libTriton version 1.0 build 1592
Loading...
Searching...
No Matches
Topics | Namespaces | Classes | Typedefs | Enumerations | Functions
Collaboration diagram for Ast:

Topics

 Representations
 

Namespaces

namespace  triton::ast::representations
 The Representations namespace.
 

Classes

class  triton::ast::AbstractNode
 Abstract node. More...
 
class  triton::ast::ArrayNode
 (Array (_ BitVec indexSize) (_ BitVec 8)) node More...
 
class  triton::ast::AssertNode
 (assert <expr>) node More...
 
class  triton::ast::BswapNode
 (bswap <expr>) node More...
 
class  triton::ast::BvaddNode
 (bvadd <expr1> <expr2>) node More...
 
class  triton::ast::BvandNode
 (bvand <expr1> <expr2>) node More...
 
class  triton::ast::BvashrNode
 (bvashr <expr1> <expr2>) node More...
 
class  triton::ast::BvlshrNode
 (bvlshr <expr1> <expr2>) node More...
 
class  triton::ast::BvmulNode
 (bvmul <expr1> <expr2>) node More...
 
class  triton::ast::BvnandNode
 (bvnand <expr1> <expr2>) node More...
 
class  triton::ast::BvnegNode
 (bvneg <expr>) node More...
 
class  triton::ast::BvnorNode
 (bvnor <expr1> <expr2>) node More...
 
class  triton::ast::BvnotNode
 (bvnot <expr>) node More...
 
class  triton::ast::BvorNode
 (bvor <expr1> <expr2>) node More...
 
class  triton::ast::BvrolNode
 ((_ rotate_left rot) <expr>) node More...
 
class  triton::ast::BvrorNode
 ((_ rotate_right rot) <expr>) node More...
 
class  triton::ast::BvsdivNode
 (bvsdiv <expr1> <expr2>) node More...
 
class  triton::ast::BvsgeNode
 (bvsge <expr1> <expr2>) node More...
 
class  triton::ast::BvsgtNode
 (bvsgt <expr1> <expr2>) node More...
 
class  triton::ast::BvshlNode
 (bvshl <expr1> <expr2>) node More...
 
class  triton::ast::BvsleNode
 (bvsle <expr1> <expr2>) node More...
 
class  triton::ast::BvsltNode
 (bvslt <expr1> <expr2>) node More...
 
class  triton::ast::BvsmodNode
 (bvsmod <expr1> <expr2>) node More...
 
class  triton::ast::BvsremNode
 (bvsrem <expr1> <expr2>) node More...
 
class  triton::ast::BvsubNode
 (bvsub <expr1> <expr2>) node More...
 
class  triton::ast::BvudivNode
 (bvudiv <expr1> <expr2>) node More...
 
class  triton::ast::BvugeNode
 (bvuge <expr1> <expr2>) node More...
 
class  triton::ast::BvugtNode
 (bvugt <expr1> <expr2>) node More...
 
class  triton::ast::BvuleNode
 (bvule <expr1> <expr2>) node More...
 
class  triton::ast::BvultNode
 (bvult <expr1> <expr2>) node More...
 
class  triton::ast::BvuremNode
 (bvurem <expr1> <expr2>) node More...
 
class  triton::ast::BvxnorNode
 (bvxnor <expr1> <expr2>) node More...
 
class  triton::ast::BvxorNode
 (bvxor <expr1> <expr2>) node More...
 
class  triton::ast::BvNode
 (_ bv<value> <size>) node More...
 
class  triton::ast::CompoundNode
 [<expr1> <expr2> <expr3> ...] node More...
 
class  triton::ast::ConcatNode
 (concat <expr1> <expr2> ...) node More...
 
class  triton::ast::DeclareNode
 (declare-fun <var_name> () (_ BitVec <var_size>)) node More...
 
class  triton::ast::DistinctNode
 (distinct <expr1> <expr2> ...) node More...
 
class  triton::ast::EqualNode
 (= <expr1> <expr2> ...) node More...
 
class  triton::ast::ExtractNode
 ((_ extract <high> <low>) <expr>) node More...
 
class  triton::ast::ForallNode
 (forall ((x (_ BitVec <size>)), ...) body) More...
 
class  triton::ast::IffNode
 (iff <expr1> <expr2>) More...
 
class  triton::ast::IntegerNode
 Integer node. More...
 
class  triton::ast::IteNode
 (ite <ifExpr> <thenExpr> <elseExpr>) More...
 
class  triton::ast::LandNode
 (and <expr1> <expr2>) More...
 
class  triton::ast::LetNode
 (let ((<alias> <expr2>)) <expr3>) More...
 
class  triton::ast::LnotNode
 (lnot <expr>) More...
 
class  triton::ast::LorNode
 (or <expr1> <expr2>) More...
 
class  triton::ast::LxorNode
 (xor <expr1> <expr2>) More...
 
class  triton::ast::ReferenceNode
 Reference node. More...
 
class  triton::ast::SelectNode
 (select array index) More...
 
class  triton::ast::StoreNode
 (store array index expr) More...
 
class  triton::ast::StringNode
 String node. More...
 
class  triton::ast::SxNode
 ((_ sign_extend sizeExt) <expr>) node More...
 
class  triton::ast::VariableNode
 Variable node. More...
 
class  triton::ast::ZxNode
 ((_ zero_extend sizeExt) <expr>) node More...
 
class  triton::ast::AstContext
 AST Context - Used as AST builder. More...
 
class  triton::ast::LLVMToTriton
 Converts a LLVM IR to a Triton AST. More...
 
class  triton::ast::TritonToBitwuzla
 Converts a Triton's AST to Bitwuzla's AST. More...
 
class  triton::ast::TritonToLLVM
 Converts a Triton's AST to LVM IR. More...
 
class  triton::ast::TritonToZ3
 Converts a Triton's AST to Z3's AST. More...
 
class  triton::ast::Z3ToTriton
 Converts a Z3's AST to a Triton's AST. More...
 

Typedefs

using triton::ast::SharedAbstractNode = std::shared_ptr<triton::ast::AbstractNode>
 Shared Abstract Node.
 
using triton::ast::WeakAbstractNode = std::weak_ptr<triton::ast::AbstractNode>
 Weak Abstract Node.
 
using triton::ast::SharedAstContext = std::shared_ptr<triton::ast::AstContext>
 Shared AST context.
 

Enumerations

enum  triton::ast::ast_e {
  triton::ast::INVALID_NODE = 0 , triton::ast::ANY_NODE = 0 , triton::ast::ASSERT_NODE = 3 , triton::ast::BSWAP_NODE = 5 ,
  triton::ast::BVADD_NODE = 7 , triton::ast::BVAND_NODE = 13 , triton::ast::BVASHR_NODE = 17 , triton::ast::BVLSHR_NODE = 19 ,
  triton::ast::BVMUL_NODE = 23 , triton::ast::BVNAND_NODE = 29 , triton::ast::BVNEG_NODE = 31 , triton::ast::BVNOR_NODE = 37 ,
  triton::ast::BVNOT_NODE = 41 , triton::ast::BVOR_NODE = 43 , triton::ast::BVROL_NODE = 47 , triton::ast::BVROR_NODE = 53 ,
  triton::ast::BVSDIV_NODE = 59 , triton::ast::BVSGE_NODE = 61 , triton::ast::BVSGT_NODE = 67 , triton::ast::BVSHL_NODE = 71 ,
  triton::ast::BVSLE_NODE = 73 , triton::ast::BVSLT_NODE = 79 , triton::ast::BVSMOD_NODE = 83 , triton::ast::BVSREM_NODE = 89 ,
  triton::ast::BVSUB_NODE = 97 , triton::ast::BVUDIV_NODE = 101 , triton::ast::BVUGE_NODE = 103 , triton::ast::BVUGT_NODE = 107 ,
  triton::ast::BVULE_NODE = 109 , triton::ast::BVULT_NODE = 113 , triton::ast::BVUREM_NODE = 127 , triton::ast::BVXNOR_NODE = 131 ,
  triton::ast::BVXOR_NODE = 137 , triton::ast::BV_NODE = 139 , triton::ast::COMPOUND_NODE = 149 , triton::ast::CONCAT_NODE = 151 ,
  triton::ast::DECLARE_NODE = 157 , triton::ast::DISTINCT_NODE = 163 , triton::ast::EQUAL_NODE = 167 , triton::ast::EXTRACT_NODE = 173 ,
  triton::ast::FORALL_NODE = 179 , triton::ast::IFF_NODE = 181 , triton::ast::INTEGER_NODE = 191 , triton::ast::ITE_NODE = 193 ,
  triton::ast::LAND_NODE = 197 , triton::ast::LET_NODE = 199 , triton::ast::LNOT_NODE = 211 , triton::ast::LOR_NODE = 223 ,
  triton::ast::LXOR_NODE = 227 , triton::ast::REFERENCE_NODE = 229 , triton::ast::STRING_NODE = 233 , triton::ast::SX_NODE = 239 ,
  triton::ast::VARIABLE_NODE = 241 , triton::ast::ZX_NODE = 251 , triton::ast::ARRAY_NODE = 257 , triton::ast::SELECT_NODE = 263 ,
  triton::ast::STORE_NODE = 269
}
 

