From 1136ff0d374ff05fae6f3afabdd8580da475e284 Mon Sep 17 00:00:00 2001 From: dehnert Date: Fri, 1 Apr 2016 14:36:00 +0200 Subject: [PATCH 1/3] fixed a failing test (uninitialized data issue) Former-commit-id: ca0f456ba25e349aaca113677fdc1f8b37f31925 --- src/modelchecker/prctl/helper/SparseDtmcPrctlHelper.cpp | 1 + src/modelchecker/prctl/helper/SparseDtmcPrctlHelper.h | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/modelchecker/prctl/helper/SparseDtmcPrctlHelper.cpp b/src/modelchecker/prctl/helper/SparseDtmcPrctlHelper.cpp index 9e1b6ef14..98cbcf2ea 100644 --- a/src/modelchecker/prctl/helper/SparseDtmcPrctlHelper.cpp +++ b/src/modelchecker/prctl/helper/SparseDtmcPrctlHelper.cpp @@ -367,6 +367,7 @@ namespace storm { // Now compute reachability probabilities in the transformed model. storm::storage::SparseMatrix const& newTransitionMatrix = transformedModel.transitionMatrix.get(); std::vector conditionalProbabilities = computeUntilProbabilities(newTransitionMatrix, newTransitionMatrix.transpose(), storm::storage::BitVector(newTransitionMatrix.getRowCount(), true), transformedModel.targetStates.get(), qualitative, linearEquationSolverFactory); + storm::utility::vector::setVectorValues(result, transformedModel.beforeStates, conditionalProbabilities); } } diff --git a/src/modelchecker/prctl/helper/SparseDtmcPrctlHelper.h b/src/modelchecker/prctl/helper/SparseDtmcPrctlHelper.h index 637c30cb5..0be762298 100644 --- a/src/modelchecker/prctl/helper/SparseDtmcPrctlHelper.h +++ b/src/modelchecker/prctl/helper/SparseDtmcPrctlHelper.h @@ -45,6 +45,10 @@ namespace storm { static std::vector computeReachabilityRewards(storm::storage::SparseMatrix const& transitionMatrix, storm::storage::SparseMatrix const& backwardTransitions, std::function(uint_fast64_t, storm::storage::SparseMatrix const&, storm::storage::BitVector const&)> const& totalStateRewardVectorGetter, storm::storage::BitVector const& targetStates, bool qualitative, storm::utility::solver::LinearEquationSolverFactory const& linearEquationSolverFactory); struct BaierTransformedModel { + BaierTransformedModel() : noTargetStates(false) { + // Intentionally left empty. + } + storm::storage::BitVector beforeStates; boost::optional> transitionMatrix; boost::optional targetStates; From 2f5f439f26fac4d9b2313df7b356d0624f84d2d3 Mon Sep 17 00:00:00 2001 From: dehnert Date: Mon, 4 Apr 2016 17:31:22 +0200 Subject: [PATCH 2/3] re-added (naive) splitter selection heuristic Former-commit-id: 5c5166510da415725e77624cb8b4c7dc0b02e49e --- src/storage/bisimulation/BisimulationDecomposition.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/storage/bisimulation/BisimulationDecomposition.cpp b/src/storage/bisimulation/BisimulationDecomposition.cpp index aedd4a998..5c5b3e667 100644 --- a/src/storage/bisimulation/BisimulationDecomposition.cpp +++ b/src/storage/bisimulation/BisimulationDecomposition.cpp @@ -240,6 +240,9 @@ namespace storm { ++iterations; // Get and prepare the next splitter. + // Sort the splitters according to their sizes to prefer small splitters. That is just a heuristic, but + // tends to work well. + std::sort(splitterQueue.begin(), splitterQueue.end(), [] (Block const* b1, Block const* b2) { return b1->getNumberOfStates() < b2->getNumberOfStates(); } ); Block* splitter = splitterQueue.front(); splitterQueue.pop_front(); splitter->data().setSplitter(false); From d2d1ebdb1ab96d4d9624bdc90d24a03bc779cf33 Mon Sep 17 00:00:00 2001 From: TimQu Date: Wed, 13 Apr 2016 15:59:25 +0200 Subject: [PATCH 3/3] test didn't compile due to recent changes in carl::rationalize Former-commit-id: 81af3a0f52924b36ccfacd7f286ef7d8f29d1130 --- test/functional/utility/ModelInstantiatorTest.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/functional/utility/ModelInstantiatorTest.cpp b/test/functional/utility/ModelInstantiatorTest.cpp index fe2ee4a7c..24512d886 100644 --- a/test/functional/utility/ModelInstantiatorTest.cpp +++ b/test/functional/utility/ModelInstantiatorTest.cpp @@ -77,8 +77,8 @@ TEST(ModelInstantiatorTest, BrpProb) { ASSERT_NE(pL, carl::Variable::NO_VARIABLE); storm::Variable const& pK = carl::VariablePool::getInstance().findVariableWithName("pK"); ASSERT_NE(pK, carl::Variable::NO_VARIABLE); - valuation.insert(std::make_pair(pL,carl::rationalize(1))); - valuation.insert(std::make_pair(pK,carl::rationalize(1))); + valuation.insert(std::make_pair(pL,carl::rationalize(1.0))); + valuation.insert(std::make_pair(pK,carl::rationalize(1.0))); storm::models::sparse::Dtmc const& instantiated(modelInstantiator.instantiate(valuation)); @@ -110,7 +110,7 @@ TEST(ModelInstantiatorTest, BrpProb) { ASSERT_NE(pL, carl::Variable::NO_VARIABLE); storm::Variable const& pK = carl::VariablePool::getInstance().findVariableWithName("pK"); ASSERT_NE(pK, carl::Variable::NO_VARIABLE); - valuation.insert(std::make_pair(pL,carl::rationalize(1))); + valuation.insert(std::make_pair(pL,carl::rationalize(1.0))); valuation.insert(std::make_pair(pK,carl::rationalize(0.9))); storm::models::sparse::Dtmc const& instantiated(modelInstantiator.instantiate(valuation));