|
|
@ -215,20 +215,20 @@ namespace storm { |
|
|
|
return static_cast<bool>(manager); |
|
|
|
} |
|
|
|
|
|
|
|
std::pair<boost::optional<storm::logic::TimeBound>, boost::optional<storm::logic::TimeBound>> FormulaParserGrammar::createTimeBoundFromInterval(storm::expressions::Expression const& lowerBound, storm::expressions::Expression const& upperBound, boost::optional<std::string> const& rewardName) const { |
|
|
|
std::tuple<boost::optional<storm::logic::TimeBound>, boost::optional<storm::logic::TimeBound>, boost::optional<std::string>> FormulaParserGrammar::createTimeBoundFromInterval(storm::expressions::Expression const& lowerBound, storm::expressions::Expression const& upperBound, boost::optional<std::string> const& rewardName) const { |
|
|
|
// As soon as it somehow does not break everything anymore, I will change return types here.
|
|
|
|
|
|
|
|
storm::logic::TimeBound lower(false, lowerBound); |
|
|
|
storm::logic::TimeBound upper(false, upperBound); |
|
|
|
return std::make_pair(lower, upper); |
|
|
|
return std::make_tuple(lower, upper, rewardName); |
|
|
|
} |
|
|
|
|
|
|
|
std::pair<boost::optional<storm::logic::TimeBound>, boost::optional<storm::logic::TimeBound>> FormulaParserGrammar::createTimeBoundFromSingleBound(storm::expressions::Expression const& bound, bool upperBound, bool strict, boost::optional<std::string> const& rewardName) const { |
|
|
|
std::tuple<boost::optional<storm::logic::TimeBound>, boost::optional<storm::logic::TimeBound>, boost::optional<std::string>> FormulaParserGrammar::createTimeBoundFromSingleBound(storm::expressions::Expression const& bound, bool upperBound, bool strict, boost::optional<std::string> const& rewardName) const { |
|
|
|
// As soon as it somehow does not break everything anymore, I will change return types here.
|
|
|
|
if (upperBound) { |
|
|
|
return std::make_pair(boost::none, storm::logic::TimeBound(strict, bound)); |
|
|
|
return std::make_tuple(boost::none, storm::logic::TimeBound(strict, bound), rewardName); |
|
|
|
} else { |
|
|
|
return std::make_pair(storm::logic::TimeBound(strict, bound), boost::none); |
|
|
|
return std::make_tuple(storm::logic::TimeBound(strict, bound), boost::none, rewardName); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -261,9 +261,13 @@ namespace storm { |
|
|
|
return std::shared_ptr<storm::logic::Formula const>(new storm::logic::AtomicLabelFormula(label)); |
|
|
|
} |
|
|
|
|
|
|
|
std::shared_ptr<storm::logic::Formula const> FormulaParserGrammar::createEventuallyFormula(boost::optional<std::pair<boost::optional<storm::logic::TimeBound>, boost::optional<storm::logic::TimeBound>>> const& timeBound, storm::logic::FormulaContext context, std::shared_ptr<storm::logic::Formula const> const& subformula) const { |
|
|
|
std::shared_ptr<storm::logic::Formula const> FormulaParserGrammar::createEventuallyFormula(boost::optional<std::tuple<boost::optional<storm::logic::TimeBound>, boost::optional<storm::logic::TimeBound>, boost::optional<std::string>>> const& timeBound, storm::logic::FormulaContext context, std::shared_ptr<storm::logic::Formula const> const& subformula) const { |
|
|
|
if (timeBound) { |
|
|
|
return std::shared_ptr<storm::logic::Formula const>(new storm::logic::BoundedUntilFormula(createBooleanLiteralFormula(true), subformula, timeBound.get().first, timeBound.get().second, storm::logic::TimeBoundReference(storm::logic::TimeBoundType::Time))); |
|
|
|
if (std::get<2>(timeBound.get())) { |
|
|
|
return std::shared_ptr<storm::logic::Formula const>(new storm::logic::BoundedUntilFormula(createBooleanLiteralFormula(true), subformula, std::get<0>(timeBound.get()), std::get<1>(timeBound.get()), storm::logic::TimeBoundReference(std::get<2>(timeBound.get()).get()))); |
|
|
|
} else { |
|
|
|
return std::shared_ptr<storm::logic::Formula const>(new storm::logic::BoundedUntilFormula(createBooleanLiteralFormula(true), subformula, std::get<0>(timeBound.get()), std::get<1>(timeBound.get()), storm::logic::TimeBoundReference(storm::logic::TimeBoundType::Time))); |
|
|
|
} |
|
|
|
} else { |
|
|
|
return std::shared_ptr<storm::logic::Formula const>(new storm::logic::EventuallyFormula(subformula, context)); |
|
|
|
} |
|
|
@ -277,9 +281,14 @@ namespace storm { |
|
|
|
return std::shared_ptr<storm::logic::Formula const>(new storm::logic::NextFormula(subformula)); |
|
|
|
} |
|
|
|
|
|
|
|
std::shared_ptr<storm::logic::Formula const> FormulaParserGrammar::createUntilFormula(std::shared_ptr<storm::logic::Formula const> const& leftSubformula, boost::optional<std::pair<boost::optional<storm::logic::TimeBound>, boost::optional<storm::logic::TimeBound>>> const& timeBound, std::shared_ptr<storm::logic::Formula const> const& rightSubformula) { |
|
|
|
std::shared_ptr<storm::logic::Formula const> FormulaParserGrammar::createUntilFormula(std::shared_ptr<storm::logic::Formula const> const& leftSubformula, boost::optional<std::tuple<boost::optional<storm::logic::TimeBound>, boost::optional<storm::logic::TimeBound>, boost::optional<std::string>>> const& timeBound, std::shared_ptr<storm::logic::Formula const> const& rightSubformula) { |
|
|
|
if (timeBound) { |
|
|
|
return std::shared_ptr<storm::logic::Formula const>(new storm::logic::BoundedUntilFormula(leftSubformula, rightSubformula, timeBound.get().first, timeBound.get().second, storm::logic::TimeBoundReference(storm::logic::TimeBoundType::Time))); |
|
|
|
if (std::get<2>(timeBound.get())) { |
|
|
|
return std::shared_ptr<storm::logic::Formula const>(new storm::logic::BoundedUntilFormula(leftSubformula, rightSubformula, std::get<0>(timeBound.get()), std::get<1>(timeBound.get()), storm::logic::TimeBoundReference(std::get<2>(timeBound.get()).get()))); |
|
|
|
} else { |
|
|
|
return std::shared_ptr<storm::logic::Formula const>(new storm::logic::BoundedUntilFormula(leftSubformula, rightSubformula, std::get<0>(timeBound.get()), std::get<1>(timeBound.get()), storm::logic::TimeBoundReference(storm::logic::TimeBoundType::Time))); |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
return std::shared_ptr<storm::logic::Formula const>(new storm::logic::UntilFormula(leftSubformula, rightSubformula)); |
|
|
|
} |
|
|
|