Functions

triton::uint512 triton::ast::hash2n (triton::uint512 hash, triton::uint32 n)
 Custom hash2n function for hash routine.
 
triton::uint512 triton::ast::rotl (const triton::uint512 &value, triton::uint32 shift)
 Custom rotate left function for hash routine.
 
triton::sint512 triton::ast::modularSignExtend (AbstractNode *node)
 Custom modular sign extend for bitwise operation.
 
std::ostream & triton::ast::operator<< (std::ostream &stream, AbstractNode *node)
 Displays the node in ast representation.
 
SharedAbstractNode triton::ast::newInstance (AbstractNode *node, bool unroll=false)
 AST C++ API - Duplicates the AST.
 
SharedAbstractNode triton::ast::unroll (const SharedAbstractNode &node)
 AST C++ API - Unrolls the SSA form of a given AST.
 
std::vector< SharedAbstractNodetriton::ast::childrenExtraction (const SharedAbstractNode &node, bool unroll, bool revert)
 Returns node and all its children of an AST sorted topologically. If unroll is true, references are unrolled. If revert is true, children are on top of list.
 
std::vector< SharedAbstractNodetriton::ast::parentsExtraction (const SharedAbstractNode &node, bool revert)
 Returns node and all its parents of an AST sorted topologically. If revert is true, oldest parents are on top of list.
 
std::deque< SharedAbstractNodetriton::ast::search (const SharedAbstractNode &node, triton::ast::ast_e match=ANY_NODE)
 Returns a deque of collected matched nodes via a depth-first pre order traversal.
 
SharedAbstractNode triton::ast::dereference (const SharedAbstractNode &node)
 Returns the first non referene node encountered.
 
triton::uint32 triton::ast::getIndexSize (const SharedAbstractNode &node)
 Gets the index size of an array.
 
template<typename T >
triton::ast::getInteger (const SharedAbstractNode &node)
 Gets the value of an integer node.
 
template<>
std::string triton::ast::getInteger (const SharedAbstractNode &node)
 std::string specialization
 

Detailed Description

Typedef Documentation

◆ SharedAbstractNode

Shared Abstract Node.

Definition at line 59 of file ast.hpp.

◆ SharedAstContext

typedef std::shared_ptr< triton::ast::AstContext > triton::ast::SharedAstContext = std::shared_ptr<triton::ast::AstContext>

Shared AST context.

Definition at line 65 of file ast.hpp.

◆ WeakAbstractNode

Weak Abstract Node.

Definition at line 62 of file ast.hpp.

Enumeration Type Documentation

◆ ast_e

Enumerates all types of node. Must be prime numbers.

Enumerator
INVALID_NODE 

Invalid node

ANY_NODE 

Any node

ASSERT_NODE 

(assert x)

BSWAP_NODE 

(bswap x)

BVADD_NODE 

(bvadd x y)

BVAND_NODE 

(bvand x y)

BVASHR_NODE 

(bvashr x y)

BVLSHR_NODE 

(bvlshr x y)

BVMUL_NODE 

(bvmul x y)

BVNAND_NODE 

(bvnand x y)

BVNEG_NODE 

(bvneg x)

BVNOR_NODE 

(bvnor x y)

BVNOT_NODE 

(bvnot x)

BVOR_NODE 

(bvor x y)

BVROL_NODE 

((_ rotate_left x) y)

BVROR_NODE 

((_ rotate_right x) y)

BVSDIV_NODE 

(bvsdiv x y)

BVSGE_NODE 

(bvsge x y)

BVSGT_NODE 

(bvsgt x y)

BVSHL_NODE 

(bvshl x y)

BVSLE_NODE 

(bvsle x y)

BVSLT_NODE 

(bvslt x y)

BVSMOD_NODE 

(bvsmod x y)

BVSREM_NODE 

(bvsrem x y)

BVSUB_NODE 

(bvsub x y)

BVUDIV_NODE 

(bvudiv x y)

BVUGE_NODE 

(bvuge x y)

BVUGT_NODE 

(bvugt x y)

BVULE_NODE 

(bvule x y)

BVULT_NODE 

(bvult x y)

BVUREM_NODE 

