From 846189ff975b206326edc1540578c3f8df72138c Mon Sep 17 00:00:00 2001 From: Andrew Reynolds Date: Fri, 3 Jun 2022 15:02:16 -0500 Subject: [PATCH] Fix check for whether a term contains an uninterpreted constant (#8845) Fixes #8842. We now say "unknown" for the benchmark on that issue. --- src/theory/quantifiers/term_util.cpp | 48 ++++++++++++++++++---------- 1 file changed, 32 insertions(+), 16 deletions(-) diff --git a/src/theory/quantifiers/term_util.cpp b/src/theory/quantifiers/term_util.cpp index 4df5d26df..342732965 100644 --- a/src/theory/quantifiers/term_util.cpp +++ b/src/theory/quantifiers/term_util.cpp @@ -15,6 +15,8 @@ #include "theory/quantifiers/term_util.h" +#include "expr/array_store_all.h" +#include "expr/function_array_const.h" #include "expr/node_algorithm.h" #include "expr/skolem_manager.h" #include "theory/arith/arith_msum.h" @@ -215,26 +217,40 @@ int TermUtil::getTermDepth( Node n ) { } bool TermUtil::containsUninterpretedConstant( Node n ) { - if (!n.hasAttribute(ContainsUConstAttribute()) ){ - bool ret = false; - if (n.getKind() == UNINTERPRETED_SORT_VALUE - && n.getType().isUninterpretedSort()) - { - ret = true; - } - else + if (n.hasAttribute(ContainsUConstAttribute())) + { + return n.getAttribute(ContainsUConstAttribute()) != 0; + } + bool ret = false; + Kind k = n.getKind(); + if (k == UNINTERPRETED_SORT_VALUE) + { + Assert(n.getType().isUninterpretedSort()); + ret = true; + } + else if (k == STORE_ALL) + { + ret = containsUninterpretedConstant(n.getConst().getValue()); + } + else if (k == FUNCTION_ARRAY_CONST) + { + ret = containsUninterpretedConstant( + n.getConst().getArrayValue()); + } + else + { + for (const Node& nc : n) { - for( unsigned i=0; i