SlideShare ist ein Scribd-Unternehmen logo
1 von 30
Downloaden Sie, um offline zu lesen
1
Module 2:Logic
Prof. Shiwani Gupta
History and Applications
• Derived from the greek word ‘logos’.
• It is called science of thought.
• It starts from Aristotle.
• Real Life: Expert Systems, VLSI, Semantic Web.
• Computer Science: Godel’s incompleteness
theorem, Frame problem, Category theory, Curry-
Howard correspondence.
2
Statements in Grammar
• Declarative: The sky is blue.
• Imperative: Speak truth.
• Interrogative: Are you interested in maths?
• Exclamatory: Wow! You are so beautiful.
3
Propositional logic
• Propositional logic is the simplest logic – illustrates basic ideas.
• A declarative sentence which can be classified as either true or false.
• Simple statement
Eg. Aristotle was a philosopher
• Compound Statement
Eg. If you will commit a mistake, you will pay for it
Symbols of propositional logic
• Logical constants TRUE and FALSE are sentences
• Proposition symbols P,Q,S1,S2 are sentences
• ∧, V, , , are logical connectives
• parenthesis ( )
• Order of precedence (), , ∧, V, ,
Connectives
– If S is a sentence, S is a sentence
(negation)
– If S1 and S2 are sentences, S1  S2 is a sentence
(conjunction)
– If S1 and S2 are sentences, S1  S2 is a sentence
(disjunction)
– If S1 and S2 are sentences, S1  S2 is a sentence
(implication)
– If S1 and S2 are sentences, S1  S2 is a sentence
(biconditional)
6
Propositional logic: Semantics
Each model specifies true/false for each proposition symbol
E.g. P1 P2 P3
false true false
With these symbols, 8 possible models, can be enumerated automatically.
Rules for evaluating truth with respect to a model m:
S or S is true iff S is false
S1  S2 is true iff S1 is true and S2 is true
S1  S2 is true iff S1is true or S2 is true
S1  S2 is true iff S1 is false or S2 is true
i.e., is false iff S1 is true and S2 is false
S1  S2 is true iff S1S2 is true and S2S1 is true
Simple recursive process evaluates an arbitrary sentence, e.g.,
P1  (P2  P3) = true  (true  false) = true  true = true
Truth tables for connectives
If P then Q
 P V Q
If P then Q and If Q then P
(if and only if)
Truth tables for connectives
Converse, Inverse and Contrapositive
Given an implication "if p, then q“, we can create three related statements:
• A conditional statement consists of two parts, a premise in the “if” clause and a
conclusion in the “then” clause. For instance, “If it rains, then they cancel school.”
"It rains" is the premise.
"They cancel school" is the conclusion.
• To form the converse of the conditional statement, interchange the premise and the
conclusion.
The converse of "If it rains, then they cancel school" is
"If they cancel school, then it rains."
• To form the inverse of the conditional statement, take the negation of both the
premise and the conclusion.
The inverse of “If it rains, then they cancel school” is
“If it does not rain, then they do not cancel school.”
• To form the contrapositive of the conditional statement, interchange the premise
and the conclusion of the inverse statement.
The contrapositive of "If it rains, then they cancel school" is
"If they do not cancel school, then it does not rain."
Converse, Inverse and Contrapositive
Eg.1
Statement: If p, then q.
Converse: If q, then p.
Inverse: If not p, then not q.
Contrapositive: If not q, then not p.
Eg.2
Statement: If two angles are congruent, then they have the same measure.
Converse: If two angles have the same measure, then they are congruent.
Inverse: If two angles are not congruent, then they do not have the same measure.
Contrapositive: If two angles do not have the same measure, then they are not
congruent.
(Laws of Logic)
Logical equivalence - Biconditional
• Two sentences are logically equivalent iff true in same models:
i.e. they have identical truth tables
Involution law
• Two sentences are logically equivalent iff true in same models:
i.e. they have identical truth tables
α  α ≡ α α ∧ α ≡ α Idempotent Law
α  F ≡ α α ∧ T ≡ T Identity Law
α  T ≡ T α ∧ F ≡ F Annihilation Law
α   α ≡ T α ∧  α ≡ F Inverse Law
 T ≡ F  F ≡ T Complement Law
(Laws of Logic)
Logical equivalence
Validity (tautology), contradiction and contingency
A proposition which is always true is called tautology
α   α
A proposition which is always false is called contradiction
α ∧  α
A proposition which is neither a tautology nor a contradiction is
called contingency
 α   ,  α  , α  
Propositions quantifying
• All humans are mortal.
• Everything is perishable.
• Some people have pink hair.
• Nothing is perfect.
• There exists a white crow.
15
16
Quantifiers
• A quantifier is “an operator that limits the
variables of a proposition”
• Two types:
– Universal : the proposition is true for all, for
each, for every possible values in the universe
of discourse
– Existential : the proposition is true for some
value(s) in the universe of discourse
Universal quantification
•  <variables> <sentence> or A <variables> <sentence>
Example:
“All elephants are gray”
(x )(elephant(x) color(x, GRAY))
• x P is true in a model m iff P is true with x being each possible
object in the model
• Roughly speaking, equivalent to the conjunction of instantiations of P
Example:
“Everyone at NUS is smart”
x At(x,NUS)  Smart(x)
At(KingJohn,NUS) Smart(KingJohn)  At(Richard,NUS)
Smart(Richard)  At(NUS,NUS) Smart(NUS) …
Existential quantification
• <variables> <sentence> or E <variables> <sentence>
Example:
“Someone wrote Computer Chess”
(x write(x, COMPUTER-CHESS))
• x P is true in a model m iff P is true with x being some possible
object in the model
• Roughly speaking, equivalent to the disjunction of instantiations of P
Example:
Someone at NUS is smart:
x At(x,NUS)  Smart(x)
At(KingJohn,NUS)  Smart(KingJohn)  At(Richard,NUS) 
Smart(Richard)  At(NUS,NUS)  Smart(NUS)  ...
Properties of quantifiers
• x y is the same as y x
• x y is the same as y x
• x y is not the same as y x
• “There is a person who loves everyone in the house”
x y Loves(x,y)
• “Everyone in the house loves at least one person”
x y Loves(x,y)
Quantifier duality(De Morgan’s law for quantification):
each can be expressed using the other
• x Likes(x,IceCream) x Likes(x,IceCream)
• x Likes(x,Broccoli) x Likes(x,Broccoli)
Nested quantifiers
Examples on Predicate Logic
• x loves y Loves(x,y)
Everybody loves Jerry x Loves (x, Jerry)
• Everybody loves somebody x y Loves (x, y)
• There is somebody whom somebody loves y x Loves (x, y)
• Nobody loves everybody  x y Loves (x, y) = x y Loves (x, y)
• There is somebody whom Rachita doesn’t love y Loves (Rachita, y)
• There is somebody whom no one loves y x Loves (x, y)
• Everybody loves himself or herself x Loves(x,x)
Normal Forms
A problem in logic is to find whether a given statement is
tautology or contradiction via truth tables, especially where the
statement form may contain a large no. of variables.
Hence reduce statement form to normal form.
• Disjunctive Normal Form (dnf): A statement form consisting
of disjunction of fundamental conjuncts (minterm)
(P  Q  R) V (X   Y  Z) [SOP]
• Conjunctive Normal Form (cnf): A statement form consisting
of conjunction of fundamental disjuncts (maxterm)
( P V X)  (P V  Y)  (P V Z)  (…..) [POS]
DNF (SOP) to CNF (POS)
for resolution refutation
Disjunctive Normal Form
(P  Q  R) V (X   Y  Z)
Conjunctive Normal Form
( P V X)  (P V  Y)  (P V Z)  (…..)
Every sentence of propositional logic is logically equivalent
to a conjunction of disjuncts of literals
Conversion to CNF
• Eliminate α ß to (α  ß )  (ß  α )
• Eliminate α  ß to  α V ß
• CNF requires  to appear only with literals
For this apply
( α) ≡ α (double-negative elimination)
 (α  ß) ≡  α V  ß (de Morgan)
 (α V ß) ≡  α   ß (de Morgan)
• Now we have a sentence with nested  and V operators
applied to literals. Apply distributivity law distributing V
over 
Inference Rules
26
Principle of Mathematical
Induction
Mathematical induction is a form of mathematical proof.
Just because a rule, pattern, or formula seems to work for several
values of n, you cannot simply decide that it is valid for all
values of n without going through a legitimate proof.
The Principle of Mathematical Induction
Let Pn be a statement involving the positive integer n. If
1. Verification: P1 is true, and
2. Induction: the truth of Pk implies the truth of Pk+1 ,
for every positive integer k,
Conclusion: then Pn must be true for all integers n.
27
Example: Sum of Odd Integers
➢ Proposition: 1 + 3 + … + (2n-1) = n2
for all integers n≥1.
➢ Proof (by induction):
1) Basis step:
The statement is true for n=1: 1=12 .
2) Inductive step:
Assume the statement is true for some k≥1
(inductive hypothesis) ,
show that it is true for k+1 .
Example: Sum of Odd Integers
➢ Proof (cont.):
The statement is true for k:
1+3+…+(2k-1) = k2 (1)
We need to show it for k+1:
1+3+…+(2(k+1)-1) = (k+1)2 (2)
Showing (2):
1+3+…+(2(k+1)-1) = 1+3+…+(2k+1) =
1+3+…+(2k-1)+(2k+1) =
k2+(2k+1) = (k+1)2 .
We proved the basis and inductive steps,
so we conclude that the given statement true. ■
by (1)
29
Example: Sum of square of
Integers
➢ Proposition:
for all integers n≥1.
➢ Proof (by induction):
1) Basis step:
The statement is true for n=1: 12= .
2) Inductive step:
Assume the statement is true for some k≥1
(inductive hypothesis) ,
show that it is true for k+1 .
Sn = 12 + 22 + 32 + 42 + . . . + n2 = ( )( )
6
121 ++ nnn
( )( )
6
321
Example: Sum of square of
Integers
➢ Proof (cont.):
The statement is true for k:
We need to show it for k+1:
by (1)
12 + 22 + 32 + 42 + . . . + k2 = (1)
( )( )
6
121 ++ kkk
( )( )( )
6
3221 +++ kkk
( )( ) ( )
6
16121
2
++++
=
kkkk
( ) ( ) ( ) 
6
16121 ++++
=
kkkk ( ) 
6
6721 2
+++
=
kkk ( )( )( )
6
3221 +++
=
kkk
Showing (2): (12 + 22 + 32 + 42 + . . . + k2) + (k + 1)2

=
k k +1( ) 2k +1( )
6
+ (k + 1)2
12 + 22 + 32 + 42 + . . . + k2 + (k+1)2 = (2)
We proved the basis and inductive steps,
so we conclude that the given statement true.

Weitere ähnliche Inhalte

Was ist angesagt?

Does god exist
Does god existDoes god exist
Does god exist
Edz Gapuz
 
Rationalist epistemology – rene descartes
Rationalist epistemology – rene descartesRationalist epistemology – rene descartes
Rationalist epistemology – rene descartes
Aimee Hoover-Miller
 
Analysis - Inductive and Deductive Arguments
Analysis - Inductive and Deductive ArgumentsAnalysis - Inductive and Deductive Arguments
Analysis - Inductive and Deductive Arguments
Alwyn Lau
 
Ontology Powerpoint
Ontology PowerpointOntology Powerpoint
Ontology Powerpoint
ARH_Miller
 
Natural Theology
Natural TheologyNatural Theology
Natural Theology
John Lynch
 

Was ist angesagt? (20)

Square of opposition
Square of oppositionSquare of opposition
Square of opposition
 
Deductive And Inductive Reasoning
Deductive And Inductive ReasoningDeductive And Inductive Reasoning
Deductive And Inductive Reasoning
 
Logical fallacies
Logical fallaciesLogical fallacies
Logical fallacies
 
Does god exist
Does god existDoes god exist
Does god exist
 
Greek Philosophy.ppt
Greek Philosophy.pptGreek Philosophy.ppt
Greek Philosophy.ppt
 
Rationalist epistemology – rene descartes
Rationalist epistemology – rene descartesRationalist epistemology – rene descartes
Rationalist epistemology – rene descartes
 
Analysis - Inductive and Deductive Arguments
Analysis - Inductive and Deductive ArgumentsAnalysis - Inductive and Deductive Arguments
Analysis - Inductive and Deductive Arguments
 
Logic introduction
Logic   introductionLogic   introduction
Logic introduction
 
Introduction to Logic
Introduction to LogicIntroduction to Logic
Introduction to Logic
 
Existence of God and Problem of Evil
Existence of God and Problem of EvilExistence of God and Problem of Evil
Existence of God and Problem of Evil
 
Logic
LogicLogic
Logic
 
Logical positivism
Logical positivismLogical positivism
Logical positivism
 
logic - workbook summary
logic - workbook summarylogic - workbook summary
logic - workbook summary
 
Lecture of thermo-chemistry and calorimetery
Lecture of thermo-chemistry and calorimeteryLecture of thermo-chemistry and calorimetery
Lecture of thermo-chemistry and calorimetery
 
Metonymy 150705110256-lva1-app6892
Metonymy 150705110256-lva1-app6892Metonymy 150705110256-lva1-app6892
Metonymy 150705110256-lva1-app6892
 
Ambiguity
AmbiguityAmbiguity
Ambiguity
 
History of logic
History of logicHistory of logic
History of logic
 
Ontology Powerpoint
Ontology PowerpointOntology Powerpoint
Ontology Powerpoint
 
Aristotle
AristotleAristotle
Aristotle
 
Natural Theology
Natural TheologyNatural Theology
Natural Theology
 

Ähnlich wie Logic

Discrete-Chapter 05 Inference and Proofs
Discrete-Chapter 05 Inference and ProofsDiscrete-Chapter 05 Inference and Proofs
Discrete-Chapter 05 Inference and Proofs
Wongyos Keardsri
 
Discrete Mathematics - All chapters
Discrete Mathematics - All chapters Discrete Mathematics - All chapters
Discrete Mathematics - All chapters
Omnia A. Abdullah
 
Jarrar.lecture notes.aai.2011s.ch7.p logic
Jarrar.lecture notes.aai.2011s.ch7.p logicJarrar.lecture notes.aai.2011s.ch7.p logic
Jarrar.lecture notes.aai.2011s.ch7.p logic
PalGov
 

Ähnlich wie Logic (20)

dma_ppt.pdf
dma_ppt.pdfdma_ppt.pdf
dma_ppt.pdf
 
Valid &amp; invalid arguments
Valid &amp; invalid argumentsValid &amp; invalid arguments
Valid &amp; invalid arguments
 
Valid and Invalid Arguments.pptx
Valid and Invalid Arguments.pptxValid and Invalid Arguments.pptx
Valid and Invalid Arguments.pptx
 
Discrete Structure Lecture #5 & 6.pdf
Discrete Structure Lecture #5 & 6.pdfDiscrete Structure Lecture #5 & 6.pdf
Discrete Structure Lecture #5 & 6.pdf
 
Course notes1
Course notes1Course notes1
Course notes1
 
Lecture5
Lecture5Lecture5
Lecture5
 
Lecture 01.ppt
Lecture 01.pptLecture 01.ppt
Lecture 01.ppt
 
Chapter 01 - p2.pdf
Chapter 01 - p2.pdfChapter 01 - p2.pdf
Chapter 01 - p2.pdf
 
Discrete mathematics Chapter1 presentation.ppt
Discrete mathematics Chapter1 presentation.pptDiscrete mathematics Chapter1 presentation.ppt
Discrete mathematics Chapter1 presentation.ppt
 
AI-Unit4.ppt
AI-Unit4.pptAI-Unit4.ppt
AI-Unit4.ppt
 
DS Lecture 2.ppt
DS Lecture 2.pptDS Lecture 2.ppt
DS Lecture 2.ppt
 
1019Lec1.ppt
1019Lec1.ppt1019Lec1.ppt
1019Lec1.ppt
 
Discrete-Chapter 05 Inference and Proofs
Discrete-Chapter 05 Inference and ProofsDiscrete-Chapter 05 Inference and Proofs
Discrete-Chapter 05 Inference and Proofs
 
Discrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكرو
Discrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكروDiscrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكرو
Discrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكرو
 
Chapter1p1
Chapter1p1Chapter1p1
Chapter1p1
 
Discrete Mathematics - All chapters
Discrete Mathematics - All chapters Discrete Mathematics - All chapters
Discrete Mathematics - All chapters
 
Logic agent
Logic agentLogic agent
Logic agent
 
Quantification
QuantificationQuantification
Quantification
 
Jarrar.lecture notes.aai.2011s.ch7.p logic
Jarrar.lecture notes.aai.2011s.ch7.p logicJarrar.lecture notes.aai.2011s.ch7.p logic
Jarrar.lecture notes.aai.2011s.ch7.p logic
 
Chapter 01 - p3.pdf
Chapter 01 - p3.pdfChapter 01 - p3.pdf
Chapter 01 - p3.pdf
 

Mehr von Shiwani Gupta

Mehr von Shiwani Gupta (20)

ML MODULE 6.pdf
ML MODULE 6.pdfML MODULE 6.pdf
ML MODULE 6.pdf
 
ML MODULE 5.pdf
ML MODULE 5.pdfML MODULE 5.pdf
ML MODULE 5.pdf
 
ML MODULE 4.pdf
ML MODULE 4.pdfML MODULE 4.pdf
ML MODULE 4.pdf
 
module6_stringmatchingalgorithm_2022.pdf
module6_stringmatchingalgorithm_2022.pdfmodule6_stringmatchingalgorithm_2022.pdf
module6_stringmatchingalgorithm_2022.pdf
 
module5_backtrackingnbranchnbound_2022.pdf
module5_backtrackingnbranchnbound_2022.pdfmodule5_backtrackingnbranchnbound_2022.pdf
module5_backtrackingnbranchnbound_2022.pdf
 
module4_dynamic programming_2022.pdf
module4_dynamic programming_2022.pdfmodule4_dynamic programming_2022.pdf
module4_dynamic programming_2022.pdf
 
module3_Greedymethod_2022.pdf
module3_Greedymethod_2022.pdfmodule3_Greedymethod_2022.pdf
module3_Greedymethod_2022.pdf
 
module2_dIVIDEncONQUER_2022.pdf
module2_dIVIDEncONQUER_2022.pdfmodule2_dIVIDEncONQUER_2022.pdf
module2_dIVIDEncONQUER_2022.pdf
 
module1_Introductiontoalgorithms_2022.pdf
module1_Introductiontoalgorithms_2022.pdfmodule1_Introductiontoalgorithms_2022.pdf
module1_Introductiontoalgorithms_2022.pdf
 
ML MODULE 1_slideshare.pdf
ML MODULE 1_slideshare.pdfML MODULE 1_slideshare.pdf
ML MODULE 1_slideshare.pdf
 
ML MODULE 2.pdf
ML MODULE 2.pdfML MODULE 2.pdf
ML MODULE 2.pdf
 
ML Module 3.pdf
ML Module 3.pdfML Module 3.pdf
ML Module 3.pdf
 
Problem formulation
Problem formulationProblem formulation
Problem formulation
 
Simplex method
Simplex methodSimplex method
Simplex method
 
Functionsandpigeonholeprinciple
FunctionsandpigeonholeprincipleFunctionsandpigeonholeprinciple
Functionsandpigeonholeprinciple
 
Relations
RelationsRelations
Relations
 
Set theory
Set theorySet theory
Set theory
 
Uncertain knowledge and reasoning
Uncertain knowledge and reasoningUncertain knowledge and reasoning
Uncertain knowledge and reasoning
 
Introduction to ai
Introduction to aiIntroduction to ai
Introduction to ai
 
Planning Agent
Planning AgentPlanning Agent
Planning Agent
 

Kürzlich hochgeladen

Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
Neometrix_Engineering_Pvt_Ltd
 

Kürzlich hochgeladen (20)

DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 
Moment Distribution Method For Btech Civil
Moment Distribution Method For Btech CivilMoment Distribution Method For Btech Civil
Moment Distribution Method For Btech Civil
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network Devices
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to Computers
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
Engineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesEngineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planes
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech students
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 

Logic

  • 2. History and Applications • Derived from the greek word ‘logos’. • It is called science of thought. • It starts from Aristotle. • Real Life: Expert Systems, VLSI, Semantic Web. • Computer Science: Godel’s incompleteness theorem, Frame problem, Category theory, Curry- Howard correspondence. 2
  • 3. Statements in Grammar • Declarative: The sky is blue. • Imperative: Speak truth. • Interrogative: Are you interested in maths? • Exclamatory: Wow! You are so beautiful. 3
  • 4. Propositional logic • Propositional logic is the simplest logic – illustrates basic ideas. • A declarative sentence which can be classified as either true or false. • Simple statement Eg. Aristotle was a philosopher • Compound Statement Eg. If you will commit a mistake, you will pay for it
  • 5. Symbols of propositional logic • Logical constants TRUE and FALSE are sentences • Proposition symbols P,Q,S1,S2 are sentences • ∧, V, , , are logical connectives • parenthesis ( ) • Order of precedence (), , ∧, V, ,
  • 6. Connectives – If S is a sentence, S is a sentence (negation) – If S1 and S2 are sentences, S1  S2 is a sentence (conjunction) – If S1 and S2 are sentences, S1  S2 is a sentence (disjunction) – If S1 and S2 are sentences, S1  S2 is a sentence (implication) – If S1 and S2 are sentences, S1  S2 is a sentence (biconditional) 6
  • 7. Propositional logic: Semantics Each model specifies true/false for each proposition symbol E.g. P1 P2 P3 false true false With these symbols, 8 possible models, can be enumerated automatically. Rules for evaluating truth with respect to a model m: S or S is true iff S is false S1  S2 is true iff S1 is true and S2 is true S1  S2 is true iff S1is true or S2 is true S1  S2 is true iff S1 is false or S2 is true i.e., is false iff S1 is true and S2 is false S1  S2 is true iff S1S2 is true and S2S1 is true Simple recursive process evaluates an arbitrary sentence, e.g., P1  (P2  P3) = true  (true  false) = true  true = true
  • 8. Truth tables for connectives If P then Q  P V Q If P then Q and If Q then P (if and only if)
  • 9. Truth tables for connectives
  • 10. Converse, Inverse and Contrapositive Given an implication "if p, then q“, we can create three related statements: • A conditional statement consists of two parts, a premise in the “if” clause and a conclusion in the “then” clause. For instance, “If it rains, then they cancel school.” "It rains" is the premise. "They cancel school" is the conclusion. • To form the converse of the conditional statement, interchange the premise and the conclusion. The converse of "If it rains, then they cancel school" is "If they cancel school, then it rains." • To form the inverse of the conditional statement, take the negation of both the premise and the conclusion. The inverse of “If it rains, then they cancel school” is “If it does not rain, then they do not cancel school.” • To form the contrapositive of the conditional statement, interchange the premise and the conclusion of the inverse statement. The contrapositive of "If it rains, then they cancel school" is "If they do not cancel school, then it does not rain."
  • 11. Converse, Inverse and Contrapositive Eg.1 Statement: If p, then q. Converse: If q, then p. Inverse: If not p, then not q. Contrapositive: If not q, then not p. Eg.2 Statement: If two angles are congruent, then they have the same measure. Converse: If two angles have the same measure, then they are congruent. Inverse: If two angles are not congruent, then they do not have the same measure. Contrapositive: If two angles do not have the same measure, then they are not congruent.
  • 12. (Laws of Logic) Logical equivalence - Biconditional • Two sentences are logically equivalent iff true in same models: i.e. they have identical truth tables Involution law
  • 13. • Two sentences are logically equivalent iff true in same models: i.e. they have identical truth tables α  α ≡ α α ∧ α ≡ α Idempotent Law α  F ≡ α α ∧ T ≡ T Identity Law α  T ≡ T α ∧ F ≡ F Annihilation Law α   α ≡ T α ∧  α ≡ F Inverse Law  T ≡ F  F ≡ T Complement Law (Laws of Logic) Logical equivalence
  • 14. Validity (tautology), contradiction and contingency A proposition which is always true is called tautology α   α A proposition which is always false is called contradiction α ∧  α A proposition which is neither a tautology nor a contradiction is called contingency  α   ,  α  , α  
  • 15. Propositions quantifying • All humans are mortal. • Everything is perishable. • Some people have pink hair. • Nothing is perfect. • There exists a white crow. 15
  • 16. 16 Quantifiers • A quantifier is “an operator that limits the variables of a proposition” • Two types: – Universal : the proposition is true for all, for each, for every possible values in the universe of discourse – Existential : the proposition is true for some value(s) in the universe of discourse
  • 17. Universal quantification •  <variables> <sentence> or A <variables> <sentence> Example: “All elephants are gray” (x )(elephant(x) color(x, GRAY)) • x P is true in a model m iff P is true with x being each possible object in the model • Roughly speaking, equivalent to the conjunction of instantiations of P Example: “Everyone at NUS is smart” x At(x,NUS)  Smart(x) At(KingJohn,NUS) Smart(KingJohn)  At(Richard,NUS) Smart(Richard)  At(NUS,NUS) Smart(NUS) …
  • 18. Existential quantification • <variables> <sentence> or E <variables> <sentence> Example: “Someone wrote Computer Chess” (x write(x, COMPUTER-CHESS)) • x P is true in a model m iff P is true with x being some possible object in the model • Roughly speaking, equivalent to the disjunction of instantiations of P Example: Someone at NUS is smart: x At(x,NUS)  Smart(x) At(KingJohn,NUS)  Smart(KingJohn)  At(Richard,NUS)  Smart(Richard)  At(NUS,NUS)  Smart(NUS)  ...
  • 19. Properties of quantifiers • x y is the same as y x • x y is the same as y x • x y is not the same as y x • “There is a person who loves everyone in the house” x y Loves(x,y) • “Everyone in the house loves at least one person” x y Loves(x,y) Quantifier duality(De Morgan’s law for quantification): each can be expressed using the other • x Likes(x,IceCream) x Likes(x,IceCream) • x Likes(x,Broccoli) x Likes(x,Broccoli)
  • 21. Examples on Predicate Logic • x loves y Loves(x,y) Everybody loves Jerry x Loves (x, Jerry) • Everybody loves somebody x y Loves (x, y) • There is somebody whom somebody loves y x Loves (x, y) • Nobody loves everybody  x y Loves (x, y) = x y Loves (x, y) • There is somebody whom Rachita doesn’t love y Loves (Rachita, y) • There is somebody whom no one loves y x Loves (x, y) • Everybody loves himself or herself x Loves(x,x)
  • 22. Normal Forms A problem in logic is to find whether a given statement is tautology or contradiction via truth tables, especially where the statement form may contain a large no. of variables. Hence reduce statement form to normal form. • Disjunctive Normal Form (dnf): A statement form consisting of disjunction of fundamental conjuncts (minterm) (P  Q  R) V (X   Y  Z) [SOP] • Conjunctive Normal Form (cnf): A statement form consisting of conjunction of fundamental disjuncts (maxterm) ( P V X)  (P V  Y)  (P V Z)  (…..) [POS]
  • 23. DNF (SOP) to CNF (POS) for resolution refutation Disjunctive Normal Form (P  Q  R) V (X   Y  Z) Conjunctive Normal Form ( P V X)  (P V  Y)  (P V Z)  (…..) Every sentence of propositional logic is logically equivalent to a conjunction of disjuncts of literals
  • 24. Conversion to CNF • Eliminate α ß to (α  ß )  (ß  α ) • Eliminate α  ß to  α V ß • CNF requires  to appear only with literals For this apply ( α) ≡ α (double-negative elimination)  (α  ß) ≡  α V  ß (de Morgan)  (α V ß) ≡  α   ß (de Morgan) • Now we have a sentence with nested  and V operators applied to literals. Apply distributivity law distributing V over 
  • 26. 26 Principle of Mathematical Induction Mathematical induction is a form of mathematical proof. Just because a rule, pattern, or formula seems to work for several values of n, you cannot simply decide that it is valid for all values of n without going through a legitimate proof. The Principle of Mathematical Induction Let Pn be a statement involving the positive integer n. If 1. Verification: P1 is true, and 2. Induction: the truth of Pk implies the truth of Pk+1 , for every positive integer k, Conclusion: then Pn must be true for all integers n.
  • 27. 27 Example: Sum of Odd Integers ➢ Proposition: 1 + 3 + … + (2n-1) = n2 for all integers n≥1. ➢ Proof (by induction): 1) Basis step: The statement is true for n=1: 1=12 . 2) Inductive step: Assume the statement is true for some k≥1 (inductive hypothesis) , show that it is true for k+1 .
  • 28. Example: Sum of Odd Integers ➢ Proof (cont.): The statement is true for k: 1+3+…+(2k-1) = k2 (1) We need to show it for k+1: 1+3+…+(2(k+1)-1) = (k+1)2 (2) Showing (2): 1+3+…+(2(k+1)-1) = 1+3+…+(2k+1) = 1+3+…+(2k-1)+(2k+1) = k2+(2k+1) = (k+1)2 . We proved the basis and inductive steps, so we conclude that the given statement true. ■ by (1)
  • 29. 29 Example: Sum of square of Integers ➢ Proposition: for all integers n≥1. ➢ Proof (by induction): 1) Basis step: The statement is true for n=1: 12= . 2) Inductive step: Assume the statement is true for some k≥1 (inductive hypothesis) , show that it is true for k+1 . Sn = 12 + 22 + 32 + 42 + . . . + n2 = ( )( ) 6 121 ++ nnn ( )( ) 6 321
  • 30. Example: Sum of square of Integers ➢ Proof (cont.): The statement is true for k: We need to show it for k+1: by (1) 12 + 22 + 32 + 42 + . . . + k2 = (1) ( )( ) 6 121 ++ kkk ( )( )( ) 6 3221 +++ kkk ( )( ) ( ) 6 16121 2 ++++ = kkkk ( ) ( ) ( )  6 16121 ++++ = kkkk ( )  6 6721 2 +++ = kkk ( )( )( ) 6 3221 +++ = kkk Showing (2): (12 + 22 + 32 + 42 + . . . + k2) + (k + 1)2  = k k +1( ) 2k +1( ) 6 + (k + 1)2 12 + 22 + 32 + 42 + . . . + k2 + (k+1)2 = (2) We proved the basis and inductive steps, so we conclude that the given statement true.