Beispiel #1
0
 Z3_func_interp Z3_API Z3_add_func_interp(Z3_context c, Z3_model m, Z3_func_decl f, Z3_ast else_val) {
     Z3_TRY;
     LOG_Z3_add_func_interp(c, m, f, else_val);
     RESET_ERROR_CODE();
     func_decl* d = to_func_decl(f);
     model* mdl = to_model_ref(m);
     Z3_func_interp_ref * f_ref = alloc(Z3_func_interp_ref, *mk_c(c), mdl); 
     f_ref->m_func_interp = alloc(func_interp, mk_c(c)->m(), d->get_arity());
     mk_c(c)->save_object(f_ref);
     mdl->register_decl(d, f_ref->m_func_interp);
     f_ref->m_func_interp->set_else(to_expr(else_val));
     RETURN_Z3(of_func_interp(f_ref));
     Z3_CATCH_RETURN(nullptr);
 }
Beispiel #2
0
 Z3_func_interp Z3_API Z3_model_get_func_interp(Z3_context c, Z3_model m, Z3_func_decl f) {
     Z3_TRY;
     LOG_Z3_model_get_func_interp(c, m, f);
     RESET_ERROR_CODE();
     CHECK_NON_NULL(m, nullptr);
     func_interp * _fi       = to_model_ref(m)->get_func_interp(to_func_decl(f));
     if (!_fi) {
         SET_ERROR_CODE(Z3_INVALID_ARG, nullptr);
         RETURN_Z3(nullptr);
     }
     Z3_func_interp_ref * fi = alloc(Z3_func_interp_ref, *mk_c(c), to_model_ref(m));
     fi->m_func_interp       = _fi;
     mk_c(c)->save_object(fi);
     RETURN_Z3(of_func_interp(fi));
     Z3_CATCH_RETURN(nullptr);
 }