libTriton version 1.0 build 1588
Loading...
Searching...
No Matches
oracleEntry.hpp
Go to the documentation of this file.
1
2/*
3** Copyright (C) - Triton
4**
5** This program is under the terms of the Apache License 2.0.
6*/
7
8#ifndef TRITON_ORACLEENTRY_HPP
9#define TRITON_ORACLEENTRY_HPP
10
11#include <triton/ast.hpp>
12#include <triton/dllexport.hpp>
14
15
16
18namespace triton {
25 namespace engines {
33 namespace synthesis {
41
43 public:
46
55
58 : op(op), position(position) {
59 };
60 };
61
63
64 class UnaryEntry {
65 public:
68
71
74
77 : bits(bits), x(x), r(r) {
78 };
79 };
80
82
84 public:
87
90
93
96
99 : bits(bits), x(x), y(y), r(r) {
100 };
101 };
102
128 template<std::size_t N>
130 public:
139 std::array<triton::ast::ast_e, N> ops;
140
151 std::array<triton::uint8, N + 1> vars;
152
154 OpEncoding(std::array<triton::ast::ast_e, N> ops, std::array<triton::uint8, N + 1> vars)
155 : ops(ops), vars(vars) {
156 }
157 };
158
160 template<std::size_t N>
161 bool operator<(const OpEncoding<N>& obj1, const OpEncoding<N>& obj2) {
162 return (&obj1 < &obj2);
163 }
164
166 };
168 };
170};
171
172#endif /* TRITON_ORACLEENTRY_HPP */
Entry of the oracle table for binary operators synthesis.
Definition: oracleEntry.hpp:83
triton::uint32 bits
Size of the oracle.
Definition: oracleEntry.hpp:86
TRITON_EXPORT BinaryEntry(triton::uint8 bits, triton::uint64 x, triton::uint64 y, triton::uint64 r)
Constructor.
Definition: oracleEntry.hpp:98
triton::uint64 r
Result of x <op> y.
Definition: oracleEntry.hpp:95
Entry of the oracle table for constant synthesis.
Definition: oracleEntry.hpp:42
triton::uint8 position
Constant position in the AST.
Definition: oracleEntry.hpp:54
TRITON_EXPORT ConstantEntry(triton::uint8 position, const triton::ast::SharedAbstractNode &op)
Constructor.
Definition: oracleEntry.hpp:57
triton::ast::SharedAbstractNode op
AST operator.
Definition: oracleEntry.hpp:45
This class is used to encode operators and variables ordering.
OpEncoding(std::array< triton::ast::ast_e, N > ops, std::array< triton::uint8, N+1 > vars)
Constructor.
std::array< triton::uint8, N+1 > vars
Ordering of variables.
std::array< triton::ast::ast_e, N > ops
Ordering of operators.
Entry of the oracle table for unary operators synthesis.
Definition: oracleEntry.hpp:64
triton::uint32 bits
Size of the oracle.
Definition: oracleEntry.hpp:67
TRITON_EXPORT UnaryEntry(triton::uint8 bits, triton::uint64 x, triton::uint64 r)
Constructor.
Definition: oracleEntry.hpp:76
triton::uint64 r
Result of <op>(x)
Definition: oracleEntry.hpp:73
std::shared_ptr< triton::ast::AbstractNode > SharedAbstractNode
Shared Abstract Node.
Definition: ast.hpp:59
bool operator<(const OpEncoding< N > &obj1, const OpEncoding< N > &obj2)
Operator implementation in order to use OpEncoding as key in a std::map.
std::uint64_t uint64
unisgned 64-bits
Definition: tritonTypes.hpp:42
std::uint32_t uint32
unisgned 32-bits
Definition: tritonTypes.hpp:39
std::uint8_t uint8
unisgned 8-bits
Definition: tritonTypes.hpp:33
The Triton namespace.