Decidability of WS1S and S1S (An Exposition) Exposition by William Gasarch-U of MD

Similar documents
Theory of Computation

Lecturecise 22 Weak monadic second-order theory of one successor (WS1S)

Closure Properties of Regular Languages. Union, Intersection, Difference, Concatenation, Kleene Closure, Reversal, Homomorphism, Inverse Homomorphism

Languages. Non deterministic finite automata with ε transitions. First there was the DFA. Finite Automata. Non-Deterministic Finite Automata (NFA)

T (s, xa) = T (T (s, x), a). The language recognized by M, denoted L(M), is the set of strings accepted by M. That is,

CISC 4090: Theory of Computation Chapter 1 Regular Languages. Section 1.1: Finite Automata. What is a computer? Finite automata

Automata, Logic and Games: Theory and Application

1 Deterministic Turing Machines

Nondeterministic Finite Automata

Nondeterministic finite automata

Automata Theory. Lecture on Discussion Course of CS120. Runzhe SJTU ACM CLASS

1 More finite deterministic automata

Rabin Theory and Game Automata An Introduction

CPSC 421: Tutorial #1

CS 455/555: Finite automata

ECS 120: Theory of Computation UC Davis Phillip Rogaway February 16, Midterm Exam

CS 154, Lecture 2: Finite Automata, Closure Properties Nondeterminism,

CMSC 330: Organization of Programming Languages

CS 301. Lecture 18 Decidable languages. Stephen Checkoway. April 2, 2018

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

Languages, regular languages, finite automata

Before we show how languages can be proven not regular, first, how would we show a language is regular?

Lecture 2: Syntax. January 24, 2018

The Absoluteness of Constructibility

Further discussion of Turing machines

3515ICT: Theory of Computation. Regular languages

The Unsolvability of the Halting Problem. Chapter 19

Automata Theory for Presburger Arithmetic Logic

Mathematics 114L Spring 2018 D.A. Martin. Mathematical Logic

CS 154. Finite Automata, Nondeterminism, Regular Expressions

Lecture 23 : Nondeterministic Finite Automata DRAFT Connection between Regular Expressions and Finite Automata

TRUTH-THEORIES FOR FRAGMENTS OF PA

CSE 105 Theory of Computation

Büchi Automata and Their Determinization

Final Exam (100 points)

CSE 105 Theory of Computation Professor Jeanne Ferrante

Turing Machine Recap

Context Free Languages. Automata Theory and Formal Grammars: Lecture 6. Languages That Are Not Regular. Non-Regular Languages

Logic and Automata I. Wolfgang Thomas. EATCS School, Telc, July 2014

1 Showing Recognizability

P is the class of problems for which there are algorithms that solve the problem in time O(n k ) for some constant k.

CSE 311 Lecture 25: Relating NFAs, DFAs, and Regular Expressions. Emina Torlak and Kevin Zatloukal

1 Predicates and Quantifiers

Automata-based Verification - III

1 Deterministic Turing Machines

Optimizing Finite Automata

198:538 Complexity of Computation Lecture 16 Rutgers University, Spring March 2007

Lecture 2: Connecting the Three Models

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

Chapter Five: Nondeterministic Finite Automata

Finite Automata. Mahesh Viswanathan

CSE 4111/5111/6111 Computability Jeff Edmonds Assignment 3: Diagonalization & Halting Problem Due: One week after shown in slides

Mixed and Integer Linear Programming Using Automata Techniques

Lecture 3: Nondeterministic Finite Automata

False. They are the same language.

Turing Machines Part III

Definition of Büchi Automata

Sri vidya college of engineering and technology

452 FINAL- VERSION E Do not open this exam until you are told. Read these instructions:

Regular Expressions [1] Regular Expressions. Regular expressions can be seen as a system of notations for denoting ɛ-nfa

Automata and Languages

Deterministic Finite Automata (DFAs)

1 Reducability. CSCC63 Worksheet Reducability. For your reference, A T M is defined to be the language { M, w M accepts w}. Theorem 5.

Equivalence of DFAs and NFAs

CS 301. Lecture 17 Church Turing thesis. Stephen Checkoway. March 19, 2018

Informal Statement Calculus

CpSc 421 Homework 9 Solution

Duplicator Spoiler Games Exposition by William Gasarch

03 Review of First-Order Logic

Deterministic Finite Automata (DFAs)

CS 154 Introduction to Automata and Complexity Theory

Fooling Sets and. Lecture 5

CSC173 Workshop: 13 Sept. Notes

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

The Parikh image of languages and linear constraints

COM364 Automata Theory Lecture Note 2 - Nondeterminism

CSE 105 Homework 1 Due: Monday October 9, Instructions. should be on each page of the submission.

CSE 311: Foundations of Computing. Lecture 23: Finite State Machine Minimization & NFAs

Most General computer?

1 The decision problem for First order logic

Subset construction. We have defined for a DFA L(A) = {x Σ ˆδ(q 0, x) F } and for A NFA. For any NFA A we can build a DFA A D such that L(A) = L(A D )

CSE 105 THEORY OF COMPUTATION

Reductions in Computability Theory

Decision Problems with TM s. Lecture 31: Halting Problem. Universe of discourse. Semi-decidable. Look at following sets: CSCI 81 Spring, 2012

CSE 311: Foundations of Computing I Autumn 2014 Practice Final: Section X. Closed book, closed notes, no cell phones, no calculators.

Great Theoretical Ideas in Computer Science. Lecture 4: Deterministic Finite Automaton (DFA), Part 2

Undecidability and Rice s Theorem. Lecture 26, December 3 CS 374, Fall 2015

Introduction to Turing Machines. Reading: Chapters 8 & 9

CSci 311, Models of Computation Chapter 4 Properties of Regular Languages

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

Math 13, Spring 2013, Lecture B: Midterm

Course 4 Finite Automata/Finite State Machines

5. Peano arithmetic and Gödel s incompleteness theorem

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

CSE 105 Theory of Computation Professor Jeanne Ferrante

Algorithms and Theory of Computation. Lecture 19: Class P and NP, Reduction

Course Runtime Verification

Finite Universes. L is a fixed-length language if it has length n for some

CSC236 Week 10. Larry Zhang

CS20a: Turing Machines (Oct 29, 2002)

Transcription:

1 Introduction Decidability of WS1S and S1S (An Exposition) Exposition by William Gasarch-U of MD We are going to prove that a (small) fragment of mathematics is decidable. 1. A Formula allows variables to not be quantified over. A Formula is neither true or false. Example: ( x)[x + y = 7]. 2. A Sentence has all variables quantified over. Example: ( y)( x)[x + y = 7]. So a Sentence is either true or false. WRONG- also need to know domain. ( y)( x)[x + y = 7] TRUE if domain is Z, the integers. ( y)( x)[x + y = 7] FALSE if domain is N, the naturals. We will only use the following symbols. 1. The logical symbols,, ( ). 2. Variables x, y, z,... that range over N. 3. Variables A, B, C,... that range over finite subsets of N. 4. Symbols: <, (usual meaning), S (meaning S(x) = x + 1). 5. Constants: 0,1,2,3,.... 6. Convention: We write x + c instead of S(S( S(x)) ). NOTE: + is NOT in our lang. We call this WS1S: Weak Second order Theory of One Successor. Weak Second order means quantify over finite sets. What Does One Successor Mean? Our basic objects are numbers. If these are viwed as unary strings, elements of 1. then Succ is CONCAT 1. So could view 7 = ((5 CONCAT 1) CONCAT 1) If our basic objects were strings in {0, 1} then we could have two Succ operations: CONCAT0 and CONCAT1. Def 1.1 An Atomic Formulas is: 1. For any c N, x = y + c is an Atomic Formula. 2. For any c N, x < y + c is an Atomic Formula. 3. For any c, d N, x y + c (mod d) is an Atomic Formula. 4. For any c N, x + c A is an Atomic Formula. 5. For any c N, A = B + c is an Atomic Formula. Def 1.2 A WS1S Formula is: 1

