Defining CHR constraints at runtime
问题 I'm trying to write a program that generates new constraints at runtime in SWI-Prolog. is_true([A,means,B]) is intended to generate another constraint at runtime: :- 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 type these queries, the is_true constraint seems to have no effect. is_true([something, is, not, false]) does not