diff --git a/src/storm/modelchecker/prctl/SparseMdpPrctlModelChecker.cpp b/src/storm/modelchecker/prctl/SparseMdpPrctlModelChecker.cpp index 1623477f1..cc63d179a 100644 --- a/src/storm/modelchecker/prctl/SparseMdpPrctlModelChecker.cpp +++ b/src/storm/modelchecker/prctl/SparseMdpPrctlModelChecker.cpp @@ -189,7 +189,14 @@ namespace storm { STORM_LOG_INFO("Extracting maximal state formulas and computing satisfaction sets for path formula: " << pathFormula); + + std::map apSets; + std::map substitution; + + // TODO Maintain a mapping from APsets to labels in order to use the same label for the same formulas + std::map labels; + for (auto& p : extracted) { STORM_LOG_INFO(" Computing satisfaction set for atomic proposition \"" << p.first << "\" <=> " << *p.second << "..."); @@ -199,9 +206,31 @@ namespace storm { STORM_LOG_INFO(" Atomic proposition \"" << p.first << "\" is satisfied by " << sat.getNumberOfSetBits() << " states."); + + auto occ = labels.find(sat); + if(occ != labels.end()){ + // Reuse AP + STORM_LOG_INFO(" Atomic proposition \"" << p.first << "\" is equivalent to " << occ->second << ", substituting..."); + substitution[p.first] = occ->second; + continue; + } + /*// equivalent to !pi + occ = labels.find(~sat); + if(occ != labels.end()){ + // Reuse negated AP + STORM_LOG_INFO(" Atomic proposition \"" << p.first << "\" is equivalent to !" << occ->second << ", substituting..."); + substitution[p.first] = todo: ! occ->second; + continue; + } + */ + + labels[sat] = p.first; apSets[p.first] = std::move(sat); + STORM_LOG_INFO(" Atomic proposition \"" << p.first << "\" is satisfied by " << sat.getNumberOfSetBits() << " states."); } + ltlFormula = ltlFormula->substitute(substitution); + const SparseMdpModelType& mdp = this->getModel(); // TODO