From 1c8ce6ba760e828e3e1067fb62c895e000e3f7ce Mon Sep 17 00:00:00 2001 From: Tobias Winkler Date: Tue, 15 Sep 2020 09:58:32 +0200 Subject: [PATCH] small extension in jani and expressions --- src/storage/expressions.cpp | 1 + src/storage/jani.cpp | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/storage/expressions.cpp b/src/storage/expressions.cpp index d55ede1..88a5176 100644 --- a/src/storage/expressions.cpp +++ b/src/storage/expressions.cpp @@ -26,6 +26,7 @@ void define_expressions(py::module& m) { .def("create_integer_variable", &storm::expressions::ExpressionManager::declareIntegerVariable, "create Integer variable", py::arg("name"), py::arg("auxiliary") = false) .def("create_rational_variable", &storm::expressions::ExpressionManager::declareRationalVariable, "create Rational variable", py::arg("name"), py::arg("auxiliary") = false) .def("get_variable", &storm::expressions::ExpressionManager::getVariable, "get variably by name", py::arg("name")) + .def("get_variables", &storm::expressions::ExpressionManager::getVariables, "Retrieves the set of all variables known to this manager.") ; // Variable diff --git a/src/storage/jani.cpp b/src/storage/jani.cpp index 99f2d9c..2a9469c 100644 --- a/src/storage/jani.cpp +++ b/src/storage/jani.cpp @@ -33,6 +33,7 @@ void define_jani(py::module& m) { .def_property_readonly("undefined_constants_are_graph_preserving", &Model::undefinedConstantsAreGraphPreserving, "Flag if the undefined constants do not change the graph structure") .def("__str__", &janiToString) .def_property("initial_states_restriction", &Model::getInitialStatesRestriction, &Model::setInitialStatesRestriction, "initial states restriction") + .def("add_constant", &Model::addConstant, "adds constant to model", py::arg("constant")) .def("define_constants", &Model::defineUndefinedConstants, "define constants with a mapping from the corresponding expression variables to expressions", py::arg("map")) .def("substitute_constants", &Model::substituteConstants, "substitute constants") .def("remove_constant", &Model::removeConstant, "remove a constant. Make sure the constant does not appear in the model.", "constant_name"_a) @@ -156,7 +157,8 @@ void define_jani(py::module& m) { ; py::class_> constant(m, "JaniConstant", "A Constant in JANI"); - constant.def_property_readonly("defined", &Constant::isDefined, "is constant defined by some expression") + constant.def(py::init()) + .def_property_readonly("defined", &Constant::isDefined, "is constant defined by some expression") .def_property_readonly("name", &Constant::getName, "name of constant") .def_property_readonly("type", &Constant::getType, "type of constant") .def_property_readonly("expression_variable", &Constant::getExpressionVariable, "expression variable for this constant")