コード例 #1
0
ファイル: api_model.cpp プロジェクト: kayceesrk/Z3
 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
ファイル: api_model.cpp プロジェクト: NikolajBjorner/z3
 Z3_func_decl Z3_API Z3_model_get_func_decl(Z3_context c, Z3_model m, unsigned i) {
     Z3_TRY;
     LOG_Z3_model_get_func_decl(c, m, i);
     RESET_ERROR_CODE();
     Z3_func_decl r = get_model_func_decl_core(c, m, i);
     RETURN_Z3(r);
     Z3_CATCH_RETURN(nullptr);
 }
コード例 #3
0
ファイル: api_model.cpp プロジェクト: NikolajBjorner/z3
 unsigned get_model_func_num_entries_core(Z3_context c, Z3_model m, unsigned i) {
     RESET_ERROR_CODE();
     CHECK_NON_NULL(m, 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) {
             return g->num_entries();
         }
         SET_ERROR_CODE(Z3_IOB, nullptr);
         return 0;
     }
     return 0;
 }
コード例 #4
0
ファイル: api_model.cpp プロジェクト: kayceesrk/Z3
 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);
         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;
 }
コード例 #5
0
ファイル: api_model.cpp プロジェクト: kayceesrk/Z3
 Z3_ast Z3_API Z3_get_model_func_else(Z3_context c, Z3_model m, unsigned i) {
     Z3_TRY;
     LOG_Z3_get_model_func_else(c, m, i);
     RESET_ERROR_CODE();
     CHECK_NON_NULL(m, 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) {
             expr * e = g->get_else();
             mk_c(c)->save_ast_trail(e);
             RETURN_Z3(of_ast(e));
         }
         SET_ERROR_CODE(Z3_IOB);
         RETURN_Z3(0);
     }
     RETURN_Z3(0);
     Z3_CATCH_RETURN(0);
 }