summaryrefslogtreecommitdiff
path: root/src/expr
diff options
context:
space:
mode:
authorHaniel Barbosa <hanielbbarbosa@gmail.com>2021-02-09 00:37:10 -0300
committerGitHub <noreply@github.com>2021-02-09 00:37:10 -0300
commitd0a8c9b331022dce224c230c6b6d7edd416d5866 (patch)
treecabd0c8ac48394cec45d58833a9432318c962437 /src/expr
parent5baad1b32525ca623aaddfe557a3020edc4fe0b1 (diff)
[quantifiers] Fix prenex computation (#5879)
Previously our prenex computation could generate quantifiers of the form forall x y y. F, which would lead to an assertion failure in getFreeVariablesScope, as it assumes that no shadowing occurs. This commit makes the prenex computation take a set rather than a vector, thus avoiding duplications of prenexed variables. It also changes mkForall to take a constant vector, since it does not modify the given vector. Fixes #5693
Diffstat (limited to 'src/expr')
-rw-r--r--src/expr/node_algorithm.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/expr/node_algorithm.cpp b/src/expr/node_algorithm.cpp
index 2439e28b6..34ebfcd59 100644
--- a/src/expr/node_algorithm.cpp
+++ b/src/expr/node_algorithm.cpp
@@ -375,7 +375,8 @@ bool getFreeVariablesScope(TNode n,
for (const TNode& cn : cur[0])
{
// should not shadow
- Assert(scope.find(cn) == scope.end());
+ Assert(scope.find(cn) == scope.end())
+ << "Shadowed variable " << cn << " in " << cur << "\n";
scope.insert(cn);
}
// must make recursive call to use separate cache
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback