#include "input.h" #include "src/helpers.h" void define_property(py::module& m) { py::class_(m, "Property", "Property") .def(py::init const&, std::string const&>(), "Construct property from formula", py::arg("name"), py::arg("formula"), py::arg("comment") = "") .def_property_readonly("name", &storm::jani::Property::getName, "Obtain the name of the property") .def_property_readonly("raw_formula", &storm::jani::Property::getRawFormula, "Obtain the formula directly") .def("__str__", &streamToString) ; } // Define python bindings void define_input(py::module& m) { // Parse prism program m.def("parse_prism_program", &storm::parseProgram, "Parse prism program", py::arg("path")); // PrismType py::enum_(m, "PrismModelType", "Type of the prism model") .value("DTMC", storm::prism::Program::ModelType::DTMC) .value("CTMC", storm::prism::Program::ModelType::CTMC) .value("MDP", storm::prism::Program::ModelType::MDP) .value("CTMDP", storm::prism::Program::ModelType::CTMDP) .value("MA", storm::prism::Program::ModelType::MA) .value("UNDEFINED", storm::prism::Program::ModelType::UNDEFINED) ; // PrismProgram py::class_(m, "PrismProgram", "Prism program") .def_property_readonly("nr_modules", &storm::prism::Program::getNumberOfModules, "Number of modules") .def_property_readonly("model_type", &storm::prism::Program::getModelType, "Model type") .def_property_readonly("has_undefined_constants", &storm::prism::Program::hasUndefinedConstants, "Flag if program has undefined constants") .def("__str__", &streamToString) ; // SymbolicModelDescription py::class_(m, "SymbolicModelDescription", "Symbolic description of model") .def(py::init(), "Construct from Prism program", py::arg("prism_program")) .def_property_readonly("is_prism_program", &storm::storage::SymbolicModelDescription::isPrismProgram, "Flag if program is in Prism format") ; // PrismProgram can be converted into SymbolicModelDescription py::implicitly_convertible(); }