Logic of Informatics Introduction.

Slides:



Advertisements
Similar presentations
Brief Introduction to Logic. Outline Historical View Propositional Logic : Syntax Propositional Logic : Semantics Satisfiability Natural Deduction : Proofs.
Advertisements

Chapter Two Symbolizing in Sentential Logic This chapter is a preliminary to the project of building a model of validity for sentential arguments. We.
04 March 2009Instructor: Tasneem Darwish1 University of Palestine Faculty of Applied Engineering and Urban Planning Software Engineering Department Introduction.
Knowledge Representation Methods
CS128 – Discrete Mathematics for Computer Science
Brief Introduction to Logic. Outline Historical View Propositional Logic : Syntax Propositional Logic : Semantics Satisfiability Natural Deduction : Proofs.
Introduction to Logic & Set Theory Martin Russell EE1J2 Discrete Mathematics.
Syllabus Every Week: 2 Hourly Exams +Final - as noted on Syllabus
Let remember from the previous lesson what is Knowledge representation
CSE115/ENGR160 Discrete Mathematics 01/17/12 Ming-Hsuan Yang UC Merced 1.
Chapter 2: The Logic of Compound Statements 2.1 Logical Forms and Equivalence 12.1 Logical Forms and Equivalences Logic is a science of the necessary laws.
Adapted from Discrete Math
Predicates and Quantifiers
Intro to Discrete Structures
2009/9 1 Logic and Proofs §1.1 Introduction §1.2 Propositional Equivalences §1.3 Predicates and Quantifiers §1.4 Nested Quantifiers §1.5~7 Methods of Proofs.
Discrete Mathematics and Its Applications
Lecture for Week Spring.   Introduction to Propositional Logic  Types of Proposition  Operator and Truth table Agenda.
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sixth Edition, Mc Graw-Hill, 2007 Ch.1 (Part 1): The Foundations: Logic and Proofs Introduction.
CS 285- Discrete Mathematics Lecture 2. Section 1.1 Propositional Logic Propositions Conditional Statements Truth Tables of Compound Propositions Translating.
Chapter 1: The Foundations: Logic and Proofs
1 Propositional Logic Proposition 2 Propositions can be divided into simple propositions and compound propositions. A simple (or basic) proposition is.
1 CMSC 250 Discrete Structures CMSC 250 Lecture 1.
SSK3003 DISCRETE STRUCTURES
CS 381 DISCRETE STRUCTURES Gongjun Yan Aug 25, November 2015Introduction & Propositional Logic 1.
Chapter 7 Logic, Sets, and Counting
1 Introduction to Abstract Mathematics Expressions (Propositional formulas or forms) Instructor: Hayk Melikya
Thinking Mathematically
LOGIC AND QUANTIFIERS. INTRODUCTION Many algorithms and proofs use logical expressions such as: “IF p THEN q” or “If p1 AND p2, THEN q1 OR q2” Therefore.
1 Propositional Logic Introduction. 2 What is propositional logic? Propositional Logic is concerned with propositions and their interrelationships. 
Chapter 1: The Foundations: Logic and Proofs
CSNB143 – Discrete Structure Topic 4 – Logic. Learning Outcomes Students should be able to define statement. Students should be able to identify connectives.
Section 1.1 Propositions and Logical Operations. Introduction Remember that discrete is –the study of decision making in non-continuous systems. That.
Mathematics for Comter I Lecture 2: Logic (1) Basic definitions Logical operators Translating English sentences.
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 01: Boolean Logic Sections 1.1 and 1.2 Jarek Rossignac.
Discrete Mathematical Structures: Theory and Applications 1 Logic: Learning Objectives  Learn about statements (propositions)  Learn how to use logical.
CS104 The Foundations: Logic and Proof 1. 2 What is Discrete Structure?  Discrete Objects  Separated from each other (Opposite of continuous)  e.g.,
Chapter 1 Logic and proofs
CENG 424-Logic for CS Introduction Based on the Lecture Notes of Konstantin Korovin, Valentin Goranko, Russel and Norvig, and Michael Genesereth.
Chapter 1 Propositional Logic
Introduction to Logic © 2008 Pearson Addison-Wesley.
Logic.
Chapter 7. Propositional and Predicate Logic
Computer Science 210 Computer Organization
CSNB 143 Discrete Mathematical Structures
Lecture 1 – Formal Logic.
Discrete Mathematics Logic.
Thinking Mathematically
Niu Kun Discrete Mathematics Chapter 1 The Foundations: Logic and Proof, Sets, and Functions Niu Kun 离散数学.
6/20/2018 Arab Open University Faculty of Computer Studies M131 - Discrete Mathematics 6/20/2018.
Logic.
Ch.1 (Part 1): The Foundations: Logic and Proofs
Introduction to Prolog
The Foundations: Logic and Proofs
Principles of Computing – UFCFA3-30-1
Information Technology Department
Chapter 1 The Foundations: Logic and Proof, Sets, and Functions
CS201: Data Structures and Discrete Mathematics I
Computer Science 210 Computer Organization
Applied Discrete Mathematics Week 1: Logic
Discrete Mathematics and Its Applications Kenneth H
Chapter 3 Introduction to Logic 2012 Pearson Education, Inc.
Discrete Mathematics Lecture 2: Propositional Logic
Discrete Mathematics Logic.
Chapter 7. Propositional and Predicate Logic
Statements of Symbolic Logic
Cs Discrete Mathematics
TRUTH TABLES.
CS201: Data Structures and Discrete Mathematics I
Introduction to Computational Linguistics
Habib Ullah qamar Mscs(se)
Presentation transcript:

Logic of Informatics Introduction

Historical view Philosophical Logic Symbolic Logic Mathematical Logic 500 BC to 19th Century Symbolic Logic Mid to late 19th Century Mathematical Logic Late 19th to mid 20th Century Logic in Computer Science Logic became popular in the early 20th century among philosophers and mathematicians

Logic is called the CALCULUS of Computer Science! LOGIC is a term for CS CALCULUS is a term for Physical sciences & Engineering Disciplines Many CS areas use LOGIC, such as: Architecture (logic gates) Programming Languages ( Semantics & Logic Programming) AI Databases (SQL)

Philosophical Logic 500 B.C – 19th Century Logic dealt with arguments in the natural language used by humans. Example All men are mortal. Socrates is a man Therefore, Socrates is mortal.

Philosophical Logic [2] Natural languages are very ambiguous. Eric does not believe that Mary can pass any test. ...does not believe that she can pass some test, or ...does not believe that she can pass all tests I only borrowed your car. And not ‘borrowed and used’, or And not ‘car and coat’ Tom hates Jim and he likes Mary. Tom likes Mary, or Jim likes Mary

Symbolic Logic Mid to late 19th Century. The modern development of symbolic logic begin with George Boole in the 19th century. Attempted to formulate logic in terms of a mathematical language Rules of inference were modeled after various laws for manipulating algebraic expressions.

Mathematical Logic Late 19th to mid 20th Century Frege proposed logic as a language for mathematics in 1879. With the rigor of this new foundation, Cantor was able to analyze the notion of infinity in ways that were previously impossible. (2N is strictly larger than N) Russell’s Paradox T = { S | S ∉ S}

Logic in Computer Science In computer science, we design and study systems through the use of formal languages that can themselves be interpreted by a formal system. Boolean circuits Programming languages Design Validation and verification AI, Security. Etc.

Logic in Computer Science Propositional Logic First Order Logic Higher Order Logic Theory of Construction Real-time Logic, Temporal Logic Process Algebras Linear Logic

Propositions Logic A proposition is a statement that is either true or false 2+2=4 (true) New York City is in Oregon (false) Today is Friday (its either true or false) Do your homework! (not a proposition)

Compound and Primitive Propositions Compound Propositions are propositions that are composed of sub-propositions connected together in various ways roses are red and violets are blue Mark is smart or he studies a lot A (atomic, elementary) proposition is the underlying meaning of a simple declarative sentence, which is either true or false

Predicate logic Extension of propositional logic A ‘predicate’ is just a property Predicates define relationships between any number of entities using qualifiers:  “for all”, “for every”  “there exists”

Example Let P(x) be the property ‘if x is a triangle then the sum of its internal angles is 180o” In predicate logic:  x P(x) “For every x such that x is a triangle, the sum of the internal angles of x is 180o”

Another example Let P(x) be the property ‘x is an integer and x2 = 4’ Then  x P(x) “There exists x such that x is an integer and x2 = 4”

Newton’s second law of motion “for every x” “of type called object” “or”  x: Object  stationary(x)  in-uniform-motion (x)   f : Force  x is-acted-upon-by f “there exists an f” In English: “for every x of a certain type referred to as an Object, x is stationary, x is in uniform motion, or there is an f of type Force such that x is acted upon by f”

 and  Remember:  x ‘for every x’, or ‘for All x’  x ‘there is an x’ or ‘there Exists an x’ Tip: Think of  as an upside down ‘A’ (‘for All’) Think of  as a backwards ‘E’ (‘there Exists’)

Propositional connectives These are the words that we use to join atomic propositions together to form compound propositions. E.G: In 1938 Hitler seized Austria, (and) in 1939 he seized former Czechoslovakia and in 1941 he attacked the former USSR while still having a non-aggression pact with it

Propositional connectives Propositional logic has four connectives Name Read as Symbol negation ‘not’  conjunction ‘and’  disjunction ‘or’  implication ‘if…then…’ 

Interpretation of connectives  negation p is true if and only if p is false  A conjunction pq is true if and only if both p and q are true  A disjunction pq is true if and only if p is true or q is true.  An implication p  q is false if and only if p is true and q is false  The biconditional “p if and only if q” is written p  q

Some more terminology… Expressions either side of a conjunction are called conjuncts (pq) Expressions either side of a disjunction are called disjuncts (pq) In the implication p  q, p is called the antecedent and q is the consequence

Precedence of connectives In complex propositions, brackets may be used to remove ambiguity. (p q) r versus p  (q  r) By convention, the order of precedence Brackets, Negation, Conjunction, Disjunction, Implication

Mathematical Logic Statement Formulas Definitions Symbols p ,q ,r ,...,called statement variables Symbols ~, ∧, ∨, →,and ↔ are called logical connectives A statement variable is a statement formula If A and B are statement formulas, then the expressions (~A ), (A ∧ B) , (A ∨ B ), (A → B ) and (A ↔ B ) are statement formulas Expressions are statement formulas that are constructed only by using 1) and 2) above Discrete Mathematical Structures: Theory and Applications

Formalisation Although both Stanley and Gordon are not young, Stanley has a better chance of winning the next bowling tournament, despite Gordon’s considerable experience

Formalisation (continued) Atomic propositions: p – Stanley is young q – Gordon is young r – Stanley has a better chance of winning the next bowling tournament s – Gordon has considerable experience in bowling Formalisation in Propositional Logic: (p)  (q)  r  s

Truth Table A truth table for a compound statement is a list of the truth or falsity of the statement for every possible combination of truth and falsity of its components. In other words, a truth table helps to show whether a statement is true or false.

Rows To find the number of rows used in a truth table, take the number 2 raised to the power of the number of variables. For example, if there was a p statement and a q statement, there would be 2 variables, 2^2 is 4. If there were three statements, it would be 2^3, or 8 rows.

Columns The columns under the connectives /\, and \/, stand for the conjunction, and disjunction of the expression on the two sides of that connective.

Negation Truth Table p ~ p The opposite of p is ~p T F “Not true” is “false” “Not false” is “true”

Conjunction Truth Table p q p /\ q p and q T True only if both are true. F

Disjunction Truth Table p q p \/ q p or q T True if either on is true F False only if both are false

Logical implication: IMPLIES Is a proposition “if p, then q”. Produces all true values except when p is true and q is false. Keywords: if-then, if, then, whenever, only if, etc. We often use p q The Truth table of p → q All true except when p is true and q is false. 5/20/2019

Biimplication Let p and q be statements. The statement “p if and only if q” is called the biimplication or biconditional of p and q The biconditional “p if and only if q” is written p  q p  q is read: “p if and only if q” “p is necessary and sufficient for q” “q if and only if p” “q when and only when p” Discrete Mathematical Structures: Theory and Applications

Biconditional [2] Truth Table for the Biconditional: Discrete Mathematical Structures: Theory and Applications

Construct truth-tables for each of the following formulae: P & (Q v ¬P) ¬P → Q Q v ¬(P & Q) P → ¬(P & Q) P → (P v Q) Q → (P → Q) P & ¬P (Q v P) & ¬P