Storm 1.14.0.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
Formula.h
Go to the documentation of this file.
1#pragma once
2
3#include <boost/optional.hpp>
4#include <map>
5
9
10namespace storm {
11namespace prism {
13 public:
22 Formula(storm::expressions::Variable const& variable, storm::expressions::Expression const& expression, std::string const& filename = "",
23 uint_fast64_t lineNumber = 0);
24
33 Formula(std::string const& name, storm::expressions::Expression const& expression, std::string const& filename = "", uint_fast64_t lineNumber = 0);
34
42 Formula(std::string const& name, std::string const& filename = "", uint_fast64_t lineNumber = 0);
43
44 // Create default implementations of constructors/assignment.
45 Formula() = default;
46 Formula(Formula const& other) = default;
47 Formula& operator=(Formula const& other) = default;
48 Formula(Formula&& other) = default;
49 Formula& operator=(Formula&& other) = default;
50
56 std::string const& getName() const;
57
62 bool hasExpressionVariable() const;
63
70
77
83 storm::expressions::Type const& getType() const;
84
92 Formula substitute(std::map<storm::expressions::Variable, storm::expressions::Expression> const& substitution) const;
94
95 friend std::ostream& operator<<(std::ostream& stream, Formula const& formula);
96
97 private:
98 // The name of the formula.
99 std::string name;
100
101 // Expression variable that is used as a placeholder for this formula
102 boost::optional<storm::expressions::Variable> variable;
103
104 // A predicate that needs to be satisfied by states for the label to be attached.
106};
107} // namespace prism
108} // namespace storm
Formula(storm::expressions::Variable const &variable, storm::expressions::Expression const &expression, std::string const &filename="", uint_fast64_t lineNumber=0)
Creates a formula with the given placeholder variable and expression.
Definition Formula.cpp:5
Formula(Formula const &other)=default
Formula substituteNonStandardPredicates() const
Definition Formula.cpp:52
Formula & operator=(Formula &&other)=default
friend std::ostream & operator<<(std::ostream &stream, Formula const &formula)
Definition Formula.cpp:61
storm::expressions::Expression const & getExpression() const
Retrieves the expression that is associated with this formula.
Definition Formula.cpp:32
bool hasExpressionVariable() const
Retrieves wheter a placeholder variable is used in expressions to represent this formula.
Definition Formula.cpp:24
Formula substitute(std::map< storm::expressions::Variable, storm::expressions::Expression > const &substitution) const
Substitutes all variables in the expression of the formula according to the given map.
Definition Formula.cpp:43
Formula(Formula &&other)=default
std::string const & getName() const
Retrieves the name that is associated with this formula.
Definition Formula.cpp:20
Formula & operator=(Formula const &other)=default
storm::expressions::Type const & getType() const
Retrieves the return type of the formula, i.e., the return-type of the defining expression.
Definition Formula.cpp:36
storm::expressions::Variable const & getExpressionVariable() const
Retrieves the placeholder variable that is used in expressions to represent this formula.
Definition Formula.cpp:28
LocatedInformation(std::string const &filename, uint_fast64_t lineNumber)
Constructs a located information with the given filename and line number.