libTriton  version 0.7 build 1407
solverModel.cpp
Go to the documentation of this file.
1 /*
3 ** Copyright (C) - Triton
4 **
5 ** This program is under the terms of the BSD License.
6 */
7 
8 #include <cstdlib>
9 
10 #include <triton/solverModel.hpp>
11 #include <triton/symbolicEnums.hpp>
12 
13 
14 
15 namespace triton {
16  namespace engines {
17  namespace solver {
18 
20  this->value = 0;
21  }
22 
23 
25  this->value = value;
26  this->variable = variable;
27  }
28 
29 
31  this->copy(other);
32  }
33 
34 
35  void SolverModel::copy(const SolverModel& other) {
36  this->value = other.value;
37  this->variable = other.variable;
38  }
39 
40 
42  return this->variable->getId();
43  }
44 
45 
47  return this->value;
48  }
49 
50 
52  return this->variable;
53  }
54 
55 
57  this->copy(other);
58  return *this;
59  }
60 
61 
62  std::ostream& operator<<(std::ostream& stream, const SolverModel& model) {
63  stream << model.getVariable() << " = 0x" << std::hex << model.getValue() << std::dec;
64  return stream;
65  }
66 
67 
68  std::ostream& operator<<(std::ostream& stream, const SolverModel* model) {
69  stream << *model;
70  return stream;
71  }
72 
73  };
74  };
75 };
TRITON_EXPORT triton::usize getId(void) const
Returns the id of the variable.
Definition: solverModel.cpp:41
TRITON_EXPORT const triton::engines::symbolic::SharedSymbolicVariable & getVariable(void) const
Returns the symbolic variable.
Definition: solverModel.cpp:51
std::ostream & operator<<(std::ostream &stream, const SolverModel &model)
Display a solver model.
Definition: solverModel.cpp:62
The Triton namespace.
Definition: api.cpp:225
TRITON_EXPORT triton::uint512 getValue(void) const
Returns the value of the model.
Definition: solverModel.cpp:46
TRITON_EXPORT SolverModel()
Constructor.
Definition: solverModel.cpp:19
TRITON_EXPORT SolverModel & operator=(const SolverModel &other)
Copies a SolverModel.
Definition: solverModel.cpp:56
This class is used to represent a constraint model solved.
Definition: solverModel.hpp:42
std::shared_ptr< triton::engines::symbolic::SymbolicVariable > SharedSymbolicVariable
Shared Symbolic variable.
Definition: ast.hpp:42
triton::uint512 value
The value of the model.
Definition: solverModel.hpp:48
boost::multiprecision::uint512_t uint512
unsigned 512-bits
Definition: tritonTypes.hpp:43
std::size_t usize
unsigned MAX_INT 32 or 64 bits according to the CPU.
Definition: tritonTypes.hpp:67
triton::engines::symbolic::SharedSymbolicVariable variable
The symbolic variable.
Definition: solverModel.hpp:45