Storm 1.14.0.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
Initialization.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4#include <functional>
5#include <memory>
6#include <optional>
7#include <ranges>
8#include <span>
9#include <variant>
10#include <vector>
11
20
21namespace storm::bisimulation {
22
23template<typename ValueType>
25 public:
27 std::vector<std::shared_ptr<storm::logic::Formula const>> const& formulas);
28
30
31 std::optional<std::vector<uint64_t>> getChoiceClasses() const;
32
33 Partition getInitialStatePartition(std::optional<std::vector<uint64_t>> const& choiceClasses = {}) const;
34
46 PreservationInformation const& preservationInformation) const;
47
48 private:
50 Options const options;
51 std::vector<std::shared_ptr<storm::logic::Formula const>> const formulas;
52
56 struct PreservedAnnotations {
57 std::vector<std::span<uint64_t const>> integers;
58 std::vector<std::span<ValueType const>> values;
59
63 void addBoolean(storm::storage::BitVector const& annotation);
64
68 void addBoolean(storm::storage::BitVector&& annotation);
69
73 auto getBooleans() const {
74 return optionallyOwnedBooleans | std::views::transform([](auto const& annotation) -> storm::storage::BitVector const& {
75 return std::visit([](auto const& bitVector) -> storm::storage::BitVector const& { return bitVector; }, annotation);
76 });
77 }
78
82 bool empty() const;
83
91 void applySplit(Partition& partition, ValueType const& tolerance, std::vector<uint64_t> const& extraAnnotation = {}) const;
92
93 private:
94 // A Boolean annotation is either owned by this object or stored somewhere else.
95 using OptionallyOwnedBitVector = std::variant<std::reference_wrapper<storm::storage::BitVector const>, storm::storage::BitVector>;
96
97 std::vector<OptionallyOwnedBitVector> optionallyOwnedBooleans;
98 } preservedStateAnnotations, preservedChoiceAnnotations;
99};
100
101} // namespace storm::bisimulation
Initialization(storm::models::sparse::Model< ValueType > const &model, Options const &options, std::vector< std::shared_ptr< storm::logic::Formula const > > const &formulas)
WeakBisimulationData getWeakBisimulationData(Partition &partition, storm::storage::SparseMatrix< ValueType > const &backwardTransitions, PreservationInformation const &preservationInformation) const
Computes the state-level information that weak bisimulation requires on top of the partition,...
std::optional< std::vector< uint64_t > > getChoiceClasses() const
Partition getInitialStatePartition(std::optional< std::vector< uint64_t > > const &choiceClasses={}) const
PreservationInformation getPreservationInformation() const
Represents a partition of a set of consecutive indices.
Definition Partition.h:20
Base class for all sparse models.
Definition Model.h:34
A bit vector that is internally represented as a vector of 64-bit values.
Definition BitVector.h:16
A class that holds a possibly non-square matrix in the compressed row storage format.
The state-level information that weak bisimulation requires on top of the partition.