First order logic (Ch. 8)

Similar documents
First order logic (Ch. 8)

ITCS 6150 Intelligent Systems. Lecture 13 First-Order Logic Chapter 8

Using first order logic (Ch. 8-9)

Using first order logic (Ch. 8-9)

Question about Final Exam. CS 416 Artificial Intelligence. What do we like about propositional logic? First-order logic

Resolution in FO logic (Ch. 9)

CSC Discrete Math I, Spring Sets

Back to the knights and knaves island

Section 2.2: Introduction to the Logic of Quantified Statements

Propositional logic (Ch. 7)

Notes. Notes. Introduction. Notes. Propositional Functions. Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry.

First-Order Logic Syntax

Propositional logic (Ch. 7)

Overview. CS389L: Automated Logical Reasoning. Lecture 6: First Order Logic Syntax and Semantics. Constants in First-Order Logic.

For next Tuesday. Read chapter 8 No written homework Initial posts due Thursday 1pm and responses due by class time Tuesday

CS Bootcamp Boolean Logic Autumn 2015 A B A B T T T T F F F T F F F F T T T T F T F T T F F F

F15: Formalizing definiteness

First Order Logic Part 1

Propositional Logic Formal Syntax and Semantics. Computability and Logic

bool bool - either true or false

Practice Midterm Exam Solutions

Math Week in Review #5. A proposition, or statement, is a declarative sentence that can be classified as either true or false, but not both.

To prove something about all Boolean expressions, we will need the following induction principle: Axiom 7.1 (Induction over Boolean expressions):

Homework 1. Due Date: Wednesday 11/26/07 - at the beginning of the lecture

Lecture Notes 15 Number systems and logic CSS Data Structures and Object-Oriented Programming Professor Clark F. Olson

Chapter 1.3 Quantifiers, Predicates, and Validity. Reading: 1.3 Next Class: 1.4. Motivation

Vibhav Gogate University of Texas, Dallas Artificial Intelligence: CS 4365 First-order Logic

Lecture 6,

Activity Guide - Public Key Cryptography

7. Relational Calculus (Part I) 7.1 Introduction

for all x, the assertion P(x) is false. there exists x, for which the assertion P(x) is true.

CompSci 94 Making Decisions February 8, Prof. Susan Rodger

Propositional Logic:

COMP Intro to Logic for Computer Scientists. Lecture 2

First Order Predicate Logic CIS 32

CS1 Lecture 3 Jan. 18, 2019

Math 187 Sample Test II Questions

To prove something about all Boolean expressions, we will need the following induction principle: Axiom 7.1 (Induction over Boolean expressions):

So many Logics, so little time

Introduction to Software Testing Chapter 3, Sec# 1 & 2 Logic Coverage

A set with only one member is called a SINGLETON. A set with no members is called the EMPTY SET or 2 N

Introduction to Programming in C Department of Computer Science and Engineering. Lecture No. #06 Loops: Operators

Mathematical Logic Prof. Arindama Singh Department of Mathematics Indian Institute of Technology, Madras. Lecture - 9 Normal Forms

CS 115 Lecture. Boolean logic Taken from notes by Dr. Neil Moore

The exam is closed book, closed calculator, and closed notes except your one-page crib sheet.

Software Paradigms (Lesson 6) Logic Programming

IT Introduction to Programming for I.T. Midterm Exam #1 - Prof. Reed Spring 2008

CPSC 121: Models of Computation. Module 5: Predicate Logic

CS187 - Science Gateway Seminar for CS and Math

Automata Theory for Reasoning about Actions

This is already grossly inconvenient in present formalisms. Why do we want to make this convenient? GENERAL GOALS

L05 - Negating Statements

Name: Magpie Chatbot Lab: Student Guide. Introduction

Announcements. Homework 0: using cin with 10/3 is NOT the same as (directly)

Introduction to Artificial Intelligence 2 nd semester 2016/2017. Chapter 8: First-Order Logic (FOL)

COMS 1003 Fall Introduction to Computer Programming in C. Bits, Boolean Logic & Discrete Math. September 13 th

Lecture 5: Predicate Calculus. ffl Predicate Logic ffl The Language ffl Semantics: Structures

The Diagonal Lemma: An Informal Exposition

Solutions to Selected Exercises

logic with quantifiers (informally)

CS221 / Autumn 2017 / Liang & Ermon. Lecture 17: Logic II

CSCI Wednesdays: 1:25-2:15 Keller Thursdays: 4:00-4:50 Akerman 211

CS3 Midterm 1 Fall 2006

CPSC 121: Models of Computation. Module 6: Rewriting predicate logic statements

9/19/12. Why Study Discrete Math? What is discrete? Sets (Rosen, Chapter 2) can be described by discrete math TOPICS

COMP 410 Lecture 1. Kyle Dewey

Logic (or Declarative) Programming Foundations: Prolog. Overview [1]

Mathematical Logic Part One

CS1 Lecture 3 Jan. 22, 2018

Chapter 2 & 3: Representations & Reasoning Systems (2.2)

CSI30. Chapter 1. The Foundations: Logic and Proofs Rules of inference with quantifiers Logic and bit operations Specification consistency

CS40-S13: Functional Completeness

Programming Logic and Design Sixth Edition

Going beyond propositional logic

UMBC CMSC 331 Final Exam

Logic and its Applications

1. Logic as a subject matter is the study of logics, understood as models of acceptable inference patterns

Practice Final. Read all the problems first before start working on any of them, so you can manage your time wisely

L322 Syntax. Chapter 3: Structural Relations. Linguistics 322 D E F G H. Another representation is in the form of labelled brackets:

Grade 7/8 Math Circles Fall November 6/7/8 Boolean Logic

CSE 20 DISCRETE MATH. Fall

Towards a Logical Reconstruction of Relational Database Theory

Logic Haskell Exercises

Practice Problems: All Computer Science majors are people. Some computer science majors are logical thinkers. Some people are logical thinkers.

Self-reproducing programs. And Introduction to logic. COS 116: 3/6/2008 Sanjeev Arora

CSE 473 Lecture 12 Chapter 8. First-Order Logic. CSE AI faculty

Arrays (& strings) Ch 7

Warm-Up Problem. Let L be the language consisting of as constant symbols, as a function symbol and as a predicate symbol. Give an interpretation where

Predicate Calculus. Problems? Syntax. Atomic Sentences. Complex Sentences. Truth

Symbolic Computation

Module 8. Other representation formalisms. Version 2 CSE IIT, Kharagpur

CS 161 Computer Security

F08: Intro to Composition

Planning: Wrap up CSP Planning Logic: Intro

CS 61A Discussion 8: Scheme. March 23, 2017

Propositional Calculus. Math Foundations of Computer Science

Introduction to Boolean Algebra

Constraint Satisfaction Problems (CSPs)

CS3: Introduction to Symbolic Programming. Lecture 5:

Introduction to Boolean Algebra

Transcription:

First order logic (Ch. 8)

Announcements Test in 12 days (not next Tuesday but the one after) Nov. 14 is Midterm 2... covers: -Game theory -CSP (constraint satisfaction) -Propositional logic

Review: Propositional logic Propositional logic builds sentences that relate various symbols with true or false Each symbol is simply a unique identifier, but you cannot generalize between them While this is fairly expressive, it is also quite cumbersome as each part of the environment might need many symbols associated with it

Review: Propositional logic For example: to express just the top left cell of this mindsweep, we would need to have: Sadly in propositional logic we cannot relate these 9 symbols/literals together as value of cell [1,1] (and cannot specify this relationship in general for all cells)

FO logic: definitions Propositional logic has propositions that are either true or false First order logic has objects and the relation between them is what is important This can provide a more compact way of expressing the environment (but is more complicated as we are not restricted to T/F, so we cannot brute force search truth tables)

FO logic: definitions There are two basic things in first order logic: 1. Objects which are some sort of noun or thing in the environment (e.g. teacher, bat) 2. Relations among objects, which can be: 2.1. Unary (or properties) which relate to a single object (e.g. red, healthy, boring) 2.2. n-ary which involve more than one 2.3. Functions, one value for an object

FO logic: definitions Both unary and n-ary relations are similar, just how many variables are involved Unary and n-ary relations are true/false values (similar to propositional logic) Functions converts the inputted objects into a single output object (i.e. like coding functions that return an object)

