Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for interval-based transitions in storm #409

Merged
merged 46 commits into from
Dec 21, 2023

Conversation

sjunges
Copy link
Contributor

@sjunges sjunges commented Aug 25, 2023

  • Support interval-based models
  • Support import/export to DRN
  • Added Robust VI for MinMaxLinearSolver
  • Various changes that allow doubles as result whereas the model consists of intervals.

In particular, it requires

  • models can have interval-valued transitions
  • models can be parsed and exported to DRN
  • an update of carl, (done, see Interval operations carl-storm#14)
  • control robustness via checktask
  • check scheduler extraction
  • checks to ensure that intervals are non-zero
  • implementation of canHandle
  • merging V1426 carl-storm#21
  • some convenience functions to add uncertainty
  • finished tests,

Things that I will currently not support. I track these in this issue: #469

  • Explicit support for solving on DTMCs -- the DTMCs must be declared as MDPs
  • Support for rewards
  • Bounded reachability properties
  • Topological VI
  • Convenience functions to remove uncertainty (e.g., by taking the 'center').
  • support for robustness in formulas
  • Generating interval models from PRISM/JANI

Other things that I do not support and that I do not see happening right now

  • DD-based representations
  • Modified Policy iteration / LP-based methods
  • Exact intervals

@sjunges sjunges marked this pull request as draft August 25, 2023 18:42
@sjunges
Copy link
Contributor Author

sjunges commented Dec 10, 2023

@volkm The tests currently fail due to /opt/storm/src/storm/models/sparse/Ctmc.cpp:87:45: error: no match for 'operator/' (operand types are 'const storm::storage::MatrixEntry<long unsigned int, carl::Interval<double> >::value_type' {aka 'const carl::Interval<double>'} and 'const __gnu_cxx::__alloc_traits<std::allocator<carl::Interval<double> >, carl::Interval<double> >::value_type' {aka 'const carl::Interval<double>'}) Do you have any clue what is going on here? It looks also in carl/Interval.h, but does not check for the actually correct definition

It looks like this is an issue on the systems based on the debug basesystem. Could it be that they have a slightly outdated carl version? Do you build from tag or from head there?

@volkm
Copy link
Contributor

volkm commented Dec 10, 2023

Yes, the pre-built images use carl-storm:stable and not the latest head. I will update it and then trigger a rerun.

@sjunges sjunges mentioned this pull request Dec 10, 2023
7 tasks
@sjunges
Copy link
Contributor Author

sjunges commented Dec 10, 2023

moves-rwth/carl-storm#21 must be merged first

Copy link
Member

@tquatmann tquatmann left a comment

Choose a reason for hiding this comment

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

Although interval support is still in its infancy, I think this is great progress! Thanks for all the effort :)

I have a few comments (mostly minor) and I added two PRs on your branch here and here

src/storm/storage/SparseMatrix.h Outdated Show resolved Hide resolved
src/storm/storage/SparseMatrix.h Outdated Show resolved Hide resolved
src/storm/storage/SparseMatrix.cpp Outdated Show resolved Hide resolved
src/storm/solver/MinMaxLinearEquationSolver.cpp Outdated Show resolved Hide resolved
tquatmann and others added 8 commits December 15, 2023 21:35
* Moved implementation into the cpp file
* avoid using exceptions for "expected" control flow
* revise the implementation so that we don't need an expression evaluator for intervals
@sjunges
Copy link
Contributor Author

sjunges commented Dec 17, 2023

@volkm @tquatmann I believe this is ready to be reviewed. I would value two pairs of eyes given the large number of essential files being touched.

@sjunges sjunges marked this pull request as ready for review December 17, 2023 21:52
@volkm volkm self-assigned this Dec 18, 2023
Copy link
Member

@tquatmann tquatmann left a comment

Choose a reason for hiding this comment

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

LGTM (besides the minor issues I pointed out)

src/storm/transformer/AddUncertainty.cpp Outdated Show resolved Hide resolved
src/storm/transformer/AddUncertainty.cpp Outdated Show resolved Hide resolved
src/storm/transformer/AddUncertainty.cpp Outdated Show resolved Hide resolved
Copy link
Contributor

@volkm volkm left a comment

Choose a reason for hiding this comment

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

In general, it looks good to me. Thank you for all the work, in particular addingstorm::Interval and SolutionType in so many places.

I have two general comments:

  • I would avoid the if interval { throw ..} else { } and just use if interval { throw} .... That way the else part does not have to be indented and less lines are changed. But this is my personal opinion.
  • In a couple of places we still use assert(..) instead of STORM_LOG_ASSERT(..). But maybe this is more a general issue which could be addressed in a separate issue.

src/storm/storage/BitVector.cpp Show resolved Hide resolved
src/storm/storage/Distribution.cpp Outdated Show resolved Hide resolved
src/storm/storage/Distribution.cpp Outdated Show resolved Hide resolved
src/storm/transformer/AddUncertainty.cpp Outdated Show resolved Hide resolved
@sjunges
Copy link
Contributor Author

sjunges commented Dec 20, 2023

@volkm I tried to remove the else parts, however, they are explicitly necessary right now to make it compile. I therefore ignore your suggestion :-)

@sjunges
Copy link
Contributor Author

sjunges commented Dec 20, 2023

Once this passes all tests, I plan to squash and merge. Thanks for all the feedback.

@volkm
Copy link
Contributor

volkm commented Dec 20, 2023

@volkm I tried to remove the else parts, however, they are explicitly necessary right now to make it compile. I therefore ignore your suggestion :-)

In one instance the issue was just because there was still a dangling } from the else part.

But I am also fine with ignoring the comments.

@sjunges
Copy link
Contributor Author

sjunges commented Dec 21, 2023

@volkm I tried to remove the else parts, however, they are explicitly necessary right now to make it compile. I therefore ignore your suggestion :-)

In one instance the issue was just because there was still a dangling } from the else part.

But I am also fine with ignoring the comments.

That was why the CI failed. But fixing that does not make the code compile.

Note that these are if constexpr (...). The code in the else block is only compiled for non-interval value types. That is essential, because e.g. there is no SoundValueIteration for storm::Interval.
By removing the else block, the code is compiled for storm::Interval, leading to compile errors.

@volkm
Copy link
Contributor

volkm commented Dec 21, 2023

You are fully right and now I understand the issue. Thanks for the explanation.

Copy link
Contributor

@volkm volkm left a comment

Choose a reason for hiding this comment

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

All my comments have been addressed. We can merge it.

@sjunges sjunges merged commit d7bc9e7 into moves-rwth:master Dec 21, 2023
14 checks passed
@sjunges sjunges deleted the intervals branch December 21, 2023 08:01
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.

3 participants