1 First order logic of words

Similar documents
Homework 3 Solutions

Regular Sets and Expressions

One Minute To Learn Programming: Finite Automata

Reasoning to Solve Equations and Inequalities

EQUATIONS OF LINES AND PLANES

Example 27.1 Draw a Venn diagram to show the relationship between counting numbers, whole numbers, integers, and rational numbers.

Appendix D: Completing the Square and the Quadratic Formula. In Appendix A, two special cases of expanding brackets were considered:

Factoring Polynomials

FORMAL LANGUAGES, AUTOMATA AND THEORY OF COMPUTATION EXERCISES ON REGULAR LANGUAGES

Modular Generic Verification of LTL Properties for Aspects

Math 135 Circles and Completing the Square Examples

MODULE 3. 0, y = 0 for all y

Polynomial Functions. Polynomial functions in one variable can be written in expanded form as ( )

Bayesian Updating with Continuous Priors Class 13, 18.05, Spring 2014 Jeremy Orloff and Jonathan Bloom

Or more simply put, when adding or subtracting quantities, their uncertainties add.

DATABASDESIGN FÖR INGENJÖRER F

LINEAR TRANSFORMATIONS AND THEIR REPRESENTING MATRICES

Section 5-4 Trigonometric Functions

0.1 Basic Set Theory and Interval Notation

Integration by Substitution

Solution to Problem Set 1

Physics 43 Homework Set 9 Chapter 40 Key

On the expressive power of temporal logic

Lecture 3 Gaussian Probability Distribution

4.11 Inner Product Spaces

Use Geometry Expressions to create a more complex locus of points. Find evidence for equivalence using Geometry Expressions.

Example A rectangular box without lid is to be made from a square cardboard of sides 18 cm by cutting equal squares from each corner and then folding

9.3. The Scalar Product. Introduction. Prerequisites. Learning Outcomes

Regular Languages and Finite Automata

1.2 The Integers and Rational Numbers

Lecture 5. Inner Product

flex Regular Expressions and Lexical Scanning Regular Expressions and flex Examples on Alphabet A = {a,b} (Standard) Regular Expressions on Alphabet A

9 CONTINUOUS DISTRIBUTIONS

FUNCTIONS AND EQUATIONS. xεs. The simplest way to represent a set is by listing its members. We use the notation

Generating In-Line Monitors For Rabin Automata

CS99S Laboratory 2 Preparation Copyright W. J. Dally 2001 October 1, 2001

and thus, they are similar. If k = 3 then the Jordan form of both matrices is

PROF. BOYAN KOSTADINOV NEW YORK CITY COLLEGE OF TECHNOLOGY, CUNY

2 DIODE CLIPPING and CLAMPING CIRCUITS

Treatment Spring Late Summer Fall Mean = 1.33 Mean = 4.88 Mean = 3.

FAULT TREES AND RELIABILITY BLOCK DIAGRAMS. Harry G. Kwatny. Department of Mechanical Engineering & Mechanics Drexel University

Vectors Recap of vectors

Binary Representation of Numbers Autar Kaw

5.2. LINE INTEGRALS 265. Let us quickly review the kind of integrals we have studied so far before we introduce a new one.

MATH 150 HOMEWORK 4 SOLUTIONS

1.00/1.001 Introduction to Computers and Engineering Problem Solving Fall Final Exam

Java CUP. Java CUP Specifications. User Code Additions You may define Java code to be included within the generated parser:

Unambiguous Recognizable Two-dimensional Languages

. At first sight a! b seems an unwieldy formula but use of the following mnemonic will possibly help. a 1 a 2 a 3 a 1 a 2

Algebra Review. How well do you remember your algebra?

Operations with Polynomials

Graphs on Logarithmic and Semilogarithmic Paper

Lec 2: Gates and Logic

Pentominoes. Pentominoes. Bruce Baguley Cascade Math Systems, LLC. The pentominoes are a simple-looking set of objects through which some powerful

Protocol Analysis / Analysis of Software Artifacts Kevin Bierhoff

A.7.1 Trigonometric interpretation of dot product A.7.2 Geometric interpretation of dot product

Automated Grading of DFA Constructions

Mathematics. Vectors. hsn.uk.net. Higher. Contents. Vectors 128 HSN23100

1. In the Bohr model, compare the magnitudes of the electron s kinetic and potential energies in orbit. What does this imply?

Regular Repair of Specifications

Multiplication and Division - Left to Right. Addition and Subtraction - Left to Right.

PHY 140A: Solid State Physics. Solution to Homework #2

19. The Fermat-Euler Prime Number Theorem

Repeated multiplication is represented using exponential notation, for example:

Unit 6: Exponents and Radicals

P.3 Polynomials and Factoring. P.3 an 1. Polynomial STUDY TIP. Example 1 Writing Polynomials in Standard Form. What you should learn