FO logic: definitions We can represent any sentence with objects and relations, for example: I am sleepy today Object: I Relations: Sleepy, Today Logic: Sleepy(Today(I)) I howl at full moons Objects: Me, Moon Relations: Full, Howl Logic: Full(Moon) => Howl(Me)

FO logic: definitions Let's identify objects and relations in this:

FO logic: definitions Objects: Person, Car, Road, Fish, Leash Relations: Unary: Wet(Fish), Wet(Road), Wet(Car) n-ary: OnTopOf(Person, Road), OnTopOf(Car, Road), OnTopOf(Fish, Road) Functions: attached(person, Leash) = Fish

FO logic: definitions You find objects and relations (what type):

FO logic: definitions Objects: StickPerson, Fish, Pole, Hat, SP'sLeftLeg Relations examples... unary: Black(StickPerson) n-ary: Hold(StickPerson, Fish), Hold(StickPerson, Pole) functions: OnHead(StickPerson), LeftLeg(StickPerson)

FO logic: definitions The arguments to relations might have an order relation For example: Hold(StickPerson, Fish) might imply StickPerson holds Fish This is not a symmetric relationship, so Hold(Fish, StickPerson) conveys a different meaning

FO logic: definitions We represent relations as a set of tuples (generalize pair for more than 2 elements) For example the Hold relation might be: {<StickPerson, Fish>, <StickPerson, Pole>} For functions, we normally provide the result: OnHead: <StickPerson> Hat <Fish> String

Syntax Objects and relations form the basis of first order logic, but we also expand our syntax with three things: 1. Quantifiers (existential and universal) 2. Variables (much in the math sense) 3. Equality (as in = not ) Otherwise we have a similar syntax to propositional logic (implies, AND, OR, etc.)

Existential quantifier The existential quantifier is, which means there exists... For example, if I had a variable x, then...... means Santa exists or Someone is Santa... means Someone in class is hungry or At least one person in class is hungry

Existential quantifier A variable is a place-holder for any object So if we had 3 objects, {Sue, Alex, Devin}, we could formally write: As...... or in English: Someone is Santa, Santa is Sue, Alex or Devin

Universal quantifier The universal quantifier is denoted by means for all... Thus,... means Everyone is a Santa If our objects were again {Sue, Alex, Devin}, then this would mean:

Quantifier As is basically ORs and is ANDs, we can apply De Morgan's laws: In words No Santa exists is the same as Everyone is not Santa (or No one is Santa ) You can have multiple quantifiers as well: This means Two people are snapchatting (Note: this could also mean snapchatting self)

Quantifier The order of quantifiers also matters: means For every person x, they have some mother y or All people have some mother However in the opposite order: means There is some person y, who is the mother to everyone or Everyone has the same mother

Quantifier Write these two sentences in logic: 1. Someone is happy yet sleepy 2. Everyone in class is thinking

Quantifier Write these two sentences in logic: 1. Someone is happy yet sleepy 2. Everyone in class is thinking Normally this is the case: For you use For you use

Equality In logic, equality means two things are the same (much as it does in math) For example, would imply Sue and Alex are the same people This is often useful with variables:... which means No two (different) people have the same midterm score (unique scores)

Assumptions Being completely expressive in first order logic can be difficult at times In the last statement you need the (which I will abbreviate often as: ) to ensure that the variable does not reference the same person/object However, in general two objects could be the same thing...

Assumptions Try to formally express: My brothers are Bob and Jack

Assumptions Try to formally express: My brothers are Bob and Jack This is overly complicated as we have to specify that everyone else is not my brother and that Jack and Bob are different people

Assumptions For this reason, we make 3 assumptions: 1. Objects are unique (i.e. always) 2. All un-said sentences are false Thus, if I only say: then I imply: 3. Only objects I have specified exist (i.e. I assume a person does not exists as I never mentioned them)

Assumptions These assumptions make it easier to write sentences more compactly Under these assumptions, My sisters are Alice and Grace can be represented as: These assumptions do make it harder to say more general sentences, such as: Two of my sisters are Alice and Grace