1#include "storm-config.h"
16TEST(BEDistributionTest, ConstantFail) {
18 double timebound = 0.8;
20#ifdef STORM_HAVE_SYLVAN
23 auto checker = std::make_shared<storm::dft::modelchecker::SFTBDDChecker>(dft, std::make_shared<storm::dft::storage::SylvanBddManager>(env));
24 double resultBDD = checker->getProbabilityAtTimebound(timebound);
25 EXPECT_NEAR(resultBDD, 0.3296799540, 1e-10);
31 std::string
property =
"Pmax=? [F<=" + std::to_string(timebound) +
" \"failed\"]";
35 EXPECT_NEAR(resultMC, 0.3296799540, 1e-10);
38TEST(BEDistributionTest, ConstantNonFail) {
40 double timebound = 0.8;
42#ifdef STORM_HAVE_SYLVAN
45 auto checker = std::make_shared<storm::dft::modelchecker::SFTBDDChecker>(dft, std::make_shared<storm::dft::storage::SylvanBddManager>(env));
46 double resultBDD = checker->getProbabilityAtTimebound(timebound);
47 EXPECT_NEAR(resultBDD, 0.9592377960, 1e-10);
53 std::string
property =
"P=? [F<=" + std::to_string(timebound) +
" \"failed\"]";
57 EXPECT_NEAR(resultMC, 0.9592377960, 1e-10);
60TEST(BEDistributionTest, ConstantNonFail2) {
62 double timebound = 0.8;
64#ifdef STORM_HAVE_SYLVAN
67 auto checker = std::make_shared<storm::dft::modelchecker::SFTBDDChecker>(dft, std::make_shared<storm::dft::storage::SylvanBddManager>(env));
68 double resultBDD = checker->getProbabilityAtTimebound(timebound);
69 EXPECT_EQ(resultBDD, 0);
75 std::string
property =
"P=? [F<=" + std::to_string(timebound) +
" \"failed\"]";
79 EXPECT_EQ(resultMC, 0);
82TEST(BEDistributionTest, Probability) {
84 double timebound = 0.8;
86#ifdef STORM_HAVE_SYLVAN
89 auto checker = std::make_shared<storm::dft::modelchecker::SFTBDDChecker>(dft, std::make_shared<storm::dft::storage::SylvanBddManager>(env));
90 double resultBDD = checker->getProbabilityAtTimebound(timebound);
91 EXPECT_NEAR(resultBDD, 0.1095403852, 1e-10);
97 std::string
property =
"Pmax=? [F<=" + std::to_string(timebound) +
" \"failed\"]";
101 EXPECT_NEAR(resultMC, 0.1095403852, 1e-10);
104TEST(BEDistributionTest, Exponential) {
106 double timebound = 0.8;
108#ifdef STORM_HAVE_SYLVAN
111 auto checker = std::make_shared<storm::dft::modelchecker::SFTBDDChecker>(dft, std::make_shared<storm::dft::storage::SylvanBddManager>(env));
112 double resultBDD = checker->getProbabilityAtTimebound(timebound);
113 EXPECT_NEAR(resultBDD, 0.108688872, 1e-10);
119 std::string
property =
"P=? [F<=" + std::to_string(timebound) +
" \"failed\"]";
123 EXPECT_NEAR(resultMC, 0.108688872, 1e-10);
126TEST(BEDistributionTest, Erlang) {
128 double timebound = 0.8;
130#ifdef STORM_HAVE_SYLVAN
133 auto checker = std::make_shared<storm::dft::modelchecker::SFTBDDChecker>(dft, std::make_shared<storm::dft::storage::SylvanBddManager>(env));
134 double resultBDD = checker->getProbabilityAtTimebound(timebound);
135 EXPECT_NEAR(resultBDD, 0.4949009834, 1e-10);
141 std::string
property =
"P=? [F<=" + std::to_string(timebound) +
" \"failed\"]";
145 EXPECT_NEAR(resultMC, 0.4949009834, 1e-10);
148TEST(BEDistributionTest, Weibull) {
149#ifdef STORM_HAVE_SYLVAN
151 double timebound = 2;
155 auto checker = std::make_shared<storm::dft::modelchecker::SFTBDDChecker>(dft, std::make_shared<storm::dft::storage::SylvanBddManager>(env));
156 double resultBDD = checker->getProbabilityAtTimebound(timebound);
157 EXPECT_NEAR(resultBDD, 0.0382982486, 1e-10);
159 GTEST_SKIP() <<
"Library Sylvan not available.";
163TEST(BEDistributionTest, LogNormal) {
164#ifdef STORM_HAVE_SYLVAN
166 double timebound = 0.8;
170 auto checker = std::make_shared<storm::dft::modelchecker::SFTBDDChecker>(dft, std::make_shared<storm::dft::storage::SylvanBddManager>(env));
171 double resultBDD = checker->getProbabilityAtTimebound(timebound);
172 EXPECT_NEAR(resultBDD, 0.2336675428, 1e-10);
174 GTEST_SKIP() <<
"Library Sylvan not available.";
TEST(RegionConstraintCheckerTest, AffineConstraintHoldsThroughout)
Environment for storm-dft.
std::vector< std::shared_ptr< storm::logic::Formula const > > extractFormulasFromProperties(std::vector< storm::jani::Property > const &properties)
std::vector< storm::jani::Property > parseProperties(storm::parser::FormulaParser &formulaParser, std::string const &inputString, boost::optional< std::set< std::string > > const &propertyFilter)
std::shared_ptr< storm::dft::storage::DFT< ValueType > > prepareForMarkovAnalysis(storm::dft::storage::DFT< ValueType > const &dft)
Apply transformations to make DFT feasible for Markovian analysis.
std::shared_ptr< storm::dft::storage::DFT< ValueType > > loadDFTGalileoFile(std::string const &file)
Load DFT from Galileo file.
std::pair< bool, std::string > isWellFormed(storm::dft::storage::DFT< ValueType > const &dft, bool validForMarkovianAnalysis)
Check whether the DFT is well-formed.
storm::dft::modelchecker::DFTModelChecker< ValueType >::dft_results analyzeDFT(storm::dft::DftEnvironment const &env, storm::dft::storage::DFT< ValueType > const &dft, std::vector< std::shared_ptr< storm::logic::Formula const > > const &properties, storm::dft::utility::RelevantEvents const &relevantEvents, bool printOutput, typename storm::dft::modelchecker::DFTModelChecker< ValueType >::ModelExportCallback const &exportCallback)
Compute the exact or approximate analysis result of the given DFT according to the given properties.