Storm 1.14.0.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
VariableInformation.h
Go to the documentation of this file.
1#pragma once
2
3#include <unordered_map>
4#include <vector>
5
8
9namespace storm {
10namespace prism {
11class Program;
12}
13
14namespace jani {
15class Model;
16class Automaton;
18class VariableSet;
19} // namespace jani
20
21namespace generator {
22// A structure storing information about the boolean variables of the model.
25
26 std::string const& getName() const {
27 return variable.getName();
28 }
29
30 // The boolean variable.
32
33 // Its bit offset in the compressed state.
34 uint_fast64_t bitOffset;
35
36 // A flag indicating whether the variable is a global one.
37 bool global;
38
39 //
41};
42
43// A structure storing information about the integer variables of the model.
46 uint_fast64_t bitWidth, bool global = false, bool observable = true, bool forceOutOfBoundsCheck = false);
47
48 std::string const& getName() const {
49 return variable.getName();
50 }
51
52 // The integer variable.
54
55 // The lower bound of its range.
56 int_fast64_t lowerBound;
57
58 // The upper bound of its range.
59 int_fast64_t upperBound;
60
61 // Its bit offset in the compressed state.
62 uint_fast64_t bitOffset;
63
64 // Its bit width in the compressed state.
65 uint_fast64_t bitWidth;
66
67 // A flag indicating whether the variable is a global one.
68 bool global;
69
71
72 // A flag indicating whether an out of bounds check is enforced for this variable.
74};
75
76// A structure storing information about the location variables of the model.
79 bool observable);
80
81 // The expression variable for this location.
83
84 // The highest possible location value.
85 uint64_t highestValue;
86
87 // Its bit offset in the compressed state.
88 uint_fast64_t bitOffset;
89
90 // Its bit width in the compressed state.
91 uint_fast64_t bitWidth;
92
94};
95
98
99 std::string const& getName() const {
100 return variable.getName();
101 }
102
104
105 bool deterministic = true;
106};
107
108// A structure storing information about the used variables of the program.
110 VariableInformation(storm::prism::Program const& program, uint64_t reservedBitsForUnboundedVariables, bool outOfBoundsState = false);
111 VariableInformation(storm::jani::Model const& model, std::vector<std::reference_wrapper<storm::jani::Automaton const>> const& parallelAutomata,
112 uint64_t reservedBitsForUnboundedVariables, bool outOfBoundsState);
113
115 uint_fast64_t getTotalBitOffset(bool roundTo64Bit = false) const;
116
119 std::vector<uint64_t> const& arrayIndexVector) const;
121 std::vector<uint64_t> const& arrayIndexVector) const;
122
124 uint_fast64_t totalBitOffset;
125
127 std::vector<LocationVariableInformation> locationVariables;
128
130 std::vector<BooleanVariableInformation> booleanVariables;
131
133 std::vector<IntegerVariableInformation> integerVariables;
134
136 std::vector<ObservationLabelInformation> observationLabels;
137
139 std::unordered_map<storm::expressions::Variable, ArrayVariableReplacementInformation> arrayVariableToElementInformations;
140
141 bool hasOutOfBoundsBit() const;
142
143 uint64_t getOutOfBoundsBit() const;
144
145 std::optional<BooleanVariableInformation> outOfBoundsBit;
146
147 private:
151 void sortVariables();
152
156 void createVariablesForAutomaton(storm::jani::Automaton const& automaton, uint64_t reservedBitsForUnboundedVariables);
157
161 void createVariablesForVariableSet(storm::jani::VariableSet const& variableSet, uint64_t reservedBitsForUnboundedVariables, bool global);
162};
163
164} // namespace generator
165} // namespace storm
BooleanVariableInformation(storm::expressions::Variable const &variable, uint_fast64_t bitOffset, bool global, bool observable)
IntegerVariableInformation(storm::expressions::Variable const &variable, int_fast64_t lowerBound, int_fast64_t upperBound, uint_fast64_t bitOffset, uint_fast64_t bitWidth, bool global=false, bool observable=true, bool forceOutOfBoundsCheck=false)
LocationVariableInformation(storm::expressions::Variable const &variable, uint64_t highestValue, uint_fast64_t bitOffset, uint_fast64_t bitWidth, bool observable)
ObservationLabelInformation(storm::expressions::Variable const &variable)
uint_fast64_t getTotalBitOffset(bool roundTo64Bit=false) const
std::unordered_map< storm::expressions::Variable, ArrayVariableReplacementInformation > arrayVariableToElementInformations
Replacements for each array variable.
uint_fast64_t totalBitOffset
The total bit offset over all variables.
void registerArrayVariableReplacements(storm::jani::ArrayEliminatorData const &arrayEliminatorData)
std::vector< ObservationLabelInformation > observationLabels
The observation labels.
std::optional< BooleanVariableInformation > outOfBoundsBit
std::vector< IntegerVariableInformation > integerVariables
The integer variables.
BooleanVariableInformation const & getBooleanArrayVariableReplacement(storm::expressions::Variable const &arrayVariable, std::vector< uint64_t > const &arrayIndexVector) const
std::vector< LocationVariableInformation > locationVariables
The location variables.
VariableInformation(storm::prism::Program const &program, uint64_t reservedBitsForUnboundedVariables, bool outOfBoundsState=false)
IntegerVariableInformation const & getIntegerArrayVariableReplacement(storm::expressions::Variable const &arrayVariable, std::vector< uint64_t > const &arrayIndexVector) const
std::vector< BooleanVariableInformation > booleanVariables
The boolean variables.