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?