mirror of
https://github.com/Z3Prover/z3
synced 2025-04-15 21:38:44 +00:00
enable non-expression bodies of quantifiers to fix #1667
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
88ead235f0
commit
4547f2c001
|
@ -1898,13 +1898,17 @@ def is_quantifier(a):
|
||||||
|
|
||||||
def _mk_quantifier(is_forall, vs, body, weight=1, qid="", skid="", patterns=[], no_patterns=[]):
|
def _mk_quantifier(is_forall, vs, body, weight=1, qid="", skid="", patterns=[], no_patterns=[]):
|
||||||
if __debug__:
|
if __debug__:
|
||||||
_z3_assert(is_bool(body), "Z3 expression expected")
|
_z3_assert(is_bool(body) or is_app(vs) or (len(vs) > 0 and is_app(vs[0])), "Z3 expression expected")
|
||||||
_z3_assert(is_const(vs) or (len(vs) > 0 and all([ is_const(v) for v in vs])), "Invalid bounded variable(s)")
|
_z3_assert(is_const(vs) or (len(vs) > 0 and all([ is_const(v) for v in vs])), "Invalid bounded variable(s)")
|
||||||
_z3_assert(all([is_pattern(a) or is_expr(a) for a in patterns]), "Z3 patterns expected")
|
_z3_assert(all([is_pattern(a) or is_expr(a) for a in patterns]), "Z3 patterns expected")
|
||||||
_z3_assert(all([is_expr(p) for p in no_patterns]), "no patterns are Z3 expressions")
|
_z3_assert(all([is_expr(p) for p in no_patterns]), "no patterns are Z3 expressions")
|
||||||
ctx = body.ctx
|
|
||||||
if is_app(vs):
|
if is_app(vs):
|
||||||
|
ctx = vs.ctx
|
||||||
vs = [vs]
|
vs = [vs]
|
||||||
|
else:
|
||||||
|
ctx = vs[0].ctx
|
||||||
|
if not is_expr(body):
|
||||||
|
body = BoolVal(body, ctx)
|
||||||
num_vars = len(vs)
|
num_vars = len(vs)
|
||||||
if num_vars == 0:
|
if num_vars == 0:
|
||||||
return body
|
return body
|
||||||
|
|
|
@ -46,7 +46,6 @@ Revision History:
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#if 1
|
|
||||||
#include <immintrin.h>
|
#include <immintrin.h>
|
||||||
|
|
||||||
#if defined(__GNUC__)
|
#if defined(__GNUC__)
|
||||||
|
@ -69,14 +68,6 @@ inline uint64_t _trailing_zeros64(uint64_t x) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
inline unsigned _trailing_zeros32(unsigned x) {
|
|
||||||
unsigned r = 0;
|
|
||||||
for (; 0 == (x & 1) && r < 32; ++r, x >>= 1);
|
|
||||||
return r;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define _bit_min(x, y) (y + ((x - y) & ((int)(x - y) >> 31)))
|
#define _bit_min(x, y) (y + ((x - y) & ((int)(x - y) >> 31)))
|
||||||
#define _bit_max(x, y) (x - ((x - y) & ((int)(x - y) >> 31)))
|
#define _bit_max(x, y) (x - ((x - y) & ((int)(x - y) >> 31)))
|
||||||
|
|
Loading…
Reference in a new issue