CutNotFail 3 - 3 reasons to use cut 1 Confirming the choice of a rule if you get to here you have picked the correct rule for this goal Don't try

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
3 reasons to use cut ! 1. Confirming the choice of a rule “if you get to here, you have picked the correct rule for this goal.” Don't try any other! 2. The cut-fail combination “if you get to here, you should stop trying to satisfy this goal.” Return false. 3. Terminating generation of multiple solutions “If you get to here, you have found the only solution to this problem.” Don’t try to find alternatives. York University- CSE 3401- V. Movahedi 11 07_CutNotFail
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Notes The cut always has only one meaning to Prolog Instruction about where to and not to backtrack The 3 mentioned, are just to make it easy to apply cut. foo:- a, b, c, !, d, e, f. Can backtrack among goals a,b, c Success of c causes the “fence” to be crossed Can backtrack among d, e, f If d fails, no attempt to re-satisfy c, foo will also fail. York University- CSE 3401- V. Movahedi 12 07_CutNotFail
Background image of page 2
Confirming the choice of a rule Example: sum_to(1,1):- ! . sum_to(N, R):-
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/14/2012 for the course CSE 3401 taught by Professor Movahedi during the Fall '11 term at York University.

Page1 / 5

CutNotFail 3 - 3 reasons to use cut 1 Confirming the choice of a rule if you get to here you have picked the correct rule for this goal Don't try

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online