Next Prev Up Top Contents Index

cut

Backward Chaining Goal
Syntax

cut

Arguments

None.

Description

cut is a standard prolog predicate. When first called it succeeds and freezes certain choices made by the backward chainer up to this point. It may no longer attempt to resatisfy any of the goals between the start of clause and the cut , and it may not attempt to use any other clauses to satisfy the same goal.

Examples
(defrule nice :backward
  ((nice ?x)
   <--
   (rottweiler ?x)
   (cut)
   (fail))
  ((nice ?x) <--))

implements "everything is nice unless it is a rottweiler". First the backward chainer will attempt to prove (nice fido) with the first clause. If fido is a rottweiler the cut then prevents the backward chainer from using the second clause which says "everything is nice". The fail ensures that (nice fido) fails.


LispWorks KnowledgeWorks and Prolog User Guide - 14 Dec 2001

Next Prev Up Top Contents Index