48 boost::optional<std::shared_ptr<storm::expressions::ExpressionManager>>
const& expressionManager)
49 : name(name), modelType(modelType), version(version), composition(nullptr) {
51 if (expressionManager) {
52 this->expressionManager = expressionManager.get();
54 this->expressionManager = std::make_shared<storm::expressions::ExpressionManager>();
58 initialStatesRestriction = this->expressionManager->boolean(
true);
71 this->name = other.name;
72 this->modelType = other.modelType;
73 this->modelFeatures = other.modelFeatures;
74 this->version = other.version;
75 this->expressionManager = other.expressionManager;
76 this->actions = other.actions;
77 this->actionToIndex = other.actionToIndex;
78 this->nonsilentActionIndices = other.nonsilentActionIndices;
79 this->constants = other.constants;
80 this->constantToIndex = other.constantToIndex;
81 this->globalVariables = other.globalVariables;
82 this->nonTrivialRewardModels = other.nonTrivialRewardModels;
83 this->automata = other.automata;
84 this->automatonToIndex = other.automatonToIndex;
85 this->composition = other.composition;
86 this->initialStatesRestriction = other.initialStatesRestriction;
87 this->globalFunctions = other.globalFunctions;
90 std::map<Variable const*, std::reference_wrapper<Variable const>> remapping;
92 remapping.emplace(&variable, this->
getGlobalVariables().getVariable(variable.getName()));
94 auto otherAutomatonIt = other.automata.begin();
95 auto thisAutomatonIt = this->automata.begin();
97 for (; otherAutomatonIt != other.automata.end(); ++otherAutomatonIt, ++thisAutomatonIt) {
98 for (
auto const& variable : otherAutomatonIt->getVariables()) {
99 remapping.emplace(&variable, thisAutomatonIt->getVariables().getVariable(variable.getName()));
102 thisAutomatonIt->changeAssignmentVariables(remapping);
110 return *expressionManager;
122 modelType = newModelType;
126 return modelFeatures;
130 return modelFeatures;
149 boost::optional<storm::expressions::Expression>
rate;
157 auto it = chosenEdges.begin();
160 for (; it != chosenEdges.end(); ++it) {
161 result = result && it->get().getGuard();
172 for (
auto const& edge : edgesToSynchronize) {
173 result.
condition.push_back(edge.get().getSourceLocationIndex());
177 std::vector<std::vector<EdgeDestination>::const_iterator> destinationIterators;
178 for (uint_fast64_t i = 0; i < edgesToSynchronize.size(); ++i) {
179 destinationIterators.push_back(edgesToSynchronize[i].get().getDestinations().cbegin());
182 bool doneDestinations =
false;
185 result.
probabilities.emplace_back(destinationIterators[0]->getProbability());
186 for (uint_fast64_t i = 1; i < destinationIterators.size(); ++i) {
192 for (uint_fast64_t i = 0; i < destinationIterators.size(); ++i) {
193 for (
auto const& assignment : destinationIterators[i]->getOrderedAssignments().getAllAssignments()) {
199 result.
templateEdge->addDestination(templateDestination);
203 for (uint_fast64_t i = 0; i < destinationIterators.size(); ++i) {
204 result.
effects.back().push_back(destinationIterators[i]->getLocationIndex());
208 bool movedIterator =
false;
209 for (int_fast64_t j = destinationIterators.size() - 1; j >= 0; --j) {
210 ++destinationIterators[j];
211 if (destinationIterators[j] != edgesToSynchronize[j].get().getDestinations().cend()) {
212 movedIterator =
true;
216 destinationIterators[j] = edgesToSynchronize[j].get().getDestinations().cbegin();
220 doneDestinations = !movedIterator;
221 }
while (!doneDestinations);
228 std::vector<std::reference_wrapper<Automaton const>>
const& composedAutomata,
230 std::vector<ConditionalMetaEdge> result;
233 std::vector<uint64_t> components;
234 std::vector<std::pair<std::reference_wrapper<Automaton const>, uint64_t>> participatingAutomataAndActions;
235 for (uint64_t i = 0; i < composedAutomata.size(); ++i) {
236 std::string
const& actionName = vector.
getInput(i);
238 components.push_back(i);
241 participatingAutomataAndActions.push_back(std::make_pair(composedAutomata[i], actionIndex));
243 synchronizingActionIndices[i].insert(actionIndex);
257 bool noCombinations =
false;
260 std::vector<std::vector<std::reference_wrapper<storm::jani::Edge const>>> possibleEdges;
262 for (
auto const& automatonActionPair : participatingAutomataAndActions) {
263 possibleEdges.emplace_back();
264 for (
auto const& edge : automatonActionPair.first.get().getEdges()) {
265 if (edge.getActionIndex() == automatonActionPair.second) {
266 possibleEdges.back().push_back(edge);
271 if (possibleEdges.back().empty()) {
272 noCombinations =
true;
278 if (!noCombinations) {
284 std::vector<std::vector<storm::expressions::Variable>> edgeVariables(possibleEdges.size());
285 std::vector<storm::expressions::Variable> allEdgeVariables;
286 for (uint_fast64_t outerIndex = 0; outerIndex < possibleEdges.size(); ++outerIndex) {
288 for (uint_fast64_t innerIndex = 0; innerIndex < possibleEdges[outerIndex].size(); ++innerIndex) {
290 allEdgeVariables.push_back(edgeVariables[outerIndex].back());
292 solver.add(implies(edgeVariables[outerIndex].back(), guard));
296 for (
auto const& edgeVariable : edgeVariables[outerIndex]) {
297 atLeastOneEdgeFromAutomaton = atLeastOneEdgeFromAutomaton || edgeVariable;
299 solver.add(atLeastOneEdgeFromAutomaton);
302 for (uint64_t first = 0; first < possibleEdges[outerIndex].size(); ++first) {
303 for (uint64_t second = first + 1; second < possibleEdges[outerIndex].size(); ++second) {
304 atMostOneEdgeFromAutomaton = atMostOneEdgeFromAutomaton && !(edgeVariables[outerIndex][first] && edgeVariables[outerIndex][second]);
307 solver.add(atMostOneEdgeFromAutomaton);
313 std::vector<std::reference_wrapper<Edge const>> chosenEdges;
315 for (uint_fast64_t outerIndex = 0; outerIndex < edgeVariables.size(); ++outerIndex) {
316 for (uint_fast64_t innerIndex = 0; innerIndex < edgeVariables[outerIndex].size(); ++innerIndex) {
317 if (modelReference.
getBooleanValue(edgeVariables[outerIndex][innerIndex])) {
318 chosenEdges.emplace_back(possibleEdges[outerIndex][innerIndex]);
332 conditionalMetaEdge.
actionIndex = resultingActionIndex;
334 result.push_back(conditionalMetaEdge);
346 std::vector<uint64_t>
const& locations,
bool initial =
false) {
347 std::stringstream locationNameBuilder;
348 for (uint64_t i = 0; i < locations.size(); ++i) {
349 locationNameBuilder << composedAutomata[i].get().getLocation(locations[i]).getName() <<
"_";
354 for (uint64_t i = 0; i < locations.size(); ++i) {
355 for (
auto const& assignment : composedAutomata[i].get().getLocation(locations[i]).getAssignments()) {
366 std::vector<ConditionalMetaEdge>
const& conditionalMetaEdges) {
368 std::vector<std::vector<uint64_t>> locationsToExplore;
371 std::vector<std::set<uint64_t>::const_iterator> initialLocationsIts;
372 std::vector<std::set<uint64_t>::const_iterator> initialLocationsItes;
373 for (
auto const& automaton : composedAutomata) {
374 initialLocationsIts.push_back(automaton.get().getInitialLocationIndices().cbegin());
375 initialLocationsItes.push_back(automaton.get().getInitialLocationIndices().cend());
377 std::vector<uint64_t> initialLocation(composedAutomata.size());
379 initialLocationsIts, initialLocationsItes, [&initialLocation](uint64_t index, uint64_t value) { initialLocation[index] = value; },
380 [&locationsToExplore, &initialLocation]() {
381 locationsToExplore.push_back(initialLocation);
389 for (
auto const& location : locationsToExplore) {
390 uint64_t
id = newLocationMapping.size();
391 newLocationMapping[location] = id;
396 while (!locationsToExplore.empty()) {
397 std::vector<uint64_t> currentLocations = std::move(locationsToExplore.back());
398 locationsToExplore.pop_back();
400 for (
auto const& metaEdge : conditionalMetaEdges) {
401 bool isApplicable =
true;
402 for (uint64_t i = 0; i < metaEdge.components.size(); ++i) {
403 if (currentLocations[metaEdge.components[i]] != metaEdge.condition[i]) {
404 isApplicable =
false;
410 std::vector<uint64_t> newLocations;
412 for (
auto const& effect : metaEdge.effects) {
413 std::vector<uint64_t> targetLocationCombination = currentLocations;
414 for (uint64_t i = 0; i < metaEdge.components.size(); ++i) {
415 targetLocationCombination[metaEdge.components[i]] = effect[i];
419 auto it = newLocationMapping.find(targetLocationCombination);
420 if (it != newLocationMapping.end()) {
421 newLocations.emplace_back(it->second);
423 uint64_t
id = newLocationMapping.size();
424 newLocationMapping[targetLocationCombination] = id;
425 locationsToExplore.emplace_back(std::move(targetLocationCombination));
426 newLocations.emplace_back(
id);
431 newAutomaton.
addEdge(
Edge(newLocationMapping.at(currentLocations), metaEdge.actionIndex, metaEdge.rate, metaEdge.templateEdge, newLocations,
432 metaEdge.probabilities));
447 "Flatting composition is only supported for standard-compliant compositions.");
449 "Unable to flatten modules for model of type '" << this->
getModelType() <<
"'.");
451 "Flattening JANI model with arrays is not supported. We'll try but there might be unexpected errors.");
453 for (
auto const& aut : automata) {
454 STORM_LOG_THROW(aut.getFunctionDefinitions().empty(), storm::exceptions::NotImplementedException,
455 "Flattening JANI model with local function declarations not implemented. Try to eliminate functions first or make them global.");
465 std::unique_ptr<storm::solver::SmtSolver>
solver = smtSolverFactory->create(*expressionManager);
471 "Flatting does not support input-enabling actions.");
480 Automaton newAutomaton(this->
getName() +
"_flattened", expressionManager->declareIntegerVariable(
"_loc_flattened_" + this->getName()));
482 std::map<Variable const*, std::reference_wrapper<Variable const>> variableRemapping;
484 std::unique_ptr<Variable> renamedVariable = variable.clone();
485 variableRemapping.emplace(&variable, flattenedModel.
addVariable(*renamedVariable));
500 std::vector<std::reference_wrapper<Automaton const>> composedAutomata;
502 STORM_LOG_THROW(element->isAutomatonComposition(), storm::exceptions::WrongFormatException,
503 "Cannot flatten recursive (not standard-compliant) composition.");
506 "Flatting does not support input-enabling actions.");
508 composedAutomata.push_back(oldAutomaton);
511 for (
auto const& variable : oldAutomaton.
getVariables()) {
512 std::unique_ptr<Variable> renamedVariable = variable.clone();
513 renamedVariable->setName(oldAutomaton.
getName() +
"_" + renamedVariable->getName());
514 variableRemapping.emplace(&variable, newAutomaton.
addVariable(*renamedVariable));
521 if (constant.isDefined()) {
522 if (constant.isBooleanConstant()) {
525 solver->add(constant.getExpressionVariable() == constant.getExpression());
531 solver->add(variable.getRangeExpression());
535 std::vector<std::set<uint64_t>> synchronizingActionIndices(composedAutomata.size());
536 std::vector<ConditionalMetaEdge> conditionalMetaEdges;
539 if (vector.getNumberOfActionInputs() <= 1) {
544 std::vector<ConditionalMetaEdge> newConditionalMetaEdges =
546 conditionalMetaEdges.insert(conditionalMetaEdges.end(), newConditionalMetaEdges.begin(), newConditionalMetaEdges.end());
550 for (uint64_t i = 0; i < composedAutomata.size(); ++i) {
551 Automaton const& automaton = composedAutomata[i].get();
552 for (
auto const& edge : automaton.
getEdges()) {
553 if (synchronizingActionIndices[i].find(edge.getActionIndex()) == synchronizingActionIndices[i].end()) {
554 uint64_t actionIndex = edge.getActionIndex();
557 if (flattenedModel.
hasAction(actionName)) {
560 actionIndex = flattenedModel.
addAction(actionName);
564 conditionalMetaEdges.emplace_back();
567 conditionalMetaEdge.
templateEdge = std::make_shared<TemplateEdge>(edge.getGuard());
569 conditionalMetaEdge.
actionIndex = edge.getActionIndex();
570 conditionalMetaEdge.
components.emplace_back(
static_cast<uint64_t
>(i));
571 conditionalMetaEdge.
condition.emplace_back(edge.getSourceLocationIndex());
572 conditionalMetaEdge.
rate = edge.getOptionalRate();
573 for (
auto const& destination : edge.getDestinations()) {
574 conditionalMetaEdge.
templateEdge->addDestination(destination.getOrderedAssignments());
575 conditionalMetaEdge.
effects.emplace_back();
577 conditionalMetaEdge.
effects.back().emplace_back(destination.getLocationIndex());
578 conditionalMetaEdge.
probabilities.emplace_back(destination.getProbability());
593 for (
auto const& automaton : composedAutomata) {
594 if (automaton.get().hasInitialStatesRestriction()) {
595 initialStatesRestriction = initialStatesRestriction && automaton.get().getInitialStatesRestriction();
597 for (
auto const& funDef : automaton.get().getFunctionDefinitions()) {
610 return flattenedModel;
614 auto it = actionToIndex.find(action.
getName());
615 STORM_LOG_THROW(it == actionToIndex.end(), storm::exceptions::WrongFormatException,
"Action with name '" << action.
getName() <<
"' already exists.");
616 actionToIndex.emplace(action.
getName(), actions.size());
617 actions.push_back(action);
619 nonsilentActionIndices.insert(actions.size() - 1);
621 return actions.size() - 1;
625 return actions[index];
629 return actionToIndex.find(name) != actionToIndex.end();
633 auto it = actionToIndex.find(name);
634 STORM_LOG_THROW(it != actionToIndex.end(), storm::exceptions::InvalidOperationException,
"Unable to retrieve index of unknown action '" << name <<
"'.");
639 return actionToIndex;
647 return nonsilentActionIndices;
651 auto it = constantToIndex.find(constant.
getName());
652 STORM_LOG_THROW(it == constantToIndex.end(), storm::exceptions::WrongFormatException,
653 "Cannot add constant with name '" << constant.
getName() <<
"', because a constant with that name already exists.");
654 constantToIndex.emplace(constant.
getName(), constants.size());
655 constants.push_back(constant);
660 return constantToIndex.find(name) != constantToIndex.end();
664 auto pos = constantToIndex.find(name);
665 if (pos != constantToIndex.end()) {
666 uint64_t index = pos->second;
667 constants.erase(constants.begin() + index);
668 constantToIndex.erase(pos);
669 for (
auto& entry : constantToIndex) {
670 if (entry.second > index) {
680 auto it = constantToIndex.find(name);
681 STORM_LOG_THROW(it != constantToIndex.end(), storm::exceptions::WrongFormatException,
"Unable to retrieve unknown constant '" << name <<
"'.");
682 return constants[it->second];
696 res += aut.getNumberOfEdges();
702 std::size_t res = globalVariables.getNumberOfNontransientVariables();
704 res += aut.getVariables().getNumberOfNontransientVariables();
714 return globalVariables.addVariable(variable);
718 return globalVariables;
722 return globalVariables;
726 std::set<storm::expressions::Variable> result;
728 for (
auto const& constant : constants) {
729 result.insert(constant.getExpressionVariable());
732 result.insert(variable.getExpressionVariable());
734 for (
auto const& automaton : automata) {
735 auto const& automatonVariables = automaton.getAllExpressionVariables();
736 result.insert(automatonVariables.begin(), automatonVariables.end());
737 if (includeLocationExpressionVariables) {
738 result.insert(automaton.getLocationExpressionVariable());
746 std::set<storm::expressions::Variable> result;
747 for (
auto const& automaton : automata) {
748 result.insert(automaton.getLocationExpressionVariable());
758 return globalVariables.getVariable(name);
762 for (
auto const& automaton : automata) {
763 if (automaton.hasTransientVariable()) {
771 auto insertionRes = globalFunctions.emplace(functionDefinition.
getName(), functionDefinition);
772 STORM_LOG_THROW(insertionRes.second, storm::exceptions::InvalidOperationException,
773 " a function with the name " << functionDefinition.
getName() <<
" already exists in this model.");
774 return insertionRes.first->second;
778 return globalFunctions;
782 return globalFunctions;
786 return *expressionManager;
790 return !nonTrivialRewardModels.empty();
794 return nonTrivialRewardModels.count(identifier) > 0;
801 STORM_LOG_THROW(!globalVariables.hasVariable(identifier) || !globalVariables.getVariable(identifier).isTransient(),
802 storm::exceptions::InvalidArgumentException,
803 "Non trivial reward expression with identifier '" << identifier <<
"' clashes with global transient variable of the same name.");
804 nonTrivialRewardModels.emplace(identifier, rewardExpression);
810 auto findRes = nonTrivialRewardModels.find(identifier);
811 if (findRes != nonTrivialRewardModels.end()) {
812 return findRes->second;
815 if (globalVariables.hasVariable(identifier)) {
816 return globalVariables.getVariable(identifier).getExpressionVariable().getExpression();
818 STORM_LOG_THROW(identifier.empty(), storm::exceptions::InvalidArgumentException,
"Cannot find unknown reward model '" << identifier <<
"'.");
819 STORM_LOG_THROW(nonTrivialRewardModels.size() + globalVariables.getNumberOfNumericalTransientVariables() == 1,
820 storm::exceptions::InvalidArgumentException,
"Reference to standard reward model is ambiguous.");
821 if (nonTrivialRewardModels.size() == 1) {
822 return nonTrivialRewardModels.begin()->second;
824 for (
auto const& variable : globalVariables.getTransientVariables()) {
825 auto const& type = variable.getType();
826 if ((type.isBasicType() && type.asBasicType().isNumericalType()) || (type.isBoundedType() && type.asBoundedType().isNumericalType())) {
827 return variable.getExpressionVariable().getExpression();
833 STORM_LOG_THROW(
false, storm::exceptions::InvalidArgumentException,
"Cannot find unknown reward model '" << identifier <<
"'.");
838 std::vector<std::pair<std::string, storm::expressions::Expression>> result;
839 for (
auto const& nonTrivExpr : nonTrivialRewardModels) {
840 result.emplace_back(nonTrivExpr.first, nonTrivExpr.second);
842 for (
auto const& variable : globalVariables.getTransientVariables()) {
843 auto const& type = variable.getType();
844 if ((type.isBasicType() && type.asBasicType().isNumericalType()) || (type.isBoundedType() && type.asBoundedType().isNumericalType())) {
845 result.emplace_back(variable.getName(), variable.getExpressionVariable().getExpression());
852 return nonTrivialRewardModels;
856 return nonTrivialRewardModels;
860 auto it = automatonToIndex.find(automaton.
getName());
861 STORM_LOG_THROW(it == automatonToIndex.end(), storm::exceptions::WrongFormatException,
862 "Automaton with name '" << automaton.
getName() <<
"' already exists.");
863 automatonToIndex.emplace(automaton.
getName(), automata.size());
864 automata.push_back(automaton);
865 return automata.size() - 1;
877 return automatonToIndex.find(name) != automatonToIndex.end();
881 automata[index] = automaton;
885 auto it = automatonToIndex.find(name);
886 STORM_LOG_THROW(it != automatonToIndex.end(), storm::exceptions::InvalidOperationException,
"Unable to retrieve unknown automaton '" << name <<
"'.");
887 return automata[it->second];
891 return automata[index];
895 return automata[index];
899 auto it = automatonToIndex.find(name);
900 STORM_LOG_THROW(it != automatonToIndex.end(), storm::exceptions::InvalidOperationException,
"Unable to retrieve unknown automaton '" << name <<
"'.");
901 return automata[it->second];
905 auto it = automatonToIndex.find(name);
906 STORM_LOG_THROW(it != automatonToIndex.end(), storm::exceptions::InvalidOperationException,
"Unable to retrieve unknown automaton '" << name <<
"'.");
911 return automata.size();
916 std::set<uint64_t> allActionIndices;
917 std::vector<std::set<uint64_t>> automatonActionIndices;
918 std::vector<std::shared_ptr<Composition>> subcompositions;
919 for (
auto const& automaton : automata) {
920 automatonActionIndices.push_back(automaton.getActionIndices());
922 allActionIndices.insert(automatonActionIndices.back().begin(), automatonActionIndices.back().end());
923 subcompositions.push_back(std::make_shared<AutomatonComposition>(automaton.getName()));
928 std::vector<storm::jani::SynchronizationVector> synchVectors;
929 for (
auto actionIndex : allActionIndices) {
931 std::vector<std::string> synchVectorInputs;
932 for (
auto const& actionIndices : automatonActionIndices) {
933 if (actionIndices.find(actionIndex) != actionIndices.end()) {
934 synchVectorInputs.push_back(actionName);
942 return std::make_shared<ParallelComposition>(subcompositions, synchVectors);
952 : automatonToCopiesMap(automatonToCopiesMap) {}
955 return boost::any_cast<std::shared_ptr<Composition>>(oldComposition.
accept(*
this, boost::any()));
960 if (automatonToCopiesMap.count(name) != 0) {
961 auto& copies = automatonToCopiesMap[name];
962 STORM_LOG_ASSERT(!copies.empty(),
"Not enough copies of automaton " << name <<
".");
963 name = copies.back();
970 std::vector<std::shared_ptr<Composition>> subcomposition;
972 subcomposition.push_back(boost::any_cast<std::shared_ptr<Composition>>(p->accept(*
this, data)));
978 std::unordered_map<std::string, std::vector<std::string>> automatonToCopiesMap;
985 STORM_LOG_WARN(
"Unable to simplify non-standard compliant system composition.");
989 std::unordered_map<std::string, std::vector<std::string>> automatonToCopiesMap;
991 if (automatonMultiplicity.second > 1) {
992 std::vector<std::string> copies = {automatonMultiplicity.first};
994 for (uint64_t copyIndex = 1; copyIndex < automatonMultiplicity.second; ++copyIndex) {
995 std::string copyPrefix =
"Copy__" + std::to_string(copyIndex) +
"_Of";
996 std::string copyAutName = copyPrefix + automatonMultiplicity.first;
998 copies.push_back(copyAutName);
1001 std::reverse(copies.begin(), copies.end());
1003 automatonToCopiesMap[automatonMultiplicity.first] = std::move(copies);
1007 if (!automatonToCopiesMap.empty()) {
1015 this->composition = composition;
1023 std::set<std::string> result;
1024 for (
auto const& entry : actionToIndex) {
1026 result.insert(entry.first);
1033 std::map<uint64_t, std::string> mapping;
1035 for (
auto const& act : actions) {
1036 mapping[i] = act.getName();
1043 Model result(*
this);
1045 std::set<storm::expressions::Variable> definedUndefinedConstants;
1046 for (
auto& constant : result.constants) {
1049 if (constant.isDefined()) {
1051 STORM_LOG_THROW(constantDefinitions.find(constant.getExpressionVariable()) == constantDefinitions.end(),
1052 storm::exceptions::InvalidOperationException,
"Illegally defining already defined constant '" << constant.getName() <<
"'.");
1054 auto const& variableExpressionPair = constantDefinitions.find(constant.getExpressionVariable());
1056 if (variableExpressionPair != constantDefinitions.end()) {
1058 definedUndefinedConstants.insert(constant.getExpressionVariable());
1061 STORM_LOG_THROW(variableExpressionPair->second.getType() == constant.getType(), storm::exceptions::InvalidOperationException,
1062 "Illegal type of expression defining constant '" << constant.getName() <<
"'.");
1065 if (constant.hasConstraint()) {
1067 using SubMap = std::map<storm::expressions::Variable, storm::expressions::Expression>;
1069 constant.setConstraintExpression(transcendentalsVisitor.
substitute(constant.getConstraintExpression()));
1071 constant.define(variableExpressionPair->second);
1080 for (
auto const& constant : constants) {
1081 if (!constant.isDefined()) {
1089 std::vector<std::reference_wrapper<Constant const>> result;
1091 for (
auto const& constant : constants) {
1092 if (!constant.isDefined()) {
1093 result.push_back(constant);
1107 std::map<storm::expressions::Variable, storm::expressions::Expression> constantSubstitution;
1109 if (constant.hasConstraint()) {
1110 constant.setConstraintExpression(
1111 substituteJaniExpression(constant.getConstraintExpression(), constantSubstitution, substituteTranscendentalNumbers));
1113 if (constant.isDefined()) {
1114 constant.define(
substituteJaniExpression(constant.getExpression(), constantSubstitution, substituteTranscendentalNumbers));
1115 constantSubstitution[constant.getExpressionVariable()] = constant.getExpression();
1120 functionDefinition.second.substitute(constantSubstitution, substituteTranscendentalNumbers);
1135 automaton.substitute(constantSubstitution, substituteTranscendentalNumbers);
1141 Model result(*
this);
1148 Model result(*
this);
1155Model Model::preprocess(std::map<storm::expressions::Variable, storm::expressions::Expression>
const& constantDefinitions)
const {
1166 std::map<storm::expressions::Variable, storm::expressions::Expression> result;
1168 for (
auto const& constant : constants) {
1169 if (constant.isDefined()) {
1170 result.emplace(constant.getExpressionVariable(), constant.getExpression());
1177void Model::substitute(std::map<storm::expressions::Variable, storm::expressions::Expression>
const& substitution,
bool const substituteTranscendentalNumbers) {
1180 if (constant.hasConstraint()) {
1181 constant.setConstraintExpression(
substituteJaniExpression(constant.getConstraintExpression(), substitution, substituteTranscendentalNumbers));
1183 if (constant.isDefined()) {
1184 constant.define(
substituteJaniExpression(constant.getExpression(), substitution, substituteTranscendentalNumbers));
1189 functionDefinition.second.substitute(substitution, substituteTranscendentalNumbers);
1194 variable.substitute(substitution, substituteTranscendentalNumbers);
1197 variable.substitute(substitution, substituteTranscendentalNumbers);
1200 variable.substitute(substitution, substituteTranscendentalNumbers);
1212 automaton.substitute(substitution, substituteTranscendentalNumbers);
1217 std::vector<Property> emptyPropertyVector;
1230 if (a.getVariables().containsArrayVariables()) {
1239 return arrayEliminator.
eliminate(*
this, keepNonTrivialArrayAccess);
1244 for (
auto& p : properties) {
1245 data.transformProperty(p);
1250 std::vector<Property> emptyPropertyVector;
1288 return uncheckedFeatures;
1292 this->initialStatesRestriction = initialStatesRestriction;
1300 return initialStatesRestriction;
1308 if (variable.hasInitExpression() && !variable.isTransient()) {
1313 for (
auto const& automaton : this->automata) {
1314 if (automaton.hasNonTrivialInitialStates()) {
1324 std::vector<std::reference_wrapper<storm::jani::Automaton const>> allAutomata;
1325 for (
auto const& automaton : this->
getAutomata()) {
1326 allAutomata.push_back(automaton);
1337 for (
auto const& automaton : this->
getAutomata()) {
1338 result &= automaton.hasTrivialInitialStatesExpression();
1351 for (
auto const& variable : globalVariables) {
1352 if (variable.isTransient()) {
1356 if (variable.hasInitExpression()) {
1358 if (variable.getType().isBasicType() && variable.getType().asBasicType().isBooleanType()) {
1361 newInitExpression = variable.getExpressionVariable() == variable.getInitExpression();
1363 result = result && newInitExpression;
1368 for (
auto const& automatonReference : automata) {
1372 if (automatonInitialStatesExpression.
isInitialized() && !automatonInitialStatesExpression.
isTrue()) {
1373 result = result && automatonInitialStatesExpression;
1389 std::vector<std::reference_wrapper<storm::jani::Automaton const>>
const& automata)
const {
1390 std::vector<storm::expressions::Expression> result;
1391 for (
auto const& variable : this->
getGlobalVariables().getBoundedIntegerVariables()) {
1392 result.push_back(variable.getRangeExpression());
1396 if (automata.empty()) {
1397 for (
auto const& automaton : this->
getAutomata()) {
1398 std::vector<storm::expressions::Expression> automatonRangeExpressions = automaton.getAllRangeExpressions();
1399 result.insert(result.end(), automatonRangeExpressions.begin(), automatonRangeExpressions.end());
1402 for (
auto const& automaton : automata) {
1403 std::vector<storm::expressions::Expression> automatonRangeExpressions = automaton.get().getAllRangeExpressions();
1404 result.insert(result.end(), automatonRangeExpressions.begin(), automatonRangeExpressions.end());
1412 automaton.finalize(*
this);
1424 std::vector<std::reference_wrapper<Automaton const>> allAutomata;
1425 for (
auto const& automaton : automata) {
1426 allAutomata.emplace_back(automaton);
1432 std::vector<std::reference_wrapper<Automaton const>>
const& automata)
const {
1433 STORM_LOG_THROW(transientVariable.
isTransient(), storm::exceptions::InvalidArgumentException,
"Expected transient variable.");
1434 auto const& type = transientVariable.
getType();
1435 STORM_LOG_THROW(type.isBasicType() && type.asBasicType().isBooleanType(), storm::exceptions::InvalidArgumentException,
"Expected boolean variable.");
1440 for (
auto const& automaton : automata) {
1443 for (
auto const& location : automaton.get().getLocations()) {
1444 for (
auto const& assignment : location.getAssignments().getTransientAssignments()) {
1447 if (automaton.get().getNumberOfLocations() <= 1) {
1448 newExpression = (negate ? !assignment.getAssignedExpression() : assignment.getAssignedExpression());
1450 newExpression = (locationVariable == this->
getManager().
integer(automaton.get().getLocationIndex(location.getName()))) &&
1451 (negate ? !assignment.getAssignedExpression() : assignment.getAssignedExpression());
1454 result = result || newExpression;
1456 result = newExpression;
1481 if (multiplicity.second > 1) {
1503 std::set<storm::expressions::Variable> undefinedConstantVariables;
1505 if (!constant.isDefined()) {
1506 undefinedConstantVariables.insert(constant.getExpressionVariable());
1513 if (constant.isDefined()) {
1514 if (constant.getExpression().containsVariable(undefinedConstantVariables)) {
1515 undefinedConstantVariables.insert(constant.getExpressionVariable());
1521 if (this->
getGlobalVariables().containsVariablesInBoundExpressionsOrInitialValues(undefinedConstantVariables)) {
1526 for (
auto const& automaton : this->
getAutomata()) {
1527 if (!automaton.containsVariablesOnlyInProbabilitiesOrTransientAssignments(undefinedConstantVariables)) {
1533 if (initialStatesRestriction.containsVariable(undefinedConstantVariables)) {
1540 for (
auto& automaton : automata) {
1544 automaton.pushTransientRealLocationAssignmentsToEdges();
1546 automaton.pushEdgeAssignmentsToDestinations();
1551 for (
auto& automaton : automata) {
1552 automaton.pushEdgeAssignmentsToDestinations();
1558 automaton.liftTransientEdgeDestinationAssignments(maxLevel);
1563 for (
auto const& automaton : this->
getAutomata()) {
1564 if (automaton.hasTransientEdgeDestinationAssignments()) {
1572 for (
auto const& automaton : this->
getAutomata()) {
1573 if (automaton.usesAssignmentLevels(onlyTransient)) {
1586 for (
auto const& automaton : this->
getAutomata()) {
1587 result &= automaton.isLinear();
1594 if (composition->isParallelComposition()) {
1595 return composition->asParallelComposition().areActionsReused();
1601 return automatonIndex << 32 | edgeIndex;
1605 return std::make_pair(index >> 32, index & ((1ull << 32) - 1));
1609 Model result(*
this);
1612 for (uint64_t automatonIndex = 0; automatonIndex < result.automata.size(); ++automatonIndex) {
1615 for (
auto const& e : automataAndEdgeIndices) {
1617 if (automatonAndEdgeIndex.first == automatonIndex) {
1618 automatonEdgeIndices.insert(automatonAndEdgeIndex.second);
1622 result.automata[automatonIndex].restrictToEdges(automatonEdgeIndices);
1628Model Model::createModelFromAutomaton(
Automaton const& automaton)
const {
1630 Model newModel(*
this);
1633 newModel.automata = std::vector<Automaton>({automaton});
1636 newModel.setSystemComposition(newModel.getStandardSystemComposition());
1644 std::string result = text;
1645 std::replace_if(result.begin(), result.end(), [](
const char& c) { return std::ispunct(c); },
'_');
1650 outStream <<
"digraph " <<
filterName(name) <<
" {\n";
1652 std::vector<std::string> actionNames;
1653 for (
auto const& act : actions) {
1654 actionNames.push_back(act.getName());
1657 for (
auto const& automaton : automata) {
bool isTrue() const
Checks if the expression is equal to the boolean literal true.
bool isInitialized() const
Checks whether the object encapsulates a base-expression.
This class is responsible for managing a set of typed variables and all expressions using these varia...
Variable declareFreshBooleanVariable(bool auxiliary=false, std::string const &prefix="_x")
Declares a variable with Boolean type whose name is guaranteed to be unique and not yet in use.
Expression integer(int_fast64_t value) const
Creates an expression that characterizes the given integer literal.
Expression boolean(bool value) const
Creates an expression that characterizes the given boolean literal.
bool check(Expression const &expression, bool booleanIsLinear=false)
Checks that the given expression is linear.
Expression substitute(Expression const &expression)
Substitutes the identifiers in the given expression according to the previously given map and returns...
std::string const & getName() const
Returns the name of the location.
ArrayEliminatorData eliminate(Model &model, bool keepNonTrivialArrayAccess=false)
Eliminates all array references in the given model by replacing them with basic variables.
std::string const & getAutomatonName() const
Retrieves the name of the automaton this composition element refers to.
std::set< std::string > const & getInputEnabledActions() const
VariableSet & getVariables()
Retrieves the variables of this automaton.
Automaton clone(storm::expressions::ExpressionManager &manager, std::string const &nameOfClone, std::string const &variablePrefix) const
void addEdge(Edge const &edge)
Adds an edge to the automaton.
void registerTemplateEdge(std::shared_ptr< TemplateEdge > const &)
Adds the template edge to the list of edges.
storm::expressions::Expression getInitialStatesExpression() const
Retrieves the expression defining the legal initial values of the automaton's variables.
Location const & getLocation(uint64_t index) const
Retrieves the location with the given index.
void setInitialStatesRestriction(storm::expressions::Expression const &initialStatesRestriction)
Sets the expression restricting the legal initial values of the automaton's variables.
Variable const & addVariable(Variable const &variable)
Adds the given variable to this automaton.
FunctionDefinition const & addFunctionDefinition(FunctionDefinition const &functionDefinition)
Adds the given function definition.
void addInitialLocation(std::string const &name)
Adds the location with the given name to the initial locations.
uint64_t addLocation(Location const &location)
Adds the given location to the automaton.
void changeAssignmentVariables(std::map< Variable const *, std::reference_wrapper< Variable const > > const &remapping)
Changes all variables in assignments based on the given mapping.
void writeDotToStream(std::ostream &outStream, std::vector< std::string > const &actionNames) const
std::string const & getName() const
Retrieves the name of the automaton.
std::vector< Edge > & getEdges()
Retrieves the edges of the automaton.
virtual bool isAutomatonComposition() const
virtual bool isParallelComposition() const
AutomatonComposition const & asAutomatonComposition() const
virtual boost::any accept(CompositionVisitor &visitor, boost::any const &data) const =0
ParallelComposition const & asParallelComposition() const
std::shared_ptr< Composition > simplify(Composition const &oldComposition)
virtual boost::any visit(ParallelComposition const &composition, boost::any const &data) override
CompositionSimplificationVisitor(std::unordered_map< std::string, std::vector< std::string > > const &automatonToCopiesMap)
virtual boost::any visit(AutomatonComposition const &composition, boost::any const &) override
std::string const & getName() const
Retrieves the name of the constant.
std::string const & getName() const
Retrieves the name of the function.
static void toStream(storm::jani::Model const &janiModel, std::vector< storm::jani::Property > const &formulas, std::ostream &ostream, bool checkValid=false, bool compact=false)
void addTransientAssignment(storm::jani::Assignment const &assignment)
Adds the given transient assignment to this location.
bool hasFunctions() const
bool hasDerivedOperators() const
bool hasTrigonometricFunctions() const
bool hasStateExitRewards() const
void remove(ModelFeature const &modelFeature)
void setInitialStatesRestriction(storm::expressions::Expression const &initialStatesRestriction)
Sets the expression restricting the legal initial values of the global variables.
bool hasUndefinedConstants() const
Retrieves whether the model still has undefined constants.
storm::expressions::ExpressionManager & getManager() const
Retrieves the expression manager responsible for the expressions in the model.
std::set< std::string > getActionNames(bool includeSilent=true) const
Retrieves the set of action names.
std::size_t getNumberOfEdges() const
Retrieves the total number of edges in this model.
Model preprocess(std::map< storm::expressions::Variable, storm::expressions::Expression > const &constantDefinitions) const
Preprocesses the model by defining the given constant definitions and substituting constants.
Model & replaceUnassignedVariablesWithConstants()
Replaces each variable to which we never assign a value with a constant.
storm::storage::FlatSet< uint64_t > const & getNonsilentActionIndices() const
Retrieves all non-silent action indices of the model.
bool hasAction(std::string const &name) const
Checks whether the model has an action with the given name.
Variable const & getGlobalVariable(std::string const &name) const
Retrieves the global variable with the given name if one exists.
std::vector< storm::expressions::Expression > getAllRangeExpressions(std::vector< std::reference_wrapper< storm::jani::Automaton const > > const &automata={}) const
Retrieves a list of expressions that characterize the legal values of the variables in this model.
VariableSet & getGlobalVariables()
Retrieves the variables of this automaton.
Model()
Creates an uninitialized model.
storm::expressions::ExpressionManager & getExpressionManager() const
Retrieves the manager responsible for the expressions in the JANI model.
std::unordered_map< std::string, storm::expressions::Expression > const & getNonTrivialRewardExpressions() const
Retrieves all available non-trivial reward model names and expressions of the model.
bool hasInitialStatesRestriction() const
Retrieves whether there is an expression restricting the legal initial values of the global variables...
Model & substituteConstantsInPlace(bool const substituteTranscendentalNumbers)
Substitutes all constants in all expressions of the model.
bool addNonTrivialRewardExpression(std::string const &identifier, storm::expressions::Expression const &rewardExpression)
Adds a reward expression, i.e., a reward model that does not consist of a single, global,...
storm::expressions::Expression getRewardModelExpression(std::string const &identifier) const
Retrieves the defining reward expression of the reward model with the given identifier.
bool reusesActionsInComposition() const
Checks whether in the composition, actions are reused: That is, if the model is put in parallel compo...
void setSystemComposition(std::shared_ptr< Composition > const &composition)
Sets the system composition expression of the JANI model.
static uint64_t encodeAutomatonAndEdgeIndices(uint64_t automatonIndex, uint64_t edgeIndex)
Encode and decode a tuple of automaton and edge index in one 64-bit index.
Composition const & getSystemComposition() const
Retrieves the system composition expression.
bool hasTransientEdgeDestinationAssignments() const
Retrieves whether there is any transient edge destination assignment in the model.
storm::expressions::Expression const & getInitialStatesRestriction() const
Gets the expression restricting the legal initial values of the global variables.
void liftTransientEdgeDestinationAssignments(int64_t maxLevel=0)
Lifts the common edge destination assignments of transient variables to edge assignments.
void replaceAutomaton(uint64_t index, Automaton const &newAutomaton)
Replaces the automaton at index with a new automaton.
std::shared_ptr< Composition > getStandardSystemComposition() const
Gets the system composition as the standard, fully-synchronizing parallel composition.
InformationObject getModelInformation() const
Returns various information of this model.
std::set< storm::expressions::Variable > getAllExpressionVariables(bool includeLocationExpressionVariables=false) const
Retrieves all expression variables used by this model.
storm::expressions::Expression getInitialStatesExpression() const
Retrieves the expression defining the legal initial values of the variables.
bool hasStandardComposition() const
Retrieves whether this model has the standard composition, that is it composes all automata in parall...
static const uint64_t SILENT_ACTION_INDEX
The index of the silent action.
std::vector< Automaton > & getAutomata()
Retrieves the automata of the model.
ModelType const & getModelType() const
Retrieves the type of the model.
bool hasNonTrivialRewardExpression() const
Returns true iff there is a non-trivial reward model, i.e., a reward model that does not consist of a...
std::vector< Constant > const & getConstants() const
Retrieves the constants of the model.
std::vector< Action > const & getActions() const
Retrieves the actions of the model.
bool undefinedConstantsAreGraphPreserving() const
Checks that undefined constants (parameters) of the model preserve the graph of the underlying model.
void pushEdgeAssignmentsToDestinations()
Model substituteConstants() const
Substitutes all constants in all expressions of the model.
std::size_t getTotalNumberOfNonTransientVariables() const
Number of global and local variables.
storm::expressions::Expression getLabelExpression(Variable const &transientVariable, std::vector< std::reference_wrapper< Automaton const > > const &automata) const
Creates the expression that characterizes all states in which the provided transient boolean variable...
void addConstant(Constant const &constant)
Adds the given constant to the model.
void substitute(std::map< storm::expressions::Variable, storm::expressions::Expression > const &substitution, bool const substituteTranscendentalNumbers)
Substitutes all expression variables in all expressions of the model.
uint64_t getJaniVersion() const
Retrieves the JANI-version of the model.
void substituteFunctions()
Substitutes all function calls with the corresponding function definition.
void setStandardSystemComposition()
Sets the system composition to be the fully-synchronizing parallel composition of all automat.
Variable const & addVariable(Variable const &variable)
Adds the given variable to this model.
Action const & getAction(uint64_t index) const
Retrieves the action with the given index.
std::vector< std::pair< std::string, storm::expressions::Expression > > getAllRewardModelExpressions() const
Retrieves all available reward model names and expressions of the model.
void checkValid() const
Checks if the model is valid JANI, which should be verified before any further operations are applied...
std::string const & getName() const
Retrieves the name of the model.
bool hasConstant(std::string const &name) const
Retrieves whether the model has a constant with the given name.
void removeConstant(std::string const &name)
Removes (without checks) a constant from the model.
bool isNonTrivialRewardModelExpression(std::string const &identifier) const
Returns true iff the given identifier corresponds to a non-trivial reward expression i....
bool isDeterministicModel() const
Determines whether this model is a deterministic one in the sense that each state only has one choice...
bool hasNonGlobalTransientVariable() const
Retrieves whether this model has a non-global transient variable.
void simplifyComposition()
Attempts to simplify the composition.
Model flattenComposition(std::shared_ptr< storm::utility::solver::SmtSolverFactory > const &smtSolverFactory=std::make_shared< storm::utility::solver::SmtSolverFactory >()) const
Flatten the composition to obtain an equivalent model that contains exactly one automaton that has th...
void writeDotToStream(std::ostream &outStream=std::cout) const
FunctionDefinition const & addFunctionDefinition(FunctionDefinition const &functionDefinition)
Adds the given function definition.
Model defineUndefinedConstants(std::map< storm::expressions::Variable, storm::expressions::Expression > const &constantDefinitions) const
Defines the undefined constants of the model by the given expressions.
static const std::string SILENT_ACTION_NAME
The name of the silent action.
bool containsArrayVariables() const
Returns true if at least one array variable occurs in the model.
Constant const & getConstant(std::string const &name) const
Retrieves the constant with the given name (if any).
std::unordered_map< std::string, uint64_t > const & getActionToIndexMap() const
Retrieves the mapping from action names to their indices.
uint64_t addAction(Action const &action)
Adds an action to the model.
void makeStandardJaniCompliant()
std::size_t getNumberOfAutomata() const
Retrieves the number of automata in this model.
bool isDiscreteTimeModel() const
Determines whether this model is a discrete-time model.
bool hasGlobalVariable(std::string const &name) const
Retrieves whether this model has a global variable with the given name.
ModelFeatures const & getModelFeatures() const
Retrieves the enabled model features.
std::map< storm::expressions::Variable, storm::expressions::Expression > getConstantsSubstitution() const
Retrieves a mapping from expression variables associated with defined constants of the model to their...
bool hasAutomaton(std::string const &name) const
Rerieves whether there exists an automaton with the given name.
Model restrictEdges(storm::storage::FlatSet< uint_fast64_t > const &automataAndEdgeIndices) const
Creates a new model that only contains the selected edges.
uint64_t addAutomaton(Automaton const &automaton)
Adds the given automaton to the automata of this model.
Automaton & getAutomaton(std::string const &name)
Retrieves the automaton with the given name.
bool hasNonTrivialInitialStates() const
Retrieves whether there are non-trivial initial states in the model or any of the contained automata.
void setModelType(ModelType const &)
Changes (only) the type declaration of the model.
bool isLinear() const
Checks the model for linearity.
void setName(std::string const &newName)
Sets the name of the model.
std::map< uint64_t, std::string > getActionIndexToNameMap() const
Builds a map with action indices mapped to their names.
uint64_t getActionIndex(std::string const &name) const
Get the index of the action.
bool usesAssignmentLevels(bool onlyTransient=false) const
Retrieves whether the model uses an assignment level other than zero.
void finalize()
After adding all components to the model, this method has to be called.
std::set< storm::expressions::Variable > getAllLocationExpressionVariables() const
Retrieves all location expression variables used by this model.
bool hasStandardCompliantComposition() const
Checks whether the composition has no nesting.
uint64_t getAutomatonIndex(std::string const &name) const
Retrieves the index of the given automaton.
ModelFeatures restrictToFeatures(ModelFeatures const &modelFeatures)
Attempts to eliminate all features of this model that are not in the given set of features.
bool hasTrivialInitialStatesExpression() const
Retrieves whether the initial states expression is trivial in the sense that no automaton has an init...
Model & operator=(Model const &other)
Copy-assigns the given model.
std::unordered_map< std::string, FunctionDefinition > const & getGlobalFunctionDefinitions() const
Retrieves all global function definitions.
ArrayEliminatorData eliminateArrays(bool keepNonTrivialArrayAccess=false)
Eliminates occurring array variables and expressions by replacing array variables by multiple basic v...
Model substituteConstantsFunctionsTranscendentals() const
std::vector< std::reference_wrapper< Constant const > > getUndefinedConstants() const
Retrieves all undefined constants of the model.
static std::pair< uint64_t, uint64_t > decodeAutomatonAndEdgeIndices(uint64_t index)
std::vector< SynchronizationVector > const & getSynchronizationVectors() const
Retrieves the synchronization vectors of the parallel composition.
std::vector< std::shared_ptr< Composition > > const & getSubcompositions() const
Retrieves the subcompositions of the parallel composition.
static const std::string NO_ACTION_INPUT
std::vector< std::string > const & getInput() const
static bool isNoActionInput(std::string const &action)
std::string const & getOutput() const
void addAssignment(Assignment const &assignment, bool addToExisting=false)
storm::expressions::Variable const & getExpressionVariable() const
Retrieves the associated expression variable.
storm::expressions::Expression const & getInitExpression() const
Retrieves the initial expression Should only be called if an initial expression is set for this varia...
detail::Variables< Variable > getBoundedIntegerVariables()
Retrieves the bounded integer variables in this set.
bool hasVariable(std::string const &name) const
Retrieves whether this variable set contains a variable with the given name.
void substitute(std::map< storm::expressions::Variable, storm::expressions::Expression > const &substitution, bool const substituteTranscendentalNumbers)
Applies the given substitution to all variables in this set.
bool empty() const
Retrieves whether this variable set is empty.
The base class for all model references.
virtual bool getBooleanValue(storm::expressions::Variable const &variable) const =0
An interface that captures the functionality of an SMT solver.
#define STORM_LOG_WARN(message)
#define STORM_LOG_ERROR(message)
#define STORM_LOG_ASSERT(cond, message)
#define STORM_LOG_WARN_COND(cond, message)
#define STORM_LOG_THROW(cond, exception, message)
Expression iff(Expression const &first, Expression const &second)
void eliminateFunctions(Model &model, std::vector< Property > &properties)
Eliminates all function references in the given model and the given properties by replacing them with...
std::vector< ConditionalMetaEdge > createSynchronizingMetaEdges(Model const &oldModel, Model &newModel, Automaton &newAutomaton, std::vector< std::set< uint64_t > > &synchronizingActionIndices, SynchronizationVector const &vector, std::vector< std::reference_wrapper< Automaton const > > const &composedAutomata, storm::solver::SmtSolver &solver)
storm::expressions::Expression eliminateFunctionCallsInExpression(storm::expressions::Expression const &expression, Model const &model)
Eliminates all function calls in the given expression by replacing them with their corresponding defi...
storm::expressions::Expression createSynchronizedGuard(std::vector< std::reference_wrapper< Edge const > > const &chosenEdges)
InformationObject collectModelInformation(Model const &model)
storm::expressions::Expression substituteJaniExpression(storm::expressions::Expression const &expression, std::map< storm::expressions::Variable, storm::expressions::Expression > const &identifierToExpressionMap, bool const substituteTranscendentalNumbers)
@ MultiObjectiveProperties
void addEdgesToReachableLocations(std::vector< std::reference_wrapper< Automaton const > > const &composedAutomata, Automaton &newAutomaton, std::vector< ConditionalMetaEdge > const &conditionalMetaEdges)
std::ostream & operator<<(std::ostream &stream, Assignment const &assignment)
std::string filterName(std::string const &text)
ConditionalMetaEdge createSynchronizedMetaEdge(Automaton &automaton, std::vector< std::reference_wrapper< Edge const > > const &edgesToSynchronize)
void createCombinedLocation(std::vector< std::reference_wrapper< Automaton const > > const &composedAutomata, Automaton &newAutomaton, std::vector< uint64_t > const &locations, bool initial=false)
boost::container::flat_set< Key, std::less< Key >, boost::container::new_allocator< Key > > FlatSet
Redefinition of flat_set was needed, because from Boost 1.70 on the default allocator is set to void.
std::map< storm::expressions::Variable, storm::expressions::Expression > parseConstantDefinitionString(storm::expressions::ExpressionManager const &manager, std::string const &constantDefinitionString)
Parses a comma-separated string of constant definitions (e.g.
void forEach(std::vector< IteratorType > const &its, std::vector< IteratorType > const &ites, std::function< void(uint64_t, decltype(*std::declval< IteratorType >()))> const &setValueCallback, std::function< bool()> const &newCombinationCallback)