Miscellaneous predicates

Author(s): Manuel Carro, Daniel Cabeza.

This module implements some miscellaneous non-logical (but sometimes very useful) predicates.

Usage and interface

  • Library usage:
    :- use_module(library(odd)).
  • Exports:

Documentation on exports

PREDICATE

Usage: setarg(Index,Term,NewArg)

  • Description: Replace destructively argument Index in Term by NewArg. The assignment is undone on backtracking. This is a major change to the normal behavior of data assignment in Ciao Prolog.
  • The following properties should hold at call time:
    (term_typing:integer/1)Index is currently instantiated to an integer.
    (basic_props:struct/1)Term is a compound term.
    (basic_props:term/1)NewArg is any term.

PREDICATE

Meta-predicate with arguments: undo(goal).

Usage: undo(Goal)

  • Description: call(Goal) is executed on backtracking. This is a major change to the normal control of Ciao Prolog execution.
  • The following properties should hold at call time:
    (basic_props:callable/1)Goal is a term which represents a goal, i.e., an atom or a structure.
  • The following properties should hold upon exit:
    (basic_props:callable/1)Goal is a term which represents a goal, i.e., an atom or a structure.