I wonder if we can get a list of the higher-order free variables in the Z3 formula as they were declared while making the formula.
For example, in the following code:
P1 = Bool('P1')
x, y = Ints('x y')
A1 = (x + y > 1)
A2 = (x <= 0)
f = And(Implies(P1, A1), Implies(Not(P1), A2))
Is there a way, to get {P1, A1, A2}
from f
?
Using this answer, I can get {x, y, P1}
which are not the higher order. Because in my later parts of the code, I want to get models for And(f, Not(A1))
etc.