16template<storm::dd::DdType DdType,
typename ValueType>
18 std::shared_ptr<storm::utility::solver::SmtSolverFactory>
const& smtSolverFactory,
bool useDecomposition,
19 bool addPredicatesForValidBlocks,
bool debug)
20 : smtSolverFactory(smtSolverFactory), abstractionInformation(abstractionInformation), commands(), module(module) {
22 for (
auto const& command : module.getCommands()) {
23 commands.emplace_back(command, abstractionInformation, smtSolverFactory, useDecomposition, addPredicatesForValidBlocks, debug);
27template<storm::dd::DdType DdType,
typename ValueType>
29 for (uint_fast64_t index = 0; index < commands.size(); ++index) {
31 commands[index].refine(predicates);
35template<storm::dd::DdType DdType,
typename ValueType>
37 return commands[player1Choice].getGuard();
40template<storm::dd::DdType DdType,
typename ValueType>
42 return commands[player1Choice].getNumberOfUpdates(player1Choice);
45template<storm::dd::DdType DdType,
typename ValueType>
47 uint64_t auxiliaryChoice)
const {
48 return commands[player1Choice].getVariableUpdates(auxiliaryChoice);
51template<storm::dd::DdType DdType,
typename ValueType>
53 return commands[player1Choice].getAssignedVariables();
56template<storm::dd::DdType DdType,
typename ValueType>
59 std::vector<GameBddResult<DdType>> commandDdsAndUsedOptionVariableCounts;
60 uint_fast64_t maximalNumberOfUsedOptionVariables = 0;
61 for (
auto& command : commands) {
62 commandDdsAndUsedOptionVariableCounts.push_back(command.abstract());
63 maximalNumberOfUsedOptionVariables =
64 std::max(maximalNumberOfUsedOptionVariables, commandDdsAndUsedOptionVariableCounts.back().numberOfPlayer2Variables);
70 for (
auto const& commandDd : commandDdsAndUsedOptionVariableCounts) {
72 commandDd.bdd && this->getAbstractionInformation().encodePlayer2Choice(1, commandDd.numberOfPlayer2Variables, maximalNumberOfUsedOptionVariables);
77template<storm::dd::DdType DdType,
typename ValueType>
79 uint_fast64_t numberOfPlayer2Variables) {
81 this->getAbstractionInformation().getDdManager().getBddZero());
83 for (
auto& command : commands) {
84 BottomStateResult<DdType> commandBottomStateResult = command.getBottomStateTransitions(reachableStates, numberOfPlayer2Variables);
92template<storm::dd::DdType DdType,
typename ValueType>
95 for (
auto const& command : commands) {
96 result += command.getCommandUpdateProbabilitiesAdd();
101template<storm::dd::DdType DdType,
typename ValueType>
106template<storm::dd::DdType DdType,
typename ValueType>
111template<storm::dd::DdType DdType,
typename ValueType>
113 return abstractionInformation.get();
116template<storm::dd::DdType DdType,
typename ValueType>
118 for (
auto& command : commands) {
119 command.notifyGuardIsPredicate();
DdManager< LibraryType > & getDdManager() const
Retrieves the manager that is responsible for this DD.
BottomStateResult< DdType > getBottomStateTransitions(storm::dd::Bdd< DdType > const &reachableStates, uint_fast64_t numberOfPlayer2Variables)
Retrieves the transitions to bottom states of this module.
std::map< storm::expressions::Variable, storm::expressions::Expression > getVariableUpdates(uint64_t player1Choice, uint64_t auxiliaryChoice) const
Retrieves a mapping from variables to expressions that define their updates wrt.
storm::dd::Add< DdType, ValueType > getCommandUpdateProbabilitiesAdd() const
Retrieves an ADD that maps the encodings of commands and their updates to their probabilities.
void refine(std::vector< uint_fast64_t > const &predicates)
Refines the abstract module with the given predicates.
GameBddResult< DdType > abstract()
Computes the abstraction of the module wrt.
std::vector< CommandAbstractor< DdType, ValueType > > const & getCommands() const
Retrieves the abstract commands of this abstract module.
ModuleAbstractor(storm::prism::Module const &module, AbstractionInformation< DdType > &abstractionInformation, std::shared_ptr< storm::utility::solver::SmtSolverFactory > const &smtSolverFactory, bool useDecomposition, bool addPredicatesForValidBlocks, bool debug)
Constructs an abstract module from the given module.
storm::expressions::Expression const & getGuard(uint64_t player1Choice) const
Retrieves the guard of the given player 1 choice.
std::set< storm::expressions::Variable > const & getAssignedVariables(uint64_t player1Choice) const
Retrieves the variables assigned by the given player 1 choice.
void notifyGuardsArePredicates()
uint64_t getNumberOfUpdates(uint64_t player1Choice) const
Retrieves the number of updates of the specified player 1 choice.
#define STORM_LOG_TRACE(message)
storm::dd::Bdd< DdType > states
storm::dd::Bdd< DdType > transitions