Skip to content

Bounded MC support for IDTMCs + Bugfixes + Unification of bounded MC logic#916

Merged
tquatmann merged 7 commits into
stormchecker:masterfrom
plindnercs:idtmc-bounded-mc
May 12, 2026
Merged

Bounded MC support for IDTMCs + Bugfixes + Unification of bounded MC logic#916
tquatmann merged 7 commits into
stormchecker:masterfrom
plindnercs:idtmc-bounded-mc

Conversation

@plindnercs
Copy link
Copy Markdown
Contributor

@plindnercs plindnercs commented Apr 22, 2026

This pull request includes:

  • bounded MC support for IDTMCs,
  • unification of the bounded MC logic for deterministic and non-deterministic models and
  • a fix for the off-by-one error during bounded MC of interval models,

and thus resolves #914.

…fixed computation of exact bounds + unified code for deterministic and non-deterministic models
@plindnercs plindnercs changed the title implemented bounded mc support for IDTMCs + fixed off-by-one error + … Bounded MC support for IDTCs + Bugfixes + Unification of bounded MC logic Apr 22, 2026
@plindnercs plindnercs changed the title Bounded MC support for IDTCs + Bugfixes + Unification of bounded MC logic Bounded MC support for IDTMCs + Bugfixes + Unification of bounded MC logic Apr 22, 2026
@tquatmann tquatmann self-assigned this Apr 30, 2026
Comment thread resources/examples/testfiles/dtmc/tiny-01.drn
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change

@@ -0,0 +1,198 @@
#include "SparseStepBoundedHorizonHelper.h"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
#include "SparseStepBoundedHorizonHelper.h"
#include "storm/modelchecker/helper/finitehorizon/SparseStepBoundedHorizonHelper.h"

@@ -0,0 +1,198 @@
#include "SparseStepBoundedHorizonHelper.h"
#include "storm/adapters/IntervalAdapter.h"
#include "storm/adapters/IntervalForward.h"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
#include "storm/adapters/IntervalForward.h"

The *Forward headers don't need to be included when the actual header is included, too.

Same for RationalNumberForward below.

#include "storm/adapters/RationalNumberAdapter.h"
#include "storm/adapters/RationalNumberForward.h"
#include "storm/modelchecker/hints/ExplicitModelCheckerHint.h"
#include "storm/modelchecker/prctl/helper/SparseMdpEndComponentInformation.h"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
#include "storm/modelchecker/prctl/helper/SparseMdpEndComponentInformation.h"

#include "storm/utility/macros.h"
#include "storm/utility/vector.h"

#include "storm/environment/solver/MinMaxSolverEnvironment.h"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
#include "storm/environment/solver/MinMaxSolverEnvironment.h"

Comment on lines +174 to +180
if (lowerBound == 0) {
maybeStates &= ~psiStates;
}

if constexpr (storm::IsIntervalType<ValueType>) {
maybeStates &= ~psiStates;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why are we always excluding psiStates for interval models?

Also, this avoids potentially excluding them twice :)

Suggested change
if (lowerBound == 0) {
maybeStates &= ~psiStates;
}
if constexpr (storm::IsIntervalType<ValueType>) {
maybeStates &= ~psiStates;
}
if (storm::IsIntervalType<ValueType> || lowerBound == 0) {
maybeStates &= ~psiStates;
}

// For the 'maybeStates' we definitely have to compute the values.
storm::storage::BitVector maybeStates = computeMaybeStates(goal, transitionMatrix, backwardTransitions, phiStates, psiStates, lowerBound, upperBound, hint);
storm::storage::BitVector makeZeroColumns;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Add a comment here that explains the procedure for lowerbound!=0 and/or interval types

@volkm volkm added this to the 1.13 milestone May 4, 2026
@plindnercs
Copy link
Copy Markdown
Contributor Author

Thanks for your feedback @tquatmann! I was able to simplify the logic of computing the 'maybeStates' a bit and added some comments for further clarification.

@tquatmann
Copy link
Copy Markdown
Contributor

I had some trouble following the code in the SparseStepBoundedHorizonHelper (both, interval and non-interval code). Of course, this has been an issue already before this PR.

Anyway, I have spent some effort to (hopefully) simplify the computations and streamline the different cases. Would be good if someone can have a short look at SparseStepBoundedHorizon.cpp before merging.


// We identify states that must have probability 0 of reaching the target states to exclude them in the further analysis.
storm::storage::BitVector const probGreater0States =
detail::computeProbGreater0States<ValueType, SolutionType>(goal, transitionMatrix, backwardTransitions, phiStates, psiStates, upperBound, hint);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should one do this analysis also in two phases, as in, first look for upperBound-lowerBound, as that is a smaller number it may be quicker and more states will be zero, which is good for the first phase, and for the second phase, we can then use the actual zeros from the first phase with again a reduced number of iterations.

I do think the current implementation is also correct, just potentially a bit slower (caching effects may also invalidate anything i said)...

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Indeed, this could work, and would probably be a bit faster in cases where the bounds are small compared to the number of states. Not sure how common this case is.

However, I think I will merge this PR for now, so that we have a correct implementation in master.

@sjunges
Copy link
Copy Markdown
Contributor

sjunges commented May 9, 2026

LGTM! Many thanks both.

@tquatmann tquatmann merged commit 36285af into stormchecker:master May 12, 2026
22 checks passed
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.

Interval Models: Off by one error during bounded MC

4 participants