MCPcopy Create free account
hub / github.com/AliveToolkit/alive2 / expr

Class expr

smt/expr.h:25–414  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23class AndExpr;
24
25class expr {
26 uintptr_t ptr = 0;
27
28 expr(Z3_ast ast) noexcept;
29 bool isZ3Ast() const;
30 Z3_ast ast() const;
31 Z3_ast operator()() const { return ast(); }
32 void incRef();
33 void decRef();
34
35 Z3_sort sort() const;
36 Z3_decl decl() const;
37 Z3_app isApp() const;
38 Z3_app isAppOf(int app_type) const;
39
40 expr binop_commutative(const expr &rhs,
41 Z3_ast(*op)(Z3_context, Z3_ast, Z3_ast),
42 expr (expr::*expr_op)(const expr &) const,
43 bool (expr::*identity)() const,
44 bool (expr::*absorvent)() const,
45 int z3_app = 0) const;
46 expr binop_commutative(const expr &rhs,
47 Z3_ast(*op)(Z3_context, Z3_ast, Z3_ast)) const;
48
49 expr unop_fold(Z3_ast(*op)(Z3_context, Z3_ast)) const;
50 expr binop_fold(const expr &rhs,
51 Z3_ast(*op)(Z3_context, Z3_ast, Z3_ast)) const;
52
53 bool alwaysFalse() const { return false; }
54
55 static Z3_ast mkTrue();
56 static Z3_ast mkFalse();
57 static expr mkUInt(uint64_t n, Z3_sort sort);
58 static expr mkInt(int64_t n, Z3_sort sort);
59 static expr mkConst(Z3_decl decl);
60
61 bool isUnOp(expr &a, int z3op) const;
62 bool isBinOp(expr &a, expr &b, int z3op) const;
63 bool isTernaryOp(expr &a, expr &b, expr &c, int z3op) const;
64
65public:
66 expr() = default;
67
68 expr(expr &&other) noexcept {
69 std::swap(ptr, other.ptr);
70 }
71
72 expr(const expr &other) noexcept;
73 expr(bool val) noexcept : expr(val ? mkTrue() : mkFalse()) {}
74 ~expr() noexcept;
75
76 void operator=(expr &&other);
77 void operator=(const expr &other);
78
79 static expr mkUInt(uint64_t n, unsigned bits);
80 static expr mkUInt(uint64_t n, const expr &type);
81 static expr mkInt(int64_t n, unsigned bits);
82 static expr mkInt(int64_t n, const expr &type);

Callers 14

domainMethod · 0.70
operator()Method · 0.70
mkUIntMethod · 0.70
mkIntMethod · 0.70
someMethod · 0.70
operator&Method · 0.70
extractMethod · 0.70
varsMethod · 0.70
operator*Method · 0.70
getElseMethod · 0.70
DisjointExprMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected