Question

Is there a way to make z3 solver emit "symbolic" solutions? For example, for equation:

1+x=c

the solution is x=c-1, but z3 always emits a specific model, like [c = 0, x = -1]. How to "define" c as a symbolic variable?

Was it helpful?

Solution

Unfortunately, Z3 does not expose this kind of functionality. Although we use solvers internally, they are not exposed in the API. In future versions, we want to expose internal components such as: solver, Grobner bases procedures, etc. In the current version, we have a tactic called solve-eqs (see http://rise4fun.com/Z3Py/tutorial/strategies). It eliminates variables using a generalization of Gaussian elimination. However, this is a preprocessing step, and you do not have any control over which variables are eliminated.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top