Storm 1.11.1.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
SparseSmgRpatlModelChecker.cpp
Go to the documentation of this file.
2
3#include <memory>
4
14
15namespace storm {
16namespace modelchecker {
17template<typename SparseSmgModelType>
19 : SparsePropositionalModelChecker<SparseSmgModelType>(model) {
20 // Intentionally left empty.
21}
22
23template<typename SparseSmgModelType>
25 bool* requiresSingleInitialState) {
26 storm::logic::Formula const& formula = checkTask.getFormula();
27
28 return formula.isInFragment(storm::logic::rpatl());
29}
30
31template<typename SparseSmgModelType>
33 bool requiresSingleInitialState = false;
34 if (canHandleStatic(checkTask, &requiresSingleInitialState)) {
35 return !requiresSingleInitialState || this->getModel().getInitialStates().getNumberOfSetBits() == 1;
36 } else {
37 return false;
38 }
39}
40
41template<typename SparseSmgModelType>
44 storm::logic::GameFormula const& gameFormula = checkTask.getFormula();
45 storm::logic::Formula const& subFormula = gameFormula.getSubformula();
46 if (subFormula.isOperatorFormula()) {
47 return this->checkStateFormula(env, checkTask.substituteFormula(subFormula.asStateFormula()).setPlayerCoalition(gameFormula.getCoalition()));
48 }
49 STORM_LOG_THROW(false, storm::exceptions::NotImplementedException, "Only game formulas with Operatorformulas as subformula are supported.");
50}
51
52template<typename SparseSmgModelType>
55 STORM_LOG_THROW(false, storm::exceptions::NotImplementedException, "Not implemented.");
56}
57
58template<typename SparseSmgModelType>
61 auto rewardModel = storm::utility::createFilteredRewardModel(this->getModel(), checkTask);
62 STORM_LOG_THROW(checkTask.isPlayerCoalitionSet(), storm::exceptions::InvalidPropertyException, "No player coalition was set.");
63 auto coalitionStates = this->getModel().computeStatesOfCoalition(checkTask.getPlayerCoalition());
64 std::cout << "Found " << coalitionStates.getNumberOfSetBits() << " states in coalition.\n";
65 STORM_LOG_THROW(false, storm::exceptions::NotImplementedException, "Not implemented.");
66}
67
70} // namespace modelchecker
71} // namespace storm
virtual bool isOperatorFormula() const
Definition Formula.cpp:188
StateFormula & asStateFormula()
Definition Formula.cpp:229
bool isInFragment(FragmentSpecification const &fragment) const
Definition Formula.cpp:204
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)