Next: List Processing, Previous: Comparison of Terms, Up: Terms [Contents][Index]
These testing predicates are used to determine various properties of the data objects, or apply constraints to the data objects.
Relations:
Succeed if Term
is a non-variable of type Type
.
type : (??top, !typeE(_)) <=
Example:
| ?? type(a, atomic). yes | ?? type(a, int). no | ?? type([a,2], [int || atom]). yes
Succeed if Term
is ground.
ground : (??top) <=
Succeed if Term
is of type Type
and Type
is a finite type.
isa : (?Term, !typeE(_)) <=
Example: For this example we assume the following type declarations.
name ::= "Alice" | "Bob" | "Carol" status ::= good(name) | bad(name)
| ?? isa(X, status). X = good("Alice") ... X = good("Bob") ... X = good("Carol") ... X = bad("Alice") ... X = bad("Bob") .. X = bad("Carol") | ?? isa(good("Bob"), status). yes | ?? isa(2, nat). no
Succeed if Term
is atomic or a compound term with a ground functor.
template :(??top) <=
Succeed if Term
is a relation or action term and that the modes
of its arguments are correct.
ground_inputs : ??(relcall || actcall) <=