Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
SparseSmgRpatlModelChecker.cpp
Go to the documentation of this file.
2
3#include <memory>
4#include <vector>
5
16
17namespace storm {
18namespace modelchecker {
19template<typename SparseSmgModelType>
21 : SparsePropositionalModelChecker<SparseSmgModelType>(model) {
22 // Intentionally left empty.
23}
24
25template<typename SparseSmgModelType>
27 bool* requiresSingleInitialState) {
28 storm::logic::Formula const& formula = checkTask.getFormula();
29
30 return formula.isInFragment(storm::logic::rpatl());
31}
32
33template<typename SparseSmgModelType>
35 bool requiresSingleInitialState = false;
36 if (canHandleStatic(checkTask, &requiresSingleInitialState)) {
37 return !requiresSingleInitialState || this->getModel().getInitialStates().getNumberOfSetBits() == 1;
38 } else {
39 return false;
40 }
41}
42
43template<typename SparseSmgModelType>
46 storm::logic::GameFormula const& gameFormula = checkTask.getFormula();
47 storm::logic::Formula const& subFormula = gameFormula.getSubformula();
48 if (subFormula.isOperatorFormula()) {
49 return this->checkStateFormula(env, checkTask.substituteFormula(subFormula.asStateFormula()).setPlayerCoalition(gameFormula.getCoalition()));
50 }
51 STORM_LOG_THROW(false, storm::exceptions::NotImplementedException, "Only game formulas with Operatorformulas as subformula are supported.");
52}
53
54template<typename SparseSmgModelType>
57 STORM_LOG_THROW(false, storm::exceptions::NotImplementedException, "Not implemented.");
58}
59
60template<typename SparseSmgModelType>
63 auto rewardModel = storm::utility::createFilteredRewardModel(this->getModel(), checkTask);
64 STORM_LOG_THROW(checkTask.isPlayerCoalitionSet(), storm::exceptions::InvalidPropertyException, "No player coalition was set.");
65 auto coalitionStates = this->getModel().computeStatesOfCoalition(checkTask.getPlayerCoalition());
66 std::cout << "Found " << coalitionStates.getNumberOfSetBits() << " states in coalition.\n";
67 STORM_LOG_THROW(false, storm::exceptions::NotImplementedException, "Not implemented.");
68}
69
72} // namespace modelchecker
73} // namespace storm
virtual bool isOperatorFormula() const
Definition Formula.cpp:180
StateFormula & asStateFormula()
Definition Formula.cpp:221
bool isInFragment(FragmentSpecification const &fragment) const
Definition Formula.cpp:196
PlayerCoalition const & getCoalition() const
Formula const & getSubformula() const
CheckTask< NewFormulaType, ValueType > substituteFormula(NewFormulaType const &newFormula) const
Copies the check task from the source while replacing the formula with the new one.
Definition CheckTask.h:52
FormulaType const & getFormula() const
Retrieves the formula from this task.
Definition CheckTask.h:140
storm::logic::PlayerCoalition const & getPlayerCoalition() const
Retrieves the player coalition (if set).
Definition CheckTask.h:175
bool isPlayerCoalitionSet() const
Retrieves whether a player coalition was set.
Definition CheckTask.h:168
virtual std::unique_ptr< CheckResult > computeLongRunAverageProbabilities(Environment const &env, CheckTask< storm::logic::StateFormula, ValueType > const &checkTask) override
virtual std::unique_ptr< CheckResult > checkGameFormula(Environment const &env, CheckTask< storm::logic::GameFormula, ValueType > const &checkTask) override
virtual bool canHandle(CheckTask< storm::logic::Formula, ValueType > const &checkTask) const override
virtual std::unique_ptr< CheckResult > computeLongRunAverageRewards(Environment const &env, CheckTask< storm::logic::LongRunAverageRewardFormula, ValueType > const &checkTask) override
static bool canHandleStatic(CheckTask< storm::logic::Formula, ValueType > const &checkTask, bool *requiresSingleInitialState=nullptr)
Returns false, if this task can certainly not be handled by this model checker (independent of the co...
#define STORM_LOG_THROW(cond, exception, message)
Definition macros.h:30
FragmentSpecification rpatl()
FilteredRewardModel< RewardModelType > createFilteredRewardModel(RewardModelType const &baseRewardModel, storm::logic::RewardAccumulation const &acc, bool isDiscreteTimeModel)
LabParser.cpp.
Definition cli.cpp:18