3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-03 01:40:22 +00:00

Allow building AC functions without requiring arity check from API

This commit is contained in:
Nikolaj Bjorner 2023-01-22 14:39:58 -08:00
parent 806a4772bc
commit 7d364bf786
2 changed files with 5 additions and 6 deletions

View file

@ -660,11 +660,14 @@ extern "C" {
LOG_Z3_get_domain(c, d, i);
RESET_ERROR_CODE();
CHECK_VALID_AST(d, nullptr);
if (i >= to_func_decl(d)->get_arity()) {
func_decl* _d = to_func_decl(d);
if (_d->is_associative())
i = 0;
if (i >= _d->get_arity()) {
SET_ERROR_CODE(Z3_IOB, nullptr);
RETURN_Z3(nullptr);
}
Z3_sort r = of_sort(to_func_decl(d)->get_domain(i));
Z3_sort r = of_sort(_d->get_domain(i));
RETURN_Z3(r);
Z3_CATCH_RETURN(nullptr);
}