BAP Online Manuals : Library Reference : Library by Name : ! (cut)
Previous: Library by Name
Next: =

6.2.1. ! (cut)

affects backtracking

SYNOPSIS

!

SYNTAX

!

ARGUMENTS

(none)

DESCRIPTION

This is a standard prolog built-in. If a execution within a clause encounters a cut, the system commits to all choices made since entering the parent goal. This means that no other clauses of the predicate will be evaluated, and either this clause suceeds or the entire predicate call fails.
The ! succeeds once and causes the parent goal to fail if encountered during backtracking.
The !,fail combination is often used to indicate final failure of a predicate goal.

EXAMPLE

repeat,
	read(X),
	write(X),nl,
X=ende,
!,fail.

ERRORS

Always succeeds. No runtime errors.

LAYERS

prolog-process, client-server, object

RELATED PREDICATES

set_cut , cut , getbacktrack , cutbacktrack


BAP Online Manuals : Library Reference : Library by Name : ! (cut)
Previous: Library by Name
Next: =