I have a question about quantifiers.
Suppose I have an array and I want to calculate the index of the array 0, 1 and 2 for this array -
(declare-const cpuA (Array Int Int)) (assert (or (= (select cpuA 0) 0) (= (select cpuA 0) 1))) (assert (or (= (select cpuA 1) 0) (= (select cpuA 1) 1))) (assert (or (= (select cpuA 2) 0) (= (select cpuA 2) 1)))
Or else I can specify the same using forall construct as -
(assert (forall ((x Int)) (=> (and (>= x 0) (<= x 2)) (or (= (select cpuA x) 0) (= (select cpuA x) 1)))))
Now I would like to understand the difference between the two of them. The first method is fast and provides a simple and readable model. In contrast, the size of the code with the second option is much smaller, but it takes time to execute the program. And also a difficult decision.
I would like to use the second method, as my code will become smaller. However, I want to find a readable simple model.
Raj
source share