版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、1.3 Predicates and QuantifiersIntroduction (1) propositional logic cannot adequately express the meaning of statements“Every computer connected to the university network is functioning properly”Can not conclude“MATH3 is functioning properly”“CS is under attack by an intruder”Can not conclude using t
2、he rules of propositional logic“There is a computer on the university network that is under attack by an intruder”.predicate logic: predicate, quantifiers2022/8/2811.predicate (1) Consider the statement “x is greater than 3”. xsubject of the statement “is greater than 3”predicate, property of the su
3、bject. (2) P(x) “x is greater than 3” P”greater than 3”(predicate) P(x) is also said to be the value of propositional function P at x. 2022/8/282(3) P(x)”x is greater than 3”, propositional function P(4)proposition ,true P(2)proposition, false(3)Example2(p31) A(x)”Computer x is under attack by an in
4、truder.” CS2, MATH1 are under attack. A(CS1)false A(CS2)true A(MATH1)true(4) Statements can involve more than 1 variable. Example 3 (page 31): Q(x,y)”x=y+3” Q(1,2)false Q(3,0)true2022/8/283(5) In general, A statement of the form P(x1,x2,xn) is the value of the propositional function P at the n-tuple
5、 (x1,x2,xn) , and P is called a n-ary predicate.(6)Predicates are used in the verification that computer programs produce the desired output when given valid input.Preconditionvalid inputPostconditionthe conditions that output should satisfy.2022/8/284(7) quantifiers(量詞)a range of elementsuniversal
6、quantifiers(全稱(chēng)量詞)existential quantifiers(存在量詞)predicate calculus(謂詞演算)the area of logic that deals with predicate and quantifiers.2022/8/2852. Universal Quantifier(1) domain (or Universe of Discourse )個(gè)體域 a set containing all the values of a variable(2) Definition 1 (page 34) The universal quantific
7、ation of P(x) is the statement “P(x) for all values of x in the domain.” x P(x) ,read “for all x P(x)”or “for every x P(x)”A counterexample of x P(x) :an element makes P(x) to be false.2022/8/286 (3) Example 8(page 34) P(x)”x+1x” the domainall real numbers How about x P(x) ? Answer: x P(x) true(4) E
8、xample 9 (page 35) Q(x)”x0”. the domain integers Show x P(x) is falseSolution: giving a counterexample. X=0(6) Further explanation the domain finite set x1,x2,xn x P(x) is the same as P(x1) / P(x2) / / P(xn) 2022/8/288(7) Example 11 (page 35) P(x)” x23” the domain all real numbers Consider x P(x) So
9、lution: x P(x) is true Why? (x can be 3.5, 4, ., which makes is P(x) is true)2022/8/2812(3) Example 15 (page 36) Q(x)”x=x+1” the domain all real numbers Consider x Q(x) Solution: For every real number x, Q(x) is false. Therefore, x Q(x) is false2022/8/2813(4) If the domain is a finite set, i.e., x1,
10、 x2, , xn , then x P(x) is the same as P(x1) / P(x2) / P(xn)2022/8/2814(5) Example 16 (page 37) P(x)”x210” the domain”all the positive integers not exceeding 4” Consider x P(x) Solution: universe of discourse=1, 2, 3, 4 x P(x) is the same as P(1) / P(2) / P(3) / P(4) x P(x) is true because P(4) is t
11、rue.2022/8/2815(6) SummaryStatement When True? When False x P(x) P(x) is true There is an x for for all x which P(x) is false x P(x) There is an x P(x) is false for for which P(x) every x is true 2022/8/28164. Other quantifiersThe most often quantifier is uniqueness quantifierdenoted by !xP(x), or 1
12、x P(x)5. Quantifiers with restricted domains(1)There is a condition after quantifier.(2)Example x 0), y0(y3 0)and z0(z2=2), if the domain is the real numbers.(3) x 0) is the same as x (x 0)(4) z(z0z2=2)6. Precedence of Quantifiers: and have higher than all logical operators.2022/8/28177. Binding Var
13、iables (變量約束)Bound Variable and Free Variable (約束變量和自由變量)Example 18 (page 38) (a) x Q(x, y) xbound variable yfree variable (b) x ( P(x) / Q(x) ) / x R(x) the scope of bound variable2022/8/28187. Logical equivalences involving quantifiers(1)definition3iff they have the same truth value no matter whic
14、h predicates are substituted into these statements and which domain is used for the variables in these propositional functions.notation: ST(2)Example 19 (p39) show x(P(x)Q(x) and xP(x)xQ(x) are logically equivalent.Solution: see blackboard. x(P(x)Q(x) xP(x)xQ(x) 2022/8/28198. Negations(1) “Every stu
15、dent in the class has taken a course in calculus” x P(x) Here, P(x)”x has taken a course in calculus”The negation is “It is not the case that Every student in the class has taken a course in calculus” or “There is a student in the class who has not taken a course in calculus” x P(x) x P(x) x P(x) so
16、lution: see blackboard2022/8/2820(2) “There is a student in the class who has taken a course in calculus” x Q(x) Here, Q(x)”x has taken a course in calculus”The negation is “It is not the case that there is a student in the class who has taken a course in calculus” or “Every student in the class has
17、 not taken a course in calculus” x Q(x) x Q(x) x Q(x)solution: see blackboard2022/8/2821De Morgans law for quantifiers x P(x) x P(x) x Q(x) x Q(x)2022/8/2822(3) Example 21 (page 41) What is the negations of the statements x (x2x) and x (x2=2) Solution: x (x2x) x (x2x) x (x2x) .(1) x (x2=2) x (x2=2)
18、x (x22) .(2) The truth values of these statements depends on the domain. For (1), use 0.5, 3 and 2, 5 to check For (2), use 0,1 and 1,2 to check2022/8/2823(4) Example 22 (page 41) show that x (P(x)Q(x) and x (P(x) Q(x) are logically equivalent.Solution: see blackboard.2022/8/28249. Translating from
19、English into logical expressionExample 23 (page 42) Express the statement “Every student in this class has studied calculus” in predicates and quantifiers.Solution:C(x)”x has studied calculus” the domainall the students in the class x C(x)2022/8/2825(2) Way 2: the domain all people “For every person
20、 x, if person x is in this class then x has studied calculus.” S(x)person x is in this class C(x)person x has studied calculus x ( S(x)C(x) ) (correct) x ( S(x) / C(x) ) (wrong, why?)2022/8/2826Example 24 (page 42)Express the statements below in predicates and quantifiers. “Some students in this class has visited Mexico” (1) and “Every student in
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2024抵押借貸合同范文
- 2024咨詢服務(wù)合同范本標(biāo)準(zhǔn)范文
- 廣東省珠海市七年級(jí)上學(xué)期語(yǔ)文期中試卷7套【附答案】
- 2024藥品代理合同范本
- 單位團(tuán)購(gòu)房產(chǎn)轉(zhuǎn)讓合同范本
- 企業(yè)財(cái)產(chǎn)出售協(xié)議樣式
- 2024年農(nóng)村房屋轉(zhuǎn)讓協(xié)議范本
- 七年級(jí)地理上冊(cè)5.1《世界的人口》教案粵教版
- 2024版標(biāo)準(zhǔn)家庭裝修協(xié)議
- 建筑外墻保溫工程施工合同
- 藝術(shù)設(shè)計(jì)就業(yè)職業(yè)生涯規(guī)劃
- 《狙擊手》和《新神榜楊戩》電影賞析
- 槍庫(kù)應(yīng)急處置預(yù)案
- 老年患者術(shù)后譫妄的護(hù)理干預(yù)
- 《凸透鏡成像的規(guī)律》課件
- 倉(cāng)庫(kù)管理中的客戶服務(wù)和溝通技巧
- 規(guī)劃選址及用地預(yù)審
- 土砂石料廠項(xiàng)目融資計(jì)劃書(shū)
- 2024年給藥錯(cuò)誤護(hù)理不良事件分析持續(xù)改進(jìn)
- 郵政營(yíng)銷(xiāo)策劃方案
- 國(guó)際貿(mào)易法與跨境業(yè)務(wù)合規(guī)的風(fēng)險(xiǎn)管理與應(yīng)對(duì)策略
評(píng)論
0/150
提交評(píng)論