3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-24 01:25:31 +00:00

Fixed performance problems with enumeration sorts (Codeplex #190).

This commit is contained in:
Christoph M. Wintersteiger 2015-03-25 18:08:56 +00:00
parent 1c77ad00c3
commit a792790882
2 changed files with 20 additions and 14 deletions

View file

@ -475,12 +475,12 @@ extern "C" {
SET_ERROR_CODE(Z3_INVALID_ARG);
return 0;
}
ptr_vector<func_decl> const * decls = dt_util.get_datatype_constructors(_t);
if (!decls || idx >= decls->size()) {
unsigned n = dt_util.get_datatype_num_constructors(_t);
if (idx >= n) {
SET_ERROR_CODE(Z3_INVALID_ARG);
return 0;
}
func_decl* decl = (*decls)[idx];
func_decl* decl = dt_util.get_constructor(_t, idx);
mk_c(c)->save_ast_trail(decl);
return of_func_decl(decl);
}
@ -505,12 +505,12 @@ extern "C" {
SET_ERROR_CODE(Z3_INVALID_ARG);
RETURN_Z3(0);
}
ptr_vector<func_decl> const * decls = dt_util.get_datatype_constructors(_t);
if (!decls || idx >= decls->size()) {
unsigned n = dt_util.get_datatype_num_constructors(_t);
if (idx >= n) {
SET_ERROR_CODE(Z3_INVALID_ARG);
RETURN_Z3(0);
return 0;
}
func_decl* decl = (*decls)[idx];
func_decl* decl = dt_util.get_constructor(_t, idx);
decl = dt_util.get_constructor_recognizer(decl);
mk_c(c)->save_ast_trail(decl);
RETURN_Z3(of_func_decl(decl));
@ -528,12 +528,12 @@ extern "C" {
SET_ERROR_CODE(Z3_INVALID_ARG);
RETURN_Z3(0);
}
ptr_vector<func_decl> const * decls = dt_util.get_datatype_constructors(_t);
if (!decls || idx_c >= decls->size()) {
unsigned n = dt_util.get_datatype_num_constructors(_t);
if (idx_c >= n) {
SET_ERROR_CODE(Z3_INVALID_ARG);
RETURN_Z3(0);
return 0;
}
func_decl* decl = (*decls)[idx_c];
func_decl* decl = dt_util.get_constructor(_t, idx_c);
if (decl->get_arity() <= idx_a) {
SET_ERROR_CODE(Z3_INVALID_ARG);
RETURN_Z3(0);