Predicate logic. Logic in computer science. Logic in Computer Science (lecture) PART II. first order logic



Similar documents
2. The Language of First-order Logic

CHAPTER 7 GENERAL PROOF SYSTEMS

(LMCS, p. 317) V.1. First Order Logic. This is the most powerful, most expressive logic that we will examine.

First-Order Logics and Truth Degrees

First-Order Stable Model Semantics and First-Order Loop Formulas

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

Computational Logic and Cognitive Science: An Overview

CS510 Software Engineering

Predicate Logic. For example, consider the following argument:

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

Rigorous Software Development CSCI-GA

Software Modeling and Verification

Predicate Logic Review

Examination paper for MA0301 Elementær diskret matematikk

Aikaterini Marazopoulou

Computational Methods for Database Repair by Signed Formulae

Cassandra. References:

Scalable Automated Symbolic Analysis of Administrative Role-Based Access Control Policies by SMT solving

A Beginner s Guide to Modern Set Theory

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

Monitoring Metric First-order Temporal Properties

Lecture 8: Resolution theorem-proving

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

INTRODUCTORY SET THEORY

Type Theory & Functional Programming

CSC4510 AUTOMATA 2.1 Finite Automata: Examples and D efinitions Definitions

A Propositional Dynamic Logic for CCS Programs

Handout #1: Mathematical Reasoning

Fixed-Point Logics and Computation

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

Certamen 1 de Representación del Conocimiento

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

ON FUNCTIONAL SYMBOL-FREE LOGIC PROGRAMS

Chapter 4: The Logic of Boolean Connectives

Deterministic Finite Automata

Relations: their uses in programming and computational specifications

2. Abstract State Machines

1. Prove that the empty set is a subset of every set.

University of Ostrava. Reasoning in Description Logic with Semantic Tableau Binary Trees

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

Which Semantics for Neighbourhood Semantics?

Mathematical Induction. Lecture 10-11

A Problem Course in Mathematical Logic Version 1.6. Stefan Bilaniuk

EQUATIONAL LOGIC AND ABSTRACT ALGEBRA * ABSTRACT

Introduction to Logic in Computer Science: Autumn 2006

ML for the Working Programmer

Bounded-width QBF is PSPACE-complete

Relational Calculus. Module 3, Lecture 2. Database Management Systems, R. Ramakrishnan 1

Lecture 1. Basic Concepts of Set Theory, Functions and Relations

CSL105: Discrete Mathematical Structures. Ragesh Jaiswal, CSE, IIT Delhi

3. Mathematical Induction

x < y iff x < y, or x and y are incomparable and x χ(x,y) < y χ(x,y).

Analyzing First-order Role Based Access Control

A Tutorial on Data Integration

Lights and Darks of the Star-Free Star

C H A P T E R Regular Expressions regular expression

Foundational Proof Certificates

Formal Engineering for Industrial Software Development

From Workflow Design Patterns to Logical Specifications

7: The CRR Market Model

INF5140: Specification and Verification of Parallel Systems

Logic in general. Inference rules and theorem proving

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

A first step towards modeling semistructured data in hybrid multimodal logic

Formal Verification Coverage: Computing the Coverage Gap between Temporal Specifications

Turing Degrees and Definability of the Jump. Theodore A. Slaman. University of California, Berkeley. CJuly, 2005

Regular Languages and Finite State Machines

CODING TRUE ARITHMETIC IN THE MEDVEDEV AND MUCHNIK DEGREES

We would like to state the following system of natural deduction rules preserving falsity:

Beyond Propositional Logic Lukasiewicz s System

An introduction to Good old fashioned model theory

Model Checking II Temporal Logic Model Checking

Remarks on Non-Fregean Logic

o-minimality and Uniformity in n 1 Graphs

Query Processing in Data Integration Systems

Automata Theory. Şubat 2006 Tuğrul Yılmaz Ankara Üniversitesi

Sentence Semantics. General Linguistics Jennifer Spenader, February 2006 (Most slides: Petra Hendriks)

These axioms must hold for all vectors ū, v, and w in V and all scalars c and d.

Data Integration: A Theoretical Perspective

Algorithmic Software Verification

Regular Expressions with Nested Levels of Back Referencing Form a Hierarchy

This asserts two sets are equal iff they have the same elements, that is, a set is determined by its elements.

The Syntax of Predicate Logic

Updating Action Domain Descriptions

Local periods and binary partial words: An algorithm

