I need someone to verify if I have translated a sentence into predicate logic correctly.
Given predicates:
- Empty(x) : the list x is empty
- Sorted(x) : the list x is sorted in ascending (not decreasing) order
- x < y : number x is smaller than number y
- At(x, i, y) : the list x contains the number y on index i
The start index begins always at zero in a list. [41, 19, 7, 5, 2, 5], i.e. the number 41 is at index 0 in the list, number 19 is at index 1, and so on.
The sentence(Updated): If it is for a non-empty list holds if i < j, then we know that the number on index j in the list is not less than the number on index i, then the list is sorted.
My translation: ¬Empty(L)∧((i < j)∧At(L, i, p)∧At(L, j, q) → ¬(q < p))→Sorted(L)
A new attempt: If it is for a non-empty list holds if i < j, then we know that the number on index j in the list is not less than the number on index i, then the list is sorted.
– karl88 Oct 05 '14 at 05:59