Reputation: 223
I need to create a simple Datalog machine (Which means that my input are 2 files: 1. facts , 2. rules.) I'm currently using pyDatalog package. I need to parse the facts and create terms dynamically.
from pyDatalog's tutorial I've found this example for loading facts:
load("""
ancestor(X,Y) <= parent(X,Y)
ancestor(X,Y) <= parent(X,Z) & ancestor(Z,Y)
""")
in this case I just need to parse strings from a file.
How can I dynamically load an arithmetic term? (for example: SUM(X,Y,Z)-> Z = X + Y)
Thanks!
Upvotes: 0
Views: 366