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

Function Z3_mk_store

src/api/api_array.cpp:106–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104
105
106 Z3_ast Z3_API Z3_mk_store(Z3_context c, Z3_ast a, Z3_ast i, Z3_ast v) {
107 Z3_TRY;
108 LOG_Z3_mk_store(c, a, i, v);
109 RESET_ERROR_CODE();
110 ast_manager & m = mk_c(c)->m();
111 CHECK_IS_EXPR(a, nullptr);
112 CHECK_IS_EXPR(i, nullptr);
113 CHECK_IS_EXPR(v, nullptr);
114 expr * _a = to_expr(a);
115 expr * _i = to_expr(i);
116 expr * _v = to_expr(v);
117 sort * a_ty = _a->get_sort();
118 sort * i_ty = _i->get_sort();
119 sort * v_ty = _v->get_sort();
120 if (a_ty->get_family_id() != mk_c(c)->get_array_fid()) {
121 SET_ERROR_CODE(Z3_SORT_ERROR, nullptr);
122 RETURN_Z3(nullptr);
123 }
124 sort * domain[3] = {a_ty, i_ty, v_ty};
125 func_decl * d = m.mk_func_decl(mk_c(c)->get_array_fid(), OP_STORE, 2, a_ty->get_parameters(), 3, domain);
126 expr * args[3] = {_a, _i, _v};
127 app * r = m.mk_app(d, 3, args);
128 mk_c(c)->save_ast_trail(r);
129 check_sorts(c, r);
130 RETURN_Z3(of_ast(r));
131 Z3_CATCH_RETURN(nullptr);
132 }
133
134 Z3_ast Z3_API Z3_mk_store_n(Z3_context c, Z3_ast a, unsigned n, Z3_ast const* idxs, Z3_ast v) {
135 Z3_TRY;

Callers 7

test_arrayFunction · 0.85
Z3_mk_set_addFunction · 0.85
Z3_mk_set_delFunction · 0.85
UpdateFunction · 0.85
storeFunction · 0.85
array_example1Function · 0.85

Calls 12

mk_cFunction · 0.85
check_sortsFunction · 0.85
of_astFunction · 0.85
save_ast_trailMethod · 0.80
to_exprFunction · 0.70
mMethod · 0.45
get_sortMethod · 0.45
get_family_idMethod · 0.45
get_array_fidMethod · 0.45
mk_func_declMethod · 0.45
get_parametersMethod · 0.45
mk_appMethod · 0.45

Tested by 3

test_arrayFunction · 0.68
array_example1Function · 0.68