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

Similar documents
Warm-Up Problem. 1. What is the definition of a Hoare triple satisfying partial correctness? 2. Recall the rule for assignment: x (assignment)

Warmup Problem. Describe how structural induction differs from our MATH 135 notion of induction. 1/25

Warmup Problem. Translate the following sentence from English into Propositional Logic. I want to eat ice cream even though I am on a diet.

Warm-Up Problem. Let be a set of well-formed Predicate logic formulas. Let be well-formed Predicate logic formulas. Prove or disprove the following.

Foundations of AI. 9. Predicate Logic. Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution

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

Definition: A context-free grammar (CFG) is a 4- tuple. variables = nonterminals, terminals, rules = productions,,

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

Chapter 3: Propositional Languages

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

Lecture 1: Conjunctive Queries

Automated Reasoning. Natural Deduction in First-Order Logic

Module 6. Knowledge Representation and Logic (First Order Logic) Version 2 CSE IIT, Kharagpur

First Order Predicate Logic CIS 32

Formal Specification: Z Notation. CITS5501 Software Testing and Quality Assurance

Introductory logic and sets for Computer scientists

Automata Theory for Reasoning about Actions

Lecture 6,

Introduction to dependent types in Coq

Harvard School of Engineering and Applied Sciences CS 152: Programming Languages

Lecture 5 - Axiomatic semantics

Propositional Logic Formal Syntax and Semantics. Computability and Logic

Back to the knights and knaves island

Formal Methods in Software Engineering. Lecture 07

COMP4418 Knowledge Representation and Reasoning

Introduction to Logic Programming

What is a Logic Program. Introduction to Logic Programming. Introductory Examples. Introductory Examples. Foundations, First-Order Language

logic with quantifiers (informally)

Safe Stratified Datalog With Integer Order Does not Have Syntax

Propositional Logic. Andreas Klappenecker

CSC Discrete Math I, Spring Sets

Formal Methods in Software Engineering 1

LTCS Report. Concept Descriptions with Set Constraints and Cardinality Constraints. Franz Baader. LTCS-Report 17-02

Introduction to Logic Programming

Software Engineering Lecture Notes

CSE 20 DISCRETE MATH. Fall

Reasoning About Imperative Programs. COS 441 Slides 10

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

First-Order Logic PREDICATE LOGIC. Syntax. Terms

CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer Science (Arkoudas and Musser) Chapter p. 1/27

Formal Predicate Calculus. Michael Meyling

Computer-Aided Program Design

Logic and its Applications

HOL DEFINING HIGHER ORDER LOGIC LAST TIME ON HOL CONTENT. Slide 3. Slide 1. Slide 4. Slide 2 WHAT IS HIGHER ORDER LOGIC? 2 LAST TIME ON HOL 1

Logic: TD as search, Datalog (variables)

CSE 20 DISCRETE MATH. Winter

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

EXTENSIONS OF FIRST ORDER LOGIC

Towards a Logical Reconstruction of Relational Database Theory

CITS2211 Discrete Structures Logic

Recursive definition of sets and structural induction

Finite Model Generation for Isabelle/HOL Using a SAT Solver

Programming Languages Third Edition

15-819M: Data, Code, Decisions

An Annotated Language

Functional Programming. Pure Functional Programming

On the Boolean Algebra of Shape Analysis Constraints

Foundations of Databases

CMPSCI 250: Introduction to Computation. Lecture #7: Quantifiers and Languages 6 February 2012

Part I Logic programming paradigm

We ve studied the main models and concepts of the theory of computation:

Binary Decision Diagrams

Variables. Substitution

Introduction & Review

Lecture 1. 1 Notation

Theorem proving. PVS theorem prover. Hoare style verification PVS. More on embeddings. What if. Abhik Roychoudhury CS 6214

Summary of Course Coverage

Knowledge Representation. CS 486/686: Introduction to Artificial Intelligence

Recap Datalog Datalog Syntax Datalog Semantics. Logic: Datalog. CPSC 322 Logic 6. Textbook Logic: Datalog CPSC 322 Logic 6, Slide 1

CS 512, Spring 2017: Take-Home End-of-Term Examination

Decision Procedures in the Theory of Bit-Vectors

Lecture 5. Logic I. Statement Logic

CSC 501 Semantics of Programming Languages

Propositional Theories are Strongly Equivalent to Logic Programs

Decision Procedures in First Order Logic

Logic Programming and Resolution Lecture notes for INF3170/4171

Propositional Calculus: Boolean Functions and Expressions. CS 270: Mathematical Foundations of Computer Science Jeremy Johnson

A Knowledge Compilation Technique for ALC Tboxes

Concepts of programming languages

Type Safety. Java and ML are type safe, or strongly typed, languages. C and C++ are often described as weakly typed languages.

Propositional Logic:

Propositional Calculus. Math Foundations of Computer Science

