VocabularylogicVariable descriptionThe cut operator.
Use the cut operator to suppress backtracking.
ExamplesIn the following example, it is used to define that cats generally eat mice, but Tom does not.
USING: logic prettyprint ;
IN: scratchpad
LOGIC-PREDS: is-ao consumeso ;
LOGIC-VARS: X Y ;
SYMBOLS: Tom Jerry Nibbles
mouse cat milk cheese fresh-milk Emmentaler ;
{
{ is-ao Tom cat }
{ is-ao Jerry mouse }
{ is-ao Nibbles mouse }
{ is-ao fresh-milk milk }
{ is-ao Emmentaler cheese }
} facts
{ consumeso X milk } {
{ is-ao X mouse } ;;
{ is-ao X cat }
} rule
{ consumeso X cheese } { is-ao X mouse } rule
{ consumeso Tom mouse } { !! f } rule
{ consumeso X mouse } { is-ao X cat } rule
{ { consumeso Tom X } { is-ao Y X } } query .
{ H{ { X milk } { Y fresh-milk } } }
Definition