1. Any atomic formula is a WS1S formula. 2. If φ 1, φ 2 are WS1S formulas then so are (a) φ 1 φ 2, (b) φ 1 φ 2 (c) φ 1 3. If φ(x 1,..., x n, A 1,..., A m ) is a WS1S-Formula then so are (a) ( x i )[φ(x 1,..., x n, A 1,..., A m )] (b) ( A i )[φ(x 1,..., x n, A 1,..., A m )] Def 1.3 A formulas is in Prenex Normal Form if it is of the form (Q 1 v 1 )(Q 2 v 2 ) (Q n v n )[φ(v 1,..., v n )] where the v i s are either number of finite-set variables, and φ has no quantifiers. Every formula can be put into this form using the following rules 1. ( x)[φ 1 (x)] ( y)[φ 2 (y)] is equiv to ( x)[φ 1 (x) φ 2 (x)]. 2. ( x)[φ 1 (x)] ( y)[φ 2 (y)] is equiv to ( x)[φ 1 (x) φ 2 (x)]. 3. φ(x) is equivalent to ( y)[φ(x)] and ( y)[φ(x)]. KEY DEFINITION: Def 1.4 If φ(x 1,..., x n, A 1,..., A m ) is a WS1S-Formula then T RUE φ is the set {(x 1,..., x n, A 1,..., A m ) φ(x 1,..., x n, A 1,..., A m ) = T } This is the set of (x 1,..., x n, A 1,..., A m ) that make φ TRUE. REPRESENTATION We want to say that T RUE is regular. Need to represent (x 1,..., x n, A 1,..., A m ). We just look at (x, y, A). Use the alphabet {0, 1} 3. Below: Top line and the x, y, A are not there- Visual Aid. The triple (3, 4, {0, 1, 2, 4, 7}) is represented by 0 1 2 3 4 5 6 7 x 0 0 0 1 0 y 0 0 0 0 1 A 1 1 1 0 1 0 0 1 Note 1.5 After we see 0001 for x we DO NOT CARE what happens next. The * s can be filled in with 0 s or 1 s and the string from {0, 1} 3 above would still represent (3, 4, {0, 1, 2, 4, 7}). 2

STUPID STRINGS What does 0 1 2 3 4 5 6 7 x 0 0 0 0 0 0 0 0 y 0 0 0 0 1 1 0 1 A 1 1 1 0 1 0 0 1 represent? This string is STUPID! There is no value for x This string does not represent anything! Our DFA s will have THREE kinds of states: ACCEPT, REJECT, and STUPID. STUPID means that the string did not represent anything because the number-variable track is all 0 s. (It is fine for a set var to be all 0 s- that would be the empty set.) KEY THEOREM Theorem 1.6 For all WS1S formulas φ the set T RUE φ is regular. We proof this by induction on the formation of a formula. If you prefer- induction on the LENGTH of a formula. Lemma 1.7 For all WS1S ATOMIC formulas φ the set T RUE φ is regular. Proof: We proved this in class. THEOREM FOR FORMULAS (I) Assume true for φ 1, φ 2 so T RUE φ1 and T RUE φ2 are REG. 1. T RUE φ1 φ 2 = T RUE φ1 T RUE φ2. 2. T RUE φ1 φ 2 = T RUE φ1 T RUE φ2. 3. T RUE φ1 = Σ T RUE φ1. Good News!: All of the above can be shown using the Closure properties of Regular Langs. Caveat: Must be do carefully because of the stupid states. (Stupid is as stupid does. Name that movie reference!) Theorem 1.8 If T RUE φ(x1,...,x n,a 1,...,A m) is regular then T RUE ( x1 )[φ(x 1,...,x n,a 1,...,A m)] is regular. Proof: Use that Regular langs are closed under projection via nondeterminism. Theorem 1.9 The following problem is decidable: strings. given a DFA determine if it accepts ANY 3

