Storm 1.14.0.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
SimpleValuation.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4#include <set>
5#include <vector>
6
10
11namespace storm {
12namespace expressions {
13
17class SimpleValuation : public Valuation {
18 public:
21
26
32 SimpleValuation(std::shared_ptr<storm::expressions::ExpressionManager const> const& manager);
33
34 // Define deep-copy and move operators.
35 SimpleValuation(SimpleValuation const& other);
39
46 bool operator==(SimpleValuation const& other) const;
47
48 // Override virtual functions of base class.
49 virtual bool getBooleanValue(Variable const& booleanVariable) const override;
50 virtual void setBooleanValue(Variable const& booleanVariable, bool value) override;
51 virtual int_fast64_t getIntegerValue(Variable const& integerVariable) const override;
52 virtual int_fast64_t getBitVectorValue(Variable const& bitVectorVariable) const override;
53 virtual void setIntegerValue(Variable const& integerVariable, int_fast64_t value) override;
54 virtual void setBitVectorValue(Variable const& bitVectorVariable, int_fast64_t value) override;
55 virtual double getRationalValue(Variable const& rationalVariable) const override;
56 virtual void setRationalValue(Variable const& rationalVariable, double value) override;
57
64 virtual std::string toPrettyString(std::set<storm::expressions::Variable> const& selectedVariables) const;
65
66 virtual std::string toString(bool pretty = true) const;
68
69 friend std::ostream& operator<<(std::ostream& out, SimpleValuation const& valuation);
70
71 private:
72 // Containers that store the values of the variables of the appropriate type.
73 std::vector<bool> booleanValues;
74 std::vector<int_fast64_t> integerValues;
75 std::vector<double> rationalValues;
76};
77
78std::ostream& operator<<(std::ostream& out, SimpleValuation const& valuation);
79
85 public:
86 std::size_t operator()(SimpleValuation* valuation) const;
87};
88
95 public:
96 bool operator()(SimpleValuation* valuation1, SimpleValuation* valuation2) const;
97};
98
105 public:
106 bool operator()(SimpleValuation* valuation1, SimpleValuation* valuation2) const;
107};
108} // namespace expressions
109} // namespace storm
A simple implementation of the valuation interface.
friend std::ostream & operator<<(std::ostream &out, SimpleValuation const &valuation)
virtual std::string toPrettyString(std::set< storm::expressions::Variable > const &selectedVariables) const
Returns a string representation of the valuation of the selected variables.
virtual void setIntegerValue(Variable const &integerVariable, int_fast64_t value) override
Sets the value of the given integer variable to the provided value.
virtual int_fast64_t getIntegerValue(Variable const &integerVariable) const override
Retrieves the value of the given integer variable.
virtual double getRationalValue(Variable const &rationalVariable) const override
Retrieves the value of the given rational variable.
bool operator==(SimpleValuation const &other) const
Checks whether the two valuations are semantically equivalent.
virtual void setBooleanValue(Variable const &booleanVariable, bool value) override
Sets the value of the given boolean variable to the provided value.
SimpleValuation & operator=(SimpleValuation const &other)
storm::json< storm::RationalNumber > toJson() const
virtual std::string toString(bool pretty=true) const
virtual bool getBooleanValue(Variable const &booleanVariable) const override
Retrieves the value of the given boolean variable.
SimpleValuation()
Creates an empty simple valuation that is associated to no manager and has no variables.
virtual void setRationalValue(Variable const &rationalVariable, double value) override
Sets the value of the given boolean variable to the provided value.
virtual int_fast64_t getBitVectorValue(Variable const &bitVectorVariable) const override
Retrieves the value of the given bit vector variable.
virtual void setBitVectorValue(Variable const &bitVectorVariable, int_fast64_t value) override
Sets the value of the given bit vector variable to the provided value.
A helper class that can be used as the comparison functor wrt.
bool operator()(SimpleValuation *valuation1, SimpleValuation *valuation2) const
A helper class that can pe used as the hash functor for data structures that need to hash valuations ...
std::size_t operator()(SimpleValuation *valuation) const
A helper class that can be used as the comparison functor wrt.
bool operator()(SimpleValuation *valuation1, SimpleValuation *valuation2) const
Valuation(std::shared_ptr< ExpressionManager const > const &manager)
Creates a valuation of all non-auxiliary variables managed by the given manager.
Definition Valuation.cpp:6
std::ostream & operator<<(std::ostream &stream, BaseExpression const &expression)
nlohmann::basic_json< std::map, std::vector, std::string, bool, int64_t, uint64_t, ValueType > json
Definition JsonForward.h:11