Adaption to Environment and ExtendedNumber - #453
Merged
Conversation
There was a problem hiding this comment.
🔵 Needs a closer look
It changes core binding surfaces and numeric conversion behavior in ways that could have subtle runtime/ABI effects and should be validated by a human with the target Storm version and full test/CI context.
Pull request overview
This PR updates stormpy’s Python bindings to match upstream Storm API changes around Environment initialization and ExtendedNumber usage, avoiding early/default Environment construction and converting extended numeric results back to the exposed ValueType in bindings.
Changes:
- Update parametric instantiation checker bindings/tests to require an explicit
Environmentat construction time. - Convert Storm’s
ExtendedNumber-based return values to plain binding value types viastorm::utility::narrow(...)(incl. DFT analysis, PLA extremum/bounds, and result min/max/value accessors). - Remove
storm::Environment()default arguments from several pybind-exposed functions to prevent import-time environment creation issues.
File summaries
| File | Description |
|---|---|
| tests/pars/test_model_instantiator.py | Adapts tests to new instantiation checker constructor requiring an explicit Environment. |
| src/pars/pla.cpp | Narrows extended numeric results when returning region bounds/extrema through bindings. |
| src/pars/model_instantiator.cpp | Updates instantiation checker pybind constructors to accept Environment + model. |
| src/dft/analysis.cpp | Converts DFT analysis results from extended numeric type back to ValueType. |
| src/core/result.cpp | Narrows min/max/at() and switches get_values() to a finite value vector to avoid exposing ExtendedNumber. |
| src/core/modelchecking.cpp | Removes default-constructed Environment from pybind function signatures. |
| src/core/core.cpp | Removes default-constructed Environment from symbolic build binding signatures. |
Review details
- Files reviewed: 7/7 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adaption to changes in stormchecker/storm#1025 and stormchecker/storm#1040.
ExtendedNumberare converted toValueTypeinternally and not made available as stormpy bindings (yet).An interesting was
ImportError: IllegalFunctionCallException: Cannot retrieve unknown module 'general'.The problem was that the Environment constructor now depends on GeneralSettings. The default environment is created before the settings are initialized, leading to this issue when importing stormpy. Removing the default argument fixes this issue.