diff options
author | Andrew Reynolds <andrew.j.reynolds@gmail.com> | 2020-04-05 01:52:37 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-04 23:52:37 -0700 |
commit | 2e4e1d2d202ac048a2d808e907d6e6e61d002709 (patch) | |
tree | 8106f4b7b43baa4f11b69df356673fe8339288fc /src/theory/strings/theory_strings.h | |
parent | 9d571cb1156e5ed6a6ba8a261b365e7fb5f92914 (diff) |
Type-independent preregistration of empty word (#4205)
Also removes another instance of empty string in TheoryStrings for consistency sake.
Diffstat (limited to 'src/theory/strings/theory_strings.h')
-rw-r--r-- | src/theory/strings/theory_strings.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/theory/strings/theory_strings.h b/src/theory/strings/theory_strings.h index 5ae0ac7a9..84e0a0a00 100644 --- a/src/theory/strings/theory_strings.h +++ b/src/theory/strings/theory_strings.h @@ -103,6 +103,7 @@ class TheoryStrings : public Theory { typedef context::CDHashMap<Node, int, NodeHashFunction> NodeIntMap; typedef context::CDHashMap<Node, Node, NodeHashFunction> NodeNodeMap; typedef context::CDHashSet<Node, NodeHashFunction> NodeSet; + typedef context::CDHashSet<TypeNode, TypeNodeHashFunction> TypeNodeSet; public: TheoryStrings(context::Context* c, context::UserContext* u, @@ -242,6 +243,8 @@ class TheoryStrings : public Theory { // preReg cache NodeSet d_pregistered_terms_cache; NodeSet d_registered_terms_cache; + /** The types that we have preregistered */ + TypeNodeSet d_registeredTypesCache; std::vector< Node > d_empty_vec; private: @@ -350,6 +353,13 @@ private: * effort, the call to this method does nothing. */ void registerTerm(Node n, int effort); + /** Register type + * + * Ensures the theory solver is setup to handle string-like type tn. In + * particular, this includes: + * - Calling preRegisterTerm on the empty word for tn + */ + void registerType(TypeNode tn); // Symbolic Regular Expression private: |