Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
SymbolicQualitativeCheckResult.cpp
Go to the documentation of this file.
2
5
7
9
10namespace storm {
11namespace modelchecker {
12template<storm::dd::DdType Type>
14 : reachableStates(reachableStates), states(reachableStates), truthValues(truthValues) {
15 // Intentionally left empty.
16}
17
18template<storm::dd::DdType Type>
20 storm::dd::Bdd<Type> const& truthValues)
21 : reachableStates(reachableStates), states(states), truthValues(truthValues) {
22 // Intentionally left empty.
23}
24
25template<storm::dd::DdType Type>
26std::unique_ptr<CheckResult> SymbolicQualitativeCheckResult<Type>::clone() const {
27 return std::make_unique<SymbolicQualitativeCheckResult<Type>>(this->reachableStates, this->states, this->truthValues);
28}
29
30template<storm::dd::DdType Type>
32 return true;
33}
34
35template<storm::dd::DdType Type>
37 return reachableStates == states;
38}
39
40template<storm::dd::DdType Type>
44
45template<storm::dd::DdType Type>
47 STORM_LOG_THROW(other.isSymbolicQualitativeCheckResult(), storm::exceptions::InvalidOperationException,
48 "Cannot perform logical 'and' on check results of incompatible type.");
49 this->truthValues &= other.asSymbolicQualitativeCheckResult<Type>().getTruthValuesVector();
50 return *this;
51}
52
53template<storm::dd::DdType Type>
55 STORM_LOG_THROW(other.isSymbolicQualitativeCheckResult(), storm::exceptions::InvalidOperationException,
56 "Cannot perform logical 'and' on check results of incompatible type.");
57 this->truthValues |= other.asSymbolicQualitativeCheckResult<Type>().getTruthValuesVector();
58 return *this;
59}
60
61template<storm::dd::DdType Type>
63 this->truthValues = !this->truthValues && reachableStates;
64}
65
66template<storm::dd::DdType Type>
70
71template<storm::dd::DdType Type>
75
76template<storm::dd::DdType Type>
80
81template<storm::dd::DdType Type>
83 return !this->truthValues.isZero();
84}
85
86template<storm::dd::DdType Type>
88 return this->truthValues == this->states;
89}
90
91template<storm::dd::DdType Type>
93 return this->truthValues.getNonZeroCount();
94}
95
96template<storm::dd::DdType Type>
97std::ostream& SymbolicQualitativeCheckResult<Type>::writeToStream(std::ostream& out) const {
98 if (states.getNonZeroCount() == 1) {
99 if (truthValues.isZero()) {
100 out << "false";
101 } else {
102 out << "true";
103 }
104 } else if (states == truthValues) {
105 out << "{true}\n";
106 } else {
107 if (truthValues.isZero()) {
108 out << "{false}\n";
109 } else {
110 out << "{true, false}\n";
111 }
112 }
113 return out;
114}
115
116template<storm::dd::DdType Type>
118 STORM_LOG_THROW(filter.isSymbolicQualitativeCheckResult(), storm::exceptions::InvalidOperationException,
119 "Cannot filter symbolic check result with non-symbolic filter.");
120 this->states &= filter.asSymbolicQualitativeCheckResult<Type>().getTruthValuesVector();
121 ;
122 this->truthValues &= filter.asSymbolicQualitativeCheckResult<Type>().getTruthValuesVector();
123 this->states &= filter.asSymbolicQualitativeCheckResult<Type>().getTruthValuesVector();
124}
125
128} // namespace modelchecker
129} // namespace storm
bool isZero() const
Retrieves whether this DD represents the constant zero function.
Definition Bdd.cpp:547
virtual bool isSymbolicQualitativeCheckResult() const
SymbolicQualitativeCheckResult< Type > & asSymbolicQualitativeCheckResult()
virtual void filter(QualitativeCheckResult const &filter) override
Filters the current result wrt.
virtual std::unique_ptr< CheckResult > clone() const override
virtual QualitativeCheckResult & operator&=(QualitativeCheckResult const &other) override
virtual QualitativeCheckResult & operator|=(QualitativeCheckResult const &other) override
virtual std::ostream & writeToStream(std::ostream &out) const override
#define STORM_LOG_THROW(cond, exception, message)
Definition macros.h:30
LabParser.cpp.
Definition cli.cpp:18