user2199630
user2199630

Reputation: 223

How to create arithmetic predicates in pyDatalog?

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!

Upvotes: 0

Views: 277

Answers (1)

Pierre Carbonnelle
Pierre Carbonnelle

Reputation: 2625

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

Upvotes: 1

Related Questions