1 Equality of Streams is a Problem Grigore Rosu University of Illinois at Urbana-Champaign.

Slides:



Advertisements
Similar presentations
Lecture 3 Universal TM. Code of a DTM Consider a one-tape DTM M = (Q, Σ, Γ, δ, s). It can be encoded as follows: First, encode each state, each direction,
Advertisements

CS 345: Chapter 9 Algorithmic Universality and Its Robustness
CS 461 – Nov. 9 Chomsky hierarchy of language classes –Review –Let’s find a language outside the TM world! –Hints: languages and TM are countable, but.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen Department of Computer Science University of Texas-Pan American.
1 COMP 382: Reasoning about algorithms Unit 9: Undecidability [Slides adapted from Amos Israeli’s]
1 Section 14.1 Computability Some problems cannot be solved by any machine/algorithm. To prove such statements we need to effectively describe all possible.
1 Introduction to Computability Theory Lecture12: Decidable Languages Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture15: Reductions Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture12: Reductions Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture13: Mapping Reductions Prof. Amos Israeli.
Courtesy Costas Busch - RPI1 A Universal Turing Machine.
P, NP, PS, and NPS By Muhannad Harrim. Class P P is the complexity class containing decision problems which can be solved by a Deterministic Turing machine.
Fall 2004COMP 3351 Recursively Enumerable and Recursive Languages.
Recursively Enumerable and Recursive Languages
CSE115/ENGR160 Discrete Mathematics 03/03/11 Ming-Hsuan Yang UC Merced 1.
1 Uncountable Sets continued Theorem: Let be an infinite countable set. The powerset of is uncountable.
CS 310 – Fall 2006 Pacific University CS310 Turing Machines Section 3.1 November 6, 2006.
Lecture 5 Turing Machines
1 Decidability continued. 2 Undecidable Problems Halting Problem: Does machine halt on input ? State-entry Problem: Does machine enter state halt on input.
November 3, 2009Introduction to Cognitive Science Lecture 15: Theory of Computation II 1 Languages Accepted by Turing Machines Example 2: Language L =
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 5 Reducibility Contents Undecidable Problems from Language Theory.
Fall 2004COMP 3351 A Universal Turing Machine. Fall 2004COMP 3352 Turing Machines are “hardwired” they execute only one program A limitation of Turing.
Theory of Computing Lecture 20 MAS 714 Hartmut Klauck.
CS21 Decidability and Tractability
Halting Problem. Background - Halting Problem Common error: Program goes into an infinite loop. Wouldn’t it be nice to have a tool that would warn us.
Induction and recursion
Algorithms: Selected Exercises Goals Introduce the concept & basic properties of an algorithm.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen Department of Computer Science University of Texas-Pan American.
February 18, 2015CS21 Lecture 181 CS21 Decidability and Tractability Lecture 18 February 18, 2015.
Computational Complexity Theory Lecture 2: Reductions, NP-completeness, Cook-Levin theorem Indian Institute of Science.
1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 15-1 Mälardalen University 2012.
1 The Halting Problem and Decidability How powerful is a TM? Any program in a high level language can be simulated by a TM. Any algorithmic procedure carried.
CSCI 2670 Introduction to Theory of Computing November 29, 2005.
MA/CSSE 474 Theory of Computation Enumerability Reduction.
A Universal Turing Machine
CS 103 Discrete Structures Lecture 13 Induction and Recursion (1)
1 Turing’s Thesis. 2 Turing’s thesis: Any computation carried out by mechanical means can be performed by a Turing Machine (1930)
CS Master – Introduction to the Theory of Computation Jan Maluszynski - HT Lecture 7 Undecidability cont. Jan Maluszynski, IDA, 2007
TM Design Macro Language D and SD MA/CSSE 474 Theory of Computation.
Turing -Recognizable vs. -Decidable
Capabilities of computing systems Numeric and symbolic Computations A look at Computability theory Turing Machines.
Lecture 21 Reducibility. Many-one reducibility For two sets A c Σ* and B c Γ*, A ≤ m B if there exists a Turing-computable function f: Σ* → Γ* such that.
Recursively Enumerable and Recursive Languages
Overview of the theory of computation Episode 3 0 Turing machines The traditional concepts of computability, decidability and recursive enumerability.
1 Introduction to Turing Machines
Donghyun (David) Kim Department of Mathematics and Computer Science North Carolina Central University 1 Chapter 5 Reducibility Some slides are in courtesy.
Turing Machines Sections 17.6 – The Universal Turing Machine Problem: All our machines so far are hardwired. ENIAC
1 8.4 Extensions to the Basic TM Extended TM’s to be studied: Multitape Turing machine Nondeterministic Turing machine The above extensions make no increase.
FORMAL LANGUAGES, AUTOMATA, AND COMPUTABILITY * Read chapter 4 of the book for next time * Lecture9x.ppt.
1 Recursively Enumerable and Recursive Languages.
1 A Universal Turing Machine. 2 Turing Machines are “hardwired” they execute only one program A limitation of Turing Machines: Real Computers are re-programmable.
Fall 2006Costas Busch - RPI1 RE languages and Enumerators.
A Universal Turing Machine
Recursively Enumerable and Recursive Languages
Behavioral Rewrite Systems and Behavioral Productivity
MCC 2093 Advanced Theoretical Computer Science
LIMITS OF ALGORITHMIC COMPUTATION
Summary.
Generating Optimal Linear Temporal Logic Monitors by Coinduction
Decidability and Undecidability
Proposed in Turing’s 1936 paper
Formal Languages, Automata and Models of Computation
Class 33: Making Recursion M.C. Escher, Ascending and Descending
CSCI 2670 Introduction to Theory of Computing
CS21 Decidability and Tractability
More Undecidable Problems
Turing -Recognizable vs. -Decidable
Algorithms CSCI 235, Spring 2019 Lecture 37 The Halting Problem
Lecture 4: Unsolvable Problems
Presentation transcript:

1 Equality of Streams is a Problem Grigore Rosu University of Illinois at Urbana-Champaign

2 Streams Infinite sequences (of 0,1 bits) 0, 1, 1, 0, 0, 1, … Many applications –Protocols (inputs/outputs) –Lazy functional programming (elegant) Canonical infinite structures –Basic case study for theoretical or algorithmic approaches to infinite state systems Many streams of interest can be defined equationally, with a finite number of equations

3 Outline Equational definitions of streams –Stream equality problem Computation as equational deduction Stream equality is  2 0 -hard –Reduction from TOTALITY Stream equality is in  2 0 –Completeness of FOL =

4 Equational Definitions of Streams Many practical streams and operations on streams can be defined equationally; e.g. Many languages support such definitions: functional (Haskell), algebraic (Maude), coalgebraic (BOBJ), etc. E 00 11 (01) 

5 Given an equational definition of streams E and stream terms str and str’, is it true that E str = str’ E.g: Stream Equality Problem E ? E ?

6 On Proving Stream Equality Equational deduction sound, but weak –Cannot show zip(zeros,ones) = blink Ordinary structural induction –Not always sound (constructors for streams?) –Weak, initial model not appropriate zip(zeros,ones) ≠ blink in the initial model Behavioral/observational techniques –Indistinguishability under experiments –Coinduction (Rutten), context induction (Hennicker), circular coinduction (Rosu)

7 Circular Coinduction zip(zeros, ones) = blink zip(zeros, ones) = blink 0 = 0zip(ones,zeros) = t(blink) 1 = 1zip(zeros,ones) = blink ht h t Cobasis {h,t} (i.e., experiments with h and t)

8 The Temptation … We show that neither of these is possible ! Moreover, we give a precise characterization of the difficulty of this problem Search for “complete” proof systems or algorithms for equality or for inequality of streams …

9 What is … P is iff P(k) = (  i)(  j) r(i,j,k) r

10 A Complete Problem TOTALITY Input: the k th –Turing machine, or –Partial recursive function Output –Does it halt, or is it total, on any input? (  input i)(  computation j) r(i,j,k) TOTALITY

11 TOTALITY: Simpler Version Fix a universal machine U, such that U(1 i 01 k ) runs machine number k on input number i Input –integer k Output –Does U(1 i 01 k ) halt for any integer i ? TOTALITY - simpler -

12 Encoding Computation as Equational Deduction - 1 Well known, but involved –Bergstra & Tucker, Nipkow, etc. We give simpler encoding (thanks to streams) –Turing machine M with tape infinite at both ends –Configuations q(L,R) –Add equation q(b’:L, b:R) = q’(L, b’:b:R) when M moves head to left, changing state from q to q’ –q start initial state, q halt halt state; add q halt (L,R) = 1 RL bb’ zeros b:R, b’:L streams

13 Encoding Computation as Equational Deduction - 2 Let E M be the equational specification associated to Turing machine M as above Theorem M halts on b 1 b 2 …b n iff E M satisfies q start (zeros, b 1 : b 2 : … : b n : zeros) = 1 We apply it when M is U (the universal TM)

14 Stream Equality is Hard - 1 Reduction from TOTALITY Let E U be the equational specification associated to universal Turing machine U Input –integer k Output –Does E U satisfy q start (0 , 1 i 01 k 0  ) = 1 for any i ? TOTALITY - deductive -

15 Stream Equality is Hard - 1 Reduction from TOTALITY Let E U be the equational specification associated to universal Turing machine U Input –integer k Output –Does E U satisfy q start (0 , 1 i 01 k 0  ) = 1 for any i ? TOTALITY - deductive -

16 Stream Equality is Hard - 2 Define an additional stream operation total?(R) = q start (0 , R) : total?(1:R) Input –integer k Output –Does E U satisfy total?(01 k 0  ) = 1  ? TOTALITY - equational -

17 Membership in - 1 Input – specification E and – streams str, str’ Output – Does E satisfy str = str’ ? Stream equality P is iff P(k) = (  i)(  j) r(i,j,k)

18 Membership in - 2 Step 1: build FOL = spec E Bit as follows –For each stream = stream’ in E, add r.e. set { hd(tl i (stream)) = hd(tl i (stream’)) | i  N } –Add  (0 = 1) –Add (  b:Bit) b = 0  b = 1 Step 2: prove theorem – E stream-satisfies str = str’ iff – for all i, E Bit satisfies hd(tl i (str)) = hd(tl i (str’)) in FOL= Step 3: conclude – is, by the complete deduction of FOL =

19 Conclusion hardness – Reduction from TOTALITY Membership in – Completeness of FOL = Stream Equality is - complete

20 What this result tells us No way to automatically –Prove equalities of streams –Prove inequalities of streams …

21 Then, what should we do? Should we then stop trying? –NO Instead, develop –Algorithms that work in “practice” –Criteria that filter out “bad” stream definitions For example, what makes the following coinductive proof work?

22 Circular Coinduction zip(odd(S), even(S)) = S zip(odd(S), even(S)) = S h(S) = h(S)zip(even(S),even(t(S))) = t(S) h(t(S)) = h(t(S))zip(even(t(S)), even(t(t(S)))) = t(t(S)) ht h t Cobasis {h,t}