%%%[(1,[(a,0),(b,0)])]
%%% 'ASP_to_CHR'([(a:-b),(b:-a,c),(b:-d)],'test_32',all_answer_sets,'no_data')
:- use_module(library(chr)).
:- chr_constraint success/0, failure/0, supported_1/0, supported_2/0, supported_3/0, launcher/0, next_it/1, cfc/1, clean_result/0, d/0, c/0, a/0, b/0.
success <=> true.
failure <=> fail.
a # passive \ a <=> true.
b # passive \ b <=> true.



%% b:-d
propagate_1 @ d==>
   b.

%% b:-a,c
supported_2 @ c,a==>
   true | 
   supported_2.
unuseful_2 @ b \ supported_2<=>
   success.
propagate_2 @ supported_2<=>
   b.

%% a:-b
propagate_3 @ b==>
   a.





success @ next_it(_Profondeur) <=> clean_result, chr_show_store(user),  write("--"), nl, fail.

launcher <=>    next_it(0).

clean_result <=> true.




