From b041ca5e66ba53ff93c3e86f2c12ffb07c1019ba Mon Sep 17 00:00:00 2001 From: Sebastian Junges Date: Wed, 29 Apr 2020 10:14:38 -0700 Subject: [PATCH] get constants and there defining expressions --- src/storage/prism.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/storage/prism.cpp b/src/storage/prism.cpp index 4f0c010..47b4bc1 100644 --- a/src/storage/prism.cpp +++ b/src/storage/prism.cpp @@ -35,7 +35,9 @@ void define_prism(py::module& m) { .def("restrict_commands", &Program::restrictCommands, "Restrict commands") .def("simplify", &Program::simplify, "Simplify") .def("used_constants",&Program::usedConstants, "Compute Used Constants") + .def("get_constant", &Program::getConstant, py::arg("name")) .def("get_module", [](Program const& prog, std::string const& name) {return prog.getModule(name);}, py::arg("module_name")) + // TODO the following is a duplicate and should be deprecated. .def_property_readonly("hasUndefinedConstants", &Program::hasUndefinedConstants, "Does the program have undefined constants?") .def_property_readonly("isDeterministicModel", &Program::isDeterministicModel, "Does the program describe a deterministic model?") .def_property_readonly("expression_manager", &Program::getManager, "Get the expression manager for expressions in this program") @@ -100,6 +102,7 @@ void define_prism(py::module& m) { .def_property_readonly("defined", &Constant::isDefined, "Is the constant defined?") .def_property_readonly("type", &Constant::getType, "The type of the constant") .def_property_readonly("expression_variable", &Constant::getExpressionVariable, "Expression variable") + .def_property_readonly("definition", &Constant::getExpression, "Defining expression") ;