Proof: Write Skip Line Line 2
Let's prove the following theorem:
if the following are true:
- the line at time 2 = 3
- the tab at time 2 = 1
- statement at line 3, tab 2 =
self.x = 0
then the line at time 3 = 4
Proof:
Given
1 | the line at time 2 = 3 |
---|---|
2 | the tab at time 2 = 1 |
3 | statement at line 3, tab 2 = self.x = 0 |
# | Claim | Reason |
---|---|---|
1 | 2 > 1 | 2 > 1 |
2 | the line at time (2 + 1) = 3 + 1 | if the line at time 2 = 3 and the tab at time 2 = 1 and statement at line 3, tab 2 = self.x = 0 and 2 > 1, then the line at time (2 + 1) = 3 + 1 |
3 | 3 + 1 = 4 | 3 + 1 = 4 |
4 | the line at time (2 + 1) = 4 | if the line at time (2 + 1) = 3 + 1 and 3 + 1 = 4, then the line at time (2 + 1) = 4 |
5 | 2 + 1 = 3 | 2 + 1 = 3 |
6 | the line at time (2 + 1) = the line at time 3 | if 2 + 1 = 3, then the line at time (2 + 1) = the line at time 3 |
7 | the line at time 3 = 4 | if the line at time (2 + 1) = the line at time 3 and the line at time (2 + 1) = 4, then the line at time 3 = 4 |
Comments
Please log in to add comments