datalog (inference from facts and rules)

datalog (inference from facts and rules) using pyDatalog (pythonic datalog extension)
from pyDatalog import pyDatalog

pyDatalog.create_terms("parent")
+ parent("xerces", "brooke")
+ parent("brooke", "damocles")

pyDatalog.create_terms("ancestor,X,Y,Z")
ancestor(X,Y) <= parent(X,Y)
ancestor(X,Y) <= parent(X,Z) & ancestor(Z,Y)

print(ancestor("xerces", X))

datalog (inference from facts and rules) using pyDatalog (pythonic datalog extension)


Commenti

Lascia un commento