I am interested in using z3 for solving planning problems but I am having difficulty finding examples. For instance I really want to find an example of the Sussman anomaly/blocks world in z3 but have not been able to find anything. My attempt looks like
#!/usr/bin/env python
from z3 import *
blk = DeclareSort ("Block")
On = Function ("On", blk , blk, BoolSort () )
Above = Function ("Above", blk , blk, BoolSort () )
a, b, c, x, y, z = Consts ("a b c x y z", blk )
P0 = And(On(a,b), On(b,c))
P1 = ForAll([x, y], Implies(On(x,y), Above(x,y)))
P2 = ForAll([x, y, z], Implies(And(On(x,y), Above(z, y)), Above(x,y)))
solver = Solver()
solver.add(And(P0,P1,P2))
print solver.check()
print solver.model()
but this outputs to something that looks like gibberish to me. How can I fix this? and where can I find a good resource for encoding planning problems to SAT? I have seen STRIPS formalism but it is unclear to me how to encode pre+post conditions into logic props. I would think implication but I haven't had much luck with this and it seems this technique relies on new constraints to be generated from the effects/post-conditions after the preconditions are satisfied in the model. And it appears z3 cannot do this without having the post conditions explicitly programmed.