]> Repositorios git - scryer-prolog.git/commitdiff
Enhanced shift/1
authornotoria <[email protected]>
Thu, 7 May 2020 16:51:49 +0000 (18:51 +0200)
committernotoria <[email protected]>
Thu, 7 May 2020 17:10:21 +0000 (19:10 +0200)
src/prolog/lib/cont.pl
src/prolog/lib/tabling.pl

index 032234e6d5b8e23cada0dc8b378ebca07104d251..8dccdc5ec48c2d13f0bdf1e58c4058d4ea51dda0 100644 (file)
@@ -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),
index 153d7f47070c964c7c01e06c856148acd87164b2..8f2b79d265719bfe1116b88d9c29e8803a65f7f1 100644 (file)
@@ -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),