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/theory/quantifiers/quantifiers_rewriter.h | |
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/theory/quantifiers/quantifiers_rewriter.h')
-rw-r--r-- | src/theory/quantifiers/quantifiers_rewriter.h | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/theory/quantifiers/quantifiers_rewriter.h b/src/theory/quantifiers/quantifiers_rewriter.h index 1ceab7fc0..93f2c5dba 100644 --- a/src/theory/quantifiers/quantifiers_rewriter.h +++ b/src/theory/quantifiers/quantifiers_rewriter.h @@ -248,8 +248,8 @@ class QuantifiersRewriter : public TheoryRewriter */ static Node computePrenex(Node q, Node body, - std::vector<Node>& args, - std::vector<Node>& nargs, + std::unordered_set<Node, NodeHashFunction>& args, + std::unordered_set<Node, NodeHashFunction>& nargs, bool pol, bool prenexAgg); /** @@ -289,9 +289,16 @@ public: * The result is wrapped in a trust node of kind TrustNodeKind::REWRITE. */ static TrustNode preprocess(Node n, bool isInst = false); - static Node mkForAll( std::vector< Node >& args, Node body, QAttributes& qa ); - static Node mkForall( std::vector< Node >& args, Node body, bool marked = false ); - static Node mkForall( std::vector< Node >& args, Node body, std::vector< Node >& iplc, bool marked = false ); + static Node mkForAll(const std::vector<Node>& args, + Node body, + QAttributes& qa); + static Node mkForall(const std::vector<Node>& args, + Node body, + bool marked = false); + static Node mkForall(const std::vector<Node>& args, + Node body, + std::vector<Node>& iplc, + bool marked = false); }; /* class QuantifiersRewriter */ }/* CVC4::theory::quantifiers namespace */ @@ -299,5 +306,3 @@ public: }/* CVC4 namespace */ #endif /* CVC4__THEORY__QUANTIFIERS__QUANTIFIERS_REWRITER_H */ - - |