3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-02-20 23:44:41 +00:00

add functions that create unique sets for model construction based on solving cardinality constraints

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2025-12-29 11:57:48 -08:00
parent 1d3f6a7c70
commit ba13460511
6 changed files with 108 additions and 23 deletions

View file

@ -49,6 +49,7 @@ enum finite_set_op_kind {
OP_FINITE_SET_RANGE,
OP_FINITE_SET_EXT,
OP_FINITE_SET_MAP_INVERSE,
OP_FINITE_SET_UNIQUE_SET,
LAST_FINITE_SET_OP
};
@ -134,6 +135,7 @@ public:
bool is_map(expr const* n) const { return is_app_of(n, m_fid, OP_FINITE_SET_MAP); }
bool is_filter(expr const* n) const { return is_app_of(n, m_fid, OP_FINITE_SET_FILTER); }
bool is_range(expr const* n) const { return is_app_of(n, m_fid, OP_FINITE_SET_RANGE); }
bool is_unique_set(expr const *n) const { return is_app_of(n, m_fid, OP_FINITE_SET_UNIQUE_SET); }
MATCH_UNARY(is_singleton);
MATCH_UNARY(is_size);
@ -145,6 +147,7 @@ public:
MATCH_BINARY(is_map);
MATCH_BINARY(is_filter);
MATCH_BINARY(is_range);
MATCH_BINARY(is_unique_set);
};
class finite_set_util : public finite_set_recognizers {
@ -211,7 +214,9 @@ public:
func_decl *mk_range_decl();
app * mk_range(expr* low, expr* high) {
app *mk_range(expr *low, expr *high) {
return m_manager.mk_app(m_fid, OP_FINITE_SET_RANGE, low, high);
}
app *mk_unique_set(expr *s1, expr *s2, sort *s);
};