Multi-agent and Semantic Web Systems: RDF Data Structures

DATABASE THEORY. Lecture 11: Introduction to Datalog. TU Dresden, 12th June Markus Krötzsch Knowledge-Based Systems

Propositional Logic. Part I

Typed Lambda Calculus

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

Database Theory VU , SS Codd s Theorem. Reinhard Pichler

SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION

Resolution (14A) Young W. Lim 6/14/14

Lee Pike. June 3, 2005

Topic 3: Propositions as types

NP-Complete Reductions 2

LOGIC AND DISCRETE MATHEMATICS

Lectures 20, 21: Axiomatic Semantics

Automatic Reasoning (Section 8.3)

Data Compression - Seminar 4

The Satisfiability Problem [HMU06,Chp.10b] Satisfiability (SAT) Problem Cook s Theorem: An NP-Complete Problem Restricted SAT: CSAT, k-sat, 3SAT

Bootcamp. Christoph Thiele. Summer An example of a primitive universe

Module 6. Knowledge Representation and Logic (First Order Logic) Version 2 CSE IIT, Kharagpur

Transcription:

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 is false Use a finite domain in your interpretation (Two early clicker questions are coming!) 1/28

Predicate Logic: Semantics, Interpretations and Environments Carmen Bruni Lecture 13 Based on slides by Jonathan Buss, Lila Kari, Anna Lubiw and Steve Wolfman with thanks to B Bonakdarpour, A Gao, D Maftuleac, C Roberts, R Trefler, and P Van Beek Predicate Logic Semantics 2/28

Last Time Did another substitution example (Please Review!) Discussed Interpretations with respect to Predicate Logic Predicate Logic Semantics 3/28

Learning Goals Define an interpretation and an environment Give examples of interpretations and environments in specific situations Define validity, satisfiable and unsatisfiable Predicate Logic Semantics 4/28

Environments How do we deal with variables and quantifiers? Definition: An environment is a function that assigns a value in the domain to every variable symbol in the language An environment needs to be defined on all variables! We will see in practice, environments will only be used to interpret free variables but must nonetheless be defined on all variables including bound variables Bound variables will get their meaning primarily through the corresponding quantifier Predicate Logic Semantics 5/28

Meaning of Terms The combination of an interpretation and an environment supplies a value for every term Definition: Fix an interpretation I and environment For each term, the value of under I and, denoted I, is as follows If is a constant, the value I is I If is a variable, the value I is If is, the value I is I I I To extend this definition to formulas, we must consider quantifiers But first, a few examples Predicate Logic Semantics 6/28

Constants Vs Variables Example: Let be (where is a constant), and let be (where a variable) Let I be the interpretation with domain N, I and I is even Then I T, but I is undefined Predicate Logic Semantics 7/28

Constants Vs Variables Example: Let be (where is a constant), and let be (where a variable) Let I be the interpretation with domain N, I and I is even Then I T, but I is undefined To give a value, we must also specify an environment For example, if, then I T Predicate Logic Semantics 7/28

Example Let and be function symbols Let and be predicate symbols, let be constant symbols and let be variable symbols Define an interpretation I by: Domain: D Constants: I, I, I Functions: I I, I, I I (min is the minimum function) Predicates: I I and define an environment by (see next slide) Predicate Logic Semantics 8/28

Interpretations What is the meaning of each of these formulas in the interpretation and environment on the previous slide? I I I I Predicate Logic Semantics 9/28

Meaning of Terms Example Example Suppose a language has constant symbol, a unary function, and a binary function We shall write in infix position: instead of The expressions and are both terms The following are examples of interpretations and environments D dom I N, I, I is the successor function and I is the addition operation Then, if, the terms get values I and I Predicate Logic Semantics 10/28

Meaning of Terms Example 2 D dom J is the collection of all words over the alphabet, J, J appends to the end of a string, and J is concatenation Let Then J and J Predicate Logic Semantics 11/28

Quantifiers Finally, we can evaluate formulas with free and bound variables How can we evaluate a formula of the form or? For, we need to verify that is true for every possible value of in the domain For we need to verify that is true for at least one possible value of in the domain We formalize this on the next few slides Predicate Logic Semantics 12/28

Quantifiers Finally, we can evaluate formulas with free and bound variables How can we evaluate a formula of the form or? For, we need to verify that is true for every possible value of in the domain For we need to verify that is true for at least one possible value of in the domain We formalize this on the next few slides but first a small aside Predicate Logic Semantics 12/28

Quantifiers Over Finite Domains The universal and existential quantifiers may be understood respectively as generalizations of conjunction and disjunction If the domain is finite then: For all, iff and and There exists, iff or or where is a predicate (a property) Predicate Logic Semantics 13/28

Quantified Formulas Definition: For any environment and domain element d, the environment with re-assigned to, denoted d, is given by d if is d if is not In other words, d and for any other variable, d Key point: d is just a new environment! Predicate Logic Semantics 14/28

