negation works

parent d9f271ae
......@@ -1556,10 +1556,9 @@ constant = #(nlocals nstack constants code)
;; [.z.]
(LABEL post-negation)
(PRSTACK sp fp)
(<let> ((SCM np (<ref> inst-pt (<c> 0)))
(int out (scm->int (<ref> inst-pt (<c> 1)))))
(<=> cut (<ref> inst-pt (<c> 2)))
(<=> inst-pt (<+> inst-pt (<c> 3)))
(<let> ((SCM np (<ref> inst-pt (<c> 0))))
(<=> cut (<ref> inst-pt (<c> 1)))
(<=> inst-pt (<+> inst-pt (<c> 2)))
(RESTORE-STATE-TAIL s p np ctrl-stack)
(<let> ((int n (scm->int (<call> gp_gp_lookup *gp-not-n* s)))
(SCM d (<call> gp_gp_lookup *gp-is-delayed?* s)))
......@@ -1570,9 +1569,7 @@ constant = #(nlocals nstack constants code)
(<call> gp_fluid_force_bang
*gp-is-delayed?* (<scm> #t) s)
(BACKTRACK p instructions inst-pt fp sp))
(<begin>
(<=> inst-pt (<+> instructions out))
(NEXT inst-pt)))))
(NEXT inst-pt))))
;; We will
(LABEL unwind-tail)
......@@ -1604,8 +1601,7 @@ constant = #(nlocals nstack constants code)
(LABEL unwind-negation)
(PRSTACK sp fp)
(<let> ((SCM n (<*> inst-pt)))
(<=> cut (<ref> inst-pt (<c> 1)))
(<=> inst-pt (<+> inst-pt (<c> 2)))
(<=> cut (<ref> inst-pt (<c> 1)))
(RESTORE-STATE-TAIL s p n ctrl-stack)
(UNWIND-TAIL s)
(<call> gp_fluid_force_bang *gp-is-delayed?* (<scm> #f) s)
......
......@@ -253,7 +253,7 @@ compile_goal(\\+X,Tail,V,[L,LL]) :- !,
label(Al),label(Bl),
(A=[[0|_]|_] -> Tp is 0 ; Tp is 1),
L = [ [Newframe,Al,Tp] |LX ],
LLX = [ [Unwind,Al,Bl,C0],[label,Al],[Post,Al,C0],[label,Bl] | LLL]
LLX = [ [Unwind,Al,C0],[label,Al],[Post,Al,C0] | LLL]
)).
......
......@@ -37,15 +37,12 @@ handle((X,[('goto-inst';'store-state';'unwind-tail';softie),N]),
II is I + 2,
L=[X|LL].
handle((X,[(newframe;'newframe-negation';'post-negation';'unwind'),A,B]),
handle((X,[(newframe;'newframe-negation';'post-negation'
;'unwind' ;'unwind-negation'),A,B]),
I,II,L,LL) :- !,
II is I + 3,
L=[X|LL].
handle((X,['unwind-negation',A,B,C]),I,II,L,LL) :- !,
II is I + 4,
L = [X|LL].
handle([label,N,[_,Tags]],I,II,L,LL) :- !,
N=I,
addvs(Tags,I,II,L,LL).
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment