0
$\begingroup$

I have been working through some tutorials (of which I have the answers to) trying to understand predicate construction. Anything I've found online has been quite well laid out and easy to understand and I understand the role of the quantifiers but the following question and answer from the tutorial has stumped me:

Given the variable declaration A,B: ARRAY[1..10] OF INTEGER; K,L,M: INTEGER; x: INTEGER; Construct predicates to assert that:

(a) The arrays A and B are identical. Answer: ∀K.1 ≤ K ≤ 10.(A[K] = B[K])

(b) Every element of A is less than 10. Answer: ∀K.1 ≤ K ≤ 10.(A[K] < 10)

There are more questions and answers but I figured if I could understand the first two I could do the rest. Can someone explain what the dot means in "K.1" and "10."? and could someone talk me through the declaration of the array and how it's read as a sentence?

Cheers in advance

  • 0
    I'm not familiar with this exact notation, but the "." in this case appears to be "such that.2017-01-12

2 Answers 2

0

(a) The arrays A and B are identical. Answer: ∀K.1 ≤ K ≤ 10.(A[K] = B[K])

(b) Every element of A is less than 10. Answer: ∀K.1 ≤ K ≤ 10.(A[K] < 10)

(a) For all K such that $1 \leq K \leq 10$, $A[K] = B[K]$.
In even more laymens terms this means, all elements of A, are equal to the corresponding element of B (in the range of [1,10] which happens to be the entire arrays)

(b) For all K such that $1 \leq K \leq 10$, $A[K] < 10$.
In even more laymens terms, all elements of A in the range [1,10](which happens to be all of them) are less than 10

  • 0
    Given this and a little bit more looking online I understand it. I was getting pretty confused by "K.1 ≤ K ≤ 10 " but now understand what it means. Thanks!2017-01-12
0

The dots are simply used as separators so as to avoid confusion. But you might as well just spacing, e.g. the first one could just as well be written as:

$∀K \: 1 ≤ K ≤ 10 \: (A[K] = B[K])$

... I am not sure what you want for the second question ...