Browse Source

extensions to prism datastructures

refactoring
Tobias Winkler 4 years ago
committed by Matthias Volk
parent
commit
e80c7e2dcf
No known key found for this signature in database GPG Key ID: 83A57678F739FCD3
  1. 8
      src/storage/prism.cpp

8
src/storage/prism.cpp

@ -26,6 +26,8 @@ void define_stateGeneration(py::module& m);
void define_prism(py::module& m) { void define_prism(py::module& m) {
py::class_<storm::prism::Program, std::shared_ptr<storm::prism::Program>> program(m, "PrismProgram", "A Prism Program"); py::class_<storm::prism::Program, std::shared_ptr<storm::prism::Program>> program(m, "PrismProgram", "A Prism Program");
program.def_property_readonly("constants", &Program::getConstants, "Get Program Constants") program.def_property_readonly("constants", &Program::getConstants, "Get Program Constants")
.def_property_readonly("global_boolean_variables", &Program::getGlobalBooleanVariables, "Retrieves the global boolean variables of the program")
.def_property_readonly("global_integer_variables", &Program::getGlobalIntegerVariables, "Retrieves the global integer variables of the program")
.def_property_readonly("nr_modules", &storm::prism::Program::getNumberOfModules, "Number of modules") .def_property_readonly("nr_modules", &storm::prism::Program::getNumberOfModules, "Number of modules")
.def_property_readonly("modules", &storm::prism::Program::getModules, "Modules in the program") .def_property_readonly("modules", &storm::prism::Program::getModules, "Modules in the program")
.def_property_readonly("model_type", &storm::prism::Program::getModelType, "Model type") .def_property_readonly("model_type", &storm::prism::Program::getModelType, "Model type")
@ -76,6 +78,8 @@ void define_prism(py::module& m) {
.def_property_readonly("labeled", &Command::isLabeled, "Is the command labeled") .def_property_readonly("labeled", &Command::isLabeled, "Is the command labeled")
.def_property_readonly("action_index", &Command::getActionIndex, "What is the action index of the command") .def_property_readonly("action_index", &Command::getActionIndex, "What is the action index of the command")
.def_property_readonly("guard_expression", &Command::getGuardExpression, "Get guard expression") .def_property_readonly("guard_expression", &Command::getGuardExpression, "Get guard expression")
.def_property_readonly("is_labeled", &Command::isLabeled, "Retrieves whether the command possesses a synchronization label")
.def_property_readonly("action_name", &Command::getActionName, "Retrieves the action name of this command")
.def_property_readonly("updates", [](Command const& command) { .def_property_readonly("updates", [](Command const& command) {
return command.getUpdates(); return command.getUpdates();
}, "Updates in the command") }, "Updates in the command")
@ -87,6 +91,10 @@ void define_prism(py::module& m) {
return update.getAssignments(); return update.getAssignments();
}, "Assignments in the update") }, "Assignments in the update")
.def_property_readonly("probability_expression", &Update::getLikelihoodExpression, "The probability expression for this update") .def_property_readonly("probability_expression", &Update::getLikelihoodExpression, "The probability expression for this update")
.def("substitute", &Update::substitute, "Substitutes all identifiers in the update according to the given map")
.def("simplify", &Update::simplify, "Simplifies the update in various ways (also removes identity assignments)")
.def("get_assignment", &Update::getAssignment, py::arg("variable_name"), "Retrieves a reference to the assignment for the variable with the given name")
.def("get_as_variable_to_expression_map", &Update::getAsVariableToExpressionMap, "Creates a mapping representation of this update")
.def("__str__", &streamToString<Update>) .def("__str__", &streamToString<Update>)
; ;

Loading…
Cancel
Save