module type SYMBOL_TYPE = sig
.. end
The output signature of Symbols.Make
.
include X.X_TYPE
The following list summarizes the function in
X.X_TYPE
.
- The type of symbol element is
E|U|S(x)
where x=X.x
.
name
is the string "Symbol("^X.name^")"
.
compare
is the same as Pervasives.compare
.
pair s1 s2
unifies the symbols. If s1=S(x1)
and s2=S(x2)
then
unification occurs only if x1
and x2
are compatible in which case
unification yields S(X.pair x1 x2)
.
of_string
returns a symbol from a string representation.
The string "<E>"
denotes the empty symbol.
The string "<U>"
denotes the universal symbol.
Otherwise the string x
denotes an element of type X.t
and
S(X.of_string x)
is returned. If x
is the empty, i.e. ""
a
failure is raised.
to_string
returns a string representation of the symbol.
print
prints the symbol followed by an endline.
print_
prints the symbol followed but no endline.
val are_unifiable : t -> t -> bool
Two symbols are unifiable iff one of them is universal, they are both
empty, or they are compatible x
types.
val conform : t -> t -> t
If s1
and s2
are symbols of type x
then conform s1 s2
returns
the value of conform
for the elements as defined by the module of type
SYMBOL_SEED
. Otherwise it returns s2
.
type
x
The type of X.
val of_x : x -> t
Returns a symbol given x
.
val to_x : t -> x
Returns an element of type x
given a symbol. Raises a failure if the
symbol is the the empty symbol <E>
or the universal symbol <U>
.
val blank : t
The empty symbol.
val wild : t
The universal symbol.