Miscellaneous ISO Prolog predicates

Author(s): Daniel Cabeza, Jose F. Morales.

This module implements some miscellaneous ISO Prolog predicates.

Usage and interface

Documentation on exports

PREDICATEonce/1
once(G)

Finds the first solution of goal G (if any). once/1 behaves as call/1, except that no further solutions are explored on backtracking.

Usage:ISO

  • The following properties should hold at call time:
    (basic_props:cgoal/1)G is a term which represents a goal, i.e., an atom or a structure.
Meta-predicate with arguments: once(goal).

PREDICATEforall/2
forall(Generate,Test)

Test succeeds for all solutions to Generate

Usage:

  • The following properties should hold at call time:
    (basic_props:cgoal/1)Generate is a term which represents a goal, i.e., an atom or a structure.
    (basic_props:cgoal/1)Test is a term which represents a goal, i.e., an atom or a structure.
Meta-predicate with arguments: forall(goal,goal).

PREDICATEcall_det/2
call_det(G,Det)

Call goal G and unify Det with true if no additional choice-points has been created, or false otherwise

Usage:

  • Call and exit should be compatible with:
    (basic_props:atm/1)Det is an atom.
  • The following properties should hold at call time:
    (basic_props:cgoal/1)G is a term which represents a goal, i.e., an atom or a structure.
  • The following properties should hold upon exit:
    (basic_props:atm/1)Det is an atom.
Meta-predicate with arguments: call_det(goal,?).

PREDICATEcompound/1
compound(T)

T is currently instantiated to a compound term.

Usage:ISO

PREDICATEsub_atom/5
sub_atom(Atom,Before,Length,After,Sub_atom)

Is true iff atom Atom can be broken into three pieces, AtomL, Sub_atom and AtomR such that Before is the number of characters of the name of AtomL, Length is the number of characters of the name of Sub_atom and After is the number of characters of the name of AtomR

Usage:ISO

unify_with_occurs_check(X,Y)

Attempts to compute and apply a most general unifier of the two terms X and Y. Is true iff X and Y are unifiable.

Usage:ISO

Documentation on imports

This module has the following direct dependencies: