Lecture#2
Propositional Logic
" / / ' ' fal sum " toll om " " absurdum " - - PowerPoint PPT Presentation
Lecture # 2 Propositional Logic proposition " a declarative sentence that is either " : True ( T / 1) or False ( F / / ) Ip ' ' " / / ' ' fal sum " toll om " " absurdum " ) stand in for propositions
Lecture#2
Propositional Logic
proposition
" : a declarative sentencethat is either True (T/1)Ip
)
"toll om "/ ' 'falsum ' '/
"absurdum "propositional variables (
e.g. , " p " , "g
") stand in for propositions , and help us focus on the logic (ratherthanthe propositions themselves) we often prefer to use variables to refer to atomic propositions , which cannot be expressed in terms of simpler propositions .p
and of "::: :::
:::: cinnamon
in order of decreasing precedence
TP n of
disjunction is the typical programming language
"or " e.g .def foo ( x , y)
:if
x soy s o
: raise Exception L" no negative uipnts ") exclusive or is often implied up the English "or " e -g . " you can have cake of ice cream for dessert . "many
rows in a truth table for a proposition of N variables ?n
e.g . N -e.g
Nzoo
Pq
Pqr_
pqrs_
T
T
l l l l.
O l lApplying logic to English propositions
:p
= " I love cats "computer
science is a science " r = " 4 s too " read :p n of
qt⇒
n p v ng p n ( q v n r)gun of
= TT
p
v - p( p
n q) v - p v e of A contradiction is a proposition that is always false . e.g .F / t
p r ept (Cpr g)
u r p v - q)T
p →
(aka
. implication) read " if p , then q "1
ahypothesis/
↳ndusion/
antecedentconsequent
equivalent
to the "if " statement wiunpinatim programming !
e.g .if
card {}#
not a proposition !d
q
then
I can left this¥1 ¥ IF
←
we oozed?gw÷qF
F
T
If
kmstrong enough
then
I can lift this wight l l l?
I can if this weight only ifkm strong enough
.many
conditional in English
. some trickyp is sufficient for q
" "IaI "q
is necessary for p " " q unless 7 p "using just
n , n , V ?if Tp thenp T
←→
②←
"Ymir
alert
'