Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
VariableInformation.h
Go to the documentation of this file.
1#ifndef STORM_GENERATOR_VARIABLEINFORMATION_H_
2#define STORM_GENERATOR_VARIABLEINFORMATION_H_
3
4#include <boost/container/flat_map.hpp>
5#include <boost/optional/optional.hpp>
6#include <unordered_map>
7#include <vector>
8
11
12namespace storm {
13namespace prism {
14class Program;
15}
16
17namespace jani {
18class Model;
19class Automaton;
20struct ArrayEliminatorData;
21class VariableSet;
22} // namespace jani
23
24namespace generator {
25// A structure storing information about the boolean variables of the model.
28
29 std::string const& getName() const {
30 return variable.getName();
31 }
32
33 // The boolean variable.
35
36 // Its bit offset in the compressed state.
37 uint_fast64_t bitOffset;
38
39 // A flag indicating whether the variable is a global one.
40 bool global;
41
42 //
44};
45
46// A structure storing information about the integer variables of the model.
49 uint_fast64_t bitWidth, bool global = false, bool observable = true, bool forceOutOfBoundsCheck = false);
50
51 std::string const& getName() const {
52 return variable.getName();
53 }
54
55 // The integer variable.
57
58 // The lower bound of its range.
59 int_fast64_t lowerBound;
60
61 // The upper bound of its range.
62 int_fast64_t upperBound;
63
64 // Its bit offset in the compressed state.
65 uint_fast64_t bitOffset;
66
67 // Its bit width in the compressed state.
68 uint_fast64_t bitWidth;
69
70 // A flag indicating whether the variable is a global one.
71 bool global;
72
74
75 // A flag indicating whether an out of bounds check is enforced for this variable.
77};
78
79// A structure storing information about the location variables of the model.
82 bool observable);
83
84 // The expression variable for this location.
86
87 // The highest possible location value.
88 uint64_t highestValue;
89
90 // Its bit offset in the compressed state.
91 uint_fast64_t bitOffset;
92
93 // Its bit width in the compressed state.
94 uint_fast64_t bitWidth;
95
97};
98
100 ObservationLabelInformation(std::string const& name);
101 std::string name;
102 bool deterministic = true;
103};
104
105// A structure storing information about the used variables of the program.
107 VariableInformation(storm::prism::Program const& program, uint64_t reservedBitsForUnboundedVariables, bool outOfBoundsState = false);
108 VariableInformation(storm::jani::Model const& model, std::vector<std::reference_wrapper<storm::jani::Automaton const>> const& parallelAutomata,
109 uint64_t reservedBitsForUnboundedVariables, bool outOfBoundsState);
110
112 uint_fast64_t getTotalBitOffset(bool roundTo64Bit = false) const;
113
116 std::vector<uint64_t> const& arrayIndexVector) const;
118 std::vector<uint64_t> const& arrayIndexVector) const;
119
121 uint_fast64_t totalBitOffset;
122
124 std::vector<LocationVariableInformation> locationVariables;
125
127 std::vector<BooleanVariableInformation> booleanVariables;
128
130 std::vector<IntegerVariableInformation> integerVariables;
131
133 std::vector<ObservationLabelInformation> observationLabels;
134
136 std::unordered_map<storm::expressions::Variable, ArrayVariableReplacementInformation> arrayVariableToElementInformations;
137
138 bool hasOutOfBoundsBit() const;
139
140 uint64_t getOutOfBoundsBit() const;
141
142 private:
143 boost::optional<uint64_t> outOfBoundsBit;
144
148 void sortVariables();
149
153 void createVariablesForAutomaton(storm::jani::Automaton const& automaton, uint64_t reservedBitsForUnboundedVariables);
154
158 void createVariablesForVariableSet(storm::jani::VariableSet const& variableSet, uint64_t reservedBitsForUnboundedVariables, bool global);
159};
160
161} // namespace generator
162} // namespace storm
163
164#endif /* STORM_GENERATOR_VARIABLEINFORMATION_H_ */
std::string const & getName() const
Retrieves the name of the variable.
Definition Variable.cpp:46
LabParser.cpp.
Definition cli.cpp:18
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::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.
IntegerVariableInformation const & getIntegerArrayVariableReplacement(storm::expressions::Variable const &arrayVariable, std::vector< uint64_t > const &arrayIndexVector) const
std::vector< BooleanVariableInformation > booleanVariables
The boolean variables.