d_internal->ppStaticLearn(n, learned);
}
-bool TheoryArith::preCheck(Effort level) { return d_internal->preCheck(level); }
+bool TheoryArith::preCheck(Effort level)
+{
+ Trace("arith-check") << "TheoryArith::preCheck " << level << std::endl;
+ return d_internal->preCheck(level);
+}
void TheoryArith::postCheck(Effort level)
{
+ Trace("arith-check") << "TheoryArith::postCheck " << level << std::endl;
// check with the non-linear solver at last call
if (level == Theory::EFFORT_LAST_CALL)
{
bool TheoryArith::preNotifyFact(
TNode atom, bool pol, TNode fact, bool isPrereg, bool isInternal)
{
+ Trace("arith-check") << "TheoryArith::preNotifyFact: " << fact
+ << ", isPrereg=" << isPrereg
+ << ", isInternal=" << isInternal << std::endl;
d_internal->preNotifyFact(atom, pol, fact);
// We do not assert to the equality engine of arithmetic in the standard way,
// hence we return "true" to indicate we are finished with this fact.
ce_vars.push_back(tutil->getInstantiationConstant(q, i));
}
CegInstantiator* cinst = getInstantiator(q);
- LemmaStatus status = d_quantEngine->getOutputChannel().lemma(lem);
+ LemmaStatus status =
+ d_quantEngine->getOutputChannel().lemma(lem, LemmaProperty::PREPROCESS);
Node ppLem = status.getRewrittenLemma();
Trace("cegqi-debug") << "Counterexample lemma (post-preprocess): " << ppLem
<< std::endl;
Debug("theory") << "TheoryEngine::preRegister: " << preprocessed
<< std::endl;
Assert(!expr::hasFreeVar(preprocessed));
+ // should not have witness
+ Assert(!expr::hasSubtermKind(kind::WITNESS, preprocessed));
// Pre-register the terms in the atom
theory::TheoryIdSet theories = NodeVisitor<PreRegisterVisitor>::run(
Debug("ensureLiteral") << "rewriting: " << n << std::endl;
Node rewritten = Rewriter::rewrite(n);
Debug("ensureLiteral") << " got: " << rewritten << std::endl;
- TrustNode tp = preprocess(rewritten);
- Node preprocessed = tp.isNull() ? rewritten : tp.getNode();
+ std::vector<TrustNode> newLemmas;
+ std::vector<Node> newSkolems;
+ TrustNode tpn = d_tpp.preprocess(n, newLemmas, newSkolems, true);
+ // send lemmas corresponding to the skolems introduced by preprocessing n
+ for (const TrustNode& tnl : newLemmas)
+ {
+ lemma(tnl, LemmaProperty::NONE);
+ }
+ Node preprocessed = tpn.isNull() ? rewritten : tpn.getNode();
Debug("ensureLiteral") << "preprocessed: " << preprocessed << std::endl;
d_propEngine->ensureLiteral(preprocessed);
return preprocessed;
Node node = tlemma.getNode();
Node lemma = tlemma.getProven();
+ Assert(!expr::hasFreeVar(lemma));
+
// when proofs are enabled, we ensure the trust node has a generator by
// adding a trust step to the lazy proof maintained by this class
if (isProofEnabled())
Node getModelValue(TNode var);
/**
- * Takes a literal and returns an equivalent literal that is guaranteed to be a SAT literal
+ * Takes a literal and returns an equivalent literal that is guaranteed to be
+ * a SAT literal. This rewrites and preprocesses n, which notice may involve
+ * sending lemmas if preprocessing n involves introducing new skolems.
*/
Node ensureLiteral(TNode n);
* This function is called from the smt engine's checkModel routine.
*/
void checkTheoryAssertionsWithModel(bool hardFailure);
-
private:
IntStat d_arithSubstitutionsAdded;
};/* class TheoryEngine */
{
// In this method, all rewriting steps of node are stored in d_tpg.
- Trace("tpp-proof-debug") << "TheoryPreprocessor::preprocess: start " << node
- << ", doTheoryPreprocess=" << doTheoryPreprocess
- << std::endl;
+ Trace("tpp-debug") << "TheoryPreprocessor::preprocess: start " << node
+ << ", doTheoryPreprocess=" << doTheoryPreprocess
+ << std::endl;
// Run theory preprocessing, maybe
Node ppNode = node;
if (doTheoryPreprocess)
// in d_tpg, which maintains the fact that d_tpg can prove the rewrite.
Node retNode = rewriteWithProof(rtfNode);
- if (Trace.isOn("tpp-proof-debug"))
+ if (Trace.isOn("tpp-debug"))
{
if (node != ppNode)
{
- Trace("tpp-proof-debug")
- << "after preprocessing : " << ppNode << std::endl;
+ Trace("tpp-debug") << "after preprocessing : " << ppNode << std::endl;
}
if (rtfNode != ppNode)
{
- Trace("tpp-proof-debug") << "after rtf : " << rtfNode << std::endl;
+ Trace("tpp-debug") << "after rtf : " << rtfNode << std::endl;
}
if (retNode != rtfNode)
{
- Trace("tpp-proof-debug") << "after rewriting : " << retNode << std::endl;
+ Trace("tpp-debug") << "after rewriting : " << retNode << std::endl;
}
- Trace("tpp-proof-debug")
- << "TheoryPreprocessor::preprocess: finish" << std::endl;
+ Trace("tpp-debug") << "TheoryPreprocessor::preprocess: finish" << std::endl;
}
if (node == retNode)
{
// we wil use the sequence generator
tret = d_tspg->mkTrustRewriteSequence(cterms);
}
- tret.debugCheckClosed("tpp-proof-debug", "TheoryPreprocessor::lemma_ret");
+ tret.debugCheckClosed("tpp-debug", "TheoryPreprocessor::lemma_ret");
}
else
{
}
// now, rewrite the lemmas
- Trace("tpp-proof-debug") << "TheoryPreprocessor::preprocess: process lemmas"
- << std::endl;
+ Trace("tpp-debug") << "TheoryPreprocessor::preprocess: process lemmas"
+ << std::endl;
for (size_t i = 0, lsize = newLemmas.size(); i < lsize; ++i)
{
// get the trust node to process
TrustNode trn = newLemmas[i];
trn.debugCheckClosed(
- "tpp-proof-debug", "TheoryPreprocessor::lemma_new_initial", false);
+ "tpp-debug", "TheoryPreprocessor::lemma_new_initial", false);
Assert(trn.getKind() == TrustNodeKind::LEMMA);
Node assertion = trn.getNode();
// rewrite, which is independent of d_tpg, since additional lemmas
newLemmas[i] = TrustNode::mkTrustLemma(rewritten, d_lp.get());
}
Assert(!isProofEnabled() || newLemmas[i].getGenerator() != nullptr);
- newLemmas[i].debugCheckClosed("tpp-proof-debug",
- "TheoryPreprocessor::lemma_new");
+ newLemmas[i].debugCheckClosed("tpp-debug", "TheoryPreprocessor::lemma_new");
}
- Trace("tpp-proof-debug") << "Preprocessed: " << node << " " << retNode
- << std::endl;
+ Trace("tpp-debug") << "Preprocessed: " << node << " " << retNode << std::endl;
return tret;
}
// may rewrite the same term more than once, thus check hasRewriteStep
if (termr != term)
{
- Trace("tpp-proof-debug")
- << "TheoryPreprocessor: addRewriteStep (rewriting) " << term << " -> "
- << termr << std::endl;
+ Trace("tpp-debug") << "TheoryPreprocessor: addRewriteStep (rewriting) "
+ << term << " -> " << termr << std::endl;
// always use term context hash 0 (default)
d_tpg->addRewriteStep(term, termr, PfRule::REWRITE, {}, {term});
}
{
if (trn.getGenerator() != nullptr)
{
- Trace("tpp-proof-debug")
- << "TheoryPreprocessor: addRewriteStep (generator) " << term << " -> "
- << termr << std::endl;
- trn.debugCheckClosed("tpp-proof-debug",
+ Trace("tpp-debug") << "TheoryPreprocessor: addRewriteStep (generator) "
+ << term << " -> " << termr << std::endl;
+ trn.debugCheckClosed("tpp-debug",
"TheoryPreprocessor::preprocessWithProof");
// always use term context hash 0 (default)
d_tpg->addRewriteStep(
}
else
{
- Trace("tpp-proof-debug")
- << "TheoryPreprocessor: addRewriteStep (trusted) " << term << " -> "
- << termr << std::endl;
+ Trace("tpp-debug") << "TheoryPreprocessor: addRewriteStep (trusted) "
+ << term << " -> " << termr << std::endl;
// small step trust
d_tpg->addRewriteStep(
term, termr, PfRule::THEORY_PREPROCESS, {}, {term.eqNode(termr)});
regress1/quantifiers/issue4620-erq-witness-unsound.smt2
regress1/quantifiers/issue4685-wrewrite.smt2
regress1/quantifiers/issue5019-cegqi-i.smt2
+ regress1/quantifiers/issue5469-aext.smt2
+ regress1/quantifiers/issue5470-aext.smt2
+ regress1/quantifiers/issue5471-aext.smt2
regress1/quantifiers/issue993.smt2
regress1/quantifiers/javafe.ast.StmtVec.009.smt2
regress1/quantifiers/lia-witness-div-pp.smt2
--- /dev/null
+; COMMAND-LINE: --sygus-inst --strings-exp --no-check-models
+; EXPECT: sat
+(set-logic NIA)
+(set-option :sygus-inst true)
+(set-option :strings-exp true)
+(set-info :status sat)
+(declare-fun d () Int)
+(assert (forall ((g Int)) (or (> 1 g) (> g (div 1 d)))))
+(assert (not (= d 0)))
+(check-sat)
--- /dev/null
+(set-logic NIA)
+(set-option :strings-exp true)
+(set-info :status sat)
+(declare-fun b () Int)
+(assert (exists ((c Int)) (< 0 c (div 0 b))))
+(check-sat)
--- /dev/null
+(set-logic NRA)
+(set-option :sygus-inst true)
+(set-option :strings-exp true)
+(set-info :status unsat)
+(declare-fun a () Real)
+(declare-fun b () Real)
+(declare-fun c () Real)
+(assert (forall ((d Real)) (= (> d 0) (<= (+ d (/ a c)) 0))))
+(assert (<= (* b b) 0))
+(check-sat)