summaryrefslogtreecommitdiff
path: root/src/smt/smt_engine.h
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2020-10-16 13:32:42 -0500
committerGitHub <noreply@github.com>2020-10-16 13:32:42 -0500
commit7c249b3efdeeb51fd3dfc2571bc529c55880cf5c (patch)
tree220a1c3f2aa53b047c2a52260fce3bd2dce22429 /src/smt/smt_engine.h
parent547df7cd146091674562dfa4812f10bae7765934 (diff)
Refactor SMT-level model object (#5277)
This refactors the SMT-level model object so that it is a wrapper around TheoryModel instead of a base class. This inheritance was unnecessary. Moreover, it removes the virtual base models of the SMT-level model which were based on Expr. Now the interface is more minimal and in terms of Node only. This PR further simplifies a few places in the code that interface with the SmtEngine with things related to models.
Diffstat (limited to 'src/smt/smt_engine.h')
-rw-r--r--src/smt/smt_engine.h21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/smt/smt_engine.h b/src/smt/smt_engine.h
index 62e54a0c1..da12d336b 100644
--- a/src/smt/smt_engine.h
+++ b/src/smt/smt_engine.h
@@ -60,7 +60,6 @@ class TheoryEngine;
class ProofManager;
-class Model;
class LogicRequest;
class StatisticsRegistry;
@@ -95,6 +94,7 @@ namespace prop {
namespace smt {
/** Utilities */
+class Model;
class SmtEngineState;
class AbstractValues;
class Assertions;
@@ -280,7 +280,7 @@ class CVC4_PUBLIC SmtEngine
* Get the model (only if immediately preceded by a SAT or NOT_ENTAILED
* query). Only permitted if produce-models is on.
*/
- Model* getModel();
+ smt::Model* getModel();
/**
* Block the current model. Can be called only if immediately preceded by
@@ -969,16 +969,17 @@ class CVC4_PUBLIC SmtEngine
Result quickCheck();
/**
- * Get the model, if it is available and return a pointer to it
+ * Get the (SMT-level) model pointer, if we are in SAT mode. Otherwise,
+ * return nullptr.
*
- * This ensures that the model is currently available, which means that
- * CVC4 is producing models, and is in "SAT mode", otherwise an exception
- * is thrown.
+ * This ensures that the underlying theory model of the SmtSolver maintained
+ * by this class is currently available, which means that CVC4 is producing
+ * models, and is in "SAT mode", otherwise a recoverable exception is thrown.
*
* The flag c is used for giving an error message to indicate the context
* this method was called.
*/
- theory::TheoryModel* getAvailableModel(const char* c) const;
+ smt::Model* getAvailableModel(const char* c) const;
// --------------------------------------- callbacks from the state
/**
@@ -1088,6 +1089,12 @@ class CVC4_PUBLIC SmtEngine
/** The (old) proof manager TODO (project #37): delete this */
std::unique_ptr<ProofManager> d_proofManager;
+ /**
+ * The SMT-level model object, which contains information about how to
+ * print the model, as well as a pointer to the underlying TheoryModel
+ * implementation maintained by the SmtSolver.
+ */
+ std::unique_ptr<smt::Model> d_model;
/**
* The proof manager, which manages all things related to checking,
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback