Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 24th, 2012  |  syntax: None  |  size: 0.55 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Formal Methods, Logic and VDM past exam paper questions
  2. max(i, j)
  3. if i>j
  4. then i
  5. else j
  6.        
  7. max(i : Z, j : Z)r : Z
  8. pre true
  9. post (r = i ∨ r = j) ∧ i ≤ r ∧ j ≤ r
  10.        
  11. (1) ∃x • P(x) is logically equivalent to ¬∀x • ¬P(x)
  12. (2) ∀x∈S • P(x) means ∀x • x∈S ⇒ P(x)
  13.  
  14. ∃x∈S • P(x)
  15. == ¬∀x∈S • ¬P(x) (from (1))
  16. == ¬∀x • x∈S ⇒ ¬P(x) (from (2))
  17. == ¬∀x • ¬x∈S v ¬P(x) (from def. of ⇒)
  18. == ¬∀x • ¬(x∈S ∧ P(x)) (from ¬A v ¬B == ¬(A ∧ B))
  19. == ∃x • x∈S ∧ P(x) (from (1) -- the other way around)