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

iMC changes inside of storm-pars #640

Draft
wants to merge 171 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
171 commits
Select commit Hold shift + click to select a range
e16f242
Add Robust Parameter Lifting Algorithm
glatteis Feb 6, 2024
0d0675c
Merge branch 'master' of github.com:moves-rwth/storm into robustpla
glatteis Feb 12, 2024
b829776
First version of horizon-bounded big-step and time-travelling
glatteis Feb 15, 2024
fd8acbe
applyRowRobust optimization
glatteis Feb 19, 2024
7cae91c
Revert changes in ValueIterationOperator.cpp
glatteis Feb 21, 2024
0e06f0c
Add support for ill-defined regions
glatteis Feb 23, 2024
f2571c3
Revert "Revert changes in ValueIterationOperator.cpp"
glatteis Feb 23, 2024
135619b
WIP commit
glatteis Feb 27, 2024
4b94de0
Revert "Revert "Revert changes in ValueIterationOperator.cpp""
glatteis Feb 27, 2024
bee2544
Best version of robust value iteration
glatteis Feb 29, 2024
49e2860
Fix: copy x here
glatteis Mar 4, 2024
a9f25c2
New RegionRefinementChecker and AnnotatedRegion (work in progress)
tquatmann Mar 11, 2024
5a97d3d
Almost works?
glatteis Mar 11, 2024
28f51ac
towards compiling again and a simpler ValidatingSparseParameterLiftin…
tquatmann Mar 13, 2024
af044ee
A lot of stuff, everywhere
glatteis Mar 15, 2024
ac1d2f4
Format
glatteis Mar 15, 2024
d432df3
WIP refactor of TimeTravelling.cpp (does not compile yet)
glatteis Mar 15, 2024
9c0ccc4
towards compiling again and OrderBasedMonotonicityBackend (work in pr…
tquatmann Mar 16, 2024
105b9d9
Finally compiling again. Not tested yet.
tquatmann Mar 19, 2024
d3cee7f
work on order-based monotonicity backend & various fixes
tquatmann Mar 20, 2024
878fe6f
Fixed build with cln numbers
tquatmann Mar 20, 2024
b325ea3
refactor time-travelling
glatteis Mar 20, 2024
5f75b2a
whoops
glatteis Mar 21, 2024
23d92f8
Fixed build with cln numbers [Part 2]
tquatmann Mar 21, 2024
faa786d
Fix cubicEquationZeroes code
glatteis Mar 21, 2024
b12e273
3 fixes
tquatmann Mar 21, 2024
bd610ac
Correct preprocessing for b-vectors with intervals in ValueIterationH…
glatteis Mar 22, 2024
03c9f5d
Merge branch 'master' of github.com:moves-rwth/storm into robustpla
glatteis Mar 22, 2024
26f31d6
Optimize time-travelling
glatteis Mar 22, 2024
1595d86
Fix non-const ASSERT statement that broke in release mode
glatteis Mar 25, 2024
df78b3f
Find polynomial roots using SMT solver
glatteis Mar 26, 2024
8cb8882
bigstep rewrite
glatteis Mar 27, 2024
201ce51
New BigStep algorithm uses DFS and BFS :)
glatteis Apr 2, 2024
1856ad3
Cache polynomial multiplication, polynomial addition still slow
glatteis Apr 2, 2024
3407d5e
Still a couple of TODOs left, mainly the incredibly slow operations o…
glatteis Apr 2, 2024
e6eed5c
Talk to the SMT solver a little better
glatteis Apr 2, 2024
c3ace88
Fix updateTreeStates
glatteis Apr 2, 2024
1ae3748
Fix TimeTravellingTest to use strong bisim
glatteis Apr 8, 2024
3dd506a
Merge branch 'master' of github.com:moves-rwth/storm into robustpla
glatteis Apr 8, 2024
f3d8edf
New method name for robust scheduler tracking helper
glatteis Apr 8, 2024
601e2c7
Find roots with CARL as well
glatteis Apr 8, 2024
e230dbb
Make time-travelling work with only the annotations
glatteis Apr 10, 2024
664474e
Polished code
tquatmann Apr 10, 2024
86b54c8
Remove commented code
tquatmann Apr 10, 2024
b314bb8
Split MonotonicityAnnotation from AnnotatedRegion
tquatmann Apr 10, 2024
f81753a
Interval arithmetic works but I still need to figure out how to do th…
glatteis Apr 10, 2024
4b37b5f
implemented feedback by LH
tquatmann Apr 11, 2024
8a148ac
clean-up of includes, silence warning concerning usage of class vs. s…
tquatmann Apr 11, 2024
595a20a
WIP: Rootfinding
glatteis Apr 12, 2024
3e02cce
WIP: Interval Arithmetic
glatteis Apr 17, 2024
b0abc39
Mix derivative intervalling with rootfinding
glatteis Apr 24, 2024
588d7d8
Solve grid issue
glatteis May 1, 2024
82d0335
Performance-related fixes
glatteis May 3, 2024
00c436f
Add round-robin and CLI stuff for region refinement
glatteis May 7, 2024
c8efba6
Implement estimate-based splitting
glatteis May 8, 2024
6686607
Add --estimate-method CLI argument
glatteis May 21, 2024
eb1e3b0
Do not split on monotone parameters if mode is feasibility
glatteis May 21, 2024
01ad349
Small fixes
glatteis May 21, 2024
1038219
Merge branch 'region-refinement' of github.com:linusheck/storm into r…
glatteis May 21, 2024
7783ca5
Amend estimate based strategy to not request estimates if maxSplitDim…
glatteis May 21, 2024
ed351d4
Merge branch 'region-refinement' of github.com:linusheck/storm into r…
glatteis May 21, 2024
d2227f1
WIP commit
glatteis May 24, 2024
fc1fffb
WIP commit
glatteis May 27, 2024
d32f833
Add regions to GD
glatteis May 27, 2024
be5e682
WIP: Add minmaxdelta strategies
glatteis Jun 3, 2024
7de29ca
Conservative extension of state-value-delta
glatteis Jun 5, 2024
22b586a
WIP
glatteis Jun 20, 2024
f323c96
Fix bigstep bug
glatteis Jun 26, 2024
61f40f1
Compute subgraph, including edges, in time travelling
glatteis Jun 28, 2024
8f2281e
Add IntervalEndComponentPreserver
glatteis Jul 3, 2024
9f908be
Update src/storm-pars-cli/storm-pars.cpp
linusheck Jul 9, 2024
e17bcd4
Update src/storm-pars-cli/storm-pars.cpp
linusheck Jul 9, 2024
0bfed3c
Update src/storm-pars/modelchecker/region/RegionRefinementChecker.cpp
linusheck Jul 9, 2024
361aabb
Update src/storm-pars/modelchecker/region/SparseDtmcParameterLiftingM…
linusheck Jul 9, 2024
b0d2a2a
Update src/storm-pars/modelchecker/region/RegionRefinementChecker.cpp
linusheck Jul 9, 2024
dd31238
Fix suggestions around RegionRefinementChecker loop
glatteis Jul 9, 2024
7ade3a1
PRINT_AND_LOG links now
glatteis Jul 9, 2024
9aa565c
Fix second splitting loop
glatteis Jul 9, 2024
2d6bf34
Fix format?
glatteis Jul 9, 2024
26a689b
Change region splitting strategy heuristic API
glatteis Jul 9, 2024
aee5f58
Print default
glatteis Jul 9, 2024
daaa039
Fix format?
glatteis Jul 10, 2024
21acd0b
Complain if bigstep gets a non-probabilistic matrix
glatteis Jul 16, 2024
502f8d8
Fix compile
glatteis Jul 16, 2024
cdb6a3b
Merge branch 'robustpla' of github.com:glatteis/storm-private into ro…
glatteis Jul 16, 2024
1d68644
Fix weird Release GCC behavior
glatteis Jul 18, 2024
337ce74
Merge branch 'robustpla' of github.com:glatteis/storm-private into ro…
glatteis Jul 18, 2024
9687630
Fix Gmp number conversions and interval end component preserving
glatteis Jul 18, 2024
54aa476
Fix incorrect check in ValueIterationOperator
glatteis Jul 23, 2024
d96aeba
Fix result vector size
glatteis Jul 25, 2024
05725e9
Fix the fix
glatteis Jul 25, 2024
79d2f8e
Fix bugs in interval component preserver, warm-start
glatteis Jul 25, 2024
9d34a8a
Fix assert
glatteis Jul 26, 2024
ac96a58
Remove prints
glatteis Jul 26, 2024
84cd4b6
Merge remote-tracking branch 'fork/region-refinement' into robustpla
glatteis Jul 26, 2024
ec85113
Merge branch 'robustpla' of github.com:glatteis/storm-private into ro…
glatteis Jul 26, 2024
f739523
Add --not-graph-preserving flag
glatteis Aug 1, 2024
f9a1c7e
Improve interval evaluation for non-factorizable polynomials
glatteis Aug 2, 2024
616f34e
WIP: Add interval non-trivial MEC detection and elimination
glatteis Aug 2, 2024
1e6392a
Merge branch 'not-graph-preserving' of github.com:linusheck/storm int…
glatteis Aug 2, 2024
3697673
Does this fix the weird compile issue?
glatteis Aug 2, 2024
6061528
Remove some TODOs
glatteis Aug 2, 2024
2e2f71f
Fix maze problem
glatteis Aug 4, 2024
689cf57
Fix bug in interval evaluation
glatteis Aug 4, 2024
2db851d
Preserve reward models in graph-preserving bisim
glatteis Aug 5, 2024
80480af
Fix part of the tests :D
glatteis Aug 5, 2024
ed19aa8
Fix target set bug, add tests for non-graph-preserving checker on gra…
glatteis Aug 5, 2024
5054a58
Eliminate target, sink state from matrix
glatteis Aug 5, 2024
51ad42a
Change behavior of MEC elimination, add test
glatteis Aug 6, 2024
f3dd68b
Remove include
glatteis Aug 7, 2024
6901552
fix some details, add some prints
glatteis Aug 7, 2024
f00afcf
Cache optimizations
glatteis Aug 7, 2024
5a4c871
add some optimizations that i hope actually make the code faster
glatteis Aug 7, 2024
74b6368
fix derivatives
glatteis Aug 7, 2024
4e58ef1
remove couts
glatteis Aug 7, 2024
76dca2b
Remove prints
glatteis Aug 8, 2024
c9f53a2
Fix bug in bigstep
glatteis Aug 21, 2024
c7d12b3
aaahhh
glatteis Aug 22, 2024
1cc4a06
Small but important bigstep tweaks
glatteis Sep 13, 2024
30f0887
no couts
glatteis Sep 13, 2024
ad976d1
Redirect eliminated in nontrivial MECs
glatteis Sep 18, 2024
8b0a840
Add discrete parameters
glatteis Sep 27, 2024
7b1b8a3
Do not split on fixed parameters
glatteis Sep 27, 2024
47dd410
remove couts
glatteis Sep 30, 2024
f59aabc
Fix parseVariableList
glatteis Oct 4, 2024
482a6e8
bigstep topological ordering
glatteis Oct 8, 2024
bde6169
Simple special case
glatteis Oct 9, 2024
30f92a8
Change pointing
glatteis Oct 9, 2024
ef4c0ca
more robust optimization
glatteis Oct 9, 2024
ed18a69
Fix estimate method
glatteis Oct 9, 2024
2b47a71
Fix estimate method
glatteis Oct 9, 2024
1fc089d
Revert "more robust optimization"
glatteis Oct 9, 2024
6eb1701
Revert "Change pointing"
glatteis Oct 9, 2024
06a5434
Revert "Simple special case"
glatteis Oct 9, 2024
c94d846
just trying something out...
glatteis Oct 11, 2024
845de7b
fix stateeliminator
glatteis Oct 11, 2024
9878a51
Fix estimate bug
glatteis Oct 12, 2024
7eb0faa
Merge branch 'master' of github.com:moves-rwth/storm into robustpla
glatteis Oct 28, 2024
8a144f6
Header fixes
glatteis Oct 29, 2024
02cc238
setup Topological MinMax equation solver so I can eventually port it …
glatteis Oct 29, 2024
cad7131
WIP on feasibility
glatteis Nov 1, 2024
34c473f
Merge branch 'master' of github.com:moves-rwth/storm into robustpla
glatteis Nov 1, 2024
e6e6fdd
iMC changes outside of storm-pars
glatteis Nov 1, 2024
c1a741a
Remove commented out code
glatteis Nov 1, 2024
28ec366
Format
glatteis Nov 1, 2024
7a7376a
fix verification mode
glatteis Nov 11, 2024
217c5a8
Fix iMDPs
glatteis Nov 12, 2024
b32ec4c
Format
glatteis Nov 12, 2024
2d7239c
Fix POMDP test segfault
glatteis Nov 18, 2024
0ee405b
Fix other POMDP test
glatteis Nov 18, 2024
3f9e564
Merge branch 'robustpla-storm' into robustpla
glatteis Nov 19, 2024
e6f520c
Format and reset testfiles
glatteis Nov 19, 2024
1184fa5
Default should be to not skip constant deterministic state elimination
glatteis Nov 19, 2024
f4077dc
Remove z3_api include
glatteis Nov 19, 2024
a8f1952
Delete disabled tests
glatteis Nov 19, 2024
c216bfc
Remove z3 include
glatteis Nov 20, 2024
342b237
CARL splitting strategy segfaults, so change it?
glatteis Nov 20, 2024
6d2ab9f
Merge branch 'robustpla' of https://github.com/linusheck/storm into r…
glatteis Nov 20, 2024
164f5c1
Format
glatteis Nov 20, 2024
25d0841
Include RationalNumberForward in ParameterRegion.h
glatteis Nov 21, 2024
698a5f9
Format
glatteis Nov 21, 2024
59dea93
Maybe RationalNumber(x,y) just doesn't exist for cln
glatteis Nov 21, 2024
adb208c
Remove RationalNumber mention
glatteis Nov 21, 2024
056fbe1
Fix BinaryDtmcTransformerTest
glatteis Nov 21, 2024
3e09162
Not sure what the problem is
glatteis Nov 26, 2024
58d4467
Remove print
glatteis Nov 29, 2024
d87be08
Skip tests if Z3 not available
glatteis Nov 29, 2024
05c7b2f
Format >:(
glatteis Nov 29, 2024
a9397bd
Fix BinaryDtmcTransformerTest
glatteis Nov 29, 2024
3a0e6d0
TEST -> TEST_F
glatteis Nov 29, 2024
8202517
Warning was inverted >:(
glatteis Dec 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions resources/examples/testfiles/pdtmc/only_p.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
dtmc

const double p;

module test

// local state
s : [0..1] init 0;

[] s=0 -> p : (s'=0) + (1-p) : (s'=1);
[] s=1 -> 1 : (s'=1);

endmodule

label "target" = s=1;
4 changes: 2 additions & 2 deletions src/storm-cli-utilities/model-handling.h
Original file line number Diff line number Diff line change
Expand Up @@ -572,14 +572,14 @@ std::shared_ptr<storm::models::sparse::Model<ValueType>> preprocessSparseMarkovA
template<typename ValueType>
std::shared_ptr<storm::models::sparse::Model<ValueType>> preprocessSparseModelBisimulation(
std::shared_ptr<storm::models::sparse::Model<ValueType>> const& model, SymbolicInput const& input,
storm::settings::modules::BisimulationSettings const& bisimulationSettings) {
storm::settings::modules::BisimulationSettings const& bisimulationSettings, bool graphPreserving = true) {
storm::storage::BisimulationType bisimType = storm::storage::BisimulationType::Strong;
if (bisimulationSettings.isWeakBisimulationSet()) {
bisimType = storm::storage::BisimulationType::Weak;
}

STORM_LOG_INFO("Performing bisimulation minimization...");
return storm::api::performBisimulationMinimization<ValueType>(model, createFormulasToRespect(input.properties), bisimType);
return storm::api::performBisimulationMinimization<ValueType>(model, createFormulasToRespect(input.properties), bisimType, graphPreserving);
}

template<typename ValueType>
Expand Down
37 changes: 26 additions & 11 deletions src/storm-pars-cli/feasibility.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#include "storm-pars-cli/feasibility.h"
#include <optional>

#include "storm-pars/modelchecker/region/RegionSplittingStrategy.h"
#include "storm-pars/storage/ParameterRegion.h"
#include "storm/api/verification.h"

#include "storm/settings/SettingsManager.h"
Expand Down Expand Up @@ -110,9 +113,7 @@ void runFeasibilityWithGD(std::shared_ptr<storm::models::sparse::Model<ValueType

STORM_LOG_THROW(model->isOfType(storm::models::ModelType::Dtmc), storm::exceptions::NotSupportedException,
"Gradient descent is currently only supported for DTMCs.");
STORM_LOG_THROW(!task->isRegionSet(), storm::exceptions::NotSupportedException, "Gradient descent only works with *the* graph-preserving region.");
std::shared_ptr<storm::models::sparse::Dtmc<ValueType>> dtmc = model->template as<storm::models::sparse::Dtmc<ValueType>>();

STORM_LOG_THROW(task->getFormula().isProbabilityOperatorFormula() || task->getFormula().isRewardOperatorFormula(), storm::exceptions::NotSupportedException,
"Input formula needs to be either a probability operator formula or a reward operator formula.");
STORM_LOG_THROW(task->isBoundSet(), storm::exceptions::NotImplementedException, "GD (right now) requires an explicitly given bound.");
Expand Down Expand Up @@ -145,14 +146,19 @@ void runFeasibilityWithGD(std::shared_ptr<storm::models::sparse::Model<ValueType
return;
}

boost::optional<std::map<typename utility::parametric::VariableType<ValueType>::type, typename utility::parametric::CoefficientType<ValueType>::type>>
std::optional<std::map<typename utility::parametric::VariableType<ValueType>::type, typename utility::parametric::CoefficientType<ValueType>::type>>
startPoint;

std::optional<storage::ParameterRegion<storm::RationalFunction>> region;
if (task->isRegionSet()) {
region = task->getRegion();
}

STORM_PRINT("Finding an extremum using Gradient Descent\n");
storm::utility::Stopwatch derivativeWatch(true);
storm::derivative::GradientDescentInstantiationSearcher<storm::RationalFunction, double> gdsearch(
*dtmc, *method, derSettings.getLearningRate(), derSettings.getAverageDecay(), derSettings.getSquaredAverageDecay(), derSettings.getMiniBatchSize(),
derSettings.getTerminationEpsilon(), startPoint, *constraintMethod, derSettings.isPrintJsonSet());
derSettings.getTerminationEpsilon(), startPoint, *constraintMethod, region, derSettings.isPrintJsonSet());

gdsearch.setup(Environment(), task);
auto instantiationAndValue = gdsearch.gradientDescent();
Expand Down Expand Up @@ -194,13 +200,21 @@ void runFeasibilityWithPLA(std::shared_ptr<storm::models::sparse::Model<ValueTyp
// TODO handle omittedParameterss
auto regionVerificationSettings = storm::settings::getModule<storm::settings::modules::RegionVerificationSettings>();
auto engine = regionVerificationSettings.getRegionCheckEngine();
bool generateSplitEstimates = regionVerificationSettings.isSplittingThresholdSet();

auto regionSplittingStrategy = modelchecker::RegionSplittingStrategy();

regionSplittingStrategy.heuristic = regionVerificationSettings.getRegionSplittingHeuristic();
regionSplittingStrategy.estimateKind = regionVerificationSettings.getRegionSplittingEstimateMethod();
if (regionVerificationSettings.isSplittingThresholdSet()) {
regionSplittingStrategy.maxSplitDimensions = regionVerificationSettings.getSplittingThreshold();
}

if (task->isBoundSet()) {
storm::utility::Stopwatch watch(true);
auto valueValuation = storm::api::computeExtremalValue<ValueType>(
model, storm::api::createTask<ValueType>(task->getFormula().asSharedPointer(), true), task->getRegion(), engine, direction,
storm::utility::zero<ValueType>(), !task->isMaxGapRelative(), monotonicitySettings, task->getBound().getInvertedBound(), generateSplitEstimates);
auto const& settings = storm::api::RefinementSettings<ValueType>{model, storm::api::createTask<ValueType>(task->getFormula().asSharedPointer(), true),
engine, regionSplittingStrategy};
auto valueValuation = storm::api::computeExtremalValue<ValueType>(settings, task->getRegion(), direction, storm::utility::zero<ValueType>(),
!task->isMaxGapRelative(), task->getBound().getInvertedBound());
watch.stop();

printFeasibilityResult(task->getBound().isSatisfied(valueValuation.first), valueValuation, watch);
Expand All @@ -210,9 +224,10 @@ void runFeasibilityWithPLA(std::shared_ptr<storm::models::sparse::Model<ValueTyp

ValueType precision = storm::utility::convertNumber<ValueType>(task->getMaximalAllowedGap().value());
storm::utility::Stopwatch watch(true);
auto valueValuation = storm::api::computeExtremalValue<ValueType>(model, storm::api::createTask<ValueType>(task->getFormula().asSharedPointer(), true),
task->getRegion(), engine, direction, precision, !task->isMaxGapRelative(),
monotonicitySettings, std::nullopt, generateSplitEstimates);
auto const& settings = storm::api::RefinementSettings<ValueType>{model, storm::api::createTask<ValueType>(task->getFormula().asSharedPointer(), true),
engine, regionSplittingStrategy};
auto valueValuation = storm::api::computeExtremalValue<ValueType>(settings, task->getRegion(), direction, storm::utility::zero<ValueType>(),
!task->isMaxGapRelative(), std::nullopt);
watch.stop();

printFeasibilityResult(true, valueValuation, watch);
Expand Down
80 changes: 67 additions & 13 deletions src/storm-pars-cli/storm-pars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

#include "storm-pars/derivative/SparseDerivativeInstantiationModelChecker.h"
#include "storm-pars/modelchecker/instantiation/SparseCtmcInstantiationModelChecker.h"
#include "storm-pars/modelchecker/region/RegionSplittingStrategy.h"
#include "storm-pars/modelchecker/region/SparseDtmcParameterLiftingModelChecker.h"
#include "storm-pars/modelchecker/region/SparseParameterLiftingModelChecker.h"

Expand All @@ -36,6 +37,7 @@
#include "storm-parsers/parser/KeyValueParser.h"
#include "storm/api/storm.h"

#include "storm/environment/Environment.h"
#include "storm/exceptions/BaseException.h"
#include "storm/exceptions/InvalidSettingsException.h"
#include "storm/exceptions/NotSupportedException.h"
Expand Down Expand Up @@ -82,6 +84,19 @@ std::vector<storm::storage::ParameterRegion<ValueType>> parseRegions(std::shared
} else if (regionSettings.isRegionBoundSet()) {
result = storm::api::createRegion<ValueType>(regionSettings.getRegionBoundString(), *model);
}
if (!regionSettings.isNotGraphPreservingSet()) {
for (auto const& region : result) {
for (auto const& variable : region.getVariables()) {
if (region.getLowerBoundary(variable) <= storm::utility::zero<typename storm::utility::parametric::CoefficientType<ValueType>::type>() ||
region.getUpperBoundary(variable) >= storm::utility::one<typename storm::utility::parametric::CoefficientType<ValueType>::type>()) {
STORM_LOG_WARN(
"Region" << region
<< " appears to not preserve the graph structure of the parametric model. If this is the case, --not-graph-preserving.");
break;
}
}
}
}
return result;
}

Expand Down Expand Up @@ -202,6 +217,7 @@ PreprocessResult preprocessSparseModel(std::shared_ptr<storm::models::sparse::Mo
auto parametricSettings = storm::settings::getModule<storm::settings::modules::ParametricSettings>();
auto transformationSettings = storm::settings::getModule<storm::settings::modules::TransformationSettings>();
auto monSettings = storm::settings::getModule<storm::settings::modules::MonotonicitySettings>();
auto regionSettings = storm::settings::getModule<storm::settings::modules::RegionSettings>();

PreprocessResult result(model, false);
// TODO: why only simplify in these modes
Expand All @@ -218,8 +234,8 @@ PreprocessResult preprocessSparseModel(std::shared_ptr<storm::models::sparse::Mo
}

if (mpi.applyBisimulation) {
result.model =
storm::cli::preprocessSparseModelBisimulation(result.model->template as<storm::models::sparse::Model<ValueType>>(), input, bisimulationSettings);
result.model = storm::cli::preprocessSparseModelBisimulation(result.model->template as<storm::models::sparse::Model<ValueType>>(), input,
bisimulationSettings, !regionSettings.isNotGraphPreservingSet());
result.changed = true;
}

Expand All @@ -230,12 +246,17 @@ PreprocessResult preprocessSparseModel(std::shared_ptr<storm::models::sparse::Mo
result.changed = true;
}

if (parametricSettings.isTimeTravellingEnabled()) {
if (parametricSettings.isBigStepEnabled()) {
transformer::TimeTravelling tt;
auto formulas = storm::api::extractFormulasFromProperties(input.properties);
modelchecker::CheckTask<storm::logic::Formula, storm::RationalFunction> checkTask(*formulas[0]);
result.model = std::make_shared<storm::models::sparse::Dtmc<RationalFunction>>(
tt.timeTravel(*result.model->template as<storm::models::sparse::Dtmc<RationalFunction>>(), checkTask));
auto bigStepResult = tt.bigStep(*result.model->template as<storm::models::sparse::Dtmc<RationalFunction>>(), checkTask);
result.model = std::make_shared<storm::models::sparse::Dtmc<RationalFunction>>(bigStepResult.first);

if (mpi.applyBisimulation) {
result.model = storm::cli::preprocessSparseModelBisimulation(result.model->template as<storm::models::sparse::Model<ValueType>>(), input,
bisimulationSettings, !regionSettings.isNotGraphPreservingSet());
}
result.changed = true;
}

Expand Down Expand Up @@ -329,11 +350,14 @@ void verifyRegionWithSparseEngine(std::shared_ptr<storm::models::sparse::Model<V

auto const& rvs = storm::settings::getModule<storm::settings::modules::RegionVerificationSettings>();
auto engine = rvs.getRegionCheckEngine();
bool generateSplitEstimates = rvs.isSplittingThresholdSet();
std::optional<uint64_t> maxSplitsPerStep = generateSplitEstimates ? std::make_optional(rvs.getSplittingThreshold()) : std::nullopt;
auto splittingHeuristic = rvs.getRegionSplittingHeuristic();
auto estimateKind = rvs.getRegionSplittingEstimateMethod();
uint64_t maxSplitsPerStep = rvs.isSplittingThresholdSet() ? rvs.getSplittingThreshold() : std::numeric_limits<uint64_t>::max();

auto splittingStrategy = modelchecker::RegionSplittingStrategy(splittingHeuristic, maxSplitsPerStep, estimateKind);
storm::utility::Stopwatch watch(true);
if (storm::api::verifyRegion<ValueType>(model, *(property.getRawFormula()), region, engine, monotonicitySettings, generateSplitEstimates,
maxSplitsPerStep)) {
auto const& settings = storm::api::RefinementSettings<ValueType>{model, *(property.getRawFormula()), engine, splittingStrategy, monotonicitySettings};
if (storm::api::verifyRegion<ValueType>(settings, region)) {
STORM_PRINT_AND_LOG("Formula is satisfied by all parameter instantiations.\n");
} else {
STORM_PRINT_AND_LOG("Formula is not satisfied by all parameter instantiations.\n");
Expand All @@ -354,9 +378,10 @@ void parameterSpacePartitioningWithSparseEngine(std::shared_ptr<storm::models::s
auto parametricSettings = storm::settings::getModule<storm::settings::modules::ParametricSettings>();
auto rvs = storm::settings::getModule<storm::settings::modules::RegionVerificationSettings>();
auto partitionSettings = storm::settings::getModule<storm::settings::modules::PartitionSettings>();
auto regionSettings = storm::settings::getModule<storm::settings::modules::RegionSettings>();

ValueType refinementThreshold = storm::utility::convertNumber<ValueType>(partitionSettings.getCoverageThreshold());
boost::optional<uint64_t> optionalDepthLimit;
std::optional<uint64_t> optionalDepthLimit;
if (partitionSettings.isDepthLimitSet()) {
optionalDepthLimit = partitionSettings.getDepthLimit();
}
Expand All @@ -366,19 +391,46 @@ void parameterSpacePartitioningWithSparseEngine(std::shared_ptr<storm::models::s

auto engine = rvs.getRegionCheckEngine();
STORM_PRINT_AND_LOG(" using " << engine);

auto splittingStrategy = modelchecker::RegionSplittingStrategy();

splittingStrategy.heuristic = rvs.getRegionSplittingHeuristic();
splittingStrategy.estimateKind = rvs.getRegionSplittingEstimateMethod();
if (rvs.isSplittingThresholdSet()) {
splittingStrategy.maxSplitDimensions = rvs.getSplittingThreshold();
}

bool graphPreserving = !regionSettings.isNotGraphPreservingSet();

auto parsedDiscreteVars = storm::api::parseVariableList<ValueType>(regionSettings.getDiscreteVariablesString(), *model);
std::set<typename storm::storage::ParameterRegion<ValueType>::VariableType> discreteVariables(parsedDiscreteVars.begin(), parsedDiscreteVars.end());

STORM_PRINT_AND_LOG(" and splitting heuristic " << splittingStrategy.heuristic);
if (monotonicitySettings.useMonotonicity) {
STORM_PRINT_AND_LOG(" with local monotonicity and");
}

STORM_PRINT_AND_LOG(" with iterative refinement until "
<< (1.0 - partitionSettings.getCoverageThreshold()) * 100.0 << "% is covered."
<< (1.0 - partitionSettings.getCoverageThreshold()) * 100.0 << "\% is covered."
<< (partitionSettings.isDepthLimitSet() ? " Depth limit is " + std::to_string(partitionSettings.getDepthLimit()) + "." : "") << '\n');

storm::cli::printModelCheckingProperty(property);
storm::utility::Stopwatch watch(true);
Environment env;

auto settings = storm::api::RefinementSettings<ValueType>{
model,
storm::api::createTask<ValueType>(property.getRawFormula(), true),
engine,
splittingStrategy,
monotonicitySettings,
discreteVariables,
true, // allow model simplification
graphPreserving,
false // preconditions not yet validated
};
std::unique_ptr<storm::modelchecker::CheckResult> result = storm::api::checkAndRefineRegionWithSparseEngine<ValueType>(
model, storm::api::createTask<ValueType>((property.getRawFormula()), true), regions.front(), engine, refinementThreshold, optionalDepthLimit,
storm::modelchecker::RegionResultHypothesis::Unknown, false, monotonicitySettings, monThresh);
settings, regions.front(), refinementThreshold, optionalDepthLimit, storm::modelchecker::RegionResultHypothesis::Unknown, monThresh);
watch.stop();
printInitialStatesResult<ValueType>(result, &watch);

Expand All @@ -394,6 +446,7 @@ void processInputWithValueTypeAndDdlib(cli::SymbolicInput& input, storm::cli::Mo
auto parSettings = storm::settings::getModule<storm::settings::modules::ParametricSettings>();
auto monSettings = storm::settings::getModule<storm::settings::modules::MonotonicitySettings>();
auto sampleSettings = storm::settings::getModule<storm::settings::modules::SamplingSettings>();
auto regionSettings = storm::settings::getModule<storm::settings::modules::RegionSettings>();

STORM_LOG_THROW(mpi.engine == storm::utility::Engine::Sparse || mpi.engine == storm::utility::Engine::Hybrid || mpi.engine == storm::utility::Engine::Dd,
storm::exceptions::InvalidSettingsException, "The selected engine is not supported for parametric models.");
Expand Down Expand Up @@ -457,6 +510,7 @@ void processInputWithValueTypeAndDdlib(cli::SymbolicInput& input, storm::cli::Mo
STORM_LOG_INFO("Solution function mode started.");
STORM_LOG_THROW(regions.empty(), storm::exceptions::InvalidSettingsException,
"Solution function computations cannot be restricted to specific regions");
STORM_LOG_ERROR_COND(!regionSettings.isNotGraphPreservingSet(), "Solution function computations assume graph preservation.");

if (model->isSparseModel()) {
computeSolutionFunctionsWithSparseEngine(model->as<storm::models::sparse::Model<ValueType>>(), input);
Expand Down
34 changes: 34 additions & 0 deletions src/storm-pars/analysis/MonotonicityKind.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#include "storm-pars/analysis/MonotonicityKind.h"

#include "storm/exceptions/NotImplementedException.h"
#include "storm/utility/macros.h"

namespace storm::analysis {
std::ostream& operator<<(std::ostream& out, MonotonicityKind kind) {
switch (kind) {
case MonotonicityKind::Incr:
out << "MonIncr";
break;
case MonotonicityKind::Decr:
out << "MonDecr";
break;
case MonotonicityKind::Constant:
out << "Constant";
break;
case MonotonicityKind::Not:
out << "NotMon";
break;
case MonotonicityKind::Unknown:
out << "Unknown";
break;
default:
STORM_LOG_THROW(false, storm::exceptions::NotImplementedException,
"Could not get a string from the region monotonicity check result. The case has not been implemented");
}
return out;
}

bool isMonotone(MonotonicityKind kind) {
return kind == MonotonicityKind::Incr || kind == MonotonicityKind::Decr || kind == MonotonicityKind::Constant;
}
} // namespace storm::analysis
21 changes: 21 additions & 0 deletions src/storm-pars/analysis/MonotonicityKind.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#pragma once

#include <iostream>

namespace storm::analysis {
/*!
* The results of monotonicity checking for a single Parameter Region
*/
enum class MonotonicityKind {
Incr, /*!< the result is monotonically increasing */
Decr, /*!< the result is monotonically decreasing */
Constant, /*!< the result is constant */
Not, /*!< the result is not monotonic */
Unknown /*!< the monotonicity result is unknown */
};

std::ostream& operator<<(std::ostream& out, MonotonicityKind kind);

bool isMonotone(MonotonicityKind kind);

} // namespace storm::analysis
Loading
Loading