fix bugs in corout (onbs from David Powers).wq
This commit is contained in:
parent
52a4680ac7
commit
13130df3d9
@ -60,15 +60,20 @@ attgoal_for_delay(redo_dif(Done, X, Y), V) -->
|
|||||||
[prolog:dif(X,Y)].
|
[prolog:dif(X,Y)].
|
||||||
attgoal_for_delay(redo_freeze(Done, V, Goal), V) -->
|
attgoal_for_delay(redo_freeze(Done, V, Goal), V) -->
|
||||||
{ var(Done) }, !,
|
{ var(Done) }, !,
|
||||||
[prolog:freeze(V,Goal)].
|
{ remove_when_declarations(Goal, NoWGoal) },
|
||||||
|
[ prolog:freeze(V,NoWGoal) ].
|
||||||
attgoal_for_delay(redo_eq(Done, X, Y, Goal), V) -->
|
attgoal_for_delay(redo_eq(Done, X, Y, Goal), V) -->
|
||||||
{ var(Done), first_att(Goal, V) }, !,
|
{ var(Done), first_att(Goal, V) }, !,
|
||||||
[prolog:when(X=Y,Goal)].
|
[ prolog:when(X=Y,Goal) ].
|
||||||
attgoal_for_delay(redo_ground(Done, X, Goal), V) -->
|
attgoal_for_delay(redo_ground(Done, X, Goal), V) -->
|
||||||
{ var(Done) }, !,
|
{ var(Done) }, !,
|
||||||
[prolog:when(ground(X),Goal)].
|
[ prolog:when(ground(X),Goal) ].
|
||||||
attgoal_for_delay(_, V) --> [].
|
attgoal_for_delay(_, V) --> [].
|
||||||
|
|
||||||
|
remove_when_declarations(when(Cond,Goal,_), when(Cond,NoWGoal)) :- !,
|
||||||
|
remove_when_declarations(Goal, NoWGoal).
|
||||||
|
remove_when_declarations(Goal, Goal).
|
||||||
|
|
||||||
%
|
%
|
||||||
% operators defined in this module:
|
% operators defined in this module:
|
||||||
%
|
%
|
||||||
@ -215,7 +220,7 @@ prolog:when(_,Goal) :-
|
|||||||
|
|
||||||
%
|
%
|
||||||
% support for when/2 like declaration.
|
% support for when/2 like declaration.
|
||||||
%
|
v%
|
||||||
%
|
%
|
||||||
% when will block on a conjunction or disjunction of nonvar, ground,
|
% when will block on a conjunction or disjunction of nonvar, ground,
|
||||||
% ?=, where ?= is both terms being bound together
|
% ?=, where ?= is both terms being bound together
|
||||||
@ -357,8 +362,8 @@ prolog:'$block'(Conds) :-
|
|||||||
prolog:'$block'(_).
|
prolog:'$block'(_).
|
||||||
|
|
||||||
generate_blocking_code(Conds, G, Code) :-
|
generate_blocking_code(Conds, G, Code) :-
|
||||||
'$extract_head_for_block'(Conds, G),
|
extract_head_for_block(Conds, G),
|
||||||
'$recorded'('$blocking_code','$code'(G,OldConds),R), !,
|
recorded('$blocking_code','$code'(G,OldConds),R), !,
|
||||||
erase(R),
|
erase(R),
|
||||||
functor(G, Na, Ar),
|
functor(G, Na, Ar),
|
||||||
'$current_module'(M),
|
'$current_module'(M),
|
||||||
|
Reference in New Issue
Block a user