Documentation

MasterThesis.Compiler.Compiler_v1

Compiler for LOOP language, version 1 #

This file defines a compiler that translates (reversibilizes) any LOOP program into a corresponding SCORE program based on a specific notion of equivalence between LOOP states and SCORE states.

Notations #

Syntax-directed compiler from LOOP programs to SCORE programs. The compiler takes as input a LOOP.Com and outputs the equivalent SCORE.Com.

Equations
Instances For

    Notion of equivalence between LOOP states and SCORE states. A LOOP state s is said to be equivalent to a SCORE state t if for each identifier x the value of the register identified by x in s is equal to the current value of the variable identified by x in t.

    Equations
    Instances For
      theorem Compiler.eq_states_update {σ : LOOP.Store} {τ : SCORE.Store} (x : Ident) (v : ) :
      some σsome τsome (σ[x v])some (τ[x v :: τ x])

      Two states are kept equivalent if the first is updated by assigning a new value v to the register identified by x and the second is updated by inserting v on top of the stack identified by x.

      Let P be a LOOP program, σ a LOOP state and τ a SCORE state. If the two states are equivalent, then the evaluation of P in σ and the compiled SCORE program l2s P in τ end in two equivalent states.