3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-11-14 01:51:16 +00:00

Add finite set API functions to access term constructors from finite_set_decl_plugin.h (#7996)

* Initial plan

* Add C API for finite sets

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>

* Add Python bindings for finite sets

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>

* Add C++ bindings for finite sets

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>

* Add documentation for finite set API

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
This commit is contained in:
Copilot 2025-10-23 17:10:47 +02:00 committed by GitHub
parent 4c67a7271e
commit 541a554ecd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 700 additions and 1 deletions

View file

@ -3389,6 +3389,107 @@ extern "C" {
Z3_ast Z3_API Z3_mk_array_ext(Z3_context c, Z3_ast arg1, Z3_ast arg2);
/**@}*/
/** @name Finite Sets */
/**@{*/
/**
\brief Create a finite set sort.
def_API('Z3_mk_finite_set_sort', SORT, (_in(CONTEXT), _in(SORT)))
*/
Z3_sort Z3_API Z3_mk_finite_set_sort(Z3_context c, Z3_sort elem_sort);
/**
\brief Check if a sort is a finite set sort.
def_API('Z3_is_finite_set_sort', BOOL, (_in(CONTEXT), _in(SORT)))
*/
bool Z3_API Z3_is_finite_set_sort(Z3_context c, Z3_sort s);
/**
\brief Get the element sort of a finite set sort.
def_API('Z3_get_finite_set_sort_basis', SORT, (_in(CONTEXT), _in(SORT)))
*/
Z3_sort Z3_API Z3_get_finite_set_sort_basis(Z3_context c, Z3_sort s);
/**
\brief Create an empty finite set of the given sort.
def_API('Z3_mk_finite_set_empty', AST, (_in(CONTEXT), _in(SORT)))
*/
Z3_ast Z3_API Z3_mk_finite_set_empty(Z3_context c, Z3_sort set_sort);
/**
\brief Create a singleton finite set.
def_API('Z3_mk_finite_set_singleton', AST, (_in(CONTEXT), _in(AST)))
*/
Z3_ast Z3_API Z3_mk_finite_set_singleton(Z3_context c, Z3_ast elem);
/**
\brief Create the union of two finite sets.
def_API('Z3_mk_finite_set_union', AST, (_in(CONTEXT), _in(AST), _in(AST)))
*/
Z3_ast Z3_API Z3_mk_finite_set_union(Z3_context c, Z3_ast s1, Z3_ast s2);
/**
\brief Create the intersection of two finite sets.
def_API('Z3_mk_finite_set_intersect', AST, (_in(CONTEXT), _in(AST), _in(AST)))
*/
Z3_ast Z3_API Z3_mk_finite_set_intersect(Z3_context c, Z3_ast s1, Z3_ast s2);
/**
\brief Create the set difference of two finite sets.
def_API('Z3_mk_finite_set_difference', AST, (_in(CONTEXT), _in(AST), _in(AST)))
*/
Z3_ast Z3_API Z3_mk_finite_set_difference(Z3_context c, Z3_ast s1, Z3_ast s2);
/**
\brief Check if an element is a member of a finite set.
def_API('Z3_mk_finite_set_member', AST, (_in(CONTEXT), _in(AST), _in(AST)))
*/
Z3_ast Z3_API Z3_mk_finite_set_member(Z3_context c, Z3_ast elem, Z3_ast set);
/**
\brief Get the size (cardinality) of a finite set.
def_API('Z3_mk_finite_set_size', AST, (_in(CONTEXT), _in(AST)))
*/
Z3_ast Z3_API Z3_mk_finite_set_size(Z3_context c, Z3_ast set);
/**
\brief Check if one finite set is a subset of another.
def_API('Z3_mk_finite_set_subset', AST, (_in(CONTEXT), _in(AST), _in(AST)))
*/
Z3_ast Z3_API Z3_mk_finite_set_subset(Z3_context c, Z3_ast s1, Z3_ast s2);
/**
\brief Apply a function to all elements of a finite set.
def_API('Z3_mk_finite_set_map', AST, (_in(CONTEXT), _in(AST), _in(AST)))
*/
Z3_ast Z3_API Z3_mk_finite_set_map(Z3_context c, Z3_ast f, Z3_ast set);
/**
\brief Filter a finite set using a predicate.
def_API('Z3_mk_finite_set_filter', AST, (_in(CONTEXT), _in(AST), _in(AST)))
*/
Z3_ast Z3_API Z3_mk_finite_set_filter(Z3_context c, Z3_ast f, Z3_ast set);
/**
\brief Create a finite set of integers in the range [low, high).
def_API('Z3_mk_finite_set_range', AST, (_in(CONTEXT), _in(AST), _in(AST)))
*/
Z3_ast Z3_API Z3_mk_finite_set_range(Z3_context c, Z3_ast low, Z3_ast high);
/**@}*/
/** @name Numerals */
/**@{*/
/**