From 93ba6f941ff9c9eba3fc5b81034dc28e8e8474f7 Mon Sep 17 00:00:00 2001 From: dehnert Date: Mon, 5 Dec 2016 18:51:29 +0100 Subject: [PATCH] forgot to add file --- src/storm/abstraction/ValidBlockAbstractor.h | 88 ++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 src/storm/abstraction/ValidBlockAbstractor.h diff --git a/src/storm/abstraction/ValidBlockAbstractor.h b/src/storm/abstraction/ValidBlockAbstractor.h new file mode 100644 index 000000000..6e0b28ab4 --- /dev/null +++ b/src/storm/abstraction/ValidBlockAbstractor.h @@ -0,0 +1,88 @@ +#pragma once + +#include +#include +#include +#include + +#include "storm/storage/dd/DdType.h" +#include "storm/storage/dd/Bdd.h" + +#include "storm/abstraction/LocalExpressionInformation.h" + +#include "storm/solver/SmtSolver.h" + +namespace storm { + namespace utility { + namespace solver { + class SmtSolverFactory; + } + } + + namespace abstraction { + + template + class AbstractionInformation; + + template + class ValidBlockAbstractor { + public: + ValidBlockAbstractor(AbstractionInformation& abstractionInformation, std::shared_ptr const& smtSolverFactory); + + storm::dd::Bdd const& getValidBlocks(); + + void refine(std::vector const& predicates); + + private: + /*! + * Checks which parts of the valid blocks need to be recomputed. + */ + void recomputeValidBlocks(); + + /*! + * Recomputed the valid blocks for the given predicate block. + */ + void recomputeValidBlockForPredicateBlock(uint64_t blockIndex); + + /*! + * Retrieves the abstraction information object. + */ + AbstractionInformation const& getAbstractionInformation() const; + + /*! + * Translates the given model to a source state DD. + * + * @param model The model to translate. + * @param blockIndex The index of the block. + * @return The source state encoded as a DD. + */ + storm::dd::Bdd getSourceStateBdd(storm::solver::SmtSolver::ModelReference const& model, uint64_t blockIndex) const; + + /// The object storing the information about the abstraction (like predicates etc.) + std::reference_wrapper const> abstractionInformation; + + /// An object storing information about how predicates are related. + LocalExpressionInformation localExpressionInformation; + + /// The BDD storing all valid blocks; + storm::dd::Bdd validBlocks; + + /// A vector of SMT solvers that correspond to the predicate blocks in the local expression information. + std::vector> smtSolvers; + + /// A vector of relevant variables and predicates. Every inner vector corresponds to one block of the local + /// expression information. + std::vector>> relevantVariablesAndPredicates; + + /// The decision variables for each predicate block. + std::vector> decisionVariables; + + /// A vector of BDDs that store the valid blocks for the individual predicate blocks to be able to reuse them. + std::vector> validBlocksForPredicateBlocks; + + /// A flag that stores whether we need to possibly recompute the valid blocks (or parts). + bool checkForRecomputation; + }; + + } +}