52 boost::optional<std::shared_ptr<storm::expressions::ExpressionManager>>
const& expressionManager)
53 : name(name), modelType(modelType), version(version), composition(nullptr) {
55 if (expressionManager) {
56 this->expressionManager = expressionManager.get();
58 this->expressionManager = std::make_shared<storm::expressions::ExpressionManager>();
62 initialStatesRestriction = this->expressionManager->boolean(
true);
75 this->name = other.name;
76 this->modelType = other.modelType;
77 this->modelFeatures = other.modelFeatures;
78 this->version = other.version;
79 this->expressionManager = other.expressionManager;
80 this->actions = other.actions;
81 this->actionToIndex = other.actionToIndex;
82 this->nonsilentActionIndices = other.nonsilentActionIndices;
83 this->constants = other.constants;
84 this->constantToIndex = other.constantToIndex;
85 this->globalVariables = other.globalVariables;
86 this->nonTrivialRewardModels = other.nonTrivialRewardModels;
87 this->automata = other.automata;
88 this->automatonToIndex = other.automatonToIndex;
89 this->composition = other.composition;
90 this->initialStatesRestriction = other.initialStatesRestriction;
91 this->globalFunctions = other.globalFunctions;
94 std::map<Variable const*, std::reference_wrapper<Variable const>> remapping;
98 auto otherAutomatonIt = other.automata.begin();
99 auto thisAutomatonIt = this->automata.begin();
101 for (; otherAutomatonIt != other.automata.end(); ++otherAutomatonIt, ++thisAutomatonIt) {
102 for (
auto const& variable : otherAutomatonIt->getVariables()) {
103 remapping.emplace(&variable, thisAutomatonIt->getVariables().getVariable(variable.getName()));
106 thisAutomatonIt->changeAssignmentVariables(remapping);
114 return *expressionManager;
126 modelType = newModelType;
130 return modelFeatures;
134 return modelFeatures;
153 boost::optional<storm::expressions::Expression>
rate;
161 auto it = chosenEdges.begin();
164 for (; it != chosenEdges.end(); ++it) {
165 result = result && it->get().getGuard();
176 for (
auto const& edge : edgesToSynchronize) {
177 result.
condition.push_back(edge.get().getSourceLocationIndex());
181 std::vector<std::vector<EdgeDestination>::const_iterator> destinationIterators;
182 for (uint_fast64_t i = 0; i < edgesToSynchronize.size(); ++i) {
183 destinationIterators.push_back(edgesToSynchronize[i].get().getDestinations().cbegin());
186 bool doneDestinations =
false;
189 result.
probabilities.emplace_back(destinationIterators[0]->getProbability());
190 for (uint_fast64_t i = 1; i < destinationIterators.size(); ++i) {
196 for (uint_fast64_t i = 0; i < destinationIterators.size(); ++i) {
197 for (
auto const& assignment : destinationIterators[i]->getOrderedAssignments().getAllAssignments()) {
203 result.
templateEdge->addDestination(templateDestination);
207 for (uint_fast64_t i = 0; i < destinationIterators.size(); ++i) {
208 result.
effects.back().push_back(destinationIterators[i]->getLocationIndex());
212 bool movedIterator =
false;
213 for (int_fast64_t j = destinationIterators.size() - 1; j >= 0; --j) {
214 ++destinationIterators[j];
215 if (destinationIterators[j] != edgesToSynchronize[j].get().getDestinations().cend()) {
216 movedIterator =
true;
220 destinationIterators[j] = edgesToSynchronize[j].get().getDestinations().cbegin();
224 doneDestinations = !movedIterator;
225 }
while (!doneDestinations);
232 std::vector<std::reference_wrapper<Automaton const>>
const& composedAutomata,
234 std::vector<ConditionalMetaEdge> result;
237 std::vector<uint64_t> components;
238 std::vector<std::pair<std::reference_wrapper<Automaton const>, uint64_t>> participatingAutomataAndActions;
239 for (uint64_t i = 0; i < composedAutomata.size(); ++i) {
240 std::string
const& actionName = vector.
getInput(i);
242 components.push_back(i);
245 participatingAutomataAndActions.push_back(std::make_pair(composedAutomata[i], actionIndex));
247 synchronizingActionIndices[i].insert(actionIndex);
261 bool noCombinations =
false;
264 std::vector<std::vector<std::reference_wrapper<storm::jani::Edge const>>> possibleEdges;
266 for (
auto const& automatonActionPair : participatingAutomataAndActions) {
267 possibleEdges.emplace_back();
268 for (
auto const& edge : automatonActionPair.first.get().getEdges()) {
269 if (edge.getActionIndex() == automatonActionPair.second) {
270 possibleEdges.back().push_back(edge);
275 if (possibleEdges.back().empty()) {
276 noCombinations =
true;
282 if (!noCombinations) {
288 std::vector<std::vector<storm::expressions::Variable>> edgeVariables(possibleEdges.size());
289 std::vector<storm::expressions::Variable> allEdgeVariables;
290 for (uint_fast64_t outerIndex = 0; outerIndex < possibleEdges.size(); ++outerIndex) {
292 for (uint_fast64_t innerIndex = 0; innerIndex < possibleEdges[outerIndex].size(); ++innerIndex) {
294 allEdgeVariables.push_back(edgeVariables[outerIndex].back());
296 solver.
add(implies(edgeVariables[outerIndex].back(), guard));
300 for (
auto const& edgeVariable : edgeVariables[outerIndex]) {
301 atLeastOneEdgeFromAutomaton = atLeastOneEdgeFromAutomaton || edgeVariable;
303 solver.
add(atLeastOneEdgeFromAutomaton);
306 for (uint64_t first = 0; first < possibleEdges[outerIndex].size(); ++first) {
307 for (uint64_t second = first + 1; second < possibleEdges[outerIndex].size(); ++second) {
308 atMostOneEdgeFromAutomaton = atMostOneEdgeFromAutomaton && !(edgeVariables[outerIndex][first] && edgeVariables[outerIndex][second]);
311 solver.
add(atMostOneEdgeFromAutomaton);
317 std::vector<std::reference_wrapper<Edge const>> chosenEdges;
319 for (uint_fast64_t outerIndex = 0; outerIndex < edgeVariables.size(); ++outerIndex) {
320 for (uint_fast64_t innerIndex = 0; innerIndex < edgeVariables[outerIndex].size(); ++innerIndex) {
321 if (modelReference.
getBooleanValue(edgeVariables[outerIndex][innerIndex])) {
322 chosenEdges.emplace_back(possibleEdges[outerIndex][innerIndex]);
336 conditionalMetaEdge.
actionIndex = resultingActionIndex;
338 result.push_back(conditionalMetaEdge);
350 std::vector<uint64_t>
const& locations,
bool initial =
false) {
351 std::stringstream locationNameBuilder;
352 for (uint64_t i = 0; i < locations.size(); ++i) {
353 locationNameBuilder << composedAutomata[i].get().getLocation(locations[i]).getName() <<
"_";
358 for (uint64_t i = 0; i < locations.size(); ++i) {
359 for (
auto const& assignment : composedAutomata[i].get().getLocation(locations[i]).getAssignments()) {
370 std::vector<ConditionalMetaEdge>
const& conditionalMetaEdges) {
372 std::vector<std::vector<uint64_t>> locationsToExplore;
375 std::vector<std::set<uint64_t>::const_iterator> initialLocationsIts;
376 std::vector<std::set<uint64_t>::const_iterator> initialLocationsItes;
377 for (
auto const& automaton : composedAutomata) {
378 initialLocationsIts.push_back(automaton.get().getInitialLocationIndices().cbegin());
379 initialLocationsItes.push_back(automaton.get().getInitialLocationIndices().cend());
381 std::vector<uint64_t> initialLocation(composedAutomata.size());
383 initialLocationsIts, initialLocationsItes, [&initialLocation](uint64_t index, uint64_t value) { initialLocation[index] = value; },
384 [&locationsToExplore, &initialLocation]() {
385 locationsToExplore.push_back(initialLocation);
393 for (
auto const& location : locationsToExplore) {
394 uint64_t
id = newLocationMapping.size();
395 newLocationMapping[location] = id;
400 while (!locationsToExplore.empty()) {
401 std::vector<uint64_t> currentLocations = std::move(locationsToExplore.back());
402 locationsToExplore.pop_back();
404 for (
auto const& metaEdge : conditionalMetaEdges) {
405 bool isApplicable =
true;
406 for (uint64_t i = 0; i < metaEdge.components.size(); ++i) {
407 if (currentLocations[metaEdge.components[i]] != metaEdge.condition[i]) {
408 isApplicable =
false;
414 std::vector<uint64_t> newLocations;
416 for (
auto const& effect : metaEdge.effects) {
417 std::vector<uint64_t> targetLocationCombination = currentLocations;
418 for (uint64_t i = 0; i < metaEdge.components.size(); ++i) {
419 targetLocationCombination[metaEdge.components[i]] = effect[i];
423 auto it = newLocationMapping.find(targetLocationCombination);
424 if (it != newLocationMapping.end()) {
425 newLocations.emplace_back(it->second);
427 uint64_t
id = newLocationMapping.size();
428 newLocationMapping[targetLocationCombination] = id;
429 locationsToExplore.emplace_back(std::move(targetLocationCombination));
430 newLocations.emplace_back(
id);
435 newAutomaton.
addEdge(
Edge(newLocationMapping.at(currentLocations), metaEdge.actionIndex, metaEdge.rate, metaEdge.templateEdge, newLocations,
436 metaEdge.probabilities));
451 "Flatting composition is only supported for standard-compliant compositions.");
453 "Unable to flatten modules for model of type '" << this->
getModelType() <<
"'.");
455 "Flattening JANI model with arrays is not supported. We'll try but there might be unexpected errors.");
457 for (
auto const& aut : automata) {
458 STORM_LOG_THROW(aut.getFunctionDefinitions().empty(), storm::exceptions::NotImplementedException,
459 "Flattening JANI model with local function declarations not implemented. Try to eliminate functions first or make them global.");
469 std::unique_ptr<storm::solver::SmtSolver> solver = smtSolverFactory->create(*expressionManager);
475 "Flatting does not support input-enabling actions.");
484 Automaton newAutomaton(this->
getName() +
"_flattened", expressionManager->declareIntegerVariable(
"_loc_flattened_" + this->getName()));
486 std::map<Variable const*, std::reference_wrapper<Variable const>> variableRemapping;
488 std::unique_ptr<Variable> renamedVariable = variable.clone();
489 variableRemapping.emplace(&variable, flattenedModel.
addVariable(*renamedVariable));
504 std::vector<std::reference_wrapper<Automaton const>> composedAutomata;
506 STORM_LOG_THROW(element->isAutomatonComposition(), storm::exceptions::WrongFormatException,
507 "Cannot flatten recursive (not standard-compliant) composition.");
510 "Flatting does not support input-enabling actions.");
512 composedAutomata.push_back(oldAutomaton);
515 for (
auto const& variable : oldAutomaton.
getVariables()) {
516 std::unique_ptr<Variable> renamedVariable = variable.clone();
517 renamedVariable->setName(oldAutomaton.
getName() +
"_" + renamedVariable->getName());
518 variableRemapping.emplace(&variable, newAutomaton.
addVariable(*renamedVariable));
525 if (constant.isDefined()) {
526 if (constant.isBooleanConstant()) {
529 solver->add(constant.getExpressionVariable() == constant.getExpression());
535 solver->add(variable.getRangeExpression());
539 std::vector<std::set<uint64_t>> synchronizingActionIndices(composedAutomata.size());
540 std::vector<ConditionalMetaEdge> conditionalMetaEdges;
543 if (vector.getNumberOfActionInputs() <= 1) {
548 std::vector<ConditionalMetaEdge> newConditionalMetaEdges =
550 conditionalMetaEdges.insert(conditionalMetaEdges.end(), newConditionalMetaEdges.begin(), newConditionalMetaEdges.end());
554 for (uint64_t i = 0; i < composedAutomata.size(); ++i) {
555 Automaton const& automaton = composedAutomata[i].get();
556 for (
auto const& edge : automaton.
getEdges()) {
557 if (synchronizingActionIndices[i].find(edge.getActionIndex()) == synchronizingActionIndices[i].end()) {
558 uint64_t actionIndex = edge.getActionIndex();
561 if (flattenedModel.
hasAction(actionName)) {
564 actionIndex = flattenedModel.
addAction(actionName);
568 conditionalMetaEdges.emplace_back();
571 conditionalMetaEdge.
templateEdge = std::make_shared<TemplateEdge>(edge.getGuard());
573 conditionalMetaEdge.
actionIndex = edge.getActionIndex();
574 conditionalMetaEdge.
components.emplace_back(
static_cast<uint64_t
>(i));
575 conditionalMetaEdge.
condition.emplace_back(edge.getSourceLocationIndex());
576 conditionalMetaEdge.
rate = edge.getOptionalRate();
577 for (
auto const& destination : edge.getDestinations()) {
578 conditionalMetaEdge.
templateEdge->addDestination(destination.getOrderedAssignments());
579 conditionalMetaEdge.
effects.emplace_back();
581 conditionalMetaEdge.
effects.back().emplace_back(destination.getLocationIndex());
582 conditionalMetaEdge.
probabilities.emplace_back(destination.getProbability());
597 for (
auto const& automaton : composedAutomata) {
598 if (automaton.get().hasInitialStatesRestriction()) {
599 initialStatesRestriction = initialStatesRestriction && automaton.get().getInitialStatesRestriction();
601 for (
auto const& funDef : automaton.get().getFunctionDefinitions()) {
614 return flattenedModel;
618 auto it = actionToIndex.find(action.
getName());
619 STORM_LOG_THROW(it == actionToIndex.end(), storm::exceptions::WrongFormatException,
"Action with name '" << action.
getName() <<
"' already exists");
620 actionToIndex.emplace(action.
getName(), actions.size());
621 actions.push_back(action);
623 nonsilentActionIndices.insert(actions.size() - 1);
625 return actions.size() - 1;
629 return actions[index];
633 return actionToIndex.find(name) != actionToIndex.end();
637 auto it = actionToIndex.find(name);
638 STORM_LOG_THROW(it != actionToIndex.end(), storm::exceptions::InvalidOperationException,
"Unable to retrieve index of unknown action '" << name <<
"'.");
643 return actionToIndex;
651 return nonsilentActionIndices;
655 auto it = constantToIndex.find(constant.
getName());
656 STORM_LOG_THROW(it == constantToIndex.end(), storm::exceptions::WrongFormatException,
657 "Cannot add constant with name '" << constant.
getName() <<
"', because a constant with that name already exists.");
658 constantToIndex.emplace(constant.
getName(), constants.size());
659 constants.push_back(constant);
664 return constantToIndex.find(name) != constantToIndex.end();
668 auto pos = constantToIndex.find(name);
669 if (pos != constantToIndex.end()) {
670 uint64_t index = pos->second;
671 constants.erase(constants.begin() + index);
672 constantToIndex.erase(pos);
673 for (
auto& entry : constantToIndex) {
674 if (entry.second > index) {
684 auto it = constantToIndex.find(name);
685 STORM_LOG_THROW(it != constantToIndex.end(), storm::exceptions::WrongFormatException,
"Unable to retrieve unknown constant '" << name <<
"'.");
686 return constants[it->second];
700 res += aut.getNumberOfEdges();
708 res += aut.getVariables().getNumberOfNontransientVariables();
722 return globalVariables;
726 return globalVariables;
730 std::set<storm::expressions::Variable> result;
732 for (
auto const& constant : constants) {
733 result.insert(constant.getExpressionVariable());
736 result.insert(variable.getExpressionVariable());
738 for (
auto const& automaton : automata) {
739 auto const& automatonVariables = automaton.getAllExpressionVariables();
740 result.insert(automatonVariables.begin(), automatonVariables.end());
741 if (includeLocationExpressionVariables) {
742 result.insert(automaton.getLocationExpressionVariable());
750 std::set<storm::expressions::Variable> result;
751 for (
auto const& automaton : automata) {
752 result.insert(automaton.getLocationExpressionVariable());
766 for (
auto const& automaton : automata) {
767 if (automaton.hasTransientVariable()) {
775 auto insertionRes = globalFunctions.emplace(functionDefinition.
getName(), functionDefinition);
776 STORM_LOG_THROW(insertionRes.second, storm::exceptions::InvalidOperationException,
777 " a function with the name " << functionDefinition.
getName() <<
" already exists in this model.");
778 return insertionRes.first->second;
782 return globalFunctions;
786 return globalFunctions;
790 return *expressionManager;
794 return !nonTrivialRewardModels.empty();
798 return nonTrivialRewardModels.count(identifier) > 0;
806 storm::exceptions::InvalidArgumentException,
807 "Non trivial reward expression with identifier '" << identifier <<
"' clashes with global transient variable of the same name.");
808 nonTrivialRewardModels.emplace(identifier, rewardExpression);
814 auto findRes = nonTrivialRewardModels.find(identifier);
815 if (findRes != nonTrivialRewardModels.end()) {
816 return findRes->second;
822 STORM_LOG_THROW(identifier.empty(), storm::exceptions::InvalidArgumentException,
"Cannot find unknown reward model '" << identifier <<
"'.");
824 storm::exceptions::InvalidArgumentException,
"Reference to standard reward model is ambiguous.");
825 if (nonTrivialRewardModels.size() == 1) {
826 return nonTrivialRewardModels.begin()->second;
829 auto const& type = variable.getType();
830 if ((type.isBasicType() && type.asBasicType().isNumericalType()) || (type.isBoundedType() && type.asBoundedType().isNumericalType())) {
831 return variable.getExpressionVariable().getExpression();
837 STORM_LOG_THROW(
false, storm::exceptions::InvalidArgumentException,
"Cannot find unknown reward model '" << identifier <<
"'.");
842 std::vector<std::pair<std::string, storm::expressions::Expression>> result;
843 for (
auto const& nonTrivExpr : nonTrivialRewardModels) {
844 result.emplace_back(nonTrivExpr.first, nonTrivExpr.second);
847 auto const& type = variable.getType();
848 if ((type.isBasicType() && type.asBasicType().isNumericalType()) || (type.isBoundedType() && type.asBoundedType().isNumericalType())) {
849 result.emplace_back(variable.getName(), variable.getExpressionVariable().getExpression());
856 return nonTrivialRewardModels;
860 return nonTrivialRewardModels;
864 auto it = automatonToIndex.find(automaton.
getName());
865 STORM_LOG_THROW(it == automatonToIndex.end(), storm::exceptions::WrongFormatException,
866 "Automaton with name '" << automaton.
getName() <<
"' already exists.");
867 automatonToIndex.emplace(automaton.
getName(), automata.size());
868 automata.push_back(automaton);
869 return automata.size() - 1;
881 return automatonToIndex.find(name) != automatonToIndex.end();
885 automata[index] = automaton;
889 auto it = automatonToIndex.find(name);
890 STORM_LOG_THROW(it != automatonToIndex.end(), storm::exceptions::InvalidOperationException,
"Unable to retrieve unknown automaton '" << name <<
"'.");
891 return automata[it->second];
895 return automata[index];
899 return automata[index];
903 auto it = automatonToIndex.find(name);
904 STORM_LOG_THROW(it != automatonToIndex.end(), storm::exceptions::InvalidOperationException,
"Unable to retrieve unknown automaton '" << name <<
"'.");
905 return automata[it->second];
909 auto it = automatonToIndex.find(name);
910 STORM_LOG_THROW(it != automatonToIndex.end(), storm::exceptions::InvalidOperationException,
"Unable to retrieve unknown automaton '" << name <<
"'.");
915 return automata.size();
920 std::set<uint64_t> allActionIndices;
921 std::vector<std::set<uint64_t>> automatonActionIndices;
922 std::vector<std::shared_ptr<Composition>> subcompositions;
923 for (
auto const& automaton : automata) {
924 automatonActionIndices.push_back(automaton.getActionIndices());
926 allActionIndices.insert(automatonActionIndices.back().begin(), automatonActionIndices.back().end());
927 subcompositions.push_back(std::make_shared<AutomatonComposition>(automaton.getName()));
932 std::vector<storm::jani::SynchronizationVector> synchVectors;
933 for (
auto actionIndex : allActionIndices) {
935 std::vector<std::string> synchVectorInputs;
936 for (
auto const& actionIndices : automatonActionIndices) {
937 if (actionIndices.find(actionIndex) != actionIndices.end()) {
938 synchVectorInputs.push_back(actionName);
946 return std::make_shared<ParallelComposition>(subcompositions, synchVectors);
956 : automatonToCopiesMap(automatonToCopiesMap) {}
959 return boost::any_cast<std::shared_ptr<Composition>>(oldComposition.
accept(*
this, boost::any()));
964 if (automatonToCopiesMap.count(name) != 0) {
965 auto& copies = automatonToCopiesMap[name];
966 STORM_LOG_ASSERT(!copies.empty(),
"Not enough copies of automaton " << name <<
".");
967 name = copies.back();
974 std::vector<std::shared_ptr<Composition>> subcomposition;
976 subcomposition.push_back(boost::any_cast<std::shared_ptr<Composition>>(p->accept(*
this, data)));
982 std::unordered_map<std::string, std::vector<std::string>> automatonToCopiesMap;
989 STORM_LOG_WARN(
"Unable to simplify non-standard compliant system composition.");
993 std::unordered_map<std::string, std::vector<std::string>> automatonToCopiesMap;
995 if (automatonMultiplicity.second > 1) {
996 std::vector<std::string> copies = {automatonMultiplicity.first};
998 for (uint64_t copyIndex = 1; copyIndex < automatonMultiplicity.second; ++copyIndex) {
999 std::string copyPrefix =
"Copy__" + std::to_string(copyIndex) +
"_Of";
1000 std::string copyAutName = copyPrefix + automatonMultiplicity.first;
1002 copies.push_back(copyAutName);
1005 std::reverse(copies.begin(), copies.end());
1007 automatonToCopiesMap[automatonMultiplicity.first] = std::move(copies);
1011 if (!automatonToCopiesMap.empty()) {
1019 this->composition = composition;
1027 std::set<std::string> result;
1028 for (
auto const& entry : actionToIndex) {
1030 result.insert(entry.first);
1037 std::map<uint64_t, std::string> mapping;
1039 for (
auto const& act : actions) {
1040 mapping[i] = act.getName();
1047 Model result(*
this);
1049 std::set<storm::expressions::Variable> definedUndefinedConstants;
1050 for (
auto& constant : result.constants) {
1053 if (constant.isDefined()) {
1055 STORM_LOG_THROW(constantDefinitions.find(constant.getExpressionVariable()) == constantDefinitions.end(),
1056 storm::exceptions::InvalidOperationException,
"Illegally defining already defined constant '" << constant.getName() <<
"'.");
1058 auto const& variableExpressionPair = constantDefinitions.find(constant.getExpressionVariable());
1060 if (variableExpressionPair != constantDefinitions.end()) {
1062 definedUndefinedConstants.insert(constant.getExpressionVariable());
1065 STORM_LOG_THROW(variableExpressionPair->second.getType() == constant.getType(), storm::exceptions::InvalidOperationException,
1066 "Illegal type of expression defining constant '" << constant.getName() <<
"'.");
1069 if (constant.hasConstraint()) {
1071 using SubMap = std::map<storm::expressions::Variable, storm::expressions::Expression>;
1073 constant.setConstraintExpression(transcendentalsVisitor.
substitute(constant.getConstraintExpression()));
1075 constant.define(variableExpressionPair->second);
1084 for (
auto const& constant : constants) {
1085 if (!constant.isDefined()) {
1093 std::vector<std::reference_wrapper<Constant const>> result;
1095 for (
auto const& constant : constants) {
1096 if (!constant.isDefined()) {
1097 result.push_back(constant);
1111 std::map<storm::expressions::Variable, storm::expressions::Expression> constantSubstitution;
1113 if (constant.hasConstraint()) {
1114 constant.setConstraintExpression(
1115 substituteJaniExpression(constant.getConstraintExpression(), constantSubstitution, substituteTranscendentalNumbers));
1117 if (constant.isDefined()) {
1118 constant.define(
substituteJaniExpression(constant.getExpression(), constantSubstitution, substituteTranscendentalNumbers));
1119 constantSubstitution[constant.getExpressionVariable()] = constant.getExpression();
1124 functionDefinition.second.
substitute(constantSubstitution, substituteTranscendentalNumbers);
1139 automaton.substitute(constantSubstitution, substituteTranscendentalNumbers);
1145 Model result(*
this);
1152 Model result(*
this);
1160 std::map<storm::expressions::Variable, storm::expressions::Expression> result;
1162 for (
auto const& constant : constants) {
1163 if (constant.isDefined()) {
1164 result.emplace(constant.getExpressionVariable(), constant.getExpression());
1171void Model::substitute(std::map<storm::expressions::Variable, storm::expressions::Expression>
const& substitution,
bool const substituteTranscendentalNumbers) {
1174 if (constant.hasConstraint()) {
1175 constant.setConstraintExpression(
substituteJaniExpression(constant.getConstraintExpression(), substitution, substituteTranscendentalNumbers));
1177 if (constant.isDefined()) {
1178 constant.define(
substituteJaniExpression(constant.getExpression(), substitution, substituteTranscendentalNumbers));
1183 functionDefinition.second.
substitute(substitution, substituteTranscendentalNumbers);
1188 variable.substitute(substitution, substituteTranscendentalNumbers);
1191 variable.substitute(substitution, substituteTranscendentalNumbers);
1194 variable.substitute(substitution, substituteTranscendentalNumbers);
1206 automaton.substitute(substitution, substituteTranscendentalNumbers);
1211 std::vector<Property> emptyPropertyVector;
1224 if (a.getVariables().containsArrayVariables()) {
1233 return arrayEliminator.
eliminate(*
this, keepNonTrivialArrayAccess);
1238 for (
auto& p : properties) {
1239 data.transformProperty(p);
1244 std::vector<Property> emptyPropertyVector;
1277 return uncheckedFeatures;
1281 this->initialStatesRestriction = initialStatesRestriction;
1289 return initialStatesRestriction;
1297 if (variable.hasInitExpression() && !variable.isTransient()) {
1302 for (
auto const& automaton : this->automata) {
1303 if (automaton.hasNonTrivialInitialStates()) {
1313 std::vector<std::reference_wrapper<storm::jani::Automaton const>> allAutomata;
1314 for (
auto const& automaton : this->
getAutomata()) {
1315 allAutomata.push_back(automaton);
1326 for (
auto const& automaton : this->
getAutomata()) {
1327 result &= automaton.hasTrivialInitialStatesExpression();
1340 for (
auto const& variable : globalVariables) {
1341 if (variable.isTransient()) {
1345 if (variable.hasInitExpression()) {
1347 if (variable.getType().isBasicType() && variable.getType().asBasicType().isBooleanType()) {
1350 newInitExpression = variable.getExpressionVariable() == variable.getInitExpression();
1352 result = result && newInitExpression;
1357 for (
auto const& automatonReference : automata) {
1361 if (automatonInitialStatesExpression.
isInitialized() && !automatonInitialStatesExpression.
isTrue()) {
1362 result = result && automatonInitialStatesExpression;
1378 std::vector<std::reference_wrapper<storm::jani::Automaton const>>
const& automata)
const {
1379 std::vector<storm::expressions::Expression> result;
1381 result.push_back(variable.getRangeExpression());
1385 if (automata.empty()) {
1386 for (
auto const& automaton : this->
getAutomata()) {
1387 std::vector<storm::expressions::Expression> automatonRangeExpressions = automaton.getAllRangeExpressions();
1388 result.insert(result.end(), automatonRangeExpressions.begin(), automatonRangeExpressions.end());
1391 for (
auto const& automaton : automata) {
1392 std::vector<storm::expressions::Expression> automatonRangeExpressions = automaton.get().getAllRangeExpressions();
1393 result.insert(result.end(), automatonRangeExpressions.begin(), automatonRangeExpressions.end());
1401 automaton.finalize(*
this);
1413 std::vector<std::reference_wrapper<Automaton const>> allAutomata;
1414 for (
auto const& automaton : automata) {
1415 allAutomata.emplace_back(automaton);
1421 std::vector<std::reference_wrapper<Automaton const>>
const& automata)
const {
1422 STORM_LOG_THROW(transientVariable.
isTransient(), storm::exceptions::InvalidArgumentException,
"Expected transient variable.");
1423 auto const& type = transientVariable.
getType();
1424 STORM_LOG_THROW(type.isBasicType() && type.asBasicType().isBooleanType(), storm::exceptions::InvalidArgumentException,
"Expected boolean variable.");
1429 for (
auto const& automaton : automata) {
1432 for (
auto const& location : automaton.get().getLocations()) {
1433 for (
auto const& assignment : location.getAssignments().getTransientAssignments()) {
1436 if (automaton.get().getNumberOfLocations() <= 1) {
1437 newExpression = (negate ? !assignment.getAssignedExpression() : assignment.getAssignedExpression());
1439 newExpression = (locationVariable == this->
getManager().
integer(automaton.get().getLocationIndex(location.getName()))) &&
1440 (negate ? !assignment.getAssignedExpression() : assignment.getAssignedExpression());
1443 result = result || newExpression;
1445 result = newExpression;
1470 if (multiplicity.second > 1) {
1492 std::set<storm::expressions::Variable> undefinedConstantVariables;
1494 if (!constant.isDefined()) {
1495 undefinedConstantVariables.insert(constant.getExpressionVariable());
1502 if (constant.isDefined()) {
1503 if (constant.getExpression().containsVariable(undefinedConstantVariables)) {
1504 undefinedConstantVariables.insert(constant.getExpressionVariable());
1515 for (
auto const& automaton : this->
getAutomata()) {
1516 if (!automaton.containsVariablesOnlyInProbabilitiesOrTransientAssignments(undefinedConstantVariables)) {
1522 if (initialStatesRestriction.
containsVariable(undefinedConstantVariables)) {
1529 for (
auto& automaton : automata) {
1533 automaton.pushTransientRealLocationAssignmentsToEdges();
1535 automaton.pushEdgeAssignmentsToDestinations();
1540 for (
auto& automaton : automata) {
1541 automaton.pushEdgeAssignmentsToDestinations();
1547 automaton.liftTransientEdgeDestinationAssignments(maxLevel);
1552 for (
auto const& automaton : this->
getAutomata()) {
1553 if (automaton.hasTransientEdgeDestinationAssignments()) {
1561 for (
auto const& automaton : this->
getAutomata()) {
1562 if (automaton.usesAssignmentLevels(onlyTransient)) {
1575 for (
auto const& automaton : this->
getAutomata()) {
1576 result &= automaton.isLinear();
1583 if (composition->isParallelComposition()) {
1584 return composition->asParallelComposition().areActionsReused();
1590 return automatonIndex << 32 | edgeIndex;
1594 return std::make_pair(index >> 32, index & ((1ull << 32) - 1));
1598 Model result(*
this);
1601 for (uint64_t automatonIndex = 0; automatonIndex < result.automata.size(); ++automatonIndex) {
1604 for (
auto const& e : automataAndEdgeIndices) {
1606 if (automatonAndEdgeIndex.first == automatonIndex) {
1607 automatonEdgeIndices.insert(automatonAndEdgeIndex.second);
1611 result.automata[automatonIndex].restrictToEdges(automatonEdgeIndices);
1617Model Model::createModelFromAutomaton(
Automaton const& automaton)
const {
1619 Model newModel(*
this);
1622 newModel.automata = std::vector<Automaton>({automaton});
1625 newModel.setSystemComposition(newModel.getStandardSystemComposition());
1633 std::string result = text;
1634 std::replace_if(result.begin(), result.end(), [](
const char& c) { return std::ispunct(c); },
'_');
1639 outStream <<
"digraph " <<
filterName(name) <<
" {\n";
1641 std::vector<std::string> actionNames;
1642 for (
auto const& act : actions) {
1643 actionNames.push_back(act.getName());
1646 for (
auto const& automaton : automata) {
bool isTrue() const
Checks if the expression is equal to the boolean literal true.
bool containsVariable(std::set< storm::expressions::Variable > const &variables) const
Retrieves whether the expression contains any of the given variables.
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...
storm::expressions::Expression getExpression() const
Retrieves an expression that represents the variable.
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 & 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.
Variable const & addVariable(Variable const &variable)
Adds the given variable to this set.
bool hasVariable(std::string const &name) const
Retrieves whether this variable set contains a variable with the given name.
uint64_t getNumberOfNumericalTransientVariables() const
Retrieves the number of numerical (i.e.
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.
Variable const & getVariable(std::string const &name) const
Retrieves the variable with the given name.
uint64_t getNumberOfNontransientVariables() const
bool empty() const
Retrieves whether this variable set is empty.
detail::Variables< Variable > getClockVariables()
Retrieves the clock variables in this set.
bool containsVariablesInBoundExpressionsOrInitialValues(std::set< storm::expressions::Variable > const &variables) const
Checks whether any of the provided variables appears in bound expressions or initial values of the va...
detail::Variables< Variable > getArrayVariables()
Retrieves the Array variables in this set.
detail::ConstVariables< Variable > getTransientVariables() const
Retrieves the transient variables in this variable set.
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.
virtual void pop()=0
Pops a backtracking point from the solver's stack.
virtual void add(storm::expressions::Expression const &assertion)=0
Adds an assertion to the solver's stack.
virtual std::vector< storm::expressions::SimpleValuation > allSat(std::vector< storm::expressions::Variable > const &important)
Performs AllSat over the (provided) important atoms.
virtual void push()=0
Pushes a backtracking point on the solver's stack.
#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)
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.
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)