Review guide for the final exam in Math 233

On Recognizable Timed Languages

Words Symbols Diagram. abcde. a + b + c + d + e

Basic Analysis of Autarky and Free Trade Models

SPECIAL PRODUCTS AND FACTORIZATION

1 Fractions from an advanced point of view

Vectors. The magnitude of a vector is its length, which can be determined by Pythagoras Theorem. The magnitude of a is written as a.

Linear Equations in Two Variables

6.2 Volumes of Revolution: The Disk Method

Second Term MAT2060B 1. Supplementary Notes 3 Interchange of Differentiation and Integration

1. Find the zeros Find roots. Set function = 0, factor or use quadratic equation if quadratic, graph to find zeros on calculator

e.g. f(x) = x domain x 0 (cannot find the square root of negative values)

AntiSpyware Enterprise Module 8.5

5.6 POSITIVE INTEGRAL EXPONENTS

Quick Reference Guide: One-time Account Update

Two hours UNIVERSITY OF MANCHESTER SCHOOL OF COMPUTER SCIENCE. Date: Friday 16 th May Time: 14:00 16:00

Concept Formation Using Graph Grammars

On decidability of LTL model checking for process rewrite systems

A Visual and Interactive Input abb Automata. Theory Course with JFLAP 4.0

Basically, logarithmic transformations ask, a number, to what power equals another number?

How To Understand The Theory Of Inequlities

Module Summary Sheets. C3, Methods for Advanced Mathematics (Version B reference to new book) Topic 2: Natural Logarithms and Exponentials

Math 314, Homework Assignment Prove that two nonvertical lines are perpendicular if and only if the product of their slopes is 1.

Learning Workflow Petri Nets

RIGHT TRIANGLES AND THE PYTHAGOREAN TRIPLETS

Geometry 7-1 Geometric Mean and the Pythagorean Theorem

Scalar and Vector Quantities. A scalar is a quantity having only magnitude (and possibly phase). LECTURE 2a: VECTOR ANALYSIS Vector Algebra

Brillouin Zones. Physics 3P41 Chris Wiebe

All pay auctions with certain and uncertain prizes a comment

Quick Reference Guide: Reset Password

COMBINATORIAL HOPF ALGEBRAS FROM PROS

Small Business Networking

Techniques for Requirements Gathering and Definition. Kristian Persson Principal Product Specialist

Transcription:

Lecture 2: Lnguges vi Logicl Formule Lnguges cn e defined (nd this is perhps the most nturl wy to define them) s words stisfying prticulr property. For exmple, the set of words stisfying ech of the following properties is regulr lnguge: 1. Every occurnce of n is eventully followed y. 2. There is exctly one. 3. The first letter is n. 4. The lst letter is. 5. Every occurnce of is immeditely followed y. 6. There re even numer of s. However, the set of words which stisfy the property there re equl numer of s nd s is not regulr lnguge. So wht identifies properties tht define regulr lnguges? 1 First order logic of words A nturl forml lnguge to descrie properties such s the ones descried ove is the first order logic over words. This logic is quite esy to understnd nd we shll illustrte this logic with few exmples. For instnce, consider the formul, x. ((x) y. ((y > x) (x)) Here, the vriles x, y etc. refer to positions in the word. The formul (x) sserts tht the letter t position x is. The quntifiers hve the usul mening. The formul y > x is true if the position y ppers somewhere to the right of the position x. Thus, word w stisfies the ove formul only if for ny position (x) with the letter, there is some position to its right (y) with the letter. This cptures in the lnguge of first order logic the first property listed ove. The second property cn e expressed s x. y. ((x) (y)) x = y Consider the formul First(x) = y.(x = y) (x < y). This formul evlutes to true t position x if nd only if it is the first position in the word. With this, the third property cn e expressed s x.((x) First(x)) Consider the formul (x < y) z.(x < z) (y z) (where y z is (y = z) (y < z).) It sserts tht the position y is the position immeditely to the right of the position x. We 1

shll write (y = x + 1) to denote this formul nd using this we write the fourth property ove s x.(x) y.(y = x + 1) (y) As it turns out, the fifth property, which does descrie regulr lnguge, hs no equivlent in the first order logic of words. This is one of the results tht we shll prove. But for the moment, we shll turn to extending the first order logic of words so tht ll regulr lnguges cn e descried. 2 Mondic logic over words In first order logic, the only kind of vriles we hve re those tht represent positions in the word. In mondic logic, in ddition to the position vriles, we re lso llowed to use vriles tht represent sets of positions. We shll use X,Y,... to denote vriles tht rnge over sets of positions. We re lso llowed to quntify over such vriles. For exmple X. x.(x X) (x) sserts tht in every suset of positions, every position it contins hs the letter. Clerly this is true of word if nd only if every position in the word hs the letter. The following formul X. x.(x X) (x) is not true of ny word!! This is ecuse, when X is the empty set of positions x.(x X) (x) cnnot e stisfied. Once we hve quntifiction over sets, we cn descrie the set of even length words s follows: The set of ll positions cn e divided into two sets X nd Y such tht 1. The first position is in X 2. The lst position is in Y 3. for ech position x if x is in X then the next position (if it exists) lies in Y 4. for ech position x if x is in Y then the next position (if it exists) is in X The third nd fourth properities ensure tht the positions of the word re lterntely in X nd Y nd the first nd second ssertions ensure tht there re even numer of lterntions nd thus the word must hve even numer of positions! The mondic formul expressing the ove properties is: X. Y. ( x.(x X) (x Y ) x.first(x) (x X) x.lst(x) (x Y ) x. y. ((x X) (y = x + 1)) (y Y ) x. y. ((x Y ) (y = x + 1)) (y X)) 2

The first line sserts tht the set of ll positions is divided into two sets X nd Y nd the following four lines descrie the four properties mentioned ove. This extended logic which includes the use of set vriles (nd x X) is clled the second-order mondic logic of words (or second-order mondic logic of order). We shll often write MSO to denote this logic. It is lso clled S1S (or second-order mondic logic of one successor). 3 Mondic logic nd regulr lnguges Büchi nd Elgot showed tht the clss of lnguges definle using formuls in mondic logic over words is precisely the clss of regulr lnguges. Theorem 1 (Büchi/Elgot) A lnguge L is regulr if nd only if it cn e descried using formul in MSO. The trnsltion from finite utomton ccepting regulr lnguge to MSO formul descriing the sme lnguge is the esier direction. Before we give the detils, we shll illustrte the ides with simple exmple. Consider the following utomton with 2 sttes. q 0 q 1 Let us exmine run of this utomton on some word, sy. q 0 Oserve tht run on word of length n involves sequence of sttes of length n + 1. For the moment if we omit the lst stte reched on input of length n, we hve sequence of of sttes of length n. Thus, we cn think of the run (without the lst stte) s lelling of the positions of the word with sttes (the stte reched efore the letter t tht position is red). Cn we then write out formul tht descries the run of the utomton on ny given word? Here is n outline of how to do this: The trick is to use one second order vrile X q for ech q Q, nd use X q to pick out the positions tht re lelled y stte q. Let the sttes of the utomton e q 0,q 1,...q k. (Thus, for the ove exmple we use two vriles X q0 nd X q1.) We then ssert tht the set of positions cn e decomposed into Q sets, X q0,x q1,...x qk such tht 3

1. The first position elongs to X q0 (since q 0 is the strt stte of the utomton). 2. If x nd x + 1 re positions in the given word nd the letter t position x is some then, x nd x + 1 elong to sets X p nd X q such tht δ(p,) = q. 3. If x is the lst position in the word w, the letter t this position is nd x elongs to X q then δ(q,) F. For the ove utomton these ssertions cn e expressed in MSO s follows: X q0. X q1. ( x.(x X q0 ) (x X q1 ) x.first(x) (x X q0 ) x. y. ((x X q0 ) (x) (y = x + 1)) (y X q1 ) x. y. ((x X q0 ) (x) (y = x + 1)) (y X q0 ) x. y. ((x X q1 ) (x) (y = x + 1)) (y X q0 ) x. y. ((x X q1 ) (x) (y = x + 1)) (y X q1 ) x.(lst(x) ((x X q0 (x)) (x X q1 (x))) The first line sys ech position is lelled either with q 0 or q 1 (to represent the stte reched efore leding the letter t tht position). The second line sserts tht stte corresponding to the first position is the strt stte. The susequent four lines encode the four possile trnsitions of the utomton. The lst line ensures tht the stte ssigned to the lst position is such tht the trnsition from this stte on the letter t the lst position tkes the run into finl stte. In generl given finite utomton A = ({q 0,...,q k }, Σ,δ,q 0,F), the following formul sserts tht there is n ccepting run for A over the given word. Thus the models of this formul re precisely the words in the lnguge ccepted y A. X q0. X q1... X qk. x. 0 i k x X q i x. i j (x X i) (x X j ) x.first(x) x X q0 δ(p,)=q x.((x X p) (x) (y = x + 1)) (y X q ) x.lst(x) ( δ(p,) F ((x X p) (x))) The first nd second lines ssert tht the set of positions is decomposed into collection of sets, one for ech stte in Q. The the next three lines ssert the 3 properties mentioned ove nd thus word stisfies this property if nd only if it is ccepted y the utomton A. This completes sketch of the rgument showing tht every regulr lnguge cn e descried y MSO formul. Notes: In this lecture nd the next our presenttion follows tht of Struing [1]. 4

References [1] Howrd Struing: Finite Automt, Forml Logic nd Circuit Complexity, Birkhäuser, 1994. 5