libTriton version 1.0 build 1592
Loading...
Searching...
No Matches
synthesizer.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_SYNTHESIZER_HPP
9#define TRITON_SYNTHESIZER_HPP
10
11#include <array>
12#include <deque>
13#include <map>
14
15#include <triton/astContext.hpp>
16#include <triton/dllexport.hpp>
22
23
24
26namespace triton {
33 namespace engines {
41 namespace synthesis {
49 namespace oracles {
57 extern std::map<triton::ast::ast_e, std::array<UnaryEntry, 40>> unopTable;
58
60 extern std::map<triton::ast::ast_e, std::array<BinaryEntry, 40>> binopTable;
61
63 };
64
66
68 private:
70 std::map<triton::uint512, triton::ast::SharedAbstractNode> hash2var;
71
73 std::map<triton::ast::SharedAbstractNode, triton::ast::SharedAbstractNode> var2expr;
74
77
80
82 bool constantSynthesis(const std::deque<triton::ast::SharedAbstractNode>& vars, const triton::ast::SharedAbstractNode& node, SynthesisResult& result);
83
85 bool opaqueConstantSynthesis(const std::deque<triton::ast::SharedAbstractNode>& vars, const triton::ast::SharedAbstractNode& node, SynthesisResult& result);
86
88 bool unaryOperatorSynthesis(const std::deque<triton::ast::SharedAbstractNode>& vars, const triton::ast::SharedAbstractNode& node, SynthesisResult& result);
89
91 bool binaryOperatorSynthesis(const std::deque<triton::ast::SharedAbstractNode>& vars, const triton::ast::SharedAbstractNode& node, SynthesisResult& result);
92
94 bool childrenSynthesis(const triton::ast::SharedAbstractNode& node, bool constant, bool opaque, SynthesisResult& result);
95
97 bool do_synthesize(const triton::ast::SharedAbstractNode& node, bool constant, bool opaque, SynthesisResult& result);
98
100 triton::ast::SharedAbstractNode symbolizeSubExpression(const triton::ast::SharedAbstractNode& node, SynthesisResult& tmpResult);
101
103 void substituteSubExpression(const triton::ast::SharedAbstractNode& node);
104
105 public:
108
110 TRITON_EXPORT SynthesisResult synthesize(const triton::ast::SharedAbstractNode& node, bool constant=true, bool subexpr=true, bool opaque=false);
111 };
112
114 };
116 };
118};
119
120#endif /* TRITON_SYNTHESIZER_HPP */
This class is used to interface with solvers.
The SynthesisResult engine class.
The Synthesizer engine class.
TRITON_EXPORT SynthesisResult synthesize(const triton::ast::SharedAbstractNode &node, bool constant=true, bool subexpr=true, bool opaque=false)
Synthesizes a given node. If constant is true, perform a constant synthesis. If opaque is true,...
TRITON_EXPORT Synthesizer(triton::engines::symbolic::SymbolicEngine *symbolic)
Constructor.
std::shared_ptr< triton::ast::AbstractNode > SharedAbstractNode
Shared Abstract Node.
Definition ast.hpp:59
std::map< triton::ast::ast_e, std::array< UnaryEntry, 40 > > unopTable
The oracle table for unary operators. Each entry is a UnaryEntry object.
std::map< triton::ast::ast_e, std::array< BinaryEntry, 40 > > binopTable
The oracle table for binary operators. Each entry is a BinaryEntry object.
The Triton namespace.