Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
DAProductBuilder.h
Go to the documentation of this file.
1#pragma once
2
8
9#include <vector>
10
11namespace storm {
12namespace transformer {
14 public:
15 DAProductBuilder(const storm::automata::DeterministicAutomaton& da, const std::vector<storm::storage::BitVector>& statesForAP)
16 : da(da), statesForAP(statesForAP) {}
17
18 template<typename Model>
19 typename DAProduct<Model>::ptr build(const Model& originalModel, const storm::storage::BitVector& statesOfInterest) const {
20 return build<Model>(originalModel.getTransitionMatrix(), statesOfInterest);
21 }
22
23 template<typename Model>
25 const storm::storage::BitVector& statesOfInterest) const {
26 typename Product<Model>::ptr product = ProductBuilder<Model>::buildProduct(originalMatrix, *this, statesOfInterest);
28 product->getProductModel().getNumberOfStates(), [&product](std::size_t prodState) { return product->getAutomatonState(prodState); });
29
30 return typename DAProduct<Model>::ptr(new DAProduct<Model>(std::move(*product), prodAcceptance));
31 }
32
34 return da.getSuccessor(da.getInitialState(), getLabelForState(modelState));
35 }
36
38 return da.getSuccessor(automatonFrom, getLabelForState(modelTo));
39 }
40
41 private:
43 const std::vector<storm::storage::BitVector>& statesForAP;
44
47 for (unsigned int ap = 0; ap < da.getAPSet().size(); ap++) {
48 if (statesForAP.at(ap).get(s)) {
49 label = da.getAPSet().elementAddAP(label, ap);
50 }
51 }
52 return label;
53 }
54};
55} // namespace transformer
56} // namespace storm
alphabet_element elementAddAP(alphabet_element element, unsigned int ap) const
Definition APSet.cpp:56
alphabet_element elementAllFalse() const
Definition APSet.cpp:52
std::size_t alphabet_element
Definition APSet.h:12
std::shared_ptr< AcceptanceCondition > ptr
std::size_t getSuccessor(std::size_t from, APSet::alphabet_element label) const
std::shared_ptr< AcceptanceCondition > getAcceptance() const
A bit vector that is internally represented as a vector of 64-bit values.
Definition BitVector.h:18
A class that holds a possibly non-square matrix in the compressed row storage format.
DAProductBuilder(const storm::automata::DeterministicAutomaton &da, const std::vector< storm::storage::BitVector > &statesForAP)
storm::storage::sparse::state_type getSuccessor(storm::storage::sparse::state_type automatonFrom, storm::storage::sparse::state_type modelTo) const
DAProduct< Model >::ptr build(const storm::storage::SparseMatrix< typename Model::ValueType > &originalMatrix, const storm::storage::BitVector &statesOfInterest) const
storm::storage::sparse::state_type getInitialState(storm::storage::sparse::state_type modelState) const
DAProduct< Model >::ptr build(const Model &originalModel, const storm::storage::BitVector &statesOfInterest) const
std::shared_ptr< DAProduct< Model > > ptr
Definition DAProduct.h:13
static Product< Model >::ptr buildProduct(const matrix_type &originalMatrix, ProductOperator &prodOp, const storm::storage::BitVector &statesOfInterest)
std::shared_ptr< Product< Model > > ptr
Definition Product.h:10
LabParser.cpp.
Definition cli.cpp:18