40 changed files with 495 additions and 351 deletions
-
31src/storm/cli/cli.cpp
-
4src/storm/counterexamples/SMTMinimalCommandSetGenerator.h
-
31src/storm/logic/BoundedUntilFormula.cpp
-
30src/storm/logic/BoundedUntilFormula.h
-
66src/storm/logic/CumulativeRewardFormula.cpp
-
26src/storm/logic/CumulativeRewardFormula.h
-
62src/storm/logic/InstantaneousRewardFormula.cpp
-
31src/storm/logic/InstantaneousRewardFormula.h
-
19src/storm/logic/TimeBound.cpp
-
21src/storm/logic/TimeBound.h
-
12src/storm/logic/TimeBoundType.h
-
24src/storm/logic/VariableSubstitutionVisitor.cpp
-
3src/storm/logic/VariableSubstitutionVisitor.h
-
8src/storm/modelchecker/csl/HybridCtmcCslModelChecker.cpp
-
6src/storm/modelchecker/csl/SparseCtmcCslModelChecker.cpp
-
6src/storm/modelchecker/multiobjective/pcaa/SparsePcaaPreprocessor.cpp
-
8src/storm/modelchecker/prctl/HybridDtmcPrctlModelChecker.cpp
-
8src/storm/modelchecker/prctl/HybridMdpPrctlModelChecker.cpp
-
8src/storm/modelchecker/prctl/SparseDtmcPrctlModelChecker.cpp
-
28src/storm/modelchecker/prctl/SparseMdpPrctlModelChecker.cpp
-
8src/storm/modelchecker/prctl/SymbolicDtmcPrctlModelChecker.cpp
-
8src/storm/modelchecker/prctl/SymbolicMdpPrctlModelChecker.cpp
-
8src/storm/parser/FormulaParser.cpp
-
1src/storm/parser/FormulaParser.h
-
80src/storm/parser/FormulaParserGrammar.cpp
-
28src/storm/parser/FormulaParserGrammar.h
-
12src/storm/parser/JaniParser.cpp
-
36src/storm/storage/SymbolicModelDescription.cpp
-
5src/storm/storage/SymbolicModelDescription.h
-
5src/storm/storage/jani/Model.cpp
-
6src/storm/storage/prism/Program.cpp
-
65src/storm/utility/cli.cpp
-
16src/storm/utility/cli.h
-
55src/storm/utility/jani.cpp
-
7src/storm/utility/jani.h
-
60src/storm/utility/prism.cpp
-
2src/storm/utility/prism.h
-
5src/storm/utility/storm.cpp
-
1src/storm/utility/storm.h
-
6src/test/modelchecker/NativeHybridDtmcPrctlModelCheckerTest.cpp
@ -0,0 +1,19 @@ |
|||
#include "storm/logic/TimeBound.h"
|
|||
|
|||
namespace storm { |
|||
namespace logic { |
|||
|
|||
TimeBound::TimeBound(bool strict, storm::expressions::Expression const& bound) : strict(strict), bound(bound) { |
|||
// Intentionally left empty.
|
|||
} |
|||
|
|||
storm::expressions::Expression const& TimeBound::getBound() const { |
|||
return bound; |
|||
} |
|||
|
|||
bool TimeBound::isStrict() const { |
|||
return strict; |
|||
} |
|||
|
|||
} |
|||
} |
@ -0,0 +1,21 @@ |
|||
#pragma once |
|||
|
|||
#include "storm/storage/expressions/Expression.h" |
|||
|
|||
namespace storm { |
|||
namespace logic { |
|||
|
|||
class TimeBound { |
|||
public: |
|||
TimeBound(bool strict, storm::expressions::Expression const& bound); |
|||
|
|||
storm::expressions::Expression const& getBound() const; |
|||
bool isStrict() const; |
|||
|
|||
private: |
|||
bool strict; |
|||
storm::expressions::Expression bound; |
|||
}; |
|||
|
|||
} |
|||
} |
@ -0,0 +1,12 @@ |
|||
#pragma once |
|||
|
|||
namespace storm { |
|||
namespace logic { |
|||
|
|||
enum class TimeBoundType { |
|||
Steps, |
|||
Time |
|||
}; |
|||
|
|||
} |
|||
} |
@ -0,0 +1,65 @@ |
|||
#include "storm/utility/cli.h"
|
|||
|
|||
#include "storm/utility/macros.h"
|
|||
#include "storm/exceptions/WrongFormatException.h"
|
|||
|
|||
namespace storm { |
|||
namespace utility { |
|||
namespace cli { |
|||
|
|||
std::map<storm::expressions::Variable, storm::expressions::Expression> parseConstantDefinitionString(storm::expressions::ExpressionManager const& manager, std::string const& constantDefinitionString) { |
|||
std::map<storm::expressions::Variable, storm::expressions::Expression> constantDefinitions; |
|||
std::set<storm::expressions::Variable> definedConstants; |
|||
|
|||
if (!constantDefinitionString.empty()) { |
|||
// Parse the string that defines the undefined constants of the model and make sure that it contains exactly
|
|||
// one value for each undefined constant of the model.
|
|||
std::vector<std::string> definitions; |
|||
boost::split(definitions, constantDefinitionString, boost::is_any_of(",")); |
|||
for (auto& definition : definitions) { |
|||
boost::trim(definition); |
|||
|
|||
// Check whether the token could be a legal constant definition.
|
|||
std::size_t positionOfAssignmentOperator = definition.find('='); |
|||
STORM_LOG_THROW(positionOfAssignmentOperator != std::string::npos, storm::exceptions::WrongFormatException, "Illegal constant definition string: syntax error."); |
|||
|
|||
// Now extract the variable name and the value from the string.
|
|||
std::string constantName = definition.substr(0, positionOfAssignmentOperator); |
|||
boost::trim(constantName); |
|||
std::string value = definition.substr(positionOfAssignmentOperator + 1); |
|||
boost::trim(value); |
|||
|
|||
// Check whether the constant is a legal undefined constant of the program and if so, of what type it is.
|
|||
if (manager.hasVariable(constantName)) { |
|||
// Get the actual constant and check whether it's in fact undefined.
|
|||
auto const& variable = manager.getVariable(constantName); |
|||
STORM_LOG_THROW(definedConstants.find(variable) == definedConstants.end(), storm::exceptions::WrongFormatException, "Illegally trying to define constant '" << constantName <<"' twice."); |
|||
definedConstants.insert(variable); |
|||
|
|||
if (variable.hasBooleanType()) { |
|||
if (value == "true") { |
|||
constantDefinitions[variable] = manager.boolean(true); |
|||
} else if (value == "false") { |
|||
constantDefinitions[variable] = manager.boolean(false); |
|||
} else { |
|||
throw storm::exceptions::WrongFormatException() << "Illegal value for boolean constant: " << value << "."; |
|||
} |
|||
} else if (variable.hasIntegerType()) { |
|||
int_fast64_t integerValue = std::stoi(value); |
|||
constantDefinitions[variable] = manager.integer(integerValue); |
|||
} else if (variable.hasRationalType()) { |
|||
double doubleValue = std::stod(value); |
|||
constantDefinitions[variable] = manager.rational(doubleValue); |
|||
} |
|||
} else { |
|||
STORM_LOG_THROW(false, storm::exceptions::WrongFormatException, "Illegal constant definition string: unknown undefined constant '" << constantName << "'."); |
|||
} |
|||
} |
|||
} |
|||
|
|||
return constantDefinitions; |
|||
} |
|||
|
|||
} |
|||
} |
|||
} |
@ -0,0 +1,16 @@ |
|||
#pragma once |
|||
|
|||
#include <map> |
|||
|
|||
#include "storm/storage/expressions/ExpressionManager.h" |
|||
#include "storm/storage/expressions/Expression.h" |
|||
|
|||
namespace storm { |
|||
namespace utility { |
|||
namespace cli { |
|||
|
|||
std::map<storm::expressions::Variable, storm::expressions::Expression> parseConstantDefinitionString(storm::expressions::ExpressionManager const& manager, std::string const& constantDefinitionString); |
|||
|
|||
} |
|||
} |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue