1

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)

karl88
  • 13
  • Sorry, I can't understand the sentence you are supposed to translate. It does not appear to be English. – MJD Oct 05 '14 at 04:36
  • Karl, if the sentence was originally in another language, perhaps you can include it in that language. – user180040 Oct 05 '14 at 04:43
  • Sorry. This is a hard sentence to translate.

    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
  • Karl, I still can't understand this sentence. If you wish, perhaps someone here can translate it for you. http://meta.math.stackexchange.com/questions/107/faq-for-math-stackexchange/4384#4384 – user180040 Oct 05 '14 at 06:34
  • I asked my friend and he said that my formula is correct. Thank you very much anyway :) – karl88 Oct 06 '14 at 02:55

0 Answers0