diff --git a/resources/examples/testfiles/dft/hecs_2_2.dft b/resources/examples/testfiles/dft/hecs_2_2.dft new file mode 100644 index 000000000..788efaf16 --- /dev/null +++ b/resources/examples/testfiles/dft/hecs_2_2.dft @@ -0,0 +1,40 @@ +toplevel "System"; +"System" or "System_1" "System_2"; +"System_1" or "PSF_1" "MSF_1" "BSF_1" "IF_1"; +"PSF_1" and "P_11" "P_12"; +"P_11" wsp "A_11" "A_1S"; +"P_12" wsp "A_12" "A_1S"; +"MSF_1" 3of5 "M_1_1" "M_1_2" "M_1_3" "M_1_4" "M_1_5"; +"BSF_1" and "BUS_11" "BUS_12"; +"IF_1" or "HW_1" "SW_1"; +"System_2" or "PSF_2" "MSF_2" "BSF_2" "IF_2"; +"PSF_2" and "P_21" "P_22"; +"P_21" wsp "A_21" "A_2S"; +"P_22" wsp "A_22" "A_2S"; +"MSF_2" 3of5 "M_2_1" "M_2_2" "M_2_3" "M_2_4" "M_2_5"; +"BSF_2" and "BUS_21" "BUS_22"; +"IF_2" or "HW_2" "SW_2"; +"A_11" lambda=1.0e-4 dorm=0; +"A_12" lambda=1.0e-4 dorm=0; +"A_1S" lambda=1.0e-4 dorm=0; +"M_1_1" lambda=6.0e-5 dorm=0; +"M_1_2" lambda=6.0e-5 dorm=0; +"M_1_3" lambda=6.0e-5 dorm=0; +"M_1_4" lambda=6.0e-5 dorm=0; +"M_1_5" lambda=6.0e-5 dorm=0; +"BUS_11" lambda=1.0e-6 dorm=0; +"BUS_12" lambda=1.0e-6 dorm=0; +"HW_1" lambda=5.0e-5 dorm=0; +"SW_1" lambda=6.0e-5 dorm=0; +"A_21" lambda=1.0e-4 dorm=0; +"A_22" lambda=1.0e-4 dorm=0; +"A_2S" lambda=1.0e-4 dorm=0; +"M_2_1" lambda=6.0e-5 dorm=0; +"M_2_2" lambda=6.0e-5 dorm=0; +"M_2_3" lambda=6.0e-5 dorm=0; +"M_2_4" lambda=6.0e-5 dorm=0; +"M_2_5" lambda=6.0e-5 dorm=0; +"BUS_21" lambda=1.0e-6 dorm=0; +"BUS_22" lambda=1.0e-6 dorm=0; +"HW_2" lambda=5.0e-5 dorm=0; +"SW_2" lambda=6.0e-5 dorm=0; diff --git a/src/test/storm-dft/api/DftModelCheckerTest.cpp b/src/test/storm-dft/api/DftModelCheckerTest.cpp index 6da316081..65e1e05d2 100644 --- a/src/test/storm-dft/api/DftModelCheckerTest.cpp +++ b/src/test/storm-dft/api/DftModelCheckerTest.cpp @@ -71,6 +71,17 @@ namespace { return boost::get(results[0]); } + double analyzeReliability(std::string const &file, double bound) { + std::shared_ptr> dft = storm::api::loadDFTGalileoFile(file); + EXPECT_TRUE(storm::api::isWellFormed(*dft)); + std::string property = "Pmin=? [F<=" + std::to_string(bound) + " \"failed\"]"; + std::vector> properties = storm::api::extractFormulasFromProperties( + storm::api::parseProperties(property)); + typename storm::modelchecker::DFTModelChecker::dft_results results = storm::api::analyzeDFT( + *dft, properties, config.useSR, config.useMod, config.useDC, false); + return boost::get(results[0]); + } + private: DftAnalysisConfig config; }; @@ -184,4 +195,8 @@ namespace { EXPECT_EQ(result, storm::utility::infinity()); } + TYPED_TEST(DftModelCheckerTest, HecsMTTF) { + double result = this->analyzeReliability(STORM_TEST_RESOURCES_DIR "/dft/hecs_2_2.dft", 1.0); + EXPECT_FLOAT_EQ(result, 0.00021997582); + } }