summaryrefslogtreecommitdiff
path: root/src/preprocessing
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2020-06-03 08:47:46 -0500
committerGitHub <noreply@github.com>2020-06-03 08:47:46 -0500
commit6c8702ab5eb08466bf954e202241df39de680081 (patch)
tree3feb6e0f2dc64619ce131006f479350eb8e275fd /src/preprocessing
parent0a960638857ae4682162cf19b47801bc19dd94c3 (diff)
Do not apply unconstrained simplification when quantifiers are present (#4532)
Fixes #4437. This is a simpler fix that aborts the preprocessing pass when a quantifier is encountered. It also updates our smt2 parser to throw a logic exception when forall/exists is used in non-quantified logics. This is required to ensure that unconstrained simplification does not throw an exception to a user as a result of accidentally setting the wrong logic.
Diffstat (limited to 'src/preprocessing')
-rw-r--r--src/preprocessing/passes/unconstrained_simplifier.cpp9
-rw-r--r--src/preprocessing/passes/unconstrained_simplifier.h6
2 files changed, 14 insertions, 1 deletions
diff --git a/src/preprocessing/passes/unconstrained_simplifier.cpp b/src/preprocessing/passes/unconstrained_simplifier.cpp
index 5d544ae57..b74909824 100644
--- a/src/preprocessing/passes/unconstrained_simplifier.cpp
+++ b/src/preprocessing/passes/unconstrained_simplifier.cpp
@@ -91,6 +91,15 @@ void UnconstrainedSimplifier::visitAll(TNode assertion)
d_unconstrained.insert(current);
}
}
+ else if (current.isClosure())
+ {
+ // Throw an exception. This should never happen in practice unless the
+ // user specifically enabled unconstrained simplification in an illegal
+ // logic.
+ throw LogicException(
+ "Cannot use unconstrained simplification in this logic, due to "
+ "(possibly internally introduced) quantified formula.");
+ }
else
{
for (TNode childNode : current)
diff --git a/src/preprocessing/passes/unconstrained_simplifier.h b/src/preprocessing/passes/unconstrained_simplifier.h
index ac4fd0a03..7fc13e17d 100644
--- a/src/preprocessing/passes/unconstrained_simplifier.h
+++ b/src/preprocessing/passes/unconstrained_simplifier.h
@@ -62,7 +62,11 @@ class UnconstrainedSimplifier : public PreprocessingPass
theory::SubstitutionMap d_substitutions;
const LogicInfo& d_logicInfo;
-
+ /**
+ * Visit all subterms in assertion. This method throws a LogicException if
+ * there is a subterm that is unhandled by this preprocessing pass (e.g. a
+ * quantified formula).
+ */
void visitAll(TNode assertion);
Node newUnconstrainedVar(TypeNode t, TNode var);
void processUnconstrained();
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback