DM
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:
- A single propositional variable is a WFF, called atom propositional WFF.
2.If A is a WFF, then ┐A is a WFF.- If both A and B are WFFs, then A∧B, A∨B, A→B, A↔B are WFFs.
- 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
- WFF A is with layer 0, if A is an Atom WFF
- 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);- 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.
- A is a Tautology if the value of A is always True for any possible assignment to A.
- A is a Contradiction if the value of A is always False for any possible assignment to A.
- 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
- Double negation law-双重否定律
A <=> ┐┐A (2.1)- Idempotent laws-等幂律
A <=> A ∨ A, A <=> A ∧ A (2.2)- Commutative laws-交换律
A ∨ B <=> B ∨ A, A ∧ B <=> B ∧ A (2.3)- Associative laws-结合律
(A ∨ B)∨C <=> A ∨ (B∨C) (A ∧ B)∧C <=> A ∧ (B∧C) (2.4)- Distributive laws-分配律
A∨(B∧C)<=>(A∨B)∧(A∨C) (∨对∧的分配律)
A∧(B∨C)<=>(A∧B)∨(A∧C) (∧对∨的分配律) (2.5)- de Morgan’s laws-德摩根律
┐(A∨B)<=>┐A∧┐B, ┐(A∧B)<=>┐A∨┐B (2.6)- Absorption laws-吸收律
A∨(A∧B)<=>A, A∧(A∨B) <=> A (2.7)- Domination laws-零律
A∨1<=>1, A∧0 <=> 0 (2.8)- Identity laws-同一律
A∨0<=>A, A∧1<=>A (2.9)- Negation laws 1-排中律
A∨┐A<=>1 (2.10)- Negation laws 2-矛盾律
A∧┐A<=>0 (2.11)- Logical Equivalences involving Implication-蕴涵等值式 (here shorten as Implication rule)
A→B <=> ┐A∨B (2.12)- Logical Equivalences involving biconditional - 等价等值式
A↔ B<=> (A→B) ∧ (B→A) (2.13)- Logical Equivalences involving implication 2 - Contraposition 假言易位
A→B 假言易位 ┐B→ ┐A (2.14)- Logical Equivalences involving biconditional 2 - 等价否定等值式
A↔ B假言易位 ┐A↔ ┐B (2.15)- 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
- A is a tautology iff the Full DNF of A contains all 2^n minterms;
- A is a contradiction iff the Full DNF of A contains no minterm;
- 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
- 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. - 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). - 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:
- Alphabet 字母表
(1) Propositional variables 命题变项: p, q, r, …, pi, qi, ri, …
(2) Connectives 联结词符号: ┐, ∧, ∨, →, ↔
(3) Parentheses and commas 括号与逗号: ( ), , - Formulas/WFFs 合式公式
- 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谓词逻辑
- 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 - Predicate 谓词
A function to represent the properties of individuals (个体词性质) and the relationships among individuals(个体词之间相互关系)
- 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.
- 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.
- 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.
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:
Individual constants: a,b,c,…,ai,bi,ci,…,i≥1
Individual variables: x,y,z,…,xi,yi,zi,…,i≥1
Functions: f,g,h,…,fi,gi,hi,…,i≥1
Predicates: F,G,H,…,Fi,Gi,Hi,…,i≥1
Quantifiers: ,
Connectives: ┐,∧,∨,→,↔
Punctuation symbols: (), ,
DM的更多相关文章
- Atitit Data Matrix dm码的原理与特点
Atitit Data Matrix dm码的原理与特点 Datamatrix原名Datacode,由美国国际资料公司(International Data Matrix, 简称ID Matrix)于 ...
- Atitit 常用二维码对比(QR、PDF417、DM、汉信码 Aztec code maxicode
Atitit 常用二维码对比(QR.PDF417.DM.汉信码 Aztec code maxicode DM码则更"小",可在仅仅25mm²的面积上编码30个数字.但也就是因为太小 ...
- DM 多路径存储
DM多路径存储 系统环境:RHEL5.4 small install selinux and iptables disabled主机规划:主机网卡软件station133eth0: 192.168. ...
- osgi dm
看了http://developer.51cto.com/art/200909/154863.htm 真心感到,最强大最有组织的技术网站还是 51cto,牛人应该也是最多的. 以前逛51cto的比较少 ...
- AI,DM,ML,PR的区别与联系
数据挖掘和机器学习的区别和联系,周志华有一篇很好的论述<机器学习与数据挖掘>可以帮助大家理解.数据挖掘受到很多学科领域的影响,其中数据库.机器学习.统计学无疑影响最大.简言之,对数据挖掘而 ...
- Rocky4.2下安装达梦(DM)6数据库
1.准备操作系统 1.1 系统登录界面 1.2 操作系统版本信息 jdbh:~ # uname -ra Linux jdbh -x86_64 # SMP Fri Dec :: CST x86_64 G ...
- DW与DM
DW组成部分简介 DW的组成部分有:针对数据源的分析.数据的ETL.数据的存储结构,元数据管理等. 数据源分析 主要是分析要抽取哪些数据,如何抽取(全量还是增量)?它的更新周期是怎么样的?它的数据质量 ...
- DB、ETL、DW、OLAP、DM、BI关系结构图
DB.ETL.DW.OLAP.DM.BI关系结构图 在此大概用口水话简单叙述一下他们几个概念: (1)DB/Database/数据库——这里一般指的就是OLTP数据库,在线事物数据库,用来支持生产的, ...
- 財哥面京东dm的经历【帮財哥发的】
关于面京东,感触仅仅有一个,虐的快吐血了.首先说京东分四个板块,有京东商城.京东金融.京东刚收购的拍拍和海外事业部.我这个职位主要是在金融部数据组做数据挖掘和机器学习,还有推荐系统.面试是在周 ...
- DW,DM,ODS的区别
数据仓库的重要应用是将不同来源的数据和异构数据通过ETL整合在一起,为决策分析提供支撑,若在同一个数据库中分不同用户,此意义不大:假设所有有用户都在一个数据库里,如果因为某个原因数据库重启,那么会影响 ...
随机推荐
- linux软连接
linux软连接.类似window的快捷方式可以跨磁盘块(硬连接不可以). #软硬链接 ln -sf source target ln source target #硬链接不能跨分区 #批量解压文件 ...
- IoC之AutoFac(三)——生命周期
阅读目录 一.Autofac中的生命周期相关概念 二.创建一个新的生命周期范围 三.实例周期范围 3.1 每个依赖一个实例(InstancePerDependency) 3.2 单个实例(Sin ...
- 企业级镜像仓库Harbor
介绍: Habor是由VMWare公司开源的容器镜像仓库.事实上,Habor是在Docker Registry上进行了相应的企业级扩展,从而获得了更加广泛的应用,这些新的企业级特性包括:管理用户界面, ...
- Istio究竟是干嘛的?
要聊ServiceMesh,就不得不提Istio,它是ServiceMesh目前最流行的实践, 当微服务架构体系越来越复杂的时候,需要将“业务服务”和“基础设施”解耦,将一个微服务进程一分为二: 一个 ...
- 【原创 Hadoop&Spark 动手实践 4】Hadoop2.7.3 YARN原理与动手实践
简介 Apache Hadoop 2.0 包含 YARN,它将资源管理和处理组件分开.基于 YARN 的架构不受 MapReduce 约束.本文将介绍 YARN,以及它相对于 Hadoop 中以前的分 ...
- 【原创 Hadoop&Spark 动手实践 3】Hadoop2.7.3 MapReduce理论与动手实践
开始聊MapReduce,MapReduce是Hadoop的计算框架,我学Hadoop是从Hive开始入手,再到hdfs,当我学习hdfs时候,就感觉到hdfs和mapreduce关系的紧密.这个可能 ...
- MUI框架的缩写输入
html 上面--代表最小触发字符 下面--代表非必要完整触发字符 组件 触发字符 mDoctype(mui-dom结构) mdo ctype mBody(主体) mbo dy m ...
- [HDFS Manual] CH3 HDFS Commands Guide
HDFS Commands Guide HDFS Commands Guide 3.1概述 3.2 用户命令 3.2.1 classpath 3.2.2 dfs 3.2.3 envvars 3.2.4 ...
- C# Task中的Func, Action, Async与Await的使用
在说Asnc和Await之前,先说明一下Func和Action委托, Task任务的基础的用法 1. Func Func是一种委托,这是在3.5里面新增的,2.0里面我们使用委托是用Delegate, ...
- Houdini技术体系 基础管线(一) : Houdini与Houdini Engine的安装
Houdini 下载与安装 在官网 https://www.sidefx.com/download/ 下载最新的Production Build 版本,当前是16.5版本,需要注册帐号 PS:公司内网 ...