Runtime predicates for call on determinate
Author(s): Jose F. Morales, Manuel Carro.
Implementation of variant of call and cut which executes pending goals when the computation has no more alternatives.
Usage and interface
- Library usage:
:- use_module(library(det_hook_rt)). - Exports:
- Predicates:
det_try/3.
- Predicates:
- Imports:
- Packages:
prelude, nonpure, assertions, isomodes.
- Packages:
Documentation on exports
PREDICATE
Usage:det_try(Goal,OnCut,OnFail)
Action is called, and OnCut and OnFail are goals to be executed when Goal is cut or when it finitely fails, respectively. In order for this to work, cutting must be performed in a special way, by using the !!/0 predicate, also provided by this module.
- 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.
(basic_props:callable/1)OnCut is a term which represents a goal, i.e., an atom or a structure.
(basic_props:callable/1)OnFail is a term which represents a goal, i.e., an atom or a structure.