[logo] Built-in Predicates and Functions

>>Built-in Predicates

Unification

X = Y   <Unify>

Unifies X and Y under the synchronizaion rules of GHC.

[Where]

Guard and body

X \= Y   <Non-Unify>

Succeeds when it is found that X and Y are not unifiable.

[Where]

Guard

X := Exp   <Assign>

Unifies X and the evaluated value of Exp.

[Where]

Guard and body

Comparison

Exp1 =:= Exp2   <Equal>

Unifies the evaluated value of Exp1 and the evaluated value of Exp2.

[Where]

Guard

Exp1 =\= Exp2   <Not-Equal>

Succeeds when it is found that the evaluated value of Exp1 and the evaluated value of Exp2 are not unifiable.

[Where]

Guard

Exp1 < Exp2   <Less>

Succeeds when the evaluated value of Exp1 is less than the evaluated value of Exp2.

[Where]

Guard

Exp1 =< Exp2   <Less or Equal>

Succeeds when the evaluated value of Exp1 is less than or equal to the evaluated value of Exp2.

[Where]

Guard

Exp1 > Exp2   <Greater>

Succeeds when the evaluated value of Exp1 is greater than the evaluated value of Exp2.

[Where]

Guard

Exp1 >= Exp2   <Greater or Equal>

Succeeds when the evaluated value of Exp1 is greater than or equal to the evaluated value of Exp2.

[Where]

Guard

Logic

true   <True>

Always succeeds.

[Where]

Guard and body

otherwise   <Last Alternative>

Succeeds when the guards of all other clauses fails for the same predicate.

[Where]

Guard

wait(X)   <Waiting for Instantiation>

Succeeds when X is instantiated.

[Where]

Guard

>>Built-in Functions

Arithmetic

X + Y   <Add>

Returns X plus Y.

If either X or Y is a character string, returns the concatenated string.

[Where]

Guard and body

X - Y   <Subtract>

Returns X minus Y.

[Where]

Guard and body

X * Y   <Multiply>

Returns X multiplied by Y.

[Where]

Guard and body

X / Y   <Divide>

Returns X divided by Y.

[Where]

Guard and body

X mod Y   <Remainder>

Returns the remainder of X divided by Y.

Both X and Y need to be integers.

[Where]

Guard and body