mirror of
https://github.com/Z3Prover/z3
synced 2025-12-19 18:53:43 +00:00
Implement inverter functions for finite-set operators (#7974)
* Initial plan * Add set operator inverters to array_expr_inverter Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> * Refactor expr_inverter to remove set operations Removed handling for set operations like union, intersection, and difference in expr_inverter.cpp. Introduced finite_set_inverter class to manage set union operation. * Remove OP_SET_COMPLEMENT case from expr_inverter Removed handling for OP_SET_COMPLEMENT in expr_inverter. * Change OP_SET_UNION to OP_FINITE_SET_UNION --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> Co-authored-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
0efe3820fc
commit
930ba5ebd6
1 changed files with 29 additions and 0 deletions
|
|
@ -823,6 +823,35 @@ public:
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
class finite_set_inverter : public iexpr_inverter {
|
||||||
|
finite_set_util fs;
|
||||||
|
public:
|
||||||
|
finite_set_inverter(ast_manager& m): iexpr_inverter(m), fs(m) {}
|
||||||
|
|
||||||
|
bool operator()(func_decl* f, unsigned num, expr* const* args, expr_ref& r) override {
|
||||||
|
switch (f->get_decl_kind()) {
|
||||||
|
case OP_FINITE_SET_UNION:
|
||||||
|
// x union y -> fresh
|
||||||
|
// x := fresh, y := empty
|
||||||
|
if (num == 2 && uncnstr(args[0]) && uncnstr(args[1])) {
|
||||||
|
mk_fresh_uncnstr_var_for(f, r);
|
||||||
|
if (m_mc) {
|
||||||
|
add_def(args[0], r);
|
||||||
|
add_def(args[1], fs.mk_empty_set(args[1]->get_sort()));
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool mk_diff(expr* t, expr_ref& r) override {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
class seq_expr_inverter : public iexpr_inverter {
|
class seq_expr_inverter : public iexpr_inverter {
|
||||||
seq_util seq;
|
seq_util seq;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue