Christian Collberg
Department of Computer Science
University of Arizona
The cut (!) is is ued to affect Prolog's backtracking. It can be used to
The cut succeeds and commits Prolog to all the choices made since the parent goal was called.
Cut does two things:
Produce an ordered list of integers from two ordered lists of integers.
1#1
2#2
4#4
Find the intersection of two lists A & B, i.e. all elements of A which are also in B.
5#5
6#6
7#7
First clause indexing will select the right clause in constant time:
First clause indexing will select the right clause in linear time:
11#11
Red cuts prune away logical solutions. A clause with a red cut has no logical reading.
12#12
14#14
15#15
How should we handle negative information?
Open World Assumption:
If a clause P is not currently asserted then P is neither true nor false.
Closed World Assumption:
If a clause P is not currently asserted then the negation of P is currently asserted.
17#17
Open World Assumption:
Dahlin, Thern, and Andersson are strikers, but there may be others we don't know about.
Closed World Assumption:
X is a striker if and only if X is one of Dahlin, Thern, and Andersson.
18#18
Do the lists X & Y not have any elements in common?
21#21