90 likes | 215 Views
Translation, simulation and other exercises with reversible languages. Holger Bock Axelsen Dept. of Computer Science, DIKU University of Copenhagen. GRACE Int’l Meeting on Bidirectional Transformations. What can reversible languages compute ?.
E N D
Translation, simulation and other exercises with reversible languages Holger Bock Axelsen Dept. of Computer Science, DIKU University of Copenhagen GRACE Int’l Meeting on Bidirectional Transformations
Whatcan reversible languagescompute? • Restriction: Logicalreversibilityimpliesthatwecanonlycomputeinjectivefunctionsin reversible languages. Programs Functions Computable functions Turing Machines Rev. TM Injective computable functions Injective functions
Reversible computing vs.bidirectional transformations • Computing injective functions: Anatural choice for bidirectional transformation? • That’s what I’m here to find out…
Translation • Janus -> PISAcompiler T. PISA: Reversible assembler • Atomic stmt: x+=e (x := x+e) • T(+=)is easy: ADD$a $b ($a <- $a + $b) • T(e)istricky: • Problem:expression evaluation is irreversible, even thoughstatementevaluation is reversible!) • PISA cannotcompute [[e]]!
…Orcan it? • Question: Can all computationsbe done reversibly? • Answer: Yes, byextendingthe output withgarbage, ensuringreversibility. • Landauer (1961): Add a trace. • Bennett (1973): Copy the input to the output. • Problem: Altering the type of the computedfunction.
Translation strategy • Evaluatinge is irreversible. • But wecanevaluateexpressionsreversiblyusinggarbage. • Uncomputation is easy: Inversion of PISA code fore. • Use a version of the local Bennett trick (reversible update). 1. Computee + garbage. 2. Updatex with the result of e. 3.Uncomputee + garbage. x+=e Semantics-preservingtranslation T(x += e)
Church-Turingthesis: Reversible Computing Version • ClassicalChurch-Turingthesis: If functionf is computable in languageS, then it is computable in anyotherlanguageT. • Reversible Church-Turingthesis (RCT): If functionf is computable in reversiblelanguageS, then it is computable in anyother reversible languageT. Specifically, withoutaltering the type of the computedfunction.
r-Turingcompleteness • The RCT saysthat reversible languagescancomputeexactly the same functions. The type is conserved (modulo data representation). • Suggeststhat reversible languagescansimulateeachothercleanly. • Clean: Nogarbagenecessary. No Landauer embedding, Bennett trick, oranyother ”injectivization” is inherentlynecessarywhendealingwith simulation of reversible languages! • Definition: A reversible language is r-Turingcompleteiff it cansimulate reversible Turingmachinescleanly.
Possible talks • Reversible flowchart languages (~25min.): • Proof that structured programs are as computationally strong as unstructured, in RC. • r-Turing completeness demonstrated. • Injectivization of classical Turing machines. • Janus -> PISA compilation (~45min.): • More on reversibility. • CFO, procedure call translation. • Register allocation.