mirror of
https://github.com/Z3Prover/z3
synced 2025-04-22 16:45:31 +00:00
Add Z3_is_recursive_datatype_sort to the API (#7615)
It does not seem to be possible to test if a datatype sort is recursive.
This commit is contained in:
parent
14e2aadad0
commit
d792840739
2 changed files with 17 additions and 0 deletions
|
@ -443,6 +443,16 @@ extern "C" {
|
|||
Z3_CATCH;
|
||||
}
|
||||
|
||||
bool Z3_API Z3_is_recursive_datatype_sort(Z3_context c, Z3_sort t) {
|
||||
Z3_TRY;
|
||||
LOG_Z3_is_recursive_datatype_sort(c, t);
|
||||
RESET_ERROR_CODE();
|
||||
sort * s = to_sort(t);
|
||||
datatype_util& dt_util = mk_c(c)->dtutil();
|
||||
return dt_util.is_datatype(s) && dt_util.is_recursive(s);
|
||||
Z3_CATCH_RETURN(false);
|
||||
}
|
||||
|
||||
unsigned Z3_API Z3_get_datatype_sort_num_constructors(Z3_context c, Z3_sort t) {
|
||||
Z3_TRY;
|
||||
LOG_Z3_get_datatype_sort_num_constructors(c, t);
|
||||
|
|
|
@ -4588,6 +4588,13 @@ extern "C" {
|
|||
*/
|
||||
Z3_func_decl Z3_API Z3_get_tuple_sort_field_decl(Z3_context c, Z3_sort t, unsigned i);
|
||||
|
||||
/**
|
||||
\brief Check if \c s is a recursive datatype sort.
|
||||
|
||||
def_API('Z3_is_recursive_datatype_sort', BOOL, (_in(CONTEXT), _in(SORT)))
|
||||
*/
|
||||
bool Z3_API Z3_is_recursive_datatype_sort(Z3_context c, Z3_sort s);
|
||||
|
||||
/**
|
||||
\brief Return number of constructors for datatype.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue