Inter4ql  5.2
Result.h
1 #ifndef __RESULT_H__
2 #define __RESULT_H__
3 
4 #include "Types.h"
5 #include "Valuation.h"
6 
7 #include <utility>
8 #include <map>
9 #include <string>
10 #include <memory>
11 #include <vector>
12 
13 namespace Inter4ql {
14 
15  class Value;
16  class Result {
17  public:
18  Result();
19  explicit Result(std::vector<std::string> names);
20  explicit Result(std::vector<std::string> names, Valuation valuation);
21  ~Result();
22 
23  const std::vector<std::string>& get_variable_names() const;
24  const Valuation& get_valuation() const;
25  Valuation& get_valuation_destructive();
26 
33  bool add_element(const std::vector<Value*>& vect, logic_type::type value);
38  void add_variable_name(const std::string name);
44  void sum_Results_OP(Result& other, operation_type::type operation);
48  void negate();
53  Result* trim_variables(std::vector<std::string> names);
59  void apply_operation(operation_type::type operation, logic_type::type value);
65  std::string print(bool type = false, bool unknown = false);
66  private:
67 
68  std::vector<std::string> variable_names;
69  Valuation valuation;
70  static Value dummy_plug;
71  };
72 }
73 
74 #endif /* __RESULT_H__ */
75 
std::string print(bool type=false, bool unknown=false)
prints Result
Definition: Result.cc:383
type
Enumeration type for four-valued logic.
Definition: Types.h:45
bool add_element(const std::vector< Value *> &vect, logic_type::type value)
adds element to result
Definition: Result.cc:28
void negate()
negates all logic values
Definition: Result.cc:323
void sum_Results_OP(Result &other, operation_type::type operation)
merges another Result into current one
Definition: Result.cc:69
Definition: Result.h:16
Definition: Application.cc:37
Result * trim_variables(std::vector< std::string > names)
restricts result to only some variables
Definition: Result.cc:330
void add_variable_name(const std::string name)
adds variable name to result
Definition: Result.cc:44
Definition: Valuation.h:11
Value class that handles different types of data.
Definition: Value.h:11
void apply_operation(operation_type::type operation, logic_type::type value)
applies operation to all logic values in valuation
Definition: Result.cc:48