Cuts in a Prolog query?

I have seen lots of examples of cuts used inside Prolog predicate clauses (removes all choicepoints of that specific predicate).

For example:

 gamble(X) :- gotmoney(X),!.
 gamble(X) :- gotcredit(X), \+ gotmoney(X).

However, how do they exactly behave when put inside a prolog query? They remove ALL choicepoints so far?

  • look at some other prolog cut questions, they may give you a better idea. stackoverflow.com/a/26483422/4437190 . stackoverflow.com/q/14541164/4437190.

    – 




Leave a Comment