This Jekejeke Minlog module provides a subject to occurs check constraint sto/1 and a term inequality constraint dif/2. To allow good performance both constraints perform an attribute variable verification before their attribute variables are instantiated and new sub constraints are registered:Example:
?- sto(X), X = f(X).
?- dif(f(X,X), f(Y,Z)), X = Y.
Y = X,
The subject to occurs check has to be initially called with an acyclic term, but it will subsequently assure the subject to occurs check as required. The subject to occurs check is ordered so that it is always checked before some inequality constraint is checked against the same variable.
The following herbrand predicates are provided.