Storm 1.14.0.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
GraphConditions.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstddef>
4#include <memory>
5#include <set>
6#include <unordered_map>
7#include <vector>
8
14
15namespace storm {
16namespace expressions {
18}
19namespace analysis {
20
35 public:
39 using ConstraintSet = std::vector<storm::expressions::Expression>;
40
41 private:
46 using ConstraintIndex = std::unordered_map<std::size_t, ConstraintSet>;
47
48 // The expression manager owning the collected constraints.
49 std::shared_ptr<storm::expressions::ExpressionManager> expressionManager;
50
51 // Hashes expressions by their structure, so that they can be deduplicated and looked up.
53
54 // A set of constraints that says that the DTMC actually has valid probability distributions in all states.
55 ConstraintSet wellformedConstraintSet;
56
57 // An index over the wellformed constraints. It mirrors wellformedConstraintSet.
58 ConstraintIndex wellformedConstraintIndex;
59
60 // A set of constraints that makes sure that the underlying graph of the model does not change depending
61 // on the parameter values.
62 ConstraintSet graphPreservingConstraintSet;
63
64 // An index over the graph preserving constraints. It mirrors graphPreservingConstraintSet.
65 ConstraintIndex graphPreservingConstraintIndex;
66
67 // A set of variables
68 std::set<storm::RationalFunctionVariable> variableSet;
69
86 storm::expressions::Expression relateToZero(storm::RawPolynomial const& polynomial, storm::expressions::RelationType relation) const;
87
96 bool addConstraint(ConstraintSet& constraintSet, ConstraintIndex& constraintIndex, storm::expressions::Expression const& constraint);
97
103 void wellformedRequiresNonNegativeEntries(storm::RationalFunction const& value);
104
112 void wellformedRequiresAtMostOne(storm::RationalFunction const& value);
113
120 void graphPreservingRequiresNonZero(storm::RationalFunction const& value);
121
128
129 public:
137
144
151
156 std::set<storm::RationalFunctionVariable> const& getVariables() const;
157
164};
165
166} // namespace analysis
167} // namespace storm
ConstraintSet const & getGraphPreservingConstraints() const
Returns the set of graph-preserving constraints.
std::set< storm::RationalFunctionVariable > const & getVariables() const
Returns the set of variables in the model.
ConstraintCollector(storm::models::sparse::Model< storm::RationalFunction > const &model)
Constructs a constraint collector for the given model.
void operator()(storm::models::sparse::Model< storm::RationalFunction > const &model)
Constructs the constraints for the given model by calling the process method.
ConstraintSet const & getWellformedConstraints() const
Returns the set of wellformed-ness constraints.
std::vector< storm::expressions::Expression > ConstraintSet
The type of the collected constraints.
This class is responsible for managing a set of typed variables and all expressions using these varia...
Computes a hash of an expression such that syntactically equal expressions hash to the same value.
Definition HashVisitor.h:21
Base class for all sparse models.
Definition Model.h:34
RelationType
An enum type specifying the different relations applicable.
carl::RationalFunction< Polynomial, true > RationalFunction
carl::MultivariatePolynomial< RationalFunctionCoefficient > RawPolynomial
void process()