--------------------------------------------------------------------------
*/
+void SmtEngine::declarePool(const Node& p, const std::vector<Node>& initValue)
+{
+ Assert(p.isVar() && p.getType().isSet());
+ finishInit();
+ QuantifiersEngine* qe = getAvailableQuantifiersEngine("declareTermPool");
+ qe->declarePool(p, initValue);
+}
+
Node SmtEngine::simplify(const Node& ex)
{
SmtScope smts(this);
/*------------------------- end of sygus commands ------------------------*/
+ /**
+ * Declare pool whose initial value is the terms in initValue. A pool is
+ * a variable of type (Set T) that is used in quantifier annotations and does
+ * not occur in constraints.
+ *
+ * @param p The pool to declare, which should be a variable of type (Set T)
+ * for some type T.
+ * @param initValue The initial value of p, which should be a vector of terms
+ * of type T.
+ */
+ void declarePool(const Node& p, const std::vector<Node>& initValue);
/**
* Simplify a formula without doing "much" work. Does not involve
* the SAT Engine in the simplification, but uses the current
#include "cvc4_private.h"
-#ifndef CVC4__THEORY__QUANTIFIERS__INST_STRATEGY_POOL_H
-#define CVC4__THEORY__QUANTIFIERS__INST_STRATEGY_POOL_H
+#ifndef CVC5__THEORY__QUANTIFIERS__INST_STRATEGY_POOL_H
+#define CVC5__THEORY__QUANTIFIERS__INST_STRATEGY_POOL_H
#include "theory/quantifiers/quant_module.h"
orig_body, q[1], maxInstLevel + 1);
}
}
+ d_treg.processInstantiation(q, terms);
Trace("inst-add-debug") << " --> Success." << std::endl;
++(d_statistics.d_instantiations);
return true;
if( q.getNumChildren()==3 ){
qa.d_ipl = q[2];
for( unsigned i=0; i<q[2].getNumChildren(); i++ ){
- Trace("quant-attr-debug") << "Check : " << q[2][i] << " " << q[2][i].getKind() << std::endl;
- if( q[2][i].getKind()==INST_PATTERN || q[2][i].getKind()==INST_NO_PATTERN ){
+ Kind k = q[2][i].getKind();
+ Trace("quant-attr-debug")
+ << "Check : " << q[2][i] << " " << k << std::endl;
+ if (k == INST_PATTERN || k == INST_NO_PATTERN)
+ {
qa.d_hasPattern = true;
- }else if( q[2][i].getKind()==INST_ATTRIBUTE ){
+ }
+ else if (k == INST_POOL || k == INST_ADD_TO_POOL
+ || k == SKOLEM_ADD_TO_POOL)
+ {
+ qa.d_hasPool = true;
+ }
+ else if (k == INST_ATTRIBUTE)
+ {
Node avar = q[2][i][0];
if( avar.getAttribute(FunDefAttribute()) ){
Trace("quant-attr") << "Attribute : function definition : " << q << std::endl;
public:
QAttributes()
: d_hasPattern(false),
+ d_hasPool(false),
d_sygus(false),
d_qinstLevel(-1),
d_quant_elim(false),
~QAttributes(){}
/** does the quantified formula have a pattern? */
bool d_hasPattern;
+ /** does the quantified formula have a pool? */
+ bool d_hasPool;
/** if non-null, this quantified formula is a function definition for function
* d_fundef_f */
Node d_fundef_f;
ProofNodeManager* pnm)
: InferenceManagerBuffered(t, state, pnm, "theory::quantifiers"),
d_instantiate(new Instantiate(state, *this, qr, tr, pnm)),
- d_skolemize(new Skolemize(state, pnm))
+ d_skolemize(new Skolemize(state, tr, pnm))
{
}
#include "options/smt_options.h"
#include "theory/quantifiers/quantifiers_attributes.h"
#include "theory/quantifiers/quantifiers_state.h"
+#include "theory/quantifiers/term_registry.h"
#include "theory/quantifiers/term_util.h"
#include "theory/rewriter.h"
#include "theory/sort_inference.h"
namespace theory {
namespace quantifiers {
-Skolemize::Skolemize(QuantifiersState& qs, ProofNodeManager* pnm)
+Skolemize::Skolemize(QuantifiersState& qs,
+ TermRegistry& tr,
+ ProofNodeManager* pnm)
: d_qstate(qs),
+ d_treg(tr),
d_skolemized(qs.getUserContext()),
d_pnm(pnm),
d_epg(pnm == nullptr ? nullptr
lem = nb;
}
d_skolemized[q] = lem;
+ // triggered when skolemizing
+ d_treg.processSkolemization(q, d_skolem_constants[q]);
return TrustNode::mkTrustLemma(lem, pg);
}
class DTypeConstructor;
namespace theory {
-
-class SortInference;
-
namespace quantifiers {
class QuantifiersState;
+class TermRegistry;
/** Skolemization utility
*
typedef context::CDHashMap<Node, Node, NodeHashFunction> NodeNodeMap;
public:
- Skolemize(QuantifiersState& qs, ProofNodeManager* pnm);
+ Skolemize(QuantifiersState& qs, TermRegistry& tr, ProofNodeManager* pnm);
~Skolemize() {}
/** skolemize quantified formula q
* If the return value ret of this function is non-null, then ret is a trust
std::vector<Node>& selfSel);
/** Reference to the quantifiers state */
QuantifiersState& d_qstate;
+ /** Reference to the term registry */
+ TermRegistry& d_treg;
/** quantified formulas that have been skolemized */
NodeNodeMap d_skolemized;
/** map from quantified formulas to the list of skolem constants */
d.initialize();
for (const Node& i : initValue)
{
+ Assert(i.getType().isComparableTo(p.getType().getSetElementType()));
d.add(i);
}
}
} // namespace quantifiers
} // namespace theory
-} // namespace CVC4
+} // namespace cvc5
} // namespace quantifiers
} // namespace theory
-} // namespace CVC5
+} // namespace cvc5
#endif /* CVC5__THEORY__QUANTIFIERS__TERM_POOLS_H */
d_util.push_back(&d_qreg);
d_util.push_back(tr.getTermDatabase());
d_util.push_back(qim.getInstantiate());
+ d_util.push_back(tr.getTermPools());
}
QuantifiersEngine::~QuantifiersEngine() {}
{
return d_qmodules->d_synth_e->getSynthSolutions(sol_map);
}
+void QuantifiersEngine::declarePool(Node p, const std::vector<Node>& initValue)
+{
+ d_treg.declarePool(p, initValue);
+}
} // namespace theory
} // namespace cvc5
* SynthConjecture::getSynthSolutions.
*/
bool getSynthSolutions(std::map<Node, std::map<Node, Node> >& sol_map);
-
+ /** Declare pool */
+ void declarePool(Node p, const std::vector<Node>& initValue);
//----------end user interface for instantiations
private: