Previously we used to desugar implications and biconditionals into
equivalent CNF/DNF as soon as possible. However, this desugaring makes
debug output (Environment::dump()) less readable than it could be.
Therefore, it makes sense to keep the sugared representation of a
boolean formula, and desugar it in the solver.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/lib/Analysis/FlowSensitive/WatchedLiteralsSolver.cpp | ||
---|---|---|
332 | I wonder why this simplification is done here only for BiconditionalValue. Other operations seem to not do these sorts of simplifications. Also, when would we take this branch? getOrCreateIff has a special case when both operands are the same. |
clang/lib/Analysis/FlowSensitive/WatchedLiteralsSolver.cpp | ||
---|---|---|
332 | Oh, looking at the other patch I see it mentioning desugaring. So can desugaring also introduce Biconditionals? |
clang/lib/Analysis/FlowSensitive/WatchedLiteralsSolver.cpp | ||
---|---|---|
332 | It is also necessary in the other cases due to the precondition of addClause(), I'm adding that special handling in a separate patch: https://reviews.llvm.org/D130522 We would take this branch when someone avoids using the DataflowContext API. So not extremely likely at the moment, but it is a latent bug that can be exposed by some future refactoring. |
clang/lib/Analysis/FlowSensitive/WatchedLiteralsSolver.cpp | ||
---|---|---|
332 | I see, thanks! |
clang/include/clang/Analysis/FlowSensitive/Value.h | ||
---|---|---|
40–41 | ||
clang/lib/Analysis/FlowSensitive/DebugSupport.cpp | ||
110 | I think <=> would be more natural. | |
clang/unittests/Analysis/FlowSensitive/SolverTest.cpp | ||
201 | Let's add a label: !((X <=> Y) <=> ((X ^ Y) v (!X ^ !Y))) | |
303 | Let's add a label: !((X => Y) <=> (!X v Y)) |
clang/include/clang/Analysis/FlowSensitive/Value.h | ||
---|---|---|
40–41 | Applied. | |
clang/lib/Analysis/FlowSensitive/DebugSupport.cpp | ||
110 | Yeah, but = is what smtlib uses. | |
clang/lib/Analysis/FlowSensitive/WatchedLiteralsSolver.cpp | ||
332 | Marking done. | |
clang/unittests/Analysis/FlowSensitive/SolverTest.cpp | ||
201 | Added! | |
303 | Added! |