Open jukowski opened 6 years ago
That's correct. The output should be the same as SWI-Prolog produces:
> cat test.pl
:- use_module(library(chr)).
:- chr_constraint interface/2, env/2, match/2.
interface(App1, 'i1'), interface(App2, 'i2'), env(App1, E), env(App2, E)
==> match(App1, App2).
> swipl -q test.pl
?- interface('a1', 'i1'), env('a1', 'e1'), interface('a2', 'i2'), env('a2', 'e1'), interface('a3', 'i2'), env('a3', 'e1').
interface(a3, i2),
interface(a2, i2),
interface(a1, i1),
env(a3, e1),
env(a2, e1),
env(a1, e1),
match(a1, a3),
match(a1, a2).
I will have a look at this bug. Thank you for reporting!
Consider the following CHR rule: interface(App1, "i1"), interface(App2, "i2"), env(App1, E), env(App2, E) ==> match(App1, App2)
and following test data: chr.interface("a1", "i1"),
chr.env("a1", "e1"),
chr.interface("a2", "i2"),
chr.env("a2", "e1"),
chr.interface("a3", "i2"),
chr.env("a3", "e1"),
then the engine generates the output: ID Constraint
1 interface("a1","i1") 2 env("a1","e1") 3 interface("a2","i2") 4 env("a2","e1") 5 interface("a3","i2") 6 env("a3","e1") 7 match("a1","a2") 8 match("a1","a2") 9 match("a1","a2") 10 match("a1","a3")
As far as I understand, statements 8 and 9 should not be there.