3#include "storm-config.h"
59template<
typename ModelType,
typename ValueType =
typename ModelType::ValueType>
61 std::vector<ValueType>
const& stateRewards = {}, std::vector<ValueType>
const& stateActionRewards = {}) {
64 labeling.addLabel(
"init");
65 labeling.addLabelToState(
"init", 0);
66 for (
auto const& [label, states] : labels) {
67 labeling.addLabel(label);
68 for (uint64_t
const state : states) {
69 labeling.addLabelToState(label, state);
72 storm::storage::sparse::ModelComponents<ValueType> components(std::move(matrix), std::move(labeling));
73 if constexpr (std::is_same_v<ModelType, storm::models::sparse::Ctmc<ValueType>>) {
74 components.rateTransitions =
true;
76 if (!stateRewards.empty() || !stateActionRewards.empty()) {
77 components.rewardModels.emplace(
"rew", storm::models::sparse::StandardRewardModel<ValueType>(
78 stateRewards.empty() ? std::nullopt : std::optional<std::vector<ValueType>>(stateRewards),
79 stateActionRewards.empty() ? std::nullopt : std::optional<std::vector<ValueType>>(stateActionRewards)));
81 return std::make_shared<ModelType>(std::move(components));
88template<
typename ValueType =
double>
91 std::map<std::string, std::vector<uint64_t>>
const& labels) {
96 for (
auto const& [label, states] : labels) {
98 for (uint64_t
const state : states) {
105 return std::make_shared<storm::models::sparse::MarkovAutomaton<ValueType>>(std::move(components));
111template<
typename ValueType>
114 return result->template asExplicitQuantitativeCheckResult<ValueType>()[*model->getInitialStates().begin()];
121template<
typename ValueType>
130template<
typename ValueType>
132 std::shared_ptr<storm::models::sparse::Model<ValueType>>
model;
133 std::vector<std::shared_ptr<storm::logic::Formula const>>
formulas;
147template<
typename ValueType>
152 PrismInput<ValueType> result;
155 if (buildOptions.choiceLabels) {
156 builderOptions.setBuildChoiceLabels();
158 if (buildOptions.choiceOrigins) {
159 builderOptions.setBuildChoiceOrigins();
161 if (buildOptions.stateValuations) {
162 builderOptions.setBuildStateValuations();
void addLabel(std::string const &label)
Adds a new label to the labelings.
Base class for all sparse models.
This class manages the labeling of the state space with a number of (atomic) labels.
void addLabelToState(std::string const &label, storm::storage::sparse::state_type state)
Adds a label to a given state.
static storm::prism::Program parse(std::string const &filename, bool prismCompatability=false)
Parses the given file into the PRISM storage classes assuming it complies with the PRISM syntax.
Program preprocess(std::map< storm::expressions::Variable, storm::expressions::Expression > const &constantDefinitions) const
Preprocesses the program by defining the given constant definitions, substituting constants and formu...
A bit vector that is internally represented as a vector of 64-bit values.
A class that holds a possibly non-square matrix in the compressed row storage format.
index_type getColumnCount() const
Returns the number of columns of the matrix.
storm::modelchecker::CheckTask< storm::logic::Formula, ValueType > createTask(std::shared_ptr< const storm::logic::Formula > const &formula, bool onlyInitialStatesRelevant=false)
std::vector< storm::jani::Property > parsePropertiesForPrismProgram(std::string const &inputString, storm::prism::Program const &program, boost::optional< std::set< std::string > > const &propertyFilter)
std::shared_ptr< storm::models::sparse::Model< ValueType > > buildSparseModel(storm::storage::SymbolicModelDescription const &model, storm::builder::BuilderOptions const &options, typename storm::builder::ExplicitModelBuilder< ValueType >::Options const &explorationOptions=typename storm::builder::ExplicitModelBuilder< ValueType >::Options())
std::vector< std::shared_ptr< storm::logic::Formula const > > extractFormulasFromProperties(std::vector< storm::jani::Property > const &properties)
std::unique_ptr< storm::modelchecker::CheckResult > verifyWithSparseEngine(storm::Environment const &env, std::shared_ptr< storm::models::sparse::Dtmc< ValueType > > const &dtmc, storm::modelchecker::CheckTask< storm::logic::Formula, ValueType > const &task, bool preferEliminationChecker=false)
StateLabelPreservation
The way state labels will be preserved by the bisimulation.
Shared helpers for the bisimulation tests, cf.
storm::bisimulation::StateLabelPreservation StateLabelPreservation
ValueType checkFormula(std::shared_ptr< storm::models::sparse::Model< ValueType > > const &model, std::shared_ptr< storm::logic::Formula const > const &formula)
storm::bisimulation::Options Options
std::shared_ptr< storm::models::sparse::MarkovAutomaton< ValueType > > buildMarkovAutomaton(storm::storage::SparseMatrix< ValueType > matrix, storm::storage::BitVector markovianStates, std::map< std::string, std::vector< uint64_t > > const &labels)
Builds a Markov automaton.
std::shared_ptr< ModelType > buildModel(storm::storage::SparseMatrix< ValueType > matrix, std::map< std::string, std::vector< uint64_t > > const &labels, std::vector< ValueType > const &stateRewards={}, std::vector< ValueType > const &stateActionRewards={})
Builds a deterministic model with the given (probability or rate) matrix.
PrismInput< ValueType > buildFromPrism(std::string const &prismFile, std::string const &formulaString, BuildOptions const &buildOptions={})
BisimulationType bisimulationType
std::optional< storm::RationalNumber > tolerance
boost::optional< storm::storage::BitVector > markovianStates
What to build from a PRISM program in addition to what the formulas require.