|
|
@ -17,40 +17,40 @@ |
|
|
|
namespace storm { |
|
|
|
namespace generator { |
|
|
|
|
|
|
|
BooleanVariableInformation::BooleanVariableInformation(storm::expressions::Variable const& variable, uint_fast64_t bitOffset, bool global) : variable(variable), bitOffset(bitOffset), global(global) { |
|
|
|
BooleanVariableInformation::BooleanVariableInformation(storm::expressions::Variable const& variable, uint_fast64_t bitOffset, bool global, bool observable) : variable(variable), bitOffset(bitOffset), global(global), observable(observable) { |
|
|
|
// Intentionally left empty.
|
|
|
|
} |
|
|
|
|
|
|
|
IntegerVariableInformation::IntegerVariableInformation(storm::expressions::Variable const& variable, int_fast64_t lowerBound, int_fast64_t upperBound, uint_fast64_t bitOffset, uint_fast64_t bitWidth, bool global) : variable(variable), lowerBound(lowerBound), upperBound(upperBound), bitOffset(bitOffset), bitWidth(bitWidth), global(global) { |
|
|
|
IntegerVariableInformation::IntegerVariableInformation(storm::expressions::Variable const& variable, int_fast64_t lowerBound, int_fast64_t upperBound, uint_fast64_t bitOffset, uint_fast64_t bitWidth, bool global, bool observable) : variable(variable), lowerBound(lowerBound), upperBound(upperBound), bitOffset(bitOffset), bitWidth(bitWidth), global(global), observable(observable) { |
|
|
|
// Intentionally left empty.
|
|
|
|
} |
|
|
|
|
|
|
|
LocationVariableInformation::LocationVariableInformation(storm::expressions::Variable const& variable, uint64_t highestValue, uint_fast64_t bitOffset, uint_fast64_t bitWidth) : variable(variable), highestValue(highestValue), bitOffset(bitOffset), bitWidth(bitWidth) { |
|
|
|
LocationVariableInformation::LocationVariableInformation(storm::expressions::Variable const& variable, uint64_t highestValue, uint_fast64_t bitOffset, uint_fast64_t bitWidth, bool observable) : variable(variable), highestValue(highestValue), bitOffset(bitOffset), bitWidth(bitWidth), observable(observable) { |
|
|
|
// Intentionally left empty.
|
|
|
|
} |
|
|
|
|
|
|
|
VariableInformation::VariableInformation(storm::prism::Program const& program) : totalBitOffset(0) { |
|
|
|
for (auto const& booleanVariable : program.getGlobalBooleanVariables()) { |
|
|
|
booleanVariables.emplace_back(booleanVariable.getExpressionVariable(), totalBitOffset, true); |
|
|
|
booleanVariables.emplace_back(booleanVariable.getExpressionVariable(), totalBitOffset, true, booleanVariable.isObservable()); |
|
|
|
++totalBitOffset; |
|
|
|
} |
|
|
|
for (auto const& integerVariable : program.getGlobalIntegerVariables()) { |
|
|
|
int_fast64_t lowerBound = integerVariable.getLowerBoundExpression().evaluateAsInt(); |
|
|
|
int_fast64_t upperBound = integerVariable.getUpperBoundExpression().evaluateAsInt(); |
|
|
|
uint_fast64_t bitwidth = static_cast<uint_fast64_t>(std::ceil(std::log2(upperBound - lowerBound + 1))); |
|
|
|
integerVariables.emplace_back(integerVariable.getExpressionVariable(), lowerBound, upperBound, totalBitOffset, bitwidth, true); |
|
|
|
integerVariables.emplace_back(integerVariable.getExpressionVariable(), lowerBound, upperBound, totalBitOffset, bitwidth, true, integerVariable.isObservable()); |
|
|
|
totalBitOffset += bitwidth; |
|
|
|
} |
|
|
|
for (auto const& module : program.getModules()) { |
|
|
|
for (auto const& booleanVariable : module.getBooleanVariables()) { |
|
|
|
booleanVariables.emplace_back(booleanVariable.getExpressionVariable(), totalBitOffset); |
|
|
|
booleanVariables.emplace_back(booleanVariable.getExpressionVariable(), totalBitOffset, false, booleanVariable.isObservable()); |
|
|
|
++totalBitOffset; |
|
|
|
} |
|
|
|
for (auto const& integerVariable : module.getIntegerVariables()) { |
|
|
|
int_fast64_t lowerBound = integerVariable.getLowerBoundExpression().evaluateAsInt(); |
|
|
|
int_fast64_t upperBound = integerVariable.getUpperBoundExpression().evaluateAsInt(); |
|
|
|
uint_fast64_t bitwidth = static_cast<uint_fast64_t>(std::ceil(std::log2(upperBound - lowerBound + 1))); |
|
|
|
integerVariables.emplace_back(integerVariable.getExpressionVariable(), lowerBound, upperBound, totalBitOffset, bitwidth); |
|
|
|
integerVariables.emplace_back(integerVariable.getExpressionVariable(), lowerBound, upperBound, totalBitOffset, bitwidth, false, integerVariable.isObservable()); |
|
|
|
totalBitOffset += bitwidth; |
|
|
|
} |
|
|
|
} |
|
|
@ -69,7 +69,7 @@ namespace storm { |
|
|
|
|
|
|
|
for (auto const& variable : model.getGlobalVariables().getBooleanVariables()) { |
|
|
|
if (!variable.isTransient()) { |
|
|
|
booleanVariables.emplace_back(variable.getExpressionVariable(), totalBitOffset, true); |
|
|
|
booleanVariables.emplace_back(variable.getExpressionVariable(), totalBitOffset, true, true); |
|
|
|
++totalBitOffset; |
|
|
|
} |
|
|
|
} |
|
|
@ -78,7 +78,7 @@ namespace storm { |
|
|
|
int_fast64_t lowerBound = variable.getLowerBound().evaluateAsInt(); |
|
|
|
int_fast64_t upperBound = variable.getUpperBound().evaluateAsInt(); |
|
|
|
uint_fast64_t bitwidth = static_cast<uint_fast64_t>(std::ceil(std::log2(upperBound - lowerBound + 1))); |
|
|
|
integerVariables.emplace_back(variable.getExpressionVariable(), lowerBound, upperBound, totalBitOffset, bitwidth, true); |
|
|
|
integerVariables.emplace_back(variable.getExpressionVariable(), lowerBound, upperBound, totalBitOffset, bitwidth, true, true); |
|
|
|
totalBitOffset += bitwidth; |
|
|
|
} |
|
|
|
} |
|
|
@ -92,12 +92,12 @@ namespace storm { |
|
|
|
|
|
|
|
void VariableInformation::createVariablesForAutomaton(storm::jani::Automaton const& automaton) { |
|
|
|
uint_fast64_t bitwidth = static_cast<uint_fast64_t>(std::ceil(std::log2(automaton.getNumberOfLocations()))); |
|
|
|
locationVariables.emplace_back(automaton.getLocationExpressionVariable(), automaton.getNumberOfLocations() - 1, totalBitOffset, bitwidth); |
|
|
|
locationVariables.emplace_back(automaton.getLocationExpressionVariable(), automaton.getNumberOfLocations() - 1, totalBitOffset, bitwidth, true); |
|
|
|
totalBitOffset += bitwidth; |
|
|
|
|
|
|
|
for (auto const& variable : automaton.getVariables().getBooleanVariables()) { |
|
|
|
if (!variable.isTransient()) { |
|
|
|
booleanVariables.emplace_back(variable.getExpressionVariable(), totalBitOffset); |
|
|
|
booleanVariables.emplace_back(variable.getExpressionVariable(), totalBitOffset, false, true); |
|
|
|
++totalBitOffset; |
|
|
|
} |
|
|
|
} |
|
|
@ -106,7 +106,7 @@ namespace storm { |
|
|
|
int_fast64_t lowerBound = variable.getLowerBound().evaluateAsInt(); |
|
|
|
int_fast64_t upperBound = variable.getUpperBound().evaluateAsInt(); |
|
|
|
uint_fast64_t bitwidth = static_cast<uint_fast64_t>(std::ceil(std::log2(upperBound - lowerBound + 1))); |
|
|
|
integerVariables.emplace_back(variable.getExpressionVariable(), lowerBound, upperBound, totalBitOffset, bitwidth); |
|
|
|
integerVariables.emplace_back(variable.getExpressionVariable(), lowerBound, upperBound, totalBitOffset, bitwidth, false, true); |
|
|
|
totalBitOffset += bitwidth; |
|
|
|
} |
|
|
|
} |
|
|
|