Storm 1.11.1.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
DeterministicModelBisimulationDecomposition.h
Go to the documentation of this file.
1#pragma once
2
5
6namespace storm {
7namespace storage {
8
12template<typename ModelType>
13class DeterministicModelBisimulationDecomposition : public BisimulationDecomposition<ModelType, bisimulation::DeterministicBlockData> {
14 public:
16 typedef typename ModelType::ValueType ValueType;
17 typedef typename ModelType::RewardModelType RewardModelType;
18
28
29 protected:
30 virtual std::pair<storm::storage::BitVector, storm::storage::BitVector> getStatesWithProbability01() override;
31
32 virtual void initializeMeasureDrivenPartition() override;
33
34 virtual void initializeLabelBasedPartition() override;
35
36 virtual void buildQuotient() override;
37
39 std::vector<bisimulation::Block<BlockDataType>*>& splitterQueue) override;
40
41 private:
42 // Post-processes the initial partition to properly initialize it.
43 void postProcessInitialPartition();
44
45 // Refines the given block wrt to strong bisimulation.
46 void refinePredecessorBlockOfSplitterStrong(bisimulation::Block<BlockDataType>& block, std::vector<bisimulation::Block<BlockDataType>*>& splitterQueue);
47
48 // Refines the predecessor blocks wrt. strong bisimulation.
49 void refinePredecessorBlocksOfSplitterStrong(std::list<bisimulation::Block<BlockDataType>*> const& predecessorBlocks,
50 std::vector<bisimulation::Block<BlockDataType>*>& splitterQueue);
51
55 void initializeWeakDtmcBisimulation();
56
61 void splitOffDivergentStates();
62
66 void initializeSilentProbabilities();
67
68 // Retrieves the probability of going into the splitter for the given state.
69 ValueType const& getProbabilityToSplitter(storm::storage::sparse::state_type const& state) const;
70
71 // Retrieves the silent probability for the given state.
72 ValueType getSilentProbability(storm::storage::sparse::state_type const& state) const;
73
74 // Retrieves whether the given state is silent.
75 bool isSilent(storm::storage::sparse::state_type const& state) const;
76
77 // Retrieves whether the given state has a non-zero silent probability.
78 bool hasNonZeroSilentProbability(storm::storage::sparse::state_type const& state) const;
79
80 // Retrieves whether the given predecessor of the splitters possibly needs refinement.
81 bool possiblyNeedsRefinement(bisimulation::Block<BlockDataType> const& predecessorBlock) const;
82
83 // Moves the given state to the position marked by marker1 moves the marker one step further.
84 void moveStateToMarker1(storm::storage::sparse::state_type predecessor, bisimulation::Block<BlockDataType>& predecessorBlock);
85
86 // Moves the given state to the position marked by marker2 the marker one step further.
87 void moveStateToMarker2(storm::storage::sparse::state_type predecessor, bisimulation::Block<BlockDataType>& predecessorBlock);
88
89 // Moves the given state to a proper place in the splitter, depending on where the predecessor is located.
90 void moveStateInSplitter(storm::storage::sparse::state_type predecessor, bisimulation::Block<BlockDataType>& predecessorBlock,
91 storm::storage::sparse::state_type currentPositionInSplitter, uint_fast64_t& elementsToSkip);
92
93 // Increases the probability of moving to the current splitter for the given state.
94 void increaseProbabilityToSplitter(storm::storage::sparse::state_type predecessor, bisimulation::Block<BlockDataType> const& predecessorBlock,
95 ValueType const& value);
96
97 // Explores the remaining states of the splitter.
98 void exploreRemainingStatesOfSplitter(bisimulation::Block<BlockDataType>& splitter, std::list<bisimulation::Block<BlockDataType>*>& predecessorBlocks);
99
100 // Updates the silent probabilities of the states in the block based on the probabilities of going to the splitter.
101 void updateSilentProbabilitiesBasedOnProbabilitiesToSplitter(bisimulation::Block<BlockDataType>& block);
102
103 // Updates the silent probabilities of the states in the block based on a forward exploration of the transitions
104 // of the states.
105 void updateSilentProbabilitiesBasedOnTransitions(bisimulation::Block<BlockDataType>& block);
106
107 // Refines the given block wrt to weak bisimulation in DTMCs.
108 void refinePredecessorBlockOfSplitterWeak(bisimulation::Block<BlockDataType>& block, std::vector<bisimulation::Block<BlockDataType>*>& splitterQueue);
109
110 // Refines the predecessor blocks of the splitter wrt. weak bisimulation in DTMCs.
111 void refinePredecessorBlocksOfSplitterWeak(bisimulation::Block<BlockDataType> const& splitter,
112 std::list<bisimulation::Block<BlockDataType>*> const& predecessorBlocks,
113 std::vector<bisimulation::Block<BlockDataType>*>& splitterQueue);
114
115 // Converts the one-step probabilities of going into the splitter into the conditional probabilities needed
116 // for weak bisimulation (on DTMCs).
117 void computeConditionalProbabilitiesForNonSilentStates(bisimulation::Block<BlockDataType>& block);
118
119 // Computes the (indices of the) blocks of non-silent states within the block.
120 std::vector<uint_fast64_t> computeNonSilentBlocks(bisimulation::Block<BlockDataType>& block);
121
122 // Computes a labeling for all states of the block that identifies in which block they need to end up.
123 std::vector<storm::storage::BitVector> computeWeakStateLabelingBasedOnNonSilentBlocks(bisimulation::Block<BlockDataType> const& block,
124 std::vector<uint_fast64_t> const& nonSilentBlockIndices);
125
126 // Inserts the block into the list of predecessors if it is not already contained.
127 void insertIntoPredecessorList(bisimulation::Block<BlockDataType>& predecessorBlock, std::list<bisimulation::Block<BlockDataType>*>& predecessorBlocks);
128
130 [[maybe_unused]] storm::storage::sparse::state_type state) const;
131
132 // A vector that holds the probabilities of states going into the splitter. This is used by the method that
133 // refines a block based on probabilities.
134 std::vector<ValueType> probabilitiesToCurrentSplitter;
135
136 // A vector mapping each state to its silent probability.
137 std::vector<ValueType> silentProbabilities;
138};
139} // namespace storage
140} // namespace storm
This class is the superclass of all decompositions of a sparse model into its bisimulation quotient.
This class represents the decomposition of a deterministic model into its bisimulation quotient.
virtual void refinePartitionBasedOnSplitter(bisimulation::Block< BlockDataType > &splitter, std::vector< bisimulation::Block< BlockDataType > * > &splitterQueue) override
virtual void initializeLabelBasedPartition() override
Initializes the initial partition based on all respected labels.
virtual void initializeMeasureDrivenPartition() override
Creates the measure-driven initial partition for reaching psi states from phi states.
virtual void buildQuotient() override
Builds the quotient model based on the previously computed equivalence classes (stored in the blocks ...
virtual std::pair< storm::storage::BitVector, storm::storage::BitVector > getStatesWithProbability01() override
Computes the set of states with probability 0/1 for satisfying phi until psi.