Theory of Computer Science

Similar documents
Theory of Computer Science

B1.1 Motivation. Theory of Computer Science. Theory of Computer Science. B1.1 Motivation. B1.2 Syntax. B1.3 Semantics

Agenda Artificial Intelligence. Let s Talk About the Wumpus Instead? Let s Talk About Blocks, Baby...

Logic: First Order Logic (Part I)

Theory of Computer Science

Logic. Foundations of First Order Logic. franconi. Enrico Franconi

Theory of Computer Science

Outline. Formale Methoden der Informatik First-Order Logic for Forgetters. Why PL1? Why PL1? Cont d. Motivation

Description Logics. Foundations of Propositional Logic. franconi. Enrico Franconi


Logic: Propositional Logic (Part I)

First-Order Logic First-Order Theories. Roopsha Samanta. Partly based on slides by Aaron Bradley and Isil Dillig

3. The Logic of Quantified Statements Summary. Aaron Tan August 2017

Logic Part I: Classical Logic and Its Semantics

First-Order Logic. 1 Syntax. Domain of Discourse. FO Vocabulary. Terms

The Calculus of Computation: Decision Procedures with Applications to Verification. Part I: FOUNDATIONS. by Aaron Bradley Zohar Manna

Syntax. Notation Throughout, and when not otherwise said, we assume a vocabulary V = C F P.

Artificial Intelligence

Foundations of Artificial Intelligence

First Order Logic (FOL) 1 znj/dm2017

A Little Logic. Propositional Logic. Satisfiability Problems. Solving Sudokus. First Order Logic. Logic Programming

Normal Forms of Propositional Logic

C1.1 Introduction. Theory of Computer Science. Theory of Computer Science. C1.1 Introduction. C1.2 Alphabets and Formal Languages. C1.

Principles of Knowledge Representation and Reasoning

