Skip to content

Refactor/monotonicity module - #976

Open
sjunges wants to merge 10 commits into
stormchecker:masterfrom
sjunges:refactor/monotonicity-module
Open

Refactor/monotonicity module#976
sjunges wants to merge 10 commits into
stormchecker:masterfrom
sjunges:refactor/monotonicity-module

Conversation

@sjunges

@sjunges sjunges commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Resolved some bugs and memory management issues. Represent assumptions with a dedicated datastructure. Minimally invasive changes; the original benchmark tables can be more or less verbatim be reproduced.

My goal was fixing part of #199 and preparing this code for an API pass. Performance tweaks and some other style issues are tabled.

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.

Pull request overview

Refactors the monotonicity/reachability-order implementation to address memory-management issues from raw new allocations and ExpressionManager usage, while preparing the module for a future API pass (per #199).

Changes:

  • Reworks Order node ownership to use std::unique_ptr storage and adds a deep-copying copy constructor/assignment, plus regression tests for deep copy + inconsistent merges.
  • Introduces a lightweight storm::analysis::Assumption value type and migrates assumption creation/checking away from expression-based objects to reduce allocations and avoid lifetime/cycle issues.
  • Consolidates OrderExtender per-order bookkeeping into a dedicated Context keyed by weak_ptr, and updates monotonicity-building logic to be iterative (worklist) rather than recursive.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/test/storm-pars/modelchecker/region/monotonicity/OrderTest.cpp Adds regression tests for deep-copy behavior and inconsistent merges.
src/test/storm-pars/modelchecker/region/monotonicity/AssumptionMakerTest.cpp Updates tests to the new Assumption value type and asserts deterministic candidate ordering.
src/test/storm-pars/modelchecker/region/monotonicity/AssumptionCheckerTest.cpp Migrates tests away from expression-based assumptions to Assumption.
src/storm-pars/modelchecker/region/monotonicity/OrderExtender.h Switches assumptions to std::optional<Assumption>, introduces per-order Context, and moves to unique_ptr ownership for AssumptionMaker.
src/storm-pars/modelchecker/region/monotonicity/OrderExtender.cpp Implements Context handling, improves invalid-order bailouts, and refactors initial order construction.
src/storm-pars/modelchecker/region/monotonicity/OrderBasedMonotonicityBackend.cpp Fixes bounds initialization to set min/max correctly.
src/storm-pars/modelchecker/region/monotonicity/Order.h Adds deep-copy/assignment support and node allocation helper with owned storage.
src/storm-pars/modelchecker/region/monotonicity/Order.cpp Implements deep copy, unique_ptr node ownership, and more robust invalid-merge handling/assertions.
src/storm-pars/modelchecker/region/monotonicity/MonotonicityHelper.h Updates result/assumption types and switches extender ownership to unique_ptr.
src/storm-pars/modelchecker/region/monotonicity/MonotonicityHelper.cpp Refactors assumption-branch exploration to an iterative worklist using Assumption.
src/storm-pars/modelchecker/region/monotonicity/AssumptionMaker.h Changes assumption API to return ordered candidate vectors of (Assumption, status).
src/storm-pars/modelchecker/region/monotonicity/AssumptionMaker.cpp Implements vector-based assumption candidates and removes ExpressionManager allocation/variable setup.
src/storm-pars/modelchecker/region/monotonicity/AssumptionChecker.h Migrates checker APIs to take Assumption by value/reference.
src/storm-pars/modelchecker/region/monotonicity/AssumptionChecker.cpp Implements sample/SMT checking using Assumption instead of expression objects.
src/storm-pars/modelchecker/region/monotonicity/Assumption.h Adds the new Assumption data structure.
src/storm-pars/modelchecker/region/monotonicity/Assumption.cpp Adds logging/printing for Assumption.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/storm-pars/modelchecker/region/monotonicity/Assumption.cpp
sjunges added 2 commits August 8, 2026 20:06
…or<<

Both silently treated any non-Greater relation as Equal, per Copilot
review comments.
@sjunges sjunges added this to the 1.15 milestone Aug 12, 2026
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