10#include <boost/algorithm/string.hpp>
18storm::converter::JaniConversionOptions
const defaultOptions;
23const std::string JaniExportSettings::edgeAssignmentsOptionName =
"edge-assignments";
24const std::string JaniExportSettings::exportFlattenOptionName =
"flatten";
25const std::string JaniExportSettings::locationVariablesOptionName =
"location-variables";
26const std::string JaniExportSettings::globalVariablesOptionName =
"globalvars";
27const std::string JaniExportSettings::localVariablesOptionName =
"localvars";
28const std::string JaniExportSettings::compactJsonOptionName =
"compactjson";
29const std::string JaniExportSettings::eliminateArraysOptionName =
"remove-arrays";
30const std::string JaniExportSettings::eliminateFunctionsOptionName =
"remove-functions";
31const std::string JaniExportSettings::replaceUnassignedVariablesWithConstantsOptionName =
"replace-unassigned-vars";
32const std::string JaniExportSettings::simplifyCompositionOptionName =
"simplify-composition";
33const std::string JaniExportSettings::performLocationElimination =
"location-elimination";
38 "variables",
"A comma separated list of automaton and local variable names seperated by a dot, e.g. A.x,B.y.")
39 .setDefaultValueString(
"")
45 "If set, the output model can have transient edge assignments. This can simplify the jani model but is not compliant to the jani standard.")
48 "Flattens the composition of Automata to obtain an equivalent model that contains exactly one automaton")
52 "If set, variables will preferably be made global, e.g., to guarantee the same variable order as in the input file.")
56 "If set, the size of the resulting jani file will be reduced at the cost of (human-)readability.")
59 "If set, transforms the model such that array variables/expressions are eliminated.")
66 moduleName, replaceUnassignedVariablesWithConstantsOptionName,
false,
67 "If set, local and global variables that are (a) not assigned to some value and (b) have a known initial value are replaced by constants.")
72 "If set, location elimination will be performed before the model is built.")
75 "location-heuristic",
"If this number of locations is reached, no further unfolding will be performed")
76 .setDefaultValueUnsignedInteger(defaultOptions.locationEliminationLocationHeuristic)
80 "edges-heuristic",
"Determines how many new edges may be created by a single elimination")
81 .setDefaultValueUnsignedInteger(defaultOptions.locationEliminationEdgeHeuristic)
100 std::vector<std::pair<std::string, std::string>> result;
103 std::vector<std::string> arguments;
104 boost::split(arguments, argument, boost::is_any_of(
","));
105 for (
auto const& pair : arguments) {
106 std::vector<std::string> keyvaluepair;
107 boost::split(keyvaluepair, pair, boost::is_any_of(
"."));
108 STORM_LOG_THROW(keyvaluepair.size() == 2, storm::exceptions::IllegalArgumentException,
109 "Expected a name of the form AUTOMATON.VARIABLE (with no further dots) but got " << pair <<
".");
110 result.emplace_back(keyvaluepair.at(0), keyvaluepair.at(1));
virtual std::string getValueAsString() const =0
Retrieves the value of this argument as a string.
virtual uint_fast64_t getValueAsUnsignedInteger() const =0
Retrieves the value of this argument as an unsigned integer.
static ArgumentBuilder createUnsignedIntegerArgument(std::string const &name, std::string const &description)
Creates an unsigned integer argument with the given parameters.
static ArgumentBuilder createStringArgument(std::string const &name, std::string const &description)
Creates a string argument with the given parameters.
This class provides the interface to create an option...
OptionBuilder & addArgument(std::shared_ptr< ArgumentBase > argument)
Adds the given argument to the arguments of this option.
std::shared_ptr< Option > build()
Builds an option from the data that was added to this builder.
ArgumentBase const & getArgumentByName(std::string const &argumentName) const
Returns a reference to the argument with the specified long name.
bool getHasOptionBeenSet() const
Retrieves whether the option has been set.
bool isReplaceUnassignedVariablesWithConstantsSet() const
void finalize() override
Prepares the modules for further usage, should be called at the end of the initialization,...
bool isCompactJsonSet() const
uint64_t getLocationEliminationEdgesHeuristic() const
static const std::string moduleName
bool isSimplifyCompositionSet() const
bool isEliminateArraysSet() const
uint64_t getLocationEliminationLocationHeuristic() const
bool isAllowEdgeAssignmentsSet() const
std::vector< std::pair< std::string, std::string > > getLocationVariables() const
bool isExportFlattenedSet() const
bool isLocationEliminationSet() const
bool isLocalVarsSet() const
bool isEliminateFunctionsSet() const
bool isGlobalVarsSet() const
JaniExportSettings()
Creates a new JaniExport setting.
bool isLocationVariablesSet() const
bool check() const override
Checks whether the settings are consistent.
ModuleSettings(std::string const &moduleName)
Constructs a new settings object.
void addOption(std::shared_ptr< Option > const &option)
Adds and registers the given option.
Option & getOption(std::string const &longName)
Retrieves the option with the given long name.
#define STORM_LOG_THROW(cond, exception, message)