Propostional Logic Inference Rules, Sequent Style

CS477 Spring 2013
Midterm
NetID:
Propostional Logic Inference Rules, Sequent Style
Introduction Rules
is set of propositions (assumptions/hypotheses)
Hypothesis Introduction:
[ {A} ` A
Hyp
Truth Introduction:
And Introduction:
`T
`A
TI
`B
`A^B
And I
Or Introduction:
`A
`A_B
`B
OrL I
Not Introduction:
`A_B
OrR I
Implication Introduction:
[ {A} ` F
` ¬A
[ {A} ` B
Not I
`A)B
Imp I
Elimination Rules
False Elimination:
Not Elimination:
F
C
¬A A
FE
C
Not E
And Elimination:
A^B
C
A
..
.
C
A_B
A^B
AndL E
Or Elimination:
B.
..
C
C
AndR E
Implication Elimination:
A
..
.
C
C
B.
..
C
A)B
Or E
A
C
Page 16
B.
..
C
Imp E
CS477 Spring 2013
Midterm
Name:
First Order Logic
All rules from Propositional Logic included
` [t/x]
` 9x.
` [y/x]
` 8x.
` 9x.
Ex I
[ {( [y/x])} ` '
`'
provided
S
y2
/ f v(') [ (f v( ) \ {x}) [
` 8x.
All I
provided
S
y2
/ (f v( ) \ {x}) [
02
Ex E
02
[ { [t/x]} ` '
`'
f v( 0 )
All E
f v( 0 )
Floyd-Hoare Logic
Assingment Rule
{|P [e/x]|} x := e {|P |}
Sequencing Rule
{|P |} C1 {|Q|} {|Q|} C2 {|R|}
{|P |} C1 ; C2 {|R|}
Rule of Consequence
P ) P 0 {|P 0 |} C {|Q0 |} Q0 ) Q
{|P |} C {|Q|}
If Then Else Rule
{|P ^ B|} C1 {|Q|} {|P ^ ¬B|} C2 {|Q|}
{|P |} if B then C1 else C2 {|Q|}
While Rule
{|P ^ B|} C {|P |}
{|P |} while B do C {|P ^ ¬B|}
Weakest Precondition and Verification Condition Generation
wp (x := e) Q = Q[x ) e]
wp (C1 ; C2 ) Q = wp C1 (wp C2 Q)
wp (if B then C1 else C2 fi) Q =
(B ^ (wp C1 Q)) _ ((¬B) ^ (wp C2 Q))
wp (while B inv P do C od) Q = P
vcg (x := e) Q = true
vcg (C1 ; C2 ) Q = (vcg C1 (wp C2 Q)) ^ (vcg C2 Q)
vcg (if B then C1 else C2 fi) Q = (vcg C1 Q) ^ (vcg C2 Q)
vcg (while B inv P do C od) Q =
((P ^ B) ) (wp C P )) ^ (vcg C P ) ^ ((P ^ (¬B)) ) Q)
Page 17