From d48e117199b766a9a55eaf951d4d5ed80c9b8dc0 Mon Sep 17 00:00:00 2001 From: Mathias Preiner Date: Fri, 28 Aug 2020 17:39:44 -0700 Subject: [PATCH] New C++ API: Add REGEXP_{REPEAT,LOOP}_OP handling in getIndices. (#4969) --- src/api/cvc4cpp.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/api/cvc4cpp.cpp b/src/api/cvc4cpp.cpp index 0a35981d2..51ecea9f2 100644 --- a/src/api/cvc4cpp.cpp +++ b/src/api/cvc4cpp.cpp @@ -578,7 +578,9 @@ const static std::unordered_map {CVC4::Kind::REGEXP_OPT, REGEXP_OPT}, {CVC4::Kind::REGEXP_RANGE, REGEXP_RANGE}, {CVC4::Kind::REGEXP_REPEAT, REGEXP_REPEAT}, + {CVC4::Kind::REGEXP_REPEAT_OP, REGEXP_REPEAT}, {CVC4::Kind::REGEXP_LOOP, REGEXP_LOOP}, + {CVC4::Kind::REGEXP_LOOP_OP, REGEXP_LOOP}, {CVC4::Kind::REGEXP_EMPTY, REGEXP_EMPTY}, {CVC4::Kind::REGEXP_SIGMA, REGEXP_SIGMA}, {CVC4::Kind::REGEXP_COMPLEMENT, REGEXP_COMPLEMENT}, @@ -1321,6 +1323,9 @@ uint32_t Op::getIndices() const i = d_node->getConst().bvs.d_size; break; case TUPLE_UPDATE: i = d_node->getConst().getIndex(); break; + case REGEXP_REPEAT: + i = d_node->getConst().d_repeatAmount; + break; default: CVC4ApiExceptionStream().ostream() << "Can't get uint32_t index from" << " kind " << kindToString(k); @@ -1379,6 +1384,11 @@ std::pair Op::getIndices() const d_node->getConst(); indices = std::make_pair(ext.t.exponent(), ext.t.significand()); } + else if (k == REGEXP_LOOP) + { + CVC4::RegExpLoop ext = d_node->getConst(); + indices = std::make_pair(ext.d_loopMinOcc, ext.d_loopMaxOcc); + } else { CVC4_API_CHECK(false) << "Can't get pair indices from" -- 2.30.2