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

PREDICATEsetarg/3

Usage:setarg(Index,Term,NewArg)

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.

PREDICATEundo/1

Usage:undo(Goal)

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:cgoal/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:cgoal/1)Goal is a term which represents a goal, i.e., an atom or a structure.
Meta-predicate with arguments: undo(goal).

Documentation on imports

This module has the following direct dependencies: