cut properly in first (,)/3 clause

This commit is contained in:
Mark Thom
2018-09-06 09:16:44 -03:00
parent 96ff9c0126
commit 57ddf64cba

View File

@@ -128,8 +128,9 @@ comma_errors(G1, G2, B) :- var(G1), throw(error(instantiation_error, (,)/2)).
comma_errors(G1, G2, B) :- '$call_with_default_policy'(','(G1, G2, B)).
:- non_counted_backtracking (,)/3.
','(!, CF, B) :- '$set_cp'(B), compound(CF),
','(!, CF, B) :- compound(CF),
'$call_with_default_policy'(CF =.. [',', G1, G2]),
'$set_cp'(B),
'$call_with_default_policy'(comma_errors(G1, G2, B)).
','(!, Atom, B) :- Atom == !, '$set_cp'(B).
','(!, G, B) :- '$set_cp'(B), G.