Porting the "Worst Datalog" to Python

I really enjoyed the two posts by Christophe Grand about Datalog, Writing the Worst Datalog Ever in 26loc and Half Dumb Datalog in 30 loc (even more than the first one), so I ended up porting them to Python. There's a bunch of differences to the Clojure versions: they are roughly twice as long use generators and thus have to environment threading somewhat differently a custom class for variables…