Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
MenuGame.cpp
Go to the documentation of this file.
2
5
9
11
12#include "storm-config.h"
14
15namespace storm::gbar {
16namespace abstraction {
17
18template<storm::dd::DdType Type, typename ValueType>
20 storm::dd::Bdd<Type> initialStates, storm::dd::Bdd<Type> deadlockStates, storm::dd::Add<Type, ValueType> transitionMatrix,
21 storm::dd::Bdd<Type> bottomStates, std::set<storm::expressions::Variable> const& rowVariables,
22 std::set<storm::expressions::Variable> const& columnVariables,
23 std::vector<std::pair<storm::expressions::Variable, storm::expressions::Variable>> const& rowColumnMetaVariablePairs,
24 std::set<storm::expressions::Variable> const& player1Variables,
25 std::set<storm::expressions::Variable> const& player2Variables,
26 std::set<storm::expressions::Variable> const& allNondeterminismVariables,
27 std::set<storm::expressions::Variable> const& probabilisticBranchingVariables,
28 std::map<storm::expressions::Expression, storm::dd::Bdd<Type>> const& expressionToBddMap)
29 : storm::models::symbolic::StochasticTwoPlayerGame<Type, ValueType>(
30 manager, reachableStates, initialStates, deadlockStates, transitionMatrix.sumAbstract(probabilisticBranchingVariables), rowVariables, nullptr,
31 columnVariables, rowColumnMetaVariablePairs, player1Variables, player2Variables, allNondeterminismVariables),
32 extendedTransitionMatrix(transitionMatrix),
33 probabilisticBranchingVariables(probabilisticBranchingVariables),
34 expressionToBddMap(expressionToBddMap),
35 bottomStates(bottomStates) {
36 // Intentionally left empty.
37}
38
39template<storm::dd::DdType Type, typename ValueType>
41 STORM_LOG_THROW(false, storm::exceptions::InvalidOperationException, "Menu games do not provide labels.");
42}
43
44template<storm::dd::DdType Type, typename ValueType>
46 return this->getStates(expression, false);
47}
48
49template<storm::dd::DdType Type, typename ValueType>
51 if (expression.isTrue()) {
52 return this->getReachableStates();
53 } else if (expression.isFalse()) {
54 return this->getManager().getBddZero();
55 }
56
57 auto it = expressionToBddMap.find(expression);
58 STORM_LOG_THROW(it != expressionToBddMap.end(), storm::exceptions::InvalidArgumentException,
59 "The given expression was not used in the abstraction process and can therefore not be retrieved.");
60 if (negated) {
61 return !it->second && this->getReachableStates();
62 } else {
63 return it->second && this->getReachableStates();
64 }
65}
66
67template<storm::dd::DdType Type, typename ValueType>
71
72template<storm::dd::DdType Type, typename ValueType>
74 return extendedTransitionMatrix;
75}
76
77template<storm::dd::DdType Type, typename ValueType>
78std::set<storm::expressions::Variable> const& MenuGame<Type, ValueType>::getProbabilisticBranchingVariables() const {
79 return probabilisticBranchingVariables;
80}
81
82template<storm::dd::DdType Type, typename ValueType>
83bool MenuGame<Type, ValueType>::hasLabel(std::string const&) const {
84 return false;
85}
86
89
90#ifdef STORM_HAVE_CARL
92#endif
93} // namespace abstraction
94} // namespace storm::gbar
bool isFalse() const
Checks if the expression is equal to the boolean literal false.
bool isTrue() const
Checks if the expression is equal to the boolean literal true.
This class represents a discrete-time stochastic two-player game.
Definition MenuGame.h:16
MenuGame(MenuGame< Type, ValueType > const &other)=default
virtual bool hasLabel(std::string const &label) const override
Retrieves whether the given label is a valid label in this model.
Definition MenuGame.cpp:83
storm::dd::Bdd< Type > getBottomStates() const
Retrieves the bottom states of the model.
Definition MenuGame.cpp:68
virtual storm::dd::Bdd< Type > getStates(std::string const &label) const override
Returns the sets of states labeled with the given label.
Definition MenuGame.cpp:40
std::set< storm::expressions::Variable > const & getProbabilisticBranchingVariables() const
Retrieves the variables used to encode additional information for the probabilistic branching in the ...
Definition MenuGame.cpp:78
storm::dd::Add< Type, ValueType > const & getExtendedTransitionMatrix() const
Retrieves the transition matrix extended by variables that encode additional information for the prob...
Definition MenuGame.cpp:73
#define STORM_LOG_THROW(cond, exception, message)
Definition macros.h:30
LabParser.cpp.
Definition cli.cpp:18