diff options
author | Haniel Barbosa <hanielbbarbosa@gmail.com> | 2021-02-09 00:37:10 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-09 00:37:10 -0300 |
commit | d0a8c9b331022dce224c230c6b6d7edd416d5866 (patch) | |
tree | cabd0c8ac48394cec45d58833a9432318c962437 /src/expr | |
parent | 5baad1b32525ca623aaddfe557a3020edc4fe0b1 (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.cpp | 3 |
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 |