Previously, we had a special case to support users who directly accessed the model object pointer in the old API.
The special case ensure that the information in the model was eagerly updated after each "sat" response, in the case that the user did not re-request a pointer to the model.
Since users no longer can access the internal model pointer (apart from GetModelCommand), this special case is no longer necessary.
This PR should make us slightly faster for incremental benchmarks where the user asks for the model on some but not all "sat" responses.
Model* m = getAvailableModel("get model");
- // Since model m is being returned to the user, we must ensure that this
- // model object remains valid with future check-sat calls. Hence, we set
- // the theory engine into "eager model building" mode. TODO #2648: revisit.
- TheoryEngine* te = getTheoryEngine();
- Assert(te != nullptr);
- te->setEagerModelBuilding();
+ // Notice that the returned model is (currently) accessed by the
+ // GetModelCommand only, and is not returned to the user. The information
+ // in that model may become stale after it is returned. This is safe
+ // since GetModelCommand always calls this command again when it prints
+ // a model.
if (d_env->getOptions().smt.modelCoresMode
!= options::ModelCoresMode::NONE)
/**
* Get the model (only if immediately preceded by a SAT or NOT_ENTAILED
* query). Only permitted if produce-models is on.
+ *
+ * TODO (issues#287): eliminate this method.
*/
smt::Model* getModel();
d_quantEngine(nullptr),
d_decManager(new DecisionManager(d_env.getUserContext())),
d_relManager(nullptr),
- d_eager_model_building(false),
d_inConflict(d_env.getContext(), false),
d_inSatMode(false),
d_hasShutDown(false),
}
if (!d_inConflict && !needCheck())
{
- // If d_eager_model_building is false, then we only mark that we
- // are in "SAT mode". We build the model later only if the user asks
- // for it via getBuiltModel.
+ // We only mark that we are in "SAT mode". We build the model later only
+ // if the user asks for it via getBuiltModel.
d_inSatMode = true;
- if (d_eager_model_building)
- {
- d_tc->buildModel();
- }
}
}
* call).
*/
bool buildModel();
- /** set eager model building
- *
- * If this method is called, then this TheoryEngine will henceforth build
- * its model immediately after every satisfiability check that results
- * in a satisfiable or unknown result. The motivation for this mode is to
- * accomodate API users that get the model object from the TheoryEngine,
- * where we want to ensure that this model is always valid.
- * TODO (#2648): revisit this.
- */
- void setEagerModelBuilding() { d_eager_model_building = true; }
/**
* Get the theory associated to a given Node.