2

Consider the following rules:

pyDatalog.create_atoms('X')
pyDatalog.create_atoms('Y')

pyDatalog.create_atoms('a')
pyDatalog.create_atoms('b')

b(X,1) <= (X<0)
b(X,Y) <= (X==1) & (Y>0)
a(X,Y) <= b(X,Y) & (X>0)

And the problem of finding the constraints that satisfy: a(X,1)

The question is: Can you use pyDatalog to come up with the list [(X==1)] ? or [(X>0), (X==1)]?

Thanks,

Anderson Green
  • 30,230
  • 67
  • 195
  • 328
Andres
  • 33
  • 3

1 Answers1

2

Unfortunately not, at least with the current version :-)

pyDatalog can solve discrete constraint problems, not general constraint problems like the one you describe. pyDatalog can only return values, not criteria like X>0.

Note: you can combine the first 4 statements in just one:

pyDatalog.create_atoms('X, Y, a, b')
Pierre Carbonnelle
  • 2,305
  • 19
  • 25