mirror of
https://github.com/Z3Prover/z3
synced 2025-04-12 12:08:18 +00:00
expose n-ary xor
This commit is contained in:
parent
764e033bf4
commit
2704fb5fd5
|
@ -1210,6 +1210,7 @@ namespace z3 {
|
||||||
friend expr implies(bool a, expr const & b);
|
friend expr implies(bool a, expr const & b);
|
||||||
|
|
||||||
friend expr mk_or(expr_vector const& args);
|
friend expr mk_or(expr_vector const& args);
|
||||||
|
friend expr mk_xor(expr_vector const& args);
|
||||||
friend expr mk_and(expr_vector const& args);
|
friend expr mk_and(expr_vector const& args);
|
||||||
|
|
||||||
friend expr ite(expr const & c, expr const & t, expr const & e);
|
friend expr ite(expr const & c, expr const & t, expr const & e);
|
||||||
|
@ -2384,6 +2385,14 @@ namespace z3 {
|
||||||
args.check_error();
|
args.check_error();
|
||||||
return expr(args.ctx(), r);
|
return expr(args.ctx(), r);
|
||||||
}
|
}
|
||||||
|
inline expr mk_xor(expr_vector const& args) {
|
||||||
|
if (args.empty())
|
||||||
|
return args.ctx().bool_val(false);
|
||||||
|
expr r = args[0];
|
||||||
|
for (unsigned i = 1; i < args.size(); ++i)
|
||||||
|
r = r ^ args[i];
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
class func_entry : public object {
|
class func_entry : public object {
|
||||||
|
|
Loading…
Reference in a new issue