The generality of this interface is unnecessary.
}
ArithEntailmentCheckParameters::ArithEntailmentCheckParameters()
- : EntailmentCheckParameters(theory::THEORY_ARITH)
- , d_algorithms()
+ : d_algorithms()
{}
ArithEntailmentCheckParameters::~ArithEntailmentCheckParameters()
return d_algorithms.end();
}
-
-// SimplexInferBoundsParameters::SimplexInferBoundsParameters()
-// : d_parameter(1)
-// , d_upperBound(true)
-// , d_threshold()
-// {}
-
-// SimplexInferBoundsParameters::~SimplexInferBoundsParameters(){}
-
-
-
-// int SimplexInferBoundsParameters::getSimplexRoundParameter() const {
-// return d_parameter;
-// }
-
-// bool SimplexInferBoundsParameters::findLowerBound() const {
-// return ! findUpperBound();
-// }
-
-// bool SimplexInferBoundsParameters::findUpperBound() const {
-// return d_upperBound;
-// }
-
-// void SimplexInferBoundsParameters::setThreshold(const DeltaRational& th){
-// d_threshold = th;
-// d_useThreshold = true;
-// }
-
-// bool SimplexInferBoundsParameters::useThreshold() const{
-// return d_useThreshold;
-// }
-
-// const DeltaRational& SimplexInferBoundsParameters::getThreshold() const{
-// return d_threshold;
-// }
-
-// SimplexInferBoundsParameters::SimplexInferBoundsParameters(int p, bool ub)
-// : d_parameter(p)
-// , d_upperBound(ub)
-// , d_useThreshold(false)
-// , d_threshold()
-// {}
-
-
InferBoundsResult::InferBoundsResult()
: d_foundBound(false)
, d_budgetExhausted(false)
d_explanation = exp;
}
-//bool InferBoundsResult::foundBound() const { return d_foundBound; }
-//bool InferBoundsResult::boundIsOptimal() const { return d_boundIsProvenOpt; }
-//bool InferBoundsResult::inconsistentState() const { return d_inconsistentState; }
-
-
void InferBoundsResult::setBudgetExhausted() { d_budgetExhausted = true; }
void InferBoundsResult::setReachedThreshold() { d_reachedThreshold = true; }
void InferBoundsResult::setIsOptimal() { d_boundIsProvenOpt = true; }
return os;
}
-
ArithEntailmentCheckSideEffects::ArithEntailmentCheckSideEffects()
- : EntailmentCheckSideEffects(theory::THEORY_ARITH)
- , d_simplexSideEffects (NULL)
+ : d_simplexSideEffects(NULL)
{}
ArithEntailmentCheckSideEffects::~ArithEntailmentCheckSideEffects(){
std::ostream& operator<<(std::ostream& os, const Algorithms a);
} /* namespace inferbounds */
-class ArithEntailmentCheckParameters : public EntailmentCheckParameters {
-private:
+class ArithEntailmentCheckParameters
+{
+ private:
typedef std::vector<inferbounds::InferBoundAlgorithm> VecInferBoundAlg;
VecInferBoundAlg d_algorithms;
std::ostream& operator<<(std::ostream& os, const InferBoundsResult& ibr);
-class ArithEntailmentCheckSideEffects : public EntailmentCheckSideEffects{
-public:
+class ArithEntailmentCheckSideEffects
+{
+ public:
ArithEntailmentCheckSideEffects();
~ArithEntailmentCheckSideEffects();
return d_internal->getModelValue( var );
}
-
-std::pair<bool, Node> TheoryArith::entailmentCheck (TNode lit,
- const EntailmentCheckParameters* params,
- EntailmentCheckSideEffects* out)
+std::pair<bool, Node> TheoryArith::entailmentCheck(TNode lit)
{
- const ArithEntailmentCheckParameters* aparams = NULL;
- if(params == NULL){
- ArithEntailmentCheckParameters* def = new ArithEntailmentCheckParameters();
- def->addLookupRowSumAlgorithms();
- aparams = def;
- }else{
- AlwaysAssert(params->getTheoryId() == getId());
- aparams = dynamic_cast<const ArithEntailmentCheckParameters*>(params);
- }
- Assert(aparams != NULL);
-
- ArithEntailmentCheckSideEffects* ase = NULL;
- if(out == NULL){
- ase = new ArithEntailmentCheckSideEffects();
- }else{
- AlwaysAssert(out->getTheoryId() == getId());
- ase = dynamic_cast<ArithEntailmentCheckSideEffects*>(out);
- }
- Assert(ase != NULL);
-
- std::pair<bool, Node> res = d_internal->entailmentCheck(lit, *aparams, *ase);
-
- if(params == NULL){
- delete aparams;
- }
- if(out == NULL){
- delete ase;
- }
-
+ ArithEntailmentCheckParameters def;
+ def.addLookupRowSumAlgorithms();
+ ArithEntailmentCheckSideEffects ase;
+ std::pair<bool, Node> res = d_internal->entailmentCheck(lit, def, ase);
return res;
}
Node getModelValue(TNode var) override;
- std::pair<bool, Node> entailmentCheck(
- TNode lit,
- const EntailmentCheckParameters* params,
- EntailmentCheckSideEffects* out) override;
+ std::pair<bool, Node> entailmentCheck(TNode lit) override;
void setProofRecorder(proof::ArithProofRecorder* proofRecorder)
{
<< " relevant terms..." << std::endl;
}
-std::pair<bool, Node> TheoryDatatypes::entailmentCheck(TNode lit, const EntailmentCheckParameters* params, EntailmentCheckSideEffects* out) {
+std::pair<bool, Node> TheoryDatatypes::entailmentCheck(TNode lit)
+{
Trace("dt-entail") << "Check entailed : " << lit << std::endl;
Node atom = lit.getKind()==NOT ? lit[0] : lit;
bool pol = lit.getKind()!=NOT;
return make_pair(true, exp);
}
}
- }else{
-
}
return make_pair(false, Node::null());
}
/** debug print */
void printModelDebug( const char* c );
/** entailment check */
- std::pair<bool, Node> entailmentCheck(
- TNode lit,
- const EntailmentCheckParameters* params = NULL,
- EntailmentCheckSideEffects* out = NULL) override;
+ std::pair<bool, Node> entailmentCheck(TNode lit) override;
private:
/** add tester to equivalence class info */
return PP_ASSERT_STATUS_UNSOLVED;
}
-std::pair<bool, Node> Theory::entailmentCheck(
- TNode lit,
- const EntailmentCheckParameters* params,
- EntailmentCheckSideEffects* out) {
+std::pair<bool, Node> Theory::entailmentCheck(TNode lit)
+{
return make_pair(false, Node::null());
}
d_extTheory = new ExtTheory(this);
}
-
-EntailmentCheckParameters::EntailmentCheckParameters(TheoryId tid)
- : d_tid(tid) {
-}
-
-EntailmentCheckParameters::~EntailmentCheckParameters(){}
-
-TheoryId EntailmentCheckParameters::getTheoryId() const {
- return d_tid;
-}
-
-EntailmentCheckSideEffects::EntailmentCheckSideEffects(TheoryId tid)
- : d_tid(tid)
-{}
-
-TheoryId EntailmentCheckSideEffects::getTheoryId() const {
- return d_tid;
-}
-
-EntailmentCheckSideEffects::~EntailmentCheckSideEffects() {
-}
-
}/* CVC4::theory namespace */
}/* CVC4 namespace */
class ExtTheory;
class TheoryRewriter;
-class EntailmentCheckParameters;
-class EntailmentCheckSideEffects;
-
namespace rrinst {
class CandidateGenerator;
}/* CVC4::theory::rrinst namespace */
*
* The theory may always return false!
*
- * The search is controlled by the parameter params. For default behavior,
- * this may be left NULL.
- *
- * Theories that want parameters extend the virtual EntailmentCheckParameters
- * class. Users ask the theory for an appropriate subclass from the theory
- * and configure that. How this is implemented is on a per theory basis.
- *
- * The search may provide additional output to guide the user of
- * this function. This output is stored in a EntailmentCheckSideEffects*
- * output parameter. The implementation of this is theory specific. For
- * no output, this is NULL.
- *
* Theories may not touch their output stream during an entailment check.
*
* @param lit a literal belonging to the theory.
- * @param params the control parameters for the entailment check.
- * @param out a theory specific output object of the entailment search.
* @return a pair <b,E> s.t. if b is true, then a formula E such that
* E |= lit in the theory.
*/
- virtual std::pair<bool, Node> entailmentCheck(
- TNode lit, const EntailmentCheckParameters* params = NULL,
- EntailmentCheckSideEffects* out = NULL);
+ virtual std::pair<bool, Node> entailmentCheck(TNode lit);
/* equality engine TODO: use? */
virtual eq::EqualityEngine* getEqualityEngine() { return NULL; }
return out;
}
-class EntailmentCheckParameters {
-private:
- TheoryId d_tid;
-protected:
- EntailmentCheckParameters(TheoryId tid);
-public:
- TheoryId getTheoryId() const;
- virtual ~EntailmentCheckParameters();
-};/* class EntailmentCheckParameters */
-
-class EntailmentCheckSideEffects {
-private:
- TheoryId d_tid;
-protected:
- EntailmentCheckSideEffects(TheoryId tid);
-public:
- TheoryId getTheoryId() const;
- virtual ~EntailmentCheckSideEffects();
-};/* class EntailmentCheckSideEffects */
-
}/* CVC4::theory namespace */
}/* CVC4 namespace */
}
}
-std::pair<bool, Node> TheoryEngine::entailmentCheck(
- options::TheoryOfMode mode,
- TNode lit,
- const EntailmentCheckParameters* params,
- EntailmentCheckSideEffects* seffects)
+std::pair<bool, Node> TheoryEngine::entailmentCheck(options::TheoryOfMode mode,
+ TNode lit)
{
TNode atom = (lit.getKind() == kind::NOT) ? lit[0] : lit;
if( atom.getKind()==kind::AND || atom.getKind()==kind::OR || atom.getKind()==kind::IMPLIES ){
if( pol==( lit.getKind()==kind::IMPLIES && i==0 ) ){
ch = atom[i].negate();
}
- std::pair<bool, Node> chres = entailmentCheck( mode, ch, params, seffects );
+ std::pair<bool, Node> chres = entailmentCheck(mode, ch);
if( chres.first ){
if( !is_conjunction ){
return chres;
if( r==1 ){
ch = ch.negate();
}
- std::pair<bool, Node> chres = entailmentCheck( mode, ch, params, seffects );
+ std::pair<bool, Node> chres = entailmentCheck(mode, ch);
if( chres.first ){
Node ch2 = atom[ atom.getKind()==kind::ITE ? r+1 : 1 ];
if( pol==( atom.getKind()==kind::ITE ? true : r==1 ) ){
ch2 = ch2.negate();
}
- std::pair<bool, Node> chres2 = entailmentCheck( mode, ch2, params, seffects );
+ std::pair<bool, Node> chres2 = entailmentCheck(mode, ch2);
if( chres2.first ){
return std::pair<bool, Node>(true, NodeManager::currentNM()->mkNode(kind::AND, chres.second, chres2.second));
}else{
theory::Theory* th = theoryOf(tid);
Assert(th != NULL);
- Assert(params == NULL || tid == params->getTheoryId());
- Assert(seffects == NULL || tid == seffects->getTheoryId());
Trace("theory-engine-entc") << "Entailment check : " << lit << std::endl;
- std::pair<bool, Node> chres = th->entailmentCheck(lit, params, seffects);
+ std::pair<bool, Node> chres = th->entailmentCheck(lit);
return chres;
}
}
* Forwards an entailment check according to the given theoryOfMode.
* See theory.h for documentation on entailmentCheck().
*/
- std::pair<bool, Node> entailmentCheck(
- options::TheoryOfMode mode,
- TNode lit,
- const theory::EntailmentCheckParameters* params = NULL,
- theory::EntailmentCheckSideEffects* out = NULL);
+ std::pair<bool, Node> entailmentCheck(options::TheoryOfMode mode, TNode lit);
private:
/** Default visitor for pre-registration */
return d_engine->getPropEngine()->getAssertionLevel();
}
-std::pair<bool, Node> Valuation::entailmentCheck(
- options::TheoryOfMode mode,
- TNode lit,
- const theory::EntailmentCheckParameters* params,
- theory::EntailmentCheckSideEffects* out)
+std::pair<bool, Node> Valuation::entailmentCheck(options::TheoryOfMode mode,
+ TNode lit)
{
- return d_engine->entailmentCheck(mode, lit, params, out);
+ return d_engine->entailmentCheck(mode, lit);
}
bool Valuation::needCheck() const{
namespace theory {
-class EntailmentCheckParameters;
-class EntailmentCheckSideEffects;
class TheoryModel;
/**
* Request an entailment check according to the given theoryOfMode.
* See theory.h for documentation on entailmentCheck().
*/
- std::pair<bool, Node> entailmentCheck(
- options::TheoryOfMode mode,
- TNode lit,
- const theory::EntailmentCheckParameters* params = NULL,
- theory::EntailmentCheckSideEffects* out = NULL);
+ std::pair<bool, Node> entailmentCheck(options::TheoryOfMode mode, TNode lit);
/** need check ? */
bool needCheck() const;