Transcription:

PART II. Predicate logic first order logic Logic in computer science Seminar: INGK401-K5; INHK401; INJK401-K4 University of Debrecen, Faculty of Informatics kadek.tamas@inf.unideb.hu 1 / 19

Alphabets Logical symbols: logical connectives, ^, _, Ą, quantifiers: @, D, individuum variables: x, y, z,... (lowercase english letters). Separator symbols: circle brackets and the comma. Non-logical symbols: L Srt, P r, F n, Cnst where Srt is a nonempty set of sorts (or types), P r is a set of predicate symbols, F n is a set of function symbols. Cnst is a set of constant symbols. 2 / 19

Signature Each individuum variable belongs to a type. The signature is a triple of function ν 1, ν 2, ν 3 where ν 1 assigns a list of type to each P P P r, ν 2 assigns a list of type to each f P F n, ν 3 assigns a type to each c P Cnst. 3 / 19

π type terms 1. x, if x is a π type variable, 2. c, if c P Cnst and ν 3 pcq pπq, 3. fpt 1, t 2,..., t n q, if f P F n and ν 2 pfq pπ 1, π 2,..., π n, πq and t 1, t 2,..., t n are π 1, π 2,..., π n type terms, 4. A string of symbols is a term if and only if it can be obtained by starting with variables (1) or constants (2) repeatedly applying the inductive steps (3), and it must terminates after a finite number of steps. 4 / 19

Formulas P pt 1, t 2,..., t n q is an atomic formula, if P P P r and ν 1 pp q pπ 1, π 2,..., π n q and t 1, t 2,..., t n are π 1, π 2,..., π n type terms, A, if A is an arbitrary formula, pa Bq, if A and B are an arbitrary formulas and P t^, _, Ąu, DxA, if A is an arbitrary formula and x is a variable, @xa, if A is an arbitrary formula and x is a variable, A string of symbols is a formula if and only if it can be obtained by starting with atomic formulas, repeatedly applying the inductive steps, and it must terminates after a finite number of steps. 5 / 19

Syntactical properties Immediate subterms: 1. A constant or a variable has no immediate subterm. 2. The immediate subterms of fpt 1, t 2,..., t n q are the t 1, t 2,..., t n terms. Let T be a term. The set of subterms of T is the smallest set that contains T, and contains, with each member, the immediate subterms of that member. 6 / 19

Syntactical properties The functional degree of a T term is dpt q: 1. dpt q 0, if T is a variable or a constatnt, otherwise 2. dpfpt1, t 2,..., t n qq dpt 1 q ` dpt 2 q `... ` dpt n q ` 1. 7 / 19

Syntactical properties Immediate subformulas: 1. An atomic formula has no immediate subformulas. 2. The only immediate subformula of A is A. 3. The immediate subformulas of pa Bq are A and B, where P t^, _, Ąu. 4. The immediate subformulas of QxA is A, where Q P t@, Du and x is a variable. Let A be a formula. The set of subformulas of A is the smallest set that contains A, and contains, with each member, the immediate subformulas of that member. 8 / 19

Syntactical properties The logical degree of an A formula is dpaq: 1. dpaq 0, if A is an atomic formula, 2. dp Aq dpaq ` 1, where A is an arbitrary formula, 3. dpa Bq dpaq ` dpbq ` 1, where A and B are arbitrary formulas, and P t^, _, Ąu. 4. dpqxaq dpaq ` 1, where A is an arbitrary formula, x is a variable, and Q P t@, Du. 9 / 19

Syntactical properties The free-variable occurrences in a formula: 1. If A is an atomic formula, then all the variable occurrences in A are freevariable occurrences. 2. The free-variable occurrences in A are free-variable occurrences in A. 3. The free-variable occurrences in pa Bq are the free-variable occurrences in A and the free-variable occurrences in B, where P t^, _, Ąu. 4. The free-variable occurrences in @xa and DxA are free-variable occurrences in A, except for occurrences of x. A variable occurrence is called bound if it is not free. A closed formula (sentence) is a formula with no free-variable occurrences. 10 / 19

Bound variable renaming, clean formula A x y denotes, that we replace each free occurrence of the x variable in the A formula with an y variable, where x and y are in the same type. Regular bound variable renaming If y has no free occurrences in the A formula, and there is no occurrences of x within the scope of a quantifier bounding y, then the following renamings are regular: @xa ñ @y A x y DxA ñ Dy A x y A formula called clean, if a variable has just free or just bound occurrences, not both, and each different quantifier bounds different variable. 11 / 19

