variables known to be don't-cares.
after SAT/INVALID/UNKNOWN, check that the generated model satisfies user assertions
option dumpModels --dump-models bool :default false :link --produce-models :link-smt produce-models
output models after every SAT/INVALID/UNKNOWN response
+option omitDontCares --omit-dont-cares bool :default false
+ When producing a model, omit variables whose value does not matter
option proof produce-proofs --proof bool :default false :predicate proofEnabledBuild :notify notifyBeforeSearch
turn on proof generation
option checkProofs check-proofs --check-proofs bool :link --proof :link-smt produce-proofs :notify notifyBeforeSearch :read-write
void Printer::toStream(std::ostream& out, const Model& m) const throw() {
for(size_t i = 0; i < m.getNumCommands(); ++i) {
- toStream(out, m, m.getCommand(i));
+ const Command* cmd = m.getCommand(i);
+ const DeclareFunctionCommand* dfc = dynamic_cast<const DeclareFunctionCommand*>(cmd);
+ if (dfc != NULL && m.isDontCare(dfc->getFunction())) {
+ continue;
+ }
+ toStream(out, m, cmd);
}
}/* Printer::toStream(Model) */
std::string getInputName() const { return d_inputName; }
public:
+ /** Check whether this expr is a don't-care in the model */
+ virtual bool isDontCare(Expr expr) const { return false; }
/** get value for expression */
virtual Expr getValue(Expr expr) const = 0;
/** get cardinality for sort */
d_eeContext->push();
}
-Node TheoryModel::getValue(TNode n) const {
+Node TheoryModel::getValue(TNode n, bool useDontCares) const {
//apply substitutions
Node nn = d_substitutions.apply(n);
//get value in model
- nn = getModelValue(nn);
+ nn = getModelValue(nn, false, useDontCares);
+ if (nn.isNull()) return nn;
if(options::condenseFunctionValues() || nn.getKind() != kind::LAMBDA) {
//normalize
nn = Rewriter::rewrite(nn);
return nn;
}
+bool TheoryModel::isDontCare(Expr expr) const {
+ return getValue(Node::fromExpr(expr), true).isNull();
+}
+
Expr TheoryModel::getValue( Expr expr ) const{
Node n = Node::fromExpr( expr );
Node ret = getValue( n );
}
}
-Node TheoryModel::getModelValue(TNode n, bool hasBoundVars) const
+Node TheoryModel::getModelValue(TNode n, bool hasBoundVars, bool useDontCares) const
{
std::hash_map<Node, Node, NodeHashFunction>::iterator it = d_modelCache.find(n);
if (it != d_modelCache.end()) {
if(n.getType().isRegExp()) {
ret = Rewriter::rewrite(ret);
} else {
+ if (options::omitDontCares() && useDontCares) {
+ return Node();
+ }
// Unknown term - return first enumerated value for this type
TypeEnumerator te(n.getType());
ret = *te;
/**
* Get model value function. This function is called by getValue
*/
- Node getModelValue(TNode n, bool hasBoundVars = false) const;
+ Node getModelValue(TNode n, bool hasBoundVars = false, bool useDontCares = false) const;
public:
/**
* Get value function. This should be called only after a ModelBuilder has called buildModel(...)
* on this model.
*/
- Node getValue( TNode n ) const;
+ Node getValue( TNode n, bool useDontCares = false ) const;
/** get existing domain value, with possible exclusions
* This function returns a term in d_rep_set.d_type_reps[tn] but not in exclude
bool areEqual(TNode a, TNode b);
bool areDisequal(TNode a, TNode b);
public:
+ /** return whether this node is a don't-care */
+ bool isDontCare(Expr expr) const;
/** get value function for Exprs. */
Expr getValue( Expr expr ) const;
/** get cardinality for sort */