From 8f4a09ba0c962e666df305f1def25576195027c7 Mon Sep 17 00:00:00 2001 From: Luko van der Maas Date: Thu, 24 Oct 2024 17:06:23 +0200 Subject: [PATCH 01/35] Verimon stormpy api --- src/mod_pomdp.cpp | 2 ++ src/pomdp/generator.cpp | 23 +++++++++++++++++++++++ src/pomdp/generator.h | 5 +++++ 3 files changed, 30 insertions(+) create mode 100644 src/pomdp/generator.cpp create mode 100644 src/pomdp/generator.h diff --git a/src/mod_pomdp.cpp b/src/mod_pomdp.cpp index 1dee57b220..4c6c05b6b2 100644 --- a/src/mod_pomdp.cpp +++ b/src/mod_pomdp.cpp @@ -6,6 +6,7 @@ #include "pomdp/transformations.h" #include "pomdp/memory.h" #include "pomdp/quantitative_analysis.h" +#include "pomdp/generator.h" #include PYBIND11_MODULE(pomdp, m) { @@ -24,6 +25,7 @@ PYBIND11_MODULE(pomdp, m) { define_transformations(m, "Double"); define_transformations(m, "Exact"); define_belief_exploration(m, "Double"); + define_verimon_generator(m, "Double"); define_transformations(m, "Rf"); } diff --git a/src/pomdp/generator.cpp b/src/pomdp/generator.cpp new file mode 100644 index 0000000000..31b591958a --- /dev/null +++ b/src/pomdp/generator.cpp @@ -0,0 +1,23 @@ +#include "generator.h" +#include "storm-pomdp/generator/GenerateMonitorVerifier.h" + +template using GenerateMonitorVerifier = storm::generator::GenerateMonitorVerifier; +template using SparseDtmc = storm::models::sparse::Dtmc; +template using SparseMdp = storm::models::sparse::Mdp; +template using GenerateMonitorVerifierOptions = typename storm::generator::GenerateMonitorVerifier::Options; + +template +void define_verimon_generator(py::module& m, std::string const& vtSuffix) { + py::class_> gmv(m, ("GenerateMonitorVerifier" + vtSuffix).c_str(), "Generator of POMDP used in verifying monitors against markov chains"); + gmv.def(py::init const&, SparseMdp const&, GenerateMonitorVerifierOptions const&>(), py::arg("mc"), py::arg("monitor"), py::arg("options")); + gmv.def("create_product", &storm::generator::GenerateMonitorVerifier::createProduct, "Created the verification POMDP"); + + py::class_> gmvopts(m, ("GenerateMonitorVerifier" + vtSuffix + "Options").c_str(), "Options for corresponding generator"); + gmvopts.def(py::init<>()); + gmvopts.def_readwrite("good_label", &GenerateMonitorVerifierOptions::goodLabel); + gmvopts.def_readwrite("accepting_label", &GenerateMonitorVerifierOptions::acceptingLabel); + gmvopts.def_readwrite("step_prefix", &GenerateMonitorVerifierOptions::stepPrefix); + gmvopts.def_readwrite("horizon_label", &GenerateMonitorVerifierOptions::horizonLabel); +} + +template void define_verimon_generator(py::module& m, std::string const& vtSuffix); diff --git a/src/pomdp/generator.h b/src/pomdp/generator.h new file mode 100644 index 0000000000..bd28415441 --- /dev/null +++ b/src/pomdp/generator.h @@ -0,0 +1,5 @@ +#pragma once +#include "common.h" + +template +void define_verimon_generator(py::module& m, std::string const& vtSuffix); From 298b74aa2fa51699ab46a279b5abc9c7c4321c78 Mon Sep 17 00:00:00 2001 From: Luko van der Maas Date: Tue, 12 Nov 2024 16:28:17 +0100 Subject: [PATCH 02/35] Add verimon to stormpy --- .gitignore | 2 ++ src/mod_pomdp.cpp | 36 ++++++++++++++++++------------------ src/pomdp/generator.cpp | 12 +++++++++++- 3 files changed, 31 insertions(+), 19 deletions(-) diff --git a/.gitignore b/.gitignore index b37085814d..83021db757 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,8 @@ __pycache__/ _build/ .pytest_cache/ .idea/ +.vscode/ cmake-build-debug/ .DS_Store +.cache/ diff --git a/src/mod_pomdp.cpp b/src/mod_pomdp.cpp index 4c6c05b6b2..044a341790 100644 --- a/src/mod_pomdp.cpp +++ b/src/mod_pomdp.cpp @@ -1,31 +1,31 @@ #include "common.h" -#include "pomdp/tracker.h" -#include "pomdp/qualitative_analysis.h" -#include "pomdp/transformations.h" +#include "pomdp/generator.h" #include "pomdp/memory.h" +#include "pomdp/qualitative_analysis.h" #include "pomdp/quantitative_analysis.h" -#include "pomdp/generator.h" +#include "pomdp/tracker.h" +#include "pomdp/transformations.h" #include PYBIND11_MODULE(pomdp, m) { - m.doc() = "Functionality for POMDP analysis"; + m.doc() = "Functionality for POMDP analysis"; #ifdef STORMPY_DISABLE_SIGNATURE_DOC - py::options options; - options.disable_function_signatures(); + py::options options; + options.disable_function_signatures(); #endif - define_tracker(m, "Double"); - define_tracker(m, "Exact"); - define_qualitative_policy_search(m, "Double"); - define_qualitative_policy_search_nt(m); - define_memory(m); - define_transformations_nt(m); - define_transformations(m, "Double"); - define_transformations(m, "Exact"); - define_belief_exploration(m, "Double"); - define_verimon_generator(m, "Double"); + define_tracker(m, "Double"); + define_tracker(m, "Exact"); + define_qualitative_policy_search(m, "Double"); + define_qualitative_policy_search_nt(m); + define_memory(m); + define_transformations_nt(m); + define_transformations(m, "Double"); + define_transformations(m, "Exact"); + define_belief_exploration(m, "Double"); + define_verimon_generator(m, "Double"); - define_transformations(m, "Rf"); + define_transformations(m, "Rf"); } diff --git a/src/pomdp/generator.cpp b/src/pomdp/generator.cpp index 31b591958a..692575882a 100644 --- a/src/pomdp/generator.cpp +++ b/src/pomdp/generator.cpp @@ -1,16 +1,24 @@ #include "generator.h" #include "storm-pomdp/generator/GenerateMonitorVerifier.h" +#include "storm/adapters/RationalNumberAdapter.h" template using GenerateMonitorVerifier = storm::generator::GenerateMonitorVerifier; template using SparseDtmc = storm::models::sparse::Dtmc; template using SparseMdp = storm::models::sparse::Mdp; +template using SparsePomdp = storm::models::sparse::Pomdp; template using GenerateMonitorVerifierOptions = typename storm::generator::GenerateMonitorVerifier::Options; template void define_verimon_generator(py::module& m, std::string const& vtSuffix) { + py::class_, std::shared_ptr>> mv(m, ("MonitorVerifier" + vtSuffix).c_str(), "Container for monitor verifier POMDP with associated objects"); + mv.def(py::init&, const std::map, uint32_t>&>(), py::arg("product"), py::arg("observation_map")); + mv.def("get_product", &storm::generator::MonitorVerifier::getProduct, py::return_value_policy::copy); + mv.def_property_readonly("observation_map", &storm::generator::MonitorVerifier::getObservationMap, py::return_value_policy::copy); + py::class_> gmv(m, ("GenerateMonitorVerifier" + vtSuffix).c_str(), "Generator of POMDP used in verifying monitors against markov chains"); gmv.def(py::init const&, SparseMdp const&, GenerateMonitorVerifierOptions const&>(), py::arg("mc"), py::arg("monitor"), py::arg("options")); - gmv.def("create_product", &storm::generator::GenerateMonitorVerifier::createProduct, "Created the verification POMDP"); + gmv.def("create_product", &storm::generator::GenerateMonitorVerifier::createProduct, py::return_value_policy::copy, "Created the verification POMDP"); + gmv.def("set_risk", &storm::generator::GenerateMonitorVerifier::setRisk, py::arg("risk")); py::class_> gmvopts(m, ("GenerateMonitorVerifier" + vtSuffix + "Options").c_str(), "Options for corresponding generator"); gmvopts.def(py::init<>()); @@ -18,6 +26,8 @@ void define_verimon_generator(py::module& m, std::string const& vtSuffix) { gmvopts.def_readwrite("accepting_label", &GenerateMonitorVerifierOptions::acceptingLabel); gmvopts.def_readwrite("step_prefix", &GenerateMonitorVerifierOptions::stepPrefix); gmvopts.def_readwrite("horizon_label", &GenerateMonitorVerifierOptions::horizonLabel); + gmvopts.def_readwrite("use_risk", &GenerateMonitorVerifierOptions::useRisk); } template void define_verimon_generator(py::module& m, std::string const& vtSuffix); +template void define_verimon_generator(py::module& m, std::string const& vtSuffix); From 10bac8db61f6a21a7b39eef9a2453241419c313f Mon Sep 17 00:00:00 2001 From: Luko van der Maas Date: Thu, 14 Nov 2024 10:27:42 +0100 Subject: [PATCH 03/35] Add bindings for interval observation unfolder and asan config --- .gitignore | 2 ++ CMakeLists.txt | 6 ++++++ lib/stormpy/__init__.py | 35 ++++++++++++++++++++------------- lib/stormpy/pomdp/__init__.py | 13 +++++++++--- setup.py | 5 +++++ setup/config.py | 1 + src/mod_pomdp.cpp | 37 +++++++++++++++++++---------------- src/pomdp/transformations.cpp | 24 ++++++++++++++++++----- src/pomdp/transformations.h | 8 +++++--- src/storage/model.cpp | 6 ++++++ 10 files changed, 95 insertions(+), 42 deletions(-) diff --git a/.gitignore b/.gitignore index b37085814d..70f348ce11 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,5 @@ _build/ cmake-build-debug/ .DS_Store +.vscode/ +.cache/ \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 12923a31be..5bab0ef430 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,12 +6,18 @@ option(USE_STORM_DFT "Enable support for DFTs" ON) option(USE_STORM_GSPN "Enable support for GSPNs" ON) option(USE_STORM_PARS "Enable support for parametric models" ON) option(USE_STORM_POMDP "Enable support for POMDPs" ON) +option(STORM_COMPILE_WITH_ADDRESS_SANITIZER "Sets whether to compile with AddressSanitizer enabled" OFF) option(STORMPY_DISABLE_SIGNATURE_DOC "Disable the signature in the documentation" OFF) MARK_AS_ADVANCED(STORMPY_DISABLE_SIGNATURE_DOC) set(PYBIND_VERSION "" CACHE STRING "Pybind11 version to use") MARK_AS_ADVANCED(PYBIND_VERSION) set(STORM_DIR_HINT "" CACHE STRING "A hint where the Storm library can be found.") +if (STORM_COMPILE_WITH_ADDRESS_SANITIZER) + message(STATUS "Storm - Enabling AddressSanitizer") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -shared-libasan") +endif() + find_package(storm REQUIRED HINTS ${STORM_DIR_HINT}) find_package(Python COMPONENTS Interpreter Development REQUIRED) diff --git a/lib/stormpy/__init__.py b/lib/stormpy/__init__.py index 6df1255e11..f3ec4d2838 100644 --- a/lib/stormpy/__init__.py +++ b/lib/stormpy/__init__.py @@ -1,7 +1,7 @@ import sys if sys.version_info[0] == 2: - raise ImportError('Python 2.x is not supported for stormpy.') + raise ImportError("Python 2.x is not supported for stormpy.") from ._config import * @@ -138,7 +138,7 @@ def build_sparse_model(symbolic_description, properties=None): def build_sparse_parametric_model(symbolic_description, properties=None): """ Build a parametric model in sparse representation from a symbolic description. - + :param symbolic_description: Symbolic model description to translate into a model. :param List[Property] properties: List of properties that should be preserved during the translation. If None, then all properties are preserved. :return: Parametric model in sparse representation. @@ -204,7 +204,7 @@ def build_model_from_drn(file, options=DirectEncodingParserOptions()): return _convert_sparse_model(intermediate, parametric=False) -def build_parametric_model_from_drn(file, options = DirectEncodingParserOptions()): +def build_parametric_model_from_drn(file, options=DirectEncodingParserOptions()): """ Build a parametric model in sparse representation from the explicit DRN representation. @@ -216,7 +216,7 @@ def build_parametric_model_from_drn(file, options = DirectEncodingParserOptions( return _convert_sparse_model(intermediate, parametric=True) -def build_interval_model_from_drn(file, options = DirectEncodingParserOptions()): +def build_interval_model_from_drn(file, options=DirectEncodingParserOptions()): """ Build an interval model in sparse representation from the explicit DRN representation. @@ -226,8 +226,12 @@ def build_interval_model_from_drn(file, options = DirectEncodingParserOptions()) """ intermediate = core._build_sparse_interval_model_from_drn(file, options) assert intermediate.supports_uncertainty - if intermediate.model_type == ModelType.MDP: + if intermediate.model_type == ModelType.DTMC: + return intermediate._as_sparse_idtmc() + elif intermediate.model_type == ModelType.MDP: return intermediate._as_sparse_imdp() + elif intermediate.model_type == ModelType.POMDP: + return intermediate._as_sparse_ipomdp() else: raise StormError("Not supported interval model constructed") @@ -285,14 +289,19 @@ def model_checking(model, property, only_initial_states=False, extract_scheduler :rtype: CheckResult """ if model.is_sparse_model: - return check_model_sparse(model, property, only_initial_states=only_initial_states, - extract_scheduler=extract_scheduler, force_fully_observable=force_fully_observable, environment=environment) + return check_model_sparse( + model, + property, + only_initial_states=only_initial_states, + extract_scheduler=extract_scheduler, + force_fully_observable=force_fully_observable, + environment=environment, + ) else: - assert (model.is_symbolic_model) + assert model.is_symbolic_model if extract_scheduler: raise StormError("Model checking based on dd engine does not support extracting schedulers right now.") - return check_model_dd(model, property, only_initial_states=only_initial_states, - environment=environment) + return check_model_dd(model, property, only_initial_states=only_initial_states, environment=environment) def check_model_sparse(model, property, only_initial_states=False, extract_scheduler=False, force_fully_observable=False, hint=None, environment=Environment()): @@ -334,8 +343,6 @@ def check_model_sparse(model, property, only_initial_states=False, extract_sched else: raise RuntimeError("Model checking of partially observable models is handled via dedicated methods, unless the force fully-observable is set.") - - if model.supports_parameters: task = core.ParametricCheckTask(formula, only_initial_states) task.set_produce_schedulers(extract_scheduler) @@ -516,7 +523,7 @@ def topological_sort(model, forward=True, initial=[]): raise StormError("Unknown kind of model.") -def get_reachable_states(model, initial_states, constraint_states, target_states, maximal_steps = None, choice_filter = None ): +def get_reachable_states(model, initial_states, constraint_states, target_states, maximal_steps=None, choice_filter=None): """ Get the states that are reachable in a sparse model @@ -582,7 +589,7 @@ def construct_submodel(model, states, actions, keep_unreachable_states=True, opt return core._construct_subsystem_Double(model, states, actions, keep_unreachable_states, options) -def eliminate_ECs(matrix, subsystem, possible_ecs, add_sink_row_states, add_self_loop_at_sink_states = False): +def eliminate_ECs(matrix, subsystem, possible_ecs, add_sink_row_states, add_self_loop_at_sink_states=False): """ For each such EC (that is not contained in another EC), we add a new state and redirect all incoming and outgoing transitions of the EC to (and from) this state. diff --git a/lib/stormpy/pomdp/__init__.py b/lib/stormpy/pomdp/__init__.py index d490e77b4d..1fb55e8a03 100644 --- a/lib/stormpy/pomdp/__init__.py +++ b/lib/stormpy/pomdp/__init__.py @@ -1,6 +1,7 @@ from . import pomdp from .pomdp import * + def make_canonic(model): """ Make the POMDP canonic @@ -13,6 +14,7 @@ def make_canonic(model): else: return pomdp._make_canonic_Double(model) + def make_simple(model, keep_state_valuations=False): """ Make the POMDP simple (aka alternating), i.e., each state has at most two actions, and if there is nondeterminism, then there is no probabilistic branching, @@ -25,6 +27,7 @@ def make_simple(model, keep_state_valuations=False): else: return pomdp._make_simple_Double(model, keep_state_valuations) + def unfold_memory(model, memory, add_memory_labels=False, keep_state_valuations=False): """ Unfold the memory for an FSC into the POMDP @@ -38,6 +41,7 @@ def unfold_memory(model, memory, add_memory_labels=False, keep_state_valuations= else: return pomdp._unfold_memory_Double(model, memory, add_memory_labels, keep_state_valuations) + def apply_unknown_fsc(model, mode): if model.supports_parameters: return pomdp._apply_unknown_fsc_Rf(model, mode) @@ -64,15 +68,18 @@ def create_nondeterminstic_belief_tracker(model, reduction_timeout, track_timeou return pomdp.NondeterministicBeliefTrackerDoubleSparse(model, opts) -def create_observation_trace_unfolder(model, risk_assessment, expr_manager): +def create_observation_trace_unfolder(model, risk_assessment, expr_manager, rejection_sampling=True): """ :param model: :param risk_assessment: :param expr_manager: + :param rejection_sampling: :return: """ + options = pomdp.ObservationTraceUnfolderOptions() + options.rejection_sampling = rejection_sampling if model.is_exact: - return pomdp.ObservationTraceUnfolderExact(model, risk_assessment, expr_manager) + return pomdp.ObservationTraceUnfolderExact(model, risk_assessment, expr_manager, options) else: - return pomdp.ObservationTraceUnfolderDouble(model, risk_assessment, expr_manager) \ No newline at end of file + return pomdp.ObservationTraceUnfolderDouble(model, risk_assessment, expr_manager, options) diff --git a/setup.py b/setup.py index d7eb1580bd..7972e5ef1a 100755 --- a/setup.py +++ b/setup.py @@ -35,6 +35,7 @@ class CMakeBuild(build_ext): ('disable-pomdp', None, 'Disable support for POMDP analysis'), ('debug', None, 'Build in Debug mode'), ('jobs=', 'j', 'Number of jobs to use for compiling'), + ('asan', None, 'Turn on address sanitizer'), ('pybind-version=', None, 'Pybind11 version to use'), ] @@ -129,6 +130,8 @@ def run(self): cmake_args += ['-DUSE_STORM_GSPN=' + ('ON' if use_gspn else 'OFF')] cmake_args += ['-DUSE_STORM_PARS=' + ('ON' if use_pars else 'OFF')] cmake_args += ['-DUSE_STORM_POMDP=' + ('ON' if use_pomdp else 'OFF')] + cmake_args += ['-DSTORM_COMPILE_WITH_ADDRESS_SANITIZER=' + ('ON' if self.config.get_as_bool("asan") else 'OFF')] + # cmake_args += ['-DCMAKE_C_COMPILER=/usr/bin/clang', '-DCMAKE_CXX_COMPILER=/usr/bin/clang++'] # Configure extensions env = os.environ.copy() @@ -169,6 +172,7 @@ def initialize_options(self): self.disable_pomdp = None self.debug = None self.jobs = None + self.asan = None self.pybind_version = None def finalize_options(self): @@ -184,6 +188,7 @@ def finalize_options(self): self.config.update("disable_pomdp", self.disable_pomdp) self.config.update("debug", self.debug) self.config.update("jobs", self.jobs) + self.config.update("asan", self.asan) self.config.update("pybind_version", self.pybind_version) diff --git a/setup/config.py b/setup/config.py index 0a8b2b519c..6f7e4e0d5a 100644 --- a/setup/config.py +++ b/setup/config.py @@ -34,6 +34,7 @@ def _default_values(): "disable_pomdp": False, "debug": False, "jobs": str(no_jobs), + "asan": False, "pybind_version": "" } diff --git a/src/mod_pomdp.cpp b/src/mod_pomdp.cpp index 1dee57b220..e51d579968 100644 --- a/src/mod_pomdp.cpp +++ b/src/mod_pomdp.cpp @@ -1,29 +1,32 @@ #include "common.h" -#include "pomdp/tracker.h" -#include "pomdp/qualitative_analysis.h" -#include "pomdp/transformations.h" #include "pomdp/memory.h" +#include "pomdp/qualitative_analysis.h" #include "pomdp/quantitative_analysis.h" +#include "pomdp/tracker.h" +#include "pomdp/transformations.h" #include PYBIND11_MODULE(pomdp, m) { - m.doc() = "Functionality for POMDP analysis"; + m.doc() = "Functionality for POMDP analysis"; #ifdef STORMPY_DISABLE_SIGNATURE_DOC - py::options options; - options.disable_function_signatures(); + py::options options; + options.disable_function_signatures(); #endif - define_tracker(m, "Double"); - define_tracker(m, "Exact"); - define_qualitative_policy_search(m, "Double"); - define_qualitative_policy_search_nt(m); - define_memory(m); - define_transformations_nt(m); - define_transformations(m, "Double"); - define_transformations(m, "Exact"); - define_belief_exploration(m, "Double"); - - define_transformations(m, "Rf"); + define_tracker(m, "Double"); + define_tracker(m, "Exact"); + define_qualitative_policy_search(m, "Double"); + define_qualitative_policy_search_nt(m); + define_memory(m); + define_transformations_nt(m); + define_transformations(m, "Double"); + define_transformations(m, "Exact"); + define_transformations(m, "Rf"); + define_transformations_int(m, "Double"); + define_transformations_int(m, "Exact"); + define_transformations_int(m, "Rf"); + define_transformations_int(m, "Interval"); + define_belief_exploration(m, "Double"); } diff --git a/src/pomdp/transformations.cpp b/src/pomdp/transformations.cpp index 07fa32abc6..f9331ddac7 100644 --- a/src/pomdp/transformations.cpp +++ b/src/pomdp/transformations.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include template @@ -32,9 +33,11 @@ std::shared_ptr> apply_unk } template -std::shared_ptr> unfold_trace(storm::models::sparse::Pomdp const& pomdp, std::shared_ptr& exprManager, std::vector const& observationTrace, std::vector const& riskDef ) { - storm::pomdp::ObservationTraceUnfolder transformer(pomdp, exprManager); - return transformer.transform(observationTrace, riskDef); +std::shared_ptr> unfold_trace(storm::models::sparse::Pomdp const& pomdp, std::shared_ptr& exprManager, std::vector const& observationTrace, std::vector const& riskDef, bool rejectionSampling=true) { + storm::pomdp::ObservationTraceUnfolderOptions options = storm::pomdp::ObservationTraceUnfolderOptions(); + options.rejectionSampling = rejectionSampling; + storm::pomdp::ObservationTraceUnfolder transformer(pomdp, riskDef, exprManager, options); + return transformer.transform(observationTrace); } // STANDARD, SIMPLE_LINEAR, SIMPLE_LINEAR_INVERSE, SIMPLE_LOG, FULL @@ -47,6 +50,9 @@ void define_transformations_nt(py::module &m) { .value("full", storm::transformer::PomdpFscApplicationMode::FULL) ; + py::class_ unfolderOptions(m, "ObservationTraceUnfolderOptions", "Options for the ObservationTraceUnfolder"); + unfolderOptions.def(py::init<>()); + unfolderOptions.def_readwrite("rejection_sampling", &storm::pomdp::ObservationTraceUnfolderOptions::rejectionSampling); } template @@ -55,10 +61,13 @@ void define_transformations(py::module& m, std::string const& vtSuffix) { m.def(("_unfold_memory_" + vtSuffix).c_str(), &unfold_memory, "Unfold memory into a POMDP", py::arg("pomdp"), py::arg("memorystructure"), py::arg("memorylabels") = false, py::arg("keep_state_valuations")=false); m.def(("_make_simple_"+ vtSuffix).c_str(), &make_simple, "Make POMDP simple", py::arg("pomdp"), py::arg("keep_state_valuations")=false); m.def(("_apply_unknown_fsc_" + vtSuffix).c_str(), &apply_unknown_fsc, "Apply unknown FSC",py::arg("pomdp"), py::arg("application_mode")=storm::transformer::PomdpFscApplicationMode::SIMPLE_LINEAR); - //m.def(("_unfold_trace_" + vtSuffix).c_str(), &unfold_trace, "Unfold observed trace", py::arg("pomdp"), py::arg("expression_manager"),py::arg("observation_trace"), py::arg("risk_definition")); +} +template +void define_transformations_int(py::module& m, std::string const& vtSuffix) { py::class_> unfolder(m, ("ObservationTraceUnfolder" + vtSuffix).c_str(), "Unfolds observation traces in models"); - unfolder.def(py::init const&, std::vector const&, std::shared_ptr&>(), py::arg("model"), py::arg("risk"), py::arg("expression_manager")); + unfolder.def(py::init const&, std::vector const&, std::shared_ptr&, storm::pomdp::ObservationTraceUnfolderOptions const&>(), py::arg("model"), py::arg("risk"), py::arg("expression_manager"), py::arg("options")); + unfolder.def("is_rejection_sampling_set", &storm::pomdp::ObservationTraceUnfolder::isRejectionSamplingSet); unfolder.def("transform", &storm::pomdp::ObservationTraceUnfolder::transform, py::arg("trace")); unfolder.def("extend", &storm::pomdp::ObservationTraceUnfolder::extend, py::arg("new_observation")); unfolder.def("reset", &storm::pomdp::ObservationTraceUnfolder::reset, py::arg("new_observation")); @@ -67,3 +76,8 @@ void define_transformations(py::module& m, std::string const& vtSuffix) { template void define_transformations(py::module& m, std::string const& vtSuffix); template void define_transformations(py::module& m, std::string const& vtSuffix); template void define_transformations(py::module& m, std::string const& vtSuffix); + +template void define_transformations_int(py::module& m, std::string const& vtSuffix); +template void define_transformations_int(py::module& m, std::string const& vtSuffix); +template void define_transformations_int(py::module& m, std::string const& vtSuffix); +template void define_transformations_int(py::module& m, std::string const& vtSuffix); \ No newline at end of file diff --git a/src/pomdp/transformations.h b/src/pomdp/transformations.h index 4410946f9c..fca131f8ae 100644 --- a/src/pomdp/transformations.h +++ b/src/pomdp/transformations.h @@ -2,6 +2,8 @@ #include "common.h" -void define_transformations_nt(py::module& m); -template -void define_transformations(py::module& m, std::string const& vtSuffix); +void define_transformations_nt(py::module &m); +template +void define_transformations(py::module &m, std::string const &vtSuffix); +template +void define_transformations_int(py::module &m, std::string const &vtSuffix); diff --git a/src/storage/model.cpp b/src/storage/model.cpp index f2fbb84302..2ca7fa2232 100644 --- a/src/storage/model.cpp +++ b/src/storage/model.cpp @@ -142,6 +142,9 @@ void define_model(py::module& m) { .def("_as_sparse_pdtmc", [](ModelBase &modelbase) { return modelbase.as>(); }, "Get model as sparse pDTMC") + .def("_as_sparse_idtmc", [](ModelBase &modelbase) { + return modelbase.as>(); + }, "Get model as sparse interval DTMC") .def("_as_sparse_mdp", [](ModelBase &modelbase) { return modelbase.as>(); }, "Get model as sparse MDP") @@ -157,6 +160,9 @@ void define_model(py::module& m) { .def("_as_sparse_pomdp", [](ModelBase &modelbase) { return modelbase.as>(); }, "Get model as sparse POMDP") + .def("_as_sparse_ipomdp", [](ModelBase &modelbase) { + return modelbase.as>(); + }, "Get model as sparse interval POMDP") .def("_as_sparse_ppomdp", [](ModelBase &modelbase) { return modelbase.as>(); }, "Get model as sparse pPOMDP") From 8171efa18c38d84be55f39a0003a1c3071c77ba2 Mon Sep 17 00:00:00 2001 From: Luko van der Maas Date: Thu, 21 Nov 2024 10:06:46 +0100 Subject: [PATCH 04/35] Added back risk --- src/pomdp/generator.cpp | 88 ++++++++++++++++++++++++++++++----------- 1 file changed, 64 insertions(+), 24 deletions(-) diff --git a/src/pomdp/generator.cpp b/src/pomdp/generator.cpp index 692575882a..d934093ce5 100644 --- a/src/pomdp/generator.cpp +++ b/src/pomdp/generator.cpp @@ -1,33 +1,73 @@ #include "generator.h" #include "storm-pomdp/generator/GenerateMonitorVerifier.h" #include "storm/adapters/RationalNumberAdapter.h" +#include "storm/storage/expressions/ExpressionManager.h" -template using GenerateMonitorVerifier = storm::generator::GenerateMonitorVerifier; -template using SparseDtmc = storm::models::sparse::Dtmc; -template using SparseMdp = storm::models::sparse::Mdp; -template using SparsePomdp = storm::models::sparse::Pomdp; -template using GenerateMonitorVerifierOptions = typename storm::generator::GenerateMonitorVerifier::Options; +template +using GenerateMonitorVerifier = + storm::generator::GenerateMonitorVerifier; +template +using SparseDtmc = storm::models::sparse::Dtmc; +template +using SparseMdp = storm::models::sparse::Mdp; +template +using SparsePomdp = storm::models::sparse::Pomdp; +template +using GenerateMonitorVerifierOptions = + typename storm::generator::GenerateMonitorVerifier::Options; -template -void define_verimon_generator(py::module& m, std::string const& vtSuffix) { - py::class_, std::shared_ptr>> mv(m, ("MonitorVerifier" + vtSuffix).c_str(), "Container for monitor verifier POMDP with associated objects"); - mv.def(py::init&, const std::map, uint32_t>&>(), py::arg("product"), py::arg("observation_map")); - mv.def("get_product", &storm::generator::MonitorVerifier::getProduct, py::return_value_policy::copy); - mv.def_property_readonly("observation_map", &storm::generator::MonitorVerifier::getObservationMap, py::return_value_policy::copy); +template +void define_verimon_generator(py::module &m, std::string const &vtSuffix) { + py::class_, + std::shared_ptr>> + mv(m, ("MonitorVerifier" + vtSuffix).c_str(), + "Container for monitor verifier POMDP with associated objects"); + mv.def(py::init &, + const std::map, uint32_t> &>(), + py::arg("product"), py::arg("observation_map")); + mv.def("get_product", + &storm::generator::MonitorVerifier::getProduct, + py::return_value_policy::copy); + mv.def_property_readonly( + "observation_map", + &storm::generator::MonitorVerifier::getObservationMap, + py::return_value_policy::copy); - py::class_> gmv(m, ("GenerateMonitorVerifier" + vtSuffix).c_str(), "Generator of POMDP used in verifying monitors against markov chains"); - gmv.def(py::init const&, SparseMdp const&, GenerateMonitorVerifierOptions const&>(), py::arg("mc"), py::arg("monitor"), py::arg("options")); - gmv.def("create_product", &storm::generator::GenerateMonitorVerifier::createProduct, py::return_value_policy::copy, "Created the verification POMDP"); - gmv.def("set_risk", &storm::generator::GenerateMonitorVerifier::setRisk, py::arg("risk")); + py::class_> gmv( + m, ("GenerateMonitorVerifier" + vtSuffix).c_str(), + "Generator of POMDP used in verifying monitors against markov chains"); + gmv.def(py::init const &, SparseMdp const &, + std::shared_ptr &, + GenerateMonitorVerifierOptions const &>(), + py::arg("mc"), py::arg("monitor"), py::arg("expr_manager"), + py::arg("options")); + gmv.def("create_product", + &storm::generator::GenerateMonitorVerifier::createProduct, + py::return_value_policy::copy, "Created the verification POMDP"); + gmv.def("set_risk", + &storm::generator::GenerateMonitorVerifier::setRisk, + py::arg("risk")); - py::class_> gmvopts(m, ("GenerateMonitorVerifier" + vtSuffix + "Options").c_str(), "Options for corresponding generator"); - gmvopts.def(py::init<>()); - gmvopts.def_readwrite("good_label", &GenerateMonitorVerifierOptions::goodLabel); - gmvopts.def_readwrite("accepting_label", &GenerateMonitorVerifierOptions::acceptingLabel); - gmvopts.def_readwrite("step_prefix", &GenerateMonitorVerifierOptions::stepPrefix); - gmvopts.def_readwrite("horizon_label", &GenerateMonitorVerifierOptions::horizonLabel); - gmvopts.def_readwrite("use_risk", &GenerateMonitorVerifierOptions::useRisk); + py::class_> gmvopts( + m, ("GenerateMonitorVerifier" + vtSuffix + "Options").c_str(), + "Options for corresponding generator"); + gmvopts.def(py::init<>()); + gmvopts.def_readwrite("good_label", + &GenerateMonitorVerifierOptions::goodLabel); + gmvopts.def_readwrite( + "accepting_label", + &GenerateMonitorVerifierOptions::acceptingLabel); + gmvopts.def_readwrite("step_prefix", + &GenerateMonitorVerifierOptions::stepPrefix); + gmvopts.def_readwrite( + "horizon_label", + &GenerateMonitorVerifierOptions::horizonLabel); + gmvopts.def_readwrite("use_risk", + &GenerateMonitorVerifierOptions::useRisk); } -template void define_verimon_generator(py::module& m, std::string const& vtSuffix); -template void define_verimon_generator(py::module& m, std::string const& vtSuffix); +template void define_verimon_generator(py::module &m, + std::string const &vtSuffix); +template void +define_verimon_generator(py::module &m, + std::string const &vtSuffix); From 8544b1fdc832cb678e867fcbee78f6d1679898ad Mon Sep 17 00:00:00 2001 From: Luko van der Maas Date: Thu, 28 Nov 2024 10:34:43 +0100 Subject: [PATCH 05/35] Add default observation map --- src/pomdp/generator.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/pomdp/generator.cpp b/src/pomdp/generator.cpp index d934093ce5..a7dde063ab 100644 --- a/src/pomdp/generator.cpp +++ b/src/pomdp/generator.cpp @@ -2,6 +2,8 @@ #include "storm-pomdp/generator/GenerateMonitorVerifier.h" #include "storm/adapters/RationalNumberAdapter.h" #include "storm/storage/expressions/ExpressionManager.h" +#include +#include template using GenerateMonitorVerifier = @@ -23,8 +25,10 @@ void define_verimon_generator(py::module &m, std::string const &vtSuffix) { mv(m, ("MonitorVerifier" + vtSuffix).c_str(), "Container for monitor verifier POMDP with associated objects"); mv.def(py::init &, - const std::map, uint32_t> &>(), - py::arg("product"), py::arg("observation_map")); + const std::map, uint32_t> &, + const std::map &>(), + py::arg("product"), py::arg("observation_map"), + py::arg("default_action_map")); mv.def("get_product", &storm::generator::MonitorVerifier::getProduct, py::return_value_policy::copy); @@ -32,6 +36,10 @@ void define_verimon_generator(py::module &m, std::string const &vtSuffix) { "observation_map", &storm::generator::MonitorVerifier::getObservationMap, py::return_value_policy::copy); + mv.def_property_readonly("default_action_map", + &storm::generator::MonitorVerifier< + ValueType>::getObservationDefaultAction, + py::return_value_policy::copy); py::class_> gmv( m, ("GenerateMonitorVerifier" + vtSuffix).c_str(), From e7923ca9a2b7779e1abfea3520c74db6ee50f68a Mon Sep 17 00:00:00 2001 From: Luko van der Maas Date: Wed, 11 Dec 2024 14:42:46 +0100 Subject: [PATCH 06/35] remove interval from stormpy again --- Dockerfile | 3 +- src/mod_pomdp.cpp | 112 +++++++++++++++++++++- src/pomdp/transformations.cpp | 173 +++++++++++++++++++++++----------- 3 files changed, 228 insertions(+), 60 deletions(-) diff --git a/Dockerfile b/Dockerfile index ba5920cf76..7563365cf0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,9 +6,8 @@ # --build-arg STORM_BASE= # Set Storm base image -ARG STORM_BASE=movesrwth/storm:stable +ARG STORM_BASE=lukovdm/storm:premise FROM $STORM_BASE -MAINTAINER Matthias Volk # Configuration arguments diff --git a/src/mod_pomdp.cpp b/src/mod_pomdp.cpp index e51d579968..38dde83505 100644 --- a/src/mod_pomdp.cpp +++ b/src/mod_pomdp.cpp @@ -7,6 +7,13 @@ #include "pomdp/tracker.h" #include "pomdp/transformations.h" #include +#include + +template std::string streamToString(const T &value) { + std::stringstream sstream; + sstream << value; + return sstream.str(); +} PYBIND11_MODULE(pomdp, m) { m.doc() = "Functionality for POMDP analysis"; @@ -27,6 +34,109 @@ PYBIND11_MODULE(pomdp, m) { define_transformations_int(m, "Double"); define_transformations_int(m, "Exact"); define_transformations_int(m, "Rf"); - define_transformations_int(m, "Interval"); define_belief_exploration(m, "Double"); + + // using Interval = storm::Interval; + + // py::class_(m, "Interval") + // .def(py::init()) + // .def(py::init()) + // .def(py::init()) + + // .def_static("unboundedInterval", &Interval::unboundedInterval) + // .def_static("emptyInterval", &Interval::emptyInterval) + // .def_static("zeroInterval", &Interval::zeroInterval) + + // // TODO: does not work :-( + // //.def_property("lower", &Interval::lower, &Interval::setLower) + // .def("lower", &Interval::lower, + // py::return_value_policy::reference_internal) + // .def("setLower", &Interval::setLower) + // .def("upper", &Interval::upper, + // py::return_value_policy::reference_internal) + // .def("setUpper", &Interval::setUpper) + + // .def("isInfinite", &Interval::isInfinite) + // .def("isUnbounded", &Interval::isUnbounded) + // .def("isHalfBounded", &Interval::isHalfBounded) + // .def("isEmpty", &Interval::isEmpty) + // .def("isPointInterval", &Interval::isPointInterval) + // .def("isOpenInterval", &Interval::isOpenInterval) + // .def("isClosedInterval", &Interval::isClosedInterval) + // .def("isZero", &Interval::isZero) + // .def("isOne", &Interval::isOne) + // .def("isPositive", &Interval::isPositive) + // .def("isNegative", &Interval::isNegative) + // .def("isSemiPositive", &Interval::isSemiPositive) + // .def("isSemiNegative", &Interval::isSemiNegative) + + // .def("integralPart", &Interval::integralPart) + // .def("diameter", &Interval::diameter) + // .def("center", [](const Interval &i) { return i.center(); }) + // .def("sample", &Interval::sample) + // .def("contains", + // [](const Interval &i, const double &r) { return i.contains(r); + // }) + // .def("contains", + // [](const Interval &i, const Interval &i2) { return + // i.contains(i2); }) + // .def("meets", &Interval::meets) + // .def("isSubset", &Interval::isSubset) + // .def("isProperSubset", &Interval::isProperSubset) + + // .def("div", &Interval::div) + + // .def("inverse", &Interval::inverse) + // .def("abs", &Interval::abs) + // .def("__pow__", + // [](const Interval &i, carl::uint exp) { return i.pow(exp); }) + // .def("intersectsWith", &Interval::intersectsWith) + // .def("intersect", &Interval::intersect) + // .def("unite", &Interval::unite) + // .def("difference", &Interval::difference) + // .def("complement", &Interval::complement) + // .def("symmetricDifference", &Interval::symmetricDifference) + + // .def(py::self + py::self) + // .def(double() + py::self) + // .def(py::self + double()) + // .def(py::self += py::self) + // .def(py::self += double()) + + // .def(-py::self) + + // .def(py::self - py::self) + // .def(double() - py::self) + // .def(py::self - double()) + // .def(py::self -= py::self) + // .def(py::self -= double()) + + // .def(py::self * py::self) + // .def(double() * py::self) + // .def(py::self * double()) + // .def(py::self *= py::self) + // .def(py::self *= double()) + + // .def(py::self / double()) + // .def(py::self /= double()) + + // .def(py::self == py::self) + // .def(py::self != py::self) + // .def(py::self <= py::self) + // .def(py::self <= double()) + // .def(double() <= py::self) + // .def(py::self >= py::self) + // .def(py::self >= double()) + // .def(double() >= py::self) + // .def(py::self < py::self) + // .def(py::self < double()) + // .def(double() < py::self) + // .def(py::self > py::self) + // .def(py::self > double()) + // .def(double() > py::self) + + // .def("__str__", &streamToString); + + define_transformations_int(m, "Interval"); } diff --git a/src/pomdp/transformations.cpp b/src/pomdp/transformations.cpp index f9331ddac7..bd2dd54400 100644 --- a/src/pomdp/transformations.cpp +++ b/src/pomdp/transformations.cpp @@ -1,83 +1,142 @@ #include "transformations.h" -#include -#include -#include #include +#include +#include #include +#include #include -#include #include -template -std::shared_ptr> make_canonic(storm::models::sparse::Pomdp const& pomdp) { - storm::transformer::MakePOMDPCanonic makeCanonic(pomdp); - return makeCanonic.transform(); +template +std::shared_ptr> +make_canonic(storm::models::sparse::Pomdp const &pomdp) { + storm::transformer::MakePOMDPCanonic makeCanonic(pomdp); + return makeCanonic.transform(); } -template -std::shared_ptr> unfold_memory(storm::models::sparse::Pomdp const& pomdp, storm::storage::PomdpMemory const& memory, bool addMemoryLabels, bool keepStateValuations) { - storm::transformer::PomdpMemoryUnfolder unfolder(pomdp, memory, addMemoryLabels, keepStateValuations); - return unfolder.transform(); +template +std::shared_ptr> +unfold_memory(storm::models::sparse::Pomdp const &pomdp, + storm::storage::PomdpMemory const &memory, bool addMemoryLabels, + bool keepStateValuations) { + storm::transformer::PomdpMemoryUnfolder unfolder( + pomdp, memory, addMemoryLabels, keepStateValuations); + return unfolder.transform(); } -template -std::shared_ptr> make_simple(storm::models::sparse::Pomdp const& pomdp, bool keepStateValuations) { - storm::transformer::BinaryPomdpTransformer transformer; - return transformer.transform(pomdp,true, keepStateValuations).transformedPomdp; +template +std::shared_ptr> +make_simple(storm::models::sparse::Pomdp const &pomdp, + bool keepStateValuations) { + storm::transformer::BinaryPomdpTransformer transformer; + return transformer.transform(pomdp, true, keepStateValuations) + .transformedPomdp; } -template -std::shared_ptr> apply_unknown_fsc(storm::models::sparse::Pomdp const& pomdp, storm::transformer::PomdpFscApplicationMode const& applicationMode) { - storm::transformer::ApplyFiniteSchedulerToPomdp transformer(pomdp); - return transformer.transform(applicationMode); +template +std::shared_ptr> +apply_unknown_fsc( + storm::models::sparse::Pomdp const &pomdp, + storm::transformer::PomdpFscApplicationMode const &applicationMode) { + storm::transformer::ApplyFiniteSchedulerToPomdp transformer(pomdp); + return transformer.transform(applicationMode); } -template -std::shared_ptr> unfold_trace(storm::models::sparse::Pomdp const& pomdp, std::shared_ptr& exprManager, std::vector const& observationTrace, std::vector const& riskDef, bool rejectionSampling=true) { - storm::pomdp::ObservationTraceUnfolderOptions options = storm::pomdp::ObservationTraceUnfolderOptions(); - options.rejectionSampling = rejectionSampling; - storm::pomdp::ObservationTraceUnfolder transformer(pomdp, riskDef, exprManager, options); - return transformer.transform(observationTrace); +template +std::shared_ptr> unfold_trace( + storm::models::sparse::Pomdp const &pomdp, + std::shared_ptr &exprManager, + std::vector const &observationTrace, + std::vector const &riskDef, bool rejectionSampling = true) { + storm::pomdp::ObservationTraceUnfolderOptions options = + storm::pomdp::ObservationTraceUnfolderOptions(); + options.rejectionSampling = rejectionSampling; + storm::pomdp::ObservationTraceUnfolder transformer( + pomdp, riskDef, exprManager, options); + return transformer.transform(observationTrace); } // STANDARD, SIMPLE_LINEAR, SIMPLE_LINEAR_INVERSE, SIMPLE_LOG, FULL void define_transformations_nt(py::module &m) { - py::enum_(m, "PomdpFscApplicationMode") - .value("standard", storm::transformer::PomdpFscApplicationMode::STANDARD) - .value("simple_linear", storm::transformer::PomdpFscApplicationMode::SIMPLE_LINEAR) - .value("simple_linear_inverse", storm::transformer::PomdpFscApplicationMode::SIMPLE_LINEAR_INVERSE) - .value("simple_log", storm::transformer::PomdpFscApplicationMode::SIMPLE_LOG) - .value("full", storm::transformer::PomdpFscApplicationMode::FULL) - ; + py::enum_( + m, "PomdpFscApplicationMode") + .value("standard", storm::transformer::PomdpFscApplicationMode::STANDARD) + .value("simple_linear", + storm::transformer::PomdpFscApplicationMode::SIMPLE_LINEAR) + .value("simple_linear_inverse", + storm::transformer::PomdpFscApplicationMode::SIMPLE_LINEAR_INVERSE) + .value("simple_log", + storm::transformer::PomdpFscApplicationMode::SIMPLE_LOG) + .value("full", storm::transformer::PomdpFscApplicationMode::FULL); - py::class_ unfolderOptions(m, "ObservationTraceUnfolderOptions", "Options for the ObservationTraceUnfolder"); - unfolderOptions.def(py::init<>()); - unfolderOptions.def_readwrite("rejection_sampling", &storm::pomdp::ObservationTraceUnfolderOptions::rejectionSampling); + py::class_ unfolderOptions( + m, "ObservationTraceUnfolderOptions", + "Options for the ObservationTraceUnfolder"); + unfolderOptions.def(py::init<>()); + unfolderOptions.def_readwrite( + "rejection_sampling", + &storm::pomdp::ObservationTraceUnfolderOptions::rejectionSampling); } -template -void define_transformations(py::module& m, std::string const& vtSuffix) { - m.def(("_make_canonic_" + vtSuffix).c_str(), &make_canonic, "Return a canonicly-ordered POMDP", py::arg("pomdp")); - m.def(("_unfold_memory_" + vtSuffix).c_str(), &unfold_memory, "Unfold memory into a POMDP", py::arg("pomdp"), py::arg("memorystructure"), py::arg("memorylabels") = false, py::arg("keep_state_valuations")=false); - m.def(("_make_simple_"+ vtSuffix).c_str(), &make_simple, "Make POMDP simple", py::arg("pomdp"), py::arg("keep_state_valuations")=false); - m.def(("_apply_unknown_fsc_" + vtSuffix).c_str(), &apply_unknown_fsc, "Apply unknown FSC",py::arg("pomdp"), py::arg("application_mode")=storm::transformer::PomdpFscApplicationMode::SIMPLE_LINEAR); +template +void define_transformations(py::module &m, std::string const &vtSuffix) { + m.def(("_make_canonic_" + vtSuffix).c_str(), &make_canonic, + "Return a canonicly-ordered POMDP", py::arg("pomdp")); + m.def(("_unfold_memory_" + vtSuffix).c_str(), &unfold_memory, + "Unfold memory into a POMDP", py::arg("pomdp"), + py::arg("memorystructure"), py::arg("memorylabels") = false, + py::arg("keep_state_valuations") = false); + m.def(("_make_simple_" + vtSuffix).c_str(), &make_simple, + "Make POMDP simple", py::arg("pomdp"), + py::arg("keep_state_valuations") = false); + m.def(("_apply_unknown_fsc_" + vtSuffix).c_str(), + &apply_unknown_fsc, "Apply unknown FSC", py::arg("pomdp"), + py::arg("application_mode") = + storm::transformer::PomdpFscApplicationMode::SIMPLE_LINEAR); } -template -void define_transformations_int(py::module& m, std::string const& vtSuffix) { - py::class_> unfolder(m, ("ObservationTraceUnfolder" + vtSuffix).c_str(), "Unfolds observation traces in models"); - unfolder.def(py::init const&, std::vector const&, std::shared_ptr&, storm::pomdp::ObservationTraceUnfolderOptions const&>(), py::arg("model"), py::arg("risk"), py::arg("expression_manager"), py::arg("options")); - unfolder.def("is_rejection_sampling_set", &storm::pomdp::ObservationTraceUnfolder::isRejectionSamplingSet); - unfolder.def("transform", &storm::pomdp::ObservationTraceUnfolder::transform, py::arg("trace")); - unfolder.def("extend", &storm::pomdp::ObservationTraceUnfolder::extend, py::arg("new_observation")); - unfolder.def("reset", &storm::pomdp::ObservationTraceUnfolder::reset, py::arg("new_observation")); +template +void define_transformations_int(py::module &m, std::string const &vtSuffix) { + py::class_> unfolder( + m, ("ObservationTraceUnfolder" + vtSuffix).c_str(), + "Unfolds observation traces in models"); + unfolder.def( + py::init const &, + std::vector const &, + std::shared_ptr &, + storm::pomdp::ObservationTraceUnfolderOptions const &>(), + py::arg("model"), py::arg("risk"), py::arg("expression_manager"), + py::arg("options")); + unfolder.def("is_rejection_sampling_set", + &storm::pomdp::ObservationTraceUnfolder< + ValueType>::isRejectionSamplingSet); + unfolder.def("transform", + &storm::pomdp::ObservationTraceUnfolder::transform, + py::arg("trace")); + unfolder.def("reset", + &storm::pomdp::ObservationTraceUnfolder::reset, + py::arg("new_observation")); + unfolder.def("extend", + &storm::pomdp::ObservationTraceUnfolder::extend, + py::arg("new_observation")); } -template void define_transformations(py::module& m, std::string const& vtSuffix); -template void define_transformations(py::module& m, std::string const& vtSuffix); -template void define_transformations(py::module& m, std::string const& vtSuffix); +template void define_transformations(py::module &m, + std::string const &vtSuffix); +template void +define_transformations(py::module &m, + std::string const &vtSuffix); +template void +define_transformations(py::module &m, + std::string const &vtSuffix); -template void define_transformations_int(py::module& m, std::string const& vtSuffix); -template void define_transformations_int(py::module& m, std::string const& vtSuffix); -template void define_transformations_int(py::module& m, std::string const& vtSuffix); -template void define_transformations_int(py::module& m, std::string const& vtSuffix); \ No newline at end of file +template void define_transformations_int(py::module &m, + std::string const &vtSuffix); +template void +define_transformations_int(py::module &m, + std::string const &vtSuffix); +template void define_transformations_int( + py::module &m, std::string const &vtSuffix); +template void +define_transformations_int(py::module &m, + std::string const &vtSuffix); \ No newline at end of file From 9d87e3b7df00001e02a8d6f9f6b12f5d0cc80fa7 Mon Sep 17 00:00:00 2001 From: Luko van der Maas Date: Thu, 12 Dec 2024 15:02:02 +0100 Subject: [PATCH 07/35] fix pycarl inclusion --- CMakeLists.txt | 49 +++++++++++++++++----------------- lib/stormpy/__init__.py | 2 +- lib/stormpy/pycarl/__init__.py | 3 ++- setup.py | 2 +- 4 files changed, 29 insertions(+), 27 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8da0de3ed3..0665f4f86d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -152,9 +152,10 @@ stormpy_module(utility) # Pycarl Core ###### file(GLOB_RECURSE pycarl_core_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/pycarl/pycarl_core/*.cpp) -pybind11_add_module(pycarl.core ${CMAKE_CURRENT_SOURCE_DIR}/src/pycarl/mod_core.cpp ${pycarl_core_SOURCES}) -target_include_directories(pycarl.core PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/src/) -target_link_libraries(pycarl.core PRIVATE lib_carl) +pybind11_add_module(pycarl_core ${CMAKE_CURRENT_SOURCE_DIR}/src/pycarl/mod_core.cpp ${pycarl_core_SOURCES}) +target_include_directories(pycarl_core PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/src/) +target_link_libraries(pycarl_core PRIVATE lib_carl) +set_target_properties(pycarl_core PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pycarl" OUTPUT_NAME "pycarl_core") configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/pycarl_core_config.py.in ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pycarl/_config.py @ONLY) # Optional modules @@ -218,27 +219,27 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/pycarl_cln_config.py.in ${CMAKE # Parse -####### -file(GLOB_RECURSE PYCARL_PARSE_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/pycarl/parse/*.cpp) +# ####### +# file(GLOB_RECURSE PYCARL_PARSE_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/pycarl/parse/*.cpp) -pybind11_add_module(pycarl.parse ${CMAKE_CURRENT_SOURCE_DIR}/src/pycarl/mod_parse.cpp ${PYCARL_PARSE_SOURCES}) -target_include_directories(pycarl.parse PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/src) -target_link_libraries(pycarl.parse PRIVATE lib_carl carl-parser) -set_target_properties(pycarl.parse PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pycarl/parse" OUTPUT_NAME "parse") -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/pycarl_parser_config.py.in ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pycarl/parse/_config.py @ONLY) +# pybind11_add_module(pycarl.parse ${CMAKE_CURRENT_SOURCE_DIR}/src/pycarl/mod_parse.cpp ${PYCARL_PARSE_SOURCES}) +# target_include_directories(pycarl.parse PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/src) +# target_link_libraries(pycarl.parse PRIVATE lib_carl carl-parser) +# set_target_properties(pycarl.parse PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pycarl/parse" OUTPUT_NAME "parse") +# configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/pycarl_parser_config.py.in ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pycarl/parse/_config.py @ONLY) -# Typed parse -file(GLOB_RECURSE PYCARL_TYPED_PARSE_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/pycarl/typed_parse/*.cpp) +# # Typed parse +# file(GLOB_RECURSE PYCARL_TYPED_PARSE_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/pycarl/typed_parse/*.cpp) # GMP -pybind11_add_module(pycarl.parse-gmp ${CMAKE_CURRENT_SOURCE_DIR}/src/pycarl/mod_typed_parse.cpp ${PYCARL_TYPED_PARSE_SOURCES}) -target_include_directories(pycarl.parse-gmp PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/src) -target_link_libraries(pycarl.parse-gmp PRIVATE lib_carl carl-parser) -set_target_properties(pycarl.parse-gmp PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pycarl/gmp/parse" OUTPUT_NAME "parse") -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/pycarl_parser_config.py.in ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pycarl/gmp/parse/_config.py @ONLY) -# CLN -pybind11_add_module(pycarl.parse-cln ${CMAKE_CURRENT_SOURCE_DIR}/src/pycarl/mod_typed_parse.cpp ${PYCARL_TYPED_PARSE_SOURCES}) -target_include_directories(pycarl.parse-cln PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/src) -target_link_libraries(pycarl.parse-cln PRIVATE lib_carl carl-parser) -target_compile_definitions(pycarl.parse-cln PUBLIC "PYCARL_USE_CLN=ON") -set_target_properties(pycarl.parse-cln PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pycarl/cln/parse" OUTPUT_NAME "parse") -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/pycarl_parser_config.py.in ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pycarl/cln/parse/_config.py @ONLY) +# pybind11_add_module(pycarl.parse-gmp ${CMAKE_CURRENT_SOURCE_DIR}/src/pycarl/mod_typed_parse.cpp ${PYCARL_TYPED_PARSE_SOURCES}) +# target_include_directories(pycarl.parse-gmp PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/src) +# target_link_libraries(pycarl.parse-gmp PRIVATE lib_carl carl-parser) +# set_target_properties(pycarl.parse-gmp PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pycarl/gmp/parse" OUTPUT_NAME "parse") +# configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/pycarl_parser_config.py.in ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pycarl/gmp/parse/_config.py @ONLY) +# # CLN +# pybind11_add_module(pycarl.parse-cln ${CMAKE_CURRENT_SOURCE_DIR}/src/pycarl/mod_typed_parse.cpp ${PYCARL_TYPED_PARSE_SOURCES}) +# target_include_directories(pycarl.parse-cln PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/src) +# target_link_libraries(pycarl.parse-cln PRIVATE lib_carl carl-parser) +# target_compile_definitions(pycarl.parse-cln PUBLIC "PYCARL_USE_CLN=ON") +# set_target_properties(pycarl.parse-cln PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pycarl/cln/parse" OUTPUT_NAME "parse") +# configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/pycarl_parser_config.py.in ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pycarl/cln/parse/_config.py @ONLY) diff --git a/lib/stormpy/__init__.py b/lib/stormpy/__init__.py index 56541b2957..77b414eed6 100644 --- a/lib/stormpy/__init__.py +++ b/lib/stormpy/__init__.py @@ -12,7 +12,7 @@ from .logic import * from .exceptions import * -from stormpy.pycarl import Variable # needed for building parametric models +# from .pycarl import Variable # needed for building parametric models __version__ = "unknown" try: diff --git a/lib/stormpy/pycarl/__init__.py b/lib/stormpy/pycarl/__init__.py index cf9be2f3fe..c598a39559 100644 --- a/lib/stormpy/pycarl/__init__.py +++ b/lib/stormpy/pycarl/__init__.py @@ -3,7 +3,8 @@ if sys.version_info[0] == 2: raise ImportError("Python 2.x is not supported for pycarl.") -from stormpy.pycarl_core import * +from . import pycarl_core +from .pycarl_core import * from . import infinity from stormpy.pycarl import _config diff --git a/setup.py b/setup.py index 51c8a61378..b447d6ca14 100755 --- a/setup.py +++ b/setup.py @@ -287,7 +287,7 @@ def finalize_options(self): package_data={"stormpy.examples": ["examples/files/*"]}, ext_package="stormpy", ext_modules=[ - CMakeExtension("pycarl.core"), + CMakeExtension("pycarl_core"), CMakeExtension("pycarl.cln"), CMakeExtension("pycarl.gmp"), CMakeExtension("pycarl.formula"), From cb10f57243fe0e0352114c190c612736444107c8 Mon Sep 17 00:00:00 2001 From: Luko van der Maas Date: Thu, 12 Dec 2024 15:02:02 +0100 Subject: [PATCH 08/35] fix pycarl inclusion --- CMakeLists.txt | 49 +++++++++++++++++----------------- lib/stormpy/__init__.py | 2 +- lib/stormpy/pycarl/__init__.py | 3 ++- setup.py | 45 ++++++++++++++++--------------- 4 files changed, 51 insertions(+), 48 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4aacc0b80f..ad47b3d527 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -146,9 +146,10 @@ stormpy_module(utility) # Pycarl Core ###### file(GLOB_RECURSE pycarl_core_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/pycarl/pycarl_core/*.cpp) -pybind11_add_module(pycarl.core ${CMAKE_CURRENT_SOURCE_DIR}/src/pycarl/mod_core.cpp ${pycarl_core_SOURCES}) -target_include_directories(pycarl.core PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/src/) -target_link_libraries(pycarl.core PRIVATE lib_carl) +pybind11_add_module(pycarl_core ${CMAKE_CURRENT_SOURCE_DIR}/src/pycarl/mod_core.cpp ${pycarl_core_SOURCES}) +target_include_directories(pycarl_core PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/src/) +target_link_libraries(pycarl_core PRIVATE lib_carl) +set_target_properties(pycarl_core PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pycarl" OUTPUT_NAME "pycarl_core") configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/pycarl_core_config.py.in ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pycarl/_config.py @ONLY) # Optional modules @@ -212,27 +213,27 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/pycarl_cln_config.py.in ${CMAKE # Parse -####### -file(GLOB_RECURSE PYCARL_PARSE_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/pycarl/parse/*.cpp) +# ####### +# file(GLOB_RECURSE PYCARL_PARSE_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/pycarl/parse/*.cpp) -pybind11_add_module(pycarl.parse ${CMAKE_CURRENT_SOURCE_DIR}/src/pycarl/mod_parse.cpp ${PYCARL_PARSE_SOURCES}) -target_include_directories(pycarl.parse PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/src) -target_link_libraries(pycarl.parse PRIVATE lib_carl carl-parser) -set_target_properties(pycarl.parse PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pycarl/parse" OUTPUT_NAME "parse") -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/pycarl_parser_config.py.in ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pycarl/parse/_config.py @ONLY) +# pybind11_add_module(pycarl.parse ${CMAKE_CURRENT_SOURCE_DIR}/src/pycarl/mod_parse.cpp ${PYCARL_PARSE_SOURCES}) +# target_include_directories(pycarl.parse PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/src) +# target_link_libraries(pycarl.parse PRIVATE lib_carl carl-parser) +# set_target_properties(pycarl.parse PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pycarl/parse" OUTPUT_NAME "parse") +# configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/pycarl_parser_config.py.in ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pycarl/parse/_config.py @ONLY) -# Typed parse -file(GLOB_RECURSE PYCARL_TYPED_PARSE_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/pycarl/typed_parse/*.cpp) +# # Typed parse +# file(GLOB_RECURSE PYCARL_TYPED_PARSE_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/pycarl/typed_parse/*.cpp) # GMP -pybind11_add_module(pycarl.parse-gmp ${CMAKE_CURRENT_SOURCE_DIR}/src/pycarl/mod_typed_parse.cpp ${PYCARL_TYPED_PARSE_SOURCES}) -target_include_directories(pycarl.parse-gmp PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/src) -target_link_libraries(pycarl.parse-gmp PRIVATE lib_carl carl-parser) -set_target_properties(pycarl.parse-gmp PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pycarl/gmp/parse" OUTPUT_NAME "parse") -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/pycarl_parser_config.py.in ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pycarl/gmp/parse/_config.py @ONLY) -# CLN -pybind11_add_module(pycarl.parse-cln ${CMAKE_CURRENT_SOURCE_DIR}/src/pycarl/mod_typed_parse.cpp ${PYCARL_TYPED_PARSE_SOURCES}) -target_include_directories(pycarl.parse-cln PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/src) -target_link_libraries(pycarl.parse-cln PRIVATE lib_carl carl-parser) -target_compile_definitions(pycarl.parse-cln PUBLIC "PYCARL_USE_CLN=ON") -set_target_properties(pycarl.parse-cln PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pycarl/cln/parse" OUTPUT_NAME "parse") -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/pycarl_parser_config.py.in ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pycarl/cln/parse/_config.py @ONLY) +# pybind11_add_module(pycarl.parse-gmp ${CMAKE_CURRENT_SOURCE_DIR}/src/pycarl/mod_typed_parse.cpp ${PYCARL_TYPED_PARSE_SOURCES}) +# target_include_directories(pycarl.parse-gmp PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/src) +# target_link_libraries(pycarl.parse-gmp PRIVATE lib_carl carl-parser) +# set_target_properties(pycarl.parse-gmp PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pycarl/gmp/parse" OUTPUT_NAME "parse") +# configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/pycarl_parser_config.py.in ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pycarl/gmp/parse/_config.py @ONLY) +# # CLN +# pybind11_add_module(pycarl.parse-cln ${CMAKE_CURRENT_SOURCE_DIR}/src/pycarl/mod_typed_parse.cpp ${PYCARL_TYPED_PARSE_SOURCES}) +# target_include_directories(pycarl.parse-cln PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/src) +# target_link_libraries(pycarl.parse-cln PRIVATE lib_carl carl-parser) +# target_compile_definitions(pycarl.parse-cln PUBLIC "PYCARL_USE_CLN=ON") +# set_target_properties(pycarl.parse-cln PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pycarl/cln/parse" OUTPUT_NAME "parse") +# configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/pycarl_parser_config.py.in ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pycarl/cln/parse/_config.py @ONLY) diff --git a/lib/stormpy/__init__.py b/lib/stormpy/__init__.py index aa90005ebd..5ba3ea7a87 100644 --- a/lib/stormpy/__init__.py +++ b/lib/stormpy/__init__.py @@ -12,7 +12,7 @@ from .logic import * from .exceptions import * -from stormpy.pycarl import Variable # needed for building parametric models +# from .pycarl import Variable # needed for building parametric models __version__ = "unknown" try: diff --git a/lib/stormpy/pycarl/__init__.py b/lib/stormpy/pycarl/__init__.py index cf9be2f3fe..c598a39559 100644 --- a/lib/stormpy/pycarl/__init__.py +++ b/lib/stormpy/pycarl/__init__.py @@ -3,7 +3,8 @@ if sys.version_info[0] == 2: raise ImportError("Python 2.x is not supported for pycarl.") -from stormpy.pycarl_core import * +from . import pycarl_core +from .pycarl_core import * from . import infinity from stormpy.pycarl import _config diff --git a/setup.py b/setup.py index 6459b79e7d..1c36ecb67f 100755 --- a/setup.py +++ b/setup.py @@ -283,28 +283,29 @@ def finalize_options(self): packages=find_packages('lib'), package_dir={'': 'lib'}, include_package_data=True, - package_data={'stormpy.examples': ['examples/files/*']}, - ext_package='stormpy', - ext_modules=[CMakeExtension('pycarl.core'), - CMakeExtension("pycarl.cln"), - CMakeExtension("pycarl.gmp"), - CMakeExtension("pycarl.formula"), - CMakeExtension("pycarl.formula-cln"), - CMakeExtension("pycarl.formula-gmp"), - CMakeExtension("pycarl.parse"), - CMakeExtension("pycarl.parse-gmp"), - CMakeExtension("pycarl.parse-cln"), - CMakeExtension('core'), - CMakeExtension('info'), - CMakeExtension('logic'), - CMakeExtension('storage'), - CMakeExtension('utility'), - CMakeExtension('dft'), - CMakeExtension('gspn'), - CMakeExtension('pars'), - CMakeExtension('pomdp') - ], - cmdclass={'build_ext': CMakeBuild}, + package_data={"stormpy.examples": ["examples/files/*"]}, + ext_package="stormpy", + ext_modules=[ + CMakeExtension("pycarl_core"), + CMakeExtension("pycarl.cln"), + CMakeExtension("pycarl.gmp"), + CMakeExtension("pycarl.formula"), + CMakeExtension("pycarl.formula-cln"), + CMakeExtension("pycarl.formula-gmp"), + CMakeExtension("pycarl.parse"), + CMakeExtension("pycarl.parse-gmp"), + CMakeExtension("pycarl.parse-cln"), + CMakeExtension("core"), + CMakeExtension("info"), + CMakeExtension("logic"), + CMakeExtension("storage"), + CMakeExtension("utility"), + CMakeExtension("dft"), + CMakeExtension("gspn"), + CMakeExtension("pars"), + CMakeExtension("pomdp"), + ], + cmdclass={"build_ext": CMakeBuild}, zip_safe=False, install_requires=[], setup_requires=['pytest-runner', From a481e4fe49ef46c1eea724f3f291aa0fb6d2fad4 Mon Sep 17 00:00:00 2001 From: Luko van der Maas Date: Thu, 16 Jan 2025 17:33:28 +0100 Subject: [PATCH 09/35] add kwek_mehlhorn and stubs --- lib/stormpy/__init__.pyi | 611 +++++++++++ lib/stormpy/_config.pyi | 17 + lib/stormpy/_version.pyi | 3 + lib/stormpy/core.pyi | 1547 +++++++++++++++++++++++++++ lib/stormpy/exceptions.pyi | 15 + lib/stormpy/pomdp/__init__.py | 2 + lib/stormpy/pycarl/__init__.pyi | 61 ++ lib/stormpy/pycarl/_config.pyi | 6 + lib/stormpy/pycarl/_version.pyi | 3 + lib/stormpy/pycarl/cln/__init__.pyi | 1114 +++++++++++++++++++ lib/stormpy/pycarl/cln/_config.pyi | 3 + lib/stormpy/pycarl/gmp.pyi | 1116 +++++++++++++++++++ lib/stormpy/pycarl/infinity.pyi | 46 + lib/stormpy/pycarl/pycarl_core.pyi | 391 +++++++ lib/stormpy/utility/__init__.pyi | 16 + lib/stormpy/utility/utility.pyi | 230 ++++ setup.py | 4 - src/mod_pomdp.cpp | 2 + src/mod_utility.cpp | 24 +- src/utility/kwekMehlhorn.cpp | 22 + src/utility/kwekMehlhorn.h | 6 + 21 files changed, 5224 insertions(+), 15 deletions(-) create mode 100644 lib/stormpy/__init__.pyi create mode 100644 lib/stormpy/_config.pyi create mode 100644 lib/stormpy/_version.pyi create mode 100644 lib/stormpy/core.pyi create mode 100644 lib/stormpy/exceptions.pyi create mode 100644 lib/stormpy/pycarl/__init__.pyi create mode 100644 lib/stormpy/pycarl/_config.pyi create mode 100644 lib/stormpy/pycarl/_version.pyi create mode 100644 lib/stormpy/pycarl/cln/__init__.pyi create mode 100644 lib/stormpy/pycarl/cln/_config.pyi create mode 100644 lib/stormpy/pycarl/gmp.pyi create mode 100644 lib/stormpy/pycarl/infinity.pyi create mode 100644 lib/stormpy/pycarl/pycarl_core.pyi create mode 100644 lib/stormpy/utility/__init__.pyi create mode 100644 lib/stormpy/utility/utility.pyi create mode 100644 src/utility/kwekMehlhorn.cpp create mode 100644 src/utility/kwekMehlhorn.h diff --git a/lib/stormpy/__init__.pyi b/lib/stormpy/__init__.pyi new file mode 100644 index 0000000000..a9a904b778 --- /dev/null +++ b/lib/stormpy/__init__.pyi @@ -0,0 +1,611 @@ +from __future__ import annotations +from stormpy.core import ActionMaskDouble +from stormpy.core import BisimulationType +from stormpy.core import BuilderOptions +from stormpy.core import CheckTask +from stormpy.core import ConstraintCollector +from stormpy.core import DirectEncodingOptions +from stormpy.core import DirectEncodingParserOptions +from stormpy.core import EliminationLabelBehavior +from stormpy.core import EndComponentEliminatorReturnTypeDouble +from stormpy.core import Environment +from stormpy.core import EquationSolverType +from stormpy.core import ExactCheckTask +from stormpy.core import ExplicitExactQuantitativeCheckResult +from stormpy.core import ExplicitModelBuilder +from stormpy.core import ExplicitModelCheckerHintDouble +from stormpy.core import ExplicitParametricModelBuilder +from stormpy.core import ExplicitParametricQuantitativeCheckResult +from stormpy.core import ExplicitParetoCurveCheckResultDouble +from stormpy.core import ExplicitQualitativeCheckResult +from stormpy.core import ExplicitQuantitativeCheckResult +from stormpy.core import ExplicitStateLookup +from stormpy.core import FlatSet +from stormpy.core import HybridExactQuantitativeCheckResult +from stormpy.core import HybridParametricQuantitativeCheckResult +from stormpy.core import HybridQuantitativeCheckResult +from stormpy.core import JaniModelType +from stormpy.core import MinMaxMethod +from stormpy.core import MinMaxSolverEnvironment +from stormpy.core import ModelCheckerHint +from stormpy.core import ModelFormulasPair +from stormpy.core import NativeLinearEquationSolverMethod +from stormpy.core import NativeSolverEnvironment +from stormpy.core import OptimizationDirection +from stormpy.core import ParametricCheckTask +from stormpy.core import ParetoCurveCheckResultDouble +from stormpy.core import Property +from stormpy.core import QuotientFormat +from stormpy.core import SMTCounterExampleGenerator +from stormpy.core import SMTCounterExampleGeneratorOptions +from stormpy.core import SMTCounterExampleGeneratorStats +from stormpy.core import SMTCounterExampleInput +from stormpy.core import SolverEnvironment +from stormpy.core import StateValuationFunctionActionMaskDouble +from stormpy.core import SubsystemBuilderOptions +from stormpy.core import SubsystemBuilderReturnTypeDouble +from stormpy.core import SubsystemBuilderReturnTypeExact +from stormpy.core import SubsystemBuilderReturnTypeRatFunc +from stormpy.core import SymbolicExactQuantitativeCheckResult +from stormpy.core import SymbolicModelDescription +from stormpy.core import SymbolicParametricQuantitativeCheckResult +from stormpy.core import SymbolicQualitativeCheckResult +from stormpy.core import SymbolicQuantitativeCheckResult +from stormpy.core import build_sparse_exact_model_with_options +from stormpy.core import build_sparse_model_from_explicit +from stormpy.core import build_sparse_model_with_options +from stormpy.core import build_sparse_parametric_model_with_options +from stormpy.core import check_interval_mdp +from stormpy.core import compute_all_until_probabilities +from stormpy.core import compute_transient_probabilities +from stormpy.core import create_filter_initial_states_sparse +from stormpy.core import create_filter_initial_states_symbolic +from stormpy.core import create_filter_symbolic +from stormpy.core import install_signal_handlers +from stormpy.core import make_sparse_model_builder +from stormpy.core import make_sparse_model_builder_exact +from stormpy.core import make_sparse_model_builder_parametric +from stormpy.core import parse_constants_string +from stormpy.core import parse_jani_model +from stormpy.core import parse_jani_model_from_string +from stormpy.core import parse_prism_program +from stormpy.core import parse_properties_for_jani_model +from stormpy.core import parse_properties_for_prism_program +from stormpy.core import parse_properties_without_context +from stormpy.core import preprocess_symbolic_input +from stormpy.core import reset_timeout +from stormpy.core import set_loglevel_debug +from stormpy.core import set_loglevel_error +from stormpy.core import set_loglevel_trace +from stormpy.core import set_settings +from stormpy.core import set_timeout +from stormpy.exceptions import StormError +from stormpy.logic import logic +from stormpy.logic.logic import AtomicExpressionFormula +from stormpy.logic.logic import AtomicLabelFormula +from stormpy.logic.logic import BinaryBooleanOperatorType +from stormpy.logic.logic import BinaryPathFormula +from stormpy.logic.logic import BinaryStateFormula +from stormpy.logic.logic import BooleanBinaryStateFormula +from stormpy.logic.logic import BooleanLiteralFormula +from stormpy.logic.logic import BoundedUntilFormula +from stormpy.logic.logic import ComparisonType +from stormpy.logic.logic import ConditionalFormula +from stormpy.logic.logic import CumulativeRewardFormula +from stormpy.logic.logic import EventuallyFormula +from stormpy.logic.logic import Formula +from stormpy.logic.logic import GameFormula +from stormpy.logic.logic import GloballyFormula +from stormpy.logic.logic import InstantaneousRewardFormula +from stormpy.logic.logic import LongRunAvarageOperator +from stormpy.logic.logic import LongRunAverageRewardFormula +from stormpy.logic.logic import MultiObjectiveFormula +from stormpy.logic.logic import OperatorFormula +from stormpy.logic.logic import PathFormula +from stormpy.logic.logic import ProbabilityOperator +from stormpy.logic.logic import RewardOperator +from stormpy.logic.logic import StateFormula +from stormpy.logic.logic import TimeOperator +from stormpy.logic.logic import UnaryBooleanStateFormula +from stormpy.logic.logic import UnaryPathFormula +from stormpy.logic.logic import UnaryStateFormula +from stormpy.logic.logic import UntilFormula +from stormpy.pycarl import cln +from stormpy.pycarl.cln import FactorizedPolynomial +from stormpy.pycarl.cln import FactorizedRationalFunction +from stormpy.pycarl.cln import Polynomial +from stormpy.pycarl.cln import Rational as RationalRF +from stormpy.pycarl.cln import RationalFunction +from stormpy.pycarl import gmp +from stormpy.pycarl.gmp import Rational +from stormpy.storage import build_parametric_sparse_matrix +from stormpy.storage import build_sparse_matrix +from stormpy.storage import get_maximal_end_components +from stormpy.storage import storage +from stormpy.storage.storage import AddIterator_Sylvan_Double +from stormpy.storage.storage import Add_Sylvan_Double +from stormpy.storage.storage import Bdd_Sylvan +from stormpy.storage.storage import BitVector +from stormpy.storage.storage import ChoiceLabeling +from stormpy.storage.storage import ChoiceOrigins +from stormpy.storage.storage import DdManager_Sylvan +from stormpy.storage.storage import DdMetaVariableType +from stormpy.storage.storage import DdMetaVariable_Sylvan +from stormpy.storage.storage import Dd_Sylvan +from stormpy.storage.storage import DiceStringVisitor +from stormpy.storage.storage import Distribution +from stormpy.storage.storage import DistributionExact +from stormpy.storage.storage import DistributionInterval +from stormpy.storage.storage import ExactSparseMatrix +from stormpy.storage.storage import ExactSparseMatrixBuilder +from stormpy.storage.storage import ExactSparseMatrixEntry +from stormpy.storage.storage import ExactSparseMatrixRows +from stormpy.storage.storage import Expression +from stormpy.storage.storage import ExpressionManager +from stormpy.storage.storage import ExpressionParser +from stormpy.storage.storage import ExpressionType +from stormpy.storage.storage import IntervalSparseMatrix +from stormpy.storage.storage import IntervalSparseMatrixBuilder +from stormpy.storage.storage import IntervalSparseMatrixEntry +from stormpy.storage.storage import IntervalSparseMatrixRows +from stormpy.storage.storage import ItemLabeling +from stormpy.storage.storage import JaniAssignment +from stormpy.storage.storage import JaniAutomaton +from stormpy.storage.storage import JaniChoiceOrigins +from stormpy.storage.storage import JaniConstant +from stormpy.storage.storage import JaniEdge +from stormpy.storage.storage import JaniEdgeDestination +from stormpy.storage.storage import JaniInformationObject +from stormpy.storage.storage import JaniLocation +from stormpy.storage.storage import JaniLocationExpander +from stormpy.storage.storage import JaniModel +from stormpy.storage.storage import JaniOrderedAssignments +from stormpy.storage.storage import JaniScopeChanger +from stormpy.storage.storage import JaniTemplateEdge +from stormpy.storage.storage import JaniTemplateEdgeDestination +from stormpy.storage.storage import JaniVariable +from stormpy.storage.storage import JaniVariableSet +from stormpy.storage.storage import MaximalEndComponent +from stormpy.storage.storage import MaximalEndComponentDecomposition_double +from stormpy.storage.storage import MaximalEndComponentDecomposition_exact +from stormpy.storage.storage import MaximalEndComponentDecomposition_interval +from stormpy.storage.storage import MaximalEndComponentDecomposition_ratfunc +from stormpy.storage.storage import ModelType +from stormpy.storage.storage import OperatorType +from stormpy.storage.storage import OverlappingGuardAnalyser +from stormpy.storage.storage import ParametricSparseMatrix +from stormpy.storage.storage import ParametricSparseMatrixBuilder +from stormpy.storage.storage import ParametricSparseMatrixEntry +from stormpy.storage.storage import ParametricSparseMatrixRows +from stormpy.storage.storage import PolytopeDouble +from stormpy.storage.storage import PolytopeExact +from stormpy.storage.storage import PrismAssignment +from stormpy.storage.storage import PrismBooleanVariable +from stormpy.storage.storage import PrismChoiceOrigins +from stormpy.storage.storage import PrismCommand +from stormpy.storage.storage import PrismConstant +from stormpy.storage.storage import PrismIntegerVariable +from stormpy.storage.storage import PrismLabel +from stormpy.storage.storage import PrismModelType +from stormpy.storage.storage import PrismModule +from stormpy.storage.storage import PrismProgram +from stormpy.storage.storage import PrismRewardModel +from stormpy.storage.storage import PrismUpdate +from stormpy.storage.storage import PrismVariable +from stormpy.storage.storage import Scheduler +from stormpy.storage.storage import SchedulerChoice +from stormpy.storage.storage import SchedulerChoiceExact +from stormpy.storage.storage import SchedulerChoiceInterval +from stormpy.storage.storage import SchedulerChoiceParametric +from stormpy.storage.storage import SchedulerExact +from stormpy.storage.storage import SchedulerInterval +from stormpy.storage.storage import SchedulerParametric +from stormpy.storage.storage import SimpleValuation +from stormpy.storage.storage import SparseCtmc +from stormpy.storage.storage import SparseDtmc +from stormpy.storage.storage import SparseExactCtmc +from stormpy.storage.storage import SparseExactDtmc +from stormpy.storage.storage import SparseExactMA +from stormpy.storage.storage import SparseExactMdp +from stormpy.storage.storage import SparseExactModelAction +from stormpy.storage.storage import SparseExactModelActions +from stormpy.storage.storage import SparseExactModelComponents +from stormpy.storage.storage import SparseExactModelState +from stormpy.storage.storage import SparseExactModelStates +from stormpy.storage.storage import SparseExactPomdp +from stormpy.storage.storage import SparseExactRewardModel +from stormpy.storage.storage import SparseExactSmg +from stormpy.storage.storage import SparseIntervalCtmc +from stormpy.storage.storage import SparseIntervalDtmc +from stormpy.storage.storage import SparseIntervalMA +from stormpy.storage.storage import SparseIntervalMdp +from stormpy.storage.storage import SparseIntervalModelAction +from stormpy.storage.storage import SparseIntervalModelActions +from stormpy.storage.storage import SparseIntervalModelComponents +from stormpy.storage.storage import SparseIntervalModelState +from stormpy.storage.storage import SparseIntervalModelStates +from stormpy.storage.storage import SparseIntervalPomdp +from stormpy.storage.storage import SparseIntervalRewardModel +from stormpy.storage.storage import SparseIntervalSmg +from stormpy.storage.storage import SparseMA +from stormpy.storage.storage import SparseMatrix +from stormpy.storage.storage import SparseMatrixBuilder +from stormpy.storage.storage import SparseMatrixEntry +from stormpy.storage.storage import SparseMatrixRows +from stormpy.storage.storage import SparseMdp +from stormpy.storage.storage import SparseModelAction +from stormpy.storage.storage import SparseModelActions +from stormpy.storage.storage import SparseModelComponents +from stormpy.storage.storage import SparseModelState +from stormpy.storage.storage import SparseModelStates +from stormpy.storage.storage import SparseParametricCtmc +from stormpy.storage.storage import SparseParametricDtmc +from stormpy.storage.storage import SparseParametricMA +from stormpy.storage.storage import SparseParametricMdp +from stormpy.storage.storage import SparseParametricModelAction +from stormpy.storage.storage import SparseParametricModelActions +from stormpy.storage.storage import SparseParametricModelComponents +from stormpy.storage.storage import SparseParametricModelState +from stormpy.storage.storage import SparseParametricModelStates +from stormpy.storage.storage import SparseParametricPomdp +from stormpy.storage.storage import SparseParametricRewardModel +from stormpy.storage.storage import SparsePomdp +from stormpy.storage.storage import SparseRewardModel +from stormpy.storage.storage import SparseSmg +from stormpy.storage.storage import StateLabeling +from stormpy.storage.storage import StateValuation +from stormpy.storage.storage import StateValuationsBuilder +from stormpy.storage.storage import SymbolicSylvanCtmc +from stormpy.storage.storage import SymbolicSylvanDtmc +from stormpy.storage.storage import SymbolicSylvanMA +from stormpy.storage.storage import SymbolicSylvanMdp +from stormpy.storage.storage import SymbolicSylvanParametricCtmc +from stormpy.storage.storage import SymbolicSylvanParametricDtmc +from stormpy.storage.storage import SymbolicSylvanParametricMA +from stormpy.storage.storage import SymbolicSylvanParametricMdp +from stormpy.storage.storage import SymbolicSylvanParametricRewardModel +from stormpy.storage.storage import SymbolicSylvanRewardModel +from stormpy.storage.storage import Valuation +from stormpy.storage.storage import Variable +from stormpy.storage.storage import collect_information +from stormpy.storage.storage import eliminate_reward_accumulations +import sys as sys +from . import _config +from . import _version +from . import core +from . import exceptions +from . import pycarl +from . import utility +__all__ = ['ActionMaskDouble', 'AddIterator_Sylvan_Double', 'Add_Sylvan_Double', 'AtomicExpressionFormula', 'AtomicLabelFormula', 'Bdd_Sylvan', 'BinaryBooleanOperatorType', 'BinaryPathFormula', 'BinaryStateFormula', 'BisimulationType', 'BitVector', 'BooleanBinaryStateFormula', 'BooleanLiteralFormula', 'BoundedUntilFormula', 'BuilderOptions', 'CheckTask', 'ChoiceLabeling', 'ChoiceOrigins', 'ComparisonType', 'ConditionalFormula', 'ConstraintCollector', 'CumulativeRewardFormula', 'DdManager_Sylvan', 'DdMetaVariableType', 'DdMetaVariable_Sylvan', 'Dd_Sylvan', 'DiceStringVisitor', 'DirectEncodingOptions', 'DirectEncodingParserOptions', 'Distribution', 'DistributionExact', 'DistributionInterval', 'EliminationLabelBehavior', 'EndComponentEliminatorReturnTypeDouble', 'Environment', 'EquationSolverType', 'EventuallyFormula', 'ExactCheckTask', 'ExactSparseMatrix', 'ExactSparseMatrixBuilder', 'ExactSparseMatrixEntry', 'ExactSparseMatrixRows', 'ExplicitExactQuantitativeCheckResult', 'ExplicitModelBuilder', 'ExplicitModelCheckerHintDouble', 'ExplicitParametricModelBuilder', 'ExplicitParametricQuantitativeCheckResult', 'ExplicitParetoCurveCheckResultDouble', 'ExplicitQualitativeCheckResult', 'ExplicitQuantitativeCheckResult', 'ExplicitStateLookup', 'Expression', 'ExpressionManager', 'ExpressionParser', 'ExpressionType', 'FactorizedPolynomial', 'FactorizedRationalFunction', 'FlatSet', 'Formula', 'GameFormula', 'GloballyFormula', 'HybridExactQuantitativeCheckResult', 'HybridParametricQuantitativeCheckResult', 'HybridQuantitativeCheckResult', 'InstantaneousRewardFormula', 'IntervalSparseMatrix', 'IntervalSparseMatrixBuilder', 'IntervalSparseMatrixEntry', 'IntervalSparseMatrixRows', 'ItemLabeling', 'JaniAssignment', 'JaniAutomaton', 'JaniChoiceOrigins', 'JaniConstant', 'JaniEdge', 'JaniEdgeDestination', 'JaniInformationObject', 'JaniLocation', 'JaniLocationExpander', 'JaniModel', 'JaniModelType', 'JaniOrderedAssignments', 'JaniScopeChanger', 'JaniTemplateEdge', 'JaniTemplateEdgeDestination', 'JaniVariable', 'JaniVariableSet', 'LongRunAvarageOperator', 'LongRunAverageRewardFormula', 'MaximalEndComponent', 'MaximalEndComponentDecomposition_double', 'MaximalEndComponentDecomposition_exact', 'MaximalEndComponentDecomposition_interval', 'MaximalEndComponentDecomposition_ratfunc', 'MinMaxMethod', 'MinMaxSolverEnvironment', 'ModelCheckerHint', 'ModelFormulasPair', 'ModelType', 'MultiObjectiveFormula', 'NativeLinearEquationSolverMethod', 'NativeSolverEnvironment', 'OperatorFormula', 'OperatorType', 'OptimizationDirection', 'OverlappingGuardAnalyser', 'ParametricCheckTask', 'ParametricSparseMatrix', 'ParametricSparseMatrixBuilder', 'ParametricSparseMatrixEntry', 'ParametricSparseMatrixRows', 'ParetoCurveCheckResultDouble', 'PathFormula', 'Polynomial', 'PolytopeDouble', 'PolytopeExact', 'PrismAssignment', 'PrismBooleanVariable', 'PrismChoiceOrigins', 'PrismCommand', 'PrismConstant', 'PrismIntegerVariable', 'PrismLabel', 'PrismModelType', 'PrismModule', 'PrismProgram', 'PrismRewardModel', 'PrismUpdate', 'PrismVariable', 'ProbabilityOperator', 'Property', 'QuotientFormat', 'Rational', 'RationalFunction', 'RationalRF', 'RewardOperator', 'SMTCounterExampleGenerator', 'SMTCounterExampleGeneratorOptions', 'SMTCounterExampleGeneratorStats', 'SMTCounterExampleInput', 'Scheduler', 'SchedulerChoice', 'SchedulerChoiceExact', 'SchedulerChoiceInterval', 'SchedulerChoiceParametric', 'SchedulerExact', 'SchedulerInterval', 'SchedulerParametric', 'SimpleValuation', 'SolverEnvironment', 'SparseCtmc', 'SparseDtmc', 'SparseExactCtmc', 'SparseExactDtmc', 'SparseExactMA', 'SparseExactMdp', 'SparseExactModelAction', 'SparseExactModelActions', 'SparseExactModelComponents', 'SparseExactModelState', 'SparseExactModelStates', 'SparseExactPomdp', 'SparseExactRewardModel', 'SparseExactSmg', 'SparseIntervalCtmc', 'SparseIntervalDtmc', 'SparseIntervalMA', 'SparseIntervalMdp', 'SparseIntervalModelAction', 'SparseIntervalModelActions', 'SparseIntervalModelComponents', 'SparseIntervalModelState', 'SparseIntervalModelStates', 'SparseIntervalPomdp', 'SparseIntervalRewardModel', 'SparseIntervalSmg', 'SparseMA', 'SparseMatrix', 'SparseMatrixBuilder', 'SparseMatrixEntry', 'SparseMatrixRows', 'SparseMdp', 'SparseModelAction', 'SparseModelActions', 'SparseModelComponents', 'SparseModelState', 'SparseModelStates', 'SparseParametricCtmc', 'SparseParametricDtmc', 'SparseParametricMA', 'SparseParametricMdp', 'SparseParametricModelAction', 'SparseParametricModelActions', 'SparseParametricModelComponents', 'SparseParametricModelState', 'SparseParametricModelStates', 'SparseParametricPomdp', 'SparseParametricRewardModel', 'SparsePomdp', 'SparseRewardModel', 'SparseSmg', 'StateFormula', 'StateLabeling', 'StateValuation', 'StateValuationFunctionActionMaskDouble', 'StateValuationsBuilder', 'StormError', 'SubsystemBuilderOptions', 'SubsystemBuilderReturnTypeDouble', 'SubsystemBuilderReturnTypeExact', 'SubsystemBuilderReturnTypeRatFunc', 'SymbolicExactQuantitativeCheckResult', 'SymbolicModelDescription', 'SymbolicParametricQuantitativeCheckResult', 'SymbolicQualitativeCheckResult', 'SymbolicQuantitativeCheckResult', 'SymbolicSylvanCtmc', 'SymbolicSylvanDtmc', 'SymbolicSylvanMA', 'SymbolicSylvanMdp', 'SymbolicSylvanParametricCtmc', 'SymbolicSylvanParametricDtmc', 'SymbolicSylvanParametricMA', 'SymbolicSylvanParametricMdp', 'SymbolicSylvanParametricRewardModel', 'SymbolicSylvanRewardModel', 'TimeOperator', 'UnaryBooleanStateFormula', 'UnaryPathFormula', 'UnaryStateFormula', 'UntilFormula', 'Valuation', 'Variable', 'build_interval_model_from_drn', 'build_model', 'build_model_from_drn', 'build_parametric_model', 'build_parametric_model_from_drn', 'build_parametric_sparse_matrix', 'build_sparse_exact_model_with_options', 'build_sparse_matrix', 'build_sparse_model', 'build_sparse_model_from_explicit', 'build_sparse_model_with_options', 'build_sparse_parametric_model', 'build_sparse_parametric_model_with_options', 'build_symbolic_model', 'build_symbolic_parametric_model', 'check_interval_mdp', 'check_model_dd', 'check_model_hybrid', 'check_model_sparse', 'cln', 'collect_information', 'compute_all_until_probabilities', 'compute_expected_number_of_visits', 'compute_prob01_states', 'compute_prob01max_states', 'compute_prob01min_states', 'compute_steady_state_distribution', 'compute_transient_probabilities', 'construct_submodel', 'core', 'create_filter_initial_states_sparse', 'create_filter_initial_states_symbolic', 'create_filter_symbolic', 'eliminate_ECs', 'eliminate_non_markovian_chains', 'eliminate_reward_accumulations', 'exceptions', 'export_to_drn', 'get_maximal_end_components', 'get_reachable_states', 'gmp', 'install_signal_handlers', 'logic', 'make_sparse_model_builder', 'make_sparse_model_builder_exact', 'make_sparse_model_builder_parametric', 'model_checking', 'parse_constants_string', 'parse_jani_model', 'parse_jani_model_from_string', 'parse_prism_program', 'parse_properties', 'parse_properties_for_jani_model', 'parse_properties_for_prism_program', 'parse_properties_without_context', 'perform_bisimulation', 'perform_sparse_bisimulation', 'perform_symbolic_bisimulation', 'preprocess_symbolic_input', 'prob01max_states', 'prob01min_states', 'pycarl', 'reset_timeout', 'set_loglevel_debug', 'set_loglevel_error', 'set_loglevel_trace', 'set_settings', 'set_timeout', 'storage', 'storm_with_dft', 'storm_with_gspn', 'storm_with_pars', 'storm_with_pomdp', 'storm_with_spot', 'storm_with_xerces', 'stormpy', 'sys', 'topological_sort', 'transform_to_discrete_time_model', 'transform_to_sparse_model', 'utility'] +def _convert_sparse_model(model, parametric = False): + """ + + Convert (parametric) model in sparse representation into model corresponding to exact model type. + :param model: Sparse model. + :param parametric: Flag indicating if the model is parametric. + :return: Model corresponding to exact model type. + + """ +def _convert_symbolic_model(model, parametric = False): + """ + + Convert (parametric) model in symbolic representation into model corresponding to exact model type. + :param model: Symbolic model. + :param parametric: Flag indicating if the model is parametric. + :return: Model corresponding to exact model type. + + """ +def build_interval_model_from_drn(file, options = ...): + """ + + Build an interval model in sparse representation from the explicit DRN representation. + + :param String file: DRN file containing the model. + :param DirectEncodingParserOptions: Options for the parser. + :return: Interval model in sparse representation. + + """ +def build_model(symbolic_description, properties = None): + """ + + Build a model in sparse representation from a symbolic description. + + :param symbolic_description: Symbolic model description to translate into a model. + :param List[Property] properties: List of properties that should be preserved during the translation. If None, then all properties are preserved. + :return: Model in sparse representation. + + """ +def build_model_from_drn(file, options = ...): + """ + + Build a model in sparse representation from the explicit DRN representation. + + :param String file: DRN file containing the model. + :param DirectEncodingParserOptions: Options for the parser. + :return: Model in sparse representation. + + """ +def build_parametric_model(symbolic_description, properties = None): + """ + + Build a parametric model in sparse representation from a symbolic description. + + :param symbolic_description: Symbolic model description to translate into a model. + :param List[Property] properties: List of properties that should be preserved during the translation. If None, then all properties are preserved. + :return: Parametric model in sparse representation. + + """ +def build_parametric_model_from_drn(file, options = ...): + """ + + Build a parametric model in sparse representation from the explicit DRN representation. + + :param String file: DRN file containing the model. + :param DirectEncodingParserOptions: Options for the parser. + :return: Parametric model in sparse representation. + + """ +def build_sparse_model(symbolic_description, properties = None): + """ + + Build a model in sparse representation from a symbolic description. + + :param symbolic_description: Symbolic model description to translate into a model. + :param List[Property] properties: List of properties that should be preserved during the translation. If None, then all properties are preserved. + :return: Model in sparse representation. + + """ +def build_sparse_parametric_model(symbolic_description, properties = None): + """ + + Build a parametric model in sparse representation from a symbolic description. + + :param symbolic_description: Symbolic model description to translate into a model. + :param List[Property] properties: List of properties that should be preserved during the translation. If None, then all properties are preserved. + :return: Parametric model in sparse representation. + + """ +def build_symbolic_model(symbolic_description, properties = None): + """ + + Build a model in symbolic representation from a symbolic description. + + :param symbolic_description: Symbolic model description to translate into a model. + :param List[Property] properties: List of properties that should be preserved during the translation. If None, then all properties are preserved. + :return: Model in symbolic representation. + + """ +def build_symbolic_parametric_model(symbolic_description, properties = None): + """ + + Build a parametric model in symbolic representation from a symbolic description. + + :param symbolic_description: Symbolic model description to translate into a model. + :param List[Property] properties: List of properties that should be preserved during the translation. If None, then all properties are preserved. + :return: Parametric model in symbolic representation. + + """ +def check_model_dd(model, property, only_initial_states = False, environment = ...): + """ + + Perform model checking using dd engine. + :param model: Model. + :param property: Property to check for. + :param only_initial_states: If True, only results for initial states are computed, otherwise for all states. + :return: Model checking result. + :rtype: CheckResult + + """ +def check_model_hybrid(model, property, only_initial_states = False, environment = ...): + """ + + Perform model checking using hybrid engine. + :param model: Model. + :param property: Property to check for. + :param only_initial_states: If True, only results for initial states are computed, otherwise for all states. + :return: Model checking result. + :rtype: CheckResult + + """ +def check_model_sparse(model, property, only_initial_states = False, extract_scheduler = False, force_fully_observable = False, hint = None, environment = ...): + """ + + Perform model checking on model for property. + :param model: Model. + :param property: Property to check for. + :param only_initial_states: If True, only results for initial states are computed, otherwise for all states. + :param extract_scheduler: If True, try to extract a scheduler + :param hint: If not None, this hint is used by the model checker + :param force_fully_observable: If True, treat a POMDP as an MDP + :return: Model checking result. + :rtype: CheckResult + + """ +def compute_expected_number_of_visits(environment, model): + """ + + Compute the number of expected visits. Model must be deterministic. + + :param environment: An model checking environment + :param model: A DTMC or CTMC + :return: A vector with the expected number of visits + + """ +def compute_prob01_states(model, phi_states, psi_states): + """ + + Compute prob01 states for properties of the form phi_states until psi_states + + :param SparseDTMC model: + :param BitVector phi_states: + :param BitVector psi_states: Target states + + """ +def compute_prob01max_states(model, phi_states, psi_states): + ... +def compute_prob01min_states(model, phi_states, psi_states): + ... +def compute_steady_state_distribution(environment, model): + """ + + Compute the steady-state (aka stationary) distribution. Model must be deterministic. + + :param environment: A model checking environment + :param model: A DTMC or CTMC + :return: A vector with the steady-state distribution + + """ +def construct_submodel(model, states, actions, keep_unreachable_states = True, options = ...): + """ + + + :param model: The model + :param states: Which states should be preserved + :param actions: Which actions should be preserved + :param keep_unreachable_states: If False, run a reachability analysis. + :param options: An options object of type SubsystemBuilderOptions + :return: A model with fewer states/actions + + """ +def eliminate_ECs(matrix, subsystem, possible_ecs, add_sink_row_states, add_self_loop_at_sink_states = False): + """ + + For each such EC (that is not contained in another EC), we add a new state and redirect all incoming and outgoing + transitions of the EC to (and from) this state. + + :param matrix: + :param subsystem: BitVector with states many entries. Only states in the given subsystem are kept. Transitions leading to a state outside of the subsystem will be + removed (but the corresponding row is kept, possibly yielding empty rows). + The ECs are then identified on the subsystem. + :param possible_ecs: BitVector with rows many entries. Only ECs for which possible_ecs is true for all choices are considered. + Furthermore, the rows that contain a transition leading outside of the subsystem are not considered for an EC. + :param add_sink_row_states: BitVector with states many entries. If add_sink_row_states is true for at least one state of an eliminated EC, a row is added to the new state (representing the choice to stay at the EC forever). + :param add_self_loop_at_sink_states: if true, such rows get a selfloop (with value 1). Otherwise, the row remains empty. + :return: A container with various information. + + """ +def eliminate_non_markovian_chains(ma, properties, label_behavior): + """ + + Eliminate chains of non-Markovian states if possible. + :param ma: Markov automaton. + :param properties: List of properties to transform as well. + :param label_behavior: Behavior of labels while elimination. + :return: Tuple (converted MA, converted properties). + + """ +def export_to_drn(model, file, options = ...): + """ + + Export a model to DRN format + :param model: The model + :param file: A path + :param options: DirectEncodingOptions + :return: + + """ +def get_reachable_states(model, initial_states, constraint_states, target_states, maximal_steps = None, choice_filter = None): + """ + + Get the states that are reachable in a sparse model + + :param model: A model + :param initial_states: Which states should be definitively reachable + :param constraint_states: + :param target_states: Which states should be considered absorbing + :param maximal_steps: The maximal depth to explore + :param choice_filter: + :return: + + """ +def model_checking(model, property, only_initial_states = False, extract_scheduler = False, force_fully_observable = False, environment = ...): + """ + + Perform model checking on model for property. + :param model: Model. + :param property: Property to check for. + :param only_initial_states: If True, only results for initial states are computed, otherwise for all states. + :param extract_scheduler: If True, try to extract a scheduler + :return: Model checking result. + :rtype: CheckResult + + """ +def parse_properties(properties, context = None, filters = None): + """ + + + :param properties: A string with the pctl properties + :param context: A symbolic model that gives meaning to variables and constants. + :param filters: filters, if applicable. + :return: A list of properties + + """ +def perform_bisimulation(model, properties, bisimulation_type): + """ + + Perform bisimulation on model. + :param model: Model. + :param properties: Properties to preserve during bisimulation. + :param bisimulation_type: Type of bisimulation (weak or strong). + :return: Model after bisimulation. + + """ +def perform_sparse_bisimulation(model, properties, bisimulation_type): + """ + + Perform bisimulation on model in sparse representation. + :param model: Model. + :param properties: Properties to preserve during bisimulation. + :param bisimulation_type: Type of bisimulation (weak or strong). + :return: Model after bisimulation. + + """ +def perform_symbolic_bisimulation(model, properties, quotient_format = ...): + """ + + Perform bisimulation on model in symbolic representation. + :param model: Model. + :param properties: Properties to preserve during bisimulation. + :param quotient_format: Return format of quotient. + :return: Model after bisimulation. + + """ +def prob01max_states(model, eventually_formula): + ... +def prob01min_states(model, eventually_formula): + ... +def topological_sort(model, forward = True, initial = list()): + """ + + + :param model: A sparse model + :param forward: A flag whether the sorting should be forward or backwards + :param initial: a list of states + :return: A topological sort of the states + + """ +def transform_to_discrete_time_model(model, properties): + """ + + Transform continuous-time model to discrete time model. + :param model: Continuous-time model. + :param properties: List of properties to transform as well. + :return: Tuple (Discrete-time model, converted properties). + + """ +def transform_to_sparse_model(model): + """ + + Transform model in symbolic representation into model in sparse representation. + :param model: Symbolic model. + :return: Sparse model. + + """ +__version__: str = '1.9.0' +storm_with_dft: bool = True +storm_with_gspn: bool = True +storm_with_pars: bool = True +storm_with_pomdp: bool = True +storm_with_spot: bool = False +storm_with_xerces: bool = True +stormpy = diff --git a/lib/stormpy/_config.pyi b/lib/stormpy/_config.pyi new file mode 100644 index 0000000000..2b6d1a7136 --- /dev/null +++ b/lib/stormpy/_config.pyi @@ -0,0 +1,17 @@ +from __future__ import annotations +from stormpy import pycarl +from stormpy.pycarl import cln +from stormpy.pycarl.cln import FactorizedPolynomial +from stormpy.pycarl.cln import FactorizedRationalFunction +from stormpy.pycarl.cln import Polynomial +from stormpy.pycarl.cln import Rational as RationalRF +from stormpy.pycarl.cln import RationalFunction +from stormpy.pycarl import gmp +from stormpy.pycarl.gmp import Rational +__all__ = ['FactorizedPolynomial', 'FactorizedRationalFunction', 'Polynomial', 'Rational', 'RationalFunction', 'RationalRF', 'cln', 'gmp', 'pycarl', 'storm_with_dft', 'storm_with_gspn', 'storm_with_pars', 'storm_with_pomdp', 'storm_with_spot', 'storm_with_xerces'] +storm_with_dft: bool = True +storm_with_gspn: bool = True +storm_with_pars: bool = True +storm_with_pomdp: bool = True +storm_with_spot: bool = False +storm_with_xerces: bool = True diff --git a/lib/stormpy/_version.pyi b/lib/stormpy/_version.pyi new file mode 100644 index 0000000000..f8cfb36777 --- /dev/null +++ b/lib/stormpy/_version.pyi @@ -0,0 +1,3 @@ +from __future__ import annotations +__all__ = list() +__version__: str = '1.9.0' diff --git a/lib/stormpy/core.pyi b/lib/stormpy/core.pyi new file mode 100644 index 0000000000..79872764ed --- /dev/null +++ b/lib/stormpy/core.pyi @@ -0,0 +1,1547 @@ +""" +core +""" +from __future__ import annotations +import stormpy.pycarl.cln +import stormpy.pycarl.gmp +import typing +__all__ = ['ActionMaskDouble', 'BisimulationType', 'BuilderOptions', 'CheckTask', 'ConstraintCollector', 'DirectEncodingOptions', 'DirectEncodingParserOptions', 'EliminationLabelBehavior', 'EndComponentEliminatorReturnTypeDouble', 'Environment', 'EquationSolverType', 'ExactCheckTask', 'ExplicitExactQuantitativeCheckResult', 'ExplicitModelBuilder', 'ExplicitModelCheckerHintDouble', 'ExplicitParametricModelBuilder', 'ExplicitParametricQuantitativeCheckResult', 'ExplicitParetoCurveCheckResultDouble', 'ExplicitQualitativeCheckResult', 'ExplicitQuantitativeCheckResult', 'ExplicitStateLookup', 'FlatSet', 'HybridExactQuantitativeCheckResult', 'HybridParametricQuantitativeCheckResult', 'HybridQuantitativeCheckResult', 'JaniModelType', 'MinMaxMethod', 'MinMaxSolverEnvironment', 'ModelCheckerHint', 'ModelFormulasPair', 'NativeLinearEquationSolverMethod', 'NativeSolverEnvironment', 'OptimizationDirection', 'ParametricCheckTask', 'ParetoCurveCheckResultDouble', 'Property', 'QuotientFormat', 'SMTCounterExampleGenerator', 'SMTCounterExampleGeneratorOptions', 'SMTCounterExampleGeneratorStats', 'SMTCounterExampleInput', 'SolverEnvironment', 'StateValuationFunctionActionMaskDouble', 'SubsystemBuilderOptions', 'SubsystemBuilderReturnTypeDouble', 'SubsystemBuilderReturnTypeExact', 'SubsystemBuilderReturnTypeRatFunc', 'SymbolicExactQuantitativeCheckResult', 'SymbolicModelDescription', 'SymbolicParametricQuantitativeCheckResult', 'SymbolicQualitativeCheckResult', 'SymbolicQuantitativeCheckResult', 'build_sparse_exact_model_with_options', 'build_sparse_model_from_explicit', 'build_sparse_model_with_options', 'build_sparse_parametric_model_with_options', 'check_interval_mdp', 'compute_all_until_probabilities', 'compute_transient_probabilities', 'create_filter_initial_states_sparse', 'create_filter_initial_states_symbolic', 'create_filter_symbolic', 'install_signal_handlers', 'make_sparse_model_builder', 'make_sparse_model_builder_exact', 'make_sparse_model_builder_parametric', 'parse_constants_string', 'parse_jani_model', 'parse_jani_model_from_string', 'parse_prism_program', 'parse_properties_for_jani_model', 'parse_properties_for_prism_program', 'parse_properties_without_context', 'preprocess_symbolic_input', 'reset_timeout', 'set_loglevel_debug', 'set_loglevel_error', 'set_loglevel_trace', 'set_settings', 'set_timeout'] +class ActionMaskDouble: + pass +class BisimulationType: + """ + Types of bisimulation + + Members: + + STRONG + + WEAK + """ + STRONG: typing.ClassVar[BisimulationType] # value = + WEAK: typing.ClassVar[BisimulationType] # value = + __members__: typing.ClassVar[dict[str, BisimulationType]] # value = {'STRONG': , 'WEAK': } + def __eq__(self, other: typing.Any) -> bool: + ... + def __getstate__(self) -> int: + ... + def __hash__(self) -> int: + ... + def __index__(self) -> int: + ... + def __init__(self, value: int) -> None: + ... + def __int__(self) -> int: + ... + def __ne__(self, other: typing.Any) -> bool: + ... + def __repr__(self) -> str: + ... + def __setstate__(self, state: int) -> None: + ... + def __str__(self) -> str: + ... + @property + def name(self) -> str: + ... + @property + def value(self) -> int: + ... +class BuilderOptions: + """ + Options for building process + """ + @typing.overload + def __init__(self, formulae: list[...]) -> None: + """ + Initialise with formulae to preserve + """ + @typing.overload + def __init__(self, build_all_reward_models: bool = True, build_all_labels: bool = True) -> None: + """ + Initialise without formulae + """ + def set_add_out_of_bounds_state(self, new_value: bool = True) -> BuilderOptions: + """ + Build with out of bounds state + """ + def set_add_overlapping_guards_label(self, new_value: bool = True) -> BuilderOptions: + """ + Build with overlapping guards state labeled + """ + def set_build_all_labels(self, new_value: bool = True) -> BuilderOptions: + """ + Build with all state labels + """ + def set_build_all_reward_models(self, new_value: bool = True) -> BuilderOptions: + """ + Build with all reward models + """ + def set_build_choice_labels(self, new_value: bool = True) -> BuilderOptions: + """ + Build with choice labels + """ + def set_build_observation_valuations(self, new_value: bool = True) -> BuilderOptions: + """ + Build observation valuations + """ + def set_build_state_valuations(self, new_value: bool = True) -> BuilderOptions: + """ + Build state valuations + """ + def set_build_with_choice_origins(self, new_value: bool = True) -> BuilderOptions: + """ + Build choice origins + """ + def set_exploration_checks(self, new_value: bool = True) -> BuilderOptions: + """ + Perform extra checks during exploration + """ + @property + def preserved_label_names(self) -> set[str]: + """ + Labels preserved + """ +class CheckTask: + """ + Task for model checking + """ + def __init__(self, formula: ..., only_initial_states: bool = False) -> None: + ... + def set_hint(self, arg0: ...) -> None: + """ + Sets a hint that may speed up the solver + """ + def set_produce_schedulers(self, produce_schedulers: bool = True) -> None: + """ + Set whether schedulers should be produced (if possible) + """ + def set_robust_uncertainty(self, arg0: bool) -> None: + """ + Sets whether robust uncertainty should be considered + """ +class ConstraintCollector: + """ + Collector for constraints on parametric Markov chains + """ + @staticmethod + def __init__(*args, **kwargs) -> None: + ... + @property + def graph_preserving_constraints(self) -> set[..., ..., ...]: + """ + Get the constraints ensuring the graph is preserved + """ + @property + def wellformed_constraints(self) -> set[..., ..., ...]: + """ + Get the constraints ensuring a wellformed model + """ +class DirectEncodingOptions: + allow_placeholders: bool + def __init__(self) -> None: + ... +class DirectEncodingParserOptions: + """ + Options for the .drn parser + """ + def __init__(self) -> None: + """ + initialise + """ + @property + def build_choice_labels(self) -> bool: + """ + Build with choice labels + """ + @build_choice_labels.setter + def build_choice_labels(self, arg0: bool) -> None: + ... +class EliminationLabelBehavior: + """ + Behavior of labels while eliminating non-Markovian chains + + Members: + + KEEP_LABELS + + MERGE_LABELS + + DELETE_LABELS + """ + DELETE_LABELS: typing.ClassVar[EliminationLabelBehavior] # value = + KEEP_LABELS: typing.ClassVar[EliminationLabelBehavior] # value = + MERGE_LABELS: typing.ClassVar[EliminationLabelBehavior] # value = + __members__: typing.ClassVar[dict[str, EliminationLabelBehavior]] # value = {'KEEP_LABELS': , 'MERGE_LABELS': , 'DELETE_LABELS': } + def __eq__(self, other: typing.Any) -> bool: + ... + def __getstate__(self) -> int: + ... + def __hash__(self) -> int: + ... + def __index__(self) -> int: + ... + def __init__(self, value: int) -> None: + ... + def __int__(self) -> int: + ... + def __ne__(self, other: typing.Any) -> bool: + ... + def __repr__(self) -> str: + ... + def __setstate__(self, state: int) -> None: + ... + def __str__(self) -> str: + ... + @property + def name(self) -> str: + ... + @property + def value(self) -> int: + ... +class EndComponentEliminatorReturnTypeDouble: + """ + Container for result of endcomponent elimination + """ + @property + def matrix(self) -> ...: + """ + The resulting matrix + """ + @property + def new_to_old_row_mapping(self) -> list[int]: + """ + Index mapping that gives for each row fo the new matrix the corresponding row in the original matrix + """ + @property + def old_to_new_state_mapping(self) -> list[int]: + """ + For each state of the original matrix (and subsystem) the corresponding state in the result. Removed states are mapped to the EC. + """ + @property + def sink_rows(self) -> ...: + """ + Rows that indicate staying in the EC forever + """ +class Environment: + """ + Environment + """ + def __init__(self) -> None: + """ + Construct default environment + """ + @property + def solver_environment(self) -> ...: + """ + solver part of environment + """ +class EquationSolverType: + """ + Solver type for equation systems + + Members: + + native + + eigen + + elimination + + gmmxx + + topological + """ + __members__: typing.ClassVar[dict[str, EquationSolverType]] # value = {'native': , 'eigen': , 'elimination': , 'gmmxx': , 'topological': } + eigen: typing.ClassVar[EquationSolverType] # value = + elimination: typing.ClassVar[EquationSolverType] # value = + gmmxx: typing.ClassVar[EquationSolverType] # value = + native: typing.ClassVar[EquationSolverType] # value = + topological: typing.ClassVar[EquationSolverType] # value = + def __eq__(self, other: typing.Any) -> bool: + ... + def __getstate__(self) -> int: + ... + def __hash__(self) -> int: + ... + def __index__(self) -> int: + ... + def __init__(self, value: int) -> None: + ... + def __int__(self) -> int: + ... + def __ne__(self, other: typing.Any) -> bool: + ... + def __repr__(self) -> str: + ... + def __setstate__(self, state: int) -> None: + ... + def __str__(self) -> str: + ... + @property + def name(self) -> str: + ... + @property + def value(self) -> int: + ... +class ExactCheckTask: + """ + Task for model checking with exact numbers + """ + def __init__(self, formula: ..., only_initial_states: bool = False) -> None: + ... + def set_produce_schedulers(self, produce_schedulers: bool = True) -> None: + """ + Set whether schedulers should be produced (if possible) + """ +class ExplicitExactQuantitativeCheckResult(_ExactQuantitativeCheckResult): + """ + Explicit exact quantitative model checking result + """ + def __init__(self, values: list[stormpy.pycarl.gmp.Rational]) -> None: + ... + def at(self, state: int) -> stormpy.pycarl.gmp.Rational: + """ + Get result for given state + """ + def get_values(self) -> list[stormpy.pycarl.gmp.Rational]: + """ + Get model checking result values for all states + """ + @property + def scheduler(self) -> ...: + """ + get scheduler + """ +class ExplicitModelBuilder: + """ + Model builder for sparse models + """ + def build(self) -> ...: + """ + Build the model + """ + def export_lookup(self) -> ...: + """ + Export a lookup model + """ +class ExplicitModelCheckerHintDouble(ModelCheckerHint): + """ + Information that may accelerate an explicit state model checker + """ + def __init__(self) -> None: + ... + def set_compute_only_maybe_states(self, arg0: bool) -> None: + """ + value + """ + def set_maybe_states(self, arg0: ...) -> None: + """ + sets the maybe states. This is assumed to be correct. + """ + def set_result_hint(self, result_hint: list[float] | None) -> None: + ... + def set_scheduler_hint(self, scheduler_hint: ... | None) -> None: + """ + Set a scheduler that is close to the optimal scheduler + """ +class ExplicitParametricModelBuilder: + """ + Model builder for sparse models + """ + def build(self) -> ...: + """ + Build the model + """ + def export_lookup(self) -> ...: + """ + Export a lookup model + """ +class ExplicitParametricQuantitativeCheckResult(_ParametricQuantitativeCheckResult): + """ + Explicit parametric quantitative model checking result + """ + def at(self, state: int) -> stormpy.pycarl.cln.FactorizedRationalFunction: + """ + Get result for given state + """ + def get_values(self) -> list[stormpy.pycarl.cln.FactorizedRationalFunction]: + """ + Get model checking result values for all states + """ + @property + def scheduler(self) -> ...: + """ + get scheduler + """ +class ExplicitParetoCurveCheckResultDouble(ParetoCurveCheckResultDouble): + """ + Result for explicit multiobjective model checking + """ +class ExplicitQualitativeCheckResult(_QualitativeCheckResult): + """ + Explicit qualitative model checking result + """ + def at(self, state: int) -> bool: + """ + Get result for given state + """ + def get_truth_values(self) -> ...: + """ + Get BitVector representing the truth values + """ +class ExplicitQuantitativeCheckResult(_QuantitativeCheckResult): + """ + Explicit quantitative model checking result + """ + def __init__(self, values: list[float]) -> None: + ... + def at(self, state: int) -> float: + """ + Get result for given state + """ + def get_values(self) -> list[float]: + """ + Get model checking result values for all states + """ + @property + def scheduler(self) -> ...: + """ + get scheduler + """ +class ExplicitStateLookup: + """ + Lookup model for states + """ + def lookup(self, state_description: dict[..., ...]) -> typing.Any: + ... +class FlatSet: + """ + Container to pass to program + """ + @typing.overload + def __init__(self) -> None: + ... + @typing.overload + def __init__(self, other: FlatSet) -> None: + ... + def __iter__(self) -> typing.Iterator: + ... + def __len__(self) -> int: + ... + def __str__(self) -> str: + ... + def insert(self, arg0: int) -> None: + ... + def insert_set(self, arg0: FlatSet) -> None: + ... + def is_subset_of(self, arg0: FlatSet) -> bool: + ... +class HybridExactQuantitativeCheckResult(_QuantitativeCheckResult): + """ + Symbolic exact hybrid quantitative model checking result + """ + def get_values(self) -> list[stormpy.pycarl.gmp.Rational]: + """ + Get model checking result values for all states + """ +class HybridParametricQuantitativeCheckResult(_QuantitativeCheckResult): + """ + Symbolic parametric hybrid quantitative model checking result + """ + def get_values(self) -> list[stormpy.pycarl.cln.FactorizedRationalFunction]: + """ + Get model checking result values for all states + """ +class HybridQuantitativeCheckResult(_QuantitativeCheckResult): + """ + Hybrid quantitative model checking result + """ + def get_values(self) -> list[float]: + """ + Get model checking result values for all states + """ +class JaniModelType: + """ + Type of the Jani model + + Members: + + DTMC + + CTMC + + MDP + + CTMDP + + MA + + LTS + + TA + + PTA + + STA + + HA + + PHA + + SHA + + UNDEFINED + """ + CTMC: typing.ClassVar[JaniModelType] # value = + CTMDP: typing.ClassVar[JaniModelType] # value = + DTMC: typing.ClassVar[JaniModelType] # value = + HA: typing.ClassVar[JaniModelType] # value = + LTS: typing.ClassVar[JaniModelType] # value = + MA: typing.ClassVar[JaniModelType] # value = + MDP: typing.ClassVar[JaniModelType] # value = + PHA: typing.ClassVar[JaniModelType] # value = + PTA: typing.ClassVar[JaniModelType] # value = + SHA: typing.ClassVar[JaniModelType] # value = + STA: typing.ClassVar[JaniModelType] # value = + TA: typing.ClassVar[JaniModelType] # value = + UNDEFINED: typing.ClassVar[JaniModelType] # value = + __members__: typing.ClassVar[dict[str, JaniModelType]] # value = {'DTMC': , 'CTMC': , 'MDP': , 'CTMDP': , 'MA': , 'LTS': , 'TA': , 'PTA': , 'STA': , 'HA': , 'PHA': , 'SHA': , 'UNDEFINED': } + def __eq__(self, other: typing.Any) -> bool: + ... + def __getstate__(self) -> int: + ... + def __hash__(self) -> int: + ... + def __index__(self) -> int: + ... + def __init__(self, value: int) -> None: + ... + def __int__(self) -> int: + ... + def __ne__(self, other: typing.Any) -> bool: + ... + def __repr__(self) -> str: + ... + def __setstate__(self, state: int) -> None: + ... + def __str__(self) -> str: + ... + @property + def name(self) -> str: + ... + @property + def value(self) -> int: + ... +class MinMaxMethod: + """ + Method for min-max equation systems + + Members: + + policy_iteration + + value_iteration + + linear_programming + + topological + + rational_search + + interval_iteration + + sound_value_iteration + + optimistic_value_iteration + """ + __members__: typing.ClassVar[dict[str, MinMaxMethod]] # value = {'policy_iteration': , 'value_iteration': , 'linear_programming': , 'topological': , 'rational_search': , 'interval_iteration': , 'sound_value_iteration': , 'optimistic_value_iteration': } + interval_iteration: typing.ClassVar[MinMaxMethod] # value = + linear_programming: typing.ClassVar[MinMaxMethod] # value = + optimistic_value_iteration: typing.ClassVar[MinMaxMethod] # value = + policy_iteration: typing.ClassVar[MinMaxMethod] # value = + rational_search: typing.ClassVar[MinMaxMethod] # value = + sound_value_iteration: typing.ClassVar[MinMaxMethod] # value = + topological: typing.ClassVar[MinMaxMethod] # value = + value_iteration: typing.ClassVar[MinMaxMethod] # value = + def __eq__(self, other: typing.Any) -> bool: + ... + def __getstate__(self) -> int: + ... + def __hash__(self) -> int: + ... + def __index__(self) -> int: + ... + def __init__(self, value: int) -> None: + ... + def __int__(self) -> int: + ... + def __ne__(self, other: typing.Any) -> bool: + ... + def __repr__(self) -> str: + ... + def __setstate__(self, state: int) -> None: + ... + def __str__(self) -> str: + ... + @property + def name(self) -> str: + ... + @property + def value(self) -> int: + ... +class MinMaxSolverEnvironment: + """ + Environment for Min-Max-Solvers + """ + method: MinMaxMethod + precision: stormpy.pycarl.gmp.Rational +class ModelCheckerHint: + """ + Information that may accelerate the model checking process + """ +class ModelFormulasPair: + """ + Pair of model and formulas + """ + @property + def formulas(self) -> list[...]: + """ + The formulas + """ + @property + def model(self) -> ...: + """ + The model + """ +class NativeLinearEquationSolverMethod: + """ + Method for linear equation systems with the native solver + + Members: + + power_iteration + + sound_value_iteration + + optimistic_value_iteration + + interval_iteration + + rational_search + + jacobi + + SOR + + gauss_seidel + + walker_chae + """ + SOR: typing.ClassVar[NativeLinearEquationSolverMethod] # value = + __members__: typing.ClassVar[dict[str, NativeLinearEquationSolverMethod]] # value = {'power_iteration': , 'sound_value_iteration': , 'optimistic_value_iteration': , 'interval_iteration': , 'rational_search': , 'jacobi': , 'SOR': , 'gauss_seidel': , 'walker_chae': } + gauss_seidel: typing.ClassVar[NativeLinearEquationSolverMethod] # value = + interval_iteration: typing.ClassVar[NativeLinearEquationSolverMethod] # value = + jacobi: typing.ClassVar[NativeLinearEquationSolverMethod] # value = + optimistic_value_iteration: typing.ClassVar[NativeLinearEquationSolverMethod] # value = + power_iteration: typing.ClassVar[NativeLinearEquationSolverMethod] # value = + rational_search: typing.ClassVar[NativeLinearEquationSolverMethod] # value = + sound_value_iteration: typing.ClassVar[NativeLinearEquationSolverMethod] # value = + walker_chae: typing.ClassVar[NativeLinearEquationSolverMethod] # value = + def __eq__(self, other: typing.Any) -> bool: + ... + def __getstate__(self) -> int: + ... + def __hash__(self) -> int: + ... + def __index__(self) -> int: + ... + def __init__(self, value: int) -> None: + ... + def __int__(self) -> int: + ... + def __ne__(self, other: typing.Any) -> bool: + ... + def __repr__(self) -> str: + ... + def __setstate__(self, state: int) -> None: + ... + def __str__(self) -> str: + ... + @property + def name(self) -> str: + ... + @property + def value(self) -> int: + ... +class NativeSolverEnvironment: + """ + Environment for Native solvers + """ + maximum_iterations: int + method: NativeLinearEquationSolverMethod + precision: stormpy.pycarl.gmp.Rational +class OptimizationDirection: + """ + Members: + + Minimize + + Maximize + """ + Maximize: typing.ClassVar[OptimizationDirection] # value = + Minimize: typing.ClassVar[OptimizationDirection] # value = + __members__: typing.ClassVar[dict[str, OptimizationDirection]] # value = {'Minimize': , 'Maximize': } + def __eq__(self, other: typing.Any) -> bool: + ... + def __getstate__(self) -> int: + ... + def __hash__(self) -> int: + ... + def __index__(self) -> int: + ... + def __init__(self, value: int) -> None: + ... + def __int__(self) -> int: + ... + def __ne__(self, other: typing.Any) -> bool: + ... + def __repr__(self) -> str: + ... + def __setstate__(self, state: int) -> None: + ... + def __str__(self) -> str: + ... + @property + def name(self) -> str: + ... + @property + def value(self) -> int: + ... +class ParametricCheckTask: + """ + Task for parametric model checking + """ + def __init__(self, formula: ..., only_initial_states: bool = False) -> None: + ... + def set_produce_schedulers(self, produce_schedulers: bool = True) -> None: + """ + Set whether schedulers should be produced (if possible) + """ +class ParetoCurveCheckResultDouble(_CheckResult): + """ + Result for multiobjective model checking + """ + def get_overapproximation(self) -> ...: + ... + def get_underapproximation(self) -> ...: + ... +class Property: + """ + Property + """ + @typing.overload + def __init__(self, name: str, formula: ..., undefined_constants: set[...] = set(), comment: str = '') -> None: + """ + Construct property from formula + """ + @typing.overload + def __init__(self, arg0: Property) -> None: + ... + def __str__(self) -> str: + ... + @property + def name(self) -> str: + """ + Obtain the name of the property + """ + @property + def raw_formula(self) -> ...: + """ + Obtain the formula directly + """ +class QuotientFormat: + """ + Return format of bisimulation quotient + + Members: + + SPARSE + + DD + """ + DD: typing.ClassVar[QuotientFormat] # value = + SPARSE: typing.ClassVar[QuotientFormat] # value = + __members__: typing.ClassVar[dict[str, QuotientFormat]] # value = {'SPARSE': , 'DD': } + def __eq__(self, other: typing.Any) -> bool: + ... + def __getstate__(self) -> int: + ... + def __hash__(self) -> int: + ... + def __index__(self) -> int: + ... + def __init__(self, value: int) -> None: + ... + def __int__(self) -> int: + ... + def __ne__(self, other: typing.Any) -> bool: + ... + def __repr__(self) -> str: + ... + def __setstate__(self, state: int) -> None: + ... + def __str__(self) -> str: + ... + @property + def name(self) -> str: + ... + @property + def value(self) -> int: + ... +class SMTCounterExampleGenerator: + """ + Highlevel Counterexample Generator with SMT as backend + """ + @staticmethod + def build(env: Environment, stats: SMTCounterExampleGeneratorStats, symbolic_model: ..., model: ..., storm: ..., cex_input: ..., dontcare: FlatSet, options: SMTCounterExampleGeneratorOptions) -> list[FlatSet]: + """ + Compute counterexample + """ + @staticmethod + def precompute(env: Environment, symbolic_model: ..., model: ..., storm: ..., formula: ...) -> ...: + """ + Precompute input for counterexample generation + """ +class SMTCounterExampleGeneratorOptions: + """ + Options for highlevel counterexample generation + """ + add_backward_implication_cuts: bool + check_threshold_feasible: bool + continue_after_first_counterexample: int + encode_reachability: bool + maximum_counterexamples: int + maximum_iterations_after_counterexample: int + silent: bool + use_dynamic_constraints: bool + def __init__(self) -> None: + ... +class SMTCounterExampleGeneratorStats: + """ + Stats for highlevel counterexample generation + """ + def __init__(self) -> None: + ... + @property + def analysis_time(self) -> ...: + ... + @property + def cut_time(self) -> ...: + ... + @property + def iterations(self) -> int: + ... + @property + def model_checking_time(self) -> ...: + ... + @property + def setup_time(self) -> ...: + ... + @property + def solver_time(self) -> ...: + ... +class SMTCounterExampleInput: + """ + Precomputed input for counterexample generation + """ + def add_reward_and_threshold(self, reward_name: str, threshold: float) -> None: + """ + add another reward structure and threshold + """ +class SolverEnvironment: + """ + Environment for solvers + """ + def set_force_sound(self, new_value: bool = True) -> None: + """ + force soundness + """ + def set_linear_equation_solver_type(self, new_value: EquationSolverType, set_from_default: bool = False) -> None: + """ + set solver type to use + """ + @property + def minmax_solver_environment(self) -> ...: + ... + @property + def native_solver_environment(self) -> ...: + ... +class StateValuationFunctionActionMaskDouble(ActionMaskDouble): + def __init__(self, f: typing.Callable[[..., int], bool]) -> None: + ... +class SubsystemBuilderOptions: + """ + Options for constructing the subsystem + """ + build_action_mapping: bool + build_kept_actions: bool + build_state_mapping: bool + check_transitions_outside: bool + fix_deadlocks: bool + def __init__(self) -> None: + ... +class SubsystemBuilderReturnTypeDouble: + """ + Result of the construction of a subsystem + """ + @property + def deadlock_label(self) -> str | None: + """ + If set, deadlock states have been introduced and have been assigned this label + """ + @property + def kept_actions(self) -> ...: + """ + Actions of the subsystem available in the original system + """ + @property + def model(self) -> ...: + """ + the submodel + """ + @property + def new_to_old_action_mapping(self) -> list[int]: + """ + for each action in result, the action index in the original model + """ + @property + def new_to_old_state_mapping(self) -> list[int]: + """ + for each state in result, the state index in the original model + """ +class SubsystemBuilderReturnTypeExact: + """ + Result of the construction of a subsystem + """ + @property + def deadlock_label(self) -> str | None: + """ + If set, deadlock states have been introduced and have been assigned this label + """ + @property + def kept_actions(self) -> ...: + """ + Actions of the subsystem available in the original system + """ + @property + def model(self) -> ...: + """ + the submodel + """ + @property + def new_to_old_action_mapping(self) -> list[int]: + """ + for each action in result, the action index in the original model + """ + @property + def new_to_old_state_mapping(self) -> list[int]: + """ + for each state in result, the state index in the original model + """ +class SubsystemBuilderReturnTypeRatFunc: + """ + Result of the construction of a subsystem + """ + @property + def deadlock_label(self) -> str | None: + """ + If set, deadlock states have been introduced and have been assigned this label + """ + @property + def kept_actions(self) -> ...: + """ + Actions of the subsystem available in the original system + """ + @property + def model(self) -> ...: + """ + the submodel + """ + @property + def new_to_old_action_mapping(self) -> list[int]: + """ + for each action in result, the action index in the original model + """ + @property + def new_to_old_state_mapping(self) -> list[int]: + """ + for each state in result, the state index in the original model + """ +class SymbolicExactQuantitativeCheckResult(_QuantitativeCheckResult): + """ + Symbolic exact quantitative model checking result + """ + def clone(self) -> SymbolicExactQuantitativeCheckResult: + ... +class SymbolicModelDescription: + """ + Symbolic description of model + """ + @staticmethod + def parse_constant_definitions(*args, **kwargs) -> dict[..., ...]: + """ + Parse given constant definitions + """ + @typing.overload + def __init__(self, prism_program: ...) -> None: + """ + Construct from Prism program + """ + @typing.overload + def __init__(self, jani_model: ...) -> None: + """ + Construct from Jani model + """ + def as_jani_model(self) -> ...: + """ + Return Jani model + """ + def as_prism_program(self) -> ...: + """ + Return Prism program + """ + def instantiate_constants(self, constant_definitions: dict[..., ...]) -> SymbolicModelDescription: + """ + Instantiate constants in symbolic model description + """ + @property + def is_jani_model(self) -> bool: + """ + Flag if program is in Jani format + """ + @property + def is_prism_program(self) -> bool: + """ + Flag if program is in Prism format + """ +class SymbolicParametricQuantitativeCheckResult(_QuantitativeCheckResult): + """ + Symbolic parametric quantitative model checking result + """ + def clone(self) -> SymbolicParametricQuantitativeCheckResult: + ... +class SymbolicQualitativeCheckResult(_QualitativeCheckResult): + """ + Symbolic qualitative model checking result + """ + def get_truth_values(self) -> ...: + """ + Get Dd representing the truth values + """ +class SymbolicQuantitativeCheckResult(_QuantitativeCheckResult): + """ + Symbolic quantitative model checking result + """ + def clone(self) -> SymbolicQuantitativeCheckResult: + ... + def get_values(self) -> ...: + ... +class _CheckResult: + """ + Base class for all modelchecking results + """ + def __str__(self) -> str: + ... + def as_explicit_exact_quantitative(self) -> ...: + """ + Convert into explicit quantitative result + """ + def as_explicit_parametric_quantitative(self) -> ...: + """ + Convert into explicit quantitative result + """ + def as_explicit_qualitative(self) -> ...: + """ + Convert into explicit qualitative result + """ + def as_explicit_quantitative(self) -> ...: + """ + Convert into explicit quantitative result + """ + def filter(self, filter: ...) -> None: + """ + Filter the result + """ + @property + def _explicit_qualitative(self) -> bool: + """ + Flag if result is explicit qualitative + """ + @property + def _explicit_quantitative(self) -> bool: + """ + Flag if result is explicit quantitative + """ + @property + def _hybrid(self) -> bool: + """ + Flag if result is hybrid + """ + @property + def _hybrid_quantitative(self) -> bool: + """ + Flag if result is hybrid quantitative + """ + @property + def _pareto_curve(self) -> bool: + """ + Flag if result is a pareto curve + """ + @property + def _qualitative(self) -> bool: + """ + Flag if result is qualitative + """ + @property + def _quantitative(self) -> bool: + """ + Flag if result is quantitative + """ + @property + def _symbolic(self) -> bool: + """ + Flag if result is symbolic + """ + @property + def _symbolic_qualitative(self) -> bool: + """ + Flag if result is symbolic qualitative + """ + @property + def _symbolic_quantitative(self) -> bool: + """ + Flag if result is symbolic quantitative + """ + @property + def has_scheduler(self) -> bool: + """ + Flag if a scheduler is present + """ + @property + def result_for_all_states(self) -> bool: + """ + Flag if result is for all states + """ +class _DiscreteTimePrismProgramSimulatorDouble: + """ + Simulator for prism programs + """ + def __init__(self, program: ..., options: BuilderOptions) -> None: + ... + def _reset_to_state_from_compressed_state(self, arg0: ...) -> None: + ... + def _reset_to_state_from_valuation(self, arg0: ...) -> None: + ... + def get_action_indices(self) -> list[int]: + """ + A list of choices that encode the possibilities in the current state. + """ + def get_current_labels(self) -> list[str]: + """ + What are the state labels at the current state? + """ + def get_current_observation_as_json(self) -> ...: + ... + def get_current_state(self) -> ...: + """ + Get current state + """ + def get_current_state_as_json(self) -> ...: + ... + def get_current_state_is_sink(self) -> bool: + ... + def get_last_reward(self) -> list[float]: + ... + def get_number_of_current_choices(self) -> int: + ... + def get_reward_names(self) -> list[str]: + """ + Get names of the rewards provided by the simulator + """ + def reset_to_initial_state(self) -> bool: + """ + Reset to the initial state + """ + def set_seed(self, seed: int) -> None: + ... + def step(self, action_index: int) -> bool: + """ + Make a step and randomly select the successor. The action is given as an argument, the index reflects the index of the getChoices vector that can be accessed. + """ +class _DiscreteTimeSparseModelSimulatorDouble: + """ + Simulator for sparse discrete-time models in memory (for ValueType) + """ + def __init__(self, arg0: ..., storm: ...) -> None: + ... + def get_current_state(self) -> int: + ... + def get_last_reward(self) -> list[float]: + ... + def random_step(self) -> bool: + ... + def reset_to_initial_state(self) -> bool: + ... + def set_seed(self, seed: int) -> None: + ... + def step(self, action: int) -> bool: + ... +class _DiscreteTimeSparseModelSimulatorExact: + """ + Simulator for sparse discrete-time models in memory (for ValueType) + """ + @staticmethod + def __init__(*args, **kwargs) -> None: + ... + def get_current_state(self) -> int: + ... + def get_last_reward(self) -> list[stormpy.pycarl.gmp.Rational]: + ... + def random_step(self) -> bool: + ... + def reset_to_initial_state(self) -> bool: + ... + def set_seed(self, seed: int) -> None: + ... + def step(self, action: int) -> bool: + ... +class _ExactQuantitativeCheckResult(_CheckResult): + """ + Abstract class for exact quantitative model checking results + """ +class _ParametricQuantitativeCheckResult(_CheckResult): + """ + Abstract class for parametric quantitative model checking results + """ +class _QualitativeCheckResult(_CheckResult): + """ + Abstract class for qualitative model checking results + """ +class _QuantitativeCheckResult(_CheckResult): + """ + Abstract class for quantitative model checking results + """ + @property + def max(self) -> float: + """ + Maximal value + """ + @property + def min(self) -> float: + """ + Minimal value + """ +def _build_sparse_exact_model_from_drn(file: str, options: DirectEncodingParserOptions = ...) -> ...: + """ + Build the model from DRN + """ +def _build_sparse_exact_model_from_symbolic_description(model_description: ..., formulas: list[...] = []) -> ...: + """ + Build the model in sparse representation with exact number representation + """ +def _build_sparse_interval_model_from_drn(file: str, options: DirectEncodingParserOptions = ...) -> ...: + """ + Build the interval model from DRN + """ +def _build_sparse_model_from_drn(file: str, options: DirectEncodingParserOptions = ...) -> ...: + """ + Build the model from DRN + """ +def _build_sparse_model_from_symbolic_description(model_description: ..., formulas: list[...] = []) -> ...: + """ + Build the model in sparse representation + """ +def _build_sparse_parametric_model_from_drn(file: str, options: DirectEncodingParserOptions = ...) -> ...: + """ + Build the parametric model from DRN + """ +def _build_sparse_parametric_model_from_symbolic_description(model_description: ..., formulas: list[...] = []) -> ...: + """ + Build the parametric model in sparse representation + """ +def _build_symbolic_model_from_symbolic_description(model_description: ..., formulas: list[...] = []) -> ...: + """ + Build the model in symbolic representation + """ +def _build_symbolic_parametric_model_from_symbolic_description(model_description: ..., formulas: list[...] = []) -> ...: + """ + Build the parametric model in symbolic representation + """ +def _compute_expected_number_of_visits_double(env: Environment, model: ..., storm: ...) -> _CheckResult: + ... +def _compute_expected_number_of_visits_exact(*args, **kwargs) -> _CheckResult: + ... +def _compute_prob01states_double(model: ..., storm: ..., phi_states: ..., psi_states: ...) -> tuple[..., ...]: + """ + Compute prob-0-1 states + """ +def _compute_prob01states_max_double(model: ..., storm: ..., phi_states: ..., psi_states: ...) -> tuple[..., ...]: + """ + Compute prob-0-1 states (max) + """ +def _compute_prob01states_max_rationalfunc(*args, **kwargs) -> tuple[..., ...]: + """ + Compute prob-0-1 states (max) + """ +def _compute_prob01states_min_double(model: ..., storm: ..., phi_states: ..., psi_states: ...) -> tuple[..., ...]: + """ + Compute prob-0-1 states (min) + """ +def _compute_prob01states_min_rationalfunc(*args, **kwargs) -> tuple[..., ...]: + """ + Compute prob-0-1 states (min) + """ +def _compute_prob01states_rationalfunc(*args, **kwargs) -> tuple[..., ...]: + """ + Compute prob-0-1 states + """ +def _compute_steady_state_distribution_double(env: Environment, model: ..., storm: ...) -> _CheckResult: + ... +def _compute_steady_state_distribution_exact(*args, **kwargs) -> _CheckResult: + ... +def _construct_subsystem_Double(arg0: ..., storm: ..., arg1: ..., arg2: ..., arg3: bool, arg4: SubsystemBuilderOptions) -> SubsystemBuilderReturnTypeDouble: + """ + build a subsystem of a sparse model + """ +def _construct_subsystem_Exact(*args, **kwargs) -> SubsystemBuilderReturnTypeExact: + """ + build a subsystem of a sparse model + """ +def _construct_subsystem_RatFunc(*args, **kwargs) -> SubsystemBuilderReturnTypeRatFunc: + """ + build a subsystem of a sparse model + """ +def _eliminate_end_components_double(matrix: ..., subsystem: ..., possible_ec_rows: ..., addSinkRowStates: ..., addSelfLoopAtSinkStates: bool) -> EndComponentEliminatorReturnTypeDouble: + """ + Eliminate ECs in the subystem + """ +def _eliminate_non_markovian_chains(ma: ..., storm: ..., formulae: list[...], label_behavior: EliminationLabelBehavior) -> tuple[..., ..., list[...]]: + """ + Eliminate chains of non-Markovian states in Markov automaton. + """ +def _eliminate_non_markovian_chains_parametric(*args, **kwargs) -> tuple[..., ..., ..., ..., ..., ..., ..., ..., list[...]]: + """ + Eliminate chains of non-Markovian states in Markov automaton. + """ +def _exact_model_checking_fully_observable(*args, **kwargs) -> _CheckResult: + ... +def _exact_model_checking_sparse_engine(*args, **kwargs) -> _CheckResult: + """ + Perform model checking using the sparse engine + """ +def _export_exact_to_drn(*args, **kwargs) -> None: + """ + Export model in DRN format + """ +def _export_parametric_to_drn(*args, **kwargs) -> None: + """ + Export parametric model in DRN format + """ +def _export_to_drn(model: ..., storm: ..., file: str, options: DirectEncodingOptions = ...) -> None: + """ + Export model in DRN format + """ +def _export_to_drn_interval(model: ..., storm: ..., file: str, options: DirectEncodingOptions = ...) -> None: + """ + Export model in DRN format + """ +def _get_reachable_states_double(model: ..., storm: ..., initial_states: ..., constraint_states: ..., target_states: ..., maximal_steps: int | None = None, choice_filter: ... | None = None) -> ...: + ... +def _get_reachable_states_exact(*args, **kwargs) -> ...: + ... +def _get_reachable_states_rf(*args, **kwargs) -> ...: + ... +def _model_checking_dd_engine(*args, **kwargs) -> _CheckResult: + """ + Perform model checking using the dd engine + """ +def _model_checking_fully_observable(model: ..., storm: ..., task: CheckTask, environment: Environment = ...) -> _CheckResult: + ... +def _model_checking_hybrid_engine(*args, **kwargs) -> _CheckResult: + """ + Perform model checking using the hybrid engine + """ +def _model_checking_sparse_engine(model: ..., storm: ..., task: CheckTask, environment: Environment = ...) -> _CheckResult: + """ + Perform model checking using the sparse engine + """ +def _multi_objective_model_checking_double(model: ..., storm: ..., formula: ..., environment: Environment = ...) -> _CheckResult: + """ + Run multi-objective model checking + """ +def _multi_objective_model_checking_exact(*args, **kwargs) -> _CheckResult: + """ + Run multi-objective model checking + """ +def _parametric_model_checking_dd_engine(*args, **kwargs) -> _CheckResult: + """ + Perform parametric model checking using the dd engine + """ +def _parametric_model_checking_hybrid_engine(*args, **kwargs) -> _CheckResult: + """ + Perform parametric model checking using the hybrid engine + """ +def _parametric_model_checking_sparse_engine(*args, **kwargs) -> _CheckResult: + """ + Perform parametric model checking using the sparse engine + """ +def _perform_bisimulation(model: ..., storm: ..., formulas: list[...], bisimulation_type: ...) -> ...: + """ + Perform bisimulation + """ +def _perform_parametric_bisimulation(*args, **kwargs) -> ...: + """ + Perform bisimulation on parametric model + """ +def _perform_symbolic_bisimulation(*args, **kwargs) -> ...: + """ + Perform bisimulation + """ +def _perform_symbolic_parametric_bisimulation(*args, **kwargs) -> ...: + """ + Perform bisimulation on parametric model + """ +def _set_up(arguments: str) -> None: + """ + Initialize Storm + """ +def _transform_to_discrete_time_model(model: ..., storm: ..., formulae: list[...] = []) -> tuple[..., ..., list[...]]: + """ + Transform continuous time model to discrete time model + """ +def _transform_to_discrete_time_parametric_model(*args, **kwargs) -> tuple[..., ..., ..., ..., ..., ..., ..., ..., list[...]]: + """ + Transform parametric continuous time model to parametric discrete time model + """ +def _transform_to_sparse_model(*args, **kwargs) -> ...: + """ + Transform symbolic model into sparse model + """ +def _transform_to_sparse_parametric_model(*args, **kwargs) -> ...: + """ + Transform symbolic parametric model into sparse parametric model + """ +def build_sparse_exact_model_with_options(model_description: ..., options: ...) -> ...: + """ + Build the model in sparse representation with exact number representation + """ +def build_sparse_model_from_explicit(transition_file: str, labeling_file: str, state_reward_file: str | None = '', transition_reward_file: str | None = '', choice_labeling_file: str | None = '') -> ...: + """ + Build the model model from explicit input + """ +def build_sparse_model_with_options(model_description: ..., options: ...) -> ...: + """ + Build the model in sparse representation + """ +def build_sparse_parametric_model_with_options(model_description: ..., options: ...) -> ...: + """ + Build the model in sparse representation + """ +def check_interval_mdp(arg0: ..., storm: ..., arg1: CheckTask, arg2: Environment) -> _CheckResult: + """ + Check interval MDP + """ +def compute_all_until_probabilities(arg0: Environment, arg1: CheckTask, arg2: ..., storm: ..., arg3: ..., arg4: ...) -> list[float]: + """ + Compute forward until probabilities + """ +def compute_transient_probabilities(arg0: Environment, arg1: ..., storm: ..., arg2: ..., arg3: ..., arg4: float) -> list[float]: + """ + Compute transient probabilities + """ +def create_filter_initial_states_sparse(model: ..., storm: ...) -> _QualitativeCheckResult: + """ + Create a filter for the initial states on a sparse model + """ +def create_filter_initial_states_symbolic(*args, **kwargs) -> _QualitativeCheckResult: + """ + Create a filter for the initial states on a symbolic model + """ +def create_filter_symbolic(*args, **kwargs) -> _QualitativeCheckResult: + """ + Creates a filter for the given states and a symbolic model + """ +def install_signal_handlers(arg0: int) -> None: + ... +def make_sparse_model_builder(*args, **kwargs) -> ...: + """ + Construct a builder instance + """ +def make_sparse_model_builder_exact(*args, **kwargs) -> ...: + """ + Construct a builder instance + """ +def make_sparse_model_builder_parametric(*args, **kwargs) -> ...: + """ + Construct a builder instance + """ +def parse_constants_string(expression_manager: ..., definition_string: str) -> dict[..., ...]: + """ + Parse constants definition + """ +def parse_jani_model(path: str) -> tuple[..., list[Property]]: + """ + Parse Jani model + """ +def parse_jani_model_from_string(json_string: str) -> tuple[..., list[Property]]: + """ + Parse Jani model from string + """ +def parse_prism_program(path: str, prism_compat: bool = False, simplify: bool = True) -> ...: + """ + Parse Prism program + """ +def parse_properties_for_jani_model(formula_string: str, jani_model: ..., property_filter: set[str] | None = None) -> list[Property]: + ... +def parse_properties_for_prism_program(formula_string: str, prism_program: ..., property_filter: set[str] | None = None) -> list[Property]: + """ + Parses properties given in the prism format, allows references to variables in the prism program. + + :param str formula_str: A string of formulas + :param PrismProgram prism_program: A prism program + :param str property_filter: A filter + :return: A list of properties + """ +def parse_properties_without_context(formula_string: str, property_filter: set[str] | None = None) -> list[Property]: + """ + Parse properties given in the prism format. + + :param str formula_str: A string of formulas + :param str property_filter: A filter + :return: A list of properties + """ +def preprocess_symbolic_input(symbolic_model_description: ..., properties: list[Property], constant_definition_string: str) -> tuple[..., list[Property]]: + """ + Preprocess symoblic input + """ +def reset_timeout() -> None: + """ + Reset timeout + """ +def set_loglevel_debug() -> None: + """ + set loglevel for storm to debug + """ +def set_loglevel_error() -> None: + ... +def set_loglevel_trace() -> None: + ... +def set_settings(arguments: list[str]) -> None: + """ + Set settings + """ +def set_timeout(timeout: int) -> None: + """ + Set timeout in seconds + """ diff --git a/lib/stormpy/exceptions.pyi b/lib/stormpy/exceptions.pyi new file mode 100644 index 0000000000..10c35d6539 --- /dev/null +++ b/lib/stormpy/exceptions.pyi @@ -0,0 +1,15 @@ +from __future__ import annotations +__all__ = ['StormError'] +class StormError(Exception): + """ + + Base class for exceptions in Storm. + + """ + def __init__(self, message): + """ + + Constructor. + :param message: Error message. + + """ diff --git a/lib/stormpy/pomdp/__init__.py b/lib/stormpy/pomdp/__init__.py index d490e77b4d..a4232047ba 100644 --- a/lib/stormpy/pomdp/__init__.py +++ b/lib/stormpy/pomdp/__init__.py @@ -10,6 +10,8 @@ def make_canonic(model): if model.supports_parameters: return pomdp._make_canonic_Rf(model) + if model.is_exact: + return pomdp._make_canonic_Exact(model) else: return pomdp._make_canonic_Double(model) diff --git a/lib/stormpy/pycarl/__init__.pyi b/lib/stormpy/pycarl/__init__.pyi new file mode 100644 index 0000000000..9df061c95d --- /dev/null +++ b/lib/stormpy/pycarl/__init__.pyi @@ -0,0 +1,61 @@ +from __future__ import annotations +from stormpy.pycarl.pycarl_core import BoundType +from stormpy.pycarl.pycarl_core import Interval +from stormpy.pycarl.pycarl_core import Monomial +from stormpy.pycarl.pycarl_core import NoPicklingSupport +from stormpy.pycarl.pycarl_core import Variable +from stormpy.pycarl.pycarl_core import VariableType +from stormpy.pycarl.pycarl_core import abs +from stormpy.pycarl.pycarl_core import ceil +from stormpy.pycarl.pycarl_core import clear_monomial_pool +from stormpy.pycarl.pycarl_core import clear_variable_pool +from stormpy.pycarl.pycarl_core import create_monomial +from stormpy.pycarl.pycarl_core import div +from stormpy.pycarl.pycarl_core import floor +from stormpy.pycarl.pycarl_core import isInteger +from stormpy.pycarl.pycarl_core import pow +from stormpy.pycarl.pycarl_core import quotient +from stormpy.pycarl.pycarl_core import variable_with_name +import sys as sys +from . import _config +from . import _version +from . import cln +from . import gmp +from . import infinity +from . import pycarl_core +__all__ = ['BoundType', 'Interval', 'Monomial', 'NoPicklingSupport', 'Variable', 'VariableType', 'abs', 'carl_version', 'ceil', 'clear_monomial_pool', 'clear_pools', 'clear_variable_pool', 'cln', 'create_monomial', 'div', 'floor', 'gmp', 'has_cln', 'has_parser', 'inf', 'infinity', 'isInteger', 'pow', 'print_info', 'pycarl_core', 'quotient', 'sys', 'variable_with_name'] +def carl_version(): + """ + + Get Carl version. + :return: Version of Carl. + + """ +def clear_pools(): + """ + + Clear all pools. + + """ +def has_cln(): + """ + + Check if pycarl has support for CLN. + :return: True iff CLN is supported. + + """ +def has_parser(): + """ + + Check if pycarl has parsing support. + :return: True iff parsing is supported. + + """ +def print_info(): + """ + + Print information about pycarl. + + """ +__version__: str = '2.2.0' +inf: infinity.Infinity # value = pycarl.inf diff --git a/lib/stormpy/pycarl/_config.pyi b/lib/stormpy/pycarl/_config.pyi new file mode 100644 index 0000000000..10dfa48619 --- /dev/null +++ b/lib/stormpy/pycarl/_config.pyi @@ -0,0 +1,6 @@ +from __future__ import annotations +__all__ = ['CARL_VERSION', 'CARL_WITH_CLN', 'CARL_WITH_PARSER', 'PYBIND_VERSION'] +CARL_VERSION: str = '14.28' +CARL_WITH_CLN: bool = True +CARL_WITH_PARSER: bool = False +PYBIND_VERSION: str = '2.10.0' diff --git a/lib/stormpy/pycarl/_version.pyi b/lib/stormpy/pycarl/_version.pyi new file mode 100644 index 0000000000..9daaad0ae6 --- /dev/null +++ b/lib/stormpy/pycarl/_version.pyi @@ -0,0 +1,3 @@ +from __future__ import annotations +__all__ = list() +__version__: str = '2.2.0' diff --git a/lib/stormpy/pycarl/cln/__init__.pyi b/lib/stormpy/pycarl/cln/__init__.pyi new file mode 100644 index 0000000000..31aeb91781 --- /dev/null +++ b/lib/stormpy/pycarl/cln/__init__.pyi @@ -0,0 +1,1114 @@ +from __future__ import annotations +from stormpy.pycarl import cln +import stormpy.pycarl.pycarl_core +import typing +from . import _config +__all__ = ['Factorization', 'FactorizedPolynomial', 'FactorizedRationalFunction', 'Integer', 'Interval', 'Polynomial', 'Rational', 'RationalFunction', 'Term', 'abs', 'ceil', 'cln', 'create_factorized_polynomial', 'denominator', 'div', 'expand', 'factorization_cache', 'floor', 'isInteger', 'numerator', 'pow', 'quotient'] +class Factorization: + """ + Factorization + """ + __hash__: typing.ClassVar[None] = None + def __eq__(self, arg0: Factorization) -> bool: + ... + def __getstate__(self) -> tuple[str]: + ... + def __iter__(self) -> typing.Iterator: + ... + def __len__(self) -> int: + ... + def __setstate__(self, arg0: tuple[str]) -> None: + ... + def __str__(self) -> str: + ... +class FactorizedPolynomial: + """ + Represent a polynomial with its factorization + """ + coefficient: Rational + def __add__(self, arg0: FactorizedPolynomial) -> FactorizedPolynomial: + ... + @typing.overload + def __eq__(self, arg0: FactorizedPolynomial) -> bool: + ... + @typing.overload + def __eq__(self, arg0: Rational) -> bool: + ... + def __getstate__(self) -> tuple[str]: + ... + def __hash__(self) -> int: + ... + @typing.overload + def __init__(self, number: Rational) -> None: + """ + Constructor + """ + @typing.overload + def __init__(self, polynomial: Polynomial, cache: _FactorizationCache) -> None: + """ + Constructor + """ + def __mul__(self, arg0: FactorizedPolynomial) -> FactorizedPolynomial: + ... + @typing.overload + def __ne__(self, arg0: FactorizedPolynomial) -> bool: + ... + @typing.overload + def __ne__(self, arg0: Rational) -> bool: + ... + def __pow__(self, exponent: int) -> FactorizedPolynomial: + """ + Raise polynomial to the power + """ + def __setstate__(self, arg0: tuple[str]) -> None: + ... + def __str__(self) -> str: + ... + def __sub__(self, arg0: FactorizedPolynomial) -> FactorizedPolynomial: + ... + def cache(self) -> _FactorizationCache: + ... + def constant_part(self) -> Rational: + ... + def derive(self, variable: stormpy.pycarl.pycarl_core.Variable) -> FactorizedPolynomial: + """ + Compute the derivative + """ + def evaluate(self, arg0: dict[stormpy.pycarl.pycarl_core.Variable, Rational]) -> Rational: + ... + def factorization(self) -> Factorization: + """ + Get factorization + """ + def gather_variables(self) -> set[stormpy.pycarl.pycarl_core.Variable]: + ... + def is_constant(self) -> bool: + ... + def is_one(self) -> bool: + ... + def polynomial(self) -> Polynomial: + """ + Get underlying polynomial + """ + def to_smt2(self) -> str: + ... +class FactorizedRationalFunction: + """ + Represent a rational function, that is the fraction of two factorized polynomials + """ + @typing.overload + def __add__(self, arg0: FactorizedRationalFunction) -> FactorizedRationalFunction: + ... + @typing.overload + def __add__(self, arg0: Rational) -> FactorizedRationalFunction: + ... + def __eq__(self, arg0: FactorizedRationalFunction) -> bool: + ... + def __getstate__(self) -> tuple[str]: + ... + def __hash__(self) -> int: + ... + @typing.overload + def __init__(self, arg0: FactorizedPolynomial) -> None: + ... + @typing.overload + def __init__(self, arg0: FactorizedPolynomial, arg1: FactorizedPolynomial) -> None: + ... + def __mul__(self, arg0: FactorizedRationalFunction) -> FactorizedRationalFunction: + ... + def __ne__(self, arg0: FactorizedRationalFunction) -> bool: + ... + def __setstate__(self, arg0: tuple[str]) -> None: + ... + def __str__(self) -> str: + ... + def __sub__(self, arg0: FactorizedRationalFunction) -> FactorizedRationalFunction: + ... + def __truediv__(self, arg0: FactorizedRationalFunction) -> FactorizedRationalFunction: + ... + def constant_part(self) -> Rational: + ... + def derive(self, variable: stormpy.pycarl.pycarl_core.Variable) -> FactorizedRationalFunction: + """ + Compute the derivative + """ + def evaluate(self, arg0: dict[stormpy.pycarl.pycarl_core.Variable, Rational]) -> Rational: + ... + def gather_variables(self) -> set[stormpy.pycarl.pycarl_core.Variable]: + ... + def is_constant(self) -> bool: + ... + def rational_function(self) -> RationalFunction: + ... + def to_smt2(self) -> str: + ... + @property + def denominator(self) -> FactorizedPolynomial: + ... + @property + def numerator(self) -> FactorizedPolynomial: + ... +class Integer: + """ + Class wrapping cln-integers + """ + @staticmethod + @typing.overload + def __init__(*args, **kwargs) -> None: + ... + def __abs__(self) -> Integer: + ... + @typing.overload + def __add__(self, arg0: Integer) -> Integer: + ... + @typing.overload + def __add__(self, arg0: int) -> Integer: + ... + @typing.overload + def __add__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: + ... + @typing.overload + def __add__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> ...: + ... + @typing.overload + def __eq__(self, arg0: Integer) -> bool: + ... + @typing.overload + def __eq__(self, arg0: int) -> bool: + ... + def __float__(self) -> float: + ... + @typing.overload + def __ge__(self, arg0: Integer) -> bool: + ... + @typing.overload + def __ge__(self, arg0: int) -> bool: + ... + def __getstate__(self) -> tuple[str]: + ... + @typing.overload + def __gt__(self, arg0: Integer) -> bool: + ... + @typing.overload + def __gt__(self, arg0: int) -> bool: + ... + def __hash__(self) -> int: + ... + @typing.overload + def __init__(self, arg0: int) -> None: + ... + @typing.overload + def __init__(self, arg0: str) -> None: + ... + @typing.overload + def __le__(self, arg0: Integer) -> bool: + ... + @typing.overload + def __le__(self, arg0: int) -> bool: + ... + @typing.overload + def __lt__(self, arg0: Integer) -> bool: + ... + @typing.overload + def __lt__(self, arg0: int) -> bool: + ... + @typing.overload + def __mul__(self, arg0: Integer) -> Integer: + ... + @typing.overload + def __mul__(self, arg0: int) -> Integer: + ... + @typing.overload + def __mul__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: + ... + @typing.overload + def __mul__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> ...: + ... + @typing.overload + def __ne__(self, arg0: Integer) -> bool: + ... + @typing.overload + def __ne__(self, arg0: int) -> bool: + ... + def __neg__(self) -> Integer: + ... + def __pos__(self) -> Integer: + ... + def __pow__(self, arg0: int) -> Integer: + ... + @typing.overload + def __radd__(self, arg0: int) -> Integer: + ... + @typing.overload + def __radd__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: + ... + @typing.overload + def __radd__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> ...: + ... + def __repr__(self) -> str: + ... + @typing.overload + def __rmul__(self, arg0: int) -> Integer: + ... + @typing.overload + def __rmul__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: + ... + @typing.overload + def __rmul__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> ...: + ... + def __rsub__(self, arg0: int) -> Integer: + ... + def __setstate__(self, arg0: tuple[str]) -> None: + ... + def __str__(self) -> str: + ... + @typing.overload + def __sub__(self, arg0: Integer) -> Integer: + ... + @typing.overload + def __sub__(self, arg0: int) -> Integer: + ... + @typing.overload + def __sub__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: + ... + @typing.overload + def __sub__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> ...: + ... + def __truediv__(self, arg0: Integer) -> ...: + ... +class Interval: + __hash__: typing.ClassVar[None] = None + @staticmethod + def emptyInterval() -> Interval: + ... + @staticmethod + def unboundedInterval() -> Interval: + ... + @staticmethod + def zeroInterval() -> Interval: + ... + @typing.overload + def __add__(self, arg0: Interval) -> Interval: + ... + @typing.overload + def __add__(self, arg0: Rational) -> Interval: + ... + def __eq__(self, arg0: Interval) -> bool: + ... + @typing.overload + def __ge__(self, arg0: Rational) -> bool: + ... + @typing.overload + def __ge__(self, arg0: Interval) -> bool: + ... + @typing.overload + def __ge__(self, arg0: Rational) -> bool: + ... + def __getstate__(self) -> tuple[str]: + ... + @typing.overload + def __gt__(self, arg0: Rational) -> bool: + ... + @typing.overload + def __gt__(self, arg0: Interval) -> bool: + ... + @typing.overload + def __gt__(self, arg0: Rational) -> bool: + ... + @typing.overload + def __iadd__(self, arg0: Interval) -> Interval: + ... + @typing.overload + def __iadd__(self, arg0: Rational) -> Interval: + ... + @typing.overload + def __imul__(self, arg0: Interval) -> Interval: + ... + @typing.overload + def __imul__(self, arg0: Rational) -> Interval: + ... + @typing.overload + def __init__(self, arg0: Rational) -> None: + ... + @typing.overload + def __init__(self, arg0: Rational, arg1: Rational) -> None: + ... + @typing.overload + def __init__(self, arg0: Rational, arg1: stormpy.pycarl.pycarl_core.BoundType, arg2: Rational, arg3: stormpy.pycarl.pycarl_core.BoundType) -> None: + ... + @typing.overload + def __isub__(self, arg0: Interval) -> Interval: + ... + @typing.overload + def __isub__(self, arg0: Rational) -> Interval: + ... + def __itruediv__(self, arg0: Rational) -> Interval: + ... + @typing.overload + def __le__(self, arg0: Interval) -> bool: + ... + @typing.overload + def __le__(self, arg0: Rational) -> bool: + ... + @typing.overload + def __le__(self, arg0: Rational) -> bool: + ... + @typing.overload + def __lt__(self, arg0: Interval) -> bool: + ... + @typing.overload + def __lt__(self, arg0: Rational) -> bool: + ... + @typing.overload + def __lt__(self, arg0: Rational) -> bool: + ... + @typing.overload + def __mul__(self, arg0: Interval) -> Interval: + ... + @typing.overload + def __mul__(self, arg0: Rational) -> Interval: + ... + def __ne__(self, arg0: Interval) -> bool: + ... + def __neg__(self) -> Interval: + ... + def __pow__(self, arg0: int) -> Interval: + ... + def __radd__(self, arg0: Rational) -> Interval: + ... + def __repr__(self) -> str: + ... + def __rmul__(self, arg0: Rational) -> Interval: + ... + def __rsub__(self, arg0: Rational) -> Interval: + ... + def __setstate__(self, arg0: tuple[str]) -> None: + ... + def __str__(self) -> str: + ... + @typing.overload + def __sub__(self, arg0: Interval) -> Interval: + ... + @typing.overload + def __sub__(self, arg0: Rational) -> Interval: + ... + def __truediv__(self, arg0: Rational) -> Interval: + ... + def abs(self) -> Interval: + ... + def center(self) -> Rational: + ... + def complement(self, arg0: Interval, arg1: Interval) -> bool: + ... + @typing.overload + def contains(self, arg0: Rational) -> bool: + ... + @typing.overload + def contains(self, arg0: Interval) -> bool: + ... + def diameter(self) -> Rational: + ... + def difference(self, arg0: Interval, arg1: Interval, arg2: Interval) -> bool: + ... + def div(self, arg0: Interval) -> Interval: + ... + def integralPart(self) -> Interval: + ... + def intersect(self, arg0: Interval) -> Interval: + ... + def intersectsWith(self, arg0: Interval) -> bool: + ... + def inverse(self) -> Interval: + ... + def isClosedInterval(self) -> bool: + ... + def isEmpty(self) -> bool: + ... + def isHalfBounded(self) -> bool: + ... + def isInfinite(self) -> bool: + ... + def isNegative(self) -> bool: + ... + def isOne(self) -> bool: + ... + def isOpenInterval(self) -> bool: + ... + def isPointInterval(self) -> bool: + ... + def isPositive(self) -> bool: + ... + def isProperSubset(self, arg0: Interval) -> bool: + ... + def isSemiNegative(self) -> bool: + ... + def isSemiPositive(self) -> bool: + ... + def isSubset(self, arg0: Interval) -> bool: + ... + def isUnbounded(self) -> bool: + ... + def isZero(self) -> bool: + ... + def lower(self) -> Rational: + ... + def meets(self, arg0: Rational) -> bool: + ... + def sample(self, arg0: bool) -> Rational: + ... + def setLower(self, arg0: Rational) -> None: + ... + def setUpper(self, arg0: Rational) -> None: + ... + def symmetricDifference(self, arg0: Interval, arg1: Interval, arg2: Interval) -> bool: + ... + def unite(self, arg0: Interval, arg1: Interval, arg2: Interval) -> bool: + ... + def upper(self) -> Rational: + ... +class Polynomial: + """ + Represent a multivariate polynomial + """ + @staticmethod + @typing.overload + def __add__(*args, **kwargs) -> ...: + ... + @staticmethod + @typing.overload + def __truediv__(*args, **kwargs) -> ...: + ... + @typing.overload + def __add__(self, arg0: Integer) -> Polynomial: + ... + @typing.overload + def __add__(self, arg0: Rational) -> Polynomial: + ... + @typing.overload + def __add__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> Polynomial: + ... + @typing.overload + def __add__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> Polynomial: + ... + @typing.overload + def __add__(self, arg0: Term) -> Polynomial: + ... + @typing.overload + def __add__(self, arg0: Polynomial) -> Polynomial: + ... + @typing.overload + def __eq__(self, arg0: Polynomial) -> bool: + ... + @typing.overload + def __eq__(self, arg0: Rational) -> bool: + ... + @typing.overload + def __eq__(self, arg0: Integer) -> bool: + ... + def __getitem__(self, arg0: int) -> Term: + ... + def __getstate__(self) -> tuple[str]: + ... + def __hash__(self) -> int: + ... + @typing.overload + def __init__(self, arg0: Term) -> None: + ... + @typing.overload + def __init__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> None: + ... + @typing.overload + def __init__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> None: + ... + @typing.overload + def __init__(self, arg0: Rational) -> None: + ... + @typing.overload + def __init__(self, arg0: list[Term]) -> None: + ... + def __iter__(self) -> typing.Iterator: + ... + def __len__(self) -> int: + ... + @typing.overload + def __mul__(self, arg0: Integer) -> Polynomial: + ... + @typing.overload + def __mul__(self, arg0: Rational) -> Polynomial: + ... + @typing.overload + def __mul__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> Polynomial: + ... + @typing.overload + def __mul__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> Polynomial: + ... + @typing.overload + def __mul__(self, arg0: Term) -> Polynomial: + ... + @typing.overload + def __mul__(self, arg0: Polynomial) -> Polynomial: + ... + @typing.overload + def __ne__(self, arg0: Polynomial) -> bool: + ... + @typing.overload + def __ne__(self, arg0: Rational) -> bool: + ... + @typing.overload + def __ne__(self, arg0: Integer) -> bool: + ... + def __neg__(self) -> Polynomial: + ... + def __pos__(self) -> Polynomial: + ... + def __pow__(self, arg0: int) -> Polynomial: + ... + def __radd__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> Polynomial: + ... + def __repr__(self) -> str: + ... + @typing.overload + def __rmul__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> Polynomial: + ... + @typing.overload + def __rmul__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> Polynomial: + ... + @typing.overload + def __rsub__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> Polynomial: + ... + @typing.overload + def __rsub__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> Polynomial: + ... + def __setstate__(self, arg0: tuple[str]) -> None: + ... + def __str__(self) -> str: + ... + @typing.overload + def __sub__(self, arg0: Integer) -> Polynomial: + ... + @typing.overload + def __sub__(self, arg0: Rational) -> Polynomial: + ... + @typing.overload + def __sub__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> Polynomial: + ... + @typing.overload + def __sub__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> Polynomial: + ... + @typing.overload + def __sub__(self, arg0: Term) -> Polynomial: + ... + @typing.overload + def __sub__(self, arg0: Polynomial) -> Polynomial: + ... + @typing.overload + def __truediv__(self, arg0: Polynomial) -> ...: + ... + @typing.overload + def __truediv__(self, arg0: Term) -> ...: + ... + @typing.overload + def __truediv__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> ...: + ... + @typing.overload + def __truediv__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: + ... + @typing.overload + def __truediv__(self, arg0: Rational) -> Polynomial: + ... + @typing.overload + def __truediv__(self, arg0: Integer) -> Polynomial: + ... + def constant_part(self) -> Rational: + ... + def degree(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> int: + ... + def derive(self, variable: stormpy.pycarl.pycarl_core.Variable) -> Polynomial: + """ + Compute the derivative + """ + def evaluate(self, arg0: dict[stormpy.pycarl.pycarl_core.Variable, Rational]) -> Rational: + ... + def gather_variables(self) -> set[stormpy.pycarl.pycarl_core.Variable]: + ... + def is_constant(self) -> bool: + ... + def substitute(self, arg0: dict[stormpy.pycarl.pycarl_core.Variable, Polynomial]) -> Polynomial: + ... + def to_smt2(self) -> str: + ... + @property + def nr_terms(self) -> int: + ... + @property + def total_degree(self) -> int: + ... +class Rational: + """ + Class wrapping cln-rational numbers + """ + @staticmethod + @typing.overload + def __add__(*args, **kwargs) -> ...: + ... + @staticmethod + @typing.overload + def __init__(*args, **kwargs) -> None: + ... + @staticmethod + @typing.overload + def __truediv__(*args, **kwargs) -> ...: + ... + def __abs__(self) -> Rational: + ... + @typing.overload + def __add__(self, arg0: Rational) -> Rational: + ... + @typing.overload + def __add__(self, arg0: int) -> Rational: + ... + @typing.overload + def __add__(self, arg0: ..., carl: ..., carl: ...) -> ...: + ... + @typing.overload + def __eq__(self, arg0: Rational) -> bool: + ... + @typing.overload + def __eq__(self, arg0: Integer) -> bool: + ... + @typing.overload + def __eq__(self, arg0: ..., carl: ..., carl: ...) -> bool: + ... + @typing.overload + def __eq__(self, arg0: int) -> bool: + ... + def __float__(self) -> float: + ... + @typing.overload + def __ge__(self, arg0: Rational) -> bool: + ... + @typing.overload + def __ge__(self, arg0: Integer) -> bool: + ... + @typing.overload + def __ge__(self, arg0: int) -> bool: + ... + def __getstate__(self) -> tuple[str, str]: + ... + @typing.overload + def __gt__(self, arg0: Rational) -> bool: + ... + @typing.overload + def __gt__(self, arg0: Integer) -> bool: + ... + @typing.overload + def __gt__(self, arg0: int) -> bool: + ... + def __hash__(self) -> int: + ... + @typing.overload + def __init__(self, arg0: float) -> None: + ... + @typing.overload + def __init__(self, arg0: int) -> None: + ... + @typing.overload + def __init__(self, arg0: Integer, arg1: Integer) -> None: + ... + @typing.overload + def __init__(self, arg0: str) -> None: + ... + @typing.overload + def __le__(self, arg0: Rational) -> bool: + ... + @typing.overload + def __le__(self, arg0: Integer) -> bool: + ... + @typing.overload + def __le__(self, arg0: int) -> bool: + ... + @typing.overload + def __lt__(self, arg0: Rational) -> bool: + ... + @typing.overload + def __lt__(self, arg0: Integer) -> bool: + ... + @typing.overload + def __lt__(self, arg0: int) -> bool: + ... + @typing.overload + def __mul__(self, arg0: Rational) -> Rational: + ... + @typing.overload + def __mul__(self, arg0: int) -> Rational: + ... + @typing.overload + def __mul__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: + ... + @typing.overload + def __ne__(self, arg0: Rational) -> bool: + ... + @typing.overload + def __ne__(self, arg0: Integer) -> bool: + ... + @typing.overload + def __ne__(self, arg0: ..., carl: ..., carl: ...) -> bool: + ... + @typing.overload + def __ne__(self, arg0: int) -> bool: + ... + def __neg__(self) -> Rational: + ... + def __pos__(self) -> Rational: + ... + def __pow__(self, arg0: int) -> Rational: + ... + @typing.overload + def __radd__(self, arg0: int) -> Rational: + ... + @typing.overload + def __radd__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: + ... + def __repr__(self) -> str: + ... + @typing.overload + def __rmul__(self, arg0: int) -> Rational: + ... + @typing.overload + def __rmul__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: + ... + @typing.overload + def __rsub__(self, arg0: int) -> Rational: + ... + @typing.overload + def __rsub__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: + ... + @typing.overload + def __rtruediv__(self, arg0: int) -> Rational: + ... + @typing.overload + def __rtruediv__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: + ... + def __setstate__(self, arg0: tuple[str, str]) -> None: + ... + def __str__(self) -> str: + ... + @typing.overload + def __sub__(self, arg0: Rational) -> Rational: + ... + @typing.overload + def __sub__(self, arg0: int) -> Rational: + ... + @typing.overload + def __sub__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: + ... + @typing.overload + def __truediv__(self, arg0: Rational) -> Rational: + ... + @typing.overload + def __truediv__(self, arg0: int) -> Rational: + ... + @typing.overload + def __truediv__(self, arg0: ..., carl: ..., carl: ...) -> ...: + ... + @typing.overload + def __truediv__(self, arg0: ...) -> ...: + ... + @typing.overload + def __truediv__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> ...: + ... + @typing.overload + def __truediv__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: + ... + def is_minus_one(self) -> bool: + ... + def is_one(self) -> bool: + ... + @property + def denominator(self) -> Integer: + ... + @property + def nominator(self) -> Integer: + ... + @property + def numerator(self) -> Integer: + ... +class RationalFunction: + """ + Represent a rational function, that is the fraction of two multivariate polynomials + """ + @typing.overload + def __add__(self, arg0: Polynomial) -> RationalFunction: + ... + @typing.overload + def __add__(self, arg0: Term) -> RationalFunction: + ... + @typing.overload + def __add__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> RationalFunction: + ... + @typing.overload + def __add__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> RationalFunction: + ... + @typing.overload + def __add__(self, arg0: Rational) -> RationalFunction: + ... + @typing.overload + def __add__(self, arg0: RationalFunction) -> RationalFunction: + ... + @typing.overload + def __eq__(self, arg0: RationalFunction) -> bool: + ... + @typing.overload + def __eq__(self, arg0: Polynomial) -> bool: + ... + def __getstate__(self) -> tuple[str]: + ... + def __hash__(self) -> int: + ... + @typing.overload + def __init__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> None: + ... + @typing.overload + def __init__(self, arg0: Polynomial) -> None: + ... + @typing.overload + def __init__(self, arg0: Polynomial, arg1: Polynomial) -> None: + ... + @typing.overload + def __mul__(self, arg0: Polynomial) -> RationalFunction: + ... + @typing.overload + def __mul__(self, arg0: Term) -> RationalFunction: + ... + @typing.overload + def __mul__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> RationalFunction: + ... + @typing.overload + def __mul__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> RationalFunction: + ... + @typing.overload + def __mul__(self, arg0: Rational) -> RationalFunction: + ... + @typing.overload + def __mul__(self, arg0: RationalFunction) -> RationalFunction: + ... + @typing.overload + def __ne__(self, arg0: RationalFunction) -> bool: + ... + @typing.overload + def __ne__(self, arg0: Polynomial) -> bool: + ... + def __neg__(self) -> RationalFunction: + ... + def __pos__(self) -> RationalFunction: + ... + def __pow__(self, arg0: int) -> RationalFunction: + ... + @typing.overload + def __radd__(self, arg0: Polynomial) -> RationalFunction: + ... + @typing.overload + def __radd__(self, arg0: Term) -> RationalFunction: + ... + @typing.overload + def __radd__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> RationalFunction: + ... + @typing.overload + def __radd__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> RationalFunction: + ... + @typing.overload + def __radd__(self, arg0: Rational) -> RationalFunction: + ... + def __rmul__(self, arg0: Polynomial) -> RationalFunction: + ... + def __setstate__(self, arg0: tuple[str]) -> None: + ... + def __str__(self) -> str: + ... + @typing.overload + def __sub__(self, arg0: Polynomial) -> RationalFunction: + ... + @typing.overload + def __sub__(self, arg0: Term) -> RationalFunction: + ... + @typing.overload + def __sub__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> RationalFunction: + ... + @typing.overload + def __sub__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> RationalFunction: + ... + @typing.overload + def __sub__(self, arg0: Rational) -> RationalFunction: + ... + @typing.overload + def __sub__(self, arg0: RationalFunction) -> RationalFunction: + ... + @typing.overload + def __truediv__(self, arg0: Rational) -> RationalFunction: + ... + @typing.overload + def __truediv__(self, arg0: Polynomial) -> RationalFunction: + ... + @typing.overload + def __truediv__(self, arg0: Term) -> RationalFunction: + ... + @typing.overload + def __truediv__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> RationalFunction: + ... + @typing.overload + def __truediv__(self, arg0: Rational) -> RationalFunction: + ... + @typing.overload + def __truediv__(self, arg0: RationalFunction) -> RationalFunction: + ... + def constant_part(self) -> Rational: + ... + def derive(self, variable: stormpy.pycarl.pycarl_core.Variable) -> RationalFunction: + """ + Compute the derivative + """ + def evaluate(self, arg0: dict[stormpy.pycarl.pycarl_core.Variable, Rational]) -> Rational: + ... + def gather_variables(self) -> set[stormpy.pycarl.pycarl_core.Variable]: + ... + def is_constant(self) -> bool: + ... + def to_smt2(self) -> str: + ... + @property + def denominator(self) -> Polynomial: + ... + @property + def nominator(self) -> Polynomial: + ... + @property + def numerator(self) -> Polynomial: + ... +class Term: + @staticmethod + @typing.overload + def __truediv__(*args, **kwargs) -> ...: + ... + @typing.overload + def __add__(self, arg0: ..., carl: ..., carl: ...) -> ...: + ... + @typing.overload + def __add__(self, arg0: Term) -> ...: + ... + @typing.overload + def __add__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> ...: + ... + @typing.overload + def __add__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: + ... + @typing.overload + def __add__(self, arg0: Rational) -> ...: + ... + def __eq__(self, arg0: Term) -> bool: + ... + def __getstate__(self) -> tuple[str]: + ... + def __hash__(self) -> int: + ... + @typing.overload + def __init__(self, arg0: Rational, arg1: stormpy.pycarl.pycarl_core.Monomial) -> None: + ... + @typing.overload + def __init__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> None: + ... + @typing.overload + def __init__(self, arg0: Rational) -> None: + ... + @typing.overload + def __mul__(self, arg0: ..., carl: ..., carl: ...) -> ...: + ... + @typing.overload + def __mul__(self, arg0: Term) -> Term: + ... + @typing.overload + def __mul__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> Term: + ... + @typing.overload + def __mul__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> Term: + ... + @typing.overload + def __mul__(self, arg0: Rational) -> Term: + ... + def __ne__(self, arg0: Term) -> bool: + ... + def __neg__(self) -> Term: + ... + def __pos__(self) -> Term: + ... + def __pow__(self, arg0: int) -> Term: + ... + def __setstate__(self, arg0: tuple[str]) -> None: + ... + def __str__(self) -> str: + ... + @typing.overload + def __sub__(self, arg0: ..., carl: ..., carl: ...) -> ...: + ... + @typing.overload + def __sub__(self, arg0: Term) -> ...: + ... + @typing.overload + def __sub__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> ...: + ... + @typing.overload + def __sub__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: + ... + @typing.overload + def __sub__(self, arg0: Rational) -> ...: + ... + @typing.overload + def __truediv__(self, arg0: ..., carl: ..., carl: ...) -> ...: + ... + @typing.overload + def __truediv__(self, arg0: Term) -> ...: + ... + @typing.overload + def __truediv__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> ...: + ... + @typing.overload + def __truediv__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: + ... + @typing.overload + def __truediv__(self, arg0: Rational) -> Term: + ... + def is_constant(self) -> bool: + ... + def is_one(self) -> bool: + ... + @property + def coeff(self) -> Rational: + ... + @property + def monomial(self) -> stormpy.pycarl.pycarl_core.Monomial: + ... + @property + def tdeg(self) -> int: + ... +def abs(arg0: Interval) -> Interval: + ... +def ceil(arg0: Interval) -> Interval: + ... +def create_factorized_polynomial(polynomial): + ... +def denominator(x): + ... +def div(arg0: Interval, arg1: Interval) -> Interval: + ... +def expand(x): + ... +def floor(arg0: Interval) -> Interval: + ... +def isInteger(arg0: Interval) -> bool: + ... +def numerator(x): + ... +def pow(arg0: Interval, arg1: int) -> Interval: + ... +def quotient(arg0: Interval, arg1: Interval) -> Interval: + ... +factorization_cache: _FactorizationCache # value = diff --git a/lib/stormpy/pycarl/cln/_config.pyi b/lib/stormpy/pycarl/cln/_config.pyi new file mode 100644 index 0000000000..ddf8714ac8 --- /dev/null +++ b/lib/stormpy/pycarl/cln/_config.pyi @@ -0,0 +1,3 @@ +from __future__ import annotations +__all__ = ['CARL_WITH_CLN'] +CARL_WITH_CLN: bool = True diff --git a/lib/stormpy/pycarl/gmp.pyi b/lib/stormpy/pycarl/gmp.pyi new file mode 100644 index 0000000000..2e9cdb9828 --- /dev/null +++ b/lib/stormpy/pycarl/gmp.pyi @@ -0,0 +1,1116 @@ +from __future__ import annotations +import stormpy.pycarl.cln +from stormpy.pycarl import gmp +import stormpy.pycarl.pycarl_core +import typing +__all__ = ['Factorization', 'FactorizedPolynomial', 'FactorizedRationalFunction', 'Integer', 'Interval', 'Polynomial', 'Rational', 'RationalFunction', 'Term', 'abs', 'ceil', 'create_factorized_polynomial', 'denominator', 'div', 'expand', 'factorization_cache', 'floor', 'gmp', 'isInteger', 'numerator', 'pow', 'quotient'] +class Factorization: + """ + Factorization + """ + __hash__: typing.ClassVar[None] = None + def __eq__(self, arg0: Factorization) -> bool: + ... + def __getstate__(self) -> tuple[str]: + ... + def __iter__(self) -> typing.Iterator: + ... + def __len__(self) -> int: + ... + def __setstate__(self, arg0: tuple[str]) -> None: + ... + def __str__(self) -> str: + ... +class FactorizedPolynomial: + """ + Represent a polynomial with its factorization + """ + coefficient: Rational + def __add__(self, arg0: FactorizedPolynomial) -> FactorizedPolynomial: + ... + @typing.overload + def __eq__(self, arg0: FactorizedPolynomial) -> bool: + ... + @typing.overload + def __eq__(self, arg0: Rational) -> bool: + ... + def __getstate__(self) -> tuple[str]: + ... + def __hash__(self) -> int: + ... + @typing.overload + def __init__(self, number: Rational) -> None: + """ + Constructor + """ + @typing.overload + def __init__(self, polynomial: Polynomial, cache: _FactorizationCache) -> None: + """ + Constructor + """ + def __mul__(self, arg0: FactorizedPolynomial) -> FactorizedPolynomial: + ... + @typing.overload + def __ne__(self, arg0: FactorizedPolynomial) -> bool: + ... + @typing.overload + def __ne__(self, arg0: Rational) -> bool: + ... + def __pow__(self, exponent: int) -> FactorizedPolynomial: + """ + Raise polynomial to the power + """ + def __setstate__(self, arg0: tuple[str]) -> None: + ... + def __str__(self) -> str: + ... + def __sub__(self, arg0: FactorizedPolynomial) -> FactorizedPolynomial: + ... + def cache(self) -> _FactorizationCache: + ... + def constant_part(self) -> Rational: + ... + def derive(self, variable: stormpy.pycarl.pycarl_core.Variable) -> FactorizedPolynomial: + """ + Compute the derivative + """ + def evaluate(self, arg0: dict[stormpy.pycarl.pycarl_core.Variable, Rational]) -> Rational: + ... + def factorization(self) -> Factorization: + """ + Get factorization + """ + def gather_variables(self) -> set[stormpy.pycarl.pycarl_core.Variable]: + ... + def is_constant(self) -> bool: + ... + def is_one(self) -> bool: + ... + def polynomial(self) -> Polynomial: + """ + Get underlying polynomial + """ + def to_smt2(self) -> str: + ... +class FactorizedRationalFunction: + """ + Represent a rational function, that is the fraction of two factorized polynomials + """ + @typing.overload + def __add__(self, arg0: FactorizedRationalFunction) -> FactorizedRationalFunction: + ... + @typing.overload + def __add__(self, arg0: Rational) -> FactorizedRationalFunction: + ... + def __eq__(self, arg0: FactorizedRationalFunction) -> bool: + ... + def __getstate__(self) -> tuple[str]: + ... + def __hash__(self) -> int: + ... + @typing.overload + def __init__(self, arg0: FactorizedPolynomial) -> None: + ... + @typing.overload + def __init__(self, arg0: FactorizedPolynomial, arg1: FactorizedPolynomial) -> None: + ... + def __mul__(self, arg0: FactorizedRationalFunction) -> FactorizedRationalFunction: + ... + def __ne__(self, arg0: FactorizedRationalFunction) -> bool: + ... + def __setstate__(self, arg0: tuple[str]) -> None: + ... + def __str__(self) -> str: + ... + def __sub__(self, arg0: FactorizedRationalFunction) -> FactorizedRationalFunction: + ... + def __truediv__(self, arg0: FactorizedRationalFunction) -> FactorizedRationalFunction: + ... + def constant_part(self) -> Rational: + ... + def derive(self, variable: stormpy.pycarl.pycarl_core.Variable) -> FactorizedRationalFunction: + """ + Compute the derivative + """ + def evaluate(self, arg0: dict[stormpy.pycarl.pycarl_core.Variable, Rational]) -> Rational: + ... + def gather_variables(self) -> set[stormpy.pycarl.pycarl_core.Variable]: + ... + def is_constant(self) -> bool: + ... + def rational_function(self) -> RationalFunction: + ... + def to_smt2(self) -> str: + ... + @property + def denominator(self) -> FactorizedPolynomial: + ... + @property + def numerator(self) -> FactorizedPolynomial: + ... +class Integer: + """ + Class wrapping gmp-integers + """ + def __abs__(self) -> Integer: + ... + @typing.overload + def __add__(self, arg0: Integer) -> Integer: + ... + @typing.overload + def __add__(self, arg0: int) -> Integer: + ... + @typing.overload + def __add__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: + ... + @typing.overload + def __add__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> ...: + ... + @typing.overload + def __eq__(self, arg0: Integer) -> bool: + ... + @typing.overload + def __eq__(self, arg0: int) -> bool: + ... + def __float__(self) -> float: + ... + @typing.overload + def __ge__(self, arg0: Integer) -> bool: + ... + @typing.overload + def __ge__(self, arg0: int) -> bool: + ... + def __getstate__(self) -> tuple[str]: + ... + @typing.overload + def __gt__(self, arg0: Integer) -> bool: + ... + @typing.overload + def __gt__(self, arg0: int) -> bool: + ... + def __hash__(self) -> int: + ... + @typing.overload + def __init__(self, arg0: int) -> None: + ... + @typing.overload + def __init__(self, arg0: str) -> None: + ... + @typing.overload + def __init__(self, arg0: stormpy.pycarl.cln.Integer) -> None: + ... + @typing.overload + def __le__(self, arg0: Integer) -> bool: + ... + @typing.overload + def __le__(self, arg0: int) -> bool: + ... + @typing.overload + def __lt__(self, arg0: Integer) -> bool: + ... + @typing.overload + def __lt__(self, arg0: int) -> bool: + ... + @typing.overload + def __mul__(self, arg0: Integer) -> Integer: + ... + @typing.overload + def __mul__(self, arg0: int) -> Integer: + ... + @typing.overload + def __mul__(self: int, arg0: Integer) -> Integer: + ... + @typing.overload + def __mul__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: + ... + @typing.overload + def __mul__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> ...: + ... + @typing.overload + def __ne__(self, arg0: Integer) -> bool: + ... + @typing.overload + def __ne__(self, arg0: int) -> bool: + ... + def __neg__(self) -> Integer: + ... + def __pos__(self) -> Integer: + ... + def __pow__(self, arg0: int) -> Integer: + ... + @typing.overload + def __radd__(self, arg0: int) -> Integer: + ... + @typing.overload + def __radd__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: + ... + @typing.overload + def __radd__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> ...: + ... + def __repr__(self) -> str: + ... + @typing.overload + def __rmul__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: + ... + @typing.overload + def __rmul__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> ...: + ... + @typing.overload + def __rsub__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> ...: + ... + @typing.overload + def __rsub__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: + ... + def __setstate__(self, arg0: tuple[str]) -> None: + ... + def __str__(self) -> str: + ... + @typing.overload + def __sub__(self, arg0: Integer) -> Integer: + ... + @typing.overload + def __sub__(self, arg0: int) -> Integer: + ... + @typing.overload + def __sub__(self: int, arg0: Integer) -> Integer: + ... + @typing.overload + def __sub__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> ...: + ... + @typing.overload + def __sub__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: + ... + def __truediv__(self, arg0: Integer) -> ...: + ... +class Interval: + __hash__: typing.ClassVar[None] = None + @staticmethod + def emptyInterval() -> Interval: + ... + @staticmethod + def unboundedInterval() -> Interval: + ... + @staticmethod + def zeroInterval() -> Interval: + ... + @typing.overload + def __add__(self, arg0: Interval) -> Interval: + ... + @typing.overload + def __add__(self, arg0: Rational) -> Interval: + ... + def __eq__(self, arg0: Interval) -> bool: + ... + @typing.overload + def __ge__(self, arg0: Rational) -> bool: + ... + @typing.overload + def __ge__(self, arg0: Interval) -> bool: + ... + @typing.overload + def __ge__(self, arg0: Rational) -> bool: + ... + def __getstate__(self) -> tuple[str]: + ... + @typing.overload + def __gt__(self, arg0: Rational) -> bool: + ... + @typing.overload + def __gt__(self, arg0: Interval) -> bool: + ... + @typing.overload + def __gt__(self, arg0: Rational) -> bool: + ... + @typing.overload + def __iadd__(self, arg0: Interval) -> Interval: + ... + @typing.overload + def __iadd__(self, arg0: Rational) -> Interval: + ... + @typing.overload + def __imul__(self, arg0: Interval) -> Interval: + ... + @typing.overload + def __imul__(self, arg0: Rational) -> Interval: + ... + @typing.overload + def __init__(self, arg0: Rational) -> None: + ... + @typing.overload + def __init__(self, arg0: Rational, arg1: Rational) -> None: + ... + @typing.overload + def __init__(self, arg0: Rational, arg1: stormpy.pycarl.pycarl_core.BoundType, arg2: Rational, arg3: stormpy.pycarl.pycarl_core.BoundType) -> None: + ... + @typing.overload + def __isub__(self, arg0: Interval) -> Interval: + ... + @typing.overload + def __isub__(self, arg0: Rational) -> Interval: + ... + def __itruediv__(self, arg0: Rational) -> Interval: + ... + @typing.overload + def __le__(self, arg0: Interval) -> bool: + ... + @typing.overload + def __le__(self, arg0: Rational) -> bool: + ... + @typing.overload + def __le__(self, arg0: Rational) -> bool: + ... + @typing.overload + def __lt__(self, arg0: Interval) -> bool: + ... + @typing.overload + def __lt__(self, arg0: Rational) -> bool: + ... + @typing.overload + def __lt__(self, arg0: Rational) -> bool: + ... + @typing.overload + def __mul__(self, arg0: Interval) -> Interval: + ... + @typing.overload + def __mul__(self, arg0: Rational) -> Interval: + ... + def __ne__(self, arg0: Interval) -> bool: + ... + def __neg__(self) -> Interval: + ... + def __pow__(self, arg0: int) -> Interval: + ... + def __radd__(self, arg0: Rational) -> Interval: + ... + def __repr__(self) -> str: + ... + def __rmul__(self, arg0: Rational) -> Interval: + ... + def __rsub__(self, arg0: Rational) -> Interval: + ... + def __setstate__(self, arg0: tuple[str]) -> None: + ... + def __str__(self) -> str: + ... + @typing.overload + def __sub__(self, arg0: Interval) -> Interval: + ... + @typing.overload + def __sub__(self, arg0: Rational) -> Interval: + ... + def __truediv__(self, arg0: Rational) -> Interval: + ... + def abs(self) -> Interval: + ... + def center(self) -> Rational: + ... + def complement(self, arg0: Interval, arg1: Interval) -> bool: + ... + @typing.overload + def contains(self, arg0: Rational) -> bool: + ... + @typing.overload + def contains(self, arg0: Interval) -> bool: + ... + def diameter(self) -> Rational: + ... + def difference(self, arg0: Interval, arg1: Interval, arg2: Interval) -> bool: + ... + def div(self, arg0: Interval) -> Interval: + ... + def integralPart(self) -> Interval: + ... + def intersect(self, arg0: Interval) -> Interval: + ... + def intersectsWith(self, arg0: Interval) -> bool: + ... + def inverse(self) -> Interval: + ... + def isClosedInterval(self) -> bool: + ... + def isEmpty(self) -> bool: + ... + def isHalfBounded(self) -> bool: + ... + def isInfinite(self) -> bool: + ... + def isNegative(self) -> bool: + ... + def isOne(self) -> bool: + ... + def isOpenInterval(self) -> bool: + ... + def isPointInterval(self) -> bool: + ... + def isPositive(self) -> bool: + ... + def isProperSubset(self, arg0: Interval) -> bool: + ... + def isSemiNegative(self) -> bool: + ... + def isSemiPositive(self) -> bool: + ... + def isSubset(self, arg0: Interval) -> bool: + ... + def isUnbounded(self) -> bool: + ... + def isZero(self) -> bool: + ... + def lower(self) -> Rational: + ... + def meets(self, arg0: Rational) -> bool: + ... + def sample(self, arg0: bool) -> Rational: + ... + def setLower(self, arg0: Rational) -> None: + ... + def setUpper(self, arg0: Rational) -> None: + ... + def symmetricDifference(self, arg0: Interval, arg1: Interval, arg2: Interval) -> bool: + ... + def unite(self, arg0: Interval, arg1: Interval, arg2: Interval) -> bool: + ... + def upper(self) -> Rational: + ... +class Polynomial: + """ + Represent a multivariate polynomial + """ + @staticmethod + @typing.overload + def __add__(*args, **kwargs) -> ...: + ... + @staticmethod + @typing.overload + def __truediv__(*args, **kwargs) -> ...: + ... + @typing.overload + def __add__(self, arg0: Integer) -> Polynomial: + ... + @typing.overload + def __add__(self, arg0: Rational) -> Polynomial: + ... + @typing.overload + def __add__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> Polynomial: + ... + @typing.overload + def __add__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> Polynomial: + ... + @typing.overload + def __add__(self, arg0: Term) -> Polynomial: + ... + @typing.overload + def __add__(self, arg0: Polynomial) -> Polynomial: + ... + @typing.overload + def __eq__(self, arg0: Polynomial) -> bool: + ... + @typing.overload + def __eq__(self, arg0: Rational) -> bool: + ... + @typing.overload + def __eq__(self, arg0: Integer) -> bool: + ... + def __getitem__(self, arg0: int) -> Term: + ... + def __getstate__(self) -> tuple[str]: + ... + def __hash__(self) -> int: + ... + @typing.overload + def __init__(self, arg0: Term) -> None: + ... + @typing.overload + def __init__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> None: + ... + @typing.overload + def __init__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> None: + ... + @typing.overload + def __init__(self, arg0: Rational) -> None: + ... + @typing.overload + def __init__(self, arg0: list[Term]) -> None: + ... + def __iter__(self) -> typing.Iterator: + ... + def __len__(self) -> int: + ... + @typing.overload + def __mul__(self, arg0: Integer) -> Polynomial: + ... + @typing.overload + def __mul__(self, arg0: Rational) -> Polynomial: + ... + @typing.overload + def __mul__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> Polynomial: + ... + @typing.overload + def __mul__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> Polynomial: + ... + @typing.overload + def __mul__(self, arg0: Term) -> Polynomial: + ... + @typing.overload + def __mul__(self, arg0: Polynomial) -> Polynomial: + ... + @typing.overload + def __ne__(self, arg0: Polynomial) -> bool: + ... + @typing.overload + def __ne__(self, arg0: Rational) -> bool: + ... + @typing.overload + def __ne__(self, arg0: Integer) -> bool: + ... + def __neg__(self) -> Polynomial: + ... + def __pos__(self) -> Polynomial: + ... + def __pow__(self, arg0: int) -> Polynomial: + ... + def __radd__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> Polynomial: + ... + def __repr__(self) -> str: + ... + @typing.overload + def __rmul__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> Polynomial: + ... + @typing.overload + def __rmul__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> Polynomial: + ... + @typing.overload + def __rsub__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> Polynomial: + ... + @typing.overload + def __rsub__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> Polynomial: + ... + def __setstate__(self, arg0: tuple[str]) -> None: + ... + def __str__(self) -> str: + ... + @typing.overload + def __sub__(self, arg0: Integer) -> Polynomial: + ... + @typing.overload + def __sub__(self, arg0: Rational) -> Polynomial: + ... + @typing.overload + def __sub__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> Polynomial: + ... + @typing.overload + def __sub__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> Polynomial: + ... + @typing.overload + def __sub__(self, arg0: Term) -> Polynomial: + ... + @typing.overload + def __sub__(self, arg0: Polynomial) -> Polynomial: + ... + @typing.overload + def __truediv__(self, arg0: Polynomial) -> ...: + ... + @typing.overload + def __truediv__(self, arg0: Term) -> ...: + ... + @typing.overload + def __truediv__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> ...: + ... + @typing.overload + def __truediv__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: + ... + @typing.overload + def __truediv__(self, arg0: Rational) -> Polynomial: + ... + @typing.overload + def __truediv__(self, arg0: Integer) -> Polynomial: + ... + def constant_part(self) -> Rational: + ... + def degree(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> int: + ... + def derive(self, variable: stormpy.pycarl.pycarl_core.Variable) -> Polynomial: + """ + Compute the derivative + """ + def evaluate(self, arg0: dict[stormpy.pycarl.pycarl_core.Variable, Rational]) -> Rational: + ... + def gather_variables(self) -> set[stormpy.pycarl.pycarl_core.Variable]: + ... + def is_constant(self) -> bool: + ... + def substitute(self, arg0: dict[stormpy.pycarl.pycarl_core.Variable, Polynomial]) -> Polynomial: + ... + def to_smt2(self) -> str: + ... + @property + def nr_terms(self) -> int: + ... + @property + def total_degree(self) -> int: + ... +class Rational: + """ + Class wrapping gmp-rational numbers + """ + @staticmethod + @typing.overload + def __eq__(*args, **kwargs) -> bool: + ... + @staticmethod + @typing.overload + def __ne__(*args, **kwargs) -> bool: + ... + @staticmethod + @typing.overload + def __truediv__(*args, **kwargs) -> ...: + ... + @staticmethod + @typing.overload + def __truediv__(*args, **kwargs) -> ...: + ... + @staticmethod + @typing.overload + def __truediv__(*args, **kwargs) -> ...: + ... + def __abs__(self) -> Rational: + ... + @typing.overload + def __add__(self, arg0: Rational) -> Rational: + ... + @typing.overload + def __add__(self, arg0: int) -> Rational: + ... + @typing.overload + def __eq__(self, arg0: Rational) -> bool: + ... + @typing.overload + def __eq__(self, arg0: Integer) -> bool: + ... + @typing.overload + def __eq__(self, arg0: int) -> bool: + ... + def __float__(self) -> float: + ... + @typing.overload + def __ge__(self, arg0: Rational) -> bool: + ... + @typing.overload + def __ge__(self, arg0: Integer) -> bool: + ... + @typing.overload + def __ge__(self, arg0: int) -> bool: + ... + def __getstate__(self) -> tuple[str, str]: + ... + @typing.overload + def __gt__(self, arg0: Rational) -> bool: + ... + @typing.overload + def __gt__(self, arg0: Integer) -> bool: + ... + @typing.overload + def __gt__(self, arg0: int) -> bool: + ... + def __hash__(self) -> int: + ... + @typing.overload + def __init__(self, arg0: float) -> None: + ... + @typing.overload + def __init__(self, arg0: int) -> None: + ... + @typing.overload + def __init__(self, arg0: Integer, arg1: Integer) -> None: + ... + @typing.overload + def __init__(self, arg0: str) -> None: + ... + @typing.overload + def __init__(self, arg0: stormpy.pycarl.cln.Rational) -> None: + ... + @typing.overload + def __le__(self, arg0: Rational) -> bool: + ... + @typing.overload + def __le__(self, arg0: Integer) -> bool: + ... + @typing.overload + def __le__(self, arg0: int) -> bool: + ... + @typing.overload + def __lt__(self, arg0: Rational) -> bool: + ... + @typing.overload + def __lt__(self, arg0: Integer) -> bool: + ... + @typing.overload + def __lt__(self, arg0: int) -> bool: + ... + @typing.overload + def __mul__(self, arg0: Rational) -> Rational: + ... + @typing.overload + def __mul__(self, arg0: int) -> Rational: + ... + @typing.overload + def __mul__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: + ... + @typing.overload + def __ne__(self, arg0: Rational) -> bool: + ... + @typing.overload + def __ne__(self, arg0: Integer) -> bool: + ... + @typing.overload + def __ne__(self, arg0: int) -> bool: + ... + def __neg__(self) -> Rational: + ... + def __pos__(self) -> Rational: + ... + def __pow__(self, arg0: int) -> Rational: + ... + @typing.overload + def __radd__(self, arg0: int) -> Rational: + ... + @typing.overload + def __radd__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: + ... + def __repr__(self) -> str: + ... + @typing.overload + def __rmul__(self, arg0: int) -> Rational: + ... + @typing.overload + def __rmul__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: + ... + @typing.overload + def __rsub__(self, arg0: int) -> Rational: + ... + @typing.overload + def __rsub__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: + ... + @typing.overload + def __rtruediv__(self, arg0: int) -> Rational: + ... + @typing.overload + def __rtruediv__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: + ... + def __setstate__(self, arg0: tuple[str, str]) -> None: + ... + def __str__(self) -> str: + ... + @typing.overload + def __sub__(self, arg0: Rational) -> Rational: + ... + @typing.overload + def __sub__(self, arg0: int) -> Rational: + ... + @typing.overload + def __sub__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: + ... + @typing.overload + def __truediv__(self, arg0: Rational) -> Rational: + ... + @typing.overload + def __truediv__(self, arg0: int) -> Rational: + ... + @typing.overload + def __truediv__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> ...: + ... + @typing.overload + def __truediv__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: + ... + @property + def denominator(self) -> Integer: + ... + @property + def nominator(self) -> Integer: + ... + @property + def numerator(self) -> Integer: + ... +class RationalFunction: + """ + Represent a rational function, that is the fraction of two multivariate polynomials + """ + @typing.overload + def __add__(self, arg0: Polynomial) -> RationalFunction: + ... + @typing.overload + def __add__(self, arg0: Term) -> RationalFunction: + ... + @typing.overload + def __add__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> RationalFunction: + ... + @typing.overload + def __add__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> RationalFunction: + ... + @typing.overload + def __add__(self, arg0: Rational) -> RationalFunction: + ... + @typing.overload + def __add__(self, arg0: RationalFunction) -> RationalFunction: + ... + @typing.overload + def __eq__(self, arg0: RationalFunction) -> bool: + ... + @typing.overload + def __eq__(self, arg0: Polynomial) -> bool: + ... + def __getstate__(self) -> tuple[str]: + ... + def __hash__(self) -> int: + ... + @typing.overload + def __init__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> None: + ... + @typing.overload + def __init__(self, arg0: Polynomial) -> None: + ... + @typing.overload + def __init__(self, arg0: Polynomial, arg1: Polynomial) -> None: + ... + @typing.overload + def __mul__(self, arg0: Polynomial) -> RationalFunction: + ... + @typing.overload + def __mul__(self, arg0: Term) -> RationalFunction: + ... + @typing.overload + def __mul__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> RationalFunction: + ... + @typing.overload + def __mul__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> RationalFunction: + ... + @typing.overload + def __mul__(self, arg0: Rational) -> RationalFunction: + ... + @typing.overload + def __mul__(self, arg0: RationalFunction) -> RationalFunction: + ... + @typing.overload + def __ne__(self, arg0: RationalFunction) -> bool: + ... + @typing.overload + def __ne__(self, arg0: Polynomial) -> bool: + ... + def __neg__(self) -> RationalFunction: + ... + def __pos__(self) -> RationalFunction: + ... + def __pow__(self, arg0: int) -> RationalFunction: + ... + @typing.overload + def __radd__(self, arg0: Polynomial) -> RationalFunction: + ... + @typing.overload + def __radd__(self, arg0: Term) -> RationalFunction: + ... + @typing.overload + def __radd__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> RationalFunction: + ... + @typing.overload + def __radd__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> RationalFunction: + ... + @typing.overload + def __radd__(self, arg0: Rational) -> RationalFunction: + ... + def __rmul__(self, arg0: Polynomial) -> RationalFunction: + ... + def __setstate__(self, arg0: tuple[str]) -> None: + ... + def __str__(self) -> str: + ... + @typing.overload + def __sub__(self, arg0: Polynomial) -> RationalFunction: + ... + @typing.overload + def __sub__(self, arg0: Term) -> RationalFunction: + ... + @typing.overload + def __sub__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> RationalFunction: + ... + @typing.overload + def __sub__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> RationalFunction: + ... + @typing.overload + def __sub__(self, arg0: Rational) -> RationalFunction: + ... + @typing.overload + def __sub__(self, arg0: RationalFunction) -> RationalFunction: + ... + @typing.overload + def __truediv__(self, arg0: Rational) -> RationalFunction: + ... + @typing.overload + def __truediv__(self, arg0: Polynomial) -> RationalFunction: + ... + @typing.overload + def __truediv__(self, arg0: Term) -> RationalFunction: + ... + @typing.overload + def __truediv__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> RationalFunction: + ... + @typing.overload + def __truediv__(self, arg0: Rational) -> RationalFunction: + ... + @typing.overload + def __truediv__(self, arg0: RationalFunction) -> RationalFunction: + ... + def constant_part(self) -> Rational: + ... + def derive(self, variable: stormpy.pycarl.pycarl_core.Variable) -> RationalFunction: + """ + Compute the derivative + """ + def evaluate(self, arg0: dict[stormpy.pycarl.pycarl_core.Variable, Rational]) -> Rational: + ... + def gather_variables(self) -> set[stormpy.pycarl.pycarl_core.Variable]: + ... + def is_constant(self) -> bool: + ... + def to_smt2(self) -> str: + ... + @property + def denominator(self) -> Polynomial: + ... + @property + def nominator(self) -> Polynomial: + ... + @property + def numerator(self) -> Polynomial: + ... +class Term: + @staticmethod + @typing.overload + def __add__(*args, **kwargs) -> ...: + ... + @staticmethod + @typing.overload + def __mul__(*args, **kwargs) -> ...: + ... + @staticmethod + @typing.overload + def __sub__(*args, **kwargs) -> ...: + ... + @staticmethod + @typing.overload + def __truediv__(*args, **kwargs) -> ...: + ... + @staticmethod + @typing.overload + def __truediv__(*args, **kwargs) -> ...: + ... + @typing.overload + def __add__(self, arg0: Term) -> ...: + ... + @typing.overload + def __add__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> ...: + ... + @typing.overload + def __add__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: + ... + @typing.overload + def __add__(self, arg0: Rational) -> ...: + ... + def __eq__(self, arg0: Term) -> bool: + ... + def __getstate__(self) -> tuple[str]: + ... + def __hash__(self) -> int: + ... + @typing.overload + def __init__(self, arg0: Rational, arg1: stormpy.pycarl.pycarl_core.Monomial) -> None: + ... + @typing.overload + def __init__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> None: + ... + @typing.overload + def __init__(self, arg0: Rational) -> None: + ... + @typing.overload + def __mul__(self, arg0: Term) -> Term: + ... + @typing.overload + def __mul__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> Term: + ... + @typing.overload + def __mul__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> Term: + ... + @typing.overload + def __mul__(self, arg0: Rational) -> Term: + ... + def __ne__(self, arg0: Term) -> bool: + ... + def __neg__(self) -> Term: + ... + def __pos__(self) -> Term: + ... + def __pow__(self, arg0: int) -> Term: + ... + def __setstate__(self, arg0: tuple[str]) -> None: + ... + def __str__(self) -> str: + ... + @typing.overload + def __sub__(self, arg0: Term) -> ...: + ... + @typing.overload + def __sub__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> ...: + ... + @typing.overload + def __sub__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: + ... + @typing.overload + def __sub__(self, arg0: Rational) -> ...: + ... + @typing.overload + def __truediv__(self, arg0: Term) -> ...: + ... + @typing.overload + def __truediv__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> ...: + ... + @typing.overload + def __truediv__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: + ... + @typing.overload + def __truediv__(self, arg0: Rational) -> Term: + ... + def is_constant(self) -> bool: + ... + def is_one(self) -> bool: + ... + @property + def coeff(self) -> Rational: + ... + @property + def monomial(self) -> stormpy.pycarl.pycarl_core.Monomial: + ... + @property + def tdeg(self) -> int: + ... +def abs(arg0: Interval) -> Interval: + ... +def ceil(arg0: Interval) -> Interval: + ... +def create_factorized_polynomial(polynomial): + ... +def denominator(x): + ... +def div(arg0: Interval, arg1: Interval) -> Interval: + ... +def expand(x): + ... +def floor(arg0: Interval) -> Interval: + ... +def isInteger(arg0: Interval) -> bool: + ... +def numerator(x): + ... +def pow(arg0: Interval, arg1: int) -> Interval: + ... +def quotient(arg0: Interval, arg1: Interval) -> Interval: + ... +factorization_cache: _FactorizationCache # value = diff --git a/lib/stormpy/pycarl/infinity.pyi b/lib/stormpy/pycarl/infinity.pyi new file mode 100644 index 0000000000..172ce2947c --- /dev/null +++ b/lib/stormpy/pycarl/infinity.pyi @@ -0,0 +1,46 @@ +from __future__ import annotations +import math as math +import sys as sys +__all__ = ['Infinity', 'math', 'sys'] +class Infinity: + """ + + Class representing infinity and minus infinity + + """ + def __add__(self, other): + ... + def __div__(self, other): + ... + def __eq__(self, other): + ... + def __ge__(self, other): + ... + def __gt__(self, other): + ... + def __hash__(self): + ... + def __init__(self, negated = False): + ... + def __le__(self, other): + ... + def __lt__(self, other): + ... + def __mul__(self, other): + ... + def __neg__(self): + ... + def __radd__(self, other): + ... + def __rdiv__(self, other): + ... + def __repr__(self): + ... + def __rmul__(self, other): + ... + def __rsub__(self, other): + ... + def __str__(self): + ... + def __sub__(self, other): + ... diff --git a/lib/stormpy/pycarl/pycarl_core.pyi b/lib/stormpy/pycarl/pycarl_core.pyi new file mode 100644 index 0000000000..9b22f6d4f2 --- /dev/null +++ b/lib/stormpy/pycarl/pycarl_core.pyi @@ -0,0 +1,391 @@ +""" +pycarl core untyped functions +""" +from __future__ import annotations +import typing +__all__ = ['BoundType', 'Interval', 'Monomial', 'NoPicklingSupport', 'Variable', 'VariableType', 'abs', 'ceil', 'clear_monomial_pool', 'clear_variable_pool', 'create_monomial', 'div', 'floor', 'isInteger', 'pow', 'quotient', 'variable_with_name'] +class BoundType: + """ + Members: + + STRICT + + WEAK + + INFTY + """ + INFTY: typing.ClassVar[BoundType] # value = + STRICT: typing.ClassVar[BoundType] # value = + WEAK: typing.ClassVar[BoundType] # value = + __members__: typing.ClassVar[dict[str, BoundType]] # value = {'STRICT': , 'WEAK': , 'INFTY': } + def __eq__(self, other: typing.Any) -> bool: + ... + def __getstate__(self) -> int: + ... + def __hash__(self) -> int: + ... + def __index__(self) -> int: + ... + def __init__(self, value: int) -> None: + ... + def __int__(self) -> int: + ... + def __ne__(self, other: typing.Any) -> bool: + ... + def __repr__(self) -> str: + ... + def __setstate__(self, state: int) -> None: + ... + def __str__(self) -> str: + ... + @property + def name(self) -> str: + ... + @property + def value(self) -> int: + ... +class Interval: + __hash__: typing.ClassVar[None] = None + @staticmethod + def emptyInterval() -> Interval: + ... + @staticmethod + def unboundedInterval() -> Interval: + ... + @staticmethod + def zeroInterval() -> Interval: + ... + @typing.overload + def __add__(self, arg0: Interval) -> Interval: + ... + @typing.overload + def __add__(self, arg0: float) -> Interval: + ... + def __eq__(self, arg0: Interval) -> bool: + ... + @typing.overload + def __ge__(self, arg0: float) -> bool: + ... + @typing.overload + def __ge__(self, arg0: Interval) -> bool: + ... + @typing.overload + def __ge__(self, arg0: float) -> bool: + ... + def __getstate__(self) -> tuple[str]: + ... + @typing.overload + def __gt__(self, arg0: float) -> bool: + ... + @typing.overload + def __gt__(self, arg0: Interval) -> bool: + ... + @typing.overload + def __gt__(self, arg0: float) -> bool: + ... + @typing.overload + def __iadd__(self, arg0: Interval) -> Interval: + ... + @typing.overload + def __iadd__(self, arg0: float) -> Interval: + ... + @typing.overload + def __imul__(self, arg0: Interval) -> Interval: + ... + @typing.overload + def __imul__(self, arg0: float) -> Interval: + ... + @typing.overload + def __init__(self, arg0: float) -> None: + ... + @typing.overload + def __init__(self, arg0: float, arg1: float) -> None: + ... + @typing.overload + def __init__(self, arg0: float, arg1: BoundType, arg2: float, arg3: BoundType) -> None: + ... + @typing.overload + def __isub__(self, arg0: Interval) -> Interval: + ... + @typing.overload + def __isub__(self, arg0: float) -> Interval: + ... + def __itruediv__(self, arg0: float) -> Interval: + ... + @typing.overload + def __le__(self, arg0: Interval) -> bool: + ... + @typing.overload + def __le__(self, arg0: float) -> bool: + ... + @typing.overload + def __le__(self, arg0: float) -> bool: + ... + @typing.overload + def __lt__(self, arg0: Interval) -> bool: + ... + @typing.overload + def __lt__(self, arg0: float) -> bool: + ... + @typing.overload + def __lt__(self, arg0: float) -> bool: + ... + @typing.overload + def __mul__(self, arg0: Interval) -> Interval: + ... + @typing.overload + def __mul__(self, arg0: float) -> Interval: + ... + def __ne__(self, arg0: Interval) -> bool: + ... + def __neg__(self) -> Interval: + ... + def __pow__(self, arg0: int) -> Interval: + ... + def __radd__(self, arg0: float) -> Interval: + ... + def __repr__(self) -> str: + ... + def __rmul__(self, arg0: float) -> Interval: + ... + def __rsub__(self, arg0: float) -> Interval: + ... + def __setstate__(self, arg0: tuple[str]) -> None: + ... + def __str__(self) -> str: + ... + @typing.overload + def __sub__(self, arg0: Interval) -> Interval: + ... + @typing.overload + def __sub__(self, arg0: float) -> Interval: + ... + def __truediv__(self, arg0: float) -> Interval: + ... + def abs(self) -> Interval: + ... + def center(self) -> float: + ... + def complement(self, arg0: Interval, arg1: Interval) -> bool: + ... + @typing.overload + def contains(self, arg0: float) -> bool: + ... + @typing.overload + def contains(self, arg0: Interval) -> bool: + ... + def diameter(self) -> float: + ... + def difference(self, arg0: Interval, arg1: Interval, arg2: Interval) -> bool: + ... + def div(self, arg0: Interval) -> Interval: + ... + def integralPart(self) -> Interval: + ... + def intersect(self, arg0: Interval) -> Interval: + ... + def intersectsWith(self, arg0: Interval) -> bool: + ... + def inverse(self) -> Interval: + ... + def isClosedInterval(self) -> bool: + ... + def isEmpty(self) -> bool: + ... + def isHalfBounded(self) -> bool: + ... + def isInfinite(self) -> bool: + ... + def isNegative(self) -> bool: + ... + def isOne(self) -> bool: + ... + def isOpenInterval(self) -> bool: + ... + def isPointInterval(self) -> bool: + ... + def isPositive(self) -> bool: + ... + def isProperSubset(self, arg0: Interval) -> bool: + ... + def isSemiNegative(self) -> bool: + ... + def isSemiPositive(self) -> bool: + ... + def isSubset(self, arg0: Interval) -> bool: + ... + def isUnbounded(self) -> bool: + ... + def isZero(self) -> bool: + ... + def lower(self) -> float: + ... + def meets(self, arg0: float) -> bool: + ... + def sample(self, arg0: bool) -> float: + ... + def setLower(self, arg0: float) -> None: + ... + def setUpper(self, arg0: float) -> None: + ... + def symmetricDifference(self, arg0: Interval, arg1: Interval, arg2: Interval) -> bool: + ... + def unite(self, arg0: Interval, arg1: Interval, arg2: Interval) -> bool: + ... + def upper(self) -> float: + ... +class Monomial: + def __getitem__(self, arg0: int) -> tuple[Variable, int]: + ... + def __getstate__(self) -> tuple[str]: + ... + def __hash__(self) -> int: + ... + def __iter__(self) -> typing.Iterator: + ... + def __len__(self) -> int: + ... + @typing.overload + def __mul__(self, arg0: Monomial) -> Monomial: + ... + @typing.overload + def __mul__(self, arg0: Variable) -> Monomial: + ... + @typing.overload + def __mul__(self: Variable, arg0: Monomial) -> Monomial: + ... + def __pos__(self) -> Monomial: + ... + def __pow__(self, arg0: int) -> Monomial: + ... + def __setstate__(self, arg0: tuple[str]) -> None: + ... + def __str__(self) -> str: + ... + @property + def exponents(self) -> list[tuple[Variable, int]]: + ... + @property + def tdeg(self) -> int: + ... +class NoPicklingSupport(Exception): + pass +class Variable: + def __eq__(self, arg0: Variable) -> bool: + ... + def __ge__(self, arg0: Variable) -> bool: + ... + def __getstate__(self) -> tuple[str, str]: + ... + def __gt__(self, arg0: Variable) -> bool: + ... + def __hash__(self) -> int: + ... + @typing.overload + def __init__(self, other: Variable) -> None: + ... + @typing.overload + def __init__(self, name: str, type: VariableType = ...) -> None: + ... + @typing.overload + def __init__(self, type: VariableType = ...) -> None: + ... + def __le__(self, arg0: Variable) -> bool: + ... + def __lt__(self, arg0: Variable) -> bool: + ... + def __mul__(self, arg0: Variable) -> ...: + ... + def __ne__(self, arg0: Variable) -> bool: + ... + def __repr__(self) -> str: + ... + def __setstate__(self, arg0: tuple[str, str]) -> None: + ... + def __str__(self) -> str: + ... + @property + def id(self) -> int: + ... + @property + def is_no_variable(self) -> bool: + ... + @property + def name(self) -> str: + ... + @property + def rank(self) -> int: + ... + @property + def type(self) -> VariableType: + ... +class VariableType: + """ + Members: + + BOOL + + INT + + REAL + """ + BOOL: typing.ClassVar[VariableType] # value = + INT: typing.ClassVar[VariableType] # value = + REAL: typing.ClassVar[VariableType] # value = + __members__: typing.ClassVar[dict[str, VariableType]] # value = {'BOOL': , 'INT': , 'REAL': } + def __eq__(self, other: typing.Any) -> bool: + ... + def __getstate__(self) -> int: + ... + def __hash__(self) -> int: + ... + def __index__(self) -> int: + ... + def __init__(self, value: int) -> None: + ... + def __int__(self) -> int: + ... + def __ne__(self, other: typing.Any) -> bool: + ... + def __repr__(self) -> str: + ... + def __setstate__(self, state: int) -> None: + ... + def __str__(self) -> str: + ... + @property + def name(self) -> str: + ... + @property + def value(self) -> int: + ... +def abs(arg0: Interval) -> Interval: + ... +def ceil(arg0: Interval) -> Interval: + ... +def clear_monomial_pool() -> None: + """ + Clear monomial pool and remove all monomials + """ +def clear_variable_pool() -> None: + """ + Clear variable pool and remove all variables + """ +def create_monomial(variable: Variable, exponent: int) -> Monomial: + """ + Create monomial + """ +def div(arg0: Interval, arg1: Interval) -> Interval: + ... +def floor(arg0: Interval) -> Interval: + ... +def isInteger(arg0: Interval) -> bool: + ... +def pow(arg0: Interval, arg1: int) -> Interval: + ... +def quotient(arg0: Interval, arg1: Interval) -> Interval: + ... +def variable_with_name(arg0: str) -> Variable: + """ + Get a variable from the pool with the given name. + """ diff --git a/lib/stormpy/utility/__init__.pyi b/lib/stormpy/utility/__init__.pyi new file mode 100644 index 0000000000..2867bf8456 --- /dev/null +++ b/lib/stormpy/utility/__init__.pyi @@ -0,0 +1,16 @@ +from __future__ import annotations +from stormpy.utility.utility import JsonContainerDouble +from stormpy.utility.utility import JsonContainerRational +from stormpy.utility.utility import MatrixFormat +from stormpy.utility.utility import ModelReference +from stormpy.utility.utility import Path +from stormpy.utility.utility import ShortestPathsGenerator +from stormpy.utility.utility import SmtCheckResult +from stormpy.utility.utility import SmtSolver +from stormpy.utility.utility import SmtSolverFactory +from stormpy.utility.utility import Z3SmtSolver +from stormpy.utility.utility import Z3SmtSolverFactory +from stormpy.utility.utility import milliseconds +from stormpy.utility.utility import sharpen +from . import utility +__all__ = ['JsonContainerDouble', 'JsonContainerRational', 'MatrixFormat', 'ModelReference', 'Path', 'ShortestPathsGenerator', 'SmtCheckResult', 'SmtSolver', 'SmtSolverFactory', 'Z3SmtSolver', 'Z3SmtSolverFactory', 'milliseconds', 'sharpen', 'utility'] diff --git a/lib/stormpy/utility/utility.pyi b/lib/stormpy/utility/utility.pyi new file mode 100644 index 0000000000..07a3fa7117 --- /dev/null +++ b/lib/stormpy/utility/utility.pyi @@ -0,0 +1,230 @@ +""" +Utilities for Storm +""" +from __future__ import annotations +import stormpy.pycarl.gmp +import typing +__all__ = ['JsonContainerDouble', 'JsonContainerRational', 'MatrixFormat', 'ModelReference', 'Path', 'ShortestPathsGenerator', 'SmtCheckResult', 'SmtSolver', 'SmtSolverFactory', 'Z3SmtSolver', 'Z3SmtSolverFactory', 'milliseconds', 'sharpen'] +class JsonContainerDouble: + """ + Storm-internal container for JSON structures + """ + @staticmethod + def __eq__(s, o): + ... + @staticmethod + def __hash__(s): + ... + @staticmethod + def __int__(s): + ... + def __getitem__(self, arg0: str) -> JsonContainerDouble: + ... + def __str__(self) -> str: + ... +class JsonContainerRational: + """ + Storm-internal container for JSON structures + """ + @staticmethod + def __eq__(s, o): + ... + @staticmethod + def __hash__(s): + ... + @staticmethod + def __int__(s): + ... + def __getitem__(self, arg0: str) -> JsonContainerRational: + ... + def __str__(self) -> str: + ... +class MatrixFormat: + """ + Members: + + Straight + + I_Minus_P + """ + I_Minus_P: typing.ClassVar[MatrixFormat] # value = + Straight: typing.ClassVar[MatrixFormat] # value = + __members__: typing.ClassVar[dict[str, MatrixFormat]] # value = {'Straight': , 'I_Minus_P': } + def __eq__(self, other: typing.Any) -> bool: + ... + def __getstate__(self) -> int: + ... + def __hash__(self) -> int: + ... + def __index__(self) -> int: + ... + def __init__(self, value: int) -> None: + ... + def __int__(self) -> int: + ... + def __ne__(self, other: typing.Any) -> bool: + ... + def __repr__(self) -> str: + ... + def __setstate__(self, state: int) -> None: + ... + def __str__(self) -> str: + ... + @property + def name(self) -> str: + ... + @property + def value(self) -> int: + ... +class ModelReference: + """ + Lightweight Wrapper around results + """ + def get_boolean_value(self, variable: ...) -> bool: + """ + get a value for a boolean variable + """ + def get_integer_value(self, variable: ...) -> int: + """ + get a value for an integer variable + """ + def get_rational_value(self, variable: ...) -> float: + """ + get a value (as double) for an rational variable + """ +class Path: + __hash__: typing.ClassVar[None] = None + distance: float + predecessorK: int + predecessorNode: int | None + def __eq__(self, arg0: Path) -> bool: + """ + Compares predecessor node and index, ignoring distance + """ + @typing.overload + def __init__(self, predecessorNode: int, predecessorK: int, distance: float) -> None: + ... + @typing.overload + def __init__(self, predecessorK: int, distance: float) -> None: + ... +class ShortestPathsGenerator: + @typing.overload + def __init__(self, model: ..., storm: ..., target_bitvector: ...) -> None: + ... + @typing.overload + def __init__(self, model: ..., storm: ..., target_state: int) -> None: + ... + @typing.overload + def __init__(self, model: ..., storm: ..., target_state_list: list[int]) -> None: + ... + @typing.overload + def __init__(self, model: ..., storm: ..., target_label: str) -> None: + ... + @typing.overload + def __init__(self, transition_matrix: ..., target_prob_vector: list[float], initial_states: ..., matrix_format: MatrixFormat) -> None: + ... + @typing.overload + def __init__(self, transition_matrix: ..., target_prob_map: dict[int, float], initial_states: ..., matrix_format: MatrixFormat) -> None: + ... + def get_distance(self, k: int) -> float: + ... + def get_path_as_list(self, k: int) -> list[int]: + ... + def get_states(self, k: int) -> ...: + ... +class SmtCheckResult: + """ + Result type + + Members: + + Sat + + Unsat + + Unknown + """ + Sat: typing.ClassVar[SmtCheckResult] # value = + Unknown: typing.ClassVar[SmtCheckResult] # value = + Unsat: typing.ClassVar[SmtCheckResult] # value = + __members__: typing.ClassVar[dict[str, SmtCheckResult]] # value = {'Sat': , 'Unsat': , 'Unknown': } + def __eq__(self, other: typing.Any) -> bool: + ... + def __getstate__(self) -> int: + ... + def __hash__(self) -> int: + ... + def __index__(self) -> int: + ... + def __init__(self, value: int) -> None: + ... + def __int__(self) -> int: + ... + def __ne__(self, other: typing.Any) -> bool: + ... + def __repr__(self) -> str: + ... + def __setstate__(self, state: int) -> None: + ... + def __str__(self) -> str: + ... + @property + def name(self) -> str: + ... + @property + def value(self) -> int: + ... +class SmtSolver: + """ + Generic Storm SmtSolver Wrapper + """ + def add(self, arg0: ...) -> None: + """ + addconstraint + """ + def check(self) -> SmtCheckResult: + """ + check + """ + def pop(self, levels: int) -> None: + """ + pop + """ + def push(self) -> None: + """ + push + """ + def reset(self) -> None: + """ + reset + """ + @property + def model(self) -> ModelReference: + """ + get the model + """ +class SmtSolverFactory: + """ + Factory for creating SMT Solvers + """ +class Z3SmtSolver(SmtSolver): + """ + z3 API for storm smtsolver wrapper + """ + def __init__(self, arg0: ...) -> None: + ... +class Z3SmtSolverFactory(SmtSolverFactory): + """ + Factory for creating z3 based SMT solvers + """ + def __init__(self) -> None: + ... +class milliseconds: + def __str__(self) -> str: + ... + def count(self) -> int: + ... +def sharpen(precision: int, value: float) -> stormpy.pycarl.gmp.Rational: + """ + Convert a float to the nearest rational within precision using Kwek Mehlhorn + """ diff --git a/setup.py b/setup.py index 1c36ecb67f..f4ee6e0c65 100755 --- a/setup.py +++ b/setup.py @@ -312,10 +312,6 @@ def finalize_options(self): 'packaging' ], tests_require=['pytest', 'nbval', 'numpy'], - install_requires=['pycarl>=2.3.0'], - setup_requires=['pycarl>=2.3.0', # required to check pybind version used for pycarl - 'packaging' - ], extras_require={ "numpy": ["numpy"], "plot": ["matplotlib","numpy","scipy"], diff --git a/src/mod_pomdp.cpp b/src/mod_pomdp.cpp index 044a341790..a7faf65424 100644 --- a/src/mod_pomdp.cpp +++ b/src/mod_pomdp.cpp @@ -8,6 +8,7 @@ #include "pomdp/tracker.h" #include "pomdp/transformations.h" #include +#include PYBIND11_MODULE(pomdp, m) { m.doc() = "Functionality for POMDP analysis"; @@ -26,6 +27,7 @@ PYBIND11_MODULE(pomdp, m) { define_transformations(m, "Exact"); define_belief_exploration(m, "Double"); define_verimon_generator(m, "Double"); + define_verimon_generator(m, "Exact"); define_transformations(m, "Rf"); } diff --git a/src/mod_utility.cpp b/src/mod_utility.cpp index d8f3d5aa92..0312638f7c 100644 --- a/src/mod_utility.cpp +++ b/src/mod_utility.cpp @@ -1,22 +1,24 @@ #include "common.h" -#include "utility/shortestPaths.h" -#include "utility/smtsolver.h" +#include "src/utility/kwekMehlhorn.h" +#include "storm/adapters/RationalNumberAdapter.h" #include "utility/chrono.h" #include "utility/json.h" -#include "storm/adapters/RationalNumberAdapter.h" +#include "utility/shortestPaths.h" +#include "utility/smtsolver.h" PYBIND11_MODULE(utility, m) { - m.doc() = "Utilities for Storm"; + m.doc() = "Utilities for Storm"; #ifdef STORMPY_DISABLE_SIGNATURE_DOC - py::options options; - options.disable_function_signatures(); + py::options options; + options.disable_function_signatures(); #endif - define_ksp(m); - define_smt(m); - define_chrono(m); - define_json(m, "Double"); - define_json(m, "Rational"); + define_ksp(m); + define_smt(m); + define_chrono(m); + define_json(m, "Double"); + define_json(m, "Rational"); + define_kwek_mehlhorn(m, ""); } diff --git a/src/utility/kwekMehlhorn.cpp b/src/utility/kwekMehlhorn.cpp new file mode 100644 index 0000000000..50bcb5438a --- /dev/null +++ b/src/utility/kwekMehlhorn.cpp @@ -0,0 +1,22 @@ +#include "kwekMehlhorn.h" +#include "src/common.h" +#include +#include +#include + +template +void define_kwek_mehlhorn(py::module &m, std::string const &vtSuffix) { + m.def( + "sharpen", + [](uint64_t precision, double value) { + return storm::utility::kwek_mehlhorn::sharpen(precision, value); + }, + "Convert a float to the nearest rational within precision using Kwek " + "Mehlhorn", + py::arg("precision"), py::arg("value")); +} + +template void +define_kwek_mehlhorn(py::module &m, + std::string const &vtSuffix); \ No newline at end of file diff --git a/src/utility/kwekMehlhorn.h b/src/utility/kwekMehlhorn.h new file mode 100644 index 0000000000..42292ca4f7 --- /dev/null +++ b/src/utility/kwekMehlhorn.h @@ -0,0 +1,6 @@ +#pragma once + +#include "src/common.h" + +template +void define_kwek_mehlhorn(py::module &m, std::string const &vtSuffix); \ No newline at end of file From 66fc74290b53f99f1b9ffb0bfa02ba40122024dd Mon Sep 17 00:00:00 2001 From: Luko van der Maas Date: Fri, 25 Apr 2025 11:11:39 +0200 Subject: [PATCH 10/35] add to pomdp api --- Dockerfile | 2 +- src/mod_pomdp.cpp | 108 ------------------------------- src/pomdp/transformations.cpp | 5 +- src/storage/model_components.cpp | 1 + 4 files changed, 5 insertions(+), 111 deletions(-) diff --git a/Dockerfile b/Dockerfile index c384a3327f..ea81564b46 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,7 +22,7 @@ ARG setup_args="" # Additional CMake arguments for carl ARG carl_cmake_args="" # Number of threads to use for parallel compilation -ARG no_threads=2 +ARG no_threads=24 # Carl-storm version ARG carl_version=master diff --git a/src/mod_pomdp.cpp b/src/mod_pomdp.cpp index 38dde83505..dd487600a5 100644 --- a/src/mod_pomdp.cpp +++ b/src/mod_pomdp.cpp @@ -9,12 +9,6 @@ #include #include -template std::string streamToString(const T &value) { - std::stringstream sstream; - sstream << value; - return sstream.str(); -} - PYBIND11_MODULE(pomdp, m) { m.doc() = "Functionality for POMDP analysis"; @@ -36,107 +30,5 @@ PYBIND11_MODULE(pomdp, m) { define_transformations_int(m, "Rf"); define_belief_exploration(m, "Double"); - // using Interval = storm::Interval; - - // py::class_(m, "Interval") - // .def(py::init()) - // .def(py::init()) - // .def(py::init()) - - // .def_static("unboundedInterval", &Interval::unboundedInterval) - // .def_static("emptyInterval", &Interval::emptyInterval) - // .def_static("zeroInterval", &Interval::zeroInterval) - - // // TODO: does not work :-( - // //.def_property("lower", &Interval::lower, &Interval::setLower) - // .def("lower", &Interval::lower, - // py::return_value_policy::reference_internal) - // .def("setLower", &Interval::setLower) - // .def("upper", &Interval::upper, - // py::return_value_policy::reference_internal) - // .def("setUpper", &Interval::setUpper) - - // .def("isInfinite", &Interval::isInfinite) - // .def("isUnbounded", &Interval::isUnbounded) - // .def("isHalfBounded", &Interval::isHalfBounded) - // .def("isEmpty", &Interval::isEmpty) - // .def("isPointInterval", &Interval::isPointInterval) - // .def("isOpenInterval", &Interval::isOpenInterval) - // .def("isClosedInterval", &Interval::isClosedInterval) - // .def("isZero", &Interval::isZero) - // .def("isOne", &Interval::isOne) - // .def("isPositive", &Interval::isPositive) - // .def("isNegative", &Interval::isNegative) - // .def("isSemiPositive", &Interval::isSemiPositive) - // .def("isSemiNegative", &Interval::isSemiNegative) - - // .def("integralPart", &Interval::integralPart) - // .def("diameter", &Interval::diameter) - // .def("center", [](const Interval &i) { return i.center(); }) - // .def("sample", &Interval::sample) - // .def("contains", - // [](const Interval &i, const double &r) { return i.contains(r); - // }) - // .def("contains", - // [](const Interval &i, const Interval &i2) { return - // i.contains(i2); }) - // .def("meets", &Interval::meets) - // .def("isSubset", &Interval::isSubset) - // .def("isProperSubset", &Interval::isProperSubset) - - // .def("div", &Interval::div) - - // .def("inverse", &Interval::inverse) - // .def("abs", &Interval::abs) - // .def("__pow__", - // [](const Interval &i, carl::uint exp) { return i.pow(exp); }) - // .def("intersectsWith", &Interval::intersectsWith) - // .def("intersect", &Interval::intersect) - // .def("unite", &Interval::unite) - // .def("difference", &Interval::difference) - // .def("complement", &Interval::complement) - // .def("symmetricDifference", &Interval::symmetricDifference) - - // .def(py::self + py::self) - // .def(double() + py::self) - // .def(py::self + double()) - // .def(py::self += py::self) - // .def(py::self += double()) - - // .def(-py::self) - - // .def(py::self - py::self) - // .def(double() - py::self) - // .def(py::self - double()) - // .def(py::self -= py::self) - // .def(py::self -= double()) - - // .def(py::self * py::self) - // .def(double() * py::self) - // .def(py::self * double()) - // .def(py::self *= py::self) - // .def(py::self *= double()) - - // .def(py::self / double()) - // .def(py::self /= double()) - - // .def(py::self == py::self) - // .def(py::self != py::self) - // .def(py::self <= py::self) - // .def(py::self <= double()) - // .def(double() <= py::self) - // .def(py::self >= py::self) - // .def(py::self >= double()) - // .def(double() >= py::self) - // .def(py::self < py::self) - // .def(py::self < double()) - // .def(double() < py::self) - // .def(py::self > py::self) - // .def(py::self > double()) - // .def(double() > py::self) - - // .def("__str__", &streamToString); - define_transformations_int(m, "Interval"); } diff --git a/src/pomdp/transformations.cpp b/src/pomdp/transformations.cpp index bd2dd54400..0c04e10ccc 100644 --- a/src/pomdp/transformations.cpp +++ b/src/pomdp/transformations.cpp @@ -1,4 +1,5 @@ #include "transformations.h" +#include #include #include #include @@ -101,12 +102,12 @@ void define_transformations_int(py::module &m, std::string const &vtSuffix) { m, ("ObservationTraceUnfolder" + vtSuffix).c_str(), "Unfolds observation traces in models"); unfolder.def( - py::init const &, + py::init, std::vector const &, std::shared_ptr &, storm::pomdp::ObservationTraceUnfolderOptions const &>(), py::arg("model"), py::arg("risk"), py::arg("expression_manager"), - py::arg("options")); + py::arg("options"), py::keep_alive<2, 1>()); unfolder.def("is_rejection_sampling_set", &storm::pomdp::ObservationTraceUnfolder< ValueType>::isRejectionSamplingSet); diff --git a/src/storage/model_components.cpp b/src/storage/model_components.cpp index 3ee723abf0..cb4ecca397 100644 --- a/src/storage/model_components.cpp +++ b/src/storage/model_components.cpp @@ -39,6 +39,7 @@ void define_sparse_model_components(py::module& m, std::string const& vtSuffix) // POMDP specific components .def_readwrite("observability_classes", &SparseModelComponents::observabilityClasses, "The POMDP observations") + .def_readwrite("observation_valuations", &SparseModelComponents::observationValuations, "The POMDP observation valuations") // Continuous time specific components (CTMCs, Markov Automata): .def_readwrite("rate_transitions", &SparseModelComponents::rateTransitions, "True iff the transition values (for Markovian choices) are interpreted as rates") From 864332123bd7d723b4fd1d07a0f1de98ec0bc893 Mon Sep 17 00:00:00 2001 From: Luko van der Maas Date: Tue, 20 May 2025 09:56:52 +0200 Subject: [PATCH 11/35] add uncertainty bindings --- src/core/transformation.cpp | 7 ++++++- src/mod_core.cpp | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/core/transformation.cpp b/src/core/transformation.cpp index 92338e2223..58d0863621 100644 --- a/src/core/transformation.cpp +++ b/src/core/transformation.cpp @@ -3,6 +3,7 @@ #include "storm/models/symbolic/StandardRewardModel.h" #include "storm/transformer/SubsystemBuilder.h" #include "storm/transformer/EndComponentEliminator.h" +#include "storm/transformer/AddUncertainty.h" // Thin wrappers. template @@ -80,8 +81,12 @@ void define_transformation_typed(py::module& m, std::string const& vtSuffix) { .def_readonly("deadlock_label", &storm::transformer::SubsystemBuilderReturnType::deadlockLabel, "If set, deadlock states have been introduced and have been assigned this label"); m.def(("_construct_subsystem_" + vtSuffix).c_str(), &constructSubsystem, "build a subsystem of a sparse model"); + + py::class_>(m, ("AddUncertainty" + vtSuffix).c_str(), "Transform model into interval model with specified uncertainty") + .def(py::init> const&>(), py::arg("model")) + .def("transform", &storm::transformer::AddUncertainty::transform, "transform the model", py::arg("additiveUncertainty"), py::arg("minimalTransitionProbability")); } template void define_transformation_typed(py::module& m, std::string const& vtSuffix); template void define_transformation_typed(py::module& m, std::string const& vtSuffix); -template void define_transformation_typed(py::module& m, std::string const& vtSuffix); +// template void define_transformation_typed(py::module& m, std::string const& vtSuffix); diff --git a/src/mod_core.cpp b/src/mod_core.cpp index f2d060aeb5..9e220b77e9 100644 --- a/src/mod_core.cpp +++ b/src/mod_core.cpp @@ -36,7 +36,7 @@ PYBIND11_MODULE(core, m) { define_transformation(m); define_transformation_typed(m, "Double"); define_transformation_typed(m, "Exact"); - define_transformation_typed(m, "RatFunc"); + // define_transformation_typed(m, "RatFunc"); define_sparse_model_simulator(m, "Double"); define_sparse_model_simulator(m, "Exact"); define_prism_program_simulator(m, "Double"); From 85e02952bf9778e59de5b66624ff9ef77c579299 Mon Sep 17 00:00:00 2001 From: Luko van der Maas Date: Wed, 21 May 2025 14:32:46 +0200 Subject: [PATCH 12/35] stormpy for rational interval --- lib/stormpy/__init__.py | 22 ++++++++++++++++++++++ lib/stormpy/storage/__init__.py | 2 ++ src/core/bisimulation.cpp | 4 ++-- src/core/core.cpp | 2 ++ src/core/modelchecking.cpp | 5 +++++ src/mod_pomdp.cpp | 1 + src/mod_storage.cpp | 7 +++++++ src/pomdp/transformations.cpp | 8 ++++---- src/storage/decomposition.cpp | 1 + src/storage/distribution.cpp | 1 + src/storage/matrix.cpp | 1 + src/storage/model.cpp | 13 ++++++++++--- src/storage/model_components.cpp | 1 + src/storage/scheduler.cpp | 4 +++- src/storage/state.cpp | 1 + 15 files changed, 63 insertions(+), 10 deletions(-) diff --git a/lib/stormpy/__init__.py b/lib/stormpy/__init__.py index e2f4788154..f15f83c5da 100644 --- a/lib/stormpy/__init__.py +++ b/lib/stormpy/__init__.py @@ -236,6 +236,26 @@ def build_interval_model_from_drn(file, options=DirectEncodingParserOptions()): raise StormError("Not supported interval model constructed") +def build_exact_interval_model_from_drn(file, options=DirectEncodingParserOptions()): + """ + Build an exact interval model in sparse representation from the explicit DRN representation. + + :param String file: DRN file containing the model. + :param DirectEncodingParserOptions: Options for the parser. + :return: Exact Interval model in sparse representation. + """ + intermediate = core._build_sparse_exact_interval_model_from_drn(file, options) + assert intermediate.supports_uncertainty and intermediate.is_exact + if intermediate.model_type == ModelType.DTMC: + return intermediate._as_sparse_exact_idtmc() + elif intermediate.model_type == ModelType.MDP: + return intermediate._as_sparse_exact_imdp() + elif intermediate.model_type == ModelType.POMDP: + return intermediate._as_sparse_exact_ipomdp() + else: + raise StormError("Not supported exact interval model constructed") + + def perform_bisimulation(model, properties, bisimulation_type): """ Perform bisimulation on model. @@ -644,6 +664,8 @@ def export_to_drn(model, file, options=DirectEncodingOptions()): """ if model.supports_parameters: return core._export_parametric_to_drn(model, file, options) + if model.supports_uncertainty and model.is_exact: + return core._export_exact_to_drn_interval(model, file, options) if model.supports_uncertainty: return core._export_to_drn_interval(model, file, options) if model.is_exact: diff --git a/lib/stormpy/storage/__init__.py b/lib/stormpy/storage/__init__.py index ee6f60fdc0..b98fb04220 100644 --- a/lib/stormpy/storage/__init__.py +++ b/lib/stormpy/storage/__init__.py @@ -68,6 +68,8 @@ def get_maximal_end_components(model): """ if model.supports_parameters: return stormpy.MaximalEndComponentDecomposition_ratfunc(model) + elif model.supports_uncertainty and model.is_exact: + return stormpy.MaximalEndComponentDecomposition_ratinterval(model) elif model.is_exact: return stormpy.MaximalEndComponentDecomposition_exact(model) elif model.supports_uncertainty: diff --git a/src/core/bisimulation.cpp b/src/core/bisimulation.cpp index 372162b812..598232d8c1 100644 --- a/src/core/bisimulation.cpp +++ b/src/core/bisimulation.cpp @@ -11,8 +11,8 @@ std::shared_ptr> performBisimulationMinimization void define_bisimulation(py::module& m) { // Bisimulation - m.def("_perform_bisimulation", &storm::api::performBisimulationMinimization, "Perform bisimulation", py::arg("model"), py::arg("formulas"), py::arg("bisimulation_type")); - m.def("_perform_parametric_bisimulation", &storm::api::performBisimulationMinimization, "Perform bisimulation on parametric model", py::arg("model"), py::arg("formulas"), py::arg("bisimulation_type")); + m.def("_perform_bisimulation", &storm::api::performBisimulationMinimization, "Perform bisimulation", py::arg("model"), py::arg("formulas"), py::arg("bisimulation_type"), py::arg("graph_preserving") = true); + m.def("_perform_parametric_bisimulation", &storm::api::performBisimulationMinimization, "Perform bisimulation on parametric model", py::arg("model"), py::arg("formulas"), py::arg("bisimulation_type"), py::arg("graph_preserving") = true); m.def("_perform_symbolic_bisimulation", &performBisimulationMinimization, "Perform bisimulation", py::arg("model"), py::arg("formulas"), py::arg("bisimulation_type"), py::arg("quotient_format")); m.def("_perform_symbolic_parametric_bisimulation", &performBisimulationMinimization, "Perform bisimulation on parametric model", py::arg("model"), py::arg("formulas"), py::arg("bisimulation_type"), py::arg("quotient_format")); diff --git a/src/core/core.cpp b/src/core/core.cpp index b207c1d314..9e73e9da74 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -130,6 +130,7 @@ void define_build(py::module& m) { m.def("_build_sparse_exact_model_from_drn", &storm::api::buildExplicitDRNModel, "Build the model from DRN", py::arg("file"), py::arg("options") = storm::parser::DirectEncodingParserOptions()); m.def("_build_sparse_parametric_model_from_drn", &storm::api::buildExplicitDRNModel, "Build the parametric model from DRN", py::arg("file"), py::arg("options") = storm::parser::DirectEncodingParserOptions()); m.def("_build_sparse_interval_model_from_drn", &storm::api::buildExplicitDRNModel, "Build the interval model from DRN", py::arg("file"), py::arg("options") = storm::parser::DirectEncodingParserOptions()); + m.def("_build_sparse_exact_interval_model_from_drn", &storm::api::buildExplicitDRNModel, "Build the exact interval model from DRN", py::arg("file"), py::arg("options") = storm::parser::DirectEncodingParserOptions()); m.def("build_sparse_model_from_explicit", &storm::api::buildExplicitModel, "Build the model model from explicit input", py::arg("transition_file"), py::arg("labeling_file"), py::arg("state_reward_file") = "", py::arg("transition_reward_file") = "", py::arg("choice_labeling_file") = ""); m.def("make_sparse_model_builder", &storm::api::makeExplicitModelBuilder, "Construct a builder instance", py::arg("model_description"), py::arg("options"), py::arg("action_mask") = nullptr); @@ -195,6 +196,7 @@ void define_export(py::module& m) { // Export m.def("_export_to_drn", &exportDRN, "Export model in DRN format", py::arg("model"), py::arg("file"), py::arg("options")=storm::io::DirectEncodingOptions()); m.def("_export_to_drn_interval", &exportDRN, "Export model in DRN format", py::arg("model"), py::arg("file"), py::arg("options")=storm::io::DirectEncodingOptions()); + m.def("_export_exact_to_drn_interval", &exportDRN, "Export model in DRN format", py::arg("model"), py::arg("file"), py::arg("options")=storm::io::DirectEncodingOptions()); m.def("_export_exact_to_drn", &exportDRN, "Export model in DRN format", py::arg("model"), py::arg("file"), py::arg("options")=storm::io::DirectEncodingOptions()); m.def("_export_parametric_to_drn", &exportDRN, "Export parametric model in DRN format", py::arg("model"), py::arg("file"), py::arg("options")=storm::io::DirectEncodingOptions()); } diff --git a/src/core/modelchecking.cpp b/src/core/modelchecking.cpp index 4505f22039..67df1b481d 100644 --- a/src/core/modelchecking.cpp +++ b/src/core/modelchecking.cpp @@ -54,6 +54,11 @@ std::shared_ptr checkIntervalMdp(std::shared_p return checker.check(env, task); } +std::shared_ptr checkRationalIntervalMdp(std::shared_ptr> mdp, CheckTask const& task, storm::Environment& env) { + auto checker = storm::modelchecker::SparseMdpPrctlModelChecker>(*mdp); + return checker.check(env, task); +} + std::vector computeAllUntilProbabilities(storm::Environment const& env, CheckTask const& task, std::shared_ptr> ctmc, storm::storage::BitVector const& phiStates, storm::storage::BitVector const& psiStates) { storm::solver::SolveGoal goal(*ctmc, task); return storm::modelchecker::helper::SparseCtmcCslHelper::computeAllUntilProbabilities(env, std::move(goal), ctmc->getTransitionMatrix(), ctmc->getExitRateVector(), ctmc->getInitialStates(), phiStates, psiStates); diff --git a/src/mod_pomdp.cpp b/src/mod_pomdp.cpp index dd487600a5..7a1e43e74f 100644 --- a/src/mod_pomdp.cpp +++ b/src/mod_pomdp.cpp @@ -31,4 +31,5 @@ PYBIND11_MODULE(pomdp, m) { define_belief_exploration(m, "Double"); define_transformations_int(m, "Interval"); + define_transformations_int(m, "RationalInterval"); } diff --git a/src/mod_storage.cpp b/src/mod_storage.cpp index 380167ffc8..4c3205c395 100644 --- a/src/mod_storage.cpp +++ b/src/mod_storage.cpp @@ -35,18 +35,21 @@ PYBIND11_MODULE(storage, m) { define_sparse_model(m, ""); define_sparse_model(m, "Exact"); define_sparse_model(m, "Interval"); + define_sparse_model(m, "RationalInterval"); define_sparse_parametric_model(m); define_statevaluation(m); define_simplevaluation(m); define_sparse_matrix(m, ""); define_sparse_matrix(m, "Exact"); define_sparse_matrix(m, "Interval"); + define_sparse_matrix(m, "RationalInterval"); define_sparse_matrix(m, "Parametric"); define_sparse_matrix_nt(m); define_symbolic_model(m, "Sylvan"); define_state(m, ""); define_state(m, "Exact"); define_state(m, "Interval"); + define_state(m, "RationalInterval"); define_state(m, "Parametric"); define_prism(m); define_jani(m); @@ -57,13 +60,16 @@ PYBIND11_MODULE(storage, m) { define_scheduler(m, ""); define_scheduler(m, "Exact"); define_scheduler(m, "Interval"); + define_scheduler(m, "RationalInterval"); define_scheduler(m, "Parametric"); define_distribution(m, ""); define_distribution(m, "Exact"); define_distribution(m, "Interval"); + define_distribution(m, "RationalInterval"); define_sparse_model_components(m, ""); define_sparse_model_components(m, "Exact"); define_sparse_model_components(m, "Interval"); + define_sparse_model_components(m, "RationalInterval"); define_sparse_model_components(m, "Parametric"); define_geometry(m, "Double"); define_geometry(m, "Exact"); @@ -72,6 +78,7 @@ PYBIND11_MODULE(storage, m) { define_maximal_end_component_decomposition(m, "_double"); define_maximal_end_component_decomposition(m, "_exact"); define_maximal_end_component_decomposition(m, "_interval"); + define_maximal_end_component_decomposition(m, "_ratinterval"); define_maximal_end_component_decomposition(m, "_ratfunc"); } diff --git a/src/pomdp/transformations.cpp b/src/pomdp/transformations.cpp index 0c04e10ccc..0aa8e5033a 100644 --- a/src/pomdp/transformations.cpp +++ b/src/pomdp/transformations.cpp @@ -133,11 +133,11 @@ define_transformations(py::module &m, template void define_transformations_int(py::module &m, std::string const &vtSuffix); -template void -define_transformations_int(py::module &m, +template void define_transformations_int(py::module &m, std::string const &vtSuffix); template void define_transformations_int( py::module &m, std::string const &vtSuffix); -template void -define_transformations_int(py::module &m, +template void define_transformations_int(py::module &m, + std::string const &vtSuffix); +template void define_transformations_int(py::module &m, std::string const &vtSuffix); \ No newline at end of file diff --git a/src/storage/decomposition.cpp b/src/storage/decomposition.cpp index 7c4e2a4f1f..54e0a0951b 100644 --- a/src/storage/decomposition.cpp +++ b/src/storage/decomposition.cpp @@ -37,4 +37,5 @@ void define_maximal_end_component_decomposition(py::module& m, std::string const template void define_maximal_end_component_decomposition(py::module& m, std::string const& vt_suffix); template void define_maximal_end_component_decomposition(py::module& m, std::string const& vt_suffix); template void define_maximal_end_component_decomposition(py::module& m, std::string const& vt_suffix); +template void define_maximal_end_component_decomposition(py::module& m, std::string const& vt_suffix); template void define_maximal_end_component_decomposition(py::module& m, std::string const& vt_suffix); diff --git a/src/storage/distribution.cpp b/src/storage/distribution.cpp index 590322a794..3b8bf1a43b 100644 --- a/src/storage/distribution.cpp +++ b/src/storage/distribution.cpp @@ -18,3 +18,4 @@ void define_distribution(py::module& m, std::string vt_suffix) { template void define_distribution(py::module&, std::string vt_suffix); template void define_distribution(py::module&, std::string vt_suffix); template void define_distribution(py::module&, std::string vt_suffix); +template void define_distribution(py::module&, std::string vt_suffix); diff --git a/src/storage/matrix.cpp b/src/storage/matrix.cpp index 7f4651c451..895099f26a 100644 --- a/src/storage/matrix.cpp +++ b/src/storage/matrix.cpp @@ -132,5 +132,6 @@ void define_sparse_matrix(py::module& m, std::string const& vtSuffix) { template void define_sparse_matrix(py::module& m, std::string const& vtSuffix); template void define_sparse_matrix(py::module& m, std::string const& vtSuffix); template void define_sparse_matrix(py::module& m, std::string const& vtSuffix); +template void define_sparse_matrix(py::module& m, std::string const& vtSuffix); template void define_sparse_matrix(py::module& m, std::string const& vtSuffix); diff --git a/src/storage/model.cpp b/src/storage/model.cpp index 0af24a1681..e4ec2aaa8d 100644 --- a/src/storage/model.cpp +++ b/src/storage/model.cpp @@ -145,6 +145,9 @@ void define_model(py::module& m) { .def("_as_sparse_idtmc", [](ModelBase &modelbase) { return modelbase.as>(); }, "Get model as sparse interval DTMC") + .def("_as_sparse_exact_idtmc", [](ModelBase &modelbase) { + return modelbase.as>(); + }, "Get model as sparse exact interval DTMC") .def("_as_sparse_mdp", [](ModelBase &modelbase) { return modelbase.as>(); }, "Get model as sparse MDP") @@ -157,18 +160,21 @@ void define_model(py::module& m) { .def("_as_sparse_imdp", [](ModelBase &modelbase) { return modelbase.as>(); }, "Get model as sparse interval MDP") + .def("_as_sparse_exact_imdp", [](ModelBase &modelbase) { + return modelbase.as>(); + }, "Get model as sparse exact interval MDP") .def("_as_sparse_pomdp", [](ModelBase &modelbase) { return modelbase.as>(); }, "Get model as sparse POMDP") .def("_as_sparse_ipomdp", [](ModelBase &modelbase) { return modelbase.as>(); }, "Get model as sparse interval POMDP") + .def("_as_sparse_exact_ipomdp", [](ModelBase &modelbase) { + return modelbase.as>(); + }, "Get model as sparse interval exact POMDP") .def("_as_sparse_ppomdp", [](ModelBase &modelbase) { return modelbase.as>(); }, "Get model as sparse pPOMDP") - .def("_as_sparse_ipomdp", [](ModelBase &modelbase) { - return modelbase.as>(); - }, "Get model as sparse interval POMDP") .def("_as_sparse_ctmc", [](ModelBase &modelbase) { return modelbase.as>(); }, "Get model as sparse CTMC") @@ -482,3 +488,4 @@ template void define_symbolic_model(py::module& m, st template void define_sparse_model(py::module& m, std::string const& vt_suffix); template void define_sparse_model(py::module& m, std::string const& vt_suffix); template void define_sparse_model(py::module& m, std::string const& vt_suffix); +template void define_sparse_model(py::module& m, std::string const& vt_suffix); diff --git a/src/storage/model_components.cpp b/src/storage/model_components.cpp index cb4ecca397..06ca29ba27 100644 --- a/src/storage/model_components.cpp +++ b/src/storage/model_components.cpp @@ -59,4 +59,5 @@ void define_sparse_model_components(py::module& m, std::string const& vtSuffix) template void define_sparse_model_components(py::module& m, std::string const& vtSuffix); template void define_sparse_model_components(py::module& m, std::string const& vtSuffix); template void define_sparse_model_components(py::module& m, std::string const& vtSuffix); +template void define_sparse_model_components(py::module& m, std::string const& vtSuffix); template void define_sparse_model_components(py::module& m, std::string const& vtSuffix); diff --git a/src/storage/scheduler.cpp b/src/storage/scheduler.cpp index b5cb1ad98e..7a7c143cc8 100644 --- a/src/storage/scheduler.cpp +++ b/src/storage/scheduler.cpp @@ -32,7 +32,7 @@ void define_scheduler(py::module& m, std::string vt_suffix) { }, py::arg("model"), py::arg("skip_unique_choices") = false, py::arg("skip_dont_care_states") = false) ; - if constexpr (!std::is_same_v) { + if constexpr (!std::is_same_v && !std::is_same_v) { // Conversion from Interval not implemented scheduler .def("cast_to_double_datatype", &Scheduler::template toValueType, "Construct the scheduler with `double` value type") @@ -42,6 +42,7 @@ void define_scheduler(py::module& m, std::string vt_suffix) { if constexpr (!std::is_same_v) { // Conversion from RationalFunction to Interval not implemented scheduler.def("cast_to_interval_datatype", &Scheduler::template toValueType, "Construct the scheduler with `interval` value type"); + scheduler.def("cast_to_exact_interval_datatype", &Scheduler::template toValueType, "Construct the scheduler with `interval` value type"); } } @@ -61,4 +62,5 @@ void define_scheduler(py::module& m, std::string vt_suffix) { template void define_scheduler(py::module& m, std::string vt_suffix); template void define_scheduler(py::module& m, std::string vt_suffix); template void define_scheduler(py::module& m, std::string vt_suffix); +template void define_scheduler(py::module& m, std::string vt_suffix); template void define_scheduler(py::module& m, std::string vt_suffix); diff --git a/src/storage/state.cpp b/src/storage/state.cpp index 0fc402d8de..18ea557b68 100644 --- a/src/storage/state.cpp +++ b/src/storage/state.cpp @@ -38,5 +38,6 @@ void define_state(py::module& m, std::string const& vtSuffix) { template void define_state(py::module& m, std::string const& vtSuffix); template void define_state(py::module& m, std::string const& vtSuffix); template void define_state(py::module& m, std::string const& vtSuffix); +template void define_state(py::module& m, std::string const& vtSuffix); template void define_state(py::module& m, std::string const& vtSuffix); From cb24c407a7928a70629d9c1ae12403a75e271343 Mon Sep 17 00:00:00 2001 From: Luko van der Maas Date: Fri, 6 Jun 2025 16:11:36 +0200 Subject: [PATCH 13/35] add exact mdp modelchecking --- src/core/modelchecking.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/modelchecking.cpp b/src/core/modelchecking.cpp index 67df1b481d..88317ac80f 100644 --- a/src/core/modelchecking.cpp +++ b/src/core/modelchecking.cpp @@ -133,7 +133,6 @@ void define_modelchecking(py::module& m) { .def("set_maybe_states", py::overload_cast(&storm::modelchecker::ExplicitModelCheckerHint::setMaybeStates), "sets the maybe states. This is assumed to be correct.") .def("set_compute_only_maybe_states", &storm::modelchecker::ExplicitModelCheckerHint::setComputeOnlyMaybeStates, "value") .def("set_result_hint", py::overload_cast> const&>(&storm::modelchecker::ExplicitModelCheckerHint::setResultHint), "result_hint"_a); - m.def("_get_reachable_states_double", &getReachableStates, py::arg("model"), py::arg("initial_states"), py::arg("constraint_states"), py::arg("target_states"), py::arg("maximal_steps") = boost::none, py::arg("choice_filter") = boost::none); m.def("_get_reachable_states_exact", &getReachableStates, py::arg("model"), py::arg("initial_states"), py::arg("constraint_states"), py::arg("target_states"), py::arg("maximal_steps") = boost::none, py::arg("choice_filter") = boost::none); m.def("_get_reachable_states_rf", &getReachableStates, py::arg("model"), py::arg("initial_states"), py::arg("constraint_states"), py::arg("target_states"), py::arg("maximal_steps") = boost::none, py::arg("choice_filter") = boost::none); @@ -155,6 +154,7 @@ void define_modelchecking(py::module& m) { m.def("_model_checking_hybrid_engine", &modelCheckingHybridEngine, "Perform model checking using the hybrid engine", py::arg("model"), py::arg("task"), py::arg("environment") = storm::Environment()); m.def("_parametric_model_checking_hybrid_engine", &modelCheckingHybridEngine, "Perform parametric model checking using the hybrid engine", py::arg("model"), py::arg("task"), py::arg("environment") = storm::Environment()); m.def("check_interval_mdp", &checkIntervalMdp, "Check interval MDP"); + m.def("check_exact_interval_mdp", &checkRationalIntervalMdp, "Check exact interval MDP"); m.def("compute_all_until_probabilities", &computeAllUntilProbabilities, "Compute forward until probabilities"); m.def("compute_transient_probabilities", &computeTransientProbabilities, "Compute transient probabilities"); m.def("_compute_prob01states_double", &computeProb01, "Compute prob-0-1 states", py::arg("model"), py::arg("phi_states"), py::arg("psi_states")); From f2c382e7f90cf1d284072e8e65648db181d4a720 Mon Sep 17 00:00:00 2001 From: Luko van der Maas Date: Mon, 14 Jul 2025 10:08:42 +0200 Subject: [PATCH 14/35] small docker fix --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 9bd97dc7a2..3a14396652 100644 --- a/Dockerfile +++ b/Dockerfile @@ -75,4 +75,5 @@ RUN pip install -v \ --config-settings=cmake.define.CMAKE_BUILD_PARALLEL_LEVEL=$no_threads \ --config-settings=cmake.build-type=$build_type \ --config-settings=cmake.define.CARLPARSER_DIR_HINT=/opt/carl-parser/build/ \ + --config-settings=cmake.define.STORM_DIR_HINT=/opt/storm/build/ \ $setup_args .$options From ef0ed72602e029a07c4c1bc9ab674b99f1e47e44 Mon Sep 17 00:00:00 2001 From: Luko van der Maas Date: Mon, 13 Oct 2025 14:14:13 +0200 Subject: [PATCH 15/35] Enhance POMDP observation trace unfolder with options and update bindings in environment --- .gitignore | 2 +- lib/stormpy/pomdp/__init__.py | 10 ++-- src/core/environment.cpp | 98 ++++++++++++++++++++++++++++++++++- src/core/modelchecking.cpp | 8 +-- src/pomdp/transformations.cpp | 5 +- 5 files changed, 113 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index b37085814d..fc3c52a7dc 100644 --- a/.gitignore +++ b/.gitignore @@ -11,5 +11,5 @@ _build/ .pytest_cache/ .idea/ cmake-build-debug/ - +.cache/ .DS_Store diff --git a/lib/stormpy/pomdp/__init__.py b/lib/stormpy/pomdp/__init__.py index c43ceb50ec..e770c36530 100644 --- a/lib/stormpy/pomdp/__init__.py +++ b/lib/stormpy/pomdp/__init__.py @@ -73,15 +73,19 @@ def create_nondeterminstic_belief_tracker(model, reduction_timeout, track_timeou return _pomdp.NondeterministicBeliefTrackerDoubleSparse(model, opts) -def create_observation_trace_unfolder(model, risk_assessment, expr_manager): +def create_observation_trace_unfolder(model, risk_assessment, expr_manager, options=None): """ :param model: :param risk_assessment: :param expr_manager: + :param options: :return: """ + if options is None: + options = ObservationTraceUnfolderOptions() + if model.is_exact: - return _pomdp.ObservationTraceUnfolderExact(model, risk_assessment, expr_manager) + return _pomdp.ObservationTraceUnfolderExact(model, risk_assessment, expr_manager, options) else: - return _pomdp.ObservationTraceUnfolderDouble(model, risk_assessment, expr_manager) + return _pomdp.ObservationTraceUnfolderDouble(model, risk_assessment, expr_manager, options) diff --git a/src/core/environment.cpp b/src/core/environment.cpp index e89007057c..5fc17ee5a2 100644 --- a/src/core/environment.cpp +++ b/src/core/environment.cpp @@ -3,6 +3,9 @@ #include "storm/environment/Environment.h" #include "storm/environment/solver/SolverEnvironment.h" #include "storm/environment/solver/AllSolverEnvironments.h" +#include "storm/environment/modelchecker/ModelCheckerEnvironment.h" +#include "storm/environment/modelchecker/MultiObjectiveModelCheckerEnvironment.h" +#include "storm/storage/SchedulerClass.h" // added for SchedulerClass binding void define_environment(py::module& m) { py::enum_(m, "EquationSolverType", "Solver type for equation systems") @@ -36,9 +39,103 @@ void define_environment(py::module& m) { .value("optimistic_value_iteration", storm::solver::MinMaxMethod::OptimisticValueIteration) ; + // Multi-objective related enums + py::enum_(m, "MultiObjectiveMethod", "Multi-objective model checking method") + .value("pcaa", storm::modelchecker::multiobjective::MultiObjectiveMethod::Pcaa) + .value("constraint_based", storm::modelchecker::multiobjective::MultiObjectiveMethod::ConstraintBased) + ; + + // Added enums for model checker environment + py::enum_(m, "SteadyStateDistributionAlgorithm", "Algorithm for steady state distribution computation") + .value("automatic", storm::SteadyStateDistributionAlgorithm::Automatic) + .value("equation_system", storm::SteadyStateDistributionAlgorithm::EquationSystem) + .value("expected_visiting_times", storm::SteadyStateDistributionAlgorithm::ExpectedVisitingTimes) + .value("classic", storm::SteadyStateDistributionAlgorithm::Classic) + ; + + py::enum_(m, "ConditionalAlgorithmSetting", "Algorithm used for conditional model checking") + .value("default", storm::ConditionalAlgorithmSetting::Default) + .value("restart", storm::ConditionalAlgorithmSetting::Restart) + .value("bisection", storm::ConditionalAlgorithmSetting::Bisection) + .value("bisection_advanced", storm::ConditionalAlgorithmSetting::BisectionAdvanced) + .value("policy_iteration", storm::ConditionalAlgorithmSetting::PolicyIteration) + ; + + py::enum_(m, "MultiObjectivePrecisionType", "Type of precision for multi-objective model checking") + .value("absolute", storm::MultiObjectiveModelCheckerEnvironment::PrecisionType::Absolute) + .value("relative_to_diff", storm::MultiObjectiveModelCheckerEnvironment::PrecisionType::RelativeToDiff) + ; + + py::enum_(m, "MultiObjectiveEncodingType", "Encoding type for multi-objective model checking") + .value("auto", storm::MultiObjectiveModelCheckerEnvironment::EncodingType::Auto) + .value("classic", storm::MultiObjectiveModelCheckerEnvironment::EncodingType::Classic) + .value("flow", storm::MultiObjectiveModelCheckerEnvironment::EncodingType::Flow) + ; + + // Scheduler class bindings (needed for scheduler restriction) + py::enum_(m, "SchedulerMemoryPattern", "Memory pattern of a scheduler") + .value("arbitrary", storm::storage::SchedulerClass::MemoryPattern::Arbitrary) + .value("goal_memory", storm::storage::SchedulerClass::MemoryPattern::GoalMemory) + .value("counter", storm::storage::SchedulerClass::MemoryPattern::Counter) + ; + + py::class_(m, "SchedulerClass", "Scheduler class restriction") + .def(py::init<>()) + .def_property("deterministic", &storm::storage::SchedulerClass::isDeterministic, [](storm::storage::SchedulerClass& sc, bool v){ sc.setIsDeterministic(v); }) + .def_property("memory_states", + [](storm::storage::SchedulerClass const& sc)->py::object { if (sc.isMemoryBounded()) return py::cast(sc.getMemoryStates()); return py::none(); }, + [](storm::storage::SchedulerClass& sc, py::object obj){ if (obj.is_none()) sc.unsetMemoryStates(); else sc.setMemoryStates(obj.cast()); }) + .def_property_readonly("is_memory_bounded", &storm::storage::SchedulerClass::isMemoryBounded) + .def_property_readonly("memory_pattern", &storm::storage::SchedulerClass::getMemoryPattern) + .def("set_memory_pattern", [](storm::storage::SchedulerClass& sc, storm::storage::SchedulerClass::MemoryPattern p){ sc.setMemoryPattern(p); }) + .def("set_positional", &storm::storage::SchedulerClass::setPositional) + ; + py::class_(m, "Environment", "Environment") .def(py::init<>(), "Construct default environment") .def_property_readonly("solver_environment", [](storm::Environment& env) -> auto& {return env.solver();}, "solver part of environment") + .def_property_readonly("model_checker_environment", [](storm::Environment& env) -> auto& {return env.modelchecker();}, "model checker part of environment") + ; + + py::class_(m, "ModelCheckerEnvironment", "Environment for the solver") + .def_property("conditional_algorithm", &storm::ModelCheckerEnvironment::getConditionalAlgorithmSetting, &storm::ModelCheckerEnvironment::setConditionalAlgorithmSetting, "conditional algorithm used") + .def_property("steady_state_distribution_algorithm", &storm::ModelCheckerEnvironment::getSteadyStateDistributionAlgorithm, &storm::ModelCheckerEnvironment::setSteadyStateDistributionAlgorithm, "steady state distribution algorithm used") + .def_property("ltl2da_tool", + [](storm::ModelCheckerEnvironment const& env)->py::object { if (env.isLtl2daToolSet()) return py::cast(env.getLtl2daTool()); return py::none(); }, + [](storm::ModelCheckerEnvironment& env, py::object obj){ if (obj.is_none()) env.unsetLtl2daTool(); else env.setLtl2daTool(obj.cast()); }, + "Path to external ltl2da tool (None to unset)") + .def_property_readonly("multi", [](storm::ModelCheckerEnvironment& env)->storm::MultiObjectiveModelCheckerEnvironment& { return env.multi(); }, py::return_value_policy::reference, "Access multi-objective sub-environment") + ; + + py::class_(m, "MultiObjectiveModelCheckerEnvironment", "Environment for multi-objective model checking") + .def_property("method", + [](storm::MultiObjectiveModelCheckerEnvironment const& env){ return env.getMethod(); }, + &storm::MultiObjectiveModelCheckerEnvironment::setMethod, + "multi-objective model checking method") + .def_property("precision", &storm::MultiObjectiveModelCheckerEnvironment::getPrecision, &storm::MultiObjectiveModelCheckerEnvironment::setPrecision) + .def_property("precision_type", &storm::MultiObjectiveModelCheckerEnvironment::getPrecisionType, &storm::MultiObjectiveModelCheckerEnvironment::setPrecisionType) + .def_property("encoding_type", &storm::MultiObjectiveModelCheckerEnvironment::getEncodingType, &storm::MultiObjectiveModelCheckerEnvironment::setEncodingType) + .def_property("use_indicator_constraints", &storm::MultiObjectiveModelCheckerEnvironment::getUseIndicatorConstraints, &storm::MultiObjectiveModelCheckerEnvironment::setUseIndicatorConstraints) + .def_property("use_bscc_order_encoding", &storm::MultiObjectiveModelCheckerEnvironment::getUseBsccOrderEncoding, &storm::MultiObjectiveModelCheckerEnvironment::setUseBsccOrderEncoding) + .def_property("use_redundant_bscc_constraints", &storm::MultiObjectiveModelCheckerEnvironment::getUseRedundantBsccConstraints, &storm::MultiObjectiveModelCheckerEnvironment::setUseRedundantBsccConstraints) + .def_property_readonly("export_plot_set", &storm::MultiObjectiveModelCheckerEnvironment::isExportPlotSet) + .def_property("plot_path_under_approximation", + [](storm::MultiObjectiveModelCheckerEnvironment const& env)->py::object { auto p = env.getPlotPathUnderApproximation(); if (p) return py::cast(*p); return py::none(); }, + [](storm::MultiObjectiveModelCheckerEnvironment& env, py::object obj){ if (obj.is_none()) env.unsetPlotPathUnderApproximation(); else env.setPlotPathUnderApproximation(obj.cast()); }) + .def_property("plot_path_over_approximation", + [](storm::MultiObjectiveModelCheckerEnvironment const& env)->py::object { auto p = env.getPlotPathOverApproximation(); if (p) return py::cast(*p); return py::none(); }, + [](storm::MultiObjectiveModelCheckerEnvironment& env, py::object obj){ if (obj.is_none()) env.unsetPlotPathOverApproximation(); else env.setPlotPathOverApproximation(obj.cast()); }) + .def_property("plot_path_pareto_points", + [](storm::MultiObjectiveModelCheckerEnvironment const& env)->py::object { auto p = env.getPlotPathParetoPoints(); if (p) return py::cast(*p); return py::none(); }, + [](storm::MultiObjectiveModelCheckerEnvironment& env, py::object obj){ if (obj.is_none()) env.unsetPlotPathParetoPoints(); else env.setPlotPathParetoPoints(obj.cast()); }) + .def_property("max_steps", + [](storm::MultiObjectiveModelCheckerEnvironment const& env)->py::object { if (env.isMaxStepsSet()) return py::cast(env.getMaxSteps()); return py::none(); }, + [](storm::MultiObjectiveModelCheckerEnvironment& env, py::object obj){ if (obj.is_none()) env.unsetMaxSteps(); else env.setMaxSteps(obj.cast()); }) + .def_property("scheduler_restriction", + [](storm::MultiObjectiveModelCheckerEnvironment const& env)->py::object { if (env.isSchedulerRestrictionSet()) return py::cast(env.getSchedulerRestriction()); return py::none(); }, + [](storm::MultiObjectiveModelCheckerEnvironment& env, py::object obj){ if (obj.is_none()) env.unsetSchedulerRestriction(); else env.setSchedulerRestriction(obj.cast()); }) + .def_property("print_results", &storm::MultiObjectiveModelCheckerEnvironment::isPrintResultsSet, &storm::MultiObjectiveModelCheckerEnvironment::setPrintResults) + .def_property("lexicographic_model_checking", &storm::MultiObjectiveModelCheckerEnvironment::isLexicographicModelCheckingSet, &storm::MultiObjectiveModelCheckerEnvironment::setLexicographicModelChecking) ; py::class_(m, "SolverEnvironment", "Environment for solvers") @@ -62,4 +159,3 @@ void define_environment(py::module& m) { } - diff --git a/src/core/modelchecking.cpp b/src/core/modelchecking.cpp index 4505f22039..6c6908b8f4 100644 --- a/src/core/modelchecking.cpp +++ b/src/core/modelchecking.cpp @@ -59,9 +59,9 @@ std::vector computeAllUntilProbabilities(storm::Environment const& env, return storm::modelchecker::helper::SparseCtmcCslHelper::computeAllUntilProbabilities(env, std::move(goal), ctmc->getTransitionMatrix(), ctmc->getExitRateVector(), ctmc->getInitialStates(), phiStates, psiStates); } -std::vector computeTransientProbabilities(storm::Environment const& env, std::shared_ptr> ctmc, storm::storage::BitVector const& phiStates, storm::storage::BitVector const& psiStates, double timeBound) { - return storm::modelchecker::helper::SparseCtmcCslHelper::computeAllTransientProbabilities(env, ctmc->getTransitionMatrix(), ctmc->getInitialStates(), phiStates, psiStates, ctmc->getExitRateVector(), timeBound); -} +// std::vector computeTransientProbabilities(storm::Environment const& env, std::shared_ptr> ctmc, storm::storage::BitVector const& phiStates, storm::storage::BitVector const& psiStates, double timeBound) { +// return storm::modelchecker::helper::SparseCtmcCslHelper::computeAllTransientProbabilities(env, ctmc->getTransitionMatrix(), ctmc->getInitialStates(), phiStates, psiStates, ctmc->getExitRateVector(), timeBound); +// } // Thin wrapper for computing prob01 states template @@ -151,7 +151,7 @@ void define_modelchecking(py::module& m) { m.def("_parametric_model_checking_hybrid_engine", &modelCheckingHybridEngine, "Perform parametric model checking using the hybrid engine", py::arg("model"), py::arg("task"), py::arg("environment") = storm::Environment()); m.def("check_interval_mdp", &checkIntervalMdp, "Check interval MDP"); m.def("compute_all_until_probabilities", &computeAllUntilProbabilities, "Compute forward until probabilities"); - m.def("compute_transient_probabilities", &computeTransientProbabilities, "Compute transient probabilities"); + // m.def("compute_transient_probabilities", &computeTransientProbabilities, "Compute transient probabilities"); m.def("_compute_prob01states_double", &computeProb01, "Compute prob-0-1 states", py::arg("model"), py::arg("phi_states"), py::arg("psi_states")); m.def("_compute_prob01states_rationalfunc", &computeProb01, "Compute prob-0-1 states", py::arg("model"), py::arg("phi_states"), py::arg("psi_states")); m.def("_compute_prob01states_min_double", &computeProb01min, "Compute prob-0-1 states (min)", py::arg("model"), py::arg("phi_states"), py::arg("psi_states")); diff --git a/src/pomdp/transformations.cpp b/src/pomdp/transformations.cpp index bfd88d72d4..9bb4197e5f 100644 --- a/src/pomdp/transformations.cpp +++ b/src/pomdp/transformations.cpp @@ -47,6 +47,9 @@ void define_transformations_nt(py::module &m) { .value("full", storm::transformer::PomdpFscApplicationMode::FULL) ; + py::class_ options(m, "ObservationTraceUnfolderOptions", "Options for unfolding observation traces"); + options.def(py::init<>()); + options.def_readwrite("rejection_sampling", &storm::pomdp::ObservationTraceUnfolderOptions::rejectionSampling, "Use rejection sampling instead of restarts"); } template @@ -58,7 +61,7 @@ void define_transformations(py::module& m, std::string const& vtSuffix) { //m.def(("_unfold_trace_" + vtSuffix).c_str(), &unfold_trace, "Unfold observed trace", py::arg("pomdp"), py::arg("expression_manager"),py::arg("observation_trace"), py::arg("risk_definition")); py::class_> unfolder(m, ("ObservationTraceUnfolder" + vtSuffix).c_str(), "Unfolds observation traces in models"); - unfolder.def(py::init const&, std::vector const&, std::shared_ptr&>(), py::arg("model"), py::arg("risk"), py::arg("expression_manager")); + unfolder.def(py::init const&, std::vector const&, std::shared_ptr&, storm::pomdp::ObservationTraceUnfolderOptions const&>(), py::arg("model"), py::arg("risk"), py::arg("expression_manager"), py::arg("options")); unfolder.def("transform", &storm::pomdp::ObservationTraceUnfolder::transform, py::arg("trace")); unfolder.def("extend", &storm::pomdp::ObservationTraceUnfolder::extend, py::arg("new_observation")); unfolder.def("reset", &storm::pomdp::ObservationTraceUnfolder::reset, py::arg("new_observation")); From 2ec0a287c1db58be96178263d8ee1a2608936ed0 Mon Sep 17 00:00:00 2001 From: Luko van der Maas Date: Fri, 24 Oct 2025 14:21:00 +0200 Subject: [PATCH 16/35] Fix some weird edits --- src/mod_pomdp.cpp | 3 +-- src/mod_utility.cpp | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/mod_pomdp.cpp b/src/mod_pomdp.cpp index a7faf65424..0a49477ce5 100644 --- a/src/mod_pomdp.cpp +++ b/src/mod_pomdp.cpp @@ -8,9 +8,8 @@ #include "pomdp/tracker.h" #include "pomdp/transformations.h" #include -#include -PYBIND11_MODULE(pomdp, m) { +PYBIND11_MODULE(_pomdp, m) { m.doc() = "Functionality for POMDP analysis"; #ifdef STORMPY_DISABLE_SIGNATURE_DOC diff --git a/src/mod_utility.cpp b/src/mod_utility.cpp index 0312638f7c..d2510cb400 100644 --- a/src/mod_utility.cpp +++ b/src/mod_utility.cpp @@ -1,13 +1,13 @@ #include "common.h" -#include "src/utility/kwekMehlhorn.h" #include "storm/adapters/RationalNumberAdapter.h" #include "utility/chrono.h" #include "utility/json.h" +#include "utility/kwekMehlhorn.h" #include "utility/shortestPaths.h" #include "utility/smtsolver.h" -PYBIND11_MODULE(utility, m) { +PYBIND11_MODULE(_utility, m) { m.doc() = "Utilities for Storm"; #ifdef STORMPY_DISABLE_SIGNATURE_DOC From 34782198c197405a1aaab096db84ab4b7876d388 Mon Sep 17 00:00:00 2001 From: Filip Macak Date: Wed, 5 Nov 2025 15:55:53 +0100 Subject: [PATCH 17/35] Added bindings for export of schedulers for conditional properties --- lib/stormpy/__init__.py | 14 ++++++++++++-- src/core/modelchecking.cpp | 4 ++++ src/logic/formulae.cpp | 8 ++++++-- src/storage/scheduler.cpp | 7 +++++++ 4 files changed, 29 insertions(+), 4 deletions(-) diff --git a/lib/stormpy/__init__.py b/lib/stormpy/__init__.py index e115962ee0..6e68f3bf41 100644 --- a/lib/stormpy/__init__.py +++ b/lib/stormpy/__init__.py @@ -272,7 +272,7 @@ def perform_symbolic_bisimulation(model, properties, quotient_format=stormpy.Quo return _core._perform_symbolic_bisimulation(model, formulae, bisimulation_type, quotient_format) -def model_checking(model, property, only_initial_states=False, extract_scheduler=False, force_fully_observable=False, environment=Environment()): +def model_checking(model, property, only_initial_states=False, extract_scheduler=False, force_fully_observable=False, environment=Environment(), reach_conditional_states_result=None, reach_target_states_result=None): """ Perform model checking on model for property. :param model: Model. @@ -290,6 +290,8 @@ def model_checking(model, property, only_initial_states=False, extract_scheduler extract_scheduler=extract_scheduler, force_fully_observable=force_fully_observable, environment=environment, + reach_conditional_states_result=reach_conditional_states_result, + reach_target_states_result=reach_target_states_result ) else: assert model.is_symbolic_model @@ -298,7 +300,7 @@ def model_checking(model, property, only_initial_states=False, extract_scheduler return check_model_dd(model, property, only_initial_states=only_initial_states, environment=environment) -def check_model_sparse(model, property, only_initial_states=False, extract_scheduler=False, force_fully_observable=False, hint=None, environment=Environment()): +def check_model_sparse(model, property, only_initial_states=False, extract_scheduler=False, force_fully_observable=False, hint=None, environment=Environment(), reach_conditional_states_result=None, reach_target_states_result=None): """ Perform model checking on model for property. :param model: Model. @@ -349,6 +351,10 @@ def check_model_sparse(model, property, only_initial_states=False, extract_sched return _core._multi_objective_model_checking_exact(model, formula, environment=environment) task = _core.ExactCheckTask(formula, only_initial_states) task.set_produce_schedulers(extract_scheduler) + if reach_conditional_states_result is not None: + task.set_reach_conditional_states_result(reach_conditional_states_result) + if reach_target_states_result is not None: + task.set_reach_target_states_result(reach_target_states_result) if hint: task.set_hint(hint) return _core._exact_model_checking_sparse_engine(model, task, environment=environment) @@ -357,6 +363,10 @@ def check_model_sparse(model, property, only_initial_states=False, extract_sched return _core._multi_objective_model_checking_double(model, formula, environment=environment) task = _core.CheckTask(formula, only_initial_states) task.set_produce_schedulers(extract_scheduler) + if reach_conditional_states_result is not None: + task.set_reach_conditional_states_result(reach_conditional_states_result) + if reach_target_states_result is not None: + task.set_reach_target_states_result(reach_target_states_result) if hint: task.set_hint(hint) return _core._model_checking_sparse_engine(model, task, environment=environment) diff --git a/src/core/modelchecking.cpp b/src/core/modelchecking.cpp index 6c6908b8f4..bfcc152df6 100644 --- a/src/core/modelchecking.cpp +++ b/src/core/modelchecking.cpp @@ -108,12 +108,16 @@ void define_modelchecking(py::module& m) { .def("set_produce_schedulers", &CheckTask::setProduceSchedulers, "Set whether schedulers should be produced (if possible)", py::arg("produce_schedulers") = true) .def("set_hint", &CheckTask::setHint, "Sets a hint that may speed up the solver") .def("set_robust_uncertainty", &CheckTask::setRobustUncertainty, "Sets whether robust uncertainty should be considered") + .def("set_reach_conditional_states_result", &CheckTask::setReachConditionalStatesResult, "Sets the result for conditional states in conditional properties") + .def("set_reach_target_states_result", &CheckTask::setReachTargetStatesResult, "Sets the result for target states in conditional properties") ; // CheckTask py::class_, std::shared_ptr>>(m, "ExactCheckTask", "Task for model checking with exact numbers") //m.def("create_check_task", &storm::api::createTask, "Create task for verification", py::arg("formula"), py::arg("only_initial_states") = false); .def(py::init(), py::arg("formula"), py::arg("only_initial_states") = false) .def("set_produce_schedulers", &CheckTask::setProduceSchedulers, "Set whether schedulers should be produced (if possible)", py::arg("produce_schedulers") = true) + .def("set_reach_conditional_states_result", &CheckTask::setReachConditionalStatesResult, "Sets the result for conditional states in conditional properties") + .def("set_reach_target_states_result", &CheckTask::setReachTargetStatesResult, "Sets the result for target states in conditional properties") ; py::class_, std::shared_ptr>>(m, "ParametricCheckTask", "Task for parametric model checking") //m.def("create_check_task", &storm::api::createTask, "Create task for verification", py::arg("formula"), py::arg("only_initial_states") = false); diff --git a/src/logic/formulae.cpp b/src/logic/formulae.cpp index 46ccaed610..c5364bddc2 100644 --- a/src/logic/formulae.cpp +++ b/src/logic/formulae.cpp @@ -32,13 +32,15 @@ void define_formulae(py::module& m) { .def_property_readonly("is_bounded_until_formula", &storm::logic::Formula::isBoundedUntilFormula) .def_property_readonly("is_until_formula", &storm::logic::Formula::isUntilFormula) .def_property_readonly("is_multi_objective_formula", &storm::logic::Formula::isMultiObjectiveFormula) + .def("_as_eventually_formula", [](storm::logic::Formula const& f) { return f.asEventuallyFormula(); }, "Get as eventually formula") ; // Path Formulae py::class_> pathFormula(m, "PathFormula", "Formula about the probability of a set of paths in an automaton", formula); py::class_> unaryPathFormula(m, "UnaryPathFormula", "Path formula with one operand", pathFormula); unaryPathFormula.def_property_readonly("subformula", &storm::logic::UnaryPathFormula::getSubformula, "the subformula"); - py::class_>(m, "EventuallyFormula", "Formula for eventually", unaryPathFormula); + py::class_>(m, "EventuallyFormula", "Formula for eventually", unaryPathFormula) + .def_property_readonly("subformula", &storm::logic::EventuallyFormula::getSubformula, "the subformula"); py::class_>(m, "GloballyFormula", "Formula for globally", unaryPathFormula); py::class_> binaryPathFormula(m, "BinaryPathFormula", "Path formula with two operands", pathFormula); binaryPathFormula.def_property_readonly("left_subformula", &storm::logic::BinaryPathFormula::getLeftSubformula); @@ -49,7 +51,9 @@ void define_formulae(py::module& m) { .def_property_readonly("upper_bound_expression", [](storm::logic::BoundedUntilFormula const& form) { return form.getUpperBound(); } ) .def_property_readonly("left_subformula", [](storm::logic::BoundedUntilFormula const& form) -> storm::logic::Formula const& { return form.getLeftSubformula(); }, py::return_value_policy::reference_internal) .def_property_readonly("right_subformula", [](storm::logic::BoundedUntilFormula const& form)-> storm::logic::Formula const& { return form.getRightSubformula(); }, py::return_value_policy::reference_internal); - py::class_>(m, "ConditionalFormula", "Formula with the right hand side being a condition.", formula); + py::class_>(m, "ConditionalFormula", "Formula with the right hand side being a condition.", formula) + .def_property_readonly("main_subformula", &storm::logic::ConditionalFormula::getSubformula, "the subformula") + .def_property_readonly("conditional_subformula", &storm::logic::ConditionalFormula::getConditionFormula, "the conditional subformula"); py::class_>(m, "UntilFormula", "Path Formula for unbounded until", binaryPathFormula); // Reward Path Formulae diff --git a/src/storage/scheduler.cpp b/src/storage/scheduler.cpp index b5cb1ad98e..e1eaa50734 100644 --- a/src/storage/scheduler.cpp +++ b/src/storage/scheduler.cpp @@ -30,6 +30,13 @@ void define_scheduler(py::module& m, std::string vt_suffix) { s.printJsonToStream(str, model, skipUniqueChoices, skipDontCareStates); return str.str(); }, py::arg("model"), py::arg("skip_unique_choices") = false, py::arg("skip_dont_care_states") = false) + .def("to_str", [](Scheduler const& s, std::shared_ptr> model, bool skipUniqueChoices, + bool skipDontCareStates) { + std::stringstream str; + s.printToStream(str, model, skipUniqueChoices, skipDontCareStates); + return str.str(); + }, py::arg("model") = nullptr, py::arg("skip_unique_choices") = false, py::arg("skip_dont_care_states") = false) + .def("get_memoryless_scheduler_for_memory_state", &Scheduler::getMemorylessSchedulerForMemoryState, py::arg("memory_state") = 0, "Get the memoryless scheduler corresponding to the given memory state") ; if constexpr (!std::is_same_v) { From b051f48c65e88fbe2fb54533e5fa377d7622ec94 Mon Sep 17 00:00:00 2001 From: Luko van der Maas Date: Mon, 10 Nov 2025 16:18:45 +0100 Subject: [PATCH 18/35] add tover option --- src/pomdp/generator.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pomdp/generator.cpp b/src/pomdp/generator.cpp index a7dde063ab..2d3100f7c7 100644 --- a/src/pomdp/generator.cpp +++ b/src/pomdp/generator.cpp @@ -72,6 +72,9 @@ void define_verimon_generator(py::module &m, std::string const &vtSuffix) { &GenerateMonitorVerifierOptions::horizonLabel); gmvopts.def_readwrite("use_risk", &GenerateMonitorVerifierOptions::useRisk); + gmvopts.def_readwrite( + "use_rejection_sampling", + &GenerateMonitorVerifierOptions::useRejectionSampling); } template void define_verimon_generator(py::module &m, From a943218df96f2f1202bdeed1fa8bb3c807dab017 Mon Sep 17 00:00:00 2001 From: Filip Macak Date: Fri, 14 Nov 2025 11:19:27 +0100 Subject: [PATCH 19/35] cleaning up unused code --- lib/stormpy/__init__.py | 16 +++------------- lib/stormpy/pomdp/__init__.py | 2 ++ src/core/modelchecking.cpp | 4 ---- 3 files changed, 5 insertions(+), 17 deletions(-) diff --git a/lib/stormpy/__init__.py b/lib/stormpy/__init__.py index 6e68f3bf41..b951595ad8 100644 --- a/lib/stormpy/__init__.py +++ b/lib/stormpy/__init__.py @@ -272,7 +272,7 @@ def perform_symbolic_bisimulation(model, properties, quotient_format=stormpy.Quo return _core._perform_symbolic_bisimulation(model, formulae, bisimulation_type, quotient_format) -def model_checking(model, property, only_initial_states=False, extract_scheduler=False, force_fully_observable=False, environment=Environment(), reach_conditional_states_result=None, reach_target_states_result=None): +def model_checking(model, property, only_initial_states=False, extract_scheduler=False, force_fully_observable=False, environment=Environment()): """ Perform model checking on model for property. :param model: Model. @@ -290,9 +290,7 @@ def model_checking(model, property, only_initial_states=False, extract_scheduler extract_scheduler=extract_scheduler, force_fully_observable=force_fully_observable, environment=environment, - reach_conditional_states_result=reach_conditional_states_result, - reach_target_states_result=reach_target_states_result - ) + ) else: assert model.is_symbolic_model if extract_scheduler: @@ -300,7 +298,7 @@ def model_checking(model, property, only_initial_states=False, extract_scheduler return check_model_dd(model, property, only_initial_states=only_initial_states, environment=environment) -def check_model_sparse(model, property, only_initial_states=False, extract_scheduler=False, force_fully_observable=False, hint=None, environment=Environment(), reach_conditional_states_result=None, reach_target_states_result=None): +def check_model_sparse(model, property, only_initial_states=False, extract_scheduler=False, force_fully_observable=False, hint=None, environment=Environment()): """ Perform model checking on model for property. :param model: Model. @@ -351,10 +349,6 @@ def check_model_sparse(model, property, only_initial_states=False, extract_sched return _core._multi_objective_model_checking_exact(model, formula, environment=environment) task = _core.ExactCheckTask(formula, only_initial_states) task.set_produce_schedulers(extract_scheduler) - if reach_conditional_states_result is not None: - task.set_reach_conditional_states_result(reach_conditional_states_result) - if reach_target_states_result is not None: - task.set_reach_target_states_result(reach_target_states_result) if hint: task.set_hint(hint) return _core._exact_model_checking_sparse_engine(model, task, environment=environment) @@ -363,10 +357,6 @@ def check_model_sparse(model, property, only_initial_states=False, extract_sched return _core._multi_objective_model_checking_double(model, formula, environment=environment) task = _core.CheckTask(formula, only_initial_states) task.set_produce_schedulers(extract_scheduler) - if reach_conditional_states_result is not None: - task.set_reach_conditional_states_result(reach_conditional_states_result) - if reach_target_states_result is not None: - task.set_reach_target_states_result(reach_target_states_result) if hint: task.set_hint(hint) return _core._model_checking_sparse_engine(model, task, environment=environment) diff --git a/lib/stormpy/pomdp/__init__.py b/lib/stormpy/pomdp/__init__.py index e770c36530..a518cf7a26 100644 --- a/lib/stormpy/pomdp/__init__.py +++ b/lib/stormpy/pomdp/__init__.py @@ -16,6 +16,8 @@ def make_canonic(model): if model.supports_parameters: return _pomdp._make_canonic_Rf(model) + elif model.is_exact: + return _pomdp._make_canonic_Exact(model) else: return _pomdp._make_canonic_Double(model) diff --git a/src/core/modelchecking.cpp b/src/core/modelchecking.cpp index bfcc152df6..6c6908b8f4 100644 --- a/src/core/modelchecking.cpp +++ b/src/core/modelchecking.cpp @@ -108,16 +108,12 @@ void define_modelchecking(py::module& m) { .def("set_produce_schedulers", &CheckTask::setProduceSchedulers, "Set whether schedulers should be produced (if possible)", py::arg("produce_schedulers") = true) .def("set_hint", &CheckTask::setHint, "Sets a hint that may speed up the solver") .def("set_robust_uncertainty", &CheckTask::setRobustUncertainty, "Sets whether robust uncertainty should be considered") - .def("set_reach_conditional_states_result", &CheckTask::setReachConditionalStatesResult, "Sets the result for conditional states in conditional properties") - .def("set_reach_target_states_result", &CheckTask::setReachTargetStatesResult, "Sets the result for target states in conditional properties") ; // CheckTask py::class_, std::shared_ptr>>(m, "ExactCheckTask", "Task for model checking with exact numbers") //m.def("create_check_task", &storm::api::createTask, "Create task for verification", py::arg("formula"), py::arg("only_initial_states") = false); .def(py::init(), py::arg("formula"), py::arg("only_initial_states") = false) .def("set_produce_schedulers", &CheckTask::setProduceSchedulers, "Set whether schedulers should be produced (if possible)", py::arg("produce_schedulers") = true) - .def("set_reach_conditional_states_result", &CheckTask::setReachConditionalStatesResult, "Sets the result for conditional states in conditional properties") - .def("set_reach_target_states_result", &CheckTask::setReachTargetStatesResult, "Sets the result for target states in conditional properties") ; py::class_, std::shared_ptr>>(m, "ParametricCheckTask", "Task for parametric model checking") //m.def("create_check_task", &storm::api::createTask, "Create task for verification", py::arg("formula"), py::arg("only_initial_states") = false); From 4840730a9cc68feed0a8c3ccaea8e396a3e14089 Mon Sep 17 00:00:00 2001 From: Luko van der Maas Date: Wed, 26 Nov 2025 15:50:41 +0100 Subject: [PATCH 20/35] add schedulers to qualitative check results --- src/core/result.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/result.cpp b/src/core/result.cpp index 8a633a21ee..6466cef617 100644 --- a/src/core/result.cpp +++ b/src/core/result.cpp @@ -69,6 +69,8 @@ void define_result(py::module& m) { return result[state]; }, py::arg("state"), "Get result for given state") .def("get_truth_values", &storm::modelchecker::ExplicitQualitativeCheckResult::getTruthValuesVector, "Get BitVector representing the truth values") + .def_property_readonly("scheduler", [](storm::modelchecker::ExplicitQualitativeCheckResult const& res) {return res.getScheduler();}, "get scheduler") + ; py::class_, std::shared_ptr>>(m, "SymbolicQualitativeCheckResult", "Symbolic qualitative model checking result", qualitativeCheckResult) .def("get_truth_values", &storm::modelchecker::SymbolicQualitativeCheckResult::getTruthValuesVector, "Get Dd representing the truth values") From 7b9d312bb1c7fc7fe7e8452c09061975ed213fad Mon Sep 17 00:00:00 2001 From: Luko van der Maas Date: Wed, 26 Nov 2025 17:48:47 +0100 Subject: [PATCH 21/35] some type fixes --- src/core/result.cpp | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/src/core/result.cpp b/src/core/result.cpp index 6466cef617..0db67e523c 100644 --- a/src/core/result.cpp +++ b/src/core/result.cpp @@ -11,7 +11,7 @@ template std::shared_ptr createFilterInitialStatesSparse(std::shared_ptr> model) { - return std::make_unique(model->getInitialStates()); + return std::make_unique>(model->getInitialStates()); } template @@ -43,7 +43,10 @@ void define_result(py::module& m) { .def_property_readonly("has_scheduler", &storm::modelchecker::CheckResult::hasScheduler, "Flag if a scheduler is present") .def("as_explicit_qualitative", [](storm::modelchecker::CheckResult const& result) { - return result.asExplicitQualitativeCheckResult(); + return result.asExplicitQualitativeCheckResult(); + }, "Convert into explicit qualitative result") + .def("as_explicit_exact_qualitative", [](storm::modelchecker::CheckResult const& result) { + return result.asExplicitQualitativeCheckResult(); }, "Convert into explicit qualitative result") .def("as_explicit_quantitative", [](storm::modelchecker::CheckResult const& result) { return result.asExplicitQuantitativeCheckResult(); @@ -64,12 +67,22 @@ void define_result(py::module& m) { // QualitativeCheckResult py::class_> qualitativeCheckResult(m, "_QualitativeCheckResult", "Abstract class for qualitative model checking results", checkResult); - py::class_>(m, "ExplicitQualitativeCheckResult", "Explicit qualitative model checking result", qualitativeCheckResult) - .def("at", [](storm::modelchecker::ExplicitQualitativeCheckResult const& result, storm::storage::sparse::state_type state) { + // For doubles + py::class_, std::shared_ptr>>(m, "ExplicitQualitativeCheckResult", "Explicit qualitative model checking result", qualitativeCheckResult) + .def("at", [](storm::modelchecker::ExplicitQualitativeCheckResult const& result, storm::storage::sparse::state_type state) { + return result[state]; + }, py::arg("state"), "Get result for given state") + .def("get_truth_values", &storm::modelchecker::ExplicitQualitativeCheckResult::getTruthValuesVector, "Get BitVector representing the truth values") + .def_property_readonly("scheduler", [](storm::modelchecker::ExplicitQualitativeCheckResult const& res) {return res.getScheduler();}, "get scheduler") + + ; + // For rationals + py::class_, std::shared_ptr>>(m, "ExactExplicitQualitativeCheckResult", "Explicit qualitative model checking result", qualitativeCheckResult) + .def("at", [](storm::modelchecker::ExplicitQualitativeCheckResult const& result, storm::storage::sparse::state_type state) { return result[state]; }, py::arg("state"), "Get result for given state") - .def("get_truth_values", &storm::modelchecker::ExplicitQualitativeCheckResult::getTruthValuesVector, "Get BitVector representing the truth values") - .def_property_readonly("scheduler", [](storm::modelchecker::ExplicitQualitativeCheckResult const& res) {return res.getScheduler();}, "get scheduler") + .def("get_truth_values", &storm::modelchecker::ExplicitQualitativeCheckResult::getTruthValuesVector, "Get BitVector representing the truth values") + .def_property_readonly("scheduler", [](storm::modelchecker::ExplicitQualitativeCheckResult const& res) {return res.getScheduler();}, "get scheduler") ; py::class_, std::shared_ptr>>(m, "SymbolicQualitativeCheckResult", "Symbolic qualitative model checking result", qualitativeCheckResult) From b4d8b629d2632f6cf13540be98631c35882acf3d Mon Sep 17 00:00:00 2001 From: Luko van der Maas Date: Mon, 22 Dec 2025 12:53:33 +0100 Subject: [PATCH 22/35] add uncertainty --- src/core/transformation.cpp | 11 +++++++++++ src/core/transformation.h | 2 ++ src/mod_core.cpp | 2 ++ 3 files changed, 15 insertions(+) diff --git a/src/core/transformation.cpp b/src/core/transformation.cpp index 92338e2223..e9b095c5df 100644 --- a/src/core/transformation.cpp +++ b/src/core/transformation.cpp @@ -3,6 +3,7 @@ #include "storm/models/symbolic/StandardRewardModel.h" #include "storm/transformer/SubsystemBuilder.h" #include "storm/transformer/EndComponentEliminator.h" +#include "storm/transformer/AddUncertainty.h" // Thin wrappers. template @@ -82,6 +83,16 @@ void define_transformation_typed(py::module& m, std::string const& vtSuffix) { m.def(("_construct_subsystem_" + vtSuffix).c_str(), &constructSubsystem, "build a subsystem of a sparse model"); } +template +void define_transformation_typed_only_numbers(py::module& m, std::string const& vtSuffix) { + py::class_>(m, ("AddUncertainty" + vtSuffix).c_str(), "Transform model into interval model with specified uncertainty") + .def(py::init> const&>(), py::arg("model")) + .def("transform", &storm::transformer::AddUncertainty::transform, "transform the model", py::arg("additiveUncertainty"), py::arg("minimalTransitionProbability")); +} + template void define_transformation_typed(py::module& m, std::string const& vtSuffix); template void define_transformation_typed(py::module& m, std::string const& vtSuffix); template void define_transformation_typed(py::module& m, std::string const& vtSuffix); + +template void define_transformation_typed_only_numbers(py::module& m, std::string const& vtSuffix); +template void define_transformation_typed_only_numbers(py::module& m, std::string const& vtSuffix); diff --git a/src/core/transformation.h b/src/core/transformation.h index 7bd010bb8d..b9691d82cc 100644 --- a/src/core/transformation.h +++ b/src/core/transformation.h @@ -5,3 +5,5 @@ void define_transformation(py::module& m); template void define_transformation_typed(py::module& m, std::string const& suffix); +template +void define_transformation_typed_only_numbers(py::module& m, std::string const& vtSuffix); diff --git a/src/mod_core.cpp b/src/mod_core.cpp index 4ce5807b66..5516c2ff24 100644 --- a/src/mod_core.cpp +++ b/src/mod_core.cpp @@ -37,6 +37,8 @@ PYBIND11_MODULE(_core, m) { define_transformation_typed(m, "Double"); define_transformation_typed(m, "Exact"); define_transformation_typed(m, "RatFunc"); + define_transformation_typed_only_numbers(m, "Double"); + define_transformation_typed_only_numbers(m, "Exact"); define_sparse_model_simulator(m, "Double"); define_sparse_model_simulator(m, "Exact"); define_prism_program_simulator(m, "Double"); From df2ad994a9e32d6f4fef54480aa670aa9fc74104 Mon Sep 17 00:00:00 2001 From: Filip Macak Date: Thu, 22 Jan 2026 19:30:12 +0800 Subject: [PATCH 23/35] added binding for conditional optimization for bounded properties setting --- src/core/environment.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/core/environment.cpp b/src/core/environment.cpp index 5fc17ee5a2..8cc1a28525 100644 --- a/src/core/environment.cpp +++ b/src/core/environment.cpp @@ -58,6 +58,8 @@ void define_environment(py::module& m) { .value("restart", storm::ConditionalAlgorithmSetting::Restart) .value("bisection", storm::ConditionalAlgorithmSetting::Bisection) .value("bisection_advanced", storm::ConditionalAlgorithmSetting::BisectionAdvanced) + .value("bisection_policy_tracking", storm::ConditionalAlgorithmSetting::BisectionPolicyTracking) + .value("bisection_advanced_policy_tracking", storm::ConditionalAlgorithmSetting::BisectionAdvancedPolicyTracking) .value("policy_iteration", storm::ConditionalAlgorithmSetting::PolicyIteration) ; @@ -100,6 +102,7 @@ void define_environment(py::module& m) { py::class_(m, "ModelCheckerEnvironment", "Environment for the solver") .def_property("conditional_algorithm", &storm::ModelCheckerEnvironment::getConditionalAlgorithmSetting, &storm::ModelCheckerEnvironment::setConditionalAlgorithmSetting, "conditional algorithm used") .def_property("steady_state_distribution_algorithm", &storm::ModelCheckerEnvironment::getSteadyStateDistributionAlgorithm, &storm::ModelCheckerEnvironment::setSteadyStateDistributionAlgorithm, "steady state distribution algorithm used") + .def_property("optimization_for_bounded_properties", &storm::ModelCheckerEnvironment::isAllowOptimizationForBoundedPropertiesSet, &storm::ModelCheckerEnvironment::setAllowOptimizationForBoundedProperties, "enable optimization for bounded properties") .def_property("ltl2da_tool", [](storm::ModelCheckerEnvironment const& env)->py::object { if (env.isLtl2daToolSet()) return py::cast(env.getLtl2daTool()); return py::none(); }, [](storm::ModelCheckerEnvironment& env, py::object obj){ if (obj.is_none()) env.unsetLtl2daTool(); else env.setLtl2daTool(obj.cast()); }, From e7841ac4b81cd1440da4ade9d083a4abd0e42d12 Mon Sep 17 00:00:00 2001 From: Sebastian Junges Date: Fri, 23 Jan 2026 20:21:16 +0100 Subject: [PATCH 24/35] update for adduncertainty change --- src/core/transformation.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/transformation.cpp b/src/core/transformation.cpp index ac29a7c9cc..5a4cb0daff 100644 --- a/src/core/transformation.cpp +++ b/src/core/transformation.cpp @@ -89,7 +89,7 @@ template void define_transformation_typed_only_numbers(py::module& m, std::string const& vtSuffix) { py::class_>(m, ("AddUncertainty" + vtSuffix).c_str(), "Transform model into interval model with specified uncertainty") .def(py::init> const&>(), py::arg("model")) - .def("transform", &storm::transformer::AddUncertainty::transform, "transform the model", py::arg("additiveUncertainty"), py::arg("minimalTransitionProbability")); + .def("transform", &storm::transformer::AddUncertainty::transform, "transform the model", py::arg("additiveUncertainty"), py::arg("minimalTransitionProbability"), py::arg("max_successors")); } template void define_transformation_typed(py::module& m, std::string const& vtSuffix); From 868ab19c481af79674caebf4c546b877eda5fa8e Mon Sep 17 00:00:00 2001 From: Sebastian Junges Date: Wed, 28 Jan 2026 14:43:13 +0100 Subject: [PATCH 25/35] some flags for conditional --- src/core/environment.cpp | 3 +++ src/pomdp/transformations.cpp | 1 + 2 files changed, 4 insertions(+) diff --git a/src/core/environment.cpp b/src/core/environment.cpp index 5fc17ee5a2..b036f51494 100644 --- a/src/core/environment.cpp +++ b/src/core/environment.cpp @@ -58,6 +58,8 @@ void define_environment(py::module& m) { .value("restart", storm::ConditionalAlgorithmSetting::Restart) .value("bisection", storm::ConditionalAlgorithmSetting::Bisection) .value("bisection_advanced", storm::ConditionalAlgorithmSetting::BisectionAdvanced) + .value("bisection_pt", storm::ConditionalAlgorithmSetting::BisectionPolicyTracking) + .value("bisection_advanced_pt", storm::ConditionalAlgorithmSetting::BisectionAdvancedPolicyTracking) .value("policy_iteration", storm::ConditionalAlgorithmSetting::PolicyIteration) ; @@ -99,6 +101,7 @@ void define_environment(py::module& m) { py::class_(m, "ModelCheckerEnvironment", "Environment for the solver") .def_property("conditional_algorithm", &storm::ModelCheckerEnvironment::getConditionalAlgorithmSetting, &storm::ModelCheckerEnvironment::setConditionalAlgorithmSetting, "conditional algorithm used") + .def_property("conditional_tolerance", &storm::ModelCheckerEnvironment::getConditionalTolerance, &storm::ModelCheckerEnvironment::setConditionalTolerance, "conditional tolerance used") .def_property("steady_state_distribution_algorithm", &storm::ModelCheckerEnvironment::getSteadyStateDistributionAlgorithm, &storm::ModelCheckerEnvironment::setSteadyStateDistributionAlgorithm, "steady state distribution algorithm used") .def_property("ltl2da_tool", [](storm::ModelCheckerEnvironment const& env)->py::object { if (env.isLtl2daToolSet()) return py::cast(env.getLtl2daTool()); return py::none(); }, diff --git a/src/pomdp/transformations.cpp b/src/pomdp/transformations.cpp index 9bb4197e5f..a8aeecfd4c 100644 --- a/src/pomdp/transformations.cpp +++ b/src/pomdp/transformations.cpp @@ -65,6 +65,7 @@ void define_transformations(py::module& m, std::string const& vtSuffix) { unfolder.def("transform", &storm::pomdp::ObservationTraceUnfolder::transform, py::arg("trace")); unfolder.def("extend", &storm::pomdp::ObservationTraceUnfolder::extend, py::arg("new_observation")); unfolder.def("reset", &storm::pomdp::ObservationTraceUnfolder::reset, py::arg("new_observation")); + unfolder.def("is_rejection_sampling_set", &storm::pomdp::ObservationTraceUnfolder::isRejectionSamplingSet); } template void define_transformations(py::module& m, std::string const& vtSuffix); From 845efcdb4ed99c96adb596f17587e4b539fd333b Mon Sep 17 00:00:00 2001 From: Luko van der Maas Date: Wed, 8 Apr 2026 14:40:14 +0200 Subject: [PATCH 26/35] Remove Pyi files --- lib/stormpy/__init__.pyi | 611 ----------- lib/stormpy/_config.pyi | 17 - lib/stormpy/_version.pyi | 3 - lib/stormpy/core.pyi | 1547 --------------------------- lib/stormpy/exceptions.pyi | 15 - lib/stormpy/pycarl/__init__.pyi | 61 -- lib/stormpy/pycarl/_config.pyi | 6 - lib/stormpy/pycarl/_version.pyi | 3 - lib/stormpy/pycarl/cln/__init__.pyi | 1114 ------------------- lib/stormpy/pycarl/cln/_config.pyi | 3 - lib/stormpy/pycarl/gmp.pyi | 1116 ------------------- lib/stormpy/pycarl/infinity.pyi | 46 - lib/stormpy/pycarl/pycarl_core.pyi | 391 ------- lib/stormpy/utility/__init__.pyi | 16 - lib/stormpy/utility/utility.pyi | 230 ---- 15 files changed, 5179 deletions(-) delete mode 100644 lib/stormpy/__init__.pyi delete mode 100644 lib/stormpy/_config.pyi delete mode 100644 lib/stormpy/_version.pyi delete mode 100644 lib/stormpy/core.pyi delete mode 100644 lib/stormpy/exceptions.pyi delete mode 100644 lib/stormpy/pycarl/__init__.pyi delete mode 100644 lib/stormpy/pycarl/_config.pyi delete mode 100644 lib/stormpy/pycarl/_version.pyi delete mode 100644 lib/stormpy/pycarl/cln/__init__.pyi delete mode 100644 lib/stormpy/pycarl/cln/_config.pyi delete mode 100644 lib/stormpy/pycarl/gmp.pyi delete mode 100644 lib/stormpy/pycarl/infinity.pyi delete mode 100644 lib/stormpy/pycarl/pycarl_core.pyi delete mode 100644 lib/stormpy/utility/__init__.pyi delete mode 100644 lib/stormpy/utility/utility.pyi diff --git a/lib/stormpy/__init__.pyi b/lib/stormpy/__init__.pyi deleted file mode 100644 index a9a904b778..0000000000 --- a/lib/stormpy/__init__.pyi +++ /dev/null @@ -1,611 +0,0 @@ -from __future__ import annotations -from stormpy.core import ActionMaskDouble -from stormpy.core import BisimulationType -from stormpy.core import BuilderOptions -from stormpy.core import CheckTask -from stormpy.core import ConstraintCollector -from stormpy.core import DirectEncodingOptions -from stormpy.core import DirectEncodingParserOptions -from stormpy.core import EliminationLabelBehavior -from stormpy.core import EndComponentEliminatorReturnTypeDouble -from stormpy.core import Environment -from stormpy.core import EquationSolverType -from stormpy.core import ExactCheckTask -from stormpy.core import ExplicitExactQuantitativeCheckResult -from stormpy.core import ExplicitModelBuilder -from stormpy.core import ExplicitModelCheckerHintDouble -from stormpy.core import ExplicitParametricModelBuilder -from stormpy.core import ExplicitParametricQuantitativeCheckResult -from stormpy.core import ExplicitParetoCurveCheckResultDouble -from stormpy.core import ExplicitQualitativeCheckResult -from stormpy.core import ExplicitQuantitativeCheckResult -from stormpy.core import ExplicitStateLookup -from stormpy.core import FlatSet -from stormpy.core import HybridExactQuantitativeCheckResult -from stormpy.core import HybridParametricQuantitativeCheckResult -from stormpy.core import HybridQuantitativeCheckResult -from stormpy.core import JaniModelType -from stormpy.core import MinMaxMethod -from stormpy.core import MinMaxSolverEnvironment -from stormpy.core import ModelCheckerHint -from stormpy.core import ModelFormulasPair -from stormpy.core import NativeLinearEquationSolverMethod -from stormpy.core import NativeSolverEnvironment -from stormpy.core import OptimizationDirection -from stormpy.core import ParametricCheckTask -from stormpy.core import ParetoCurveCheckResultDouble -from stormpy.core import Property -from stormpy.core import QuotientFormat -from stormpy.core import SMTCounterExampleGenerator -from stormpy.core import SMTCounterExampleGeneratorOptions -from stormpy.core import SMTCounterExampleGeneratorStats -from stormpy.core import SMTCounterExampleInput -from stormpy.core import SolverEnvironment -from stormpy.core import StateValuationFunctionActionMaskDouble -from stormpy.core import SubsystemBuilderOptions -from stormpy.core import SubsystemBuilderReturnTypeDouble -from stormpy.core import SubsystemBuilderReturnTypeExact -from stormpy.core import SubsystemBuilderReturnTypeRatFunc -from stormpy.core import SymbolicExactQuantitativeCheckResult -from stormpy.core import SymbolicModelDescription -from stormpy.core import SymbolicParametricQuantitativeCheckResult -from stormpy.core import SymbolicQualitativeCheckResult -from stormpy.core import SymbolicQuantitativeCheckResult -from stormpy.core import build_sparse_exact_model_with_options -from stormpy.core import build_sparse_model_from_explicit -from stormpy.core import build_sparse_model_with_options -from stormpy.core import build_sparse_parametric_model_with_options -from stormpy.core import check_interval_mdp -from stormpy.core import compute_all_until_probabilities -from stormpy.core import compute_transient_probabilities -from stormpy.core import create_filter_initial_states_sparse -from stormpy.core import create_filter_initial_states_symbolic -from stormpy.core import create_filter_symbolic -from stormpy.core import install_signal_handlers -from stormpy.core import make_sparse_model_builder -from stormpy.core import make_sparse_model_builder_exact -from stormpy.core import make_sparse_model_builder_parametric -from stormpy.core import parse_constants_string -from stormpy.core import parse_jani_model -from stormpy.core import parse_jani_model_from_string -from stormpy.core import parse_prism_program -from stormpy.core import parse_properties_for_jani_model -from stormpy.core import parse_properties_for_prism_program -from stormpy.core import parse_properties_without_context -from stormpy.core import preprocess_symbolic_input -from stormpy.core import reset_timeout -from stormpy.core import set_loglevel_debug -from stormpy.core import set_loglevel_error -from stormpy.core import set_loglevel_trace -from stormpy.core import set_settings -from stormpy.core import set_timeout -from stormpy.exceptions import StormError -from stormpy.logic import logic -from stormpy.logic.logic import AtomicExpressionFormula -from stormpy.logic.logic import AtomicLabelFormula -from stormpy.logic.logic import BinaryBooleanOperatorType -from stormpy.logic.logic import BinaryPathFormula -from stormpy.logic.logic import BinaryStateFormula -from stormpy.logic.logic import BooleanBinaryStateFormula -from stormpy.logic.logic import BooleanLiteralFormula -from stormpy.logic.logic import BoundedUntilFormula -from stormpy.logic.logic import ComparisonType -from stormpy.logic.logic import ConditionalFormula -from stormpy.logic.logic import CumulativeRewardFormula -from stormpy.logic.logic import EventuallyFormula -from stormpy.logic.logic import Formula -from stormpy.logic.logic import GameFormula -from stormpy.logic.logic import GloballyFormula -from stormpy.logic.logic import InstantaneousRewardFormula -from stormpy.logic.logic import LongRunAvarageOperator -from stormpy.logic.logic import LongRunAverageRewardFormula -from stormpy.logic.logic import MultiObjectiveFormula -from stormpy.logic.logic import OperatorFormula -from stormpy.logic.logic import PathFormula -from stormpy.logic.logic import ProbabilityOperator -from stormpy.logic.logic import RewardOperator -from stormpy.logic.logic import StateFormula -from stormpy.logic.logic import TimeOperator -from stormpy.logic.logic import UnaryBooleanStateFormula -from stormpy.logic.logic import UnaryPathFormula -from stormpy.logic.logic import UnaryStateFormula -from stormpy.logic.logic import UntilFormula -from stormpy.pycarl import cln -from stormpy.pycarl.cln import FactorizedPolynomial -from stormpy.pycarl.cln import FactorizedRationalFunction -from stormpy.pycarl.cln import Polynomial -from stormpy.pycarl.cln import Rational as RationalRF -from stormpy.pycarl.cln import RationalFunction -from stormpy.pycarl import gmp -from stormpy.pycarl.gmp import Rational -from stormpy.storage import build_parametric_sparse_matrix -from stormpy.storage import build_sparse_matrix -from stormpy.storage import get_maximal_end_components -from stormpy.storage import storage -from stormpy.storage.storage import AddIterator_Sylvan_Double -from stormpy.storage.storage import Add_Sylvan_Double -from stormpy.storage.storage import Bdd_Sylvan -from stormpy.storage.storage import BitVector -from stormpy.storage.storage import ChoiceLabeling -from stormpy.storage.storage import ChoiceOrigins -from stormpy.storage.storage import DdManager_Sylvan -from stormpy.storage.storage import DdMetaVariableType -from stormpy.storage.storage import DdMetaVariable_Sylvan -from stormpy.storage.storage import Dd_Sylvan -from stormpy.storage.storage import DiceStringVisitor -from stormpy.storage.storage import Distribution -from stormpy.storage.storage import DistributionExact -from stormpy.storage.storage import DistributionInterval -from stormpy.storage.storage import ExactSparseMatrix -from stormpy.storage.storage import ExactSparseMatrixBuilder -from stormpy.storage.storage import ExactSparseMatrixEntry -from stormpy.storage.storage import ExactSparseMatrixRows -from stormpy.storage.storage import Expression -from stormpy.storage.storage import ExpressionManager -from stormpy.storage.storage import ExpressionParser -from stormpy.storage.storage import ExpressionType -from stormpy.storage.storage import IntervalSparseMatrix -from stormpy.storage.storage import IntervalSparseMatrixBuilder -from stormpy.storage.storage import IntervalSparseMatrixEntry -from stormpy.storage.storage import IntervalSparseMatrixRows -from stormpy.storage.storage import ItemLabeling -from stormpy.storage.storage import JaniAssignment -from stormpy.storage.storage import JaniAutomaton -from stormpy.storage.storage import JaniChoiceOrigins -from stormpy.storage.storage import JaniConstant -from stormpy.storage.storage import JaniEdge -from stormpy.storage.storage import JaniEdgeDestination -from stormpy.storage.storage import JaniInformationObject -from stormpy.storage.storage import JaniLocation -from stormpy.storage.storage import JaniLocationExpander -from stormpy.storage.storage import JaniModel -from stormpy.storage.storage import JaniOrderedAssignments -from stormpy.storage.storage import JaniScopeChanger -from stormpy.storage.storage import JaniTemplateEdge -from stormpy.storage.storage import JaniTemplateEdgeDestination -from stormpy.storage.storage import JaniVariable -from stormpy.storage.storage import JaniVariableSet -from stormpy.storage.storage import MaximalEndComponent -from stormpy.storage.storage import MaximalEndComponentDecomposition_double -from stormpy.storage.storage import MaximalEndComponentDecomposition_exact -from stormpy.storage.storage import MaximalEndComponentDecomposition_interval -from stormpy.storage.storage import MaximalEndComponentDecomposition_ratfunc -from stormpy.storage.storage import ModelType -from stormpy.storage.storage import OperatorType -from stormpy.storage.storage import OverlappingGuardAnalyser -from stormpy.storage.storage import ParametricSparseMatrix -from stormpy.storage.storage import ParametricSparseMatrixBuilder -from stormpy.storage.storage import ParametricSparseMatrixEntry -from stormpy.storage.storage import ParametricSparseMatrixRows -from stormpy.storage.storage import PolytopeDouble -from stormpy.storage.storage import PolytopeExact -from stormpy.storage.storage import PrismAssignment -from stormpy.storage.storage import PrismBooleanVariable -from stormpy.storage.storage import PrismChoiceOrigins -from stormpy.storage.storage import PrismCommand -from stormpy.storage.storage import PrismConstant -from stormpy.storage.storage import PrismIntegerVariable -from stormpy.storage.storage import PrismLabel -from stormpy.storage.storage import PrismModelType -from stormpy.storage.storage import PrismModule -from stormpy.storage.storage import PrismProgram -from stormpy.storage.storage import PrismRewardModel -from stormpy.storage.storage import PrismUpdate -from stormpy.storage.storage import PrismVariable -from stormpy.storage.storage import Scheduler -from stormpy.storage.storage import SchedulerChoice -from stormpy.storage.storage import SchedulerChoiceExact -from stormpy.storage.storage import SchedulerChoiceInterval -from stormpy.storage.storage import SchedulerChoiceParametric -from stormpy.storage.storage import SchedulerExact -from stormpy.storage.storage import SchedulerInterval -from stormpy.storage.storage import SchedulerParametric -from stormpy.storage.storage import SimpleValuation -from stormpy.storage.storage import SparseCtmc -from stormpy.storage.storage import SparseDtmc -from stormpy.storage.storage import SparseExactCtmc -from stormpy.storage.storage import SparseExactDtmc -from stormpy.storage.storage import SparseExactMA -from stormpy.storage.storage import SparseExactMdp -from stormpy.storage.storage import SparseExactModelAction -from stormpy.storage.storage import SparseExactModelActions -from stormpy.storage.storage import SparseExactModelComponents -from stormpy.storage.storage import SparseExactModelState -from stormpy.storage.storage import SparseExactModelStates -from stormpy.storage.storage import SparseExactPomdp -from stormpy.storage.storage import SparseExactRewardModel -from stormpy.storage.storage import SparseExactSmg -from stormpy.storage.storage import SparseIntervalCtmc -from stormpy.storage.storage import SparseIntervalDtmc -from stormpy.storage.storage import SparseIntervalMA -from stormpy.storage.storage import SparseIntervalMdp -from stormpy.storage.storage import SparseIntervalModelAction -from stormpy.storage.storage import SparseIntervalModelActions -from stormpy.storage.storage import SparseIntervalModelComponents -from stormpy.storage.storage import SparseIntervalModelState -from stormpy.storage.storage import SparseIntervalModelStates -from stormpy.storage.storage import SparseIntervalPomdp -from stormpy.storage.storage import SparseIntervalRewardModel -from stormpy.storage.storage import SparseIntervalSmg -from stormpy.storage.storage import SparseMA -from stormpy.storage.storage import SparseMatrix -from stormpy.storage.storage import SparseMatrixBuilder -from stormpy.storage.storage import SparseMatrixEntry -from stormpy.storage.storage import SparseMatrixRows -from stormpy.storage.storage import SparseMdp -from stormpy.storage.storage import SparseModelAction -from stormpy.storage.storage import SparseModelActions -from stormpy.storage.storage import SparseModelComponents -from stormpy.storage.storage import SparseModelState -from stormpy.storage.storage import SparseModelStates -from stormpy.storage.storage import SparseParametricCtmc -from stormpy.storage.storage import SparseParametricDtmc -from stormpy.storage.storage import SparseParametricMA -from stormpy.storage.storage import SparseParametricMdp -from stormpy.storage.storage import SparseParametricModelAction -from stormpy.storage.storage import SparseParametricModelActions -from stormpy.storage.storage import SparseParametricModelComponents -from stormpy.storage.storage import SparseParametricModelState -from stormpy.storage.storage import SparseParametricModelStates -from stormpy.storage.storage import SparseParametricPomdp -from stormpy.storage.storage import SparseParametricRewardModel -from stormpy.storage.storage import SparsePomdp -from stormpy.storage.storage import SparseRewardModel -from stormpy.storage.storage import SparseSmg -from stormpy.storage.storage import StateLabeling -from stormpy.storage.storage import StateValuation -from stormpy.storage.storage import StateValuationsBuilder -from stormpy.storage.storage import SymbolicSylvanCtmc -from stormpy.storage.storage import SymbolicSylvanDtmc -from stormpy.storage.storage import SymbolicSylvanMA -from stormpy.storage.storage import SymbolicSylvanMdp -from stormpy.storage.storage import SymbolicSylvanParametricCtmc -from stormpy.storage.storage import SymbolicSylvanParametricDtmc -from stormpy.storage.storage import SymbolicSylvanParametricMA -from stormpy.storage.storage import SymbolicSylvanParametricMdp -from stormpy.storage.storage import SymbolicSylvanParametricRewardModel -from stormpy.storage.storage import SymbolicSylvanRewardModel -from stormpy.storage.storage import Valuation -from stormpy.storage.storage import Variable -from stormpy.storage.storage import collect_information -from stormpy.storage.storage import eliminate_reward_accumulations -import sys as sys -from . import _config -from . import _version -from . import core -from . import exceptions -from . import pycarl -from . import utility -__all__ = ['ActionMaskDouble', 'AddIterator_Sylvan_Double', 'Add_Sylvan_Double', 'AtomicExpressionFormula', 'AtomicLabelFormula', 'Bdd_Sylvan', 'BinaryBooleanOperatorType', 'BinaryPathFormula', 'BinaryStateFormula', 'BisimulationType', 'BitVector', 'BooleanBinaryStateFormula', 'BooleanLiteralFormula', 'BoundedUntilFormula', 'BuilderOptions', 'CheckTask', 'ChoiceLabeling', 'ChoiceOrigins', 'ComparisonType', 'ConditionalFormula', 'ConstraintCollector', 'CumulativeRewardFormula', 'DdManager_Sylvan', 'DdMetaVariableType', 'DdMetaVariable_Sylvan', 'Dd_Sylvan', 'DiceStringVisitor', 'DirectEncodingOptions', 'DirectEncodingParserOptions', 'Distribution', 'DistributionExact', 'DistributionInterval', 'EliminationLabelBehavior', 'EndComponentEliminatorReturnTypeDouble', 'Environment', 'EquationSolverType', 'EventuallyFormula', 'ExactCheckTask', 'ExactSparseMatrix', 'ExactSparseMatrixBuilder', 'ExactSparseMatrixEntry', 'ExactSparseMatrixRows', 'ExplicitExactQuantitativeCheckResult', 'ExplicitModelBuilder', 'ExplicitModelCheckerHintDouble', 'ExplicitParametricModelBuilder', 'ExplicitParametricQuantitativeCheckResult', 'ExplicitParetoCurveCheckResultDouble', 'ExplicitQualitativeCheckResult', 'ExplicitQuantitativeCheckResult', 'ExplicitStateLookup', 'Expression', 'ExpressionManager', 'ExpressionParser', 'ExpressionType', 'FactorizedPolynomial', 'FactorizedRationalFunction', 'FlatSet', 'Formula', 'GameFormula', 'GloballyFormula', 'HybridExactQuantitativeCheckResult', 'HybridParametricQuantitativeCheckResult', 'HybridQuantitativeCheckResult', 'InstantaneousRewardFormula', 'IntervalSparseMatrix', 'IntervalSparseMatrixBuilder', 'IntervalSparseMatrixEntry', 'IntervalSparseMatrixRows', 'ItemLabeling', 'JaniAssignment', 'JaniAutomaton', 'JaniChoiceOrigins', 'JaniConstant', 'JaniEdge', 'JaniEdgeDestination', 'JaniInformationObject', 'JaniLocation', 'JaniLocationExpander', 'JaniModel', 'JaniModelType', 'JaniOrderedAssignments', 'JaniScopeChanger', 'JaniTemplateEdge', 'JaniTemplateEdgeDestination', 'JaniVariable', 'JaniVariableSet', 'LongRunAvarageOperator', 'LongRunAverageRewardFormula', 'MaximalEndComponent', 'MaximalEndComponentDecomposition_double', 'MaximalEndComponentDecomposition_exact', 'MaximalEndComponentDecomposition_interval', 'MaximalEndComponentDecomposition_ratfunc', 'MinMaxMethod', 'MinMaxSolverEnvironment', 'ModelCheckerHint', 'ModelFormulasPair', 'ModelType', 'MultiObjectiveFormula', 'NativeLinearEquationSolverMethod', 'NativeSolverEnvironment', 'OperatorFormula', 'OperatorType', 'OptimizationDirection', 'OverlappingGuardAnalyser', 'ParametricCheckTask', 'ParametricSparseMatrix', 'ParametricSparseMatrixBuilder', 'ParametricSparseMatrixEntry', 'ParametricSparseMatrixRows', 'ParetoCurveCheckResultDouble', 'PathFormula', 'Polynomial', 'PolytopeDouble', 'PolytopeExact', 'PrismAssignment', 'PrismBooleanVariable', 'PrismChoiceOrigins', 'PrismCommand', 'PrismConstant', 'PrismIntegerVariable', 'PrismLabel', 'PrismModelType', 'PrismModule', 'PrismProgram', 'PrismRewardModel', 'PrismUpdate', 'PrismVariable', 'ProbabilityOperator', 'Property', 'QuotientFormat', 'Rational', 'RationalFunction', 'RationalRF', 'RewardOperator', 'SMTCounterExampleGenerator', 'SMTCounterExampleGeneratorOptions', 'SMTCounterExampleGeneratorStats', 'SMTCounterExampleInput', 'Scheduler', 'SchedulerChoice', 'SchedulerChoiceExact', 'SchedulerChoiceInterval', 'SchedulerChoiceParametric', 'SchedulerExact', 'SchedulerInterval', 'SchedulerParametric', 'SimpleValuation', 'SolverEnvironment', 'SparseCtmc', 'SparseDtmc', 'SparseExactCtmc', 'SparseExactDtmc', 'SparseExactMA', 'SparseExactMdp', 'SparseExactModelAction', 'SparseExactModelActions', 'SparseExactModelComponents', 'SparseExactModelState', 'SparseExactModelStates', 'SparseExactPomdp', 'SparseExactRewardModel', 'SparseExactSmg', 'SparseIntervalCtmc', 'SparseIntervalDtmc', 'SparseIntervalMA', 'SparseIntervalMdp', 'SparseIntervalModelAction', 'SparseIntervalModelActions', 'SparseIntervalModelComponents', 'SparseIntervalModelState', 'SparseIntervalModelStates', 'SparseIntervalPomdp', 'SparseIntervalRewardModel', 'SparseIntervalSmg', 'SparseMA', 'SparseMatrix', 'SparseMatrixBuilder', 'SparseMatrixEntry', 'SparseMatrixRows', 'SparseMdp', 'SparseModelAction', 'SparseModelActions', 'SparseModelComponents', 'SparseModelState', 'SparseModelStates', 'SparseParametricCtmc', 'SparseParametricDtmc', 'SparseParametricMA', 'SparseParametricMdp', 'SparseParametricModelAction', 'SparseParametricModelActions', 'SparseParametricModelComponents', 'SparseParametricModelState', 'SparseParametricModelStates', 'SparseParametricPomdp', 'SparseParametricRewardModel', 'SparsePomdp', 'SparseRewardModel', 'SparseSmg', 'StateFormula', 'StateLabeling', 'StateValuation', 'StateValuationFunctionActionMaskDouble', 'StateValuationsBuilder', 'StormError', 'SubsystemBuilderOptions', 'SubsystemBuilderReturnTypeDouble', 'SubsystemBuilderReturnTypeExact', 'SubsystemBuilderReturnTypeRatFunc', 'SymbolicExactQuantitativeCheckResult', 'SymbolicModelDescription', 'SymbolicParametricQuantitativeCheckResult', 'SymbolicQualitativeCheckResult', 'SymbolicQuantitativeCheckResult', 'SymbolicSylvanCtmc', 'SymbolicSylvanDtmc', 'SymbolicSylvanMA', 'SymbolicSylvanMdp', 'SymbolicSylvanParametricCtmc', 'SymbolicSylvanParametricDtmc', 'SymbolicSylvanParametricMA', 'SymbolicSylvanParametricMdp', 'SymbolicSylvanParametricRewardModel', 'SymbolicSylvanRewardModel', 'TimeOperator', 'UnaryBooleanStateFormula', 'UnaryPathFormula', 'UnaryStateFormula', 'UntilFormula', 'Valuation', 'Variable', 'build_interval_model_from_drn', 'build_model', 'build_model_from_drn', 'build_parametric_model', 'build_parametric_model_from_drn', 'build_parametric_sparse_matrix', 'build_sparse_exact_model_with_options', 'build_sparse_matrix', 'build_sparse_model', 'build_sparse_model_from_explicit', 'build_sparse_model_with_options', 'build_sparse_parametric_model', 'build_sparse_parametric_model_with_options', 'build_symbolic_model', 'build_symbolic_parametric_model', 'check_interval_mdp', 'check_model_dd', 'check_model_hybrid', 'check_model_sparse', 'cln', 'collect_information', 'compute_all_until_probabilities', 'compute_expected_number_of_visits', 'compute_prob01_states', 'compute_prob01max_states', 'compute_prob01min_states', 'compute_steady_state_distribution', 'compute_transient_probabilities', 'construct_submodel', 'core', 'create_filter_initial_states_sparse', 'create_filter_initial_states_symbolic', 'create_filter_symbolic', 'eliminate_ECs', 'eliminate_non_markovian_chains', 'eliminate_reward_accumulations', 'exceptions', 'export_to_drn', 'get_maximal_end_components', 'get_reachable_states', 'gmp', 'install_signal_handlers', 'logic', 'make_sparse_model_builder', 'make_sparse_model_builder_exact', 'make_sparse_model_builder_parametric', 'model_checking', 'parse_constants_string', 'parse_jani_model', 'parse_jani_model_from_string', 'parse_prism_program', 'parse_properties', 'parse_properties_for_jani_model', 'parse_properties_for_prism_program', 'parse_properties_without_context', 'perform_bisimulation', 'perform_sparse_bisimulation', 'perform_symbolic_bisimulation', 'preprocess_symbolic_input', 'prob01max_states', 'prob01min_states', 'pycarl', 'reset_timeout', 'set_loglevel_debug', 'set_loglevel_error', 'set_loglevel_trace', 'set_settings', 'set_timeout', 'storage', 'storm_with_dft', 'storm_with_gspn', 'storm_with_pars', 'storm_with_pomdp', 'storm_with_spot', 'storm_with_xerces', 'stormpy', 'sys', 'topological_sort', 'transform_to_discrete_time_model', 'transform_to_sparse_model', 'utility'] -def _convert_sparse_model(model, parametric = False): - """ - - Convert (parametric) model in sparse representation into model corresponding to exact model type. - :param model: Sparse model. - :param parametric: Flag indicating if the model is parametric. - :return: Model corresponding to exact model type. - - """ -def _convert_symbolic_model(model, parametric = False): - """ - - Convert (parametric) model in symbolic representation into model corresponding to exact model type. - :param model: Symbolic model. - :param parametric: Flag indicating if the model is parametric. - :return: Model corresponding to exact model type. - - """ -def build_interval_model_from_drn(file, options = ...): - """ - - Build an interval model in sparse representation from the explicit DRN representation. - - :param String file: DRN file containing the model. - :param DirectEncodingParserOptions: Options for the parser. - :return: Interval model in sparse representation. - - """ -def build_model(symbolic_description, properties = None): - """ - - Build a model in sparse representation from a symbolic description. - - :param symbolic_description: Symbolic model description to translate into a model. - :param List[Property] properties: List of properties that should be preserved during the translation. If None, then all properties are preserved. - :return: Model in sparse representation. - - """ -def build_model_from_drn(file, options = ...): - """ - - Build a model in sparse representation from the explicit DRN representation. - - :param String file: DRN file containing the model. - :param DirectEncodingParserOptions: Options for the parser. - :return: Model in sparse representation. - - """ -def build_parametric_model(symbolic_description, properties = None): - """ - - Build a parametric model in sparse representation from a symbolic description. - - :param symbolic_description: Symbolic model description to translate into a model. - :param List[Property] properties: List of properties that should be preserved during the translation. If None, then all properties are preserved. - :return: Parametric model in sparse representation. - - """ -def build_parametric_model_from_drn(file, options = ...): - """ - - Build a parametric model in sparse representation from the explicit DRN representation. - - :param String file: DRN file containing the model. - :param DirectEncodingParserOptions: Options for the parser. - :return: Parametric model in sparse representation. - - """ -def build_sparse_model(symbolic_description, properties = None): - """ - - Build a model in sparse representation from a symbolic description. - - :param symbolic_description: Symbolic model description to translate into a model. - :param List[Property] properties: List of properties that should be preserved during the translation. If None, then all properties are preserved. - :return: Model in sparse representation. - - """ -def build_sparse_parametric_model(symbolic_description, properties = None): - """ - - Build a parametric model in sparse representation from a symbolic description. - - :param symbolic_description: Symbolic model description to translate into a model. - :param List[Property] properties: List of properties that should be preserved during the translation. If None, then all properties are preserved. - :return: Parametric model in sparse representation. - - """ -def build_symbolic_model(symbolic_description, properties = None): - """ - - Build a model in symbolic representation from a symbolic description. - - :param symbolic_description: Symbolic model description to translate into a model. - :param List[Property] properties: List of properties that should be preserved during the translation. If None, then all properties are preserved. - :return: Model in symbolic representation. - - """ -def build_symbolic_parametric_model(symbolic_description, properties = None): - """ - - Build a parametric model in symbolic representation from a symbolic description. - - :param symbolic_description: Symbolic model description to translate into a model. - :param List[Property] properties: List of properties that should be preserved during the translation. If None, then all properties are preserved. - :return: Parametric model in symbolic representation. - - """ -def check_model_dd(model, property, only_initial_states = False, environment = ...): - """ - - Perform model checking using dd engine. - :param model: Model. - :param property: Property to check for. - :param only_initial_states: If True, only results for initial states are computed, otherwise for all states. - :return: Model checking result. - :rtype: CheckResult - - """ -def check_model_hybrid(model, property, only_initial_states = False, environment = ...): - """ - - Perform model checking using hybrid engine. - :param model: Model. - :param property: Property to check for. - :param only_initial_states: If True, only results for initial states are computed, otherwise for all states. - :return: Model checking result. - :rtype: CheckResult - - """ -def check_model_sparse(model, property, only_initial_states = False, extract_scheduler = False, force_fully_observable = False, hint = None, environment = ...): - """ - - Perform model checking on model for property. - :param model: Model. - :param property: Property to check for. - :param only_initial_states: If True, only results for initial states are computed, otherwise for all states. - :param extract_scheduler: If True, try to extract a scheduler - :param hint: If not None, this hint is used by the model checker - :param force_fully_observable: If True, treat a POMDP as an MDP - :return: Model checking result. - :rtype: CheckResult - - """ -def compute_expected_number_of_visits(environment, model): - """ - - Compute the number of expected visits. Model must be deterministic. - - :param environment: An model checking environment - :param model: A DTMC or CTMC - :return: A vector with the expected number of visits - - """ -def compute_prob01_states(model, phi_states, psi_states): - """ - - Compute prob01 states for properties of the form phi_states until psi_states - - :param SparseDTMC model: - :param BitVector phi_states: - :param BitVector psi_states: Target states - - """ -def compute_prob01max_states(model, phi_states, psi_states): - ... -def compute_prob01min_states(model, phi_states, psi_states): - ... -def compute_steady_state_distribution(environment, model): - """ - - Compute the steady-state (aka stationary) distribution. Model must be deterministic. - - :param environment: A model checking environment - :param model: A DTMC or CTMC - :return: A vector with the steady-state distribution - - """ -def construct_submodel(model, states, actions, keep_unreachable_states = True, options = ...): - """ - - - :param model: The model - :param states: Which states should be preserved - :param actions: Which actions should be preserved - :param keep_unreachable_states: If False, run a reachability analysis. - :param options: An options object of type SubsystemBuilderOptions - :return: A model with fewer states/actions - - """ -def eliminate_ECs(matrix, subsystem, possible_ecs, add_sink_row_states, add_self_loop_at_sink_states = False): - """ - - For each such EC (that is not contained in another EC), we add a new state and redirect all incoming and outgoing - transitions of the EC to (and from) this state. - - :param matrix: - :param subsystem: BitVector with states many entries. Only states in the given subsystem are kept. Transitions leading to a state outside of the subsystem will be - removed (but the corresponding row is kept, possibly yielding empty rows). - The ECs are then identified on the subsystem. - :param possible_ecs: BitVector with rows many entries. Only ECs for which possible_ecs is true for all choices are considered. - Furthermore, the rows that contain a transition leading outside of the subsystem are not considered for an EC. - :param add_sink_row_states: BitVector with states many entries. If add_sink_row_states is true for at least one state of an eliminated EC, a row is added to the new state (representing the choice to stay at the EC forever). - :param add_self_loop_at_sink_states: if true, such rows get a selfloop (with value 1). Otherwise, the row remains empty. - :return: A container with various information. - - """ -def eliminate_non_markovian_chains(ma, properties, label_behavior): - """ - - Eliminate chains of non-Markovian states if possible. - :param ma: Markov automaton. - :param properties: List of properties to transform as well. - :param label_behavior: Behavior of labels while elimination. - :return: Tuple (converted MA, converted properties). - - """ -def export_to_drn(model, file, options = ...): - """ - - Export a model to DRN format - :param model: The model - :param file: A path - :param options: DirectEncodingOptions - :return: - - """ -def get_reachable_states(model, initial_states, constraint_states, target_states, maximal_steps = None, choice_filter = None): - """ - - Get the states that are reachable in a sparse model - - :param model: A model - :param initial_states: Which states should be definitively reachable - :param constraint_states: - :param target_states: Which states should be considered absorbing - :param maximal_steps: The maximal depth to explore - :param choice_filter: - :return: - - """ -def model_checking(model, property, only_initial_states = False, extract_scheduler = False, force_fully_observable = False, environment = ...): - """ - - Perform model checking on model for property. - :param model: Model. - :param property: Property to check for. - :param only_initial_states: If True, only results for initial states are computed, otherwise for all states. - :param extract_scheduler: If True, try to extract a scheduler - :return: Model checking result. - :rtype: CheckResult - - """ -def parse_properties(properties, context = None, filters = None): - """ - - - :param properties: A string with the pctl properties - :param context: A symbolic model that gives meaning to variables and constants. - :param filters: filters, if applicable. - :return: A list of properties - - """ -def perform_bisimulation(model, properties, bisimulation_type): - """ - - Perform bisimulation on model. - :param model: Model. - :param properties: Properties to preserve during bisimulation. - :param bisimulation_type: Type of bisimulation (weak or strong). - :return: Model after bisimulation. - - """ -def perform_sparse_bisimulation(model, properties, bisimulation_type): - """ - - Perform bisimulation on model in sparse representation. - :param model: Model. - :param properties: Properties to preserve during bisimulation. - :param bisimulation_type: Type of bisimulation (weak or strong). - :return: Model after bisimulation. - - """ -def perform_symbolic_bisimulation(model, properties, quotient_format = ...): - """ - - Perform bisimulation on model in symbolic representation. - :param model: Model. - :param properties: Properties to preserve during bisimulation. - :param quotient_format: Return format of quotient. - :return: Model after bisimulation. - - """ -def prob01max_states(model, eventually_formula): - ... -def prob01min_states(model, eventually_formula): - ... -def topological_sort(model, forward = True, initial = list()): - """ - - - :param model: A sparse model - :param forward: A flag whether the sorting should be forward or backwards - :param initial: a list of states - :return: A topological sort of the states - - """ -def transform_to_discrete_time_model(model, properties): - """ - - Transform continuous-time model to discrete time model. - :param model: Continuous-time model. - :param properties: List of properties to transform as well. - :return: Tuple (Discrete-time model, converted properties). - - """ -def transform_to_sparse_model(model): - """ - - Transform model in symbolic representation into model in sparse representation. - :param model: Symbolic model. - :return: Sparse model. - - """ -__version__: str = '1.9.0' -storm_with_dft: bool = True -storm_with_gspn: bool = True -storm_with_pars: bool = True -storm_with_pomdp: bool = True -storm_with_spot: bool = False -storm_with_xerces: bool = True -stormpy = diff --git a/lib/stormpy/_config.pyi b/lib/stormpy/_config.pyi deleted file mode 100644 index 2b6d1a7136..0000000000 --- a/lib/stormpy/_config.pyi +++ /dev/null @@ -1,17 +0,0 @@ -from __future__ import annotations -from stormpy import pycarl -from stormpy.pycarl import cln -from stormpy.pycarl.cln import FactorizedPolynomial -from stormpy.pycarl.cln import FactorizedRationalFunction -from stormpy.pycarl.cln import Polynomial -from stormpy.pycarl.cln import Rational as RationalRF -from stormpy.pycarl.cln import RationalFunction -from stormpy.pycarl import gmp -from stormpy.pycarl.gmp import Rational -__all__ = ['FactorizedPolynomial', 'FactorizedRationalFunction', 'Polynomial', 'Rational', 'RationalFunction', 'RationalRF', 'cln', 'gmp', 'pycarl', 'storm_with_dft', 'storm_with_gspn', 'storm_with_pars', 'storm_with_pomdp', 'storm_with_spot', 'storm_with_xerces'] -storm_with_dft: bool = True -storm_with_gspn: bool = True -storm_with_pars: bool = True -storm_with_pomdp: bool = True -storm_with_spot: bool = False -storm_with_xerces: bool = True diff --git a/lib/stormpy/_version.pyi b/lib/stormpy/_version.pyi deleted file mode 100644 index f8cfb36777..0000000000 --- a/lib/stormpy/_version.pyi +++ /dev/null @@ -1,3 +0,0 @@ -from __future__ import annotations -__all__ = list() -__version__: str = '1.9.0' diff --git a/lib/stormpy/core.pyi b/lib/stormpy/core.pyi deleted file mode 100644 index 79872764ed..0000000000 --- a/lib/stormpy/core.pyi +++ /dev/null @@ -1,1547 +0,0 @@ -""" -core -""" -from __future__ import annotations -import stormpy.pycarl.cln -import stormpy.pycarl.gmp -import typing -__all__ = ['ActionMaskDouble', 'BisimulationType', 'BuilderOptions', 'CheckTask', 'ConstraintCollector', 'DirectEncodingOptions', 'DirectEncodingParserOptions', 'EliminationLabelBehavior', 'EndComponentEliminatorReturnTypeDouble', 'Environment', 'EquationSolverType', 'ExactCheckTask', 'ExplicitExactQuantitativeCheckResult', 'ExplicitModelBuilder', 'ExplicitModelCheckerHintDouble', 'ExplicitParametricModelBuilder', 'ExplicitParametricQuantitativeCheckResult', 'ExplicitParetoCurveCheckResultDouble', 'ExplicitQualitativeCheckResult', 'ExplicitQuantitativeCheckResult', 'ExplicitStateLookup', 'FlatSet', 'HybridExactQuantitativeCheckResult', 'HybridParametricQuantitativeCheckResult', 'HybridQuantitativeCheckResult', 'JaniModelType', 'MinMaxMethod', 'MinMaxSolverEnvironment', 'ModelCheckerHint', 'ModelFormulasPair', 'NativeLinearEquationSolverMethod', 'NativeSolverEnvironment', 'OptimizationDirection', 'ParametricCheckTask', 'ParetoCurveCheckResultDouble', 'Property', 'QuotientFormat', 'SMTCounterExampleGenerator', 'SMTCounterExampleGeneratorOptions', 'SMTCounterExampleGeneratorStats', 'SMTCounterExampleInput', 'SolverEnvironment', 'StateValuationFunctionActionMaskDouble', 'SubsystemBuilderOptions', 'SubsystemBuilderReturnTypeDouble', 'SubsystemBuilderReturnTypeExact', 'SubsystemBuilderReturnTypeRatFunc', 'SymbolicExactQuantitativeCheckResult', 'SymbolicModelDescription', 'SymbolicParametricQuantitativeCheckResult', 'SymbolicQualitativeCheckResult', 'SymbolicQuantitativeCheckResult', 'build_sparse_exact_model_with_options', 'build_sparse_model_from_explicit', 'build_sparse_model_with_options', 'build_sparse_parametric_model_with_options', 'check_interval_mdp', 'compute_all_until_probabilities', 'compute_transient_probabilities', 'create_filter_initial_states_sparse', 'create_filter_initial_states_symbolic', 'create_filter_symbolic', 'install_signal_handlers', 'make_sparse_model_builder', 'make_sparse_model_builder_exact', 'make_sparse_model_builder_parametric', 'parse_constants_string', 'parse_jani_model', 'parse_jani_model_from_string', 'parse_prism_program', 'parse_properties_for_jani_model', 'parse_properties_for_prism_program', 'parse_properties_without_context', 'preprocess_symbolic_input', 'reset_timeout', 'set_loglevel_debug', 'set_loglevel_error', 'set_loglevel_trace', 'set_settings', 'set_timeout'] -class ActionMaskDouble: - pass -class BisimulationType: - """ - Types of bisimulation - - Members: - - STRONG - - WEAK - """ - STRONG: typing.ClassVar[BisimulationType] # value = - WEAK: typing.ClassVar[BisimulationType] # value = - __members__: typing.ClassVar[dict[str, BisimulationType]] # value = {'STRONG': , 'WEAK': } - def __eq__(self, other: typing.Any) -> bool: - ... - def __getstate__(self) -> int: - ... - def __hash__(self) -> int: - ... - def __index__(self) -> int: - ... - def __init__(self, value: int) -> None: - ... - def __int__(self) -> int: - ... - def __ne__(self, other: typing.Any) -> bool: - ... - def __repr__(self) -> str: - ... - def __setstate__(self, state: int) -> None: - ... - def __str__(self) -> str: - ... - @property - def name(self) -> str: - ... - @property - def value(self) -> int: - ... -class BuilderOptions: - """ - Options for building process - """ - @typing.overload - def __init__(self, formulae: list[...]) -> None: - """ - Initialise with formulae to preserve - """ - @typing.overload - def __init__(self, build_all_reward_models: bool = True, build_all_labels: bool = True) -> None: - """ - Initialise without formulae - """ - def set_add_out_of_bounds_state(self, new_value: bool = True) -> BuilderOptions: - """ - Build with out of bounds state - """ - def set_add_overlapping_guards_label(self, new_value: bool = True) -> BuilderOptions: - """ - Build with overlapping guards state labeled - """ - def set_build_all_labels(self, new_value: bool = True) -> BuilderOptions: - """ - Build with all state labels - """ - def set_build_all_reward_models(self, new_value: bool = True) -> BuilderOptions: - """ - Build with all reward models - """ - def set_build_choice_labels(self, new_value: bool = True) -> BuilderOptions: - """ - Build with choice labels - """ - def set_build_observation_valuations(self, new_value: bool = True) -> BuilderOptions: - """ - Build observation valuations - """ - def set_build_state_valuations(self, new_value: bool = True) -> BuilderOptions: - """ - Build state valuations - """ - def set_build_with_choice_origins(self, new_value: bool = True) -> BuilderOptions: - """ - Build choice origins - """ - def set_exploration_checks(self, new_value: bool = True) -> BuilderOptions: - """ - Perform extra checks during exploration - """ - @property - def preserved_label_names(self) -> set[str]: - """ - Labels preserved - """ -class CheckTask: - """ - Task for model checking - """ - def __init__(self, formula: ..., only_initial_states: bool = False) -> None: - ... - def set_hint(self, arg0: ...) -> None: - """ - Sets a hint that may speed up the solver - """ - def set_produce_schedulers(self, produce_schedulers: bool = True) -> None: - """ - Set whether schedulers should be produced (if possible) - """ - def set_robust_uncertainty(self, arg0: bool) -> None: - """ - Sets whether robust uncertainty should be considered - """ -class ConstraintCollector: - """ - Collector for constraints on parametric Markov chains - """ - @staticmethod - def __init__(*args, **kwargs) -> None: - ... - @property - def graph_preserving_constraints(self) -> set[..., ..., ...]: - """ - Get the constraints ensuring the graph is preserved - """ - @property - def wellformed_constraints(self) -> set[..., ..., ...]: - """ - Get the constraints ensuring a wellformed model - """ -class DirectEncodingOptions: - allow_placeholders: bool - def __init__(self) -> None: - ... -class DirectEncodingParserOptions: - """ - Options for the .drn parser - """ - def __init__(self) -> None: - """ - initialise - """ - @property - def build_choice_labels(self) -> bool: - """ - Build with choice labels - """ - @build_choice_labels.setter - def build_choice_labels(self, arg0: bool) -> None: - ... -class EliminationLabelBehavior: - """ - Behavior of labels while eliminating non-Markovian chains - - Members: - - KEEP_LABELS - - MERGE_LABELS - - DELETE_LABELS - """ - DELETE_LABELS: typing.ClassVar[EliminationLabelBehavior] # value = - KEEP_LABELS: typing.ClassVar[EliminationLabelBehavior] # value = - MERGE_LABELS: typing.ClassVar[EliminationLabelBehavior] # value = - __members__: typing.ClassVar[dict[str, EliminationLabelBehavior]] # value = {'KEEP_LABELS': , 'MERGE_LABELS': , 'DELETE_LABELS': } - def __eq__(self, other: typing.Any) -> bool: - ... - def __getstate__(self) -> int: - ... - def __hash__(self) -> int: - ... - def __index__(self) -> int: - ... - def __init__(self, value: int) -> None: - ... - def __int__(self) -> int: - ... - def __ne__(self, other: typing.Any) -> bool: - ... - def __repr__(self) -> str: - ... - def __setstate__(self, state: int) -> None: - ... - def __str__(self) -> str: - ... - @property - def name(self) -> str: - ... - @property - def value(self) -> int: - ... -class EndComponentEliminatorReturnTypeDouble: - """ - Container for result of endcomponent elimination - """ - @property - def matrix(self) -> ...: - """ - The resulting matrix - """ - @property - def new_to_old_row_mapping(self) -> list[int]: - """ - Index mapping that gives for each row fo the new matrix the corresponding row in the original matrix - """ - @property - def old_to_new_state_mapping(self) -> list[int]: - """ - For each state of the original matrix (and subsystem) the corresponding state in the result. Removed states are mapped to the EC. - """ - @property - def sink_rows(self) -> ...: - """ - Rows that indicate staying in the EC forever - """ -class Environment: - """ - Environment - """ - def __init__(self) -> None: - """ - Construct default environment - """ - @property - def solver_environment(self) -> ...: - """ - solver part of environment - """ -class EquationSolverType: - """ - Solver type for equation systems - - Members: - - native - - eigen - - elimination - - gmmxx - - topological - """ - __members__: typing.ClassVar[dict[str, EquationSolverType]] # value = {'native': , 'eigen': , 'elimination': , 'gmmxx': , 'topological': } - eigen: typing.ClassVar[EquationSolverType] # value = - elimination: typing.ClassVar[EquationSolverType] # value = - gmmxx: typing.ClassVar[EquationSolverType] # value = - native: typing.ClassVar[EquationSolverType] # value = - topological: typing.ClassVar[EquationSolverType] # value = - def __eq__(self, other: typing.Any) -> bool: - ... - def __getstate__(self) -> int: - ... - def __hash__(self) -> int: - ... - def __index__(self) -> int: - ... - def __init__(self, value: int) -> None: - ... - def __int__(self) -> int: - ... - def __ne__(self, other: typing.Any) -> bool: - ... - def __repr__(self) -> str: - ... - def __setstate__(self, state: int) -> None: - ... - def __str__(self) -> str: - ... - @property - def name(self) -> str: - ... - @property - def value(self) -> int: - ... -class ExactCheckTask: - """ - Task for model checking with exact numbers - """ - def __init__(self, formula: ..., only_initial_states: bool = False) -> None: - ... - def set_produce_schedulers(self, produce_schedulers: bool = True) -> None: - """ - Set whether schedulers should be produced (if possible) - """ -class ExplicitExactQuantitativeCheckResult(_ExactQuantitativeCheckResult): - """ - Explicit exact quantitative model checking result - """ - def __init__(self, values: list[stormpy.pycarl.gmp.Rational]) -> None: - ... - def at(self, state: int) -> stormpy.pycarl.gmp.Rational: - """ - Get result for given state - """ - def get_values(self) -> list[stormpy.pycarl.gmp.Rational]: - """ - Get model checking result values for all states - """ - @property - def scheduler(self) -> ...: - """ - get scheduler - """ -class ExplicitModelBuilder: - """ - Model builder for sparse models - """ - def build(self) -> ...: - """ - Build the model - """ - def export_lookup(self) -> ...: - """ - Export a lookup model - """ -class ExplicitModelCheckerHintDouble(ModelCheckerHint): - """ - Information that may accelerate an explicit state model checker - """ - def __init__(self) -> None: - ... - def set_compute_only_maybe_states(self, arg0: bool) -> None: - """ - value - """ - def set_maybe_states(self, arg0: ...) -> None: - """ - sets the maybe states. This is assumed to be correct. - """ - def set_result_hint(self, result_hint: list[float] | None) -> None: - ... - def set_scheduler_hint(self, scheduler_hint: ... | None) -> None: - """ - Set a scheduler that is close to the optimal scheduler - """ -class ExplicitParametricModelBuilder: - """ - Model builder for sparse models - """ - def build(self) -> ...: - """ - Build the model - """ - def export_lookup(self) -> ...: - """ - Export a lookup model - """ -class ExplicitParametricQuantitativeCheckResult(_ParametricQuantitativeCheckResult): - """ - Explicit parametric quantitative model checking result - """ - def at(self, state: int) -> stormpy.pycarl.cln.FactorizedRationalFunction: - """ - Get result for given state - """ - def get_values(self) -> list[stormpy.pycarl.cln.FactorizedRationalFunction]: - """ - Get model checking result values for all states - """ - @property - def scheduler(self) -> ...: - """ - get scheduler - """ -class ExplicitParetoCurveCheckResultDouble(ParetoCurveCheckResultDouble): - """ - Result for explicit multiobjective model checking - """ -class ExplicitQualitativeCheckResult(_QualitativeCheckResult): - """ - Explicit qualitative model checking result - """ - def at(self, state: int) -> bool: - """ - Get result for given state - """ - def get_truth_values(self) -> ...: - """ - Get BitVector representing the truth values - """ -class ExplicitQuantitativeCheckResult(_QuantitativeCheckResult): - """ - Explicit quantitative model checking result - """ - def __init__(self, values: list[float]) -> None: - ... - def at(self, state: int) -> float: - """ - Get result for given state - """ - def get_values(self) -> list[float]: - """ - Get model checking result values for all states - """ - @property - def scheduler(self) -> ...: - """ - get scheduler - """ -class ExplicitStateLookup: - """ - Lookup model for states - """ - def lookup(self, state_description: dict[..., ...]) -> typing.Any: - ... -class FlatSet: - """ - Container to pass to program - """ - @typing.overload - def __init__(self) -> None: - ... - @typing.overload - def __init__(self, other: FlatSet) -> None: - ... - def __iter__(self) -> typing.Iterator: - ... - def __len__(self) -> int: - ... - def __str__(self) -> str: - ... - def insert(self, arg0: int) -> None: - ... - def insert_set(self, arg0: FlatSet) -> None: - ... - def is_subset_of(self, arg0: FlatSet) -> bool: - ... -class HybridExactQuantitativeCheckResult(_QuantitativeCheckResult): - """ - Symbolic exact hybrid quantitative model checking result - """ - def get_values(self) -> list[stormpy.pycarl.gmp.Rational]: - """ - Get model checking result values for all states - """ -class HybridParametricQuantitativeCheckResult(_QuantitativeCheckResult): - """ - Symbolic parametric hybrid quantitative model checking result - """ - def get_values(self) -> list[stormpy.pycarl.cln.FactorizedRationalFunction]: - """ - Get model checking result values for all states - """ -class HybridQuantitativeCheckResult(_QuantitativeCheckResult): - """ - Hybrid quantitative model checking result - """ - def get_values(self) -> list[float]: - """ - Get model checking result values for all states - """ -class JaniModelType: - """ - Type of the Jani model - - Members: - - DTMC - - CTMC - - MDP - - CTMDP - - MA - - LTS - - TA - - PTA - - STA - - HA - - PHA - - SHA - - UNDEFINED - """ - CTMC: typing.ClassVar[JaniModelType] # value = - CTMDP: typing.ClassVar[JaniModelType] # value = - DTMC: typing.ClassVar[JaniModelType] # value = - HA: typing.ClassVar[JaniModelType] # value = - LTS: typing.ClassVar[JaniModelType] # value = - MA: typing.ClassVar[JaniModelType] # value = - MDP: typing.ClassVar[JaniModelType] # value = - PHA: typing.ClassVar[JaniModelType] # value = - PTA: typing.ClassVar[JaniModelType] # value = - SHA: typing.ClassVar[JaniModelType] # value = - STA: typing.ClassVar[JaniModelType] # value = - TA: typing.ClassVar[JaniModelType] # value = - UNDEFINED: typing.ClassVar[JaniModelType] # value = - __members__: typing.ClassVar[dict[str, JaniModelType]] # value = {'DTMC': , 'CTMC': , 'MDP': , 'CTMDP': , 'MA': , 'LTS': , 'TA': , 'PTA': , 'STA': , 'HA': , 'PHA': , 'SHA': , 'UNDEFINED': } - def __eq__(self, other: typing.Any) -> bool: - ... - def __getstate__(self) -> int: - ... - def __hash__(self) -> int: - ... - def __index__(self) -> int: - ... - def __init__(self, value: int) -> None: - ... - def __int__(self) -> int: - ... - def __ne__(self, other: typing.Any) -> bool: - ... - def __repr__(self) -> str: - ... - def __setstate__(self, state: int) -> None: - ... - def __str__(self) -> str: - ... - @property - def name(self) -> str: - ... - @property - def value(self) -> int: - ... -class MinMaxMethod: - """ - Method for min-max equation systems - - Members: - - policy_iteration - - value_iteration - - linear_programming - - topological - - rational_search - - interval_iteration - - sound_value_iteration - - optimistic_value_iteration - """ - __members__: typing.ClassVar[dict[str, MinMaxMethod]] # value = {'policy_iteration': , 'value_iteration': , 'linear_programming': , 'topological': , 'rational_search': , 'interval_iteration': , 'sound_value_iteration': , 'optimistic_value_iteration': } - interval_iteration: typing.ClassVar[MinMaxMethod] # value = - linear_programming: typing.ClassVar[MinMaxMethod] # value = - optimistic_value_iteration: typing.ClassVar[MinMaxMethod] # value = - policy_iteration: typing.ClassVar[MinMaxMethod] # value = - rational_search: typing.ClassVar[MinMaxMethod] # value = - sound_value_iteration: typing.ClassVar[MinMaxMethod] # value = - topological: typing.ClassVar[MinMaxMethod] # value = - value_iteration: typing.ClassVar[MinMaxMethod] # value = - def __eq__(self, other: typing.Any) -> bool: - ... - def __getstate__(self) -> int: - ... - def __hash__(self) -> int: - ... - def __index__(self) -> int: - ... - def __init__(self, value: int) -> None: - ... - def __int__(self) -> int: - ... - def __ne__(self, other: typing.Any) -> bool: - ... - def __repr__(self) -> str: - ... - def __setstate__(self, state: int) -> None: - ... - def __str__(self) -> str: - ... - @property - def name(self) -> str: - ... - @property - def value(self) -> int: - ... -class MinMaxSolverEnvironment: - """ - Environment for Min-Max-Solvers - """ - method: MinMaxMethod - precision: stormpy.pycarl.gmp.Rational -class ModelCheckerHint: - """ - Information that may accelerate the model checking process - """ -class ModelFormulasPair: - """ - Pair of model and formulas - """ - @property - def formulas(self) -> list[...]: - """ - The formulas - """ - @property - def model(self) -> ...: - """ - The model - """ -class NativeLinearEquationSolverMethod: - """ - Method for linear equation systems with the native solver - - Members: - - power_iteration - - sound_value_iteration - - optimistic_value_iteration - - interval_iteration - - rational_search - - jacobi - - SOR - - gauss_seidel - - walker_chae - """ - SOR: typing.ClassVar[NativeLinearEquationSolverMethod] # value = - __members__: typing.ClassVar[dict[str, NativeLinearEquationSolverMethod]] # value = {'power_iteration': , 'sound_value_iteration': , 'optimistic_value_iteration': , 'interval_iteration': , 'rational_search': , 'jacobi': , 'SOR': , 'gauss_seidel': , 'walker_chae': } - gauss_seidel: typing.ClassVar[NativeLinearEquationSolverMethod] # value = - interval_iteration: typing.ClassVar[NativeLinearEquationSolverMethod] # value = - jacobi: typing.ClassVar[NativeLinearEquationSolverMethod] # value = - optimistic_value_iteration: typing.ClassVar[NativeLinearEquationSolverMethod] # value = - power_iteration: typing.ClassVar[NativeLinearEquationSolverMethod] # value = - rational_search: typing.ClassVar[NativeLinearEquationSolverMethod] # value = - sound_value_iteration: typing.ClassVar[NativeLinearEquationSolverMethod] # value = - walker_chae: typing.ClassVar[NativeLinearEquationSolverMethod] # value = - def __eq__(self, other: typing.Any) -> bool: - ... - def __getstate__(self) -> int: - ... - def __hash__(self) -> int: - ... - def __index__(self) -> int: - ... - def __init__(self, value: int) -> None: - ... - def __int__(self) -> int: - ... - def __ne__(self, other: typing.Any) -> bool: - ... - def __repr__(self) -> str: - ... - def __setstate__(self, state: int) -> None: - ... - def __str__(self) -> str: - ... - @property - def name(self) -> str: - ... - @property - def value(self) -> int: - ... -class NativeSolverEnvironment: - """ - Environment for Native solvers - """ - maximum_iterations: int - method: NativeLinearEquationSolverMethod - precision: stormpy.pycarl.gmp.Rational -class OptimizationDirection: - """ - Members: - - Minimize - - Maximize - """ - Maximize: typing.ClassVar[OptimizationDirection] # value = - Minimize: typing.ClassVar[OptimizationDirection] # value = - __members__: typing.ClassVar[dict[str, OptimizationDirection]] # value = {'Minimize': , 'Maximize': } - def __eq__(self, other: typing.Any) -> bool: - ... - def __getstate__(self) -> int: - ... - def __hash__(self) -> int: - ... - def __index__(self) -> int: - ... - def __init__(self, value: int) -> None: - ... - def __int__(self) -> int: - ... - def __ne__(self, other: typing.Any) -> bool: - ... - def __repr__(self) -> str: - ... - def __setstate__(self, state: int) -> None: - ... - def __str__(self) -> str: - ... - @property - def name(self) -> str: - ... - @property - def value(self) -> int: - ... -class ParametricCheckTask: - """ - Task for parametric model checking - """ - def __init__(self, formula: ..., only_initial_states: bool = False) -> None: - ... - def set_produce_schedulers(self, produce_schedulers: bool = True) -> None: - """ - Set whether schedulers should be produced (if possible) - """ -class ParetoCurveCheckResultDouble(_CheckResult): - """ - Result for multiobjective model checking - """ - def get_overapproximation(self) -> ...: - ... - def get_underapproximation(self) -> ...: - ... -class Property: - """ - Property - """ - @typing.overload - def __init__(self, name: str, formula: ..., undefined_constants: set[...] = set(), comment: str = '') -> None: - """ - Construct property from formula - """ - @typing.overload - def __init__(self, arg0: Property) -> None: - ... - def __str__(self) -> str: - ... - @property - def name(self) -> str: - """ - Obtain the name of the property - """ - @property - def raw_formula(self) -> ...: - """ - Obtain the formula directly - """ -class QuotientFormat: - """ - Return format of bisimulation quotient - - Members: - - SPARSE - - DD - """ - DD: typing.ClassVar[QuotientFormat] # value = - SPARSE: typing.ClassVar[QuotientFormat] # value = - __members__: typing.ClassVar[dict[str, QuotientFormat]] # value = {'SPARSE': , 'DD': } - def __eq__(self, other: typing.Any) -> bool: - ... - def __getstate__(self) -> int: - ... - def __hash__(self) -> int: - ... - def __index__(self) -> int: - ... - def __init__(self, value: int) -> None: - ... - def __int__(self) -> int: - ... - def __ne__(self, other: typing.Any) -> bool: - ... - def __repr__(self) -> str: - ... - def __setstate__(self, state: int) -> None: - ... - def __str__(self) -> str: - ... - @property - def name(self) -> str: - ... - @property - def value(self) -> int: - ... -class SMTCounterExampleGenerator: - """ - Highlevel Counterexample Generator with SMT as backend - """ - @staticmethod - def build(env: Environment, stats: SMTCounterExampleGeneratorStats, symbolic_model: ..., model: ..., storm: ..., cex_input: ..., dontcare: FlatSet, options: SMTCounterExampleGeneratorOptions) -> list[FlatSet]: - """ - Compute counterexample - """ - @staticmethod - def precompute(env: Environment, symbolic_model: ..., model: ..., storm: ..., formula: ...) -> ...: - """ - Precompute input for counterexample generation - """ -class SMTCounterExampleGeneratorOptions: - """ - Options for highlevel counterexample generation - """ - add_backward_implication_cuts: bool - check_threshold_feasible: bool - continue_after_first_counterexample: int - encode_reachability: bool - maximum_counterexamples: int - maximum_iterations_after_counterexample: int - silent: bool - use_dynamic_constraints: bool - def __init__(self) -> None: - ... -class SMTCounterExampleGeneratorStats: - """ - Stats for highlevel counterexample generation - """ - def __init__(self) -> None: - ... - @property - def analysis_time(self) -> ...: - ... - @property - def cut_time(self) -> ...: - ... - @property - def iterations(self) -> int: - ... - @property - def model_checking_time(self) -> ...: - ... - @property - def setup_time(self) -> ...: - ... - @property - def solver_time(self) -> ...: - ... -class SMTCounterExampleInput: - """ - Precomputed input for counterexample generation - """ - def add_reward_and_threshold(self, reward_name: str, threshold: float) -> None: - """ - add another reward structure and threshold - """ -class SolverEnvironment: - """ - Environment for solvers - """ - def set_force_sound(self, new_value: bool = True) -> None: - """ - force soundness - """ - def set_linear_equation_solver_type(self, new_value: EquationSolverType, set_from_default: bool = False) -> None: - """ - set solver type to use - """ - @property - def minmax_solver_environment(self) -> ...: - ... - @property - def native_solver_environment(self) -> ...: - ... -class StateValuationFunctionActionMaskDouble(ActionMaskDouble): - def __init__(self, f: typing.Callable[[..., int], bool]) -> None: - ... -class SubsystemBuilderOptions: - """ - Options for constructing the subsystem - """ - build_action_mapping: bool - build_kept_actions: bool - build_state_mapping: bool - check_transitions_outside: bool - fix_deadlocks: bool - def __init__(self) -> None: - ... -class SubsystemBuilderReturnTypeDouble: - """ - Result of the construction of a subsystem - """ - @property - def deadlock_label(self) -> str | None: - """ - If set, deadlock states have been introduced and have been assigned this label - """ - @property - def kept_actions(self) -> ...: - """ - Actions of the subsystem available in the original system - """ - @property - def model(self) -> ...: - """ - the submodel - """ - @property - def new_to_old_action_mapping(self) -> list[int]: - """ - for each action in result, the action index in the original model - """ - @property - def new_to_old_state_mapping(self) -> list[int]: - """ - for each state in result, the state index in the original model - """ -class SubsystemBuilderReturnTypeExact: - """ - Result of the construction of a subsystem - """ - @property - def deadlock_label(self) -> str | None: - """ - If set, deadlock states have been introduced and have been assigned this label - """ - @property - def kept_actions(self) -> ...: - """ - Actions of the subsystem available in the original system - """ - @property - def model(self) -> ...: - """ - the submodel - """ - @property - def new_to_old_action_mapping(self) -> list[int]: - """ - for each action in result, the action index in the original model - """ - @property - def new_to_old_state_mapping(self) -> list[int]: - """ - for each state in result, the state index in the original model - """ -class SubsystemBuilderReturnTypeRatFunc: - """ - Result of the construction of a subsystem - """ - @property - def deadlock_label(self) -> str | None: - """ - If set, deadlock states have been introduced and have been assigned this label - """ - @property - def kept_actions(self) -> ...: - """ - Actions of the subsystem available in the original system - """ - @property - def model(self) -> ...: - """ - the submodel - """ - @property - def new_to_old_action_mapping(self) -> list[int]: - """ - for each action in result, the action index in the original model - """ - @property - def new_to_old_state_mapping(self) -> list[int]: - """ - for each state in result, the state index in the original model - """ -class SymbolicExactQuantitativeCheckResult(_QuantitativeCheckResult): - """ - Symbolic exact quantitative model checking result - """ - def clone(self) -> SymbolicExactQuantitativeCheckResult: - ... -class SymbolicModelDescription: - """ - Symbolic description of model - """ - @staticmethod - def parse_constant_definitions(*args, **kwargs) -> dict[..., ...]: - """ - Parse given constant definitions - """ - @typing.overload - def __init__(self, prism_program: ...) -> None: - """ - Construct from Prism program - """ - @typing.overload - def __init__(self, jani_model: ...) -> None: - """ - Construct from Jani model - """ - def as_jani_model(self) -> ...: - """ - Return Jani model - """ - def as_prism_program(self) -> ...: - """ - Return Prism program - """ - def instantiate_constants(self, constant_definitions: dict[..., ...]) -> SymbolicModelDescription: - """ - Instantiate constants in symbolic model description - """ - @property - def is_jani_model(self) -> bool: - """ - Flag if program is in Jani format - """ - @property - def is_prism_program(self) -> bool: - """ - Flag if program is in Prism format - """ -class SymbolicParametricQuantitativeCheckResult(_QuantitativeCheckResult): - """ - Symbolic parametric quantitative model checking result - """ - def clone(self) -> SymbolicParametricQuantitativeCheckResult: - ... -class SymbolicQualitativeCheckResult(_QualitativeCheckResult): - """ - Symbolic qualitative model checking result - """ - def get_truth_values(self) -> ...: - """ - Get Dd representing the truth values - """ -class SymbolicQuantitativeCheckResult(_QuantitativeCheckResult): - """ - Symbolic quantitative model checking result - """ - def clone(self) -> SymbolicQuantitativeCheckResult: - ... - def get_values(self) -> ...: - ... -class _CheckResult: - """ - Base class for all modelchecking results - """ - def __str__(self) -> str: - ... - def as_explicit_exact_quantitative(self) -> ...: - """ - Convert into explicit quantitative result - """ - def as_explicit_parametric_quantitative(self) -> ...: - """ - Convert into explicit quantitative result - """ - def as_explicit_qualitative(self) -> ...: - """ - Convert into explicit qualitative result - """ - def as_explicit_quantitative(self) -> ...: - """ - Convert into explicit quantitative result - """ - def filter(self, filter: ...) -> None: - """ - Filter the result - """ - @property - def _explicit_qualitative(self) -> bool: - """ - Flag if result is explicit qualitative - """ - @property - def _explicit_quantitative(self) -> bool: - """ - Flag if result is explicit quantitative - """ - @property - def _hybrid(self) -> bool: - """ - Flag if result is hybrid - """ - @property - def _hybrid_quantitative(self) -> bool: - """ - Flag if result is hybrid quantitative - """ - @property - def _pareto_curve(self) -> bool: - """ - Flag if result is a pareto curve - """ - @property - def _qualitative(self) -> bool: - """ - Flag if result is qualitative - """ - @property - def _quantitative(self) -> bool: - """ - Flag if result is quantitative - """ - @property - def _symbolic(self) -> bool: - """ - Flag if result is symbolic - """ - @property - def _symbolic_qualitative(self) -> bool: - """ - Flag if result is symbolic qualitative - """ - @property - def _symbolic_quantitative(self) -> bool: - """ - Flag if result is symbolic quantitative - """ - @property - def has_scheduler(self) -> bool: - """ - Flag if a scheduler is present - """ - @property - def result_for_all_states(self) -> bool: - """ - Flag if result is for all states - """ -class _DiscreteTimePrismProgramSimulatorDouble: - """ - Simulator for prism programs - """ - def __init__(self, program: ..., options: BuilderOptions) -> None: - ... - def _reset_to_state_from_compressed_state(self, arg0: ...) -> None: - ... - def _reset_to_state_from_valuation(self, arg0: ...) -> None: - ... - def get_action_indices(self) -> list[int]: - """ - A list of choices that encode the possibilities in the current state. - """ - def get_current_labels(self) -> list[str]: - """ - What are the state labels at the current state? - """ - def get_current_observation_as_json(self) -> ...: - ... - def get_current_state(self) -> ...: - """ - Get current state - """ - def get_current_state_as_json(self) -> ...: - ... - def get_current_state_is_sink(self) -> bool: - ... - def get_last_reward(self) -> list[float]: - ... - def get_number_of_current_choices(self) -> int: - ... - def get_reward_names(self) -> list[str]: - """ - Get names of the rewards provided by the simulator - """ - def reset_to_initial_state(self) -> bool: - """ - Reset to the initial state - """ - def set_seed(self, seed: int) -> None: - ... - def step(self, action_index: int) -> bool: - """ - Make a step and randomly select the successor. The action is given as an argument, the index reflects the index of the getChoices vector that can be accessed. - """ -class _DiscreteTimeSparseModelSimulatorDouble: - """ - Simulator for sparse discrete-time models in memory (for ValueType) - """ - def __init__(self, arg0: ..., storm: ...) -> None: - ... - def get_current_state(self) -> int: - ... - def get_last_reward(self) -> list[float]: - ... - def random_step(self) -> bool: - ... - def reset_to_initial_state(self) -> bool: - ... - def set_seed(self, seed: int) -> None: - ... - def step(self, action: int) -> bool: - ... -class _DiscreteTimeSparseModelSimulatorExact: - """ - Simulator for sparse discrete-time models in memory (for ValueType) - """ - @staticmethod - def __init__(*args, **kwargs) -> None: - ... - def get_current_state(self) -> int: - ... - def get_last_reward(self) -> list[stormpy.pycarl.gmp.Rational]: - ... - def random_step(self) -> bool: - ... - def reset_to_initial_state(self) -> bool: - ... - def set_seed(self, seed: int) -> None: - ... - def step(self, action: int) -> bool: - ... -class _ExactQuantitativeCheckResult(_CheckResult): - """ - Abstract class for exact quantitative model checking results - """ -class _ParametricQuantitativeCheckResult(_CheckResult): - """ - Abstract class for parametric quantitative model checking results - """ -class _QualitativeCheckResult(_CheckResult): - """ - Abstract class for qualitative model checking results - """ -class _QuantitativeCheckResult(_CheckResult): - """ - Abstract class for quantitative model checking results - """ - @property - def max(self) -> float: - """ - Maximal value - """ - @property - def min(self) -> float: - """ - Minimal value - """ -def _build_sparse_exact_model_from_drn(file: str, options: DirectEncodingParserOptions = ...) -> ...: - """ - Build the model from DRN - """ -def _build_sparse_exact_model_from_symbolic_description(model_description: ..., formulas: list[...] = []) -> ...: - """ - Build the model in sparse representation with exact number representation - """ -def _build_sparse_interval_model_from_drn(file: str, options: DirectEncodingParserOptions = ...) -> ...: - """ - Build the interval model from DRN - """ -def _build_sparse_model_from_drn(file: str, options: DirectEncodingParserOptions = ...) -> ...: - """ - Build the model from DRN - """ -def _build_sparse_model_from_symbolic_description(model_description: ..., formulas: list[...] = []) -> ...: - """ - Build the model in sparse representation - """ -def _build_sparse_parametric_model_from_drn(file: str, options: DirectEncodingParserOptions = ...) -> ...: - """ - Build the parametric model from DRN - """ -def _build_sparse_parametric_model_from_symbolic_description(model_description: ..., formulas: list[...] = []) -> ...: - """ - Build the parametric model in sparse representation - """ -def _build_symbolic_model_from_symbolic_description(model_description: ..., formulas: list[...] = []) -> ...: - """ - Build the model in symbolic representation - """ -def _build_symbolic_parametric_model_from_symbolic_description(model_description: ..., formulas: list[...] = []) -> ...: - """ - Build the parametric model in symbolic representation - """ -def _compute_expected_number_of_visits_double(env: Environment, model: ..., storm: ...) -> _CheckResult: - ... -def _compute_expected_number_of_visits_exact(*args, **kwargs) -> _CheckResult: - ... -def _compute_prob01states_double(model: ..., storm: ..., phi_states: ..., psi_states: ...) -> tuple[..., ...]: - """ - Compute prob-0-1 states - """ -def _compute_prob01states_max_double(model: ..., storm: ..., phi_states: ..., psi_states: ...) -> tuple[..., ...]: - """ - Compute prob-0-1 states (max) - """ -def _compute_prob01states_max_rationalfunc(*args, **kwargs) -> tuple[..., ...]: - """ - Compute prob-0-1 states (max) - """ -def _compute_prob01states_min_double(model: ..., storm: ..., phi_states: ..., psi_states: ...) -> tuple[..., ...]: - """ - Compute prob-0-1 states (min) - """ -def _compute_prob01states_min_rationalfunc(*args, **kwargs) -> tuple[..., ...]: - """ - Compute prob-0-1 states (min) - """ -def _compute_prob01states_rationalfunc(*args, **kwargs) -> tuple[..., ...]: - """ - Compute prob-0-1 states - """ -def _compute_steady_state_distribution_double(env: Environment, model: ..., storm: ...) -> _CheckResult: - ... -def _compute_steady_state_distribution_exact(*args, **kwargs) -> _CheckResult: - ... -def _construct_subsystem_Double(arg0: ..., storm: ..., arg1: ..., arg2: ..., arg3: bool, arg4: SubsystemBuilderOptions) -> SubsystemBuilderReturnTypeDouble: - """ - build a subsystem of a sparse model - """ -def _construct_subsystem_Exact(*args, **kwargs) -> SubsystemBuilderReturnTypeExact: - """ - build a subsystem of a sparse model - """ -def _construct_subsystem_RatFunc(*args, **kwargs) -> SubsystemBuilderReturnTypeRatFunc: - """ - build a subsystem of a sparse model - """ -def _eliminate_end_components_double(matrix: ..., subsystem: ..., possible_ec_rows: ..., addSinkRowStates: ..., addSelfLoopAtSinkStates: bool) -> EndComponentEliminatorReturnTypeDouble: - """ - Eliminate ECs in the subystem - """ -def _eliminate_non_markovian_chains(ma: ..., storm: ..., formulae: list[...], label_behavior: EliminationLabelBehavior) -> tuple[..., ..., list[...]]: - """ - Eliminate chains of non-Markovian states in Markov automaton. - """ -def _eliminate_non_markovian_chains_parametric(*args, **kwargs) -> tuple[..., ..., ..., ..., ..., ..., ..., ..., list[...]]: - """ - Eliminate chains of non-Markovian states in Markov automaton. - """ -def _exact_model_checking_fully_observable(*args, **kwargs) -> _CheckResult: - ... -def _exact_model_checking_sparse_engine(*args, **kwargs) -> _CheckResult: - """ - Perform model checking using the sparse engine - """ -def _export_exact_to_drn(*args, **kwargs) -> None: - """ - Export model in DRN format - """ -def _export_parametric_to_drn(*args, **kwargs) -> None: - """ - Export parametric model in DRN format - """ -def _export_to_drn(model: ..., storm: ..., file: str, options: DirectEncodingOptions = ...) -> None: - """ - Export model in DRN format - """ -def _export_to_drn_interval(model: ..., storm: ..., file: str, options: DirectEncodingOptions = ...) -> None: - """ - Export model in DRN format - """ -def _get_reachable_states_double(model: ..., storm: ..., initial_states: ..., constraint_states: ..., target_states: ..., maximal_steps: int | None = None, choice_filter: ... | None = None) -> ...: - ... -def _get_reachable_states_exact(*args, **kwargs) -> ...: - ... -def _get_reachable_states_rf(*args, **kwargs) -> ...: - ... -def _model_checking_dd_engine(*args, **kwargs) -> _CheckResult: - """ - Perform model checking using the dd engine - """ -def _model_checking_fully_observable(model: ..., storm: ..., task: CheckTask, environment: Environment = ...) -> _CheckResult: - ... -def _model_checking_hybrid_engine(*args, **kwargs) -> _CheckResult: - """ - Perform model checking using the hybrid engine - """ -def _model_checking_sparse_engine(model: ..., storm: ..., task: CheckTask, environment: Environment = ...) -> _CheckResult: - """ - Perform model checking using the sparse engine - """ -def _multi_objective_model_checking_double(model: ..., storm: ..., formula: ..., environment: Environment = ...) -> _CheckResult: - """ - Run multi-objective model checking - """ -def _multi_objective_model_checking_exact(*args, **kwargs) -> _CheckResult: - """ - Run multi-objective model checking - """ -def _parametric_model_checking_dd_engine(*args, **kwargs) -> _CheckResult: - """ - Perform parametric model checking using the dd engine - """ -def _parametric_model_checking_hybrid_engine(*args, **kwargs) -> _CheckResult: - """ - Perform parametric model checking using the hybrid engine - """ -def _parametric_model_checking_sparse_engine(*args, **kwargs) -> _CheckResult: - """ - Perform parametric model checking using the sparse engine - """ -def _perform_bisimulation(model: ..., storm: ..., formulas: list[...], bisimulation_type: ...) -> ...: - """ - Perform bisimulation - """ -def _perform_parametric_bisimulation(*args, **kwargs) -> ...: - """ - Perform bisimulation on parametric model - """ -def _perform_symbolic_bisimulation(*args, **kwargs) -> ...: - """ - Perform bisimulation - """ -def _perform_symbolic_parametric_bisimulation(*args, **kwargs) -> ...: - """ - Perform bisimulation on parametric model - """ -def _set_up(arguments: str) -> None: - """ - Initialize Storm - """ -def _transform_to_discrete_time_model(model: ..., storm: ..., formulae: list[...] = []) -> tuple[..., ..., list[...]]: - """ - Transform continuous time model to discrete time model - """ -def _transform_to_discrete_time_parametric_model(*args, **kwargs) -> tuple[..., ..., ..., ..., ..., ..., ..., ..., list[...]]: - """ - Transform parametric continuous time model to parametric discrete time model - """ -def _transform_to_sparse_model(*args, **kwargs) -> ...: - """ - Transform symbolic model into sparse model - """ -def _transform_to_sparse_parametric_model(*args, **kwargs) -> ...: - """ - Transform symbolic parametric model into sparse parametric model - """ -def build_sparse_exact_model_with_options(model_description: ..., options: ...) -> ...: - """ - Build the model in sparse representation with exact number representation - """ -def build_sparse_model_from_explicit(transition_file: str, labeling_file: str, state_reward_file: str | None = '', transition_reward_file: str | None = '', choice_labeling_file: str | None = '') -> ...: - """ - Build the model model from explicit input - """ -def build_sparse_model_with_options(model_description: ..., options: ...) -> ...: - """ - Build the model in sparse representation - """ -def build_sparse_parametric_model_with_options(model_description: ..., options: ...) -> ...: - """ - Build the model in sparse representation - """ -def check_interval_mdp(arg0: ..., storm: ..., arg1: CheckTask, arg2: Environment) -> _CheckResult: - """ - Check interval MDP - """ -def compute_all_until_probabilities(arg0: Environment, arg1: CheckTask, arg2: ..., storm: ..., arg3: ..., arg4: ...) -> list[float]: - """ - Compute forward until probabilities - """ -def compute_transient_probabilities(arg0: Environment, arg1: ..., storm: ..., arg2: ..., arg3: ..., arg4: float) -> list[float]: - """ - Compute transient probabilities - """ -def create_filter_initial_states_sparse(model: ..., storm: ...) -> _QualitativeCheckResult: - """ - Create a filter for the initial states on a sparse model - """ -def create_filter_initial_states_symbolic(*args, **kwargs) -> _QualitativeCheckResult: - """ - Create a filter for the initial states on a symbolic model - """ -def create_filter_symbolic(*args, **kwargs) -> _QualitativeCheckResult: - """ - Creates a filter for the given states and a symbolic model - """ -def install_signal_handlers(arg0: int) -> None: - ... -def make_sparse_model_builder(*args, **kwargs) -> ...: - """ - Construct a builder instance - """ -def make_sparse_model_builder_exact(*args, **kwargs) -> ...: - """ - Construct a builder instance - """ -def make_sparse_model_builder_parametric(*args, **kwargs) -> ...: - """ - Construct a builder instance - """ -def parse_constants_string(expression_manager: ..., definition_string: str) -> dict[..., ...]: - """ - Parse constants definition - """ -def parse_jani_model(path: str) -> tuple[..., list[Property]]: - """ - Parse Jani model - """ -def parse_jani_model_from_string(json_string: str) -> tuple[..., list[Property]]: - """ - Parse Jani model from string - """ -def parse_prism_program(path: str, prism_compat: bool = False, simplify: bool = True) -> ...: - """ - Parse Prism program - """ -def parse_properties_for_jani_model(formula_string: str, jani_model: ..., property_filter: set[str] | None = None) -> list[Property]: - ... -def parse_properties_for_prism_program(formula_string: str, prism_program: ..., property_filter: set[str] | None = None) -> list[Property]: - """ - Parses properties given in the prism format, allows references to variables in the prism program. - - :param str formula_str: A string of formulas - :param PrismProgram prism_program: A prism program - :param str property_filter: A filter - :return: A list of properties - """ -def parse_properties_without_context(formula_string: str, property_filter: set[str] | None = None) -> list[Property]: - """ - Parse properties given in the prism format. - - :param str formula_str: A string of formulas - :param str property_filter: A filter - :return: A list of properties - """ -def preprocess_symbolic_input(symbolic_model_description: ..., properties: list[Property], constant_definition_string: str) -> tuple[..., list[Property]]: - """ - Preprocess symoblic input - """ -def reset_timeout() -> None: - """ - Reset timeout - """ -def set_loglevel_debug() -> None: - """ - set loglevel for storm to debug - """ -def set_loglevel_error() -> None: - ... -def set_loglevel_trace() -> None: - ... -def set_settings(arguments: list[str]) -> None: - """ - Set settings - """ -def set_timeout(timeout: int) -> None: - """ - Set timeout in seconds - """ diff --git a/lib/stormpy/exceptions.pyi b/lib/stormpy/exceptions.pyi deleted file mode 100644 index 10c35d6539..0000000000 --- a/lib/stormpy/exceptions.pyi +++ /dev/null @@ -1,15 +0,0 @@ -from __future__ import annotations -__all__ = ['StormError'] -class StormError(Exception): - """ - - Base class for exceptions in Storm. - - """ - def __init__(self, message): - """ - - Constructor. - :param message: Error message. - - """ diff --git a/lib/stormpy/pycarl/__init__.pyi b/lib/stormpy/pycarl/__init__.pyi deleted file mode 100644 index 9df061c95d..0000000000 --- a/lib/stormpy/pycarl/__init__.pyi +++ /dev/null @@ -1,61 +0,0 @@ -from __future__ import annotations -from stormpy.pycarl.pycarl_core import BoundType -from stormpy.pycarl.pycarl_core import Interval -from stormpy.pycarl.pycarl_core import Monomial -from stormpy.pycarl.pycarl_core import NoPicklingSupport -from stormpy.pycarl.pycarl_core import Variable -from stormpy.pycarl.pycarl_core import VariableType -from stormpy.pycarl.pycarl_core import abs -from stormpy.pycarl.pycarl_core import ceil -from stormpy.pycarl.pycarl_core import clear_monomial_pool -from stormpy.pycarl.pycarl_core import clear_variable_pool -from stormpy.pycarl.pycarl_core import create_monomial -from stormpy.pycarl.pycarl_core import div -from stormpy.pycarl.pycarl_core import floor -from stormpy.pycarl.pycarl_core import isInteger -from stormpy.pycarl.pycarl_core import pow -from stormpy.pycarl.pycarl_core import quotient -from stormpy.pycarl.pycarl_core import variable_with_name -import sys as sys -from . import _config -from . import _version -from . import cln -from . import gmp -from . import infinity -from . import pycarl_core -__all__ = ['BoundType', 'Interval', 'Monomial', 'NoPicklingSupport', 'Variable', 'VariableType', 'abs', 'carl_version', 'ceil', 'clear_monomial_pool', 'clear_pools', 'clear_variable_pool', 'cln', 'create_monomial', 'div', 'floor', 'gmp', 'has_cln', 'has_parser', 'inf', 'infinity', 'isInteger', 'pow', 'print_info', 'pycarl_core', 'quotient', 'sys', 'variable_with_name'] -def carl_version(): - """ - - Get Carl version. - :return: Version of Carl. - - """ -def clear_pools(): - """ - - Clear all pools. - - """ -def has_cln(): - """ - - Check if pycarl has support for CLN. - :return: True iff CLN is supported. - - """ -def has_parser(): - """ - - Check if pycarl has parsing support. - :return: True iff parsing is supported. - - """ -def print_info(): - """ - - Print information about pycarl. - - """ -__version__: str = '2.2.0' -inf: infinity.Infinity # value = pycarl.inf diff --git a/lib/stormpy/pycarl/_config.pyi b/lib/stormpy/pycarl/_config.pyi deleted file mode 100644 index 10dfa48619..0000000000 --- a/lib/stormpy/pycarl/_config.pyi +++ /dev/null @@ -1,6 +0,0 @@ -from __future__ import annotations -__all__ = ['CARL_VERSION', 'CARL_WITH_CLN', 'CARL_WITH_PARSER', 'PYBIND_VERSION'] -CARL_VERSION: str = '14.28' -CARL_WITH_CLN: bool = True -CARL_WITH_PARSER: bool = False -PYBIND_VERSION: str = '2.10.0' diff --git a/lib/stormpy/pycarl/_version.pyi b/lib/stormpy/pycarl/_version.pyi deleted file mode 100644 index 9daaad0ae6..0000000000 --- a/lib/stormpy/pycarl/_version.pyi +++ /dev/null @@ -1,3 +0,0 @@ -from __future__ import annotations -__all__ = list() -__version__: str = '2.2.0' diff --git a/lib/stormpy/pycarl/cln/__init__.pyi b/lib/stormpy/pycarl/cln/__init__.pyi deleted file mode 100644 index 31aeb91781..0000000000 --- a/lib/stormpy/pycarl/cln/__init__.pyi +++ /dev/null @@ -1,1114 +0,0 @@ -from __future__ import annotations -from stormpy.pycarl import cln -import stormpy.pycarl.pycarl_core -import typing -from . import _config -__all__ = ['Factorization', 'FactorizedPolynomial', 'FactorizedRationalFunction', 'Integer', 'Interval', 'Polynomial', 'Rational', 'RationalFunction', 'Term', 'abs', 'ceil', 'cln', 'create_factorized_polynomial', 'denominator', 'div', 'expand', 'factorization_cache', 'floor', 'isInteger', 'numerator', 'pow', 'quotient'] -class Factorization: - """ - Factorization - """ - __hash__: typing.ClassVar[None] = None - def __eq__(self, arg0: Factorization) -> bool: - ... - def __getstate__(self) -> tuple[str]: - ... - def __iter__(self) -> typing.Iterator: - ... - def __len__(self) -> int: - ... - def __setstate__(self, arg0: tuple[str]) -> None: - ... - def __str__(self) -> str: - ... -class FactorizedPolynomial: - """ - Represent a polynomial with its factorization - """ - coefficient: Rational - def __add__(self, arg0: FactorizedPolynomial) -> FactorizedPolynomial: - ... - @typing.overload - def __eq__(self, arg0: FactorizedPolynomial) -> bool: - ... - @typing.overload - def __eq__(self, arg0: Rational) -> bool: - ... - def __getstate__(self) -> tuple[str]: - ... - def __hash__(self) -> int: - ... - @typing.overload - def __init__(self, number: Rational) -> None: - """ - Constructor - """ - @typing.overload - def __init__(self, polynomial: Polynomial, cache: _FactorizationCache) -> None: - """ - Constructor - """ - def __mul__(self, arg0: FactorizedPolynomial) -> FactorizedPolynomial: - ... - @typing.overload - def __ne__(self, arg0: FactorizedPolynomial) -> bool: - ... - @typing.overload - def __ne__(self, arg0: Rational) -> bool: - ... - def __pow__(self, exponent: int) -> FactorizedPolynomial: - """ - Raise polynomial to the power - """ - def __setstate__(self, arg0: tuple[str]) -> None: - ... - def __str__(self) -> str: - ... - def __sub__(self, arg0: FactorizedPolynomial) -> FactorizedPolynomial: - ... - def cache(self) -> _FactorizationCache: - ... - def constant_part(self) -> Rational: - ... - def derive(self, variable: stormpy.pycarl.pycarl_core.Variable) -> FactorizedPolynomial: - """ - Compute the derivative - """ - def evaluate(self, arg0: dict[stormpy.pycarl.pycarl_core.Variable, Rational]) -> Rational: - ... - def factorization(self) -> Factorization: - """ - Get factorization - """ - def gather_variables(self) -> set[stormpy.pycarl.pycarl_core.Variable]: - ... - def is_constant(self) -> bool: - ... - def is_one(self) -> bool: - ... - def polynomial(self) -> Polynomial: - """ - Get underlying polynomial - """ - def to_smt2(self) -> str: - ... -class FactorizedRationalFunction: - """ - Represent a rational function, that is the fraction of two factorized polynomials - """ - @typing.overload - def __add__(self, arg0: FactorizedRationalFunction) -> FactorizedRationalFunction: - ... - @typing.overload - def __add__(self, arg0: Rational) -> FactorizedRationalFunction: - ... - def __eq__(self, arg0: FactorizedRationalFunction) -> bool: - ... - def __getstate__(self) -> tuple[str]: - ... - def __hash__(self) -> int: - ... - @typing.overload - def __init__(self, arg0: FactorizedPolynomial) -> None: - ... - @typing.overload - def __init__(self, arg0: FactorizedPolynomial, arg1: FactorizedPolynomial) -> None: - ... - def __mul__(self, arg0: FactorizedRationalFunction) -> FactorizedRationalFunction: - ... - def __ne__(self, arg0: FactorizedRationalFunction) -> bool: - ... - def __setstate__(self, arg0: tuple[str]) -> None: - ... - def __str__(self) -> str: - ... - def __sub__(self, arg0: FactorizedRationalFunction) -> FactorizedRationalFunction: - ... - def __truediv__(self, arg0: FactorizedRationalFunction) -> FactorizedRationalFunction: - ... - def constant_part(self) -> Rational: - ... - def derive(self, variable: stormpy.pycarl.pycarl_core.Variable) -> FactorizedRationalFunction: - """ - Compute the derivative - """ - def evaluate(self, arg0: dict[stormpy.pycarl.pycarl_core.Variable, Rational]) -> Rational: - ... - def gather_variables(self) -> set[stormpy.pycarl.pycarl_core.Variable]: - ... - def is_constant(self) -> bool: - ... - def rational_function(self) -> RationalFunction: - ... - def to_smt2(self) -> str: - ... - @property - def denominator(self) -> FactorizedPolynomial: - ... - @property - def numerator(self) -> FactorizedPolynomial: - ... -class Integer: - """ - Class wrapping cln-integers - """ - @staticmethod - @typing.overload - def __init__(*args, **kwargs) -> None: - ... - def __abs__(self) -> Integer: - ... - @typing.overload - def __add__(self, arg0: Integer) -> Integer: - ... - @typing.overload - def __add__(self, arg0: int) -> Integer: - ... - @typing.overload - def __add__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: - ... - @typing.overload - def __add__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> ...: - ... - @typing.overload - def __eq__(self, arg0: Integer) -> bool: - ... - @typing.overload - def __eq__(self, arg0: int) -> bool: - ... - def __float__(self) -> float: - ... - @typing.overload - def __ge__(self, arg0: Integer) -> bool: - ... - @typing.overload - def __ge__(self, arg0: int) -> bool: - ... - def __getstate__(self) -> tuple[str]: - ... - @typing.overload - def __gt__(self, arg0: Integer) -> bool: - ... - @typing.overload - def __gt__(self, arg0: int) -> bool: - ... - def __hash__(self) -> int: - ... - @typing.overload - def __init__(self, arg0: int) -> None: - ... - @typing.overload - def __init__(self, arg0: str) -> None: - ... - @typing.overload - def __le__(self, arg0: Integer) -> bool: - ... - @typing.overload - def __le__(self, arg0: int) -> bool: - ... - @typing.overload - def __lt__(self, arg0: Integer) -> bool: - ... - @typing.overload - def __lt__(self, arg0: int) -> bool: - ... - @typing.overload - def __mul__(self, arg0: Integer) -> Integer: - ... - @typing.overload - def __mul__(self, arg0: int) -> Integer: - ... - @typing.overload - def __mul__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: - ... - @typing.overload - def __mul__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> ...: - ... - @typing.overload - def __ne__(self, arg0: Integer) -> bool: - ... - @typing.overload - def __ne__(self, arg0: int) -> bool: - ... - def __neg__(self) -> Integer: - ... - def __pos__(self) -> Integer: - ... - def __pow__(self, arg0: int) -> Integer: - ... - @typing.overload - def __radd__(self, arg0: int) -> Integer: - ... - @typing.overload - def __radd__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: - ... - @typing.overload - def __radd__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> ...: - ... - def __repr__(self) -> str: - ... - @typing.overload - def __rmul__(self, arg0: int) -> Integer: - ... - @typing.overload - def __rmul__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: - ... - @typing.overload - def __rmul__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> ...: - ... - def __rsub__(self, arg0: int) -> Integer: - ... - def __setstate__(self, arg0: tuple[str]) -> None: - ... - def __str__(self) -> str: - ... - @typing.overload - def __sub__(self, arg0: Integer) -> Integer: - ... - @typing.overload - def __sub__(self, arg0: int) -> Integer: - ... - @typing.overload - def __sub__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: - ... - @typing.overload - def __sub__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> ...: - ... - def __truediv__(self, arg0: Integer) -> ...: - ... -class Interval: - __hash__: typing.ClassVar[None] = None - @staticmethod - def emptyInterval() -> Interval: - ... - @staticmethod - def unboundedInterval() -> Interval: - ... - @staticmethod - def zeroInterval() -> Interval: - ... - @typing.overload - def __add__(self, arg0: Interval) -> Interval: - ... - @typing.overload - def __add__(self, arg0: Rational) -> Interval: - ... - def __eq__(self, arg0: Interval) -> bool: - ... - @typing.overload - def __ge__(self, arg0: Rational) -> bool: - ... - @typing.overload - def __ge__(self, arg0: Interval) -> bool: - ... - @typing.overload - def __ge__(self, arg0: Rational) -> bool: - ... - def __getstate__(self) -> tuple[str]: - ... - @typing.overload - def __gt__(self, arg0: Rational) -> bool: - ... - @typing.overload - def __gt__(self, arg0: Interval) -> bool: - ... - @typing.overload - def __gt__(self, arg0: Rational) -> bool: - ... - @typing.overload - def __iadd__(self, arg0: Interval) -> Interval: - ... - @typing.overload - def __iadd__(self, arg0: Rational) -> Interval: - ... - @typing.overload - def __imul__(self, arg0: Interval) -> Interval: - ... - @typing.overload - def __imul__(self, arg0: Rational) -> Interval: - ... - @typing.overload - def __init__(self, arg0: Rational) -> None: - ... - @typing.overload - def __init__(self, arg0: Rational, arg1: Rational) -> None: - ... - @typing.overload - def __init__(self, arg0: Rational, arg1: stormpy.pycarl.pycarl_core.BoundType, arg2: Rational, arg3: stormpy.pycarl.pycarl_core.BoundType) -> None: - ... - @typing.overload - def __isub__(self, arg0: Interval) -> Interval: - ... - @typing.overload - def __isub__(self, arg0: Rational) -> Interval: - ... - def __itruediv__(self, arg0: Rational) -> Interval: - ... - @typing.overload - def __le__(self, arg0: Interval) -> bool: - ... - @typing.overload - def __le__(self, arg0: Rational) -> bool: - ... - @typing.overload - def __le__(self, arg0: Rational) -> bool: - ... - @typing.overload - def __lt__(self, arg0: Interval) -> bool: - ... - @typing.overload - def __lt__(self, arg0: Rational) -> bool: - ... - @typing.overload - def __lt__(self, arg0: Rational) -> bool: - ... - @typing.overload - def __mul__(self, arg0: Interval) -> Interval: - ... - @typing.overload - def __mul__(self, arg0: Rational) -> Interval: - ... - def __ne__(self, arg0: Interval) -> bool: - ... - def __neg__(self) -> Interval: - ... - def __pow__(self, arg0: int) -> Interval: - ... - def __radd__(self, arg0: Rational) -> Interval: - ... - def __repr__(self) -> str: - ... - def __rmul__(self, arg0: Rational) -> Interval: - ... - def __rsub__(self, arg0: Rational) -> Interval: - ... - def __setstate__(self, arg0: tuple[str]) -> None: - ... - def __str__(self) -> str: - ... - @typing.overload - def __sub__(self, arg0: Interval) -> Interval: - ... - @typing.overload - def __sub__(self, arg0: Rational) -> Interval: - ... - def __truediv__(self, arg0: Rational) -> Interval: - ... - def abs(self) -> Interval: - ... - def center(self) -> Rational: - ... - def complement(self, arg0: Interval, arg1: Interval) -> bool: - ... - @typing.overload - def contains(self, arg0: Rational) -> bool: - ... - @typing.overload - def contains(self, arg0: Interval) -> bool: - ... - def diameter(self) -> Rational: - ... - def difference(self, arg0: Interval, arg1: Interval, arg2: Interval) -> bool: - ... - def div(self, arg0: Interval) -> Interval: - ... - def integralPart(self) -> Interval: - ... - def intersect(self, arg0: Interval) -> Interval: - ... - def intersectsWith(self, arg0: Interval) -> bool: - ... - def inverse(self) -> Interval: - ... - def isClosedInterval(self) -> bool: - ... - def isEmpty(self) -> bool: - ... - def isHalfBounded(self) -> bool: - ... - def isInfinite(self) -> bool: - ... - def isNegative(self) -> bool: - ... - def isOne(self) -> bool: - ... - def isOpenInterval(self) -> bool: - ... - def isPointInterval(self) -> bool: - ... - def isPositive(self) -> bool: - ... - def isProperSubset(self, arg0: Interval) -> bool: - ... - def isSemiNegative(self) -> bool: - ... - def isSemiPositive(self) -> bool: - ... - def isSubset(self, arg0: Interval) -> bool: - ... - def isUnbounded(self) -> bool: - ... - def isZero(self) -> bool: - ... - def lower(self) -> Rational: - ... - def meets(self, arg0: Rational) -> bool: - ... - def sample(self, arg0: bool) -> Rational: - ... - def setLower(self, arg0: Rational) -> None: - ... - def setUpper(self, arg0: Rational) -> None: - ... - def symmetricDifference(self, arg0: Interval, arg1: Interval, arg2: Interval) -> bool: - ... - def unite(self, arg0: Interval, arg1: Interval, arg2: Interval) -> bool: - ... - def upper(self) -> Rational: - ... -class Polynomial: - """ - Represent a multivariate polynomial - """ - @staticmethod - @typing.overload - def __add__(*args, **kwargs) -> ...: - ... - @staticmethod - @typing.overload - def __truediv__(*args, **kwargs) -> ...: - ... - @typing.overload - def __add__(self, arg0: Integer) -> Polynomial: - ... - @typing.overload - def __add__(self, arg0: Rational) -> Polynomial: - ... - @typing.overload - def __add__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> Polynomial: - ... - @typing.overload - def __add__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> Polynomial: - ... - @typing.overload - def __add__(self, arg0: Term) -> Polynomial: - ... - @typing.overload - def __add__(self, arg0: Polynomial) -> Polynomial: - ... - @typing.overload - def __eq__(self, arg0: Polynomial) -> bool: - ... - @typing.overload - def __eq__(self, arg0: Rational) -> bool: - ... - @typing.overload - def __eq__(self, arg0: Integer) -> bool: - ... - def __getitem__(self, arg0: int) -> Term: - ... - def __getstate__(self) -> tuple[str]: - ... - def __hash__(self) -> int: - ... - @typing.overload - def __init__(self, arg0: Term) -> None: - ... - @typing.overload - def __init__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> None: - ... - @typing.overload - def __init__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> None: - ... - @typing.overload - def __init__(self, arg0: Rational) -> None: - ... - @typing.overload - def __init__(self, arg0: list[Term]) -> None: - ... - def __iter__(self) -> typing.Iterator: - ... - def __len__(self) -> int: - ... - @typing.overload - def __mul__(self, arg0: Integer) -> Polynomial: - ... - @typing.overload - def __mul__(self, arg0: Rational) -> Polynomial: - ... - @typing.overload - def __mul__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> Polynomial: - ... - @typing.overload - def __mul__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> Polynomial: - ... - @typing.overload - def __mul__(self, arg0: Term) -> Polynomial: - ... - @typing.overload - def __mul__(self, arg0: Polynomial) -> Polynomial: - ... - @typing.overload - def __ne__(self, arg0: Polynomial) -> bool: - ... - @typing.overload - def __ne__(self, arg0: Rational) -> bool: - ... - @typing.overload - def __ne__(self, arg0: Integer) -> bool: - ... - def __neg__(self) -> Polynomial: - ... - def __pos__(self) -> Polynomial: - ... - def __pow__(self, arg0: int) -> Polynomial: - ... - def __radd__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> Polynomial: - ... - def __repr__(self) -> str: - ... - @typing.overload - def __rmul__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> Polynomial: - ... - @typing.overload - def __rmul__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> Polynomial: - ... - @typing.overload - def __rsub__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> Polynomial: - ... - @typing.overload - def __rsub__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> Polynomial: - ... - def __setstate__(self, arg0: tuple[str]) -> None: - ... - def __str__(self) -> str: - ... - @typing.overload - def __sub__(self, arg0: Integer) -> Polynomial: - ... - @typing.overload - def __sub__(self, arg0: Rational) -> Polynomial: - ... - @typing.overload - def __sub__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> Polynomial: - ... - @typing.overload - def __sub__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> Polynomial: - ... - @typing.overload - def __sub__(self, arg0: Term) -> Polynomial: - ... - @typing.overload - def __sub__(self, arg0: Polynomial) -> Polynomial: - ... - @typing.overload - def __truediv__(self, arg0: Polynomial) -> ...: - ... - @typing.overload - def __truediv__(self, arg0: Term) -> ...: - ... - @typing.overload - def __truediv__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> ...: - ... - @typing.overload - def __truediv__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: - ... - @typing.overload - def __truediv__(self, arg0: Rational) -> Polynomial: - ... - @typing.overload - def __truediv__(self, arg0: Integer) -> Polynomial: - ... - def constant_part(self) -> Rational: - ... - def degree(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> int: - ... - def derive(self, variable: stormpy.pycarl.pycarl_core.Variable) -> Polynomial: - """ - Compute the derivative - """ - def evaluate(self, arg0: dict[stormpy.pycarl.pycarl_core.Variable, Rational]) -> Rational: - ... - def gather_variables(self) -> set[stormpy.pycarl.pycarl_core.Variable]: - ... - def is_constant(self) -> bool: - ... - def substitute(self, arg0: dict[stormpy.pycarl.pycarl_core.Variable, Polynomial]) -> Polynomial: - ... - def to_smt2(self) -> str: - ... - @property - def nr_terms(self) -> int: - ... - @property - def total_degree(self) -> int: - ... -class Rational: - """ - Class wrapping cln-rational numbers - """ - @staticmethod - @typing.overload - def __add__(*args, **kwargs) -> ...: - ... - @staticmethod - @typing.overload - def __init__(*args, **kwargs) -> None: - ... - @staticmethod - @typing.overload - def __truediv__(*args, **kwargs) -> ...: - ... - def __abs__(self) -> Rational: - ... - @typing.overload - def __add__(self, arg0: Rational) -> Rational: - ... - @typing.overload - def __add__(self, arg0: int) -> Rational: - ... - @typing.overload - def __add__(self, arg0: ..., carl: ..., carl: ...) -> ...: - ... - @typing.overload - def __eq__(self, arg0: Rational) -> bool: - ... - @typing.overload - def __eq__(self, arg0: Integer) -> bool: - ... - @typing.overload - def __eq__(self, arg0: ..., carl: ..., carl: ...) -> bool: - ... - @typing.overload - def __eq__(self, arg0: int) -> bool: - ... - def __float__(self) -> float: - ... - @typing.overload - def __ge__(self, arg0: Rational) -> bool: - ... - @typing.overload - def __ge__(self, arg0: Integer) -> bool: - ... - @typing.overload - def __ge__(self, arg0: int) -> bool: - ... - def __getstate__(self) -> tuple[str, str]: - ... - @typing.overload - def __gt__(self, arg0: Rational) -> bool: - ... - @typing.overload - def __gt__(self, arg0: Integer) -> bool: - ... - @typing.overload - def __gt__(self, arg0: int) -> bool: - ... - def __hash__(self) -> int: - ... - @typing.overload - def __init__(self, arg0: float) -> None: - ... - @typing.overload - def __init__(self, arg0: int) -> None: - ... - @typing.overload - def __init__(self, arg0: Integer, arg1: Integer) -> None: - ... - @typing.overload - def __init__(self, arg0: str) -> None: - ... - @typing.overload - def __le__(self, arg0: Rational) -> bool: - ... - @typing.overload - def __le__(self, arg0: Integer) -> bool: - ... - @typing.overload - def __le__(self, arg0: int) -> bool: - ... - @typing.overload - def __lt__(self, arg0: Rational) -> bool: - ... - @typing.overload - def __lt__(self, arg0: Integer) -> bool: - ... - @typing.overload - def __lt__(self, arg0: int) -> bool: - ... - @typing.overload - def __mul__(self, arg0: Rational) -> Rational: - ... - @typing.overload - def __mul__(self, arg0: int) -> Rational: - ... - @typing.overload - def __mul__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: - ... - @typing.overload - def __ne__(self, arg0: Rational) -> bool: - ... - @typing.overload - def __ne__(self, arg0: Integer) -> bool: - ... - @typing.overload - def __ne__(self, arg0: ..., carl: ..., carl: ...) -> bool: - ... - @typing.overload - def __ne__(self, arg0: int) -> bool: - ... - def __neg__(self) -> Rational: - ... - def __pos__(self) -> Rational: - ... - def __pow__(self, arg0: int) -> Rational: - ... - @typing.overload - def __radd__(self, arg0: int) -> Rational: - ... - @typing.overload - def __radd__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: - ... - def __repr__(self) -> str: - ... - @typing.overload - def __rmul__(self, arg0: int) -> Rational: - ... - @typing.overload - def __rmul__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: - ... - @typing.overload - def __rsub__(self, arg0: int) -> Rational: - ... - @typing.overload - def __rsub__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: - ... - @typing.overload - def __rtruediv__(self, arg0: int) -> Rational: - ... - @typing.overload - def __rtruediv__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: - ... - def __setstate__(self, arg0: tuple[str, str]) -> None: - ... - def __str__(self) -> str: - ... - @typing.overload - def __sub__(self, arg0: Rational) -> Rational: - ... - @typing.overload - def __sub__(self, arg0: int) -> Rational: - ... - @typing.overload - def __sub__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: - ... - @typing.overload - def __truediv__(self, arg0: Rational) -> Rational: - ... - @typing.overload - def __truediv__(self, arg0: int) -> Rational: - ... - @typing.overload - def __truediv__(self, arg0: ..., carl: ..., carl: ...) -> ...: - ... - @typing.overload - def __truediv__(self, arg0: ...) -> ...: - ... - @typing.overload - def __truediv__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> ...: - ... - @typing.overload - def __truediv__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: - ... - def is_minus_one(self) -> bool: - ... - def is_one(self) -> bool: - ... - @property - def denominator(self) -> Integer: - ... - @property - def nominator(self) -> Integer: - ... - @property - def numerator(self) -> Integer: - ... -class RationalFunction: - """ - Represent a rational function, that is the fraction of two multivariate polynomials - """ - @typing.overload - def __add__(self, arg0: Polynomial) -> RationalFunction: - ... - @typing.overload - def __add__(self, arg0: Term) -> RationalFunction: - ... - @typing.overload - def __add__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> RationalFunction: - ... - @typing.overload - def __add__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> RationalFunction: - ... - @typing.overload - def __add__(self, arg0: Rational) -> RationalFunction: - ... - @typing.overload - def __add__(self, arg0: RationalFunction) -> RationalFunction: - ... - @typing.overload - def __eq__(self, arg0: RationalFunction) -> bool: - ... - @typing.overload - def __eq__(self, arg0: Polynomial) -> bool: - ... - def __getstate__(self) -> tuple[str]: - ... - def __hash__(self) -> int: - ... - @typing.overload - def __init__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> None: - ... - @typing.overload - def __init__(self, arg0: Polynomial) -> None: - ... - @typing.overload - def __init__(self, arg0: Polynomial, arg1: Polynomial) -> None: - ... - @typing.overload - def __mul__(self, arg0: Polynomial) -> RationalFunction: - ... - @typing.overload - def __mul__(self, arg0: Term) -> RationalFunction: - ... - @typing.overload - def __mul__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> RationalFunction: - ... - @typing.overload - def __mul__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> RationalFunction: - ... - @typing.overload - def __mul__(self, arg0: Rational) -> RationalFunction: - ... - @typing.overload - def __mul__(self, arg0: RationalFunction) -> RationalFunction: - ... - @typing.overload - def __ne__(self, arg0: RationalFunction) -> bool: - ... - @typing.overload - def __ne__(self, arg0: Polynomial) -> bool: - ... - def __neg__(self) -> RationalFunction: - ... - def __pos__(self) -> RationalFunction: - ... - def __pow__(self, arg0: int) -> RationalFunction: - ... - @typing.overload - def __radd__(self, arg0: Polynomial) -> RationalFunction: - ... - @typing.overload - def __radd__(self, arg0: Term) -> RationalFunction: - ... - @typing.overload - def __radd__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> RationalFunction: - ... - @typing.overload - def __radd__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> RationalFunction: - ... - @typing.overload - def __radd__(self, arg0: Rational) -> RationalFunction: - ... - def __rmul__(self, arg0: Polynomial) -> RationalFunction: - ... - def __setstate__(self, arg0: tuple[str]) -> None: - ... - def __str__(self) -> str: - ... - @typing.overload - def __sub__(self, arg0: Polynomial) -> RationalFunction: - ... - @typing.overload - def __sub__(self, arg0: Term) -> RationalFunction: - ... - @typing.overload - def __sub__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> RationalFunction: - ... - @typing.overload - def __sub__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> RationalFunction: - ... - @typing.overload - def __sub__(self, arg0: Rational) -> RationalFunction: - ... - @typing.overload - def __sub__(self, arg0: RationalFunction) -> RationalFunction: - ... - @typing.overload - def __truediv__(self, arg0: Rational) -> RationalFunction: - ... - @typing.overload - def __truediv__(self, arg0: Polynomial) -> RationalFunction: - ... - @typing.overload - def __truediv__(self, arg0: Term) -> RationalFunction: - ... - @typing.overload - def __truediv__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> RationalFunction: - ... - @typing.overload - def __truediv__(self, arg0: Rational) -> RationalFunction: - ... - @typing.overload - def __truediv__(self, arg0: RationalFunction) -> RationalFunction: - ... - def constant_part(self) -> Rational: - ... - def derive(self, variable: stormpy.pycarl.pycarl_core.Variable) -> RationalFunction: - """ - Compute the derivative - """ - def evaluate(self, arg0: dict[stormpy.pycarl.pycarl_core.Variable, Rational]) -> Rational: - ... - def gather_variables(self) -> set[stormpy.pycarl.pycarl_core.Variable]: - ... - def is_constant(self) -> bool: - ... - def to_smt2(self) -> str: - ... - @property - def denominator(self) -> Polynomial: - ... - @property - def nominator(self) -> Polynomial: - ... - @property - def numerator(self) -> Polynomial: - ... -class Term: - @staticmethod - @typing.overload - def __truediv__(*args, **kwargs) -> ...: - ... - @typing.overload - def __add__(self, arg0: ..., carl: ..., carl: ...) -> ...: - ... - @typing.overload - def __add__(self, arg0: Term) -> ...: - ... - @typing.overload - def __add__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> ...: - ... - @typing.overload - def __add__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: - ... - @typing.overload - def __add__(self, arg0: Rational) -> ...: - ... - def __eq__(self, arg0: Term) -> bool: - ... - def __getstate__(self) -> tuple[str]: - ... - def __hash__(self) -> int: - ... - @typing.overload - def __init__(self, arg0: Rational, arg1: stormpy.pycarl.pycarl_core.Monomial) -> None: - ... - @typing.overload - def __init__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> None: - ... - @typing.overload - def __init__(self, arg0: Rational) -> None: - ... - @typing.overload - def __mul__(self, arg0: ..., carl: ..., carl: ...) -> ...: - ... - @typing.overload - def __mul__(self, arg0: Term) -> Term: - ... - @typing.overload - def __mul__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> Term: - ... - @typing.overload - def __mul__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> Term: - ... - @typing.overload - def __mul__(self, arg0: Rational) -> Term: - ... - def __ne__(self, arg0: Term) -> bool: - ... - def __neg__(self) -> Term: - ... - def __pos__(self) -> Term: - ... - def __pow__(self, arg0: int) -> Term: - ... - def __setstate__(self, arg0: tuple[str]) -> None: - ... - def __str__(self) -> str: - ... - @typing.overload - def __sub__(self, arg0: ..., carl: ..., carl: ...) -> ...: - ... - @typing.overload - def __sub__(self, arg0: Term) -> ...: - ... - @typing.overload - def __sub__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> ...: - ... - @typing.overload - def __sub__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: - ... - @typing.overload - def __sub__(self, arg0: Rational) -> ...: - ... - @typing.overload - def __truediv__(self, arg0: ..., carl: ..., carl: ...) -> ...: - ... - @typing.overload - def __truediv__(self, arg0: Term) -> ...: - ... - @typing.overload - def __truediv__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> ...: - ... - @typing.overload - def __truediv__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: - ... - @typing.overload - def __truediv__(self, arg0: Rational) -> Term: - ... - def is_constant(self) -> bool: - ... - def is_one(self) -> bool: - ... - @property - def coeff(self) -> Rational: - ... - @property - def monomial(self) -> stormpy.pycarl.pycarl_core.Monomial: - ... - @property - def tdeg(self) -> int: - ... -def abs(arg0: Interval) -> Interval: - ... -def ceil(arg0: Interval) -> Interval: - ... -def create_factorized_polynomial(polynomial): - ... -def denominator(x): - ... -def div(arg0: Interval, arg1: Interval) -> Interval: - ... -def expand(x): - ... -def floor(arg0: Interval) -> Interval: - ... -def isInteger(arg0: Interval) -> bool: - ... -def numerator(x): - ... -def pow(arg0: Interval, arg1: int) -> Interval: - ... -def quotient(arg0: Interval, arg1: Interval) -> Interval: - ... -factorization_cache: _FactorizationCache # value = diff --git a/lib/stormpy/pycarl/cln/_config.pyi b/lib/stormpy/pycarl/cln/_config.pyi deleted file mode 100644 index ddf8714ac8..0000000000 --- a/lib/stormpy/pycarl/cln/_config.pyi +++ /dev/null @@ -1,3 +0,0 @@ -from __future__ import annotations -__all__ = ['CARL_WITH_CLN'] -CARL_WITH_CLN: bool = True diff --git a/lib/stormpy/pycarl/gmp.pyi b/lib/stormpy/pycarl/gmp.pyi deleted file mode 100644 index 2e9cdb9828..0000000000 --- a/lib/stormpy/pycarl/gmp.pyi +++ /dev/null @@ -1,1116 +0,0 @@ -from __future__ import annotations -import stormpy.pycarl.cln -from stormpy.pycarl import gmp -import stormpy.pycarl.pycarl_core -import typing -__all__ = ['Factorization', 'FactorizedPolynomial', 'FactorizedRationalFunction', 'Integer', 'Interval', 'Polynomial', 'Rational', 'RationalFunction', 'Term', 'abs', 'ceil', 'create_factorized_polynomial', 'denominator', 'div', 'expand', 'factorization_cache', 'floor', 'gmp', 'isInteger', 'numerator', 'pow', 'quotient'] -class Factorization: - """ - Factorization - """ - __hash__: typing.ClassVar[None] = None - def __eq__(self, arg0: Factorization) -> bool: - ... - def __getstate__(self) -> tuple[str]: - ... - def __iter__(self) -> typing.Iterator: - ... - def __len__(self) -> int: - ... - def __setstate__(self, arg0: tuple[str]) -> None: - ... - def __str__(self) -> str: - ... -class FactorizedPolynomial: - """ - Represent a polynomial with its factorization - """ - coefficient: Rational - def __add__(self, arg0: FactorizedPolynomial) -> FactorizedPolynomial: - ... - @typing.overload - def __eq__(self, arg0: FactorizedPolynomial) -> bool: - ... - @typing.overload - def __eq__(self, arg0: Rational) -> bool: - ... - def __getstate__(self) -> tuple[str]: - ... - def __hash__(self) -> int: - ... - @typing.overload - def __init__(self, number: Rational) -> None: - """ - Constructor - """ - @typing.overload - def __init__(self, polynomial: Polynomial, cache: _FactorizationCache) -> None: - """ - Constructor - """ - def __mul__(self, arg0: FactorizedPolynomial) -> FactorizedPolynomial: - ... - @typing.overload - def __ne__(self, arg0: FactorizedPolynomial) -> bool: - ... - @typing.overload - def __ne__(self, arg0: Rational) -> bool: - ... - def __pow__(self, exponent: int) -> FactorizedPolynomial: - """ - Raise polynomial to the power - """ - def __setstate__(self, arg0: tuple[str]) -> None: - ... - def __str__(self) -> str: - ... - def __sub__(self, arg0: FactorizedPolynomial) -> FactorizedPolynomial: - ... - def cache(self) -> _FactorizationCache: - ... - def constant_part(self) -> Rational: - ... - def derive(self, variable: stormpy.pycarl.pycarl_core.Variable) -> FactorizedPolynomial: - """ - Compute the derivative - """ - def evaluate(self, arg0: dict[stormpy.pycarl.pycarl_core.Variable, Rational]) -> Rational: - ... - def factorization(self) -> Factorization: - """ - Get factorization - """ - def gather_variables(self) -> set[stormpy.pycarl.pycarl_core.Variable]: - ... - def is_constant(self) -> bool: - ... - def is_one(self) -> bool: - ... - def polynomial(self) -> Polynomial: - """ - Get underlying polynomial - """ - def to_smt2(self) -> str: - ... -class FactorizedRationalFunction: - """ - Represent a rational function, that is the fraction of two factorized polynomials - """ - @typing.overload - def __add__(self, arg0: FactorizedRationalFunction) -> FactorizedRationalFunction: - ... - @typing.overload - def __add__(self, arg0: Rational) -> FactorizedRationalFunction: - ... - def __eq__(self, arg0: FactorizedRationalFunction) -> bool: - ... - def __getstate__(self) -> tuple[str]: - ... - def __hash__(self) -> int: - ... - @typing.overload - def __init__(self, arg0: FactorizedPolynomial) -> None: - ... - @typing.overload - def __init__(self, arg0: FactorizedPolynomial, arg1: FactorizedPolynomial) -> None: - ... - def __mul__(self, arg0: FactorizedRationalFunction) -> FactorizedRationalFunction: - ... - def __ne__(self, arg0: FactorizedRationalFunction) -> bool: - ... - def __setstate__(self, arg0: tuple[str]) -> None: - ... - def __str__(self) -> str: - ... - def __sub__(self, arg0: FactorizedRationalFunction) -> FactorizedRationalFunction: - ... - def __truediv__(self, arg0: FactorizedRationalFunction) -> FactorizedRationalFunction: - ... - def constant_part(self) -> Rational: - ... - def derive(self, variable: stormpy.pycarl.pycarl_core.Variable) -> FactorizedRationalFunction: - """ - Compute the derivative - """ - def evaluate(self, arg0: dict[stormpy.pycarl.pycarl_core.Variable, Rational]) -> Rational: - ... - def gather_variables(self) -> set[stormpy.pycarl.pycarl_core.Variable]: - ... - def is_constant(self) -> bool: - ... - def rational_function(self) -> RationalFunction: - ... - def to_smt2(self) -> str: - ... - @property - def denominator(self) -> FactorizedPolynomial: - ... - @property - def numerator(self) -> FactorizedPolynomial: - ... -class Integer: - """ - Class wrapping gmp-integers - """ - def __abs__(self) -> Integer: - ... - @typing.overload - def __add__(self, arg0: Integer) -> Integer: - ... - @typing.overload - def __add__(self, arg0: int) -> Integer: - ... - @typing.overload - def __add__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: - ... - @typing.overload - def __add__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> ...: - ... - @typing.overload - def __eq__(self, arg0: Integer) -> bool: - ... - @typing.overload - def __eq__(self, arg0: int) -> bool: - ... - def __float__(self) -> float: - ... - @typing.overload - def __ge__(self, arg0: Integer) -> bool: - ... - @typing.overload - def __ge__(self, arg0: int) -> bool: - ... - def __getstate__(self) -> tuple[str]: - ... - @typing.overload - def __gt__(self, arg0: Integer) -> bool: - ... - @typing.overload - def __gt__(self, arg0: int) -> bool: - ... - def __hash__(self) -> int: - ... - @typing.overload - def __init__(self, arg0: int) -> None: - ... - @typing.overload - def __init__(self, arg0: str) -> None: - ... - @typing.overload - def __init__(self, arg0: stormpy.pycarl.cln.Integer) -> None: - ... - @typing.overload - def __le__(self, arg0: Integer) -> bool: - ... - @typing.overload - def __le__(self, arg0: int) -> bool: - ... - @typing.overload - def __lt__(self, arg0: Integer) -> bool: - ... - @typing.overload - def __lt__(self, arg0: int) -> bool: - ... - @typing.overload - def __mul__(self, arg0: Integer) -> Integer: - ... - @typing.overload - def __mul__(self, arg0: int) -> Integer: - ... - @typing.overload - def __mul__(self: int, arg0: Integer) -> Integer: - ... - @typing.overload - def __mul__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: - ... - @typing.overload - def __mul__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> ...: - ... - @typing.overload - def __ne__(self, arg0: Integer) -> bool: - ... - @typing.overload - def __ne__(self, arg0: int) -> bool: - ... - def __neg__(self) -> Integer: - ... - def __pos__(self) -> Integer: - ... - def __pow__(self, arg0: int) -> Integer: - ... - @typing.overload - def __radd__(self, arg0: int) -> Integer: - ... - @typing.overload - def __radd__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: - ... - @typing.overload - def __radd__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> ...: - ... - def __repr__(self) -> str: - ... - @typing.overload - def __rmul__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: - ... - @typing.overload - def __rmul__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> ...: - ... - @typing.overload - def __rsub__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> ...: - ... - @typing.overload - def __rsub__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: - ... - def __setstate__(self, arg0: tuple[str]) -> None: - ... - def __str__(self) -> str: - ... - @typing.overload - def __sub__(self, arg0: Integer) -> Integer: - ... - @typing.overload - def __sub__(self, arg0: int) -> Integer: - ... - @typing.overload - def __sub__(self: int, arg0: Integer) -> Integer: - ... - @typing.overload - def __sub__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> ...: - ... - @typing.overload - def __sub__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: - ... - def __truediv__(self, arg0: Integer) -> ...: - ... -class Interval: - __hash__: typing.ClassVar[None] = None - @staticmethod - def emptyInterval() -> Interval: - ... - @staticmethod - def unboundedInterval() -> Interval: - ... - @staticmethod - def zeroInterval() -> Interval: - ... - @typing.overload - def __add__(self, arg0: Interval) -> Interval: - ... - @typing.overload - def __add__(self, arg0: Rational) -> Interval: - ... - def __eq__(self, arg0: Interval) -> bool: - ... - @typing.overload - def __ge__(self, arg0: Rational) -> bool: - ... - @typing.overload - def __ge__(self, arg0: Interval) -> bool: - ... - @typing.overload - def __ge__(self, arg0: Rational) -> bool: - ... - def __getstate__(self) -> tuple[str]: - ... - @typing.overload - def __gt__(self, arg0: Rational) -> bool: - ... - @typing.overload - def __gt__(self, arg0: Interval) -> bool: - ... - @typing.overload - def __gt__(self, arg0: Rational) -> bool: - ... - @typing.overload - def __iadd__(self, arg0: Interval) -> Interval: - ... - @typing.overload - def __iadd__(self, arg0: Rational) -> Interval: - ... - @typing.overload - def __imul__(self, arg0: Interval) -> Interval: - ... - @typing.overload - def __imul__(self, arg0: Rational) -> Interval: - ... - @typing.overload - def __init__(self, arg0: Rational) -> None: - ... - @typing.overload - def __init__(self, arg0: Rational, arg1: Rational) -> None: - ... - @typing.overload - def __init__(self, arg0: Rational, arg1: stormpy.pycarl.pycarl_core.BoundType, arg2: Rational, arg3: stormpy.pycarl.pycarl_core.BoundType) -> None: - ... - @typing.overload - def __isub__(self, arg0: Interval) -> Interval: - ... - @typing.overload - def __isub__(self, arg0: Rational) -> Interval: - ... - def __itruediv__(self, arg0: Rational) -> Interval: - ... - @typing.overload - def __le__(self, arg0: Interval) -> bool: - ... - @typing.overload - def __le__(self, arg0: Rational) -> bool: - ... - @typing.overload - def __le__(self, arg0: Rational) -> bool: - ... - @typing.overload - def __lt__(self, arg0: Interval) -> bool: - ... - @typing.overload - def __lt__(self, arg0: Rational) -> bool: - ... - @typing.overload - def __lt__(self, arg0: Rational) -> bool: - ... - @typing.overload - def __mul__(self, arg0: Interval) -> Interval: - ... - @typing.overload - def __mul__(self, arg0: Rational) -> Interval: - ... - def __ne__(self, arg0: Interval) -> bool: - ... - def __neg__(self) -> Interval: - ... - def __pow__(self, arg0: int) -> Interval: - ... - def __radd__(self, arg0: Rational) -> Interval: - ... - def __repr__(self) -> str: - ... - def __rmul__(self, arg0: Rational) -> Interval: - ... - def __rsub__(self, arg0: Rational) -> Interval: - ... - def __setstate__(self, arg0: tuple[str]) -> None: - ... - def __str__(self) -> str: - ... - @typing.overload - def __sub__(self, arg0: Interval) -> Interval: - ... - @typing.overload - def __sub__(self, arg0: Rational) -> Interval: - ... - def __truediv__(self, arg0: Rational) -> Interval: - ... - def abs(self) -> Interval: - ... - def center(self) -> Rational: - ... - def complement(self, arg0: Interval, arg1: Interval) -> bool: - ... - @typing.overload - def contains(self, arg0: Rational) -> bool: - ... - @typing.overload - def contains(self, arg0: Interval) -> bool: - ... - def diameter(self) -> Rational: - ... - def difference(self, arg0: Interval, arg1: Interval, arg2: Interval) -> bool: - ... - def div(self, arg0: Interval) -> Interval: - ... - def integralPart(self) -> Interval: - ... - def intersect(self, arg0: Interval) -> Interval: - ... - def intersectsWith(self, arg0: Interval) -> bool: - ... - def inverse(self) -> Interval: - ... - def isClosedInterval(self) -> bool: - ... - def isEmpty(self) -> bool: - ... - def isHalfBounded(self) -> bool: - ... - def isInfinite(self) -> bool: - ... - def isNegative(self) -> bool: - ... - def isOne(self) -> bool: - ... - def isOpenInterval(self) -> bool: - ... - def isPointInterval(self) -> bool: - ... - def isPositive(self) -> bool: - ... - def isProperSubset(self, arg0: Interval) -> bool: - ... - def isSemiNegative(self) -> bool: - ... - def isSemiPositive(self) -> bool: - ... - def isSubset(self, arg0: Interval) -> bool: - ... - def isUnbounded(self) -> bool: - ... - def isZero(self) -> bool: - ... - def lower(self) -> Rational: - ... - def meets(self, arg0: Rational) -> bool: - ... - def sample(self, arg0: bool) -> Rational: - ... - def setLower(self, arg0: Rational) -> None: - ... - def setUpper(self, arg0: Rational) -> None: - ... - def symmetricDifference(self, arg0: Interval, arg1: Interval, arg2: Interval) -> bool: - ... - def unite(self, arg0: Interval, arg1: Interval, arg2: Interval) -> bool: - ... - def upper(self) -> Rational: - ... -class Polynomial: - """ - Represent a multivariate polynomial - """ - @staticmethod - @typing.overload - def __add__(*args, **kwargs) -> ...: - ... - @staticmethod - @typing.overload - def __truediv__(*args, **kwargs) -> ...: - ... - @typing.overload - def __add__(self, arg0: Integer) -> Polynomial: - ... - @typing.overload - def __add__(self, arg0: Rational) -> Polynomial: - ... - @typing.overload - def __add__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> Polynomial: - ... - @typing.overload - def __add__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> Polynomial: - ... - @typing.overload - def __add__(self, arg0: Term) -> Polynomial: - ... - @typing.overload - def __add__(self, arg0: Polynomial) -> Polynomial: - ... - @typing.overload - def __eq__(self, arg0: Polynomial) -> bool: - ... - @typing.overload - def __eq__(self, arg0: Rational) -> bool: - ... - @typing.overload - def __eq__(self, arg0: Integer) -> bool: - ... - def __getitem__(self, arg0: int) -> Term: - ... - def __getstate__(self) -> tuple[str]: - ... - def __hash__(self) -> int: - ... - @typing.overload - def __init__(self, arg0: Term) -> None: - ... - @typing.overload - def __init__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> None: - ... - @typing.overload - def __init__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> None: - ... - @typing.overload - def __init__(self, arg0: Rational) -> None: - ... - @typing.overload - def __init__(self, arg0: list[Term]) -> None: - ... - def __iter__(self) -> typing.Iterator: - ... - def __len__(self) -> int: - ... - @typing.overload - def __mul__(self, arg0: Integer) -> Polynomial: - ... - @typing.overload - def __mul__(self, arg0: Rational) -> Polynomial: - ... - @typing.overload - def __mul__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> Polynomial: - ... - @typing.overload - def __mul__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> Polynomial: - ... - @typing.overload - def __mul__(self, arg0: Term) -> Polynomial: - ... - @typing.overload - def __mul__(self, arg0: Polynomial) -> Polynomial: - ... - @typing.overload - def __ne__(self, arg0: Polynomial) -> bool: - ... - @typing.overload - def __ne__(self, arg0: Rational) -> bool: - ... - @typing.overload - def __ne__(self, arg0: Integer) -> bool: - ... - def __neg__(self) -> Polynomial: - ... - def __pos__(self) -> Polynomial: - ... - def __pow__(self, arg0: int) -> Polynomial: - ... - def __radd__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> Polynomial: - ... - def __repr__(self) -> str: - ... - @typing.overload - def __rmul__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> Polynomial: - ... - @typing.overload - def __rmul__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> Polynomial: - ... - @typing.overload - def __rsub__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> Polynomial: - ... - @typing.overload - def __rsub__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> Polynomial: - ... - def __setstate__(self, arg0: tuple[str]) -> None: - ... - def __str__(self) -> str: - ... - @typing.overload - def __sub__(self, arg0: Integer) -> Polynomial: - ... - @typing.overload - def __sub__(self, arg0: Rational) -> Polynomial: - ... - @typing.overload - def __sub__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> Polynomial: - ... - @typing.overload - def __sub__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> Polynomial: - ... - @typing.overload - def __sub__(self, arg0: Term) -> Polynomial: - ... - @typing.overload - def __sub__(self, arg0: Polynomial) -> Polynomial: - ... - @typing.overload - def __truediv__(self, arg0: Polynomial) -> ...: - ... - @typing.overload - def __truediv__(self, arg0: Term) -> ...: - ... - @typing.overload - def __truediv__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> ...: - ... - @typing.overload - def __truediv__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: - ... - @typing.overload - def __truediv__(self, arg0: Rational) -> Polynomial: - ... - @typing.overload - def __truediv__(self, arg0: Integer) -> Polynomial: - ... - def constant_part(self) -> Rational: - ... - def degree(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> int: - ... - def derive(self, variable: stormpy.pycarl.pycarl_core.Variable) -> Polynomial: - """ - Compute the derivative - """ - def evaluate(self, arg0: dict[stormpy.pycarl.pycarl_core.Variable, Rational]) -> Rational: - ... - def gather_variables(self) -> set[stormpy.pycarl.pycarl_core.Variable]: - ... - def is_constant(self) -> bool: - ... - def substitute(self, arg0: dict[stormpy.pycarl.pycarl_core.Variable, Polynomial]) -> Polynomial: - ... - def to_smt2(self) -> str: - ... - @property - def nr_terms(self) -> int: - ... - @property - def total_degree(self) -> int: - ... -class Rational: - """ - Class wrapping gmp-rational numbers - """ - @staticmethod - @typing.overload - def __eq__(*args, **kwargs) -> bool: - ... - @staticmethod - @typing.overload - def __ne__(*args, **kwargs) -> bool: - ... - @staticmethod - @typing.overload - def __truediv__(*args, **kwargs) -> ...: - ... - @staticmethod - @typing.overload - def __truediv__(*args, **kwargs) -> ...: - ... - @staticmethod - @typing.overload - def __truediv__(*args, **kwargs) -> ...: - ... - def __abs__(self) -> Rational: - ... - @typing.overload - def __add__(self, arg0: Rational) -> Rational: - ... - @typing.overload - def __add__(self, arg0: int) -> Rational: - ... - @typing.overload - def __eq__(self, arg0: Rational) -> bool: - ... - @typing.overload - def __eq__(self, arg0: Integer) -> bool: - ... - @typing.overload - def __eq__(self, arg0: int) -> bool: - ... - def __float__(self) -> float: - ... - @typing.overload - def __ge__(self, arg0: Rational) -> bool: - ... - @typing.overload - def __ge__(self, arg0: Integer) -> bool: - ... - @typing.overload - def __ge__(self, arg0: int) -> bool: - ... - def __getstate__(self) -> tuple[str, str]: - ... - @typing.overload - def __gt__(self, arg0: Rational) -> bool: - ... - @typing.overload - def __gt__(self, arg0: Integer) -> bool: - ... - @typing.overload - def __gt__(self, arg0: int) -> bool: - ... - def __hash__(self) -> int: - ... - @typing.overload - def __init__(self, arg0: float) -> None: - ... - @typing.overload - def __init__(self, arg0: int) -> None: - ... - @typing.overload - def __init__(self, arg0: Integer, arg1: Integer) -> None: - ... - @typing.overload - def __init__(self, arg0: str) -> None: - ... - @typing.overload - def __init__(self, arg0: stormpy.pycarl.cln.Rational) -> None: - ... - @typing.overload - def __le__(self, arg0: Rational) -> bool: - ... - @typing.overload - def __le__(self, arg0: Integer) -> bool: - ... - @typing.overload - def __le__(self, arg0: int) -> bool: - ... - @typing.overload - def __lt__(self, arg0: Rational) -> bool: - ... - @typing.overload - def __lt__(self, arg0: Integer) -> bool: - ... - @typing.overload - def __lt__(self, arg0: int) -> bool: - ... - @typing.overload - def __mul__(self, arg0: Rational) -> Rational: - ... - @typing.overload - def __mul__(self, arg0: int) -> Rational: - ... - @typing.overload - def __mul__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: - ... - @typing.overload - def __ne__(self, arg0: Rational) -> bool: - ... - @typing.overload - def __ne__(self, arg0: Integer) -> bool: - ... - @typing.overload - def __ne__(self, arg0: int) -> bool: - ... - def __neg__(self) -> Rational: - ... - def __pos__(self) -> Rational: - ... - def __pow__(self, arg0: int) -> Rational: - ... - @typing.overload - def __radd__(self, arg0: int) -> Rational: - ... - @typing.overload - def __radd__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: - ... - def __repr__(self) -> str: - ... - @typing.overload - def __rmul__(self, arg0: int) -> Rational: - ... - @typing.overload - def __rmul__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: - ... - @typing.overload - def __rsub__(self, arg0: int) -> Rational: - ... - @typing.overload - def __rsub__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: - ... - @typing.overload - def __rtruediv__(self, arg0: int) -> Rational: - ... - @typing.overload - def __rtruediv__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: - ... - def __setstate__(self, arg0: tuple[str, str]) -> None: - ... - def __str__(self) -> str: - ... - @typing.overload - def __sub__(self, arg0: Rational) -> Rational: - ... - @typing.overload - def __sub__(self, arg0: int) -> Rational: - ... - @typing.overload - def __sub__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: - ... - @typing.overload - def __truediv__(self, arg0: Rational) -> Rational: - ... - @typing.overload - def __truediv__(self, arg0: int) -> Rational: - ... - @typing.overload - def __truediv__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> ...: - ... - @typing.overload - def __truediv__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: - ... - @property - def denominator(self) -> Integer: - ... - @property - def nominator(self) -> Integer: - ... - @property - def numerator(self) -> Integer: - ... -class RationalFunction: - """ - Represent a rational function, that is the fraction of two multivariate polynomials - """ - @typing.overload - def __add__(self, arg0: Polynomial) -> RationalFunction: - ... - @typing.overload - def __add__(self, arg0: Term) -> RationalFunction: - ... - @typing.overload - def __add__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> RationalFunction: - ... - @typing.overload - def __add__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> RationalFunction: - ... - @typing.overload - def __add__(self, arg0: Rational) -> RationalFunction: - ... - @typing.overload - def __add__(self, arg0: RationalFunction) -> RationalFunction: - ... - @typing.overload - def __eq__(self, arg0: RationalFunction) -> bool: - ... - @typing.overload - def __eq__(self, arg0: Polynomial) -> bool: - ... - def __getstate__(self) -> tuple[str]: - ... - def __hash__(self) -> int: - ... - @typing.overload - def __init__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> None: - ... - @typing.overload - def __init__(self, arg0: Polynomial) -> None: - ... - @typing.overload - def __init__(self, arg0: Polynomial, arg1: Polynomial) -> None: - ... - @typing.overload - def __mul__(self, arg0: Polynomial) -> RationalFunction: - ... - @typing.overload - def __mul__(self, arg0: Term) -> RationalFunction: - ... - @typing.overload - def __mul__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> RationalFunction: - ... - @typing.overload - def __mul__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> RationalFunction: - ... - @typing.overload - def __mul__(self, arg0: Rational) -> RationalFunction: - ... - @typing.overload - def __mul__(self, arg0: RationalFunction) -> RationalFunction: - ... - @typing.overload - def __ne__(self, arg0: RationalFunction) -> bool: - ... - @typing.overload - def __ne__(self, arg0: Polynomial) -> bool: - ... - def __neg__(self) -> RationalFunction: - ... - def __pos__(self) -> RationalFunction: - ... - def __pow__(self, arg0: int) -> RationalFunction: - ... - @typing.overload - def __radd__(self, arg0: Polynomial) -> RationalFunction: - ... - @typing.overload - def __radd__(self, arg0: Term) -> RationalFunction: - ... - @typing.overload - def __radd__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> RationalFunction: - ... - @typing.overload - def __radd__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> RationalFunction: - ... - @typing.overload - def __radd__(self, arg0: Rational) -> RationalFunction: - ... - def __rmul__(self, arg0: Polynomial) -> RationalFunction: - ... - def __setstate__(self, arg0: tuple[str]) -> None: - ... - def __str__(self) -> str: - ... - @typing.overload - def __sub__(self, arg0: Polynomial) -> RationalFunction: - ... - @typing.overload - def __sub__(self, arg0: Term) -> RationalFunction: - ... - @typing.overload - def __sub__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> RationalFunction: - ... - @typing.overload - def __sub__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> RationalFunction: - ... - @typing.overload - def __sub__(self, arg0: Rational) -> RationalFunction: - ... - @typing.overload - def __sub__(self, arg0: RationalFunction) -> RationalFunction: - ... - @typing.overload - def __truediv__(self, arg0: Rational) -> RationalFunction: - ... - @typing.overload - def __truediv__(self, arg0: Polynomial) -> RationalFunction: - ... - @typing.overload - def __truediv__(self, arg0: Term) -> RationalFunction: - ... - @typing.overload - def __truediv__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> RationalFunction: - ... - @typing.overload - def __truediv__(self, arg0: Rational) -> RationalFunction: - ... - @typing.overload - def __truediv__(self, arg0: RationalFunction) -> RationalFunction: - ... - def constant_part(self) -> Rational: - ... - def derive(self, variable: stormpy.pycarl.pycarl_core.Variable) -> RationalFunction: - """ - Compute the derivative - """ - def evaluate(self, arg0: dict[stormpy.pycarl.pycarl_core.Variable, Rational]) -> Rational: - ... - def gather_variables(self) -> set[stormpy.pycarl.pycarl_core.Variable]: - ... - def is_constant(self) -> bool: - ... - def to_smt2(self) -> str: - ... - @property - def denominator(self) -> Polynomial: - ... - @property - def nominator(self) -> Polynomial: - ... - @property - def numerator(self) -> Polynomial: - ... -class Term: - @staticmethod - @typing.overload - def __add__(*args, **kwargs) -> ...: - ... - @staticmethod - @typing.overload - def __mul__(*args, **kwargs) -> ...: - ... - @staticmethod - @typing.overload - def __sub__(*args, **kwargs) -> ...: - ... - @staticmethod - @typing.overload - def __truediv__(*args, **kwargs) -> ...: - ... - @staticmethod - @typing.overload - def __truediv__(*args, **kwargs) -> ...: - ... - @typing.overload - def __add__(self, arg0: Term) -> ...: - ... - @typing.overload - def __add__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> ...: - ... - @typing.overload - def __add__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: - ... - @typing.overload - def __add__(self, arg0: Rational) -> ...: - ... - def __eq__(self, arg0: Term) -> bool: - ... - def __getstate__(self) -> tuple[str]: - ... - def __hash__(self) -> int: - ... - @typing.overload - def __init__(self, arg0: Rational, arg1: stormpy.pycarl.pycarl_core.Monomial) -> None: - ... - @typing.overload - def __init__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> None: - ... - @typing.overload - def __init__(self, arg0: Rational) -> None: - ... - @typing.overload - def __mul__(self, arg0: Term) -> Term: - ... - @typing.overload - def __mul__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> Term: - ... - @typing.overload - def __mul__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> Term: - ... - @typing.overload - def __mul__(self, arg0: Rational) -> Term: - ... - def __ne__(self, arg0: Term) -> bool: - ... - def __neg__(self) -> Term: - ... - def __pos__(self) -> Term: - ... - def __pow__(self, arg0: int) -> Term: - ... - def __setstate__(self, arg0: tuple[str]) -> None: - ... - def __str__(self) -> str: - ... - @typing.overload - def __sub__(self, arg0: Term) -> ...: - ... - @typing.overload - def __sub__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> ...: - ... - @typing.overload - def __sub__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: - ... - @typing.overload - def __sub__(self, arg0: Rational) -> ...: - ... - @typing.overload - def __truediv__(self, arg0: Term) -> ...: - ... - @typing.overload - def __truediv__(self, arg0: stormpy.pycarl.pycarl_core.Monomial) -> ...: - ... - @typing.overload - def __truediv__(self, arg0: stormpy.pycarl.pycarl_core.Variable) -> ...: - ... - @typing.overload - def __truediv__(self, arg0: Rational) -> Term: - ... - def is_constant(self) -> bool: - ... - def is_one(self) -> bool: - ... - @property - def coeff(self) -> Rational: - ... - @property - def monomial(self) -> stormpy.pycarl.pycarl_core.Monomial: - ... - @property - def tdeg(self) -> int: - ... -def abs(arg0: Interval) -> Interval: - ... -def ceil(arg0: Interval) -> Interval: - ... -def create_factorized_polynomial(polynomial): - ... -def denominator(x): - ... -def div(arg0: Interval, arg1: Interval) -> Interval: - ... -def expand(x): - ... -def floor(arg0: Interval) -> Interval: - ... -def isInteger(arg0: Interval) -> bool: - ... -def numerator(x): - ... -def pow(arg0: Interval, arg1: int) -> Interval: - ... -def quotient(arg0: Interval, arg1: Interval) -> Interval: - ... -factorization_cache: _FactorizationCache # value = diff --git a/lib/stormpy/pycarl/infinity.pyi b/lib/stormpy/pycarl/infinity.pyi deleted file mode 100644 index 172ce2947c..0000000000 --- a/lib/stormpy/pycarl/infinity.pyi +++ /dev/null @@ -1,46 +0,0 @@ -from __future__ import annotations -import math as math -import sys as sys -__all__ = ['Infinity', 'math', 'sys'] -class Infinity: - """ - - Class representing infinity and minus infinity - - """ - def __add__(self, other): - ... - def __div__(self, other): - ... - def __eq__(self, other): - ... - def __ge__(self, other): - ... - def __gt__(self, other): - ... - def __hash__(self): - ... - def __init__(self, negated = False): - ... - def __le__(self, other): - ... - def __lt__(self, other): - ... - def __mul__(self, other): - ... - def __neg__(self): - ... - def __radd__(self, other): - ... - def __rdiv__(self, other): - ... - def __repr__(self): - ... - def __rmul__(self, other): - ... - def __rsub__(self, other): - ... - def __str__(self): - ... - def __sub__(self, other): - ... diff --git a/lib/stormpy/pycarl/pycarl_core.pyi b/lib/stormpy/pycarl/pycarl_core.pyi deleted file mode 100644 index 9b22f6d4f2..0000000000 --- a/lib/stormpy/pycarl/pycarl_core.pyi +++ /dev/null @@ -1,391 +0,0 @@ -""" -pycarl core untyped functions -""" -from __future__ import annotations -import typing -__all__ = ['BoundType', 'Interval', 'Monomial', 'NoPicklingSupport', 'Variable', 'VariableType', 'abs', 'ceil', 'clear_monomial_pool', 'clear_variable_pool', 'create_monomial', 'div', 'floor', 'isInteger', 'pow', 'quotient', 'variable_with_name'] -class BoundType: - """ - Members: - - STRICT - - WEAK - - INFTY - """ - INFTY: typing.ClassVar[BoundType] # value = - STRICT: typing.ClassVar[BoundType] # value = - WEAK: typing.ClassVar[BoundType] # value = - __members__: typing.ClassVar[dict[str, BoundType]] # value = {'STRICT': , 'WEAK': , 'INFTY': } - def __eq__(self, other: typing.Any) -> bool: - ... - def __getstate__(self) -> int: - ... - def __hash__(self) -> int: - ... - def __index__(self) -> int: - ... - def __init__(self, value: int) -> None: - ... - def __int__(self) -> int: - ... - def __ne__(self, other: typing.Any) -> bool: - ... - def __repr__(self) -> str: - ... - def __setstate__(self, state: int) -> None: - ... - def __str__(self) -> str: - ... - @property - def name(self) -> str: - ... - @property - def value(self) -> int: - ... -class Interval: - __hash__: typing.ClassVar[None] = None - @staticmethod - def emptyInterval() -> Interval: - ... - @staticmethod - def unboundedInterval() -> Interval: - ... - @staticmethod - def zeroInterval() -> Interval: - ... - @typing.overload - def __add__(self, arg0: Interval) -> Interval: - ... - @typing.overload - def __add__(self, arg0: float) -> Interval: - ... - def __eq__(self, arg0: Interval) -> bool: - ... - @typing.overload - def __ge__(self, arg0: float) -> bool: - ... - @typing.overload - def __ge__(self, arg0: Interval) -> bool: - ... - @typing.overload - def __ge__(self, arg0: float) -> bool: - ... - def __getstate__(self) -> tuple[str]: - ... - @typing.overload - def __gt__(self, arg0: float) -> bool: - ... - @typing.overload - def __gt__(self, arg0: Interval) -> bool: - ... - @typing.overload - def __gt__(self, arg0: float) -> bool: - ... - @typing.overload - def __iadd__(self, arg0: Interval) -> Interval: - ... - @typing.overload - def __iadd__(self, arg0: float) -> Interval: - ... - @typing.overload - def __imul__(self, arg0: Interval) -> Interval: - ... - @typing.overload - def __imul__(self, arg0: float) -> Interval: - ... - @typing.overload - def __init__(self, arg0: float) -> None: - ... - @typing.overload - def __init__(self, arg0: float, arg1: float) -> None: - ... - @typing.overload - def __init__(self, arg0: float, arg1: BoundType, arg2: float, arg3: BoundType) -> None: - ... - @typing.overload - def __isub__(self, arg0: Interval) -> Interval: - ... - @typing.overload - def __isub__(self, arg0: float) -> Interval: - ... - def __itruediv__(self, arg0: float) -> Interval: - ... - @typing.overload - def __le__(self, arg0: Interval) -> bool: - ... - @typing.overload - def __le__(self, arg0: float) -> bool: - ... - @typing.overload - def __le__(self, arg0: float) -> bool: - ... - @typing.overload - def __lt__(self, arg0: Interval) -> bool: - ... - @typing.overload - def __lt__(self, arg0: float) -> bool: - ... - @typing.overload - def __lt__(self, arg0: float) -> bool: - ... - @typing.overload - def __mul__(self, arg0: Interval) -> Interval: - ... - @typing.overload - def __mul__(self, arg0: float) -> Interval: - ... - def __ne__(self, arg0: Interval) -> bool: - ... - def __neg__(self) -> Interval: - ... - def __pow__(self, arg0: int) -> Interval: - ... - def __radd__(self, arg0: float) -> Interval: - ... - def __repr__(self) -> str: - ... - def __rmul__(self, arg0: float) -> Interval: - ... - def __rsub__(self, arg0: float) -> Interval: - ... - def __setstate__(self, arg0: tuple[str]) -> None: - ... - def __str__(self) -> str: - ... - @typing.overload - def __sub__(self, arg0: Interval) -> Interval: - ... - @typing.overload - def __sub__(self, arg0: float) -> Interval: - ... - def __truediv__(self, arg0: float) -> Interval: - ... - def abs(self) -> Interval: - ... - def center(self) -> float: - ... - def complement(self, arg0: Interval, arg1: Interval) -> bool: - ... - @typing.overload - def contains(self, arg0: float) -> bool: - ... - @typing.overload - def contains(self, arg0: Interval) -> bool: - ... - def diameter(self) -> float: - ... - def difference(self, arg0: Interval, arg1: Interval, arg2: Interval) -> bool: - ... - def div(self, arg0: Interval) -> Interval: - ... - def integralPart(self) -> Interval: - ... - def intersect(self, arg0: Interval) -> Interval: - ... - def intersectsWith(self, arg0: Interval) -> bool: - ... - def inverse(self) -> Interval: - ... - def isClosedInterval(self) -> bool: - ... - def isEmpty(self) -> bool: - ... - def isHalfBounded(self) -> bool: - ... - def isInfinite(self) -> bool: - ... - def isNegative(self) -> bool: - ... - def isOne(self) -> bool: - ... - def isOpenInterval(self) -> bool: - ... - def isPointInterval(self) -> bool: - ... - def isPositive(self) -> bool: - ... - def isProperSubset(self, arg0: Interval) -> bool: - ... - def isSemiNegative(self) -> bool: - ... - def isSemiPositive(self) -> bool: - ... - def isSubset(self, arg0: Interval) -> bool: - ... - def isUnbounded(self) -> bool: - ... - def isZero(self) -> bool: - ... - def lower(self) -> float: - ... - def meets(self, arg0: float) -> bool: - ... - def sample(self, arg0: bool) -> float: - ... - def setLower(self, arg0: float) -> None: - ... - def setUpper(self, arg0: float) -> None: - ... - def symmetricDifference(self, arg0: Interval, arg1: Interval, arg2: Interval) -> bool: - ... - def unite(self, arg0: Interval, arg1: Interval, arg2: Interval) -> bool: - ... - def upper(self) -> float: - ... -class Monomial: - def __getitem__(self, arg0: int) -> tuple[Variable, int]: - ... - def __getstate__(self) -> tuple[str]: - ... - def __hash__(self) -> int: - ... - def __iter__(self) -> typing.Iterator: - ... - def __len__(self) -> int: - ... - @typing.overload - def __mul__(self, arg0: Monomial) -> Monomial: - ... - @typing.overload - def __mul__(self, arg0: Variable) -> Monomial: - ... - @typing.overload - def __mul__(self: Variable, arg0: Monomial) -> Monomial: - ... - def __pos__(self) -> Monomial: - ... - def __pow__(self, arg0: int) -> Monomial: - ... - def __setstate__(self, arg0: tuple[str]) -> None: - ... - def __str__(self) -> str: - ... - @property - def exponents(self) -> list[tuple[Variable, int]]: - ... - @property - def tdeg(self) -> int: - ... -class NoPicklingSupport(Exception): - pass -class Variable: - def __eq__(self, arg0: Variable) -> bool: - ... - def __ge__(self, arg0: Variable) -> bool: - ... - def __getstate__(self) -> tuple[str, str]: - ... - def __gt__(self, arg0: Variable) -> bool: - ... - def __hash__(self) -> int: - ... - @typing.overload - def __init__(self, other: Variable) -> None: - ... - @typing.overload - def __init__(self, name: str, type: VariableType = ...) -> None: - ... - @typing.overload - def __init__(self, type: VariableType = ...) -> None: - ... - def __le__(self, arg0: Variable) -> bool: - ... - def __lt__(self, arg0: Variable) -> bool: - ... - def __mul__(self, arg0: Variable) -> ...: - ... - def __ne__(self, arg0: Variable) -> bool: - ... - def __repr__(self) -> str: - ... - def __setstate__(self, arg0: tuple[str, str]) -> None: - ... - def __str__(self) -> str: - ... - @property - def id(self) -> int: - ... - @property - def is_no_variable(self) -> bool: - ... - @property - def name(self) -> str: - ... - @property - def rank(self) -> int: - ... - @property - def type(self) -> VariableType: - ... -class VariableType: - """ - Members: - - BOOL - - INT - - REAL - """ - BOOL: typing.ClassVar[VariableType] # value = - INT: typing.ClassVar[VariableType] # value = - REAL: typing.ClassVar[VariableType] # value = - __members__: typing.ClassVar[dict[str, VariableType]] # value = {'BOOL': , 'INT': , 'REAL': } - def __eq__(self, other: typing.Any) -> bool: - ... - def __getstate__(self) -> int: - ... - def __hash__(self) -> int: - ... - def __index__(self) -> int: - ... - def __init__(self, value: int) -> None: - ... - def __int__(self) -> int: - ... - def __ne__(self, other: typing.Any) -> bool: - ... - def __repr__(self) -> str: - ... - def __setstate__(self, state: int) -> None: - ... - def __str__(self) -> str: - ... - @property - def name(self) -> str: - ... - @property - def value(self) -> int: - ... -def abs(arg0: Interval) -> Interval: - ... -def ceil(arg0: Interval) -> Interval: - ... -def clear_monomial_pool() -> None: - """ - Clear monomial pool and remove all monomials - """ -def clear_variable_pool() -> None: - """ - Clear variable pool and remove all variables - """ -def create_monomial(variable: Variable, exponent: int) -> Monomial: - """ - Create monomial - """ -def div(arg0: Interval, arg1: Interval) -> Interval: - ... -def floor(arg0: Interval) -> Interval: - ... -def isInteger(arg0: Interval) -> bool: - ... -def pow(arg0: Interval, arg1: int) -> Interval: - ... -def quotient(arg0: Interval, arg1: Interval) -> Interval: - ... -def variable_with_name(arg0: str) -> Variable: - """ - Get a variable from the pool with the given name. - """ diff --git a/lib/stormpy/utility/__init__.pyi b/lib/stormpy/utility/__init__.pyi deleted file mode 100644 index 2867bf8456..0000000000 --- a/lib/stormpy/utility/__init__.pyi +++ /dev/null @@ -1,16 +0,0 @@ -from __future__ import annotations -from stormpy.utility.utility import JsonContainerDouble -from stormpy.utility.utility import JsonContainerRational -from stormpy.utility.utility import MatrixFormat -from stormpy.utility.utility import ModelReference -from stormpy.utility.utility import Path -from stormpy.utility.utility import ShortestPathsGenerator -from stormpy.utility.utility import SmtCheckResult -from stormpy.utility.utility import SmtSolver -from stormpy.utility.utility import SmtSolverFactory -from stormpy.utility.utility import Z3SmtSolver -from stormpy.utility.utility import Z3SmtSolverFactory -from stormpy.utility.utility import milliseconds -from stormpy.utility.utility import sharpen -from . import utility -__all__ = ['JsonContainerDouble', 'JsonContainerRational', 'MatrixFormat', 'ModelReference', 'Path', 'ShortestPathsGenerator', 'SmtCheckResult', 'SmtSolver', 'SmtSolverFactory', 'Z3SmtSolver', 'Z3SmtSolverFactory', 'milliseconds', 'sharpen', 'utility'] diff --git a/lib/stormpy/utility/utility.pyi b/lib/stormpy/utility/utility.pyi deleted file mode 100644 index 07a3fa7117..0000000000 --- a/lib/stormpy/utility/utility.pyi +++ /dev/null @@ -1,230 +0,0 @@ -""" -Utilities for Storm -""" -from __future__ import annotations -import stormpy.pycarl.gmp -import typing -__all__ = ['JsonContainerDouble', 'JsonContainerRational', 'MatrixFormat', 'ModelReference', 'Path', 'ShortestPathsGenerator', 'SmtCheckResult', 'SmtSolver', 'SmtSolverFactory', 'Z3SmtSolver', 'Z3SmtSolverFactory', 'milliseconds', 'sharpen'] -class JsonContainerDouble: - """ - Storm-internal container for JSON structures - """ - @staticmethod - def __eq__(s, o): - ... - @staticmethod - def __hash__(s): - ... - @staticmethod - def __int__(s): - ... - def __getitem__(self, arg0: str) -> JsonContainerDouble: - ... - def __str__(self) -> str: - ... -class JsonContainerRational: - """ - Storm-internal container for JSON structures - """ - @staticmethod - def __eq__(s, o): - ... - @staticmethod - def __hash__(s): - ... - @staticmethod - def __int__(s): - ... - def __getitem__(self, arg0: str) -> JsonContainerRational: - ... - def __str__(self) -> str: - ... -class MatrixFormat: - """ - Members: - - Straight - - I_Minus_P - """ - I_Minus_P: typing.ClassVar[MatrixFormat] # value = - Straight: typing.ClassVar[MatrixFormat] # value = - __members__: typing.ClassVar[dict[str, MatrixFormat]] # value = {'Straight': , 'I_Minus_P': } - def __eq__(self, other: typing.Any) -> bool: - ... - def __getstate__(self) -> int: - ... - def __hash__(self) -> int: - ... - def __index__(self) -> int: - ... - def __init__(self, value: int) -> None: - ... - def __int__(self) -> int: - ... - def __ne__(self, other: typing.Any) -> bool: - ... - def __repr__(self) -> str: - ... - def __setstate__(self, state: int) -> None: - ... - def __str__(self) -> str: - ... - @property - def name(self) -> str: - ... - @property - def value(self) -> int: - ... -class ModelReference: - """ - Lightweight Wrapper around results - """ - def get_boolean_value(self, variable: ...) -> bool: - """ - get a value for a boolean variable - """ - def get_integer_value(self, variable: ...) -> int: - """ - get a value for an integer variable - """ - def get_rational_value(self, variable: ...) -> float: - """ - get a value (as double) for an rational variable - """ -class Path: - __hash__: typing.ClassVar[None] = None - distance: float - predecessorK: int - predecessorNode: int | None - def __eq__(self, arg0: Path) -> bool: - """ - Compares predecessor node and index, ignoring distance - """ - @typing.overload - def __init__(self, predecessorNode: int, predecessorK: int, distance: float) -> None: - ... - @typing.overload - def __init__(self, predecessorK: int, distance: float) -> None: - ... -class ShortestPathsGenerator: - @typing.overload - def __init__(self, model: ..., storm: ..., target_bitvector: ...) -> None: - ... - @typing.overload - def __init__(self, model: ..., storm: ..., target_state: int) -> None: - ... - @typing.overload - def __init__(self, model: ..., storm: ..., target_state_list: list[int]) -> None: - ... - @typing.overload - def __init__(self, model: ..., storm: ..., target_label: str) -> None: - ... - @typing.overload - def __init__(self, transition_matrix: ..., target_prob_vector: list[float], initial_states: ..., matrix_format: MatrixFormat) -> None: - ... - @typing.overload - def __init__(self, transition_matrix: ..., target_prob_map: dict[int, float], initial_states: ..., matrix_format: MatrixFormat) -> None: - ... - def get_distance(self, k: int) -> float: - ... - def get_path_as_list(self, k: int) -> list[int]: - ... - def get_states(self, k: int) -> ...: - ... -class SmtCheckResult: - """ - Result type - - Members: - - Sat - - Unsat - - Unknown - """ - Sat: typing.ClassVar[SmtCheckResult] # value = - Unknown: typing.ClassVar[SmtCheckResult] # value = - Unsat: typing.ClassVar[SmtCheckResult] # value = - __members__: typing.ClassVar[dict[str, SmtCheckResult]] # value = {'Sat': , 'Unsat': , 'Unknown': } - def __eq__(self, other: typing.Any) -> bool: - ... - def __getstate__(self) -> int: - ... - def __hash__(self) -> int: - ... - def __index__(self) -> int: - ... - def __init__(self, value: int) -> None: - ... - def __int__(self) -> int: - ... - def __ne__(self, other: typing.Any) -> bool: - ... - def __repr__(self) -> str: - ... - def __setstate__(self, state: int) -> None: - ... - def __str__(self) -> str: - ... - @property - def name(self) -> str: - ... - @property - def value(self) -> int: - ... -class SmtSolver: - """ - Generic Storm SmtSolver Wrapper - """ - def add(self, arg0: ...) -> None: - """ - addconstraint - """ - def check(self) -> SmtCheckResult: - """ - check - """ - def pop(self, levels: int) -> None: - """ - pop - """ - def push(self) -> None: - """ - push - """ - def reset(self) -> None: - """ - reset - """ - @property - def model(self) -> ModelReference: - """ - get the model - """ -class SmtSolverFactory: - """ - Factory for creating SMT Solvers - """ -class Z3SmtSolver(SmtSolver): - """ - z3 API for storm smtsolver wrapper - """ - def __init__(self, arg0: ...) -> None: - ... -class Z3SmtSolverFactory(SmtSolverFactory): - """ - Factory for creating z3 based SMT solvers - """ - def __init__(self) -> None: - ... -class milliseconds: - def __str__(self) -> str: - ... - def count(self) -> int: - ... -def sharpen(precision: int, value: float) -> stormpy.pycarl.gmp.Rational: - """ - Convert a float to the nearest rational within precision using Kwek Mehlhorn - """ From 2b8f7b2ec0fa37757e05c46b08523280bc7c2dc6 Mon Sep 17 00:00:00 2001 From: Luko van der Maas Date: Wed, 8 Apr 2026 14:42:32 +0200 Subject: [PATCH 27/35] Fixes --- .gitignore | 1 + src/core/core.cpp | 10 +++++----- src/core/result.cpp | 6 +----- src/core/transformation.cpp | 6 +++--- src/mod_pomdp.cpp | 3 +-- src/mod_storage.cpp | 2 +- src/pomdp/transformations.cpp | 1 - src/storage/valuation.cpp | 11 ++++------- 8 files changed, 16 insertions(+), 24 deletions(-) diff --git a/.gitignore b/.gitignore index fe572b1289..356a7aa716 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ _build/ cmake-build-debug/ .cache/ .DS_Store +.venv/ diff --git a/src/core/core.cpp b/src/core/core.cpp index 670ba5188c..173d9f559c 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -206,9 +206,9 @@ void define_export(py::module& m) { ; // Export - m.def("_export_to_drn", &exportDRN, "Export model in DRN format", py::arg("model"), py::arg("file"), py::arg("options")=storm::io::DirectEncodingOptions()); - m.def("_export_to_drn_interval", &exportDRN, "Export model in DRN format", py::arg("model"), py::arg("file"), py::arg("options")=storm::io::DirectEncodingOptions()); - m.def("_export_exact_to_drn_interval", &exportDRN, "Export model in DRN format", py::arg("model"), py::arg("file"), py::arg("options")=storm::io::DirectEncodingOptions()); - m.def("_export_exact_to_drn", &exportDRN, "Export model in DRN format", py::arg("model"), py::arg("file"), py::arg("options")=storm::io::DirectEncodingOptions()); - m.def("_export_parametric_to_drn", &exportDRN, "Export parametric model in DRN format", py::arg("model"), py::arg("file"), py::arg("options")=storm::io::DirectEncodingOptions()); + m.def("_export_to_drn", &exportDRN, "Export model in DRN format", py::arg("model"), py::arg("file"), py::arg("options")=storm::io::DirectEncodingExporterOptions()); + m.def("_export_to_drn_interval", &exportDRN, "Export model in DRN format", py::arg("model"), py::arg("file"), py::arg("options")=storm::io::DirectEncodingExporterOptions()); + m.def("_export_exact_to_drn_interval", &exportDRN, "Export model in DRN format", py::arg("model"), py::arg("file"), py::arg("options")=storm::io::DirectEncodingExporterOptions()); + m.def("_export_exact_to_drn", &exportDRN, "Export model in DRN format", py::arg("model"), py::arg("file"), py::arg("options")=storm::io::DirectEncodingExporterOptions()); + m.def("_export_parametric_to_drn", &exportDRN, "Export parametric model in DRN format", py::arg("model"), py::arg("file"), py::arg("options")=storm::io::DirectEncodingExporterOptions()); } diff --git a/src/core/result.cpp b/src/core/result.cpp index 9de35b7714..f6a58808cc 100644 --- a/src/core/result.cpp +++ b/src/core/result.cpp @@ -28,7 +28,7 @@ std::shared_ptr createFilterSymboli void define_result(py::module& m) { // CheckResult - py::class_>(m, "_CheckResult", "Base class for all modelchecking results") + auto checkResult = py::class_>(m, "_CheckResult", "Base class for all modelchecking results") .def_property_readonly("_symbolic", &storm::modelchecker::CheckResult::isSymbolic, "Flag if result is symbolic") .def_property_readonly("_hybrid", &storm::modelchecker::CheckResult::isHybrid, "Flag if result is hybrid") .def_property_readonly("_quantitative", &storm::modelchecker::CheckResult::isQuantitative, "Flag if result is quantitative") @@ -91,10 +91,6 @@ void define_result(py::module& m) { py::class_, std::shared_ptr>>(m, "SymbolicQualitativeCheckResult", "Symbolic qualitative model checking result", qualitativeCheckResult) .def("get_truth_values", &storm::modelchecker::SymbolicQualitativeCheckResult::getTruthValuesVector, "Get Dd representing the truth values") ; - - py::class_, std::shared_ptr>, storm::modelchecker::QualitativeCheckResult>(m, "SymbolicQualitativeCheckResult", "Symbolic qualitative model checking result") - .def("get_truth_values", &storm::modelchecker::SymbolicQualitativeCheckResult::getTruthValuesVector, "Get Dd representing the truth values") - ; } diff --git a/src/core/transformation.cpp b/src/core/transformation.cpp index d11a75193f..0ef44645ba 100644 --- a/src/core/transformation.cpp +++ b/src/core/transformation.cpp @@ -86,14 +86,14 @@ void define_transformation_typed(py::module& m, std::string const& vtSuffix) { py::class_>(m, ("AddUncertainty" + vtSuffix).c_str(), "Transform model into interval model with specified uncertainty") .def(py::init> const&>(), py::arg("model")) - .def("transform", &storm::transformer::AddUncertainty::transform, "transform the model", py::arg("additiveUncertainty"), py::arg("minimalTransitionProbability")); + .def("transform", &storm::transformer::AddUncertainty::transform, "transform the model", py::arg("additiveUncertainty"), py::arg("minimalValue") = 0.0001, py::arg("maxSuccessors") = (uint64_t)10000000); } template -void define_transformation_typed_only_numbers(py::module& m, std::string const& vtSuffix) { +void define_transformation_typed_only_numbers(py::module& m, std::string const& vtSuffix) { py::class_>(m, ("AddUncertainty" + vtSuffix).c_str(), "Transform model into interval model with specified uncertainty") .def(py::init> const&>(), py::arg("model")) - .def("transform", &storm::transformer::AddUncertainty::transform, "transform the model", py::arg("additiveUncertainty"), py::arg("minimalTransitionProbability")); + .def("transform", &storm::transformer::AddUncertainty::transform, "transform the model", py::arg("additiveUncertainty"), py::arg("minimalValue") = 0.0001, py::arg("maxSuccessors") = (uint64_t)10000000); } template void define_transformation_typed(py::module& m, std::string const& vtSuffix); diff --git a/src/mod_pomdp.cpp b/src/mod_pomdp.cpp index c5b1c28859..6cdd333046 100644 --- a/src/mod_pomdp.cpp +++ b/src/mod_pomdp.cpp @@ -3,6 +3,7 @@ #include #include +#include #include "pomdp/generator.h" #include "pomdp/memory.h" #include "pomdp/qualitative_analysis.h" @@ -16,8 +17,6 @@ PYBIND11_MODULE(_pomdp, m) { #ifdef STORMPY_DISABLE_SIGNATURE_DOC py::options options; options.disable_function_signatures(); - py::options options; - options.disable_function_signatures(); #endif define_tracker(m, "Double"); define_tracker(m, "Exact"); diff --git a/src/mod_storage.cpp b/src/mod_storage.cpp index c4291e5374..4683b0e59c 100644 --- a/src/mod_storage.cpp +++ b/src/mod_storage.cpp @@ -39,7 +39,7 @@ PYBIND11_MODULE(_storage, m) { define_sparse_model(m, "Parametric"); define_sparse_model(m, "RationalInterval"); define_statevaluation(m); - define_statevaluation_transformer(m); + // TODO: define_statevaluation_transformer(m); // Disabled: StateValuationTransformer not yet in Storm define_simplevaluation(m); define_sparse_matrix(m, ""); define_sparse_matrix(m, "Exact"); diff --git a/src/pomdp/transformations.cpp b/src/pomdp/transformations.cpp index 31997f51d9..ea870d7206 100644 --- a/src/pomdp/transformations.cpp +++ b/src/pomdp/transformations.cpp @@ -7,7 +7,6 @@ #include "storm-pomdp/transformer/PomdpMemoryUnfolder.h" #include "storm/adapters/RationalFunctionAdapter.h" #include "storm/storage/expressions/ExpressionManager.h" -#include "storm/transformer/MakePOMDPCanonic.h" template std::shared_ptr> make_canonic(storm::models::sparse::Pomdp const &pomdp) { diff --git a/src/storage/valuation.cpp b/src/storage/valuation.cpp index a73aeabe85..c1ef5feac5 100644 --- a/src/storage/valuation.cpp +++ b/src/storage/valuation.cpp @@ -7,7 +7,7 @@ #include "storm/storage/expressions/SimpleValuation.h" #include "storm/storage/expressions/Variable.h" #include "storm/storage/sparse/StateValuations.h" -#include "storm/storage/sparse/StateValuationTransformer.h" +// #include "storm/storage/sparse/StateValuationTransformer.h" // Not yet in Storm // Thin wrappers storm::json toJson(storm::storage::sparse::StateValuations const& valuations, storm::storage::sparse::state_type const& stateIndex, boost::optional> const& selectedVariables) { @@ -32,7 +32,7 @@ void define_statevaluation(py::module& m) { .def("get_string", &storm::storage::sparse::StateValuations::toString, py::arg("state"), py::arg("pretty")=true, py::arg("selected_variables")=boost::none) .def("get_json", &toJson, py::arg("state"), py::arg("selected_variables")=boost::none) .def("get_nr_of_states", &storm::storage::sparse::StateValuations::getNumberOfStates) - .def_property_readonly("manager", &storm::storage::sparse::StateValuations::getManager); + // TODO: .def_property_readonly("manager", ...) -- getManager not yet in Storm ; @@ -45,11 +45,8 @@ void define_statevaluation(py::module& m) { } void define_statevaluation_transformer(py::module& m) { - py::class_ svt(m, "StateValuationTransformer", "Transforms the given state valuations to a new state valuations over a new variable set. The values of the new variables are determined by evaluating the provided expressions w.r.t. the old variable valuation. The freshly introduced variables may either replace or extend the existing variable set."); - svt.def(py::init(), py::arg("old_state_valuations"), py::keep_alive<1, 2>()) - .def("add_boolean_expression", &storm::storage::sparse::StateValuationTransformer::addBooleanExpression, py::arg("expression_variable"), py::arg("defining_expression")) - .def("add_integer_expression", &storm::storage::sparse::StateValuationTransformer::addIntegerExpression, py::arg("expression_variable"), py::arg("defining_expression")) - .def("build", &storm::storage::sparse::StateValuationTransformer::build, py::arg("extend")); + // TODO: Disabled until StateValuationTransformer is available in Storm + (void)m; } void define_simplevaluation(py::module& m) { From 200299d440baac787c89d37a6b890ff7e69ab521 Mon Sep 17 00:00:00 2001 From: Luko van der Maas Date: Wed, 8 Apr 2026 14:55:24 +0200 Subject: [PATCH 28/35] Update for exactIntervals branch of storm --- src/core/transformation.cpp | 6 +----- src/mod_storage.cpp | 2 +- src/pomdp/transformations.cpp | 2 +- src/storage/valuation.cpp | 11 +++++++---- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/core/transformation.cpp b/src/core/transformation.cpp index 0ef44645ba..cf43d7a627 100644 --- a/src/core/transformation.cpp +++ b/src/core/transformation.cpp @@ -83,17 +83,13 @@ void define_transformation_typed(py::module& m, std::string const& vtSuffix) { .def_readonly("deadlock_label", &storm::transformer::SubsystemBuilderReturnType::deadlockLabel, "If set, deadlock states have been introduced and have been assigned this label"); m.def(("_construct_subsystem_" + vtSuffix).c_str(), &constructSubsystem, "build a subsystem of a sparse model"); - - py::class_>(m, ("AddUncertainty" + vtSuffix).c_str(), "Transform model into interval model with specified uncertainty") - .def(py::init> const&>(), py::arg("model")) - .def("transform", &storm::transformer::AddUncertainty::transform, "transform the model", py::arg("additiveUncertainty"), py::arg("minimalValue") = 0.0001, py::arg("maxSuccessors") = (uint64_t)10000000); } template void define_transformation_typed_only_numbers(py::module& m, std::string const& vtSuffix) { py::class_>(m, ("AddUncertainty" + vtSuffix).c_str(), "Transform model into interval model with specified uncertainty") .def(py::init> const&>(), py::arg("model")) - .def("transform", &storm::transformer::AddUncertainty::transform, "transform the model", py::arg("additiveUncertainty"), py::arg("minimalValue") = 0.0001, py::arg("maxSuccessors") = (uint64_t)10000000); + .def("transform", &storm::transformer::AddUncertainty::transform, "transform the model", py::arg("additiveUncertainty"), py::arg("minimalValue") = storm::utility::convertNumber(0.0001), py::arg("maxSuccessors") = std::optional{}); } template void define_transformation_typed(py::module& m, std::string const& vtSuffix); diff --git a/src/mod_storage.cpp b/src/mod_storage.cpp index 4683b0e59c..c4291e5374 100644 --- a/src/mod_storage.cpp +++ b/src/mod_storage.cpp @@ -39,7 +39,7 @@ PYBIND11_MODULE(_storage, m) { define_sparse_model(m, "Parametric"); define_sparse_model(m, "RationalInterval"); define_statevaluation(m); - // TODO: define_statevaluation_transformer(m); // Disabled: StateValuationTransformer not yet in Storm + define_statevaluation_transformer(m); define_simplevaluation(m); define_sparse_matrix(m, ""); define_sparse_matrix(m, "Exact"); diff --git a/src/pomdp/transformations.cpp b/src/pomdp/transformations.cpp index ea870d7206..9d7d2cbaa0 100644 --- a/src/pomdp/transformations.cpp +++ b/src/pomdp/transformations.cpp @@ -2,7 +2,7 @@ #include "storm-pomdp/transformer/ApplyFiniteSchedulerToPomdp.h" #include "storm-pomdp/transformer/BinaryPomdpTransformer.h" -#include "storm-pomdp/transformer/MakePOMDPCanonic.h" +#include "storm/transformer/MakePOMDPCanonic.h" #include "storm-pomdp/transformer/ObservationTraceUnfolder.h" #include "storm-pomdp/transformer/PomdpMemoryUnfolder.h" #include "storm/adapters/RationalFunctionAdapter.h" diff --git a/src/storage/valuation.cpp b/src/storage/valuation.cpp index c1ef5feac5..5a71aab0cc 100644 --- a/src/storage/valuation.cpp +++ b/src/storage/valuation.cpp @@ -7,7 +7,7 @@ #include "storm/storage/expressions/SimpleValuation.h" #include "storm/storage/expressions/Variable.h" #include "storm/storage/sparse/StateValuations.h" -// #include "storm/storage/sparse/StateValuationTransformer.h" // Not yet in Storm +#include "storm/storage/sparse/StateValuationTransformer.h" // Thin wrappers storm::json toJson(storm::storage::sparse::StateValuations const& valuations, storm::storage::sparse::state_type const& stateIndex, boost::optional> const& selectedVariables) { @@ -32,7 +32,7 @@ void define_statevaluation(py::module& m) { .def("get_string", &storm::storage::sparse::StateValuations::toString, py::arg("state"), py::arg("pretty")=true, py::arg("selected_variables")=boost::none) .def("get_json", &toJson, py::arg("state"), py::arg("selected_variables")=boost::none) .def("get_nr_of_states", &storm::storage::sparse::StateValuations::getNumberOfStates) - // TODO: .def_property_readonly("manager", ...) -- getManager not yet in Storm + .def_property_readonly("manager", &storm::storage::sparse::StateValuations::getManager) ; @@ -45,8 +45,11 @@ void define_statevaluation(py::module& m) { } void define_statevaluation_transformer(py::module& m) { - // TODO: Disabled until StateValuationTransformer is available in Storm - (void)m; + py::class_ svt(m, "StateValuationTransformer", "Transforms the given state valuations to a new state valuations over a new variable set. The values of the new variables are determined by evaluating the provided expressions w.r.t. the old variable valuation. The freshly introduced variables may either replace or extend the existing variable set."); + svt.def(py::init(), py::arg("old_state_valuations"), py::keep_alive<1, 2>()) + .def("add_boolean_expression", &storm::storage::sparse::StateValuationTransformer::addBooleanExpression, py::arg("expression_variable"), py::arg("defining_expression")) + .def("add_integer_expression", &storm::storage::sparse::StateValuationTransformer::addIntegerExpression, py::arg("expression_variable"), py::arg("defining_expression")) + .def("build", &storm::storage::sparse::StateValuationTransformer::build, py::arg("extend")); } void define_simplevaluation(py::module& m) { From 23795b36f683d7c7c61bf7777c1884bdbaffcbeb Mon Sep 17 00:00:00 2001 From: Luko van der Maas Date: Thu, 9 Apr 2026 16:25:00 +0200 Subject: [PATCH 29/35] missed merge mistakes --- src/core/result.cpp | 19 +------------------ src/pomdp/transformations.cpp | 5 +---- 2 files changed, 2 insertions(+), 22 deletions(-) diff --git a/src/core/result.cpp b/src/core/result.cpp index f6a58808cc..aa17ceaa66 100644 --- a/src/core/result.cpp +++ b/src/core/result.cpp @@ -70,24 +70,7 @@ void define_result(py::module& m) { // QualitativeCheckResult py::class_> qualitativeCheckResult(m, "_QualitativeCheckResult", "Abstract class for qualitative model checking results", checkResult); - // For doubles - py::class_, std::shared_ptr>>(m, "ExplicitQualitativeCheckResult", "Explicit qualitative model checking result", qualitativeCheckResult) - .def("at", [](storm::modelchecker::ExplicitQualitativeCheckResult const& result, storm::storage::sparse::state_type state) { - return result[state]; - }, py::arg("state"), "Get result for given state") - .def("get_truth_values", &storm::modelchecker::ExplicitQualitativeCheckResult::getTruthValuesVector, "Get BitVector representing the truth values") - .def_property_readonly("scheduler", [](storm::modelchecker::ExplicitQualitativeCheckResult const& res) {return res.getScheduler();}, "get scheduler") - ; - // For rationals - py::class_, std::shared_ptr>>(m, "ExactExplicitQualitativeCheckResult", "Explicit qualitative model checking result", qualitativeCheckResult) - .def("at", [](storm::modelchecker::ExplicitQualitativeCheckResult const& result, storm::storage::sparse::state_type state) { - return result[state]; - }, py::arg("state"), "Get result for given state") - .def("get_truth_values", &storm::modelchecker::ExplicitQualitativeCheckResult::getTruthValuesVector, "Get BitVector representing the truth values") - .def_property_readonly("scheduler", [](storm::modelchecker::ExplicitQualitativeCheckResult const& res) {return res.getScheduler();}, "get scheduler") - - ; py::class_, std::shared_ptr>>(m, "SymbolicQualitativeCheckResult", "Symbolic qualitative model checking result", qualitativeCheckResult) .def("get_truth_values", &storm::modelchecker::SymbolicQualitativeCheckResult::getTruthValuesVector, "Get Dd representing the truth values") ; @@ -143,4 +126,4 @@ void define_typed_result(py::module& m, std::string const& vtSuffix) { template void define_typed_result(py::module& m, std::string const& vtSuffix); template void define_typed_result(py::module& m, std::string const& vtSuffix); -template void define_typed_result(py::module& m, std::string const& vtSuffix); \ No newline at end of file +template void define_typed_result(py::module& m, std::string const& vtSuffix); diff --git a/src/pomdp/transformations.cpp b/src/pomdp/transformations.cpp index 9d7d2cbaa0..1f42cdfa96 100644 --- a/src/pomdp/transformations.cpp +++ b/src/pomdp/transformations.cpp @@ -55,9 +55,6 @@ void define_transformations_nt(py::module &m) { .value("simple_log", storm::transformer::PomdpFscApplicationMode::SIMPLE_LOG) .value("full", storm::transformer::PomdpFscApplicationMode::FULL); - py::class_ unfolderOptions(m, "ObservationTraceUnfolderOptions", "Options for the ObservationTraceUnfolder"); - unfolderOptions.def(py::init<>()); - unfolderOptions.def_readwrite("rejection_sampling", &storm::pomdp::ObservationTraceUnfolderOptions::rejectionSampling); py::class_ options(m, "ObservationTraceUnfolderOptions", "Options for unfolding observation traces"); options.def(py::init<>()); options.def_readwrite("rejection_sampling", &storm::pomdp::ObservationTraceUnfolderOptions::rejectionSampling, @@ -95,4 +92,4 @@ template void define_transformations_int(py::module &m, std::string cons template void define_transformations_int(py::module &m, std::string const &vtSuffix); template void define_transformations_int(py::module &m, std::string const &vtSuffix); template void define_transformations_int(py::module &m, std::string const &vtSuffix); -template void define_transformations_int(py::module &m, std::string const &vtSuffix); \ No newline at end of file +template void define_transformations_int(py::module &m, std::string const &vtSuffix); From 413f22ef1c9817b4547857494d9dace691a9b0e0 Mon Sep 17 00:00:00 2001 From: Luko van der Maas Date: Mon, 13 Apr 2026 11:27:35 +0200 Subject: [PATCH 30/35] Add optimization_for_bounded_properties property --- src/core/environment.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/environment.cpp b/src/core/environment.cpp index b036f51494..d0abcc3f68 100644 --- a/src/core/environment.cpp +++ b/src/core/environment.cpp @@ -103,6 +103,7 @@ void define_environment(py::module& m) { .def_property("conditional_algorithm", &storm::ModelCheckerEnvironment::getConditionalAlgorithmSetting, &storm::ModelCheckerEnvironment::setConditionalAlgorithmSetting, "conditional algorithm used") .def_property("conditional_tolerance", &storm::ModelCheckerEnvironment::getConditionalTolerance, &storm::ModelCheckerEnvironment::setConditionalTolerance, "conditional tolerance used") .def_property("steady_state_distribution_algorithm", &storm::ModelCheckerEnvironment::getSteadyStateDistributionAlgorithm, &storm::ModelCheckerEnvironment::setSteadyStateDistributionAlgorithm, "steady state distribution algorithm used") + .def_property("optimization_for_bounded_properties", &storm::ModelCheckerEnvironment::isAllowOptimizationForBoundedPropertiesSet, &storm::ModelCheckerEnvironment::setAllowOptimizationForBoundedProperties, "enable optimization for bounded properties") .def_property("ltl2da_tool", [](storm::ModelCheckerEnvironment const& env)->py::object { if (env.isLtl2daToolSet()) return py::cast(env.getLtl2daTool()); return py::none(); }, [](storm::ModelCheckerEnvironment& env, py::object obj){ if (obj.is_none()) env.unsetLtl2daTool(); else env.setLtl2daTool(obj.cast()); }, From 840b1eebf2641166f81471c842fcfb0e918248fc Mon Sep 17 00:00:00 2001 From: Luko van der Maas Date: Mon, 13 Apr 2026 11:32:10 +0200 Subject: [PATCH 31/35] Expose scheduler in explicit qual check result --- src/core/result.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/result.cpp b/src/core/result.cpp index aa17ceaa66..35a77986cc 100644 --- a/src/core/result.cpp +++ b/src/core/result.cpp @@ -84,6 +84,7 @@ void define_typed_result(py::module& m, std::string const& vtSuffix) { return result[state]; }, py::arg("state"), "Get result for given state") .def("get_truth_values", &storm::modelchecker::ExplicitQualitativeCheckResult::getTruthValuesVector, "Get BitVector representing the truth values") + .def_property_readonly("scheduler", [](storm::modelchecker::ExplicitQualitativeCheckResult const& res) {return res.getScheduler();}, "get scheduler") ; py::class_, std::shared_ptr>, storm::modelchecker::CheckResult> quantitativeCheckResult(m, ("_" + vtSuffix + "QuantitativeCheckResult").c_str(), "Abstract class for quantitative model checking results"); From b3297a5c9518a0ce3b1812dbd109e40ee4afd1da Mon Sep 17 00:00:00 2001 From: Luko van der Maas Date: Fri, 17 Apr 2026 11:23:40 +0200 Subject: [PATCH 32/35] Remove dense tracker and fix scheduler --- src/core/result.cpp | 2 +- src/pomdp/tracker.cpp | 12 ------------ 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/src/core/result.cpp b/src/core/result.cpp index 35a77986cc..4f111786fd 100644 --- a/src/core/result.cpp +++ b/src/core/result.cpp @@ -84,7 +84,7 @@ void define_typed_result(py::module& m, std::string const& vtSuffix) { return result[state]; }, py::arg("state"), "Get result for given state") .def("get_truth_values", &storm::modelchecker::ExplicitQualitativeCheckResult::getTruthValuesVector, "Get BitVector representing the truth values") - .def_property_readonly("scheduler", [](storm::modelchecker::ExplicitQualitativeCheckResult const& res) {return res.getScheduler();}, "get scheduler") + .def_property_readonly("scheduler", [](storm::modelchecker::ExplicitQualitativeCheckResult const& res) {return res.getScheduler();}, "get scheduler") ; py::class_, std::shared_ptr>, storm::modelchecker::CheckResult> quantitativeCheckResult(m, ("_" + vtSuffix + "QuantitativeCheckResult").c_str(), "Abstract class for quantitative model checking results"); diff --git a/src/pomdp/tracker.cpp b/src/pomdp/tracker.cpp index 11740e2b98..8c7a20a55c 100644 --- a/src/pomdp/tracker.cpp +++ b/src/pomdp/tracker.cpp @@ -10,7 +10,6 @@ template using SparsePomdp = storm::models::sparse::Pomdp using SparsePomdpTracker = storm::generator::BeliefSupportTracker; template using NDPomdpTrackerSparse = storm::generator::NondeterministicBeliefTracker>; -template using NDPomdpTrackerDense = storm::generator::NondeterministicBeliefTracker>; template @@ -49,17 +48,6 @@ void define_tracker(py::module& m, std::string const& vtSuffix) { ndetbelieftracker.def("obtain_last_observation", &NDPomdpTrackerSparse::getCurrentObservation); ndetbelieftracker.def("reduce",&NDPomdpTrackerSparse::reduce); ndetbelieftracker.def("reduction_timed_out", &NDPomdpTrackerSparse::hasTimedOut); - -// py::class_> ndetbelieftrackerd(m, "NondeterministicBeliefTrackerDoubleDense", "Tracker for belief states and uncontrollable actions"); -// ndetbelieftrackerd.def(py::init const&>(), py::arg("pomdp")); -// ndetbelieftrackerd.def("reset", &NDPomdpTrackerDense::reset); -// ndetbelieftrackerd.def("set_risk", &NDPomdpTrackerDense::setRisk, py::arg("risk")); -// ndetbelieftrackerd.def("obtain_current_risk",&NDPomdpTrackerDense::getCurrentRisk, py::arg("max")=true); -// ndetbelieftrackerd.def("track", &NDPomdpTrackerDense::track, py::arg("observation")); -// ndetbelieftrackerd.def("obtain_beliefs", &NDPomdpTrackerDense::getCurrentBeliefs); -// ndetbelieftrackerd.def("obtain_last_observation", &NDPomdpTrackerDense::getCurrentObservation); -// ndetbelieftrackerd.def("reduce",&NDPomdpTrackerDense::reduce); - } template void define_tracker(py::module& m, std::string const& vtSuffix); From 4bffaa17f566c91fb41d2b7c10e6b8dbab643d42 Mon Sep 17 00:00:00 2001 From: Luko van der Maas Date: Fri, 17 Apr 2026 11:52:17 +0200 Subject: [PATCH 33/35] Reflect storm changes --- src/core/modelchecking.cpp | 6 +- src/pomdp/generator.cpp | 104 +++++++++++----------------------- src/pomdp/transformations.cpp | 12 ++-- 3 files changed, 43 insertions(+), 79 deletions(-) diff --git a/src/core/modelchecking.cpp b/src/core/modelchecking.cpp index 5b00133042..7e7713718e 100644 --- a/src/core/modelchecking.cpp +++ b/src/core/modelchecking.cpp @@ -69,9 +69,9 @@ std::vector computeAllUntilProbabilities(storm::Environment const& env, return storm::modelchecker::helper::SparseCtmcCslHelper::computeAllUntilProbabilities(env, std::move(goal), ctmc->getTransitionMatrix(), ctmc->getExitRateVector(), ctmc->getInitialStates(), phiStates, psiStates); } -// std::vector computeTransientProbabilities(storm::Environment const& env, std::shared_ptr> ctmc, storm::storage::BitVector const& phiStates, storm::storage::BitVector const& psiStates, double timeBound) { -// return storm::modelchecker::helper::SparseCtmcCslHelper::computeAllTransientProbabilities(env, ctmc->getTransitionMatrix(), ctmc->getInitialStates(), phiStates, psiStates, ctmc->getExitRateVector(), timeBound); -// } +std::vector computeTransientProbabilities(storm::Environment const& env, std::shared_ptr> ctmc, storm::storage::BitVector const& phiStates, storm::storage::BitVector const& psiStates, double timeBound) { + return storm::modelchecker::helper::SparseCtmcCslHelper::computeAllTransientProbabilities(env, ctmc->getTransitionMatrix(), ctmc->getInitialStates(), phiStates, psiStates, ctmc->getExitRateVector(), timeBound); +} // Thin wrapper for computing prob01 states template diff --git a/src/pomdp/generator.cpp b/src/pomdp/generator.cpp index 2d3100f7c7..8093d9d443 100644 --- a/src/pomdp/generator.cpp +++ b/src/pomdp/generator.cpp @@ -1,84 +1,48 @@ #include "generator.h" +#include +#include #include "storm-pomdp/generator/GenerateMonitorVerifier.h" #include "storm/adapters/RationalNumberAdapter.h" #include "storm/storage/expressions/ExpressionManager.h" -#include -#include -template -using GenerateMonitorVerifier = - storm::generator::GenerateMonitorVerifier; -template +template +using GenerateMonitorVerifier = storm::generator::GenerateMonitorVerifier; +template using SparseDtmc = storm::models::sparse::Dtmc; -template +template using SparseMdp = storm::models::sparse::Mdp; -template +template using SparsePomdp = storm::models::sparse::Pomdp; -template -using GenerateMonitorVerifierOptions = - typename storm::generator::GenerateMonitorVerifier::Options; +template +using GenerateMonitorVerifierOptions = typename storm::generator::GenerateMonitorVerifier::Options; -template +template void define_verimon_generator(py::module &m, std::string const &vtSuffix) { - py::class_, - std::shared_ptr>> - mv(m, ("MonitorVerifier" + vtSuffix).c_str(), - "Container for monitor verifier POMDP with associated objects"); - mv.def(py::init &, - const std::map, uint32_t> &, - const std::map &>(), - py::arg("product"), py::arg("observation_map"), - py::arg("default_action_map")); - mv.def("get_product", - &storm::generator::MonitorVerifier::getProduct, - py::return_value_policy::copy); - mv.def_property_readonly( - "observation_map", - &storm::generator::MonitorVerifier::getObservationMap, - py::return_value_policy::copy); - mv.def_property_readonly("default_action_map", - &storm::generator::MonitorVerifier< - ValueType>::getObservationDefaultAction, - py::return_value_policy::copy); + py::class_, std::shared_ptr>> mv( + m, ("MonitorVerifier" + vtSuffix).c_str(), "Container for monitor verifier POMDP with associated objects"); + mv.def(py::init &, const std::map, uint32_t> &, const std::map &>(), + py::arg("product"), py::arg("observation_map"), py::arg("default_action_map")); + mv.def("get_product", &storm::generator::MonitorVerifier::getProduct, py::return_value_policy::copy); + mv.def_property_readonly("observation_map", &storm::generator::MonitorVerifier::getObservationMap, py::return_value_policy::copy); + mv.def_property_readonly("default_action_map", &storm::generator::MonitorVerifier::getObservationDefaultAction, py::return_value_policy::copy); - py::class_> gmv( - m, ("GenerateMonitorVerifier" + vtSuffix).c_str(), - "Generator of POMDP used in verifying monitors against markov chains"); - gmv.def(py::init const &, SparseMdp const &, - std::shared_ptr &, - GenerateMonitorVerifierOptions const &>(), - py::arg("mc"), py::arg("monitor"), py::arg("expr_manager"), - py::arg("options")); - gmv.def("create_product", - &storm::generator::GenerateMonitorVerifier::createProduct, - py::return_value_policy::copy, "Created the verification POMDP"); - gmv.def("set_risk", - &storm::generator::GenerateMonitorVerifier::setRisk, - py::arg("risk")); + py::class_> gmv(m, ("GenerateMonitorVerifier" + vtSuffix).c_str(), + "Generator of POMDP used in verifying monitors against markov chains"); + gmv.def(py::init const &, SparseMdp const &, std::shared_ptr &, + GenerateMonitorVerifierOptions const &>(), + py::arg("mc"), py::arg("monitor"), py::arg("expr_manager"), py::arg("options")); + gmv.def("create_product", &storm::generator::GenerateMonitorVerifier::createProduct, py::return_value_policy::copy, + "Created the verification POMDP"); + gmv.def("set_risk", &storm::generator::GenerateMonitorVerifier::setRisk, py::arg("risk")); - py::class_> gmvopts( - m, ("GenerateMonitorVerifier" + vtSuffix + "Options").c_str(), - "Options for corresponding generator"); - gmvopts.def(py::init<>()); - gmvopts.def_readwrite("good_label", - &GenerateMonitorVerifierOptions::goodLabel); - gmvopts.def_readwrite( - "accepting_label", - &GenerateMonitorVerifierOptions::acceptingLabel); - gmvopts.def_readwrite("step_prefix", - &GenerateMonitorVerifierOptions::stepPrefix); - gmvopts.def_readwrite( - "horizon_label", - &GenerateMonitorVerifierOptions::horizonLabel); - gmvopts.def_readwrite("use_risk", - &GenerateMonitorVerifierOptions::useRisk); - gmvopts.def_readwrite( - "use_rejection_sampling", - &GenerateMonitorVerifierOptions::useRejectionSampling); + py::class_> gmvopts(m, ("GenerateMonitorVerifier" + vtSuffix + "Options").c_str(), + "Options for corresponding generator"); + gmvopts.def(py::init<>()); + gmvopts.def_readwrite("accepting_label", &GenerateMonitorVerifierOptions::acceptingLabel); + gmvopts.def_readwrite("step_prefix", &GenerateMonitorVerifierOptions::stepPrefix); + gmvopts.def_readwrite("horizon_label", &GenerateMonitorVerifierOptions::horizonLabel); + gmvopts.def_readwrite("use_restart_semantics", &GenerateMonitorVerifierOptions::useRestartSemantics); } -template void define_verimon_generator(py::module &m, - std::string const &vtSuffix); -template void -define_verimon_generator(py::module &m, - std::string const &vtSuffix); +template void define_verimon_generator(py::module &m, std::string const &vtSuffix); +template void define_verimon_generator(py::module &m, std::string const &vtSuffix); diff --git a/src/pomdp/transformations.cpp b/src/pomdp/transformations.cpp index 1f42cdfa96..3b27c5569f 100644 --- a/src/pomdp/transformations.cpp +++ b/src/pomdp/transformations.cpp @@ -2,11 +2,11 @@ #include "storm-pomdp/transformer/ApplyFiniteSchedulerToPomdp.h" #include "storm-pomdp/transformer/BinaryPomdpTransformer.h" -#include "storm/transformer/MakePOMDPCanonic.h" #include "storm-pomdp/transformer/ObservationTraceUnfolder.h" #include "storm-pomdp/transformer/PomdpMemoryUnfolder.h" #include "storm/adapters/RationalFunctionAdapter.h" #include "storm/storage/expressions/ExpressionManager.h" +#include "storm/transformer/MakePOMDPCanonic.h" template std::shared_ptr> make_canonic(storm::models::sparse::Pomdp const &pomdp) { @@ -39,9 +39,9 @@ template std::shared_ptr> unfold_trace(storm::models::sparse::Pomdp const &pomdp, std::shared_ptr &exprManager, std::vector const &observationTrace, std::vector const &riskDef, - bool rejectionSampling = true) { + bool restartSemantics = true) { storm::pomdp::ObservationTraceUnfolderOptions options = storm::pomdp::ObservationTraceUnfolderOptions(); - options.rejectionSampling = rejectionSampling; + options.useRestartSemantics = restartSemantics; storm::pomdp::ObservationTraceUnfolder transformer(pomdp, riskDef, exprManager, options); return transformer.transform(observationTrace); } @@ -57,8 +57,8 @@ void define_transformations_nt(py::module &m) { py::class_ options(m, "ObservationTraceUnfolderOptions", "Options for unfolding observation traces"); options.def(py::init<>()); - options.def_readwrite("rejection_sampling", &storm::pomdp::ObservationTraceUnfolderOptions::rejectionSampling, - "Use rejection sampling instead of restarts"); + options.def_readwrite("restart_semantics", &storm::pomdp::ObservationTraceUnfolderOptions::useRestartSemantics, + "Use restart semantics instead of a sink state"); } template @@ -78,7 +78,7 @@ void define_transformations_int(py::module &m, std::string const &vtSuffix) { unfolder.def(py::init, std::vector const &, std::shared_ptr &, storm::pomdp::ObservationTraceUnfolderOptions const &>(), py::arg("model"), py::arg("risk"), py::arg("expression_manager"), py::arg("options"), py::keep_alive<2, 1>()); - unfolder.def("is_rejection_sampling_set", &storm::pomdp::ObservationTraceUnfolder::isRejectionSamplingSet); + unfolder.def("is_restart_semantics_set", &storm::pomdp::ObservationTraceUnfolder::isRestartSemanticsSet); unfolder.def("transform", &storm::pomdp::ObservationTraceUnfolder::transform, py::arg("trace")); unfolder.def("reset", &storm::pomdp::ObservationTraceUnfolder::reset, py::arg("new_observation")); unfolder.def("extend", &storm::pomdp::ObservationTraceUnfolder::extend, py::arg("new_observation")); From 9c5161a83c282e30943904747053df80d607509d Mon Sep 17 00:00:00 2001 From: Luko van der Maas Date: Fri, 17 Apr 2026 12:04:26 +0200 Subject: [PATCH 34/35] revert more changes --- .clangd | 2 ++ Dockerfile | 5 ++--- src/core/modelchecking.cpp | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 .clangd diff --git a/.clangd b/.clangd new file mode 100644 index 0000000000..38812603d5 --- /dev/null +++ b/.clangd @@ -0,0 +1,2 @@ +CompileFlags: + CompilationDatabase: build/cp313-cp313-linux_x86_64 diff --git a/Dockerfile b/Dockerfile index ff6c7599e2..2370bb04be 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ # --build-arg STORM_BASE= # Set Storm base image -ARG STORM_BASE=lukovdm/storm:premise +ARG STORM_BASE=movesrwth/storm:stable FROM $STORM_BASE LABEL org.opencontainers.image.authors="dev@stormchecker.org" @@ -23,7 +23,7 @@ ARG setup_args="" # Optional support to install for stormpy, such as '[test,doc]' ARG options="" # Number of threads to use for parallel compilation -ARG no_threads=24 +ARG no_threads=2 # Install dependencies @@ -76,5 +76,4 @@ RUN pip install -v \ --config-settings=cmake.define.CMAKE_BUILD_PARALLEL_LEVEL=$no_threads \ --config-settings=cmake.build-type=$build_type \ --config-settings=cmake.define.CARLPARSER_DIR_HINT=/opt/carl-parser/build/ \ - --config-settings=cmake.define.STORM_DIR_HINT=/opt/storm/build/ \ $setup_args .$options diff --git a/src/core/modelchecking.cpp b/src/core/modelchecking.cpp index 7e7713718e..804b5c2283 100644 --- a/src/core/modelchecking.cpp +++ b/src/core/modelchecking.cpp @@ -129,6 +129,7 @@ void define_modelchecking(py::module& m) { .def("set_maybe_states", py::overload_cast(&storm::modelchecker::ExplicitModelCheckerHint::setMaybeStates), "sets the maybe states. This is assumed to be correct.") .def("set_compute_only_maybe_states", &storm::modelchecker::ExplicitModelCheckerHint::setComputeOnlyMaybeStates, "value") .def("set_result_hint", py::overload_cast> const&>(&storm::modelchecker::ExplicitModelCheckerHint::setResultHint), "result_hint"_a); + m.def("_get_reachable_states_double", &getReachableStates, py::arg("model"), py::arg("initial_states"), py::arg("constraint_states"), py::arg("target_states"), py::arg("maximal_steps") = boost::none, py::arg("choice_filter") = boost::none); m.def("_get_reachable_states_exact", &getReachableStates, py::arg("model"), py::arg("initial_states"), py::arg("constraint_states"), py::arg("target_states"), py::arg("maximal_steps") = boost::none, py::arg("choice_filter") = boost::none); m.def("_get_reachable_states_rf", &getReachableStates, py::arg("model"), py::arg("initial_states"), py::arg("constraint_states"), py::arg("target_states"), py::arg("maximal_steps") = boost::none, py::arg("choice_filter") = boost::none); @@ -153,7 +154,7 @@ void define_modelchecking(py::module& m) { m.def("check_interval_mdp", &checkIntervalMdp, "Check interval MDP"); m.def("check_exact_interval_mdp", &checkRationalIntervalMdp, "Check exact interval MDP"); m.def("compute_all_until_probabilities", &computeAllUntilProbabilities, "Compute forward until probabilities"); - // m.def("compute_transient_probabilities", &computeTransientProbabilities, "Compute transient probabilities"); + m.def("compute_transient_probabilities", &computeTransientProbabilities, "Compute transient probabilities"); m.def("_compute_prob01states_double", &computeProb01, "Compute prob-0-1 states", py::arg("model"), py::arg("phi_states"), py::arg("psi_states")); m.def("_compute_prob01states_rationalfunc", &computeProb01, "Compute prob-0-1 states", py::arg("model"), py::arg("phi_states"), py::arg("psi_states")); m.def("_compute_prob01states_min_double", &computeProb01min, "Compute prob-0-1 states (min)", py::arg("model"), py::arg("phi_states"), py::arg("psi_states")); From 0a46f3133cec4cc11d452b554f84be6c82a66252 Mon Sep 17 00:00:00 2001 From: Luko van der Maas Date: Fri, 17 Apr 2026 12:05:57 +0200 Subject: [PATCH 35/35] mistake --- .clangd | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 .clangd diff --git a/.clangd b/.clangd deleted file mode 100644 index 38812603d5..0000000000 --- a/.clangd +++ /dev/null @@ -1,2 +0,0 @@ -CompileFlags: - CompilationDatabase: build/cp313-cp313-linux_x86_64