@ -27,38 +27,31 @@ namespace storm {
// Intentionally left empty.
}
template < typename SparseMarkovAutomatonModelType >
bool SparseMarkovAutomatonCslModelChecker < SparseMarkovAutomatonModelType > : : canHandle ( CheckTask < storm : : logic : : Formula , ValueType > const & checkTask ) const {
return SparseMarkovAutomatonCslModelChecker < SparseMarkovAutomatonModelType > : : canHandleImplementation < ValueType > ( checkTask ) ;
}
template < typename SparseMarkovAutomatonModelType >
template < typename CValueType , typename std : : enable_if < storm : : NumberTraits < CValueType > : : SupportsExponential , int > : : type >
bool SparseMarkovAutomatonCslModelChecker < SparseMarkovAutomatonModelType > : : canHandleImplementation ( CheckTask < storm : : logic : : Formula , CValueType > const & checkTask ) const {
storm : : logic : : Formula const & formula = checkTask . getFormula ( ) ;
if ( formula . isInFragment ( storm : : logic : : csl ( ) . setGloballyFormulasAllowed ( false ) . setNextFormulasAllowed ( false ) . setRewardOperatorsAllowed ( true ) . setReachabilityRewardFormulasAllowed ( true ) . setTotalRewardFormulasAllowed ( true ) . setTimeAllowed ( true ) . setLongRunAverageProbabilitiesAllowed ( true ) . setLongRunAverageRewardFormulasAllowed ( true ) . setRewardAccumulationAllowed ( true ) ) ) {
template < typename ModelType >
bool SparseMarkovAutomatonCslModelChecker < ModelType > : : canHandleStatic ( CheckTask < storm : : logic : : Formula , ValueType > const & checkTask , bool * requiresSingleInitialState ) {
auto singleObjectiveFragment = storm : : logic : : csl ( ) . setGloballyFormulasAllowed ( false ) . setNextFormulasAllowed ( false ) . setRewardOperatorsAllowed ( true ) . setReachabilityRewardFormulasAllowed ( true ) . setTotalRewardFormulasAllowed ( true ) . setTimeAllowed ( true ) . setLongRunAverageProbabilitiesAllowed ( true ) . setLongRunAverageRewardFormulasAllowed ( true ) . setRewardAccumulationAllowed ( true ) ;
auto multiObjectiveFragment = storm : : logic : : multiObjective ( ) . setTimeAllowed ( true ) . setTimeBoundedUntilFormulasAllowed ( true ) ;
if ( ! storm : : NumberTraits < ValueType > : : SupportsExponential ) {
singleObjectiveFragment . setBoundedUntilFormulasAllowed ( false ) . setCumulativeRewardFormulasAllowed ( false ) . setInstantaneousFormulasAllowed ( false ) ;
multiObjectiveFragment . setTimeBoundedUntilFormulasAllowed ( false ) . setCumulativeRewardFormulasAllowed ( false ) . setInstantaneousFormulasAllowed ( false ) ;
}
if ( checkTask . getFormula ( ) . isInFragment ( singleObjectiveFragment ) ) {
return true ;
} else {
// Check whether we consider a multi-objective formula
// For multi-objective model checking, each initial state requires an individual scheduler (in contrast to single objective model checking). Let's exclude multiple initial states.
if ( this - > getModel ( ) . getInitialStates ( ) . getNumberOfSetBits ( ) > 1 ) return false ;
if ( ! checkTask . isOnlyInitialStatesRelevantSet ( ) ) return false ;
return formula . isInFragment ( storm : : logic : : multiObjective ( ) . setTimeAllowed ( true ) . setTimeBoundedUntilFormulasAllowed ( true ) ) ;
} else if ( checkTask . isOnlyInitialStatesRelevantSet ( ) & & checkTask . getFormula ( ) . isInFragment ( multiObjectiveFragment ) ) {
if ( requiresSingleInitialState ) {
* requiresSingleInitialState = true ;
}
}
return false ;
}
template < typename SparseMarkovAutomatonModelType >
template < typename CValueType , typename std : : enable_if < ! storm : : NumberTraits < CValueType > : : SupportsExponential , int > : : type >
bool SparseMarkovAutomatonCslModelChecker < SparseMarkovAutomatonModelType > : : canHandleImplementation ( CheckTask < storm : : logic : : Formula , CValueType > const & checkTask ) const {
storm : : logic : : Formula const & formula = checkTask . getFormula ( ) ;
if ( formula . isInFragment ( storm : : logic : : prctl ( ) . setGloballyFormulasAllowed ( false ) . setNextFormulasAllowed ( false ) . setRewardOperatorsAllowed ( true ) . setReachabilityRewardFormulasAllowed ( true ) . setTotalRewardFormulasAllowed ( true ) . setTimeAllowed ( true ) . setLongRunAverageProbabilitiesAllowed ( true ) . setLongRunAverageRewardFormulasAllowed ( true ) . setTimeBoundedUntilFormulasAllowed ( false ) . setCumulativeRewardFormulasAllowed ( false ) . setInstantaneousFormulasAllowed ( false ) ) ) {
return true ;
template < typename SparseMarkovAutomatonModelType >
bool SparseMarkovAutomatonCslModelChecker < SparseMarkovAutomatonModelType > : : canHandle ( CheckTask < storm : : logic : : Formula , ValueType > const & checkTask ) const {
bool requiresSingleInitialState = false ;
if ( canHandleStatic ( checkTask , & requiresSingleInitialState ) ) {
return ! requiresSingleInitialState | | this - > getModel ( ) . getInitialStates ( ) . getNumberOfSetBits ( ) = = 1 ;
} else {
// Check whether we consider a multi-objective formula
// For multi-objective model checking, each initial state requires an individual scheduler (in contrast to single objective model checking). Let's exclude multiple initial states.
if ( this - > getModel ( ) . getInitialStates ( ) . getNumberOfSetBits ( ) > 1 ) return false ;
if ( ! checkTask . isOnlyInitialStatesRelevantSet ( ) ) return false ;
return formula . isInFragment ( storm : : logic : : multiObjective ( ) . setTimeAllowed ( true ) . setTimeBoundedUntilFormulasAllowed ( false ) . setCumulativeRewardFormulasAllowed ( false ) . setInstantaneousFormulasAllowed ( false ) ) ;
return false ;
}
}
xxxxxxxxxx