hacky workaround

This commit is contained in:
Mark Thom
2018-05-28 20:07:34 -06:00
parent b49c0f5d36
commit 07ec2d34c8
6 changed files with 60 additions and 35 deletions

View File

@@ -7,6 +7,15 @@
(\==)/2, (@=<)/2, (@>=)/2, (@<)/2, (@>)/2, (=@=)/2, (\=@=)/2,
catch/3, throw/1, true/0, false/0]).
','(G1, G2) :- '$get_cp'(B), ','(G1, G2, B).
','(!, ','(G1, G2), B) :- '$set_cp'(B), ','(G1, G2, B).
','(!, !, B) :- '$set_cp'(B).
','(!, G, B) :- '$set_cp'(B), G.
','(G, ','(G2, G3), B) :- !, G, ','(G2, G3, B).
','(G, !, B) :- !, G, '$set_cp'(B).
','(G1, G2, _) :- G1, G2.
% arithmetic operators.
:- op(700, xfx, is).
:- op(500, yfx, +).
@@ -63,15 +72,6 @@ false :- '$fail'.
% control operators.
','(G1, G2) :- '$get_cp'(B), ','(G1, G2, B).
','(!, ','(G1, G2), B) :- '$set_cp'(B), ','(G1, G2, B).
','(!, !, B) :- '$set_cp'(B).
','(!, G, B) :- '$set_cp'(B), G.
','(G, ','(G2, G3), B) :- !, G, ','(G2, G3, B).
','(G, !, B) :- !, G, '$set_cp'(B).
','(G1, G2, _) :- G1, G2.
;(G1, G2) :- '$get_cp'(B), ;(G1, G2, B).
;(G1, G4, B) :- compound(G1), G1 = ->(G2, G3), (G2 -> G3 ; '$set_cp'(B), G4).