#include "theory/quantifiers/full_model_check.h"
#include "options/quantifiers_options.h"
+#include "options/uf_options.h"
#include "theory/quantifiers/first_order_model.h"
#include "theory/quantifiers/instantiate.h"
#include "theory/quantifiers/term_database.h"
void FullModelChecker::preInitializeType( FirstOrderModelFmc * fm, TypeNode tn ){
if( d_preinitialized_types.find( tn )==d_preinitialized_types.end() ){
d_preinitialized_types[tn] = true;
- Node mb = fm->getModelBasisTerm(tn);
- if( !mb.isConst() ){
- Trace("fmc") << "...add model basis term to EE of model " << mb << " " << tn << std::endl;
- fm->d_equalityEngine->addTerm( mb );
- fm->addTerm( mb );
+ if (!tn.isFunction() || options::ufHo())
+ {
+ Node mb = fm->getModelBasisTerm(tn);
+ if (!mb.isConst())
+ {
+ Trace("fmc") << "...add model basis term to EE of model " << mb << " "
+ << tn << std::endl;
+ fm->d_equalityEngine->addTerm(mb);
+ }
}
}
}
assumptions.push_back( tassumptions[i] );
}
}
- Debug("strings-explain-debug") << "Explanation for " << literal << " was " << std::endl;
- for( unsigned i=ps; i<assumptions.size(); i++ ){
- Debug("strings-explain-debug") << " " << assumptions[i] << std::endl;
+ if (Debug.isOn("strings-explain-debug"))
+ {
+ Debug("strings-explain-debug") << "Explanation for " << literal << " was "
+ << std::endl;
+ for (unsigned i = ps; i < assumptions.size(); i++)
+ {
+ Debug("strings-explain-debug") << " " << assumptions[i] << std::endl;
+ }
}
}
eq_exp = NodeManager::currentNM()->mkNode( kind::AND, ev );
}
}
+ // if we have unexplained literals, this lemma is not a conflict
+ if (eq == d_false && !exp_n.empty())
+ {
+ eq = eq_exp.negate();
+ eq_exp = d_true;
+ }
sendLemma( eq_exp, eq, c );
}else{
sendInfer( mkAnd( exp ), eq, c );
d_pending_exp[eq] = eq_exp;
d_infer.push_back( eq );
d_infer_exp.push_back( eq_exp );
-
}
void TheoryStrings::sendSplit( Node a, Node b, const char * c, bool preq ) {
}
/** add term */
-void TheoryModel::addTerm(TNode n ){
+void TheoryModel::addTermInternal(TNode n)
+{
Assert(d_equalityEngine->hasTerm(n));
Trace("model-builder-debug2") << "TheoryModel::addTerm : " << n << std::endl;
//must collect UF terms
if( options::ufHo() ){
Trace("model-builder-debug") << " ...function is first-class member of equality engine" << std::endl;
+ Assert(d_equalityEngine->hasTerm(f));
// assign to representative if higher-order
Node r = d_equalityEngine->getRepresentative( f );
//always replace the representative, since it is initially assigned to itself
//---------------------------- for building the model
/** Adds a substitution from x to t. */
void addSubstitution(TNode x, TNode t, bool invalidateCache = true);
- /** add term
- * This will do any model-specific processing necessary for n,
- * such as constraining the interpretation of uninterpreted functions,
- * and adding n to the equality engine of this model.
- */
- virtual void addTerm(TNode n);
/** assert equality holds in the model */
void assertEquality(TNode a, TNode b, bool polarity);
/** assert predicate holds in the model */
Node getModelValue(TNode n,
bool hasBoundVars = false,
bool useDontCares = false) const;
+ /** add term internal
+ *
+ * This will do any model-specific processing necessary for n,
+ * such as constraining the interpretation of uninterpreted functions.
+ * This is called once for all terms in the equality engine, just before
+ * a model builder constructs this model.
+ */
+ virtual void addTermInternal(TNode n);
private:
/** cache for getModelValue */
}
// AJR: build ordered list of types that ensures that base types are
// enumerated first.
- // (I think) this is only strictly necessary for finite model finding +
- // parametric types
- // instantiated with uninterpreted sorts, but is probably a good idea to do
- // in general
- // since it leads to models with smaller term sizes.
+ // (I think) this is only strictly necessary for finite model finding +
+ // parametric types instantiated with uninterpreted sorts, but is probably
+ // a good idea to do in general since it leads to models with smaller term
+ // sizes.
std::vector<TypeNode> type_list;
eqcs_i = eq::EqClassesIterator(tm->d_equalityEngine);
for (; !eqcs_i.isFinished(); ++eqcs_i)
<< std::endl;
}
// model-specific processing of the term
- tm->addTerm(n);
+ tm->addTermInternal(n);
}
// Assign representative for this EC