Fixes #8572.
Certain combinations of cegqi/sygus-inst may be solution unsound when combined with E-matching, due to using skolems that have dependencies on instantiation constants are used in instantiations.
bool CandidateGenerator::isLegalCandidate( Node n ){
return d_treg.getTermDatabase()->isTermActive(n)
- && (!options::cegqi() || !quantifiers::TermUtil::hasInstConstAttr(n));
+ && !quantifiers::TermUtil::hasInstConstAttr(n);
}
CandidateGeneratorQE::CandidateGeneratorQE(QuantifiersState& qs,
//-2 : invalid, -1 : undesired, otherwise : smaller the score, the better
int32_t EqualityQuery::getRepScore(Node n, Node q, size_t index, TypeNode v_tn)
{
- if (options().quantifiers.cegqi && quantifiers::TermUtil::hasInstConstAttr(n))
+ if (quantifiers::TermUtil::hasInstConstAttr(n))
{ // reject
return -2;
}
for (size_t j = 0; j < ground_terms_count; j++)
{
Node gt = d_tdb->getTypeGroundTerm(type_node, j);
- if (!options::cegqi() || !quantifiers::TermUtil::hasInstConstAttr(gt))
+ if (!quantifiers::TermUtil::hasInstConstAttr(gt))
{
Node rep = d_qs.getRepresentative(gt);
if (repsFound.find(rep) == repsFound.end())
#include "theory/quantifiers/term_util.h"
#include "expr/node_algorithm.h"
+#include "expr/skolem_manager.h"
#include "theory/arith/arith_msum.h"
#include "theory/bv/theory_bv_utils.h"
#include "theory/quantifiers/term_database.h"
return n.getAttribute(InstConstantAttribute());
}
-bool TermUtil::hasInstConstAttr( Node n ) {
+bool TermUtil::hasInstConstAttr(Node n)
+{
+ n = SkolemManager::getOriginalForm(n);
return !getInstConstAttr(n).isNull();
}
static size_t getVariableNum(Node q, Node v);
static Node getInstConstAttr( Node n );
- static bool hasInstConstAttr( Node n );
+ /**
+ * Does n (or its original form) contain instantiation constants? This method
+ * is used for determining when a term is ineligible for instantiation.
+ *
+ * @param n the node to check.
+ * @return true if n has instantiation constants.
+ */
+ static bool hasInstConstAttr(Node n);
static Node getBoundVarAttr( Node n );
static bool hasBoundVarAttr( Node n );
regress1/quantifiers/issue8497-syqi-str-fmf.smt2
regress1/quantifiers/issue8517-exp-exp.smt2
regress1/quantifiers/issue8520-cegqi-nl-cov.smt2
+ regress1/quantifiers/issue8572-sygus-inst-ic-purify.smt2
regress1/quantifiers/issue993.smt2
regress1/quantifiers/javafe.ast.StmtVec.009.smt2
regress1/quantifiers/lia-witness-div-pp.smt2
--- /dev/null
+; COMMAND-LINE: --strings-exp --sygus-inst
+; EXPECT: unsat
+(set-logic ALL)
+(assert (forall ((e String)) (= 0 (ite (str.contains (str.substr e 0 (- (str.len e) 1)) "/") 1 0))))
+(check-sat)