Skip to content

Adaption to Environment and ExtendedNumber - #453

Merged
volkm merged 3 commits into
stormchecker:masterfrom
volkm:adaption
Sep 9, 2026
Merged

Adaption to Environment and ExtendedNumber#453
volkm merged 3 commits into
stormchecker:masterfrom
volkm:adaption

Conversation

@volkm

@volkm volkm commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Adaption to changes in stormchecker/storm#1025 and stormchecker/storm#1040.

ExtendedNumber are converted to ValueType internally 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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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 Environment at construction time.
  • Convert Storm’s ExtendedNumber-based return values to plain binding value types via storm::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.

@volkm
volkm merged commit 90df186 into stormchecker:master Sep 9, 2026
23 checks passed
@volkm
volkm deleted the adaption branch September 9, 2026 07:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants