Proof: Write Assign Const Stack At 0
Let's prove the following theorem:
if the following are true:
- the line at time 0 = 1
- the tab at time 0 = 0
- statement at line 1, tab 0 =
a = 0
- 0 is constant
- stack at time 0 = [ ]
then stack at time 1 = [ ]
Proof:
Given
1 | the line at time 0 = 1 |
---|---|
2 | the tab at time 0 = 0 |
3 | statement at line 1, tab 0 = a = 0 |
4 | 0 is constant |
5 | stack at time 0 = [ ] |
# | Claim | Reason |
---|---|---|
1 | stack at time (0 + 1) = stack at time 0 | if the line at time 0 = 1 and the tab at time 0 = 0 and statement at line 1, tab 0 = a = 0 and 0 is constant, then stack at time (0 + 1) = stack at time 0 |
2 | stack at time (0 + 1) = [ ] | if stack at time (0 + 1) = stack at time 0 and stack at time 0 = [ ], then stack at time (0 + 1) = [ ] |
3 | 0 + 1 = 1 | 0 + 1 = 1 |
4 | stack at time (0 + 1) = stack at time 1 | if 0 + 1 = 1, then stack at time (0 + 1) = stack at time 1 |
5 | stack at time 1 = [ ] | if stack at time (0 + 1) = stack at time 1 and stack at time (0 + 1) = [ ], then stack at time 1 = [ ] |
Comments
Please log in to add comments