@ -19,7 +19,6 @@
# include "storm/modelchecker/helper/ltl/SparseLTLHelper.h"
# include "storm/logic/FragmentSpecification.h"
# include "storm/logic/ExtractMaximalStateFormulasVisitor.h"
# include "storm/adapters/RationalFunctionAdapter.h"
@ -27,10 +26,6 @@
# include "storm/exceptions/InvalidPropertyException.h"
# include "storm/exceptions/NotImplementedException.h"
# include "storm/settings/SettingsManager.h"
# include "storm/settings/modules/GeneralSettings.h"
# include "storm/settings/modules/DebugSettings.h"
namespace storm {
namespace modelchecker {
template < typename SparseCtmcModelType >
@ -40,7 +35,7 @@ namespace storm {
template < typename ModelType >
bool SparseCtmcCslModelChecker < ModelType > : : canHandleStatic ( CheckTask < storm : : logic : : Formula , ValueType > const & checkTask ) {
auto fragment = storm : : logic : : csrlstar ( ) . setGloballyFormulasAllowed ( true ) . set LongRunAverageRewardFormulasAllowed ( true ) . setLongRunAverageProbabilitiesAllowed ( true ) . setTimeAllowed ( true ) . setTimeOperatorsAllowed ( true ) . setTotalRewardFormulasAllowed ( true ) . setRewardAccumulationAllowed ( true ) ;
auto fragment = storm : : logic : : csrlstar ( ) . setLongRunAverageRewardFormulasAllowed ( true ) . setLongRunAverageProbabilitiesAllowed ( true ) . setTimeAllowed ( true ) . setTimeOperatorsAllowed ( true ) . setTotalRewardFormulasAllowed ( true ) . setRewardAccumulationAllowed ( true ) ;
if ( ! storm : : NumberTraits < ValueType > : : SupportsExponential ) {
fragment . setBoundedUntilFormulasAllowed ( false ) . setCumulativeRewardFormulasAllowed ( false ) . setInstantaneousFormulasAllowed ( false ) ;
}
@ -85,6 +80,16 @@ namespace storm {
return std : : unique_ptr < CheckResult > ( new ExplicitQuantitativeCheckResult < ValueType > ( std : : move ( numericResult ) ) ) ;
}
template < typename SparseCtmcModelType >
std : : unique_ptr < CheckResult > SparseCtmcCslModelChecker < SparseCtmcModelType > : : computeGloballyProbabilities ( Environment const & env , CheckTask < storm : : logic : : GloballyFormula , ValueType > const & checkTask ) {
storm : : logic : : GloballyFormula const & pathFormula = checkTask . getFormula ( ) ;
std : : unique_ptr < CheckResult > subResultPointer = this - > check ( env , pathFormula . getSubformula ( ) ) ;
ExplicitQualitativeCheckResult const & subResult = subResultPointer - > asExplicitQualitativeCheckResult ( ) ;
auto probabilisticTransitions = this - > getModel ( ) . computeProbabilityMatrix ( ) ;
std : : vector < ValueType > numericResult = storm : : modelchecker : : helper : : SparseDtmcPrctlHelper < ValueType > : : computeGloballyProbabilities ( env , storm : : solver : : SolveGoal < ValueType > ( this - > getModel ( ) , checkTask ) , probabilisticTransitions , probabilisticTransitions . transpose ( ) , subResult . getTruthValuesVector ( ) , checkTask . isQualitativeSet ( ) ) ;
return std : : unique_ptr < CheckResult > ( new ExplicitQuantitativeCheckResult < ValueType > ( std : : move ( numericResult ) ) ) ;
}
template < typename SparseCtmcModelType >
std : : unique_ptr < CheckResult > SparseCtmcCslModelChecker < SparseCtmcModelType > : : computeUntilProbabilities ( Environment const & env , CheckTask < storm : : logic : : UntilFormula , ValueType > const & checkTask ) {
storm : : logic : : UntilFormula const & pathFormula = checkTask . getFormula ( ) ;
@ -99,15 +104,15 @@ namespace storm {
template < typename SparseCtmcModelType >
std : : unique_ptr < CheckResult > SparseCtmcCslModelChecker < SparseCtmcModelType > : : computeHOAPathProbabilities ( Environment const & env , CheckTask < storm : : logic : : HOAPathFormula , ValueType > const & checkTask ) {
storm : : logic : : HOAPathFormula const & pathFormula = checkTask . getFormula ( ) ;
auto probabilisticTransitions = this - > getModel ( ) . computeProbabilityMatrix ( ) ;
storm : : modelchecker : : helper : : SparseLTLHelper < ValueType , false > helper ( probabilisticTransitions ) ;
storm : : modelchecker : : helper : : setInformationFromCheckTaskDeterministic ( helper , checkTask , this - > getModel ( ) ) ;
auto formulaChecker = [ & ] ( storm : : logic : : Formula const & formula ) { return this - > check ( env , formula ) - > asExplicitQualitativeCheckResult ( ) . getTruthValuesVector ( ) ; } ;
auto apSets = helper . computeApSets ( pathFormula . getAPMapping ( ) , formulaChecker ) ;
std : : vector < ValueType > numericResult = helper . computeDAProductProbabilities ( env , * pathFormula . readAutomaton ( ) , apSets ) ;
return std : : unique_ptr < CheckResult > ( new ExplicitQuantitativeCheckResult < ValueType > ( std : : move ( numericResult ) ) ) ;
}
@ -118,13 +123,13 @@ namespace storm {
auto probabilisticTransitions = this - > getModel ( ) . computeProbabilityMatrix ( ) ;
storm : : modelchecker : : helper : : SparseLTLHelper < ValueType , false > helper ( probabilisticTransitions ) ;
storm : : modelchecker : : helper : : setInformationFromCheckTaskDeterministic ( helper , checkTask , this - > getModel ( ) ) ;
auto formulaChecker = [ & ] ( storm : : logic : : Formula const & formula ) { return this - > check ( env , formula ) - > asExplicitQualitativeCheckResult ( ) . getTruthValuesVector ( ) ; } ;
std : : vector < ValueType > numericResult = helper . computeLTLProbabilities ( env , pathFormula , formulaChecker ) ;
return std : : unique_ptr < CheckResult > ( new ExplicitQuantitativeCheckResult < ValueType > ( std : : move ( numericResult ) ) ) ;
}
template < typename SparseCtmcModelType >
std : : unique_ptr < CheckResult > SparseCtmcCslModelChecker < SparseCtmcModelType > : : computeInstantaneousRewards ( Environment const & env , storm : : logic : : RewardMeasureType , CheckTask < storm : : logic : : InstantaneousRewardFormula , ValueType > const & checkTask ) {
storm : : logic : : InstantaneousRewardFormula const & rewardPathFormula = checkTask . getFormula ( ) ;