Predicates and Quantifiers

1-3章在学习Propositional logic条件逻辑,现在开始学习predicate logic谓语逻辑

1.Predicate 

A Predicate is a proposition whose truth depends on the value of a variable(s).

2.Quantifiers 量词

量词取反:都是 - 不都是(不是“都不是”),存在 - 不存在

2.1 Negating Quantified Expressions

2.2 Translating

1.^ 和 ->分别在全称量词和存在量词下的含义

If S(x) represents the statement that person x is in this class C(x), which is the statement “x has studied calculus

∀x(S(x) → C(x) ) For every person x, if person x is a student in this class then x has studied calculus.

[Caution! Our statement cannot be expressed as ∀x(S(x)∧ C(x)) because this statement says that all people are students in this class and have studied calculus!]

if S(x)to represent “x is a student in this class. M(x), which is the statement “x has visited Mexico.C(x)be “x has visited Canada

∃x(S(x)∧ M(x))  there is a person x who is a student in this class and who has visited Mexico

[Caution! Our statement cannot be expressed as ∃x(S(x) → M(x)), which is true when there is someone not in the class because, in that case, for such a person x, S(x) → M(x)becomes either F → T or F →F,bothof which are true.]

3.“For every x in this class, x has the property that x has visited Mexico or x has visited Canada.”

if the domain for x consists of the students inthis class, this second statementcanbeexpressedas∀x(C(x)∨ M(x)). However, if the domain for x consists of all people, our statement can be expressed as “For every person x,if x is a student in this class, then x has visited Mexico or x has visited Canada.”   In this case, the statement can be expressed as ∀x(S(x) → (C(x) ∨ M(x)))

2.被动语态

L(x,y) be the statement “x loves y 如果表述为 There is somebody whom no one loves.因为表述将x和y的关系变换了主次关系,因此需要将x和y交换使用。还需注意A loves B变成B loves A这不叫被动语态

Ex : L(x,y) be the statement “x loves y,” where the domain for both x and y consists of all people in the world.

There is somebody whom no one loves.  此时变为L(y,x)  ∃x∀y¬L(y, x),X和y对应关系不变

3.引入额外变量支持复杂逻辑

1.There is exactly one person whom everybody loves.

首先将口语化表述转化为逻辑清晰的同义句:当不同的所有人中,都喜欢至少一个人时,而这些至少的一个人是同一个人。这个逻辑明显需要用implies

∃x(∀yL(y, x) ∧∀z((∀wL(w,z)) → z = x))

2.There are exactly two people whom Lynn loves.林恩爱的人只有两个。

lynn喜欢A且lynn喜欢Blynn喜欢C,C=A / B,因为他不能同时爱两个人,所以引入中间变量让A/B选择其一,这个思想类似将A的变量赋值给B变量

∃x∃y(x = y ∧ L(Lynn,x)∧L(Lynn,y)∧ ∀z(L(Lynn,z)→ (z = x∨z=y)))

4.错题集

  1. Everyone loves himself or herself. ∀xL(x,x) 和下面形成对比,由于没有额外的意思,可跳过赋值步骤

    There is someone who loves no one besides himself or herself.  ∃x∀y (L(x,y) ↔ x = y)

    很容易写成∃x(L(x,x)),但是这样没有体现loves no one besides,要强调的是无论y取何值都等于x

  2. ∃x(S(x) ∧ ∀y(F(y) 不要写成∃x∀y(S(x) ∧F(y))

3. Nested Quantifiers

1.Order matter

the order of the quantifiers is important, unless all the quantifiers are universal quantifiers or all are existential quantifiers.   

eg1:The state ments ∃y∀xP(x,y) and∀x∃yP(x,y)arenot logically equivalent.     

eg2:

∀x∀y∃zQ(x,y,z)

 “For all real numbers x and for all real numbers y there is a real number z such that x +y =z,”

∃z∀x∀yQ(x,y,z)

“There is a real number z such that for all real numbers x and for all real numbers y it is true that x + y = z,”

            2. Translating Mathematical Statements into Statements Involving Nested Quantifiers            

“Every real number except zero has a multiplicative inverse.”     

For every real number x, ifx= 0, then there exists a real number y such that xy = 1.    

∀x((x= 0) →∃y(xy = 1))

3.Translating from Nested Quantifiers into English 

∃x∀y∀z((F(x,y) ∧ F(x,z)∧ (y= z)) →¬F(y,z))

where F(a,b)means a and b are friends and the domain for x, y, and z consists of all students in your school.

there is a student x such that for all students y and all students z other than y,ifx and y are friends and x and z are friends, then y and z are not friends.

there is a student none of whose friends are also friends with each other

4.Translating English Sentences into Logical Expressions 

5.错题集

1.出现each otther,错误:M(x,y),正确:M(x,y)∧ M(y,x)

2.Every student in the class has either received an e mail message or received a telephone call from an other student in the class.

容易犯的错误是没有将全称量词和存在量词分开,因为这决定了括号中用^还是->

错误:∀x∃y(x = y ∧ (M(y, x) ∨ T(y, x))) 正确:∀x(∃y(x = y ∧ (M(y, x) ∨ T(y, x))))

3.将范围分开写

There are two different students in your class who between themhavesentane-mailmessagetoortele phoned everyone else in the class.

n)∃x∃y(x= y ∧ ∀z((z= x ∧ z=y) → (M(x,z) ∨ M(y,z)∨ T(x,z)∨ T(y,z))))

4.处理含exactly的题目

Every user has access to exactly one mailbox.

∀u∃m(A(u,m) ∧∀n(n= m →¬A(u,n))) 首先正常描述存在一个,再描述其他的均不存在

There are exactly two systems that monitor every re mote server.

∃x∃y(x ≠ y ∧ ∀z((∀s M(z,s)) ↔ (z = x ∨ z = y)))

个人觉得按照上面的思路也可写为∃x∃y(x ≠ y ∧∀z∀O((M(x,z)->M(y,z)

5.因果顺序

All users on the campus network can access all web sites whose url has a .edu extension.

whose url has a .edu extension.是因所以需要写在implies的左侧 ∀u∀s(E(s,.edu) → A(u, s))

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值