libTriton version 1.0 build 1592
Loading...
Searching...
No Matches
tritonToBitwuzla.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_TRITONTOBITWUZLA_H
9#define TRITON_TRITONTOBITWUZLA_H
10
11#include <map>
12#include <unordered_map>
13
14extern "C" {
15#include <bitwuzla/c/bitwuzla.h>
16}
17
18#include <triton/ast.hpp>
19#include <triton/dllexport.hpp>
21
22
23
25namespace triton {
32 namespace ast {
40
42 public:
44 TRITON_EXPORT TritonToBitwuzla(bool eval=false);
45
47 TRITON_EXPORT ~TritonToBitwuzla();
48
50 TRITON_EXPORT BitwuzlaTerm convert(const SharedAbstractNode& node, Bitwuzla* bzla);
51
53 TRITON_EXPORT const std::unordered_map<BitwuzlaTerm, triton::engines::symbolic::SharedSymbolicVariable>& getVariables(void) const;
54
56 TRITON_EXPORT const std::map<size_t, BitwuzlaSort>& getBitvectorSorts(void) const;
57
58 private:
60 std::unordered_map<SharedAbstractNode, BitwuzlaTerm> translatedNodes;
61
63 std::unordered_map<BitwuzlaTerm, triton::engines::symbolic::SharedSymbolicVariable> variables;
64
66 std::unordered_map<std::string, triton::ast::SharedAbstractNode> symbols;
67
69 std::map<size_t, BitwuzlaSort> bvSorts;
70
72 bool isEval;
73
75 BitwuzlaTerm translate(const SharedAbstractNode& node, Bitwuzla* bzla);
76 };
77
79 };
81};
82
83#endif /* TRITON_TRITONTOBITWUZLA_H */
Converts a Triton's AST to Bitwuzla's AST.
TRITON_EXPORT BitwuzlaTerm convert(const SharedAbstractNode &node, Bitwuzla *bzla)
Converts to Bitwuzla's AST.
TRITON_EXPORT const std::map< size_t, BitwuzlaSort > & getBitvectorSorts(void) const
Returns bitvector sorts.
TRITON_EXPORT ~TritonToBitwuzla()
Destructor.
TRITON_EXPORT const std::unordered_map< BitwuzlaTerm, triton::engines::symbolic::SharedSymbolicVariable > & getVariables(void) const
Returns symbolic variables and its assosiated Bitwuzla terms to process the solver model.
TRITON_EXPORT TritonToBitwuzla(bool eval=false)
Constructor.
std::shared_ptr< triton::ast::AbstractNode > SharedAbstractNode
Shared Abstract Node.
Definition ast.hpp:59
The Triton namespace.