Predicate logic Proofs Artificial intelligence. Predicate logic. SET07106 Mathematics for Software Engineering



Similar documents
CHAPTER 3. Methods of Proofs. 1. Logical Arguments and Formal Proofs

def: An axiom is a statement that is assumed to be true, or in the case of a mathematical system, is used to specify the system.

Computational Logic and Cognitive Science: An Overview

Artificial Intelligence

Handout #1: Mathematical Reasoning

Logic in general. Inference rules and theorem proving

3. Mathematical Induction

DISCRETE MATH: LECTURE 3

CS510 Software Engineering

Likewise, we have contradictions: formulas that can only be false, e.g. (p p).

The History of Logic. Aristotle ( BC) invented logic.

Rules of Inference Friday, January 18, 2013 Chittu Tripathy Lecture 05

DEDUCTIVE & INDUCTIVE REASONING

Lecture 13 of 41. More Propositional and Predicate Logic

Predicate Logic. For example, consider the following argument:

Predicate Logic. Example: All men are mortal. Socrates is a man. Socrates is mortal.

Lecture Notes in Discrete Mathematics. Marcel B. Finan Arkansas Tech University c All Rights Reserved

CHAPTER 7 GENERAL PROOF SYSTEMS

INDUCTIVE & DEDUCTIVE RESEARCH APPROACH

A Few Basics of Probability

Beyond Propositional Logic Lukasiewicz s System

CATEGORICAL SYLLOGISMS AND DIAGRAMMING. Some lawyers are judges. Some judges are politicians. Therefore, some lawyers are politicians.

CHAPTER 2. Logic. 1. Logic Definitions. Notation: Variables are used to represent propositions. The most common variables used are p, q, and r.

Rigorous Software Development CSCI-GA

Introduction to formal semantics -

! " # The Logic of Descriptions. Logics for Data and Knowledge Representation. Terminology. Overview. Three Basic Features. Some History on DLs

A Knowledge-based System for Translating FOL Formulas into NL Sentences

Degrees of Truth: the formal logic of classical and quantum probabilities as well as fuzzy sets.

Deductive reasoning is the application of a general statement to a specific instance.

Introduction to Logic: Argumentation and Interpretation. Vysoká škola mezinárodních a veřejných vztahů PhDr. Peter Jan Kosmály, Ph.D

Examination paper for MA0301 Elementær diskret matematikk

The Mathematics of GIS. Wolfgang Kainz

Neighborhood Data and Database Security

WOLLONGONG COLLEGE AUSTRALIA. Diploma in Information Technology

WOLLONGONG COLLEGE AUSTRALIA. Diploma in Information Technology

A terminology model approach for defining and managing statistical metadata

Hypothetical Syllogisms 1

Math 3000 Section 003 Intro to Abstract Math Homework 2

FUNDAMENTALS OF ARTIFICIAL INTELLIGENCE KNOWLEDGE REPRESENTATION AND NETWORKED SCHEMES

Development of a computer system to support knowledge acquisition of basic logical forms using fairy tale "Alice in Wonderland"

Logic and Reasoning Practice Final Exam Spring Section Number

Overview of the TACITUS Project

Formalization of the CRM: Initial Thoughts

196 Chapter 7. Logical Agents

Course Outline Department of Computing Science Faculty of Science. COMP Applied Artificial Intelligence (3,1,0) Fall 2015

COURSE DESCRIPTION FOR THE COMPUTER INFORMATION SYSTEMS CURRICULUM

Remarks on Non-Fregean Logic

1.2 Forms and Validity

Reasoning and Proof Review Questions

Solutions Q1, Q3, Q4.(a), Q5, Q6 to INTLOGS16 Test 1

Switching Algebra and Logic Gates

Relations: their uses in programming and computational specifications

WRITING PROOFS. Christopher Heil Georgia Institute of Technology

Automated Theorem Proving - summary of lecture 1

Phil 2302 Intro to Logic. Introduction to Induction i

Introduction to Logic in Computer Science: Autumn 2006

Propositional Logic. A proposition is a declarative sentence (a sentence that declares a fact) that is either true or false, but not both.

Introducing Formal Methods. Software Engineering and Formal Methods

INTRODUCTORY SET THEORY

CS Master Level Courses and Areas COURSE DESCRIPTIONS. CSCI 521 Real-Time Systems. CSCI 522 High Performance Computing

Artificial Intelligence 2014

Software Modeling and Verification

Mathematics for Computer Science/Software Engineering. Notes for the course MSM1F3 Dr. R. A. Wilson

Module Catalogue for the Bachelor Program in Computational Linguistics at the University of Heidelberg

EFFICIENT KNOWLEDGE BASE MANAGEMENT IN DCSP

Fuzzy-DL Reasoning over Unknown Fuzzy Degrees

MAT Program Verication: Exercises

Algorithmic Software Verification

Web 3.0 image search: a World First

COMPUTER SCIENCE TRIPOS

Buridan and the Avicenna-Johnston semantics

MATHEMATICAL INDUCTION. Mathematical Induction. This is a powerful method to prove properties of positive integers.

