Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add warning in API concerning properties containing model variables #557

Merged
merged 2 commits into from
Jun 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/storm-parsers/api/properties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#include "storm/storage/jani/Property.h"
#include "storm/storage/prism/Program.h"

#include "storm/exceptions/WrongFormatException.h"

#include "storm/logic/Formula.h"

#include "storm/utility/cli.h"
Expand Down Expand Up @@ -43,7 +45,14 @@ std::vector<storm::jani::Property> parseProperties(storm::parser::FormulaParser&
std::vector<storm::jani::Property> parseProperties(std::string const& inputString, boost::optional<std::set<std::string>> const& propertyFilter) {
auto exprManager = std::make_shared<storm::expressions::ExpressionManager>();
storm::parser::FormulaParser formulaParser(exprManager);
return parseProperties(formulaParser, inputString, propertyFilter);
try {
return parseProperties(formulaParser, inputString, propertyFilter);
} catch (storm::exceptions::WrongFormatException const& e) {
STORM_LOG_THROW(false, storm::exceptions::WrongFormatException,
e.what() << "Note that the used API function does not have access to model variables. If the property you tried to parse contains "
"model variables, it will not "
"be parsed correctly.");
}
}

std::vector<storm::jani::Property> parsePropertiesForJaniModel(std::string const& inputString, storm::jani::Model const& model,
Expand Down
Loading