scallop-lang/scallop-lang.github.io

Incorrect computation on commit: `4618e2a`

Closed this issue · 2 comments

Hi guys,

Consider the following Scallop program:

rel b__ = { 
	(17),
	(23),
}
rel c__ = { 
	(73, 89, 49),
	(74, 74, 54),
	(73, 73, 82),
	(10, 10, 70),
	(6, 84, 19),
}
rel e__ = {
	(73),
	(16),
	(84),
}


rel c__(a, a, a) = b__(a)
rel e__(f) = c__(g, a, f), c__(b, a, a), b__(a)

query e__

When I run this program with the latest Scallop commit (4618e2a1589764d35faf83f4b5b5ae9c74fc6939), I get :

$ ./scli program.scl
e__: {(16), (17), (23), (73), (84)}

If I now add a new rule (rel c__(b, c, c) = c__(a, b, c)) for the relation c__ to get the following new program:

rel b__ = { 
	(17),
	(23),
}
rel c__ = { 
	(73, 89, 49),
	(74, 74, 54),
	(73, 73, 82),
	(10, 10, 70),
	(6, 84, 19),
}
rel e__ = {
	(73),
	(16),
	(84),
}


rel c__(a, a, a) = b__(a)
rel c__(b, c, c) = c__(a, b, c)
rel e__(f) = c__(g, a, f), c__(b, a, a), b__(a)

query e__

I get:

$ ./scli program.scl
e__: {(16), (73), (84)}

Adding this rule should not remove entries computed for relation e__.
Please let me know if you cannot reproduce this result or if I am doing something wrong :)

My Machine:

   Operating System: Debian GNU/Linux 10 (buster)  
   Kernel: Linux 5.4.188.1.amd64-smp
   Architecture: x86-64

Fixed in the latest version!

Thanks!
Adding the commit that fixed this bug for the record:
fdd074767ae909d695f558c9757e1ef05a987da6