Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
lexicographicModelChecking.cpp
Go to the documentation of this file.
7
9
11
12namespace storm {
13namespace modelchecker {
14namespace lexicographic {
15
16template<typename SparseModelType, typename ValueType>
19 CheckFormulaCallback const& formulaChecker) {
20 STORM_LOG_ASSERT(model.getInitialStates().getNumberOfSetBits() == 1,
21 "Lexicographic Model checking on model with multiple initial states is not supported.");
22 storm::logic::MultiObjectiveFormula const& formula = checkTask.getFormula();
23
24 // Define the helper that contains all functions
27
28 // get the product of (i) the product-automaton of all subformuale, and (ii) the model
29 auto res = lMC.getCompleteProductModel(model, formulaChecker);
30
31 std::shared_ptr<storm::transformer::DAProduct<SparseModelType>> completeProductModel = res.first;
32 std::vector<uint> accCond = res.second;
33
34 // get the lexicogrpahic array for all MEC of the product-model
35 std::pair<storm::storage::MaximalEndComponentDecomposition<ValueType>, std::vector<std::vector<bool>>> result =
36 lMC.getLexArrays(completeProductModel, accCond);
38 std::vector<std::vector<bool>> mecLexArrays = result.second;
39
40 // solve the reachability query
41 // That is: solve reachability for the lexicographic highest condition, restrict the model to optimal actions, repeat
42 return lMC.lexReachability(mecs, mecLexArrays, completeProductModel, model);
43}
44
45template helper::MDPSparseModelCheckingHelperReturnType<double> check<storm::models::sparse::Mdp<double>, double>(
47 CheckFormulaCallback const& formulaChecker);
48template helper::MDPSparseModelCheckingHelperReturnType<storm::RationalNumber> check<storm::models::sparse::Mdp<storm::RationalNumber>, storm::RationalNumber>(
51} // namespace lexicographic
52} // namespace modelchecker
53} // namespace storm
FormulaType const & getFormula() const
Retrieves the formula from this task.
Definition CheckTask.h:140
MDPSparseModelCheckingHelperReturnType< ValueType > lexReachability(storm::storage::MaximalEndComponentDecomposition< ValueType > const &mecs, std::vector< std::vector< bool > > const &mecLexArray, std::shared_ptr< storm::transformer::DAProduct< SparseModelType > > const &productModel, SparseModelType const &originalMdp)
Solves the reachability query for a lexicographic objective In lexicographic order,...
std::pair< std::shared_ptr< storm::transformer::DAProduct< SparseModelType > >, std::vector< uint > > getCompleteProductModel(SparseModelType const &model, CheckFormulaCallback const &formulaChecker)
Returns the product of a model and the product-automaton of all sub-formulae of the multi-objective f...
std::pair< storm::storage::MaximalEndComponentDecomposition< ValueType >, std::vector< std::vector< bool > > > getLexArrays(std::shared_ptr< storm::transformer::DAProduct< productModelType > > productModel, std::vector< uint > &acceptanceConditions)
Given a product of an MDP and a automaton, returns the MECs and their corresponding Lex-Arrays First:...
This class represents a (discrete-time) Markov decision process.
Definition Mdp.h:14
This class represents the decomposition of a nondeterministic model into its maximal end components.
#define STORM_LOG_ASSERT(cond, message)
Definition macros.h:11
helper::MDPSparseModelCheckingHelperReturnType< ValueType > check(Environment const &, SparseModelType const &model, CheckTask< storm::logic::MultiObjectiveFormula, ValueType > const &checkTask, CheckFormulaCallback const &formulaChecker)
check a lexicographic LTL-formula
std::function< storm::storage::BitVector(storm::logic::Formula const &)> CheckFormulaCallback
LabParser.cpp.
Definition cli.cpp:18