MCPcopy Create free account
hub / github.com/Z3Prover/z3 / lt

Function lt

src/ast/ast_lt.cpp:58–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56}
57
58bool lt(ast * n1, ast * n2) {
59 unsigned num;
60 start:
61 if (n1 == n2)
62 return false;
63 check_value(n1->get_kind(), n2->get_kind());
64 switch(n1->get_kind()) {
65 case AST_SORT:
66 check_symbol(to_sort(n1)->get_name(), to_sort(n2)->get_name());
67 check_value(to_sort(n1)->get_num_parameters(), to_sort(n2)->get_num_parameters());
68 num = to_sort(n1)->get_num_parameters();
69 SASSERT(num > 0);
70 for (unsigned i = 0; i < num; ++i) {
71 const parameter &p1 = to_sort(n1)->get_parameter(i);
72 const parameter &p2 = to_sort(n2)->get_parameter(i);
73 check_parameter(p1, p2);
74 }
75 UNREACHABLE();
76 return false;
77 case AST_FUNC_DECL:
78 check_symbol(to_func_decl(n1)->get_name(), to_func_decl(n2)->get_name());
79 check_value(to_func_decl(n1)->get_arity(), to_func_decl(n2)->get_arity());
80 check_value(to_func_decl(n1)->get_num_parameters(), to_func_decl(n2)->get_num_parameters());
81 num = to_func_decl(n1)->get_num_parameters();
82 for (unsigned i = 0; i < num; ++i) {
83 const parameter &p1 = to_func_decl(n1)->get_parameter(i);
84 const parameter &p2 = to_func_decl(n2)->get_parameter(i);
85 check_parameter(p1, p2);
86 }
87 num = to_func_decl(n1)->get_arity();
88 for (unsigned i = 0; i < num; ++i) {
89 ast * d1 = to_func_decl(n1)->get_domain(i);
90 ast * d2 = to_func_decl(n2)->get_domain(i);
91 check_ast(d1, d2);
92 }
93 n1 = to_func_decl(n1)->get_range();
94 n2 = to_func_decl(n2)->get_range();
95 goto start;
96 case AST_APP:
97 check_value(to_app(n1)->get_num_args(), to_app(n2)->get_num_args());
98 check_value(to_app(n1)->get_depth(), to_app(n2)->get_depth());
99 check_ast(to_app(n1)->get_decl(), to_app(n2)->get_decl());
100 num = to_app(n1)->get_num_args();
101 for (unsigned i = 0; i < num; ++i) {
102 expr * arg1 = to_app(n1)->get_arg(i);
103 expr * arg2 = to_app(n2)->get_arg(i);
104 check_ast(arg1, arg2);
105 }
106 UNREACHABLE();
107 return false;
108 case AST_QUANTIFIER:
109 check_value(to_quantifier(n1)->get_kind(), to_quantifier(n2)->get_kind());
110 check_value(to_quantifier(n1)->get_num_decls(), to_quantifier(n2)->get_num_decls());
111 check_value(to_quantifier(n1)->get_num_patterns(), to_quantifier(n2)->get_num_patterns());
112 check_value(to_quantifier(n1)->get_num_no_patterns(), to_quantifier(n2)->get_num_no_patterns());
113 check_value(to_quantifier(n1)->get_weight(), to_quantifier(n2)->get_weight());
114 num = to_quantifier(n1)->get_num_decls();
115 for (unsigned i = 0; i < num; ++i) {

Callers 13

is_sortedFunction · 0.70
lex_ltFunction · 0.70
operator()Method · 0.70
executeMethod · 0.50
tst1Function · 0.50
mk_nflat_mul_coreMethod · 0.50
TRACEFunction · 0.50
operator()Method · 0.50
mk_nflat_add_coreMethod · 0.50
mk_nflat_or_coreMethod · 0.50
mk_flat_or_coreMethod · 0.50
tMethod · 0.50

Calls 15

check_valueClass · 0.85
to_quantifierFunction · 0.85
get_num_patternsMethod · 0.80
get_num_no_patternsMethod · 0.80
get_decl_sortMethod · 0.80
get_patternMethod · 0.80
get_no_patternMethod · 0.80
to_sortFunction · 0.70
to_func_declFunction · 0.70
to_appFunction · 0.70
to_varFunction · 0.70
get_kindMethod · 0.45

Tested by 1

tst1Function · 0.40