CMPSC 461: Programming Language Concepts Assignment 6 Solution
CMPSC 461: Programming Language Concepts Assignment 6 Solution Problem 1 [8pt] Prove that the following two Hoare triples are valid. (Hint: in predicate logic P1 ⇒ P2 is equivalent to ¬P1 ∨ P2). a) (4pt) {x > −1} y := x * 2; y := y + 3; {y > 0} Solution: wp(y:=x*2;y:=y+3, y > 0) = wp(y:=x*2, wp(y:=y+3, y > 0)) = wp(y:=x*2, y + 3 > 0) = x ∗ 2 + 3 > 0 Moreover, the precondition
Written for
Document information
- Uploaded on
- September 25, 2023
- Number of pages
- 4
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
-
cmpsc 461 programming language concepts assignmen
Also available in package deal