Reputation: 2319
In Prolog using the cut. Why is the effect of the following query to return the following:
?- !,false.
no
yet this query returns the following:
?- !;false.
yes
Upvotes: 1
Views: 203
Reputation: 58
The first query performs an AND on ! (which always returns yes) and false, which always returns no. yes AND no = no.
In the second query, the ! commits execution to the first branch, that is, !, which always returns yes.
Upvotes: 2