return out;
}
+#line 66 "${template}"
+
/** Returns true if the given kind is associative. This is used by ExprManager to
* decide whether it's safe to modify big expressions by changing the grouping of
* the arguments. */
kind::metakind::getUpperBoundForKind(getKind()),
getNumChildren());
+#if 0
+ // if the kind is PARAMETERIZED, check that the operator is correctly-kinded
+ Assert(kind::metaKindOf(getKind()) != kind::metakind::PARAMETERIZED ||
+ kind::operatorKindToKind(getOperator().getKind()) == getKind(),
+ "Attempted to construct a parameterized kind `%s' with "
+ "incorrectly-kinded operator `%s'",
+ kind::kindToString(getKind()).c_str(),
+ kind::kindToString(getOperator().getKind()).c_str());
+#endif /* 0 */
+
// Implementation differs depending on whether the NodeValue was
// malloc'ed or not and whether or not it's in the already-been-seen
// NodeManager pool of Nodes. See implementation notes at the top
kind::metakind::getUpperBoundForKind(getKind()),
getNumChildren());
+#if 0
+ // if the kind is PARAMETERIZED, check that the operator is correctly-kinded
+ Assert(kind::metaKindOf(getKind()) != kind::metakind::PARAMETERIZED ||
+ kind::operatorKindToKind(getOperator().getKind()) == getKind(),
+ "Attempted to construct a parameterized kind `%s' with "
+ "incorrectly-kinded operator `%s'",
+ kind::kindToString(getKind()).c_str(),
+ kind::kindToString(getOperator().getKind()).c_str());
+#endif /* 0 */
+
// Implementation differs depending on whether the NodeValue was
// malloc'ed or not and whether or not it's in the already-been-seen
// NodeManager pool of Nodes. See implementation notes at the top
Assert(types.size() >= 2);
std::vector<TypeNode> typeNodes;
for (unsigned i = 0; i < types.size(); ++ i) {
- /* FIXME when congruence closure no longer abuses tuples
+ /* FIXME when congruence closure no longer abuses tuples */
+#if 0
CheckArgument(!types[i].isFunctionLike(), types,
"cannot put function-like types in tuples");
- */
+#endif /* 0 */
typeNodes.push_back(types[i]);
}
return mkTypeNode(kind::TUPLE_TYPE, typeNodes);
d_partialModel.setAssignment(x,assignment);
}
Debug("arithgc") << "setupVariable("<<x<<")"<<std::endl;
-};
-
-void TheoryArith::registerTerm(TNode tn){
- Debug("arith") << "registerTerm(" << tn << ")" << endl;
}
-
ArithVar TheoryArith::determineLeftVariable(TNode assertion, Kind simpleKind){
TNode left = getSide<true>(assertion, simpleKind);
*/
void preRegisterTerm(TNode n);
- /** CD setup for a node. Currently does nothing. */
- void registerTerm(TNode n);
-
void check(Effort e);
void propagate(Effort e);
void explain(TNode n);
static const bool hasRegisterTerm = ${theory_has_registerTerm};
static const bool hasNotifyRestart = ${theory_has_notifyRestart};
static const bool hasPresolve = ${theory_has_presolve};
-};
+};/* struct TheoryTraits<${theory_id}> */
"
# warnings about theory content and properties
d_engine->getSharedTermManager()->addEq(fact);
}
- if(Options::current()->theoryRegistration && !fact.getAttribute(RegisteredAttr())) {
+ if(Options::current()->theoryRegistration &&
+ !fact.getAttribute(RegisteredAttr()) &&
+ d_engine->d_needRegistration) {
list<TNode> toReg;
toReg.push_back(fact);
d_propEngine(NULL),
d_context(ctxt),
d_activeTheories(0),
+ d_needRegistration(false),
d_theoryOut(this, ctxt),
d_hasShutDown(false),
d_incomplete(ctxt, false),
// Do the checking
try {
- CVC4_FOR_EACH_THEORY
+ CVC4_FOR_EACH_THEORY;
} catch(const theory::Interrupted&) {
Debug("theory") << "TheoryEngine::check() => conflict" << std::endl;
}
}
// Propagate for each theory using the statement above
- CVC4_FOR_EACH_THEORY
+ CVC4_FOR_EACH_THEORY;
}
/* Our goal is to tease out any ITE's sitting under a theory operator. */
}
// Presolve for each theory using the statement above
- CVC4_FOR_EACH_THEORY
+ CVC4_FOR_EACH_THEORY;
} catch(const theory::Interrupted&) {
Debug("theory") << "TheoryEngine::presolve() => interrupted" << endl;
}
}
// notify each theory using the statement above
- CVC4_FOR_EACH_THEORY
+ CVC4_FOR_EACH_THEORY;
}
void TheoryEngine::staticLearning(TNode in, NodeBuilder<>& learned) {
}
// static learning for each theory using the statement above
- CVC4_FOR_EACH_THEORY
+ CVC4_FOR_EACH_THEORY;
+}
+
+bool TheoryEngine::hasRegisterTerm(TheoryId th) const {
+ switch(th) {
+ // Definition of the statement that is to be run by every theory
+#ifdef CVC4_FOR_EACH_THEORY_STATEMENT
+#undef CVC4_FOR_EACH_THEORY_STATEMENT
+#endif
+#define CVC4_FOR_EACH_THEORY_STATEMENT(THEORY) \
+ case THEORY: \
+ return theory::TheoryTraits<THEORY>::hasRegisterTerm;
+
+ CVC4_FOR_EACH_THEORY
+ default:
+ Unhandled(th);
+ }
}
Node TheoryEngine::simplify(TNode in, theory::Substitutions& outSubstitutions) {
*/
size_t d_activeTheories;
+ /**
+ * Need the registration infrastructure when theory sharing is on
+ * (>=2 active theories) or when the sole active theory has
+ * requested it.
+ */
+ bool d_needRegistration;
+
/**
* The type of the simplification cache.
*/
void markActive(theory::TheoryId th) {
if(!d_theoryIsActive[th]) {
d_theoryIsActive[th] = true;
- ++d_activeTheories;
- Notice() << "Theory " << th << " has been activated." << std::endl;
+ if(th != theory::THEORY_BUILTIN && th != theory::THEORY_BOOL) {
+ if(++d_activeTheories == 1) {
+ // theory requests registration
+ d_needRegistration = hasRegisterTerm(th);
+ } else {
+ // need it for sharing
+ d_needRegistration = true;
+ }
+ }
+ Notice() << "Theory " << th << " has been activated (registration is "
+ << (d_needRegistration ? "on" : "off") << ")." << std::endl;
}
}
+ bool hasRegisterTerm(theory::TheoryId th) const;
+
public:
/** The logic of the problem */
std::string d_logic;
d_currentPendingIdx(c,0),
d_disequality(c),
d_registered(c) {
+ Warning() << "NOTE:" << std::endl
+ << "NOTE: currently the 'Tim' UF solver is broken," << std::endl
+ << "NOTE: since its registerTerm() function is never" << std::endl
+ << "NOTE: called." << std::endl
+ << "NOTE:" << std::endl;
}
TheoryUFTim::~TheoryUFTim() {
euf_simp06.smt \
euf_simp08.smt \
euf_simp09.smt \
- euf_simp09.tim.smt \
euf_simp10.smt \
euf_simp11.smt \
euf_simp12.smt \
simple.03.cvc \
simple.04.cvc
-EXTRA_DIST = $(TESTS)
+EXTRA_DIST = $(TESTS) \
+ euf_simp09.tim.smt
#if CVC4_BUILD_PROFILE_COMPETITION
#else