Moved IteHandler into the preprocessing pipeline#858
Moved IteHandler into the preprocessing pipeline#858Tomaqa wants to merge 8 commits intopreprocess-countersfrom
IteHandler into the preprocessing pipeline#858Conversation
3284d3b to
76953cc
Compare
76953cc to
c5bc8ba
Compare
blishko
left a comment
There was a problem hiding this comment.
Seems good, but I am not sure I fully understand the underlying problem.
There should be some very minimal example to reproduce the problem, no?
Can we find it and use it as the regression test, instead of these large files?
It would also help me to understand the problem properly.
ITEHandler has always been a bit of a hack.
Wouldn't it help if we resolved the TODO associated with its usage, and incorporate the ite processing to the preprocessing pipeline?
c5bc8ba to
6596c52
Compare
Are you referring to the comment at I am not too familiar with how the overall preprocessing and substitutions work. But I assume that in general, the top-level asserted I am not sure how this concept changes with incorporating or not incorporating ITEs into the preprocessing pipeline. |
I identified some very small examples and added them. I believe that the problem appears when the top-level assertion is an ITE. I will also try to make some similar unit tests. |
6596c52 to
9d7a2bc
Compare
|
I also included unit tests. As a consequence, I also added to possibility to retrieve the names from Even with the fix, we correctly handle the unsat cores such that the names are kept, but not the terms themselves. See e.g. |
|
My current feeling is that the transformation of internal terms to the original should already happen inside of I am not sure if this is always the desired behavior, or if it should be optional - a parameter in |
|
I checked that the current fix resolves all the issues reported in #857 regarding the named terms, including minimal cores, except the cases reported in #859 where the issue is probably not related to the one discussed here. However, the issue with not identifying the original |
e21f02f to
08eb18e
Compare
9d7a2bc to
9e2516f
Compare
9e2516f to
741459e
Compare
I moved the use of the |
|
(#859 seems to remain unresolved - but it can be caused by something completely different.) |
TermNamesIteHandler into the preprocessing pipeline
|
Can you split this PR? |
I do not see the benefit here. |
741459e to
fc07b9c
Compare
|
I would like to keep the order of having the tests first and the patch later. |
blishko
left a comment
There was a problem hiding this comment.
I have to refresh my memory why IteHandler needs a number.
I am not sure about the simplifiedFormulasCount.
What I don't quite like is that now, the same original formula can be preprocessed with IteHandler multiple times.
I am afraid this could lead to some performance regression in incremental solving.
src/api/MainSolver.cc
Outdated
| vec<PTRef> frameFormulas; | ||
| for (PTRef fla : frames[i].formulas) { | ||
| fla = IteHandler(logic, simplifiedFormulasCount++).rewrite(fla); | ||
| frameFormulas.push(fla); | ||
| } | ||
|
|
||
| PTRef frameFormula = logic.mkAnd(std::move(frameFormulas)); |
There was a problem hiding this comment.
Why not apply IteHandler once on the conjunction?
Wouldn't that be better?
There was a problem hiding this comment.
I have not realized that it works recursively. Yes, it's better!
There was a problem hiding this comment.
Do we need this file in tests?
One, the core issue should be caught by the smaller tests, no?
Two, this one seems brittle, if the minimal unsat core is just smtcomp43 it seems weird to assert that OpenSMT will always find the unsat core consisting of
(
smtcomp14
smtcomp21
smtcomp43
)
There was a problem hiding this comment.
Yes, I can remove it.
Regarding how stable the tests are, this is a general issue that applies to all unsat cores and models. Even the "minimal" (irreducible) cores can be computed differently. Every time we make a change in the solver, we may need to update the expected results, or we will have to add support for multiple possible outputs in regression tests.
The only purpose is for the name of the auxiliary '.ite' variable.
I will need to handle this more thoroughly. I think it would be best to first implement an array of counters for remembering how many formulas per assertion level have been preprocessed, to easily detect that the preprocessing has already taken place, even with arbitrary |
I moved one of the less related commits into a separate PR -> #887 |
069466c to
0425df1
Compare
223bed6 to
f492e9e
Compare
10406a3 to
a82384e
Compare
Counters implemented in #889. Now |
f492e9e to
5d64244
Compare
a82384e to
451af98
Compare
451af98 to
b1a0787
Compare
Fixes
TermNamesto also consider the mapping of internal terms to original user terms.So far, I have only identified
IteHandlerto change thePTRefof the inserted formula ininsertFormulaand at the same time store it into the assertions, so that the changedPTRefis retrieved via getting the assertions or viaPartitionaManager.Without this, the
UnsatCoreBuilderwould consider some terms to be unnamed because it would not recognize them.Resolves #857