#include "src/logic/LabelSubstitutionVisitor.h" #include "src/logic/Formulas.h" namespace storm { namespace logic { LabelSubstitutionVisitor::LabelSubstitutionVisitor(std::map const& labelToExpressionMapping) : labelToExpressionMapping(labelToExpressionMapping) { // Intentionally left empty. } std::shared_ptr LabelSubstitutionVisitor::substitute(Formula const& f) const { boost::any result = f.accept(*this, boost::any()); return boost::any_cast>(result); } boost::any LabelSubstitutionVisitor::visit(AtomicLabelFormula const& f, boost::any const& data) const { auto it = labelToExpressionMapping.find(f.getLabel()); if (it != labelToExpressionMapping.end()) { return std::static_pointer_cast(std::make_shared(it->second)); } else { return std::static_pointer_cast(std::make_shared(f)); } } } }