DM

时间:2023-01-04 22:31:09

Chapter1 propositon Logic

1.1propositon

  A declarative sentence   With a unique value.

  • A proposition can be represented by a proposition variable (i.e., a symbol).
  • A simple statement can be represented by an atom proposition
  • More than one atom proposition can be combined into a compound statement

logical connective not,and,or,if then,if and only if

  • exlusive disjunction i.e. xor (┐p ∧ q) ∨(p ∧ ┐q)
  • Implication p → q is false when p1&&q0

e.g.

p implies q

Since p, then q

q, if p

q whenever p

p only if q

q is necessary for p

┐p unless q

Unless q otherwise not p

if p:充分条件;only if q 必要条件(被指,right hand side,后件)

-Equivalence biconditional

1.2Propositional Well-Formed Formula

A symbol string of propositional variables connected by logical connectives and parentheses by some logical relation.

detailed definition of WWF:

  1. A single propositional variable is a WFF, called atom propositional WFF.

    2.If A is a WFF, then ┐A is a WFF.
  2. If both A and B are WFFs, then A∧B, A∨B, A→B, A↔B are WFFs.
  3. A symbol string generated by the above rules (1)~(3) in finite times is a WFF.

Layers of WFF using the above constructing rules how many time

definition

  1. WFF A is with layer 0, if A is an Atom WFF
  2. A is n+1 (n≥0) layer WFF, if one of the following conditions holds:

    (a) A= ┐B, where B is n layer WFF;

    (b) A= B∧C, where B, C are i and j layer WFFs respectively, and n = max(i, j)

    (c) A=B∨C, where B, C are defined as (b);

    (d) A=B→C, where B, C are defined as (b);

    (e) A=B↔C, where B, C are defined as (b);
  3. If the layer of WFF A is k, then A is called k layer WFF

assignments

  • Let p1, p2, …, pn be all propositional variables in WFF A, an assignment or explanation to A is defined as the assignment of a truth value to each pi.
  • A truth table of WFF A is a table, where each line denotes a possible assignment to A, with the corresponding value of A.
  1. A is a Tautology if the value of A is always True for any possible assignment to A.
  2. A is a Contradiction if the value of A is always False for any possible assignment to A.
  3. A is a Satisfiable WFF if it is not a contradiction.

e.g. A tautology is (necessarily) satisfiable

1.3Propositional Equivalences

Two WFFs A and B are called logically equivalent, denoted by A<=>B (or A≡B), if WFF A↔B is a tautology(having same truth table)

determine Logical Equivalent WFFs

  • 24 Logical Basic Equivalences / Rules
  1. Double negation law-双重否定律

    A <=> ┐┐A (2.1)
  2. Idempotent laws-等幂律

    A <=> A ∨ A, A <=> A ∧ A (2.2)
  3. Commutative laws-交换律

    A ∨ B <=> B ∨ A, A ∧ B <=> B ∧ A (2.3)
  4. Associative laws-结合律

    (A ∨ B)∨C <=> A ∨ (B∨C) (A ∧ B)∧C <=> A ∧ (B∧C) (2.4)
  5. Distributive laws-分配律

    A∨(B∧C)<=>(A∨B)∧(A∨C) (∨对∧的分配律)

    A∧(B∨C)<=>(A∧B)∨(A∧C) (∧对∨的分配律) (2.5)
  6. de Morgan’s laws-德摩根律

    ┐(A∨B)<=>┐A∧┐B, ┐(A∧B)<=>┐A∨┐B (2.6)
  7. Absorption laws-吸收律

    A∨(A∧B)<=>A, A∧(A∨B) <=> A (2.7)
  8. Domination laws-零律

    A∨1<=>1, A∧0 <=> 0 (2.8)
  9. Identity laws-同一律

    A∨0<=>A, A∧1<=>A (2.9)
  10. Negation laws 1-排中律

    A∨┐A<=>1 (2.10)
  11. Negation laws 2-矛盾律

    A∧┐A<=>0 (2.11)
  12. Logical Equivalences involving Implication-蕴涵等值式 (here shorten as Implication rule)

    A→B <=> ┐A∨B (2.12)
  13. Logical Equivalences involving biconditional - 等价等值式

    A↔ B<=> (A→B) ∧ (B→A) (2.13)
  14. Logical Equivalences involving implication 2 - Contraposition 假言易位

    A→B 假言易位 ┐B→ ┐A (2.14)
  15. Logical Equivalences involving biconditional 2 - 等价否定等值式

    A↔ B假言易位 ┐A↔ ┐B (2.15)
  16. Logical Equivalences involving implication 3- 归谬论

    (A→B)∧(A→┐B) <=> ┐A (2.16)

Replacement Rule of Equivalences

Definition:

Replacement Rule of Equivalences - 置换规则

Let Φ(A): A WFF with A as its subwff, Φ(B): the WFF replacing all A with B.

If A <=> B, then Φ(A) <=>Φ(B).

Usage: do calculations

1.4Disjunctive Normal Form (DNF)-析取范式

Conjunctive Normal Form (CNF) 合取范式

Literal

Definition.

A single propositional variable or its negation is called a literal.

fundamental disjunction

Definition.

is either a literal or a disjunction (∨) of two or more literals.

Theorem

(1) A Fundamental Disjunction is a Tautology iff it contains a propositional variable and its negation.

(2) A Fundamental Conjunction is a Contradiction iff it contains a propositional variable and its negation.

DNF

Definition.

A DNF of a WFF is either one Fundamental Conjunction or a Disjunction of two or more Fundamental Conjunctions.

A CNF of a WFF is either one Fundamental Disjunction or a Conjunction of two or more Fundamental Disjunctions.

Theorem

(1) A DNF is a Contradiction iff each Fundamental Conjunction of it is a Contradiction.

(2)A CNF is a Tautology iff each Fundamental Disjunction of it is a Tautology.

There always exist the DNF and CNF logically equivalent to a given propositional WFF.

为了清晰和无误,演算中利用交换律 使得每个简单析取式或合取式中命题变项的出现都是按字典顺序

FULL DNF

Minterm (Maxterm)

A Minterm (Maxterm) is defined as a Fundamental Conjunction (Disjunction) with n variables, where:

each variable and its negation do not occur at the same time

but one of them definitely occurs only once, and

the ith variable or its negation occurs at the ith position from the leftmost side.

Properties of Maxterm (same to minterm)

Given n variables, there will be 2n different Maxterms

One and only one assignment makes a Maxterm to be False (0)

Let a decimal number i denote the binary assignment with false value(The Only Assignment to make it False), then the Maxterm can be denoted as Mi

Theorem

Let mi and Mi be a Minterm and a Maxterm respectively, composed by propositional variables p1, p2, …, pn, then (not the binary form,which are same)

┐mi <=> Mi

┐Mi <=> mi

Full DNF

Definition

A DNF is called a Full DNF if all Fundamental Conjunctions in it are Minterms.

A CNF is called a Full CNF if all Fundamental Disjunctions in it are Maxterms.

Theorem

There exists the unique Full DNF and the unique Full CNF logically equivalent to a propositional WFF.

Generate DNF

Steps: 1. Generate a DNF / CNF;

Steps: 2. If necessary, extend the related Fundamental Conjunctions / Disjunctions;

Ai <=> Ai∨0 <=> Ai∨(pj∧┐pj) <=> (Ai∨pj)∧(Ai∨┐pj)

Steps: 3. Write all minterms (maxterms) by alpha-beta order;

Applications of Full DNF/CNF - 1

Find Assignments to make a WFF to be true or false.

If there are s (0≤s≤ 2^n) minterms in Full DNF A, then A has S assignments to make it true, and the other 2^n-s assignments make A to be false.

Applications of Full DNF/CNF - 2

To check the type of a WFF =

Let A be a WFF with n propositional variables, then

  1. A is a tautology iff the Full DNF of A contains all 2^n minterms;
  2. A is a contradiction iff the Full DNF of A contains no minterm;
  3. A is satisfiable iff the Full DNF of A contains at least one minterm.

    similarly

There are 2^n maxterms in a contradiction by Full CNF矛盾式无成真赋值,因此矛盾式的主合取范式含2^n (n为公式中命题变项个数) 个极大项

There is no maxterm in tautology by Full CNF重言式无成假赋值,因此主合取范式不含任何极大项

Then number of maxterms in a satisfiable Full CNF is definitely less than 2^n可满足式的主合取范式中极大项的个数一定小于2^n

Applications of Full DNF/CNF - 3

To check two WFFs logically equivalent or not

Applications of Full DNF/CNF - 4

Real applications.

Q:

(1) If select A, then also select C;

(2) If select B, then not select C;

(3) If not select C, then select either A or B.

Q: How to select them?

Solution: Let p: Select A; q: Select B; r: Select C. Then, by three constraints, we get,

(p→r) ∧ (q→┐r) ∧ (┐r→(p∨q))

then, we get the Full DNF as follows,

(p→r)∧(q→┐r)∧(┐r→(p∨q)) <=> m1 ∨m2 ∨m5

Since m1 = ┐p∧┐q∧r, m2 =┐p∧q∧┐r, m5=p∧┐q∧ r

Then, there are three possible solutions:

(a) Select C, but neither A nor B.

(b) Select B, but neither A nor C.

(c) Select both A and C, but not B.

from Full DNF get Full CNF

Let A be a wff with n propositional variables, and its Full DNF contains s (0≤s≤ 2n) minterms:

A <=> mi1 ∨mi2 ∨…∨mis , 0 ≤ ij ≤ 2n-1, j = 1, 2, …, s

the non-occurred minterms没出现的极小项 are mj1,mj2,…, mj(2n-s) , whose binary strings make ┐A to be true 它们的角标的二进制表示为┐A的成真赋值,因而┐A的主析取范式为

then, ┐A <=> mj1 ∨mj2 ∨…∨ mj(2n-s)

Thus,

A<=> ┐┐A <=> ┐(mj1 ∨mj2 ∨…∨ mj(2n-s) )

<=> ┐mj1∧┐mj2∧…∧┐ mj(2n-s)

<=> Mj1∧Mj2∧…∧ Mj(2n-s)

Then, we get Full CNF by Full DNF, and vice versa.

Functionally Complete Set of Logical Connectives 联结词的完备集(Self-study)

S0 = {┐,∧,∨};

S1={┐,∧,∨,→} S2={┐,∧,∨,→,↔}

S3={┐,∧} S4={┐,∨}

S5={┐,→} S6={↑} S7={↓} a|b<=>┐(a∧b)

1.6 Inferences by Propositional Logic


Inference/Reasoning:

a process from some premises to a conclusion

A valid inference.

Let A1, A2, …, Ak, B be all propositional WFFs. For any assignment to A1, A2, …, Ak, B, if

either A1 ∧ A2 ∧ … ∧ Ak is false/0,

or when A1 ∧ A2 ∧ … ∧ Ak is true/1, B is also true/1

then, the inference of B from premises A1, A2, …, Ak is valid/correct, and B is called a valid conclusion.

Remarks

  1. The premise is a set of finite WFFs, named Γ, then the inference can be denoted as Γ├B.

    Γ╞B if the inference is valid/correct, otherwise Γ B.

    Γ├B or {A1, A2, …, Ak}├B are called the formal structures of an inference.
  2. For the n propositional variables in A1, A2, …, Ak, B, and any assignment a1, a2, …, an (ai = 0/1, i =1, 2,…,n), there are four cases for the premises and conclusion:

    (1) A1∧A2∧…∧Ak is 0, and B is 0;

    (2) A1∧A2∧…∧Ak is 0, and B is 1;

    (3) A1∧A2∧…∧Ak is 1, and B is 0;

    (4) A1∧A2∧…∧Ak is 1, and B is 1.

    The inference is valid/correct iff there is no case (3).
  3. From remark 2, a Valid/Correct inference does not make the Conclusion B necessarily be True/1, which is different from traditional mathematical reasoning.

Equivalent Formal Structure of an Inferenceanother way to present

Theorem.

The inference of B from premises A1, A2, …, Ak is valid iff

the implication (A1∧A2∧…∧Ak) → B

is a Tautology.

Then, we get a new equivalent formal structure of an inference.

{A1, A2, …, Ak}├ B

can be written as an implication WFF

(A1∧A2∧…∧Ak) → B

Example 2. Writing the formal structure of inferences in Example 1.

(1) Premises: p, p→q

Conclusion: q

Inference: (p∧(p→q)) →q

(2)some calculation

Rules of Inferences

(A∧B) =>A Simplification 化简律

A =>(A∨B) Addition 附加律

(A→B)∧A=>B Modus ponens 假言推理

(A→B)∧┐B=>┐A Modus tollens 拒取式

(A∨B)∧┐B =>A Disjunctive syllogism 拒取三段论

(A→B)∧(B→C)=>(A→C) Hypothetical syllogism假言三段论

(A↔B)∧(B↔C)=>(A↔C) Equivalence syllogism等价三段论

Constructive dilemma

(A→B)∧(C→D)∧(A∨C) =>B∨D 构造性二难

(A→B)∧(┐A→B)∧(A∨┐A)=>B 构造性二难

Destructive dilemma

(A→B)∧(C→D)∧(┐B∨┐D) => (┐A∨┐C) 破坏性二难

reamarks

Each logical basic equivalence can derive two rules of inferences, e.g., A<=> ┐┐A can derive A => ┐┐A, and ┐┐A => A

Formal inference systems

  Natural inference system: The inference starts from any premises to get a conclusion by propositional calculus.
Axiomatic inference system: The inference only starts from some given axioms to get a correct conclusion by propositional calculus.

A natural inference system P includes:

  1. Alphabet 字母表

    (1) Propositional variables 命题变项: p, q, r, …, pi, qi, ri, …

    (2) Connectives 联结词符号: ┐, ∧, ∨, →, ↔

    (3) Parentheses and commas 括号与逗号: ( ), ,
  2. Formulas/WFFs 合式公式
  3. Rules of Inferences 推理规则(12条)

Solution. (1) Proof.

Premises: (前提):p∨q, q→r, p→s, ┐s

Conclusion (结论):r∧(p∨q)

① p→s Premise 前提引入

② ┐s Premise 前提引入

③ ┐p Modus tollens ①②拒取式

④ p∨q Premise 前提引入

⑤ q Disjunctive syllogism ③④析取三段论

⑥ q→r Premise 前提引入

⑦ r Modus ponens ⑤⑥假言推理

⑧ r∧(p∨q) Conjunction ⑦④合取

Two techniques for proofs/inferences – Additional Premises

The format of inferences: 有时推理的形式结构为

(A1∧A2∧…∧Ak) →(A→B)

The conclusion is also an implication, then we can move A as a new premise and the conclusion is only B

Premises 前提: p → q, q → r

Conclusion 结论: p → r

Proof. By Additional premises. 用附加前提证明法

① p Additional premises 附加前提引入

② p → q Premise 前提引入

③ q Modus ponens ①② 假言推理

④ q → r Premise 前提引入

⑤ r Modus ponens ③④ 假言推理

Two techniques for proofs/inferences – Proof by Contradiction

For the inference in format like

(A1∧A2∧…∧Ak )→B

if we let ┐B a new premise and finally we get a contradiction like (Ai∧┐Ai), then the inference is correct.

Example 7. Show the proof for the inference

Premises 前提: (p∧q)→r, ┐r∨s, ┐s, p

Conclusion 结论: ┐q

Proof. By contradiction.

① q The negation of conclusion结论的否定引入

② p Premise 前提引入

③ p∧q Conjunction ① ②合取

④ (p∧q)→r Premise 前提引入

⑤ r Modus ponens ③ ④假言推理

⑥ ┐r∨s Premise 前提引入

⑦ s Modus tollens ⑤ ⑥拒取式

⑧ ┐s Premise 前提引入

⑨ s ∧ ┐s Conjunction ①⑨合取

1.7First Oder Logic (FOL)一阶逻辑(Predicate Logic) 谓词逻辑

 Now begins the predicate logic

1.7.1First Order Logic (FOL):

An atomic proposition can be decomposed into Three elements: Individuals (个体词), Predicates(谓词) and Quantifiers(量词), to represent the inner logical relations and quantity relations

FOL is also called Predicate Logic谓词逻辑

  1. Individuals

    An Individual constant is just a certain object, denoted usually by a, b, c, …

    An individual variable is an abstract object or a class of objects, such as human, animal, …, denoted usually by x, y, z, …; Domain
  2. Predicate 谓词

    A function to represent the properties of individuals (个体词性质) and the relationships among individuals(个体词之间相互关系)
  1. x is a rational number. “… is a rational number” is a predicate, named F, and then “x is a rational number” is denoted as F(x). A predicate constant.
  2. Jack and Luca are in the same class. “… and … are in the same class” is also a predicate, named G, G(a, b), a: Jack, b: Luca.
  3. x and y have the relation M. “… and … have the relation M”. M(x, y). A predicate variable. Abstract.

    Generally, a predicate is written as a capital letter F, G, H, …

    Any proposition can be denoted as a 0-ary predicate.
  1. Quantifiers 量词

    To denote the quantity relations among individuals.

    (1) Universal Quantifier 全称量词: All individuals in the Domain. Such as “All… ”, “for each …”, “for any…”, symbolized by , and x denote all individuals in the Domain,

    xF(x): All x in the domain satisfy the property F.

    (2) Existential Quantifier 存在量词: One individual or some individuals in the Domain. Such as “(At least) One… ”, “There exists one ..”, symbolized by , and x denote some individuals in the Domain,

    xF(x): One/Some x in the domain satisfy the property F.

    In different domains, there may or may not be different symbolizations for the same statement.

    1.7.2 Well Formed fomulas

Alphabets in FOL language:

  1. Individual constants: a,b,c,…,ai,bi,ci,…,i≥1

  2. Individual variables: x,y,z,…,xi,yi,zi,…,i≥1

  3. Functions: f,g,h,…,fi,gi,hi,…,i≥1

  4. Predicates: F,G,H,…,Fi,Gi,Hi,…,i≥1

  5. Quantifiers: , 

  6. Connectives: ┐,∧,∨,→,↔

  7. Punctuation symbols: (), ,

DM的更多相关文章

  1. Atitit Data Matrix dm码的原理与特点

    Atitit Data Matrix dm码的原理与特点 Datamatrix原名Datacode,由美国国际资料公司(International Data Matrix, 简称ID Matrix)于 ...

  2. Atitit 常用二维码对比&lpar;QR、PDF417、DM、汉信码 Aztec code maxicode

    Atitit 常用二维码对比(QR.PDF417.DM.汉信码 Aztec code maxicode DM码则更"小",可在仅仅25mm²的面积上编码30个数字.但也就是因为太小 ...

  3. DM 多路径存储

    DM多路径存储 系统环境:RHEL5.4 small install  selinux and iptables disabled主机规划:主机网卡软件station133eth0: 192.168. ...

  4. osgi dm

    看了http://developer.51cto.com/art/200909/154863.htm 真心感到,最强大最有组织的技术网站还是 51cto,牛人应该也是最多的. 以前逛51cto的比较少 ...

  5. AI&comma;DM&comma;ML&comma;PR的区别与联系

    数据挖掘和机器学习的区别和联系,周志华有一篇很好的论述<机器学习与数据挖掘>可以帮助大家理解.数据挖掘受到很多学科领域的影响,其中数据库.机器学习.统计学无疑影响最大.简言之,对数据挖掘而 ...

  6. Rocky4&period;2下安装达梦&lpar;DM&rpar;6数据库

    1.准备操作系统 1.1 系统登录界面 1.2 操作系统版本信息 jdbh:~ # uname -ra Linux jdbh -x86_64 # SMP Fri Dec :: CST x86_64 G ...

  7. DW与DM

    DW组成部分简介 DW的组成部分有:针对数据源的分析.数据的ETL.数据的存储结构,元数据管理等. 数据源分析 主要是分析要抽取哪些数据,如何抽取(全量还是增量)?它的更新周期是怎么样的?它的数据质量 ...

  8. DB、ETL、DW、OLAP、DM、BI关系结构图

    DB.ETL.DW.OLAP.DM.BI关系结构图 在此大概用口水话简单叙述一下他们几个概念: (1)DB/Database/数据库——这里一般指的就是OLTP数据库,在线事物数据库,用来支持生产的, ...

  9. 財哥面京东dm的经历【帮財哥发的】

        关于面京东,感触仅仅有一个,虐的快吐血了.首先说京东分四个板块,有京东商城.京东金融.京东刚收购的拍拍和海外事业部.我这个职位主要是在金融部数据组做数据挖掘和机器学习,还有推荐系统.面试是在周 ...

  10. DW&comma;DM&comma;ODS的区别

    数据仓库的重要应用是将不同来源的数据和异构数据通过ETL整合在一起,为决策分析提供支撑,若在同一个数据库中分不同用户,此意义不大:假设所有有用户都在一个数据库里,如果因为某个原因数据库重启,那么会影响 ...

随机推荐

  1. MongoDB 文档的删除操作

    在db中删除数据是十分危险的事,建议使用logic delete,即在doc中增加一个field:IsDeleted,将其设置为1,表示该doc在逻辑上被删除,这种workaround将delete操 ...

  2. js判断手机访问PC端跳转到手机站

    <script type="text/javascript">(function() { //得到域名后缀 var path = location.pathname.s ...

  3. ImageTragick Exploit &amp&semi; Fix

    ImageMagick是一款广泛流行的图像处理软件,有无数的网站(国内国外都有)使用它来进行图像处理,本周二,ImageMagick披露出了一个严重的0day漏洞,此漏洞允许攻击者通过上传恶意构造的图 ...

  4. selenium下拉框选择

    下拉框结构如下,我需要选择的是new: html为: <select id="condition_type" name="condition_type" ...

  5. 利用openSSL 生成RSA公钥和密钥

    安装openssl for Windows. 之后开管理员控制台,打开openSSL 我的是 C:\OpenSSL-Win32\bin\openssl.exe 生成1024位的私钥,不指定的话默认20 ...

  6. AIX 第4章 指令记录

    root@db:/#lsdev -Cc disk --查看磁盘设备信息   -C customized -c class hdisk0       Available 00-08-00 SAS Dis ...

  7. JAVA与多线程开发(线程基础、继承Thread类来定义自己的线程、实现Runnable接口来解决单继承局限性、控制多线程程并发)

    实现线程并发有两种方式:1)继承Thread类:2)实现Runnable接口. 线程基础 1)程序.进程.线程:并行.并发. 2)线程生命周期:创建状态(new一个线程对象).就绪状态(调用该对象的s ...

  8. jdbc中的Statement对象和Preparedstatement对象的区别&comma;以及通过jdbc操作调用存储过程

    一. java.sql.*   和  javax.sql.*的包的类结构 |- Driver接口: 表示java驱动程序接口.所有的具体的数据库厂商要来实现此接口. |- connect(url, p ...

  9. 返回本机的外网ip地址

     ;             );             string ip = tempip.Replace("]", "").Replace(" ...

  10. &period;Net中获取打印机的相关信息

    原文:.Net中获取打印机的相关信息 新项目中牵涉到对打印机的一些操作,最重要的莫过于获取打印机的状态,IP等信息,代码量不大,但是也是自己花了一点时间总结出来的,希望能帮助需要的朋友. Printe ...