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整合在一起,为决策分析提供支撑,若在同一个数据库中分不同用户,此意义不大:假设所有有用户都在一个数据库里,如果因为某个原因数据库重启,那么会影响 ...
随机推荐
- [C#] 将NLog输出到RichTextBox,并在运行时动态修改日志级别过滤
作者: zyl910 一.缘由 NLog是一个很好用的日志类库.利用它,可以很方便的将日志输出到 调试器.文件 等目标,还支持输出到窗体界面中的RichTextBox等目标. 而且它还支持在运行时修改 ...
- Android 蓝牙开发
今天给大家带来蓝牙开发的基础,主要展示的是程序搜到蓝牙会通过list展示出来,并实时排序,远近与信号强弱 首先我们要有次jar包 watermark/2/text/aHR0cDovL2Jsb2cuY3 ...
- [转]awsome-java
原文链接 Awesome Java A curated list of awesome Java frameworks, libraries and software. Contents Projec ...
- Windows IIS 服务器配置HTTPS启用TLS协议。
好消息, 程序员专用早餐机.和掌柜说 ideaam,可以节省20元. 点击链接 或復·制这段描述¥k3MbbVKccMU¥后到淘♂寳♀ Windows IIS 服务器配置HTTPS启用TLS协议. ...
- pandas DataFrame(5)-合并DataFrame与Series
之前已经学过DataFrame与DataFrame相加,Series与Series相加,这篇介绍下DataFrame与Series的相加: import pandas as pd s = pd.Ser ...
- [转]用JAVA在读取EXCEL文件时如何判断列隐藏
原文地址:https://www.cnblogs.com/OwenWu/archive/2012/01/03/2310620.html org.apache.poi.hssf.usermodel.HS ...
- WEB API Filter的使用以及执行顺序
在WEB Api中,引入了面向切面编程(AOP)的思想,在某些特定的位置可以插入特定的Filter进行过程拦截处理.引入了这一机制可以更好地践行DRY(Don’t Repeat Yourself)思想 ...
- Mysql数据按天分区,定期删除
需求: 1.日志表需要按天分区 2.只保留一个月数据 方案: 1.创建两个事件,一个事件生成未来需要的分区,另一个事件定期检查过期数据(移除分区) 2.创建事件每小时执行一次,删除事件每天执行一次 3 ...
- Android全面屏适配
什么是全面屏 概念 很多人可能把全面屏跟曲面屏混淆,其实这是两个不同的概念. 一般手机的屏幕纵横比为16:9,如1080x1920.1440x2560等,其比值为1.777777……,全面屏手机出现之 ...
- [译] 理解 LSTM(Long Short-Term Memory, LSTM) 网络
本文译自 Christopher Olah 的博文 Recurrent Neural Networks 人类并不是每时每刻都从一片空白的大脑开始他们的思考.在你阅读这篇文章时候,你都是基于自己已经拥有 ...