next up previous contents
Next: Nested rule groups Up: Predicates in rules Previous: Equality tests

Failure predicates

This section is not correct because failure predicates must be connected to conditions! Otherwise they only work together with target predicates.

Similar to Gentle and Puma in a rule may fail. However, not only rule tests, but also path tests and complete rule groups can be terminated voluntarily.
\begin{verbsyntax}\synrule{FailStatement}{'FAIL' 'PATH' }
\syncont{\vert 'FAIL'...
...E'' }
\lastcont{\vert 'FAIL' 'STRATUM' }
\onerule{Cut}{'CUT'}
\end{verbsyntax}

Rule tests consist of the enumeration of several paths (single source path problems) and their joins. The FAIL RULE statement says that should stop the evaluation of the current rule, skipping all evaluations of other paths. The FAIL STRATUM statement ends the evaluation of the current rule group. The FAIL PATH statement says that should stop the enumeration of the current path and continue at the place of the last cut statement in the path. Similar to Prolog, Cut statements can be placed behind normal predicates. A cut statement catches a FAIL PATH statement in a path of a rule evaluation. A cut statement is always generated after the last rule test predicate (as target predicates). A cut can be used to skip all objects in a path which are reachable from an instance of a node within the path expression. Thus, by setting an appropriate cut the user can shortcut the evaluation of a path.

FAIL RULE and FAIL STRATUM statements cannot be caught.


\begin{examplefoot}SpecialBlocks(b,b1) :-
BlockGraph(b,b1),
b ~ Block { numb...
..., skip the path
Stmts(b1, s),
s ~ Statement ,
FAIL PATH
;
\end{examplefoot}


next up previous contents
Next: Nested rule groups Up: Predicates in rules Previous: Equality tests
Uwe Assmann
1998-12-22