A brief introduction to Logic. (slides from

PROPOSITIONAL LOGIC. VL Logik: WS 2018/19

Classical First-Order Logic

Review of Predicate Logic

Roadmap. Introduction

AAA615: Formal Methods. Lecture 2 First-Order Logic

Automated Program Verification and Testing 15414/15614 Fall 2016 Lecture 2: Propositional Logic

Discrete Mathematics. Instructor: Sourav Chakraborty. Lecture 4: Propositional Logic and Predicate Lo

Logic Part II: Intuitionistic Logic and Natural Deduction

Chapter 4: Classical Propositional Semantics

First-Order Logic (FOL)

ECE473 Lecture 15: Propositional Logic

Exercises for the Logic Course

CS156: The Calculus of Computation

MATH 318/Fall, 2007 Notes on reading formulas and Skolem functions

1.1 Language and Logic

CS1021. Why logic? Logic about inference or argument. Start from assumptions or axioms. Make deductions according to rules of reasoning.

Normal Forms for First-Order Logic

Logic and Computation

CSE507. Introduction. Computer-Aided Reasoning for Software. Emina Torlak courses.cs.washington.edu/courses/cse507/17wi/

Final Exam (100 points)

Herbrand Theorem, Equality, and Compactness

INF3170 Logikk Spring Homework #8 For Friday, March 18

Comp487/587 - Boolean Formulas

Completeness in the Monadic Predicate Calculus. We have a system of eight rules of proof. Let's list them:

185.A09 Advanced Mathematical Logic

Tutorial 1: Modern SMT Solvers and Verification

Language of Propositional Logic

Learning Goals of CS245 Logic and Computation

Inference in first-order logic

Tecniche di Verifica. Introduction to Propositional Logic

CS156: The Calculus of Computation Zohar Manna Winter 2010

Transparencies to accompany Rosen, Discrete Mathematics and Its Applications Section 1.3. Section 1.3 Predicates and Quantifiers

06 From Propositional to Predicate Logic

Theory of Computer Science. Theory of Computer Science. E5.1 Routing Problems. E5.2 Packing Problems. E5.3 Conclusion.

Classical First-Order Logic

Advanced Topics in LP and FP

Logic for Computer Scientists

02 Propositional Logic

Propositional logic (revision) & semantic entailment. p. 1/34

7. Propositional Logic. Wolfram Burgard and Bernhard Nebel

Logic for Computer Scientists

Introduction to Sets and Logic (MATH 1190)

CHAPTER 4 CLASSICAL PROPOSITIONAL SEMANTICS

Logic as a Tool Chapter 4: Deductive Reasoning in First-Order Logic 4.4 Prenex normal form. Skolemization. Clausal form.

AI Principles, Semester 2, Week 2, Lecture 5 Propositional Logic and Predicate Logic

2-4: The Use of Quantifiers

INTRODUCTION TO PREDICATE LOGIC HUTH AND RYAN 2.1, 2.2, 2.4

Overview. CS389L: Automated Logical Reasoning. Lecture 7: Validity Proofs and Properties of FOL. Motivation for semantic argument method

Foundations of Artificial Intelligence

Logic: First Order Logic

Foundations of Artificial Intelligence

Reasoning with Quantified Boolean Formulas

Logic for Computer Scientists

Introduction to Logic in Computer Science: Autumn 2007

Syntax of FOL. Introduction to Logic in Computer Science: Autumn Tableaux for First-order Logic. Syntax of FOL (2)

Characterizing First Order Logic

Introduction to Artificial Intelligence Propositional Logic & SAT Solving. UIUC CS 440 / ECE 448 Professor: Eyal Amir Spring Semester 2010

Automata theory. An algorithmic approach. Lecture Notes. Javier Esparza

Predicate Calculus. Formal Methods in Verification of Computer Systems Jeremy Johnson

First-order logic Syntax and semantics

Propositional Logic Not Enough

Theory of Computer Science

Motivation. CS389L: Automated Logical Reasoning. Lecture 10: Overview of First-Order Theories. Signature and Axioms of First-Order Theory

Propositional logic. Programming and Modal Logic

Some consequences of compactness in Lukasiewicz Predicate Logic

Part 1: Propositional Logic

Foundations of Artificial Intelligence

First-Order Predicate Logic. Basics

Sequent calculus for predicate logic

INF3170 / INF4171 Notes on Resolution

Nonclassical logics (Nichtklassische Logiken)

Modal logics: an introduction

CS 512, Spring 2017, Handout 10 Propositional Logic: Conjunctive Normal Forms, Disjunctive Normal Forms, Horn Formulas, and other special forms

Recall that the expression x > 3 is not a proposition. Why?

Propositional Logic Language

Transcription:

Theory of Computer Science B4. Predicate Logic II Malte Helmert University of Basel March 9, 2016

Free and Bound Variables

Free and Bound Variables: Motivation Question: Consider a signature with variable symbols {x 1, x 2, x 3,... } and an interpretation I. Which parts of the definition of α are relevant to decide whether I, α = ( x 4 (R(x 4, x 2 ) (f(x 3 ) = x 4 )) x 3 S(x 3, x 2 ))? α(x 1 ), α(x 5 ), α(x 6 ), α(x 7 ),... are irrelevant since those variable symbols occur in no formula. α(x 4 ) also is irrelevant: the variable occurs in the formula, but all occurrences are bound by a surrounding quantifier. only assignments for free variables x 2 and x 3 relevant German: gebundene und freie Variablen

Free and Bound Variables: Motivation Question: Consider a signature with variable symbols {x 1, x 2, x 3,... } and an interpretation I. Which parts of the definition of α are relevant to decide whether I, α = ( x 4 (R(x 4, x 2 ) (f(x 3 ) = x 4 )) x 3 S(x 3, x 2 ))? α(x 1 ), α(x 5 ), α(x 6 ), α(x 7 ),... are irrelevant since those variable symbols occur in no formula. α(x 4 ) also is irrelevant: the variable occurs in the formula, but all occurrences are bound by a surrounding quantifier. only assignments for free variables x 2 and x 3 relevant German: gebundene und freie Variablen

Free and Bound Variables: Motivation Question: Consider a signature with variable symbols {x 1, x 2, x 3,... } and an interpretation I. Which parts of the definition of α are relevant to decide whether I, α = ( x 4 (R(x 4, x 2 ) (f(x 3 ) = x 4 )) x 3 S(x 3, x 2 ))? α(x 1 ), α(x 5 ), α(x 6 ), α(x 7 ),... are irrelevant since those variable symbols occur in no formula. α(x 4 ) also is irrelevant: the variable occurs in the formula, but all occurrences are bound by a surrounding quantifier. only assignments for free variables x 2 and x 3 relevant German: gebundene und freie Variablen

Free and Bound Variables: Motivation Question: Consider a signature with variable symbols {x 1, x 2, x 3,... } and an interpretation I. Which parts of the definition of α are relevant to decide whether I, α = ( x 4 (R(x 4, x 2 ) (f(x 3 ) = x 4 )) x 3 S(x 3, x 2 ))? α(x 1 ), α(x 5 ), α(x 6 ), α(x 7 ),... are irrelevant since those variable symbols occur in no formula. α(x 4 ) also is irrelevant: the variable occurs in the formula, but all occurrences are bound by a surrounding quantifier. only assignments for free variables x 2 and x 3 relevant German: gebundene und freie Variablen

Variables of a Term Definition (variables of a term) Let t be a term. The set of variables that occur in t, written as var(t), is defined as follows: var(x) = {x} for variable symbols x var(c) = for constant symbols c var(f(t 1,..., t l )) = var(t 1 ) var(t l ) for function terms terminology: A term t with var(t) = is called ground term. German: Grundterm example: var(product(x, sum(k, y))) =

Free and Bound Variables of a Formula Definition (free variables) Let ϕ be a predicate logic formula. The set of free variables of ϕ, written as free(ϕ), is defined as follows: free(p(t 1,..., t k )) = var(t 1 ) var(t k ) free((t 1 = t 2 )) = var(t 1 ) var(t 2 ) free( ϕ) = free(ϕ) free((ϕ ψ)) = free((ϕ ψ)) = free(ϕ) free(ψ) free( x ϕ) = free( x ϕ) = free(ϕ) \ {x} Example: free(( x 4 (R(x 4, x 2 ) (f(x 3 ) = x 4 )) x 3 S(x 3, x 2 ))) =

Closed Formulas/Sentences Note: Let ϕ be a formula and let α and β variable assignments with α(x) = β(x) for all free variables x of ϕ. Then I, α = ϕ iff I, β = ϕ. In particular, α is completely irrelevant if free(ϕ) =. Definition (closed formulas/sentences) A formula ϕ without free variables (i. e., free(ϕ) = ) is called closed formula or sentence. If ϕ is a sentence, then we often write I = ϕ instead of I, α = ϕ, since the definition of α does not influence whether ϕ is true under I and α or not. Formulas with at least one free variable are called open. German: geschlossene Formel/Satz, offene Formel

Closed Formulas/Sentences Note: Let ϕ be a formula and let α and β variable assignments with α(x) = β(x) for all free variables x of ϕ. Then I, α = ϕ iff I, β = ϕ. In particular, α is completely irrelevant if free(ϕ) =. Definition (closed formulas/sentences) A formula ϕ without free variables (i. e., free(ϕ) = ) is called closed formula or sentence. If ϕ is a sentence, then we often write I = ϕ instead of I, α = ϕ, since the definition of α does not influence whether ϕ is true under I and α or not. Formulas with at least one free variable are called open. German: geschlossene Formel/Satz, offene Formel

Closed Formulas/Sentences Note: Let ϕ be a formula and let α and β variable assignments with α(x) = β(x) for all free variables x of ϕ. Then I, α = ϕ iff I, β = ϕ. In particular, α is completely irrelevant if free(ϕ) =. Definition (closed formulas/sentences) A formula ϕ without free variables (i. e., free(ϕ) = ) is called closed formula or sentence. If ϕ is a sentence, then we often write I = ϕ instead of I, α = ϕ, since the definition of α does not influence whether ϕ is true under I and α or not. Formulas with at least one free variable are called open. German: geschlossene Formel/Satz, offene Formel

Closed Formulas/Sentences: Examples Question: Which of the following formulas are sentences? (Block(b) Block(b)) (Block(x) (Block(x) Block(y))) (Block(a) Block(b)) x(block(x) Red(x))

Questions Questions?

Logical Consequences

Terminology for Formulas The terminology we introduced for propositional logic similarly applies to predicate logic: Interpretation I and variable assignment α form a model of the formula ϕ if I, α = ϕ. Formula ϕ is satisfiable if I, α = ϕ for at least one I, α. Formula ϕ is falsifiable if I, α = ϕ. for at least one I, α Formula ϕ is valid if I, α = ϕ for all I, α. Formula ϕ is unsatisfiable if I, α = ϕ for all I, α. Formulas ϕ and ψ are logically equivalent, written as ϕ ψ, if they have the same models. German: Modell, erfüllbar, falsifizierbar, gültig, unerfüllbar, logisch äquivalent

Sets of Formulas: Semantics Definition (set of formulas is satisfied or true) Let S be a signature, Φ a set of formulas over S, I an interpretation for S and α a variable assignment for S and the universe of I. We say that I and α satisfy the formulas Φ (also: Φ is true under I and α), written as: I, α = Φ, if I, α = ϕ for all ϕ Φ. German: I und α erfüllen Φ, Φ ist wahr unter I und α

Terminology for Sets of Formulas and Sentences Again, we use the same notations and concepts as in propositional logic. Example: A set of formulas Φ is satisfiable if I, α = Φ for at least one I, α. A set of formulas Φ (logically) implies formula ψ, written as Φ = ψ, if all models of Φ are models of ψ. All concepts can be used for the special case of sentences (or sets of sentences). In this case we usually omit α. Examples: Interpretation I is a model of a sentence ϕ if I = ϕ. Sentence ϕ is unsatisfiable if I = ϕ for all I. similarly: ϕ = ψ if {ϕ} = ψ Φ = Ψ if Φ = ψ for all ψ Ψ

Terminology for Sets of Formulas and Sentences Again, we use the same notations and concepts as in propositional logic. Example: A set of formulas Φ is satisfiable if I, α = Φ for at least one I, α. A set of formulas Φ (logically) implies formula ψ, written as Φ = ψ, if all models of Φ are models of ψ. All concepts can be used for the special case of sentences (or sets of sentences). In this case we usually omit α. Examples: Interpretation I is a model of a sentence ϕ if I = ϕ. Sentence ϕ is unsatisfiable if I = ϕ for all I. similarly: ϕ = ψ if {ϕ} = ψ Φ = Ψ if Φ = ψ for all ψ Ψ

Terminology for Sets of Formulas and Sentences Again, we use the same notations and concepts as in propositional logic. Example: A set of formulas Φ is satisfiable if I, α = Φ for at least one I, α. A set of formulas Φ (logically) implies formula ψ, written as Φ = ψ, if all models of Φ are models of ψ. All concepts can be used for the special case of sentences (or sets of sentences). In this case we usually omit α. Examples: Interpretation I is a model of a sentence ϕ if I = ϕ. Sentence ϕ is unsatisfiable if I = ϕ for all I. similarly: ϕ = ψ if {ϕ} = ψ Φ = Ψ if Φ = ψ for all ψ Ψ

Questions Questions?

Further Topics

Further Topics Based on these definitions we could cover the same topics as in propositional logic: important logical equivalences normal forms theorems about reasoning (deduction theorem etc.) We briefly discuss some general results on those topics but will not go into detail.

Logical Equivalences All logical equivalences of propositional logic also hold in predicate logic (e. g., (ϕ ψ) (ψ ϕ)). (Why?) Additionally the following equivalences and implications hold: ( xϕ xψ) x(ϕ ψ) ( xϕ xψ) = x(ϕ ψ) ( xϕ ψ) x(ϕ ψ) ( xϕ ψ) x(ϕ ψ) xϕ x ϕ x(ϕ ψ) ( xϕ xψ) x(ϕ ψ) = ( xϕ xψ) ( xϕ ψ) x(ϕ ψ) ( xϕ ψ) x(ϕ ψ) xϕ x ϕ but not vice versa if x / free(ψ) if x / free(ψ) but not vice versa if x / free(ψ) if x / free(ψ)

Normal Forms Analogously to DNF and CNF for propositional logic there are several normal forms for predicate logic, such as negation normal form (NNF): negation symbols ( ) are only allowed in front of atoms prenex normal form: quantifiers must form the outermost part of the formula Skolem normal form: prenex normal form without existential quantifiers German: Negationsnormalform, Pränexnormalform, Skolemnormalform

Normal Forms (ctd.) Efficient methods transform formula ϕ into an equivalent formula in negation normal form, into an equivalent formula in prenex normal form, or into an equisatisfiable formula in Skolem normal form. German: erfüllbarkeitsäquivalent

Questions Questions?

Summary

Summary bound vs. free variables: bound vs. free variables: to decide if I, α = ϕ, only free variables in α matter sentences (closed formulas): formulas without free variables Once the basic definitions are in place, predicate logic can be developed in the same way as propositional logic: logical consequences logical equivalences normal forms deduction theorem etc.

Other Logics We considered first-order predicate logic. Second-order predicate logic allows quantifying over predicate symbols. There are intermediate steps, e. g. monadic second-order logic (all quantified predicates are unary). Modal logics have new operators and. classical meaning: ϕ for ϕ is necessary, classical meaning: ϕ for ϕ is possible. temporal logic: ϕ for ϕ is always true in the future, temporal logic: ϕ for ϕ is true at some point in the future deontic logic: ϕ for ϕ is obligatory, deontic logic: ϕ for ϕ is permitted... In fuzzy logic, formulas are not true or false but have values between 0 and 1.

What s Next? contents of this course: logic How can knowledge be represented? How can reasoning be automated? automata theory and formal languages What is a computation? computability theory What can be computed at all? complexity theory What can be computed efficiently?

What s Next? contents of this course: logic How can knowledge be represented? How can reasoning be automated? automata theory and formal languages What is a computation? computability theory What can be computed at all? complexity theory What can be computed efficiently?