summaryrefslogtreecommitdiff
path: root/src/api/cpp/cvc5.h
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2021-09-01 13:05:48 -0500
committerGitHub <noreply@github.com>2021-09-01 18:05:48 +0000
commit7a3aa7033719b14b34c0334d6956834b850fa9eb (patch)
tree53c2f3543a6314eaabd76eff9e38c2752a5c4afa /src/api/cpp/cvc5.h
parent24c4e9d5612fd7549a8ff7acaf76ce95acaca0d9 (diff)
Print response to get-model using the API (#7084)
This changes our implementation of GetModelCommand so that we use the API to print the model. It simplifies smt::Model so that this is a pretty printing utility, and not a layer on top of TheoryModel. It adds getModel as an API method for returning the string representation of the model, analogous to our current support for getProof. This eliminates the last call to getSmtEngine() from the command layer.
Diffstat (limited to 'src/api/cpp/cvc5.h')
-rw-r--r--src/api/cpp/cvc5.h20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/api/cpp/cvc5.h b/src/api/cpp/cvc5.h
index 11b138a50..a221f3711 100644
--- a/src/api/cpp/cvc5.h
+++ b/src/api/cpp/cvc5.h
@@ -3951,6 +3951,22 @@ class CVC5_EXPORT Solver
bool isModelCoreSymbol(const Term& v) const;
/**
+ * Get the model
+ * SMT-LIB:
+ * \verbatim
+ * ( get-model )
+ * \endverbatim
+ * Requires to enable option 'produce-models'.
+ * @param sorts The list of uninterpreted sorts that should be printed in the
+ * model.
+ * @param vars The list of free constants that should be printed in the
+ * model. A subset of these may be printed based on isModelCoreSymbol.
+ * @return a string representing the model.
+ */
+ std::string getModel(const std::vector<Sort>& sorts,
+ const std::vector<Term>& vars) const;
+
+ /**
* Do quantifier elimination.
* SMT-LIB:
* \verbatim
@@ -4329,10 +4345,6 @@ class CVC5_EXPORT Solver
*/
std::vector<Term> getSynthSolutions(const std::vector<Term>& terms) const;
- // !!! This is only temporarily available until the parser is fully migrated
- // to the new API. !!!
- SmtEngine* getSmtEngine(void) const;
-
/**
* Returns a snapshot of the current state of the statistic values of this
* solver. The returned object is completely decoupled from the solver and
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback