I am trying to write a program that generates new runtime restrictions in SWI-Prolog. is_true([A,means,B])designed to create another run-time constraint:
:- use_module(library(chr)).
:- chr_constraint is_true/1.
is_true([A,means,B]) ==> (is_true(A) ==> is_true(B),writeln('asserted')).
is_true([[A,is,true],means,[A,is,not,false]]).
is_true([something,is,true]).
But when I print these requests, the restriction is_trueseems to have no effect. is_true([something, is, not, false])does not return true:
?- is_true([something,is,true]).
true .
?- is_true([something,is,not,false]).
is_true([something, is, not, false]).
Closing a constraint in the console does not seem to have any effect:
?- asserta(is_true(A>B)==>(is_true(B<A),writeln("asserted"))).
true.
?- is_true(4>3).
is_true(4>3).
Is there any other way to define new runtime CHR restrictions?