How to create arithmetic predicates in pyDatalog?

265 Views Asked by At

how do I translate this kind of arithmetic predicate to a legal pyDatalog predicate?

add(X, Y, Z) ← X + Y = Z

for example:

?add(5, 7, Z).

the answer should be: add(5, 7, 12).

Thanks!

1

There are 1 best solutions below

3
Pierre Carbonnelle On
add(X, Y, Z) <= (Z == X + Y)