From da165b9cbee366d4e77716617f2e2c794da9bd46 Mon Sep 17 00:00:00 2001 From: Andrew Reynolds Date: Thu, 28 May 2020 15:05:06 -0500 Subject: Fix term registry for constant case, simplify. (#4538) We were getting an assertion failure (causing nightlies to fail) due to the recent optimization to the strings skolem cache (978f455). This ensures we ignore constant strings in TermRegistry::getRegisterTermAtomicLemma. It also removes a deprecated option that is deleted in the proof-new branch. --- src/theory/strings/term_registry.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/theory') diff --git a/src/theory/strings/term_registry.cpp b/src/theory/strings/term_registry.cpp index ec034b0c9..6330d7c10 100644 --- a/src/theory/strings/term_registry.cpp +++ b/src/theory/strings/term_registry.cpp @@ -374,6 +374,13 @@ Node TermRegistry::getRegisterTermAtomicLemma(Node n, LengthStatus s, std::map& reqPhase) { + if (n.isConst()) + { + // No need to send length for constant terms. This case may be triggered + // for cases where the skolem cache automatically replaces a skolem by + // a constant. + return Node::null(); + } Assert(n.getType().isStringLike()); NodeManager* nm = NodeManager::currentNM(); Node n_len = nm->mkNode(kind::STRING_LENGTH, n); @@ -433,14 +440,6 @@ Node TermRegistry::getRegisterTermAtomicLemma(Node n, Assert(false); } - // additionally add len( x ) >= 0 ? - if (options::stringLenGeqZ()) - { - Node n_len_geq = nm->mkNode(kind::GEQ, n_len, d_zero); - n_len_geq = Rewriter::rewrite(n_len_geq); - lems.push_back(n_len_geq); - } - if (lems.empty()) { return Node::null(); -- cgit v1.2.3