mirror of
https://github.com/Z3Prover/z3
synced 2025-04-24 01:25:31 +00:00
add n-ary disjunction and conjunction
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
e518d4a5fe
commit
4c786c5f70
7 changed files with 35 additions and 6 deletions
|
@ -335,7 +335,7 @@ extern "C" {
|
|||
Z3_bool Z3_API Z3_is_app(Z3_context c, Z3_ast a) {
|
||||
LOG_Z3_is_app(c, a);
|
||||
RESET_ERROR_CODE();
|
||||
return is_app(reinterpret_cast<ast*>(a));
|
||||
return a != 0 && is_app(reinterpret_cast<ast*>(a));
|
||||
}
|
||||
|
||||
Z3_app Z3_API Z3_to_app(Z3_context c, Z3_ast a) {
|
||||
|
|
|
@ -802,6 +802,9 @@ namespace z3 {
|
|||
friend expr implies(expr const & a, bool b);
|
||||
friend expr implies(bool a, expr const & b);
|
||||
|
||||
friend expr or(expr_vector const& args);
|
||||
friend expr and(expr_vector const& args);
|
||||
|
||||
friend expr ite(expr const & c, expr const & t, expr const & e);
|
||||
|
||||
friend expr distinct(expr_vector const& args);
|
||||
|
@ -947,6 +950,7 @@ namespace z3 {
|
|||
inline expr implies(expr const & a, bool b) { return implies(a, a.ctx().bool_val(b)); }
|
||||
inline expr implies(bool a, expr const & b) { return implies(b.ctx().bool_val(a), b); }
|
||||
|
||||
|
||||
inline expr pw(expr const & a, expr const & b) {
|
||||
assert(a.is_arith() && b.is_arith());
|
||||
check_context(a, b);
|
||||
|
@ -1497,6 +1501,20 @@ namespace z3 {
|
|||
return expr(ctx, r);
|
||||
}
|
||||
|
||||
inline expr or(expr_vector const& args) {
|
||||
array<Z3_ast> _args(args);
|
||||
Z3_ast r = Z3_mk_or(args.ctx(), _args.size(), _args.ptr());
|
||||
args.check_error();
|
||||
return expr(args.ctx(), r);
|
||||
}
|
||||
inline expr and(expr_vector const& args) {
|
||||
array<Z3_ast> _args(args);
|
||||
Z3_ast r = Z3_mk_and(args.ctx(), _args.size(), _args.ptr());
|
||||
args.check_error();
|
||||
return expr(args.ctx(), r);
|
||||
}
|
||||
|
||||
|
||||
class func_entry : public object {
|
||||
Z3_func_entry m_entry;
|
||||
void init(Z3_func_entry e) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue