0

guys

I'm writing a model using Microsft Z3 and I need to add the following assertions to it:

(declare-const line (Array Int Int))

(assert (and (> (select line 1) 0) (< (select line 1) 4)))
(assert (and (> (select line 2) 0) (< (select line 2) 4)))
(assert (and (> (select line 3) 0) (< (select line 3) 4)))

As you can see, what I'm trying to state is that my 3-length array, called line, can only have elements in [1..3]. This code works perfectly, however, I would like to be able to make these assertions just with a line of code, using quantifiers. I've tried:

(assert (forall ((i Int)) (=> (and (> i 0) (< i 4)) (and (> (select line i) 0) (< (select line i) 4)))))

Which I though would work... but after executing, Z3 returned unsat, which was't happening with the previous version of the code.

Why is this happening?

Is this possible?

Daniel
  • 95
  • 8
  • 1
    As far as I can tell, the two versions are equivalent. Do you have a full repro (and link to rise4fun.com/z3)? – Nikolaj Bjorner Apr 07 '13 at 23:16
  • yap... I realised the two version were, in fact, equivalent just after submitting the question. Sorry for wasting your time and thank you for the comment. – Daniel Apr 09 '13 at 01:33

0 Answers0