Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate Statements #45

Open
jukowski opened this issue Aug 6, 2018 · 1 comment
Open

Duplicate Statements #45

jukowski opened this issue Aug 6, 2018 · 1 comment

Comments

@jukowski
Copy link

jukowski commented Aug 6, 2018

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.

@fnogatz
Copy link
Owner

fnogatz commented Nov 24, 2018

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants