24 boost::optional<storm::RationalFunction>
const&
lowerBound,
25 boost::optional<storm::RationalFunction>
const&
upperBound,
31template<
typename VariableType>
36 "The default value for transient variable " <<
variable.getName() <<
" is smaller than its lower bound.");
38 "The default value for transient variable " <<
variable.getName() <<
" is higher than its upper bound.");
41template<
typename VariableType>
47template<
typename ValueType>
49 storm::jani::Model const& model, std::vector<std::reference_wrapper<storm::jani::Automaton const>>
const& parallelAutomata) {
52 for (
auto const& automatonRef : parallelAutomata) {
53 createVariablesForAutomaton(automatonRef.get());
59template<
typename ValueType>
64 if (arrayVariable->isTransient()) {
65 auto findRes = arrayEliminatorData.
replacements.find(arrayVariable->getExpressionVariable());
67 auto const& replacements = findRes->second;
68 auto const& innerType = arrayVariable->getType().asArrayType().getBaseTypeRecursive();
69 if (innerType.isBasicType() && innerType.asBasicType().isBooleanType()) {
72 }
else if ((innerType.isBasicType() && innerType.asBasicType().isIntegerType()) ||
73 (innerType.isBoundedType() && innerType.asBoundedType().isIntegerType())) {
76 }
else if ((innerType.isBasicType() && innerType.asBasicType().isRealType()) ||
77 (innerType.isBoundedType() && innerType.asBoundedType().isRealType())) {
81 STORM_LOG_THROW(
false, storm::exceptions::UnexpectedException,
"Unhandled type of base variable.");
87template<
typename ValueType>
93template<
typename ValueType>
99template<
typename ValueType>
105template<
typename ValueType>
106void TransientVariableInformation<ValueType>::createVariablesForAutomaton(
storm::jani::Automaton const& automaton) {
107 createVariablesForVariableSet(automaton.
getVariables(),
false);
110template<
typename ValueType>
111void TransientVariableInformation<ValueType>::createVariablesForVariableSet(
storm::jani::VariableSet const& variableSet,
bool global) {
113 if (variable.isTransient()) {
114 booleanVariableInformation.emplace_back(variable.getExpressionVariable(), variable.getInitExpression().evaluateAsBool(), global);
118 if (variable.isTransient()) {
119 boost::optional<int64_t> lowerBound;
120 boost::optional<int64_t> upperBound;
121 auto const& type = variable.getType().asBoundedType();
122 if (type.hasLowerBound()) {
123 lowerBound = type.getLowerBound().evaluateAsInt();
125 if (type.hasUpperBound()) {
126 upperBound = type.getUpperBound().evaluateAsInt();
128 integerVariableInformation.emplace_back(variable.getExpressionVariable(), lowerBound, upperBound, variable.getInitExpression().evaluateAsInt(),
133 if (variable.isTransient()) {
134 integerVariableInformation.emplace_back(variable.getExpressionVariable(), variable.getInitExpression().evaluateAsInt(), global);
138 if (variable.isTransient()) {
139 rationalVariableInformation.emplace_back(variable.getExpressionVariable(),
145template<
typename ValueType>
146void TransientVariableInformation<ValueType>::sortVariables() {
148 std::sort(booleanVariableInformation.begin(), booleanVariableInformation.end(),
150 std::sort(integerVariableInformation.begin(), integerVariableInformation.end(),
152 std::sort(rationalVariableInformation.begin(), rationalVariableInformation.end(),
156template<
typename ValueType>
159 evaluator.setBooleanValue(variableData.variable, variableData.defaultValue);
162 evaluator.setIntegerValue(variableData.variable, variableData.defaultValue);
165 evaluator.setRationalValue(variableData.variable, variableData.defaultValue);
VariableSet & getVariables()
Retrieves the variables of this automaton.
VariableSet & getGlobalVariables()
Retrieves the variables of this automaton.
detail::Variables< Variable > getBoundedIntegerVariables()
Retrieves the bounded integer variables in this set.
detail::Variables< Variable > getUnboundedIntegerVariables()
Retrieves the unbounded integer variables in this set.
detail::Variables< Variable > getRealVariables()
Retrieves the real variables in this set.
detail::Variables< Variable > getBooleanVariables()
Retrieves the boolean variables in this set.
#define STORM_LOG_ASSERT(cond, message)
#define STORM_LOG_THROW(cond, exception, message)
ArrayVariableReplacementInformation convertArrayReplacement(typename storm::jani::ArrayEliminatorData::Replacement const &replacement, InfoType const &relevantVariableInfo)
TargetType convertNumber(SourceType const &number)
carl::RationalFunction< Polynomial, true > RationalFunction
boost::optional< VariableType > lowerBound
TransientVariableData(storm::expressions::Variable const &variable, boost::optional< VariableType > const &lowerBound, boost::optional< VariableType > const &upperBound, VariableType const &defaultValue, bool global=false)
boost::optional< VariableType > upperBound
VariableType defaultValue
storm::expressions::Variable variable
std::unordered_map< storm::expressions::Variable, Replacement > replacements
std::vector< std::shared_ptr< Variable > > eliminatedArrayVariables