Example Let D for some interpretation I and consider as defined by Then What about the following? Predicate Logic Semantics 15/28

Values of Quantified Formulas Definition: The values of and are given by I T F I T F if I d T for every d in dom I otherwise if I d T for some d in dom I otherwise Note: The values of I and I do not depend on the value of The value only matters for free occurrences of but nonetheless environments must be specified for all variables! Predicate Logic Semantics 16/28

Examples: Value of a Quantified Formula Example Let dom I a b and I a a a b b b Let and We have I T, since a a I I F, since b a I I T, since I a T (That is, a a a a I ) What is I? Predicate Logic Semantics 17/28

Examples: Continued Example Let dom I a b and I a a a b b b Let a and b What is I? Since b a I, we have I b a F, and thus I F Predicate Logic Semantics 18/28

Examples: Continued Example Let dom I a b and I a a a b b b Let a and b What is I? Since b a I, we have I b a F, and thus I F What about I? Predicate Logic Semantics 18/28

A Question of Syntax In the previous example, we wrote I b a F Why did we not write simply b a F or perhaps b a I F? Predicate Logic Semantics 19/28

A Question of Syntax In the previous example, we wrote I b a F Why did we not write simply b a F or perhaps b a I F? Because b a is not a formula The elements a and b of dom I are not symbols in the language; they cannot appear in a formula Predicate Logic Semantics 19/28

Satisfaction of Formulas An interpretation I and environment satisfy a formula, denoted I, if I T; they do not satisfy, denoted I, if I F Form of Condition for I I I I I both I and I either I or I (or both) either I or I (or both) for every a dom I, I a there is some a dom I such that I a If I for every, then I satisfies, denoted I Predicate Logic Satisfaction of Formulas 20/28

Example: Satisfaction Example Consider the formula (For a binary predicate and a binary function) Suppose dom I, I is the addition operation, and I is the equality predicate Give a simple condition that determines when I holds Predicate Logic Satisfaction of Formulas 21/28

Example: Satisfaction Example Consider the formula (For a binary predicate and a binary function) Suppose dom I, I is the addition operation, and I is the equality predicate Give a simple condition that determines when I holds I iff is an even number Predicate Logic Satisfaction of Formulas 21/28

Validity and Satisfiability Validity and satisfiability of formulas have definitions analogous to the ones for propositional logic Definition: A formula is valid if every interpretation and environment satisfy ; that is, if I for every I and, satisfiable if some interpretation and environment satisfy ; that is, if I for some I and, and unsatisfiable if no interpretation and environment satisfy ; that is, if I for every I and (The term tautology is not used in predicate logic) Predicate Logic Satisfaction of Formulas 22/28

Note If there is no need to specify an environment, then simply defining an interpretation I and writing I will suffice Predicate Logic Satisfaction of Formulas 23/28

Revisit Example Let and be function symbols Let and be predicate symbols, let be constant symbols and let be variable symbols Define an interpretation by: Domain: D Constants: I, I, I Functions: I I, I, I I (min is the minimum function) Predicates: I I and define an environment by Give a new interpretation J and environment satisfying J Give a new interpretation J and environment satisfying J Predicate Logic Satisfaction of Formulas 24/28

Solution Give a new interpretation J and environment satisfying J Predicate Logic Satisfaction of Formulas 25/28

Solution Give a new interpretation J and environment satisfying J Solution: Set and J to be I except, let J Then J Predicate Logic Satisfaction of Formulas 25/28

Solution Give a new interpretation J and environment satisfying J Solution: Set and J to be I except, let J Then J Give a new interpretation J and environment satisfying J Predicate Logic Satisfaction of Formulas 25/28

Solution Give a new interpretation J and environment satisfying J Solution: Set and J to be I except, let J Then J Give a new interpretation J and environment satisfying J Solution: Set and J to be I except, let J Then J Predicate Logic Satisfaction of Formulas 25/28

Relevance Lemma Lemma: Let be a first-order formula, I be an interpretation, and and be two environments such that for every that occurs free in Then I if and only if I Proof by induction on the structure of Predicate Logic Satisfaction of Formulas 26/28

Example: Satisfiability and Validity Let L be a language consisting of variables, function symbols, and predicate symbol Let be the formula The formula is satisfiable: dom I : N I : summation I : squaring I : equality, and is not valid (Why?) Predicate Logic Satisfaction of Formulas 27/28

Another Example Let L be a language consisting of variables, predicate symbol Let I be the interpretation defined by Domain: D I and environment given by: 1 Show that I where def 2 Give an interpretation J and an environment such that J 3 Give an interpretation J and an environment such that J 4 Give an interpretation J and an environment such that J 5 Is valid? Why or why not? Predicate Logic Satisfaction of Formulas 28/28