Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
SubsystemBuilder.h
Go to the documentation of this file.
1#pragma once
2
3#include <memory>
4#include <vector>
5
9
10namespace storm {
11namespace transformer {
12
13template<typename ValueType, typename RewardModelType = storm::models::sparse::StandardRewardModel<ValueType>>
15 // The resulting model
16 std::shared_ptr<storm::models::sparse::Model<ValueType, RewardModelType>> model;
17 // Gives for each state in the resulting model the corresponding state in the original model.
18 std::vector<uint_fast64_t> newToOldStateIndexMapping;
19 // Gives for each action in the resulting model the corresponding action in the original model.
20 // If this action was introduced to fix a deadlock, it will get index std::numeric_limits<uint64_t>::max()
21 std::vector<uint64_t> newToOldActionIndexMapping;
22 // marks the actions of the original model that are still available in the subsystem
24 // If set, deadlock states have been introduced and have been assigned this label.
25 boost::optional<std::string> deadlockLabel;
26};
27
30 bool buildStateMapping = true;
31 bool buildActionMapping = false;
32 bool buildKeptActions = true;
33 bool fixDeadlocks = false;
35};
36
37/*
38 * Removes all states and actions that are not part of the subsystem.
39 * A state is part of the subsystem iff
40 * * it is selected in subsystemStates AND
41 * * keepUnreachableStates is true or the state is reachable from the initial states
42 * An action is part of the subsystem iff
43 * * it is selected in subsystemActions AND
44 * * it originates from a state that is part of the subsystem AND
45 * * it does not contain a transition leading to a state outside of the subsystem.
46 *
47 * If this introduces a deadlock state (i.e., a state without an action) it is either
48 * * fixed by inserting a selfloop (if fixDeadlocks is true) or
49 * * an exception is thrown (otherwise).
50 *
51 * @param originalModel The original model.
52 * @param subsystemStates The selected states.
53 * @param subsystemActions The selected actions
54 * @param keepUnreachableStates if true, states that are not reachable from the initial state are kept
55 */
56template<typename ValueType, typename RewardModelType = storm::models::sparse::StandardRewardModel<ValueType>>
58 storm::storage::BitVector const& subsystemStates,
59 storm::storage::BitVector const& subsystemActions, bool keepUnreachableStates = true,
61
62} // namespace transformer
63} // namespace storm
Base class for all sparse models.
Definition Model.h:33
A bit vector that is internally represented as a vector of 64-bit values.
Definition BitVector.h:18
SubsystemBuilderReturnType< ValueType, RewardModelType > buildSubsystem(storm::models::sparse::Model< ValueType, RewardModelType > const &originalModel, storm::storage::BitVector const &subsystemStates, storm::storage::BitVector const &subsystemActions, bool keepUnreachableStates, SubsystemBuilderOptions options)
LabParser.cpp.
Definition cli.cpp:18
std::vector< uint_fast64_t > newToOldStateIndexMapping
std::shared_ptr< storm::models::sparse::Model< ValueType, RewardModelType > > model
boost::optional< std::string > deadlockLabel