Dedekind s forgotten axiom and why we should teach it (and why we shouldn t teach mathematical induction in our calculus classes)

Gödel s Ontological Proof of the Existence of God

o-minimality and Uniformity in n 1 Graphs

Reusable Knowledge-based Components for Building Software. Applications: A Knowledge Modelling Approach

Fry Phrases Set 1. TeacherHelpForParents.com help for all areas of your child s education

FACULTY OF COMPUTER SCIENCE AND INFORMATION TECHNOLOGY AUTUMN 2016 BACHELOR COURSES

Ling 201 Syntax 1. Jirka Hana April 10, 2006

Semester Review. CSC 301, Fall 2015

Predicate Logic Review

Summary Last Lecture. Automated Reasoning. Outline of the Lecture. Definition sequent calculus. Theorem (Normalisation and Strong Normalisation)

IAI : Knowledge Representation

Logical Agents. Explorations in Artificial Intelligence. Knowledge-based Agents. Knowledge-base Agents. Outline. Knowledge bases

Levels of Analysis and ACT-R

Fixed-Point Logics and Computation

Mathematics Cognitive Domains Framework: TIMSS 2003 Developmental Project Fourth and Eighth Grades

Certamen 1 de Representación del Conocimiento

What Is Induction and Why Study It?

Chapter 1. Use the following to answer questions 1-5: In the questions below determine whether the proposition is TRUE or FALSE

Jieh Hsiang Department of Computer Science State University of New York Stony brook, NY 11794

Schedule. Logic (master program) Literature & Online Material. gic. Time and Place. Literature. Exercises & Exam. Online Material

ON ADDING A CRITICAL THINKING MODULE TO A DISCRETE STRUCTURES COURSE *

Transcription:

Predicate logic SET07106 Mathematics for Software Engineering School of Computing Edinburgh Napier University Module Leader: Uta Priss 2010 Copyright Edinburgh Napier University Predicate logic Slide 1/24

Outline Predicate logic Proofs Artificial intelligence Copyright Edinburgh Napier University Predicate logic Slide 2/24

Predicate logic Propositional logic: and, or, not and variables. Propositional logic does not have quantifiers: All poodles are dogs. There is at least one black swan. Only supervisors are allowed to fill in the form. No person can solve this problem. These sentences cannot be expressed in propositional logic. Copyright Edinburgh Napier University Predicate logic Slide 3/24

Predicate logic Quantifiers: all, at least one First order logic: quantifiers for individuals. All squirrels eat nuts. Second order logic: quantifiers for predicates. S = squirrels eat nuts All S involves chewing. Third order logic:... Copyright Edinburgh Napier University Predicate logic Slide 4/24

Syntax and semantics Predicate logic is a formal language (like a programming language) with rules for syntax (i.e. how to write expressions) and semantics (i.e. how to formalise the meaning of expressions). Copyright Edinburgh Napier University Predicate logic Slide 5/24

Syntax: well-formed formulas logical symbols: and, or, not, all, at least one, brackets, variables, equality (=), true, false predicate and function symbols (for example, Cat(x) for x is a Cat ) term: variables and functions (for example, Cat(x)) formula: any combination of terms and logical symbols (for example, Cat(x) and Sleeps(x) ) sentence: formulas without free variables (for example, All x: Cat(x) and Sleeps(x) ) Copyright Edinburgh Napier University Predicate logic Slide 6/24

Semantics: meaning The meaning of a term or formula is a set of elements. The meaning of a sentence is a truth value. The function that maps a formula into a set of elements is called an interpretation. An interpretation maps an intensional description (formula/sentence) into an extensional description (set or truth value). Copyright Edinburgh Napier University Predicate logic Slide 7/24

Validity A sentence is... satisfiable if it is true under at least one interpretation. valid if it is true under all interpretations. invalid if it is false under some interpretation. contradictory if it is false under all interpretations. Example: All x: Cat(x) and Sleeps(x) If this is interpreted on an island which only has one cat that always sleeps, this is satisfiable. Since not all cats in all interpretations always sleep, the sentence is not valid. Copyright Edinburgh Napier University Predicate logic Slide 8/24

Exercises Are these sentences satisfiable, valid, invalid or contradictory? If a sentence is satisfiable or invalid, provide an interpretation which makes it true (or false). 1 + 1 = 1 A B = not(not A not B) All x: ToBe(x) or not ToBe(x) Copyright Edinburgh Napier University Predicate logic Slide 9/24

Axioms Mathematical theories distinguish between axioms and theorems. Axioms cannot be proven, but are accepted as facts. Theorems can be proven from axioms by using logical inference. Copyright Edinburgh Napier University Predicate logic Slide 10/24

An example of using axioms A Boolean logic is a set with operators: and ( ), or ( ), not (A), the elements true and false and the axioms: associativity A (B C) = (A B) C A (B C) = (A B) C commutativity A B = B A A B = B A absorption A (A B) = A A (A B) = A distributivity A (B C) = (A B) (A C) A (B C) = (A B) (A C) complements A A = 1 A A = 0 De Morgan s law is a theorem which can be proven from the axioms. Copyright Edinburgh Napier University Predicate logic Slide 11/24

