| 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; |