From 47f5223c37d9999ec3f983813abec0623d307db8 Mon Sep 17 00:00:00 2001 From: notoria Date: Thu, 7 May 2020 18:51:49 +0200 Subject: [PATCH] Enhanced shift/1 --- src/prolog/lib/cont.pl | 2 +- src/prolog/lib/tabling.pl | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/prolog/lib/cont.pl b/src/prolog/lib/cont.pl index 032234e6..8dccdc5e 100644 --- a/src/prolog/lib/cont.pl +++ b/src/prolog/lib/cont.pl @@ -10,7 +10,7 @@ shift(Ball) :- '$nextEP'(first, E, P), get_chunks(E, P, L), ( L == [] -> - Cont = none + Cont = cont(true) ; Cont = cont(call_continuation(L)) ), '$write_cont_and_term'(_, _, Cont, Ball), diff --git a/src/prolog/lib/tabling.pl b/src/prolog/lib/tabling.pl index 153d7f47..8f2b79d2 100644 --- a/src/prolog/lib/tabling.pl +++ b/src/prolog/lib/tabling.pl @@ -136,18 +136,14 @@ activate(Wrapper,Worker,T) :- delim(Wrapper,Worker,Table) :- % debug(tabling, 'ACT: ~p on ~p', [Wrapper, Table]), reset(Worker,SourceCall,Continuation), - ( Continuation == none, var(SourceCall) -> + ( Continuation = none -> ( add_answer(Table,Wrapper) -> true %debug(tabling, 'ADD: ~p', [Wrapper]) ; %debug(tabling, 'DUP: ~p', [Wrapper]), fail ) ; - ( Continuation = cont(Cont) -> - true - ; Continuation = none -> - Cont = true - ), + Continuation = cont(Cont), SourceCall = call_info(_,SourceTable), TargetCall = call_info(Wrapper,Table), Dependency = dependency(SourceCall,Cont,TargetCall), -- 2.54.0