Пример #1
0
 Z3_ast Z3_API Z3_get_model_func_entry_value(Z3_context c,
         Z3_model m,
         unsigned i,
         unsigned j) {
     Z3_TRY;
     LOG_Z3_get_model_func_entry_value(c, m, i, j);
     RESET_ERROR_CODE();
     CHECK_NON_NULL(m, 0);
     if (j >= get_model_func_num_entries_core(c, m, i)) {
         SET_ERROR_CODE(Z3_IOB);
         RETURN_Z3(0);
     }
     Z3_func_decl d = get_model_func_decl_core(c, m, i);
     if (d) {
         model * _m = to_model_ref(m);
         func_interp * g = _m->get_func_interp(to_func_decl(d));
         if (g && j < g->num_entries()) {
             func_entry const* e = g->get_entry(j);
             expr* a = e->get_result();
             mk_c(c)->save_ast_trail(a);
             RETURN_Z3(of_ast(a));
         }
         SET_ERROR_CODE(Z3_IOB);
         RETURN_Z3(0);
     }
     RETURN_Z3(0);
     Z3_CATCH_RETURN(0);
 }
Пример #2
0
 unsigned get_model_func_entry_num_args_core(Z3_context c,
                                             Z3_model m,
                                             unsigned i,
                                             unsigned j) {
     RESET_ERROR_CODE();
     CHECK_NON_NULL(m, 0);
     if (j >= get_model_func_num_entries_core(c, m, i)) {
         SET_ERROR_CODE(Z3_IOB, nullptr);
         return 0;
     }
     Z3_func_decl d = get_model_func_decl_core(c, m, i);
     if (d) {
         model * _m = to_model_ref(m);
         func_interp * g = _m->get_func_interp(to_func_decl(d));
         return g->get_arity();
     }
     return 0;
 }
Пример #3
0
 unsigned Z3_API Z3_get_model_func_num_entries(Z3_context c, Z3_model m, unsigned i) {
     Z3_TRY;
     LOG_Z3_get_model_func_num_entries(c, m, i);
     return get_model_func_num_entries_core(c, m, i);
     Z3_CATCH_RETURN(0);
 }