Closed LeventErkok closed 4 years ago
Below is a much simpler reduced formula that should trigger the same issue; hope it is of use:
[515] % z3 small.smt2
sat
[516] % z3 model_validate=true small.smt2
sat
(error "line 16 column 10: an invalid model was generated")
[517] %
[517] % cat small.smt2
(declare-datatypes ((a 0)) (((b))))
(define-fun v () (Seq Bool) (as seq.empty (Seq Bool)))
(declare-fun e () (Seq a))
(define-fun w () Int (seq.len e))
(define-fun x () (Seq a) (seq.extract e 1 (- w 1)))
(define-fun i () (Seq a) (seq.extract x 1 (- (seq.len x) 1)))
(define-fun y () (Seq Bool) (ite (= 0 (seq.len i)) v (seq.unit true)))
(define-fun m () (Seq Bool) (seq.++ (seq.unit false) y))
(define-fun n () (Seq Bool) (ite (= 0 (seq.len x)) v m))
(define-fun o () (Seq Bool) (seq.++ (seq.unit false) n))
(define-fun p () (Seq Bool) (ite (= 0 w) v o))
(define-fun s () (Seq Bool) (seq.extract p 1 (- (seq.len p) 1)))
(define-fun u () (Seq Bool) (seq.extract s 1 (- (seq.len s) 1)))
(assert (distinct 0 (seq.len u)))
(assert (not (seq.nth u 0)))
(check-sat)
[518] %
The much shorter examples help tremendously. There is significant context switching and then investigation involved in debugging these and it is sometimes very time consuming to identify the root cause of a single bug.
this now produces unsat. It was very likely fixed when addressing unsound handling of "at".
I can confirm that this works now. But I'm getting a bunch of other failures elsewhere. I'll take a look at the new ones.
Thanks!
The following benchmark is
unsat
; but latest z3 gives a bogus model for it. Good news is that it knows the model it generated is invalid:I've a version of z3 compiled on October 29 2019 from github, which successfully says
unsat
on this benchmark. So, the issue must've crept in sometime in the last 3 months.Here's the benchmark: (It tries to perform BMC on a mutual-exclusion protocol.)