Proving de Morgan s law A B = (A B) 1 = (A B) ((A B) A B) = (A A B) (A A B) (B A B) (B A B) = 0 (A A B) 0 (B A B) = (A A B) (B A B) = ((A B) A B) = ((A B) A B) 0 = ((A B) A B) (A B A B) = A B ((A B) (A B)) = A B ((A B) (A B) (A B)) = A B (((A (A B)) (B (A B))) = A B (A B B A) = A B 1 = A B Copyright Edinburgh Napier University Predicate logic Slide 12/24

Syllogisms The ancient Greek philosopher Aristotle introduced logical syllogisms. Premise 1: All humans are mortal. Premise 2: Socrates is a human. Conclusion: Therefore, Socrates is mortal. Copyright Edinburgh Napier University Predicate logic Slide 13/24

Logical inference Law of excluded middle: either P is true or (not P) is true Principle of contradiction: P and (not P) cannot both be true Examples: Either you are currently sitting in this class room or not. The gender of the baby is either male or female or unknown. Either you are wearing shoes or sandals. Are you wearing a shirt or a t-shirt? Could be both. Copyright Edinburgh Napier University Predicate logic Slide 14/24

Logical inference Modus ponens: (P implies Q) and P is true = Q is true Modus tollens: (P implies Q) and Q is false = P is false Contradiction: P implies (Q is true and false) = P is false Contraposition: (not Q implies not P) = (P implies Q) Other types of proofs used in mathematics: mathematical induction, construction, exhaustion, visual proof,... Copyright Edinburgh Napier University Predicate logic Slide 15/24

Exercise: which of these inferences are valid? The days are becoming longer. The nights are becoming shorter if the days are becoming longer. Hence, the nights are becoming shorter. The earth is spherical implies that the moon is spherical. The earth is not spherical. Hence, the moon is not spherical. The new people in the neighbourhood have a beautiful boat. They also have a nice car. Hence, they must be nice people. All dogs are carnivorous. Some animals are dogs. Therefore, some animals are carnivorous. Copyright Edinburgh Napier University Predicate logic Slide 16/24

Reasoning (Charles Sanders Peirce) Induction: Every dog I know has ears. = Dogs have ears. (from specific examples to general) Deduction: Dogs bark. Bobby is a dog. = Bobby barks. (from general to specific) Abduction: Sherlock Holmes: the murderer was left-handed. Smith is left-handed. = Smith is the murderer. (based on shared attributes) Copyright Edinburgh Napier University Predicate logic Slide 17/24

Exercises: induction, deduction or abduction? Birds fly. Penguins are birds. Hence, penguins fly. All swans on this lake are white. Hence, all swans are white. Some dogs are animals. Some cats are animals. Hence, some cats are dogs. Copyright Edinburgh Napier University Predicate logic Slide 18/24

Exercises: induction, deduction or abduction? Birds fly. Penguins are birds. Hence, penguins fly. All swans on this lake are white. Hence, all swans are white. Some dogs are animals. Some cats are animals. Hence, some cats are dogs. Using deduction in unclear domains can lead to false results. Induction and abduction always need to be treated with caution. Copyright Edinburgh Napier University Predicate logic Slide 18/24

Artificial intelligence The term artificial intelligence was coined in 1956 by John McCarthy. An attempt to build computer software which has reasoning capabilities similar to humans. Processing of natural language. Understanding and modelling of spatial, temporal and social situations. Knowledge representation and problem solving. Many approaches: neural networks, evolutionary algorithms, robots, distributed devices,... Copyright Edinburgh Napier University Predicate logic Slide 19/24

Knowledge representation Uses formal languages to represent knowledge. Conceptual structures Ontologies Knowledge bases Expert systems Copyright Edinburgh Napier University Predicate logic Slide 20/24

Tasks for knowledge representation systems Acquisition: new information is integrated into the system Retrieval: existing information is retrieved, query answering Reasoning: logical inferences Copyright Edinburgh Napier University Predicate logic Slide 21/24

Reasoning Is this concept an element of this class? Are concepts, relations and assertions satisfiable/valid? Is the knowledge base consistent (i.e. free of contradictions)? Complexity: the reasoning tasks must not take too much time or computing resources. Copyright Edinburgh Napier University Predicate logic Slide 22/24

Natural language can be ambiguous They drank two cups of tea because they were warm. They drank two cups of tea because they were cold. Copyright Edinburgh Napier University Predicate logic Slide 23/24

Natural language can be ambiguous They drank two cups of tea because they were warm. They drank two cups of tea because they were cold. Time flies like an arrow. Fruit flies like a banana. (Groucho Marx) = It is difficult to write software that extracts information from natural language or that translates between different languages. Copyright Edinburgh Napier University Predicate logic Slide 23/24

Programming with logic Prolog: declarative, logic programming language Lisp: favourite language for artificial intelligence programming Smalltalk: object-oriented, dynamically typed, reflective language Description logics: knowledge representation languages OWL: web ontology language Copyright Edinburgh Napier University Predicate logic Slide 24/24