Professional Documents
Culture Documents
Nguyn Thanh Sn Khoa KHMT&CN H Bch Khoa TpHCM email : ntson@cse.hcmut.edu.vn http:\\www.cse.hcmut.edu.vn\~ntson
ntsn
NI DUNG
Chng 1. Tng quan Chng 2. Lun l mnh (propositional logic) Chng 3. Lun l v t (predicates logic)
Chng 1
ntsn
Chng 1
ntsn
Chng 1
ntsn
ntsn
Logic[12]
(Supplementary Chapters to Accompany Finite Mathematics (2nd. Ed.) by Stefan Waner & Steven R. Costenoble) Introduction Logic is the underpinning of all reasoned argument. The ancient Greeks recognized its role in mathematics and philosophy, and studied it extensively. Aristotle, in his Organon, wrote the first systematic treatise on logic. His work had a heavy influence on philosophy, science and religion through the Middle Ages.
Chng 1
ntsn
Logic[12]
But Aristotles logic was expressed in ordinary language, so was subject to the ambiguities of ordinary language. Philosophers came to want to express logic more formally and symbolically, more like the way that mathematics is written (Leibniz, in the 17th century, was probably the first to envision and call for such a formalism).
Chng 1
ntsn
Logic[12]
It was with the publication in 1847of G. Booles The Mathematical Analysis of Logic and A. DeMorgans Formal Logic that symbolic logic came into being, and logic became recognized as part of mathematics. This also marked the recognition that mathematics is not just about numbers (arithmetic) and shapes (geometry), but encompasses any subject that can be expressed symbolically with precise rules of manipulation of those symbols. It is symbolic logic that we shall study in this chapter.
Chng 1
ntsn
Logic[12]
Since Boole and DeMorgan, logic and mathematics have been inextricably intertwined. Logic is part of mathematics, but at the same time it is the language of mathematics. In the late 19th and early 20th century it was believed that all of mathematics could be reduced to symbolic logic and made purely formal.
Chng 1
ntsn
Logic[12]
This belief, though still held in modified form today, was shaken by K. Gdel in the 1930s, when he showed that there would always remain truths that could not be derived in any such formal system.
Chng 1
ntsn
Logic[12]
The study of symbolic logic is usually broken into several parts. The first and most fundamental is the propositional calculus. Built on top of this is the predicate calculus, which is the language of mathematics. We shall study the propositional calculus in the first six sections of this chapter and look at the predicate calculus briefly in the last two.
Chng 1
ntsn
Bc tranh v logic
Thut ng logic : Lun l hc (ting Vit) Logos (ting Hy lp) Hng tip cn : Logic l mt ngnh ca trit hc (truyn thng). Logic l mt ngnh ca ton hc (t th k 19).
Chng 1
ntsn
Bc tranh v logic
Lun l ton hc (mathematical logic) l mt ngnh ca ton hc lin h ti nhng h thng hnh thc (formal systems), dnh dng ti cch m ha nhng i tng ton hc : tp hp (set), s (number), chng minh (proof), tnh ton (computation). Lun l ton hc gm nhng ngnh : model theory, proof theory, set theory v recursion theory.
Chng 1
ntsn
Bc tranh v logic
Tn trc kia ca mathematical logic l symbolic logic v metamathematics. Thut ng symbolic logic c dng i khng vi philosophical logic. Mathematical logic l logic c m hnh v nghin cu mt cch ton hc. Mathematical logic l tn do Giuseppe Peano t.
Chng 1
ntsn
Bc tranh v logic
V c bn mathematical logic vn l logic ca Aristotle. T quan im k hiu th mathematical logic l mt ngnh ca i s tru tng (abstract algebra).
Chng 1
ntsn
Bc tranh v logic[Factasia]
Tng quan : Logic l c s hp l v l nn tng cho ton hc, khoa hc v k thut, c bit cho cng ngh thng tin.
Chng 1
ntsn
Bc tranh v logic[Factasia]
Logic l g ? i vi cc chuyn vin (techies) Mt ngn ng hnh thc c mt c php v ng ngha cht ch s tr thnh mt logic khi c cc qui lut dn ti cc l lun ng.
Chng 1
ntsn
Bc tranh v logic[Factasia]
Logic l g ? i vi cc nh t tng (thinkers) Logic l s nghin cu v nhng s tht cn thit v v nhng h thng hnh thc dn xut chng, ng thi khm ph ngha trit hc ca chng.
Chng 1
ntsn
Bc tranh v logic[Factasia]
Mt s sc thi mi ca mathematical logic : categorical logic computational logic domain theory foundations of mathematics
Chng 1
ntsn
Chng 1
ntsn
Chng 1
ntsn
Chng 1
ntsn
Chng 1
ntsn
Chng 1
ntsn
[1]
Inductive logic. Logic c qu trnh l lun t nhng trng hp c bit suy ra mt kt lun tng qut. Deductive logic. Logic c qu trnh l lun t mt pht biu tng qut suy ra mt kt lun c bit.
Chng 1
ntsn
Inductive logic
[1]
c dng trong cc tnh hung khng y thng tin. Thi gian ly thng tin lu. Chi ph ly thng tin cao. Ch rt ra c cc kt lun tm thi v thng k.
Chng 1
ntsn
[7]
Lun l mnh (propositional logic) l i s boolean. First-order logic c khi nim vi mi v c mt. Higher-order logic l lun v sets v functions. p dng vo vic kim tra phn cng. Modal/temporal logics bn v ci g phi (must, or may), c xy ra (happen). ...
Chng 1
ntsn
[2]
[2]
C php cho bit ci g c logic chp nhn. Ng ngha l ngha thc t ca cc i tng trong logic. C php l hnh thc cn ng ngha l ni dung ca cc i tng trong logic. H thng chng minh sn sinh cc i tng mi t cc i tng c sn.
Chng 1
ntsn
Cu trc kho st
Mi logic c kho st theo trnh t sau : Cu trc. Ng ngha. Suy lun.
Chng 1
ntsn
Mt vi thut ng
[7]
Statements language Statements are true, false or meaningless Declarative assertions Informal (e.g. English) or formal language (eg. C, Java) Entailment = logical consequence Logical proofs model human reasoning Interpretations and Validity Satisfiable/unsatisfiable = consistent/inconsistent Entail = Inference = implication Deducible = Provable
Chng 1
ntsn
ntsn
Ni dung
I. Cu trc ca lun l mnh (LLM) II. Suy lun t nhin trong LLM III. Ng ngha ca LLM
Chng 1
ntsn
ntsn
Thut ng[11]
Lun l mnh (LLM) c tn ting Anh : Propositional logic. Propositional Calculus. T calculus l mt thut ng chung cho bt k lnh vc ton hc lin quan ti vic tnh ton (calculating). Th d : s hc c gi l calculus of numbers.
Chng 1
ntsn
Thut ng[11]
Propositional Calculus l calculus of propositions. A proposition, or statement, is any declarative sentence which is either true (T) or false (F).
Chng 1
ntsn
Chng 1
ntsn
Cu khai bo[11]
K hiu : cu khaibo (kb) v khng khaibo (kkb). Th d : The sentence "2+2 = 4" is a statement. The sentence "1 = 0" is also a statement. "It will rain tomorrow" is a proposition. "Solve the following equation for x" is not a statement.
Chng 1
ntsn
Cu khai bo[11]
Th d : "Mars is not a planet a. is a proposition with truth value T b. is a proposition with truth value F c. is not a proposition Which one is true ?
Chng 1
ntsn
Self-Referential Sentences[11]
Liar's paradox (vn v vic nh thc tr). Th d : "I am lying t A = "I am lying. Nu A c gi tr ng th A sai v A l cu ni lo. Nu A sai th vic t tuyn b ni lo l ng v vy A ng.
Chng 1
ntsn
Self-Referential Sentences[11]
Nhng trng hp tng t : "This statement is false "This statement is true (it is the negation of the liar's paradox.) Self-referential sentences l nhng cu t tham kho ti chnh mnh. LLM khng kho st loi cu self-referential.
Chng 1
ntsn
Cu khai bo
Th d : * i s l mt ngnh ton hc. * Mi ngi u c mt c tin. * Mt tri l mt khi vung. * Ting g tra gy khan bn i. * Hy gi mail cho ti. * i, tri nng nc lm sao !.
Chng 1
ntsn
Chng 1
ntsn
Chng 1
ntsn
Cng thc
Th gii thc to s lin kt gia cu tng kh nng din t. Lun l mnh cng m phng li s lin kt ny.
Cu + cu + cu + cu
(AB)(C(D))
Ton t kt ni
Ch mt s lin t trong th gii thc c m phng li trong LLM thnh cc ton t.
hoc, hay, v, nu th , khng, tng ng, Th gii thc Lun l mnh
Chng 1
ntsn
Cng thc
Cng thc hon ho l s kt hp hu hn ln cc CTN vi cc ton t , , , . Cng thc hon ho (well-formed formula) c gi tt l cng thc (CT) hay WFF. V l thuyt ch cn 3 ton t l to thnh LLM : (, , ) hay (, , )
Chng 1
ntsn
Cng thc
Tp cng thc nguyn sinh ra tp cng thc.
Tp cng thc
Chng 1
ntsn
Cy phn tch
Cy phn tch (parse tree) l biu din bng th ca mt cng thc. Cy phn tch l cy c gc, nh l cc ton t v l l cc CT nguyn. Th d : (Q P) ((Q Q) Q)
Chng 1
ntsn
Cy phn tch
ng (path) ca mt cy phn tch l mt hnh trnh i t gc n nh l. Th d :
X
X Z
Chng 1
ntsn
Cy phn tch
Chiu cao (height) ca 1 cy phn tch l s cnh ca con ng di nht cng 1. Th d :
X
Y
Z
Y Z
Z X
Chiu cao l 4
Chiu cao l 5
Chng 1
ntsn
Vn ca cc ton t
Cc lin t or, and, not, if trong ngn ng t nhin ch kt hp nhng cu khai bo trong mt s bi cnh c th. Trong mt s bi cnh khc s kt hp tr thnh v ngha. Cc ton t ca LLM , , , kt hp c mi cng thc.
Chng 1
ntsn
Vn ca cc ton t
Th d :
AB C Hm nay tri ma Lun l mnh Th gii thc
Vn ph nh[11]
Cu "There is life on Mars. c 1 trong nhng cu sau l cu ph nh ca n. a. There is some life on Mars. b. There may be life on Mars. c. There may be no life on Mars. d. There is no life on Mars. e. There is probably no life on Mars. Hy chn cu ng (ch c 1 cu) ?
Chng 1
ntsn
Vn ph nh[11]
If P : "This galaxy will ultimately disappear into a black hole" and Q : "2+2 = 4," what is P Q? Solution P Q : "This galaxy will ultimately disappear into a black hole and 2+2=4," or the more astonishing statement : "Not only will this galaxy ultimately disappear into a black hole, but 2+2 = 4!" Before We Go On ... Q is true, so if P is true then the whole statement P Q will be true. On the other hand, if P is false, then the whole statement P Q will be false.
Chng 1
ntsn
Vn ph nh[11]
What does the statement P (Q) say? Solution P (Q) says: "This galaxy will ultimately disappear into a black hole and 2+2 4," or "Contrary to your hopes and aspirations, this galaxy is doomed to eventually disappear into a black hole; moreover, two plus two is decidedly different from four!" Before We Go On ... Since Q is false, the whole statement P (Q) is false (regardless of whether P is true or not).
Chng 1
ntsn
Vn ph nh
Ngn ng t nhin khng nh ngha dng ph nh ca cc cu trc cu : (if x then y), (x and y), (x or y). Tuy nhin LLM c cc dng not(if x then y), not(x and y), not(x or y).
Chng 1
ntsn
Ht slide
Chng 1
ntsn
ntsn
Cu khai bo
1. Pht biu no l cu khai bo v ch ra thc tr : a. Khng c m my tnh. b. Thnh ph M Tho u ? c. sng Si Gn khng c c su. d. Vic lp trnh rt hng th. e. A(BC) = (AB)(AC), A,B,C l tp hp. f. Hm nay l ngy th 3. g. 2 + 3 = 6. h. H Ni l th ca VN. i. Thit k CSDL l bt buc khi lp trnh.
Chng 1
ntsn
Cu khai bo
2. Tm ph nh ca cc cu khai bo sau : a. sng Si Gn khng c c su. b. A(BC) = (AB)(AC). c. Hm nay l ngy th 3. d. 2 + 3 = 6 e. H Ni l th ca nc VN. f. Nu c tin ti s mua xe phn khi ln. g. Thit k CSDL l bt buc khi lp trnh. h. Ti ti lp mi khi gn c k thi. i. S x l nguyn t nu n khng c c s khc 1, x.
Chng 1
ntsn
Cu khai bo
3. Biu din on vn sau bng lun l mnh : Nu anh ta mua xe th anh ta trng s hoc tha hng gia ti. Anh ta khng tha hng gia ti. Vy nu anh ta khng trng s th anh ta khng mua xe.
Chng 1
ntsn
Cu khai bo
4. Din t cc cng thc lun l mnh bng cc pht biu (cu khai bo) : M = Hm nay th 5, N = i d ngoi P = Cu c. 1. M (N P) 2. M N 3. P M 4. N M 5. M (P N)
Chng 1
ntsn
Ht slide
Chng 1
ntsn