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 <optional>
4#include <unordered_map>
5#include <vector>
6
9
10namespace storm {
11namespace prism {
12class Program;
13}
14
15namespace jani {
16class Model;
17class Automaton;
19class VariableSet;
20} // namespace jani
21
22namespace generator {
23// A structure storing information about the boolean variables of the model.
26
27 std::string const& getName() const {
28 return variable.getName();
29 }
30
31 // The boolean variable.
33
34 // Its bit offset in the compressed state.
35 uint_fast64_t bitOffset;
36
37 // A flag indicating whether the variable is a global one.
38 bool global;
39
40 //
42};
43
44// A structure storing information about the integer variables of the model.
47 uint_fast64_t bitWidth, bool global = false, bool observable = true, bool forceOutOfBoundsCheck = false);
48
49 std::string const& getName() const {
50 return variable.getName();
51 }
52
53 // The integer variable.
55
56 // The lower bound of its range.
57 int_fast64_t lowerBound;
58
59 // The upper bound of its range.
60 int_fast64_t upperBound;
61
62 // Its bit offset in the compressed state.
63 uint_fast64_t bitOffset;
64
65 // Its bit width in the compressed state.
66 uint_fast64_t bitWidth;
67
68 // A flag indicating whether the variable is a global one.
69 bool global;
70
72
73 // A flag indicating whether an out of bounds check is enforced for this variable.
75};
76
77// A structure storing information about the location variables of the model.
80 bool observable);
81
82 // The expression variable for this location.
84
85 // The highest possible location value.
86 uint64_t highestValue;
87
88 // Its bit offset in the compressed state.
89 uint_fast64_t bitOffset;
90
91 // Its bit width in the compressed state.
92 uint_fast64_t bitWidth;
93
95};
96
99
100 std::string const& getName() const {
101 return variable.getName();
102 }
103
105
106 bool deterministic = true;
107};
108
109// A structure storing information about the used variables of the program.
111 VariableInformation(storm::prism::Program const& program, uint64_t reservedBitsForUnboundedVariables, bool outOfBoundsState = false);
112 VariableInformation(storm::jani::Model const& model, std::vector<std::reference_wrapper<storm::jani::Automaton const>> const& parallelAutomata,
113 uint64_t reservedBitsForUnboundedVariables, bool outOfBoundsState);
114
116 uint_fast64_t getTotalBitOffset(bool roundTo64Bit = false) const;
117
120 std::vector<uint64_t> const& arrayIndexVector) const;
122 std::vector<uint64_t> const& arrayIndexVector) const;
123
125 uint_fast64_t totalBitOffset;
126
128 std::vector<LocationVariableInformation> locationVariables;
129
131 std::vector<BooleanVariableInformation> booleanVariables;
132
134 std::vector<IntegerVariableInformation> integerVariables;
135
137 std::vector<ObservationLabelInformation> observationLabels;
138
140 std::unordered_map<storm::expressions::Variable, ArrayVariableReplacementInformation> arrayVariableToElementInformations;
141
142 bool hasOutOfBoundsBit() const;
143
144 uint64_t getOutOfBoundsBit() const;
145
146 std::optional<BooleanVariableInformation> outOfBoundsBit;
147
148 private:
152 void sortVariables();
153
157 void createVariablesForAutomaton(storm::jani::Automaton const& automaton, uint64_t reservedBitsForUnboundedVariables);
158
162 void createVariablesForVariableSet(storm::jani::VariableSet const& variableSet, uint64_t reservedBitsForUnboundedVariables, bool global);
163};
164
165} // namespace generator
166} // 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.