Semantics Let L Srt, P r, F n, Cnst be a first-order language. The interpretation of L is an ordered 4-tuple of functions: I I Srt, I P r, I F n, I Cnst The I Srt function assigns a non empty set to each π P Srt sort. I Srt pπq D π where D π H the I P r function assigns a P I logical function to each P P P r prediacte symbol. If ν 1 pp q pπ 1, π 2,... π n q then P I : D π1 ˆ D π2 ˆ... ˆ D πn Ñ ttrue, falseu. 12 / 19

The I F n function assigns an f I mathematical function to each f P F n function symbol. If ν 2 pfq pπ 1, π 2,... π n, πq then f I : D π1 ˆ D π2 ˆ... ˆ D πn Ñ D π. the I Cnst function assigns a c I object to each c P Cnst costatnt symbol. If ν 3 pcq pπq then c I P D π. A varible substitution is a κ function which assigns an object to each variable. If the type of the x variable is π, then κpxq P D π. A κ 1 variable substitution called x variant of the κ variable substitution, if κpyq κ 1 pyq is true for all y variable different than x. 13 / 19

Term valuation We denote the term valuation of a t term by a given I interpretation and κ variable substitution as t I,κ. It is defined as a recursive function: x I,κ κpxq where x is a variable, c I,κ I Cnst pcq where c P Cnst, fpt 1, t 2,..., t n q I,κ f I p t 1 I,κ, t 2 I,κ,..., t n I,κ q where I F n pfq f I. 14 / 19

Formula valuation We denote the formula valuation of an F formula by a given I interpretation and κ variable substitution as F I,κ. It is defined as a recursive function: P pt 1, t 2,..., t n q I,κ P I p t 1 I,κ, t 2 I,κ,..., t n I,κ q if I P r pp q P I A I,κ A I,κ pa Ą Bq I,κ A I,κ Ą B I,κ pa ^ Bq I,κ A I,κ ^ B I,κ pa _ Bq I,κ A I,κ _ B I,κ " DxA I,κ true if A I,κ 1 true for at least one κ 1 x-variant of κ f alse otherwise " @xa I,κ true if A I,κ 1 true for all κ 1 x-variant of κ f alse otherwise 15 / 19

Semantical properties An A formula of the L first order language is called first-order tautology, when A I,κ true for all possible I interpretation of the L language and all possible κ variable substiturion of the I interpretation. We shortly denote this by ( A. An A formula of the L first order language is called first-order contradiction, when A I,κ false for all possible I interpretation of the L language and all possible κ variable substiturion of the I interpretation. We shortly denote this by ( A. Let A and B formulas of the same L first order language. A and B are logically equivalent, if A I,κ B I,κ for all possible I interpretation of the L language and all possible κ variable substiturion of the I interpretation. 16 / 19

First order consequence Let A 1, A 2,..., A n pn ě 1q and B formulas of the same L first order language. We say that B is a first-order consequence of A 1, A 2,..., A n, if B is true in every interpretation for every valuation, where every formula of A 1, A 2,..., A n is true. We denote this as A 1, A 2,..., A n ( B. A 1, A 2,..., A n ( B if and only if ( A 1, A 2,..., A n Ą B A 1, A 2,..., A n ( B if and only if ) A 1, A 2,..., A n ^ B 17 / 19

Prenex form A formula is in a prenex form, if it is in the form of Q 1 x 1 Q 2 x 2... Q n x n A pn ě 0q where Q i P td, @u and x i is a variable and A is a formula without quantifiers. It is a prenex conjunctive normal form (PCNF), if A is a conjunctive normal form, it is a prenex disjunctive normal form (PDNF), if A is a disjunctive normal form. 18 / 19

Algorithm to create prenex forms 1. Clean the formula, 2. use the following rules: @xa Dx A @xa _ B @xpa _ Bq @xa ^ B @xpa ^ Bq DxA _ B DxpA _ Bq DxA ^ B DxpA ^ Bq @xa Ą B DxpA Ą Bq DxA Ą B @xpa Ą Bq DxA @x A A _ @xb @xpa _ Bq A ^ @xb @xpa ^ Bq A _ DxB DxpA _ Bq A ^ DxB DxpA ^ Bq A Ą @xb @xpa Ą Bq A Ą DxB DxpA Ą Bq 19 / 19