Closed jfh1911 closed 3 years ago
We can currently not influence the solver-specific (internal) renaming of symbols in quantified expressions. Thus, having a mapping or reverting the renaming is currently not possible and not supported.
Overall, quantifier support is not available in all solvers, and thus, we try to avoid it in user applications, for example by using SSA-indices (not part of JavaSMT, but in the user application).
For the given case from above, I can not see a direct reason for using quantifiers.
Instead of using assert(forall(symbols, query))
you might also use assert(not(query))
, i.e. without further quantification.
Thinking about it: the negation should also negate the result... Please check this again!
Thanks for the answer :-)
Hey,
i have another question:
I am traversing a quantified expression with JavaSMT and Z3 as solver, like:
Within the method
visitQuantifier(BooleanFormula f, Quantifier q, List<Formula> boundVariables, BooleanFormula body)
the variablesn1
x2
y3
$uint4
are replaced by "fresh" bounded variables:var 0
to:var 3
in the formulabody
. (which makes sense)Is it possible to get the body of a quantified expression as it is (so without the replacements)?
I tried this using the fmgr.substitute, but got stuck at another problem:
Is there any way to get a mapping between
n1
and:var 0
?I tried tu use the deBruijnIdx when traversing a bounded variable, but this does not work, as (as far as i guess) the ordering in which the variables are replaced is not always from left to right. If I remove
$uint4
and all assignments, the deBruijn Index changes.A minimal example showing both cases is attached below:
(Additional remark: I also created the formulae using the manager, got the same result: