CMPF144 FUNDAMENTALS OF COMPUTING THEORY Module 5: Classical Logic.

Slides:



Advertisements
Similar presentations
Artificial Intelligence
Advertisements

Completeness and Expressiveness
The Logic of Quantified Statements
Rigorous Software Development CSCI-GA Instructor: Thomas Wies Spring 2012 Lecture 11.
Inference and Reasoning. Basic Idea Given a set of statements, does a new statement logically follow from this. For example If an animal has wings and.
Copyright © Cengage Learning. All rights reserved. CHAPTER 5 SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION.
Copyright © Cengage Learning. All rights reserved.
CHAPTER 1: AN OVERVIEW OF COMPUTERS AND LOGIC. Objectives 2  Understand computer components and operations  Describe the steps involved in the programming.
Brief Introduction to Logic. Outline Historical View Propositional Logic : Syntax Propositional Logic : Semantics Satisfiability Natural Deduction : Proofs.
TR1413: Discrete Mathematics For Computer Science Lecture 3: Formal approach to propositional logic.
Regular Languages Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 3 Comments, additions and modifications.
The Language of Propositional Logic The Syntax and Semantics of PL.
MTH 232 Section 8.1 Algebraic Expressions, Functions, & Equations.
Copyright © Cengage Learning. All rights reserved.
Adapted from Discrete Math
Predicates and Quantifiers
22 March 2009Instructor: Tasneem Darwish1 University of Palestine Faculty of Applied Engineering and Urban Planning Software Engineering Department Formal.
Intro to Discrete Structures
Logic Introduction to Logic.
First Order Logic Chapter 7. PL is a Weak Representational Language §Propositional Logic (PL) is not a very expressive language because: §Hard to identify.
DECIDABILITY OF PRESBURGER ARITHMETIC USING FINITE AUTOMATA Presented by : Shubha Jain Reference : Paper by Alexandre Boudet and Hubert Comon.
CSC312 Automata Theory Lecture # 2 Languages.
The Recursion Theorem Pages 217– ADVANCED TOPICS IN C O M P U T A B I L I T Y THEORY.
1 Sections 1.5 & 3.1 Methods of Proof / Proof Strategy.
Chapter 1, Part II: Predicate Logic With Question/Answer Animations.
ARTIFICIAL INTELLIGENCE Lecture 3 Predicate Calculus.
TextBook Concepts of Programming Languages, Robert W. Sebesta, (10th edition), Addison-Wesley Publishing Company CSCI18 - Concepts of Programming languages.
Copyright © Cengage Learning. All rights reserved. CHAPTER 3 THE LOGIC OF QUANTIFIED STATEMENTS THE LOGIC OF QUANTIFIED STATEMENTS.
Course Overview and Road Map Computability and Logic.
MA/CSSE 474 Theory of Computation Decision Problems DFSMs.
Propositional Calculus CS 270: Mathematical Foundations of Computer Science Jeremy Johnson.
CS Introduction to AI Tutorial 8 Resolution Tutorial 8 Resolution.
Hazırlayan DISCRETE COMPUTATIONAL STRUCTURES Propositional Logic PROF. DR. YUSUF OYSAL.
Key Concepts Representation Inference Semantics Discourse Pragmatics Computation.
Programming Languages and Design Lecture 3 Semantic Specifications of Programming Languages Instructor: Li Ma Department of Computer Science Texas Southern.
Copyright © Cengage Learning. All rights reserved.
Discrete Mathematical Structures 4 th Edition Kolman, Busby, Ross © 2000 by Prentice-Hall, Inc. ISBN
CS6133 Software Specification and Verification
Chapter 2 Logic 2.1 Statements 2.2 The Negation of a Statement 2.3 The Disjunction and Conjunction of Statements 2.4 The Implication 2.5 More on Implications.
1 / 48 Formal a Language Theory and Describing Semantics Principles of Programming Languages 4.
Slide 7- 1 Copyright © 2012 Pearson Education, Inc.
Predicate Logic One step stronger than propositional logic Copyright © Curt Hill.
Albert Gatt LIN3021 Formal Semantics Lecture 3. Aims This lecture is divided into two parts: 1. We make our first attempts at formalising the notion of.
ARTIFICIAL INTELLIGENCE Lecture 2 Propositional Calculus.
PREDICATES AND QUANTIFIERS COSC-1321 Discrete Structures 1.
2004/9/15fuzzy set theory chap02.ppt1 Classical Logic the forms of correct reasoning - formal logic.
The Big Picture Chapter 3. A decision problem is simply a problem for which the answer is yes or no (True or False). A decision procedure answers a decision.
Discrete Mathematical Structures: Theory and Applications 1 Logic: Learning Objectives  Learn about statements (propositions)  Learn how to use logical.
1 Section 7.1 First-Order Predicate Calculus Predicate calculus studies the internal structure of sentences where subjects are applied to predicates existentially.
Logics for Data and Knowledge Representation ClassL (part 1): syntax and semantics.
English for Economic Informatics I Tomáš Foltýnek Theoretical Foundations of Informatics.
Chapter 1 Logic and proofs
Describing Syntax and Semantics
Logic.
Chapter 7. Propositional and Predicate Logic
Propositional Calculus: Boolean Functions and Expressions
Lecture 1 – Formal Logic.
CIS Automata and Formal Languages – Pei Wang
Propositional Calculus: Boolean Functions and Expressions
Introduction to Automata Theory
Copyright © Cengage Learning. All rights reserved.
(1.4) An Introduction to Logic
MA/CSSE 474 More Math Review Theory of Computation
Computer Security: Art and Science, 2nd Edition
Chapter 7. Propositional and Predicate Logic
CSNB234 ARTIFICIAL INTELLIGENCE
Predicates and Quantifiers
Logic Logic is a discipline that studies the principles and methods used to construct valid arguments. An argument is a related sequence of statements.
CSC312 Automata Theory Lecture # 2 Languages.
Representations & Reasoning Systems (RRS) (2.2)
Presentation transcript:

CMPF144 FUNDAMENTALS OF COMPUTING THEORY Module 5: Classical Logic

Module 8CMPF144 Fundamentals of Computing TheorySlide 2 Objectives To understand what is the meaning of Logic and Classical Logic. To understand what is informal and formal language To understand principles of developing a formal language

Module 8CMPF144 Fundamentals of Computing TheorySlide 3 Introduction Logic : - is a study of valid reasoning Logic tries to establish criteria to decide some piece of reasoning is valid (TRUE) or invalid (FALSE) Reasoning consist of statements some of which are claimed to follow from previous ones. For example: “If I win the lottery, then I’m happy. However, I did not win the lottery. Therefore, I am not happy.” claimed to be inferred from others. For example: “Either the housemaid or the butler killed Mr X. However, if the housemaid would have done it, the alarm would have gone off, and the alarm did not go off. Therefore, the butler did it.”

Module 8CMPF144 Fundamentals of Computing TheorySlide 4 Definitions A logic consists of a formal or informal language together with a deductive system and/or a model- theoretic semantics Language is, or corresponds to, a part of a natural language Deductive System is to capture, codify, or simply record, which inferences are correct for the given language Semantics is to capture, codify, or record the meanings, or truth-conditions, or possible truth conditions, for at least part of the language

Module 8CMPF144 Fundamentals of Computing TheorySlide 5 Formal & Informal Languages The formal language is a recursively defined collection of strings on a fixed alphabet. is a set of finite-length words (i.e. character strings) drawn from some finite alphabets Example: {a,b} :- possible strings ababab, ab, ba, baba {a,m,n,t} :- possible strings man, ant, tan, amn, empty word is possible (zero-length string) and is often denoted by e, ε or Λ

Module 8CMPF144 Fundamentals of Computing TheorySlide 6 Examples (more) the set of all words over a,b the set {a n }, n is a prime number and a n means a repeated n times the set of syntactically correct programs in a given programming language; or the set of inputs upon which a certain Turing machine halts

Module 8CMPF144 Fundamentals of Computing TheorySlide 7 Formal & Informal Languages Without some information on this language, it may look like it doesn’t have a meaning Sometimes, it has no meaning (refer to examples) Sometimes, is has better meaning where the meaning of the formulas is given by the deductive system and the semantics

Module 8CMPF144 Fundamentals of Computing TheorySlide 8 Formal vs Informal (Natural) Languages Formal languages accurately exhibit actual features of certain fragments of a natural language Natural languages are vague and ambiguous, they should be replaced by formal languages Example: John is married, and Mary is single, or Joe is crazy It can mean that John is married and either Mary is single or Joe is crazy, or else it can mean that either both John is married and Mary is single, or else Joe is crazy

Module 8CMPF144 Fundamentals of Computing TheorySlide 9 Formal vs Informal (Natural) Languages The formula for the above sentence in Formal Language could be A & B V C Is this supposed to be ((A & B) V C), or is it (A & (B V C)) ? Parentheses solves this ambiguity

Module 8CMPF144 Fundamentals of Computing TheorySlide 10 Developing Formal Language Building block of Formal Language  Singular Terms - linguistic items whose function is to denote a person or object or subject individual constants - These are lower-case letters, near the beginning of the Roman alphabet, with or without numerical subscripts: a, a1, b23, c, d22, etc individual variables - These are lower-case letters, near the end of the alphabet, with or without numerical subscripts: w, x, y12, z, z4, etc

Module 8CMPF144 Fundamentals of Computing TheorySlide 11 Developing Formal Language (cont.) Variables serve a dual function  used as a singular term to denote a specific, but unspecified (or arbitrary) object. For example, a mathematician might start a derivation: "Let x be a natural number".  used to express generality, as in the mathematical assertion that for any natural number x, there is a natural number y, such that y>x and y is prime. Some logicians employ different symbols for unspecified objects (sometimes called "individual parameters") and variables used to express generality

Module 8CMPF144 Fundamentals of Computing TheorySlide 12 Developing Formal Language (cont.) For each natural number n, n-place predicate letters - These are upper-case letters at the beginning or middle of the alphabet. A superscript indicates the number of places, and there may or may not be a subscript. For example : A 3, B 3 2, P 3, etc

Module 8CMPF144 Fundamentals of Computing TheorySlide 13 Developing Formal Language (cont.) Compound Formula The symbols (operator) used in Formal Language are: ¬, &, Ѵ, , ∀, ∃,(, ) That is, all formulas are constructed in accordance with these rules

Module 8CMPF144 Fundamentals of Computing TheorySlide 14 Developing Formal Language (cont.) Negation (¬ θ) ¬ is equivalent to denying the sentence corresponding to θ AND (&) "and" is used to connect sentences. So (Φ &Ψ ) can be read " and ". The formula (Φ &Ψ ) is called the "conjunction" of Φ and Ψ.

Module 8CMPF144 Fundamentals of Computing TheorySlide 15 Developing Formal Language (cont.) OR ( Ѵ ) corresponds to "either... or... or both", so (Φ Ѵ Ψ ) can be read " or ". The formula (Φ Ѵ Ψ ) is called the "disjunction" of Φ and Ψ If.. Then (  ) The arrow “  " corresponds to "if... then... ", so (Φ  Ψ ) can be read "if Φ then Ψ " or " Ψ only if Φ ". The symbols "&", " Ѵ ", and “  " are called "binary connectives", since they serve to "connect" two sentences into one. Some authors introduce (  ) as an abbreviation of ((Φ  Ψ ) & (Ψ  Φ )). The symbol “  " is an analogue of the locution "if and only if".

Module 8CMPF144 Fundamentals of Computing TheorySlide 16 Developing Formal Language (cont.) For All ( ∀ ) The symbol " ∀ " is called a universal quantifier, and is an analogue of "for all"; so ∀ v θ can be read "for all v, θ ". There is ( ∃ ) The symbol " ∃ " is called an existential quantifier, and is an analogue of "there exists" or "there is"; so ∃ v θ can be read "there is a v such that θ ".

Module 8CMPF144 Fundamentals of Computing TheorySlide 17 Conclusion Logic is a study of a valid reasoning – how we determined or conclude whether a statement is valid or invalid To study logic, we need to study the language used to describe a statement, the deductive system and as well as the semantic aspect of a formal language. Formal language is used to avoid ambiguity in natural language. There are guidelines to write formal language such as a formula.

Module 8CMPF144 Fundamentals of Computing TheorySlide 18 Example (RAISE Language) ∀ x: Nat ● (x = 0) V (x >0) Reads: for all numbers x, either x is equal to 0 or x is greater than 0 ∀ p: Person, db: Database ● check (p,db)  p Є db Reads: for all people p and for all database db, if the predicate check (p,db) holds, then p Є db (A person is registered if that person belongs to the set representing the database) ∀ x, y : Nat ● ∃ !z: Nat ● x + y = z (note: ∃ ! = ‘there exists exactly one’) ∃ x, y: Nat, b: Bool ● b = (x = y)

Module 8CMPF144 Fundamentals of Computing TheorySlide 19 Example of Formal Language Z Language B Language RAISE (Rigorous Approach to Industrial Software Engineering ) Language COLD (Common Object-oriented Language for Design )Language Many more… (search the Internet for more informations)