(bvurem x y)

BVXNOR_NODE 

(bvxnor x y)

BVXOR_NODE 

(bvxor x y)

BV_NODE 

(_ bvx y)

COMPOUND_NODE 

A compound of nodes

CONCAT_NODE 

(concat x y z ...)

DECLARE_NODE 

(declare-fun <var_name> () (_ BitVec <var_size>))

DISTINCT_NODE 

(distinct x y)

EQUAL_NODE 

(= x y)

EXTRACT_NODE 

((_ extract x y) z)

FORALL_NODE 

(forall ((x (_ BitVec <size>)), ...) body)

IFF_NODE 

(iff x y)

INTEGER_NODE 

Integer node

ITE_NODE 

(ite x y z)

LAND_NODE 

(and x y)

LET_NODE 

(let ((x y)) z)

LNOT_NODE 

(and x y)

LOR_NODE 

(or x y)

LXOR_NODE 

(xor x y)

REFERENCE_NODE 

Reference node

STRING_NODE 

String node

SX_NODE 

((_ sign_extend x) y)

VARIABLE_NODE 

Variable node

ZX_NODE 

((_ zero_extend x) y)

ARRAY_NODE 

(Array (_ BitVec addrSize) (_ BitVec 8))

SELECT_NODE 

(select array index)

STORE_NODE 

(store array index expr)

Definition at line 29 of file astEnums.hpp.

Function Documentation

◆ childrenExtraction()

TRITON_EXPORT std::vector< SharedAbstractNode > triton::ast::childrenExtraction ( const SharedAbstractNode & node,
bool unroll,
bool revert )

Returns node and all its children of an AST sorted topologically. If unroll is true, references are unrolled. If revert is true, children are on top of list.

Definition at line 3700 of file ast.cpp.

◆ dereference()

TRITON_EXPORT SharedAbstractNode triton::ast::dereference ( const SharedAbstractNode & node)

Returns the first non referene node encountered.

Definition at line 3743 of file ast.cpp.

◆ getIndexSize()

triton::uint32 triton::ast::getIndexSize ( const SharedAbstractNode & node)

Gets the index size of an array.

Definition at line 3755 of file ast.cpp.

◆ getInteger() [1/2]

template<typename T >
T triton::ast::getInteger ( const SharedAbstractNode & node)
inline

Gets the value of an integer node.

Definition at line 937 of file ast.hpp.

◆ getInteger() [2/2]

template<>
std::string triton::ast::getInteger ( const SharedAbstractNode & node)
inline

std::string specialization

Definition at line 945 of file ast.hpp.

◆ hash2n()

triton::uint512 triton::ast::hash2n ( triton::uint512 hash,
triton::uint32 n )

Custom hash2n function for hash routine.

Definition at line 3476 of file ast.cpp.

◆ modularSignExtend()

triton::sint512 triton::ast::modularSignExtend ( AbstractNode * node)

Custom modular sign extend for bitwise operation.

Definition at line 3491 of file ast.cpp.

◆ newInstance()

TRITON_EXPORT SharedAbstractNode triton::ast::newInstance ( AbstractNode * node,
bool unroll )

AST C++ API - Duplicates the AST.

Definition at line 3604 of file ast.cpp.

◆ operator<<()

TRITON_EXPORT std::ostream & triton::ast::operator<< ( std::ostream & stream,
AbstractNode * node )

Displays the node in ast representation.

Definition at line 3462 of file ast.cpp.

◆ parentsExtraction()

TRITON_EXPORT std::vector< SharedAbstractNode > triton::ast::parentsExtraction ( const SharedAbstractNode & node,
bool revert )

Returns node and all its parents of an AST sorted topologically. If revert is true, oldest parents are on top of list.

Definition at line 3705 of file ast.cpp.

◆ rotl()

triton::uint512 triton::ast::rotl ( const triton::uint512 & value,
triton::uint32 shift )

Custom rotate left function for hash routine.

Definition at line 3484 of file ast.cpp.

◆ search()

TRITON_EXPORT std::deque< SharedAbstractNode > triton::ast::search ( const SharedAbstractNode & node,
triton::ast::ast_e match )

Returns a deque of collected matched nodes via a depth-first pre order traversal.

Definition at line 3710 of file ast.cpp.

◆ unroll()

TRITON_EXPORT SharedAbstractNode triton::ast::unroll ( const triton::ast::SharedAbstractNode & node)

AST C++ API - Unrolls the SSA form of a given AST.

Definition at line 3626 of file ast.cpp.