Proof: Given M = (Q, Σ, δ, s, F ) view as directed graph. Let n = Q. A 0 = {s} For i = 1 to n A i+1 = A i {p ( σ Σ)( q A i )[δ(q, σ) = p] L(M) iff A n F. Theorem 1.10 WS1S is Decidable. Proof: 1. Given a sentence in WS1S put it into the form (Q 1 A 1 ) (Q n A n )(Q n+1 x 1 ) (Q n+m x m )[φ(x 1,..., x m, A 1,..., A n )] 2. Assume Q 1 =. (If not then negate and negate answer.) 3. View as ( A)[φ(A)], a formula with one free var. 4. Construct DFA M for {A φ(a) is true}. 5. Test if L(M) =. 6. If L(M) then ( A)[φ(A)] is TRUE. If L(M) = then ( A)[φ(A)] is FALSE. Example We will do the following TOGETHER ( A)( x)( y)[x A x 2 (y x y A)]. FIRST STEP: rewrite getting rid of ( y) and the. ( A)( x) ( y) [x A x 2 (y x y A)]. ( A)( x) ( y) [x A x 2 (y > x y / A)]. (RECALL: P Q is equivalent to P A.) Atomic Formulas we Need We need DFA s for the following: 1. {(x, y, A) x A} 2. {(x, y, A) x 2} 3. {(x, y, A) y > x} 4. ({(x, y, A) y / A} 4

Atomic Formulas we Need We need DFA s for the following: 1. {(x, y, A) x A x 2} 2. {(x, y, A) y > x y / A}) 3. {(x, y, A) x A x 2 (y > x y / A)}) 4. {(x, y, A) [x A x 2 (y > x y / A)]} NOTE- we don t use de Morgans Law- we just complement the DFA. Atomic Formulas we Need We need DFA s for We need DFA s for {(x, y, A) [x A x 2 (y > x y / A)]} 1. {(x, A) ( y) [x A x 2 (y > x y / A)]} 2. {(x, A) ( y) [x A x 2 (y > x y / A)]} 3. {A ( x) ( y) [x A x 2 (y > x y / A)]} The Finale! Take the DFA for {A ( x) ( y) [x A x 2 (y > x y / A)]}. TEST it- does it accept ANYTHING? If YES then the original sentence is TRUE. If NO then the original sentence is FALSE. Complexity of the Decision Procedure Given a sentence (Q 1 A 1 ) (Q n A n )(Q n+1 x 1 ) (Q n+m x m )[φ(x 1,..., x m, A 1,..., A n )] How long will the procedure above take in the worst case?: 2 2 n steps since we do n nondet to det transformations. And this is likely the best one can do. Is WS1S interesting? YES: Extensions of WS1S are used in low-level verification of code fragments. The MONA group has coded this up and used it, though there code uses MANY tricks to speed up the program in MOST cases. NO: There are no interesting MATH problems that can be expressed in WS1S. Presburger Arithmetic In our lang 1. The logical symbols,,, ( ), ( ). 2. Variables x, y, z,... that range over N. 3. Symbols: <, +. Constants: 0,1,2,3,.... Terms and Formulas: 5

1. Any variable or constant is a term. 2. t 1, t 2 terms then t 1 + t 2 is term. 3. t 1, t 2 terms then t 1 = t 2, t 1 < t 2 are atomic formulas. 4. Other formulas in usual way:,,, ( ), ( ). Presb Arith is decidable by TRANSFORMING Pres Arith Sentences into WS1S sentences. Presb Arithmetic has been used in Code Optimization (using a better dec procedure than reducing to WS1S). 2 S1S Whats The Same: We use the same symbols and define formulas and sentences the same way Whats Different: We interpret the set variables as ranging over ANY set of naturals, including infinite ones. Question: Can we still use finite automata? Essence of WS1S proof Essence of WS1S proof: 1. Reg langs closed: UNION, INTER, COMP, PROJ. 2. Emptyness problem for DFA s is decidable. KEY: We never actually RAN a DFA on any string. Definition: A B-NDFA as an NDFA. If x Σ ω then x is accepted by B-NDFA M if there is a path such that M(x) hits a final state inf often. Good News: (PROVE IN GROUPS) 1. B-reg closed: UNION, INTER, PROJ 2. emptyness problem for B-NDFA s is decidable. NEED B-reg closed under complementation. GOOD NEWS EVERYONE! GOOD NEWS: B-reg IS closed under Complementation. GOOD NEWS: That is ALL we need to get S1S decidable. GOOD NEWS: It s the only hard step! GOOD NEWS: CMSC 452: We are DONE! GOOD NEWS: CMSC 858/Math 608 you ll see proof! GOOD NEWS: CMSC 858/Math 608 proof uses Ramsey Theory! B-Reg and Mu-Reg Definition: A Mu-aut M is a (Q, Σ, δ, s, F) where Q, Σ, δ, s are as usual but F 2 Q. That is F is a set of sets of states. M accepts x Σ ω if when you run M(x) the set of states visited inf often is in F. RECAP and PLAN: B-reg easily closed: UNION, INTER, PROJ. But COMP seems hard. 6

Mu-reg easily closed: UNION, INTER, COMP. But PROJ seems hard. Our plan if we were to do the entire proof: Show B-reg = Mu-reg. Theorem: S1S is Decidable. Proof: 1. Given a SENTENCE in S1S put it into the form (Q 1 A 1 ) (Q n A n )(Q n+1 x 1 ) (Q n+m x m )[φ(x 1,..., x m, A 1,..., A n )] 2. Assume Q 1 =. (If not then negate and negate answer.) 3. View as ( A)[φ(A)], a FORMULA with ONE free var. 4. Construct B-NDFA M for {A φ(a) is true}. 5. Test if L(M) =. 6. If L(M) then ( A)[φ(A)] is TRUE. If L(M) = then ( A)[φ(A)] is FALSE. COMPLEXITY OF THE DECISION PROCEDURE Given a sentence (Q 1 A 1 ) (Q n A n )(Q n+1 x 1 ) (Q n+m x m )[φ(x 1,..., x m, A 1,..., A n )] How long will the procedure above take in the worst case? 2 2 n steps since we do n nondet to det transformations. (This is not quite right- there are some log factors as well.) CAN ANYTHING INTERESTING BE STATED IN S1S? Is there interesting problems that can be STATED in S1S? YES: Verification of programs that are supposed to run forever like Operating systems. Verification of Security protocols. NO: There are no interesting MATH problems that can be expressed in S1S. EXTENSIONS WS1S and S1S are about strings of the form 0 1 and sets of such strings. WS2S and S2S are about strings of the form {0, 1} and sets of such strings. CAN ANYTHING INTERESTING BE STATED IN WS2S or S2S: WS2S: YES for verification, no for mathematics. S2S: YES for Mathematics (finally!). Verification- probably. I do not think S2S has ever been coded up. 7

ω-reg Definition: A language L is ω-reg if there exists regular langs U 1, U 2,..., U n, V 1, V 2,..., V n such that n L = U i Vi ω. Theorem: B-reg = ω-reg Lim-Reg Definition: i=1 1. Let V Σ. ioprefix(v) = {x = σ 1 σ 2 Σ ω ( i)[σ 1 σ i V ]} 2. A language L is ioprefix-reg if there exists regular langs U 1, U 2,..., U n, V 1, V 2,..., V n such that n L = U i ioprefix(v ) i=1 8