Skip to content

Commit

Permalink
Copy PR #420 from Scryer. Fixes triska#27
Browse files Browse the repository at this point in the history
  • Loading branch information
jeshan committed Feb 5, 2024
1 parent 0c8b93a commit 6c4f2ce
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions clpz.pl
Original file line number Diff line number Diff line change
Expand Up @@ -7375,22 +7375,26 @@

verify_attributes(Var, Other, Gs) :-
% portray_clause(Var = Other),
( get_attr(Var, clpz, clpz_attr(_,_,_,Dom,Ps,Q)) ->
( get_atts(Var, clpz(CLPZ)) ->
CLPZ = clpz_attr(_,_,_,Dom,Ps,Q),
( nonvar(Other) ->
( integer(Other) -> true
; type_error(integer, Other)
),
domain_contains(Dom, Other),
phrase(trigger_props(Ps), [Q], [_]),
Gs = [phrase(do_queue, [Q], _)]
; fd_get(Other, OD, OPs),
domains_intersection(OD, Dom, Dom1),
append_propagators(Ps, OPs, Ps1),
new_queue(Q0),
variables_same_queue([Var,Other]),
phrase((fd_put(Other,Dom1,Ps1),
trigger_props(Ps1)), [Q0], _),
; ( get_atts(Other, clpz(clpz_attr(_,_,_,OD,OPs,_))) ->
domains_intersection(OD, Dom, Dom1),
append_propagators(Ps, OPs, Ps1),
new_queue(Q0),
variables_same_queue([Var,Other]),
phrase((fd_put(Other,Dom1,Ps1),
trigger_props(Ps1)), [Q0], _),
Gs = [phrase(do_queue, [Q0], _)]
; put_atts(Other, clpz(CLPZ)),
Gs = []
)
)
; Gs = []
).
Expand Down

0 comments on commit 6c4f2ce

Please sign in to comment.