A Simple and Efficient Universal Reversible Turing Machine

Similar documents
Turing s thesis: (1930) Any computation carried out by mechanical means can be performed by a Turing Machine

CSCI3390-Assignment 2 Solutions

Part I: Definitions and Properties

IV. Turing Machine. Yuxi Fu. BASICS, Shanghai Jiao Tong University

Computability Theory. CS215, Lecture 6,

Introduction to Turing Machines. Reading: Chapters 8 & 9

CpSc 421 Homework 9 Solution

Computability and Complexity

Turing Machine properties. Turing Machines. Alternate TM definitions. Alternate TM definitions. Alternate TM definitions. Alternate TM definitions

Theory of Computer Science

Chapter 3: The Church-Turing Thesis

Chapter 8. Turing Machine (TMs)

Turing Machines. The Language Hierarchy. Context-Free Languages. Regular Languages. Courtesy Costas Busch - RPI 1

The Turing Machine. CSE 211 (Theory of Computation) The Turing Machine continued. Turing Machines

HIS LEGACY. 100 Years Turing celebration. Gordana Dodig Crnkovic, IDT Open Seminar. Computer Science and Network Department Mälardalen University

Most General computer?

Theory of Computation - Module 4

Lecture notes on Turing machines

1 Unrestricted Computation

Models. Models of Computation, Turing Machines, and the Limits of Turing Computation. Effective Calculability. Motivation for Models of Computation

Chapter 5. Finite Automata

Computable Functions

Designing 1-tape Deterministic Turing Machines

Turing Machines A Turing Machine is a 7-tuple, (Q, Σ, Γ, δ, q0, qaccept, qreject), where Q, Σ, Γ are all finite

CS154 Final Examination

Theory of Computation

6.5.3 An NP-complete domino game

1 The decision problem for First order logic

THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET

Lecture 14: Recursive Languages

Decidability: Church-Turing Thesis

arxiv: v1 [cs.lo] 16 Jul 2017

Homework. Turing Machines. Announcements. Plan for today. Now our picture looks like. Languages

Lecture 12: Mapping Reductions

(a) Definition of TMs. First Problem of URMs

Introduction to Languages and Computation

Homework Assignment 6 Answers

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

Introduction to Turing Machines

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

Before We Start. Turing Machines. Languages. Now our picture looks like. Theory Hall of Fame. The Turing Machine. Any questions? The $64,000 Question

Complexity Theory Part I

ACS2: Decidability Decidability

CSE 105 THEORY OF COMPUTATION

A Lower Bound for Boolean Satisfiability on Turing Machines

Lecture 1: Course Overview and Turing machine complexity

More About Turing Machines. Programming Tricks Restrictions Extensions Closure Properties

More Turing Machines. CS154 Chris Pollett Mar 15, 2006.

Week 2: Defining Computation

CS5371 Theory of Computation. Lecture 10: Computability Theory I (Turing Machine)

CSE355 SUMMER 2018 LECTURES TURING MACHINES AND (UN)DECIDABILITY

The Power of One-State Turing Machines

Computation. Some history...

Opleiding Informatica

About the relationship between formal logic and complexity classes

Q = Set of states, IE661: Scheduling Theory (Fall 2003) Primer to Complexity Theory Satyaki Ghosh Dastidar

Time Complexity (1) CSCI Spring Original Slides were written by Dr. Frederick W Maier. CSCI 2670 Time Complexity (1)

6.045: Automata, Computability, and Complexity (GITCS) Class 15 Nancy Lynch

CS5371 Theory of Computation. Lecture 10: Computability Theory I (Turing Machine)

Turing Machines. Our most powerful model of a computer is the Turing Machine. This is an FA with an infinite tape for storage.

Turing Machines (TM) Deterministic Turing Machine (DTM) Nondeterministic Turing Machine (NDTM)

Theory of Computation

Harvard CS 121 and CSCI E-121 Lecture 14: Turing Machines and the Church Turing Thesis

Reducability. Sipser, pages

Busch Complexity Lectures: Turing s Thesis. Costas Busch - LSU 1

Chapter 2 Algorithms and Computation

Turing machines Finite automaton no storage Pushdown automaton storage is a stack What if we give the automaton a more flexible storage?

Lecture 1: Introduction

On the Computational Hardness of Graph Coloring

Asymptotic notation : big-o and small-o

Lecture 23: Rice Theorem and Turing machine behavior properties 21 April 2009

Chapter 7 Turing Machines

Finite Automata. Mahesh Viswanathan

CSE 105 THEORY OF COMPUTATION

CPSC 421: Tutorial #1

Final Exam Comments. UVa - cs302: Theory of Computation Spring < Total

Turing Machines Part III

Busch Complexity Lectures: Turing Machines. Prof. Busch - LSU 1

CS21 Decidability and Tractability

Turing Machine Variants. Sipser pages

CS294: Pseudorandomness and Combinatorial Constructions September 13, Notes for Lecture 5

Complexity (Pre Lecture)

ECS 120 Lesson 15 Turing Machines, Pt. 1

Variations of the Turing Machine

Computability Theory

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

Chapter 1 - Time and Space Complexity. deterministic and non-deterministic Turing machine time and space complexity classes P, NP, PSPACE, NPSPACE

ASSIGNMENT THREE SOLUTIONS MATH 4805 / COMP 4805 / MATH (1) (a) A transition diagram appears below for the TM specified by the 7-tuple M =

CS 21 Decidability and Tractability Winter Solution Set 3

Predicate Logic - Undecidability

Turing machines COMS Ashley Montanaro 21 March Department of Computer Science, University of Bristol Bristol, UK

Turing Machines Part II

Turing Machines. Chapter 17

Recap DFA,NFA, DTM. Slides by Prof. Debasis Mitra, FIT.

Exam Computability and Complexity

1 Showing Recognizability

4.2 The Halting Problem

Turing Machines Part II

Time to learn about NP-completeness!

CS 410/610, MTH 410/610 Theoretical Foundations of Computing

Transcription:

A Simple and Efficient Universal Reversible Turing Machine Holger Bock Axelsen Robert Glück DIKU, Dept. of Computer Science, University of Copenhagen www.diku.dk/ funkstar LATA 2011, May 31, Tarragona

Overview Reversible Turing machines Universality for RTMs A first principles URTM 2

The setting: Turing machines [Picture credit: Tom Dunne, American Scientist, March-April 2002] 3

Turing machines Definition (Turing machine) A TM T is a tuple (Q, Σ, δ, b, q s, q f ) where Q is a finite set of states, Σ is a finite set of tape symbols, b Σ is the blank symbol, δ (Q [(Σ Σ) {,, }] Q) is a partial relation defining the transition relation, q s Q is the starting state, and q f Q is the final state. There must be no transitions leading out of q f nor into q s. 4

Triple format for transition rules δ (Q [(Σ Σ) {,, }] Q) The form of a triple format rule in δ is either: a symbol rule (q, (s, s ), q ) where s, s Σ, or a move rule (q, d, q ) where d {,, }. (Triples can be converted to the usual quintuples, and vice versa. We use it for convenience.) 5

Reversible Turing machines (RTMs) Intuition: RTMs are those where each configuration has a unique successor and predecessor configuration. Definition (Reversible Turing machine) A TM T is reversible iff it is (locally) forward and backward deterministic. 6

Local backward determinism: Examples (q, (a, b), p) and (q, (a, c), p) respects bwd determinism. (q, (a, b), p) and (r, (c, b), p) breaks bwd determinism. (q, (a, b), p) and (r,, p) breaks bwd determinism. 7

Local forward/backward determinism Definition (Local forward determinism) A TM T is local forward deterministic iff for any distinct pair of triples (q 1, a 1, q 1 ) δ and (q 2, a 2, q 2 ) δ, if q 1 = q 2 then a 1 = (s 1, s 1 ) and a 2 = (s 2, s 2 ), and s 1 s 2. Definition (Local backward determinism) A TM T is local backward deterministic iff for any distinct pair of triples (q 1, a 1, q 1 ) δ and (q 2, a 2, q 2 ) δ, if q 1 = q 2 then a 1 = (s 1, s 1 ) and a 2 = (s 2, s 2 ), and s 1 s 2. 8

RTM computability Some important results: RTMs compute injective functions, only. All injective computable function are computable with RTMs. 1-tape, 3-symbol RTMs are sufficient. RTMs can be easily inverted. 9

Classical universality A universal TM U is defined as a self-interpreter for Turing machines: [[U]]( T, x) = [[T ]](x). Here, T Σ is a Gödel number representing some TM T. Problem: Does not work for RTMs - [[U]] is non-injective. 10

RTM-universality An RTM-universal TM U R is defined by [[U R ]]( T, x) = ( T, [[T ]](x)). where T Σ is a Gödel number representing some RTM T. [[U R ]] is injective and computable computable by some RTM. 11

Why a first-principles approach? Pioneering work by Bennett, Morita rely on reversible simulations of irreversible machines. Asymptotically very costly: As much space as time! The URTM we give has better complexity: (Program dependent) constant factor slowdown, same space as interpreted program. 12

URTM overview Scope: Interprets 1-tape, 3-symbol RTMs (T = {Q, {b, 0, 1}, δ, b, q s, q f }). Structure: Work tape: Identical to T s tape. Program tape: Contains the program T. State tape: Encoding of T s internal state, q c. 13

Program encoding T A program is a string T over Σ = {b, 0, 1, B, S, M, #}. T lists the rules δ of T, with q s rule first, q f rule last. trans(q, (s, s ), q ) = S#e(q)#e(s)e(s )#(e(q )) R #S trans(q, d, q ) = M#e(q)#e(d)#(e(q )) R #M e : Q {0,1} log Q is an injective binary encoding of states. e(s) = { B s if s = b otherwise 10 if d = e(d) = BB if d = 01 if d = 14

Program encoding, example RTM T = ({q 0, q 1, q 2, q 3 }, {b, 0, 1}, δ, b, q 0, q 3 ) δ = {(q 0,, q 1 ), (q 1, (0, 1), q 2 ), (q 1, (1, 0), q 2 ), (q 2,, q 3 )} T = M#00#01#10#MS#01#01#01#SS#01#10#01#SM#10#10#11#M e is given by q 0 00, q 1 01, q 2 10 and q 3 11. 15

URTM program symbol rule move rule S, S M, M halt start b, b rewind program tape write q c = q s rewind program tape false q c = q f true clear q c = q f Problem: Lots of irreversibilities in control flow. 16

URTM program S, S M, M symbol rule move rule S, S M, M halt start b, b b, b rewind program tape write q c = q s rewind program tape false q c = q f true clear q c = q f Use enclosing S,M to join paths after rule tests. 17

URTM program S, S M, M symbol rule move rule S, S M, M halt start b, b b, b rewind program tape write q c = q s true false false q c = q s rewind program tape q c = q f true clear q c = q f Works because q s is only visited once. 18

String comparison A key functionality we need to implement is string comparison. Assume a 2-tape structure #s 1 s n # #t 1 t n # with tape heads on the leftmost #. From internal state q, we want to pass over the strings, ending in internal state q = if the strings match, and in internal state q if they don t, with the tape heads in either case on the rightmost #. 19

Irreversible string comparison of #s 1 s n # #t 1 t n # [ ] [ ] start p = [ ] α, α, α # α, α [ ] [ ] [ ] α, α, α, β # β, β [ ] α, α, α β β, β q Irreversibility at state q (and probably p). 20

Reversible string comparison of #s 1 s n # #t 1 t n # [ ] [ ] [ ] start = [ ] [ ] [ ] α, α, α, β # β, β [ ] α, α, α # α, α [ ] [ ] [ ] α, α, α # α, α [ ] α, α, α β β, β 21

Inverse string comparison of #s 1 s n # #t 1 t n # = join start [ ] [ [ ] ] [ ] [ ] α, α, α, β # β, β [ ] α, α, α # α, α [ ] [ ] [ ] [ ] α, α, α # α, α = start [ ] α, α, α β β, β 22

Testing a symbol rule (q, (s, s ), q ) t q c = q f s c = s f t apply rule Must resolve the join in control flow. 23

Testing a symbol rule (q, (s, s ), q ) t q c = q f f s c = s f t q c = q t apply rule This assertion works for all T. Still irreversible... 24

Testing a symbol rule (q, (s, s ), q ) s c = s t t apply rule s c = s t q c = q f f f t q c = q f t q c = q t q c = q f f Only works because T is reversible! 25

URTM program S, S M, M symbol rule move rule S, S M, M halt start b, b b, b rewind program tape write q c = q s true false false q c = q s rewind program tape q c = q f true clear q c = q f Move rule is analogous to symbol rule. Write/clear are subparts of apply rule. Rewind is a subpart of string comparison. 26

Bonus: Inverse interpretation URTM can work as a (reversible) inverse interpreter with no extra overhead. A reversible inverse interpreter is a program rinvint s.t. [[rinvint]](p, y) = (p, x) iff [[p]](x) = y We intentionally designed the program encoding s.t. T R = T 1 Let R perform string reversal. (Linear time using 2 tapes.) [[R U R]] ( T, y) = ( T, [[T 1 ]](y)) 27

Conclusion First URTM with Constant factor slowdown (proportional to length( T ).) No space overhead (unlike all previous approaches.) Inverse interpretation for free. The RTMs can simulate themselves efficiently. 28