SlideShare a Scribd company logo
Equivalence of Algebraic λ-calculi

 Alejandro Díaz-Caro1           Simon Perdrix12
     Christine Tasson3          Benoît Valiron1
          1 LIG,   Université de Grenoble
                       2 CNRS

               3 CEA-LIST,   MeASI


     HOR • July 14th, 2010 • Edinburgh
Algebraic calculi


               Algebraic ≡ Module structure
                                                              1
                                            (λx.yx +            · λx.y(yx)) λz.z
                                                              2
               Two origins
                       λalg −→ differential calculus
                       λlin −→ quantum computation

               Differences in
                       the encoding of the module structure
                       how the reduction rules apply




A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi   2 / 25
λalg and λlin

       share the same set of terms

                          M, N, L ::= V | (M ) N | M + N | α · M
                           U, V, W          ::= B | α · B | V + W | 0
                                     B ::= x | λx.M

       closed under associativity and conmutativity

                  M +N =N +M                              (M + N ) + L = M + (N + L)


               base term is either a variable or abstraction
               a value is either 0 or of the form                              αi · Bi ;
               a general term can be anything.


A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi       3 / 25
Rules for λalg
Group E



                      α · 0 =a              0                            0 + M =a      M
               α · (β · M ) =a              (α × β) · M                   0 · M =a     0
                     1 · M =a               M                      α · (M + N ) =a     α·M +α·N


           α·M +β·M                 =a      (α + β) · M
Group F
Group A




              (M + N ) L =a (M ) L + (N ) L
               (α · M ) N =a α · (M ) N
                    (0) M =a 0
Group B




          (λx.M ) N →a M [x := N ]

A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi              4 / 25
Rules for λlin
Group E



                      α·0 →                 0                            0+M →         M
               α · (β · M ) →               (α × β) · M                   0·M →        0
                     1·M →                  M                      α · (M + N ) →      α·M +α·N


           α·M +β·M                 →       (α + β) · M
Group F




             α·M +M                 →       (α + 1) · M
               M +M                 →       (1 + 1) · M
Group A




             (M + N ) L → (M ) L + (N ) L (M ) (N + L) → (M ) N + (M ) L
              (α · M ) N → α · (M ) N       (M ) α · N → α · (M ) N
                   (0) M → 0                     (M ) 0 → 0
Group B




          (λx.M ) B →a M [x := B]

A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi          5 / 25
Context rules

       Some common rules
                                  M →M                                         M →M
                          (M ) N → (M ) N                             M +N →M +N

                                   N →N                                        M →M
                         M +N →M +N                                      α·M →α·M
       plus one additional rule for λlin

                                                        M→ M
                                                (V ) M → (V ) M




A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi   6 / 25
Modifications to the original calculi



       The most important

               No reduction under lambda (à la Plotkin)

               λx.M is a base term for any M

                               λx.(α · M + β · N ) = α · λx.M + β · λx.N




A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi   7 / 25
Confluence

       This system is not trivially confluent
       Example
       Let Yb = (λx.(b + (x) x)) (λx.(b + (x) x)), then

                                     0 ← Yb − Yb → Yb + b − Yb → b

       Several possible solutions
               Type system → strong normalisation
               Take scalars as positive reals
               Restrict some of the reduction rules

       For this talk, we simply assume that confluence holds.



A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi   8 / 25
Question




                     Can we simulate λlin with λalg and λalg with λlin ?




A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi   9 / 25
Simulating λalg with λlin
Thunks

       Idea: encapsulating terms M as B = λf.M . So M ≡ (B) f




A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi   10 / 25
Simulating λalg with λlin
Thunks

       Idea: encapsulating terms M as B = λf.M . So M ≡ (B) f

                                           (|x|)f         =      (x) f
                                           (|0|)f         =      0
                                     (|λx.M |)f           =      λx.(|M |)f
                                   (|(M ) N |)f           =      ((|M |)f ) λz.(|N |)f
                                  (|M + N |)f             =      (|M |)f + (|N |)f
                                     (|α · M |)f          =      α · (|M |)f

       If the encoding λalg → λlin is denoted with (|−|)f , one could
       expect the result

                               M →∗ N
                                  a                      ⇒            (|M |)f →∗ (|N |)f



A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi       10 / 25
Problem



       Example
       (λx.λy.(y) x) I →a λy.(y) I,

          (|(λx.λy.(y) x) I|)f = (λx.λy.((y) f ) (λz.(x) f )) (λz λx.(x) f )
                               →∗ λy.((y) f ) (λz.(λz.λx.(x) f ) f ),
          (|λy.(y) I|)f        = λy.((y) f ) (λz.λx.(x) f )

       “Administrative” redex hidden in the first one




A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi   11 / 25
Removing administrative redexes

                                   Admin f 0 = 0
                                   Admin f x = x
                    Admin f (λf.M ) f                   = Admin f M
                        Admin f (M ) N                  = (Admin f M ) Admin f N
                           Admin f λx.M                 = λx.Admin f M                 (x = f )
                        Admin f M + N                   = Admin f M + Admin f N
                           Admin f α · M                = α · Admin f M


       Theorem (Simulation)
       For any program (i.e. closed term) M , and value V ,
       if M →∗ V then exists a value W such that
              a

                        (|M |)f →∗ W and Admin f W = Admin f (|V |)f
A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi              12 / 25
First,


                                    M                                      /N

                                       ≡Admin f
                                    M




       Lemma
       If Admin f M = Admin f M and M → N then there exists N
       such that Admin f N = Admin f N and such that M →∗ N .




A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi   13 / 25
First,


                                    M                                      /N

                                       ≡Admin f                                ≡Admin f
                                    M
                                                                          ∗/   N




       Lemma
       If Admin f M = Admin f M and M → N then there exists N
       such that Admin f N = Admin f N and such that M →∗ N .




A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi      13 / 25
Then,


                                      M


                                        ≡Admin f


                                      W

       Lemma
       If W is a value and M a term such that
       Admin f W = Admin f M , then there exists a value V such that
       M →∗ V and Admin f W = Admin f V .




A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi   14 / 25
Then,


                                      M OOO
                                           OOO
                                              OOO
                                                 OOO
                                                    OOO
                                       ≡Admin f        OOO
                                                          OOO
                                                             OOO
                                                                OO'
                                                                 ∗
                                      W           ≡Admin f          V

       Lemma
       If W is a value and M a term such that
       Admin f W = Admin f M , then there exists a value V such that
       M →∗ V and Admin f W = Admin f V .




A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi   14 / 25
Finally,



                                     M

                                    a                                     ∗/
                                     N               (|N |)f                    V


       Lemma
       For any program (i.e. closed term) M , if M →a N and
       (|N |)f →∗ V for a value V, then there exists M such that
       (|M |)f →∗ M such that Admin f M = Admin f V .




A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi   15 / 25
Finally,



                                     M               (|M |)f             / ∗M

                                                                                ≡Admin f
                                    a                                     ∗/
                                     N               (|N |)f                    V


       Lemma
       For any program (i.e. closed term) M , if M →a N and
       (|N |)f →∗ V for a value V, then there exists M such that
       (|M |)f →∗ M such that Admin f M = Admin f V .




A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi       15 / 25
Now, we want



                                                                               ∗/
                                            M                                  aV



                                         (|M |)f                               (|V |)f




A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi     16 / 25
Now, we want



                                                                               ∗/
                                            M                                  aV



                                         (|M |)f                               (|V |)f
                                                   FF
                                                     FF
                                                       FF                ≡Admin f
                                                         FF ∗
                                                           
                                                               W




A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi     16 / 25
Base case




                                          V                    =                       V


                                       (|V |)f                                   (|V |)f

                                              =                                 =
                                                            (|V |)f




A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi       17 / 25
Inductive case
                                                                /                             ∗/
                        M                                      aM                             aV



                     (|M |)f                                   (|M |)f                        (|V |)f
                                                                       EE
                                                                         EE
                                                                           EE            ≡Admin f
                                                                             EE ∗
                                                                               
                                                                                   W



                                                                                        Lemma 2
                            Lemma 3                                    M
                                                                           EE
                                          /   ∗                              EE
        M              (|M | f
                           )                      M                              EE
                                                                                   EE
                                                                                     EE
                                                  ≡Admin                 ≡Admin        EE
                                                           f                    f
                                                                                         EE
                                                                                          EE
                                              /
       a
         M              ( |f
                         |M )
                                              ∗
                                                  W                                          EE ∗
                                                                                               
                                                                         W                        W

A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi                    18 / 25
Inductive case
                                                                /                                   ∗/
                        M                                      aM                                   aV



                     (|M |)f                                   (|M |)f                              (|V |)f
                                GG                                     EE
                                  GG                                     EE
                                    GG                                     EE
                                      GG                                     EE ∗               ≡Admin f
                                        G# ∗                                   
                                              M                ≡Admin f            W



                                                                                            Lemma 2
                            Lemma 3                                    M
                                                                           EE
                                          /   ∗                              EE
        M              (|M | f
                           )                      M                              EE
                                                                                   EE
                                                                                     EE
                                                  ≡Admin                 ≡Admin        EE
                                                           f                    f
                                                                                         EE
                                                                                          EE
                                              /
       a
         M              ( |f
                         |M )
                                              ∗
                                                  W                                          EE ∗
                                                                                               
                                                                         W             ≡Admin
                                                                                                f     W

A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi                          18 / 25
Inductive case
                                                                /                             ∗/
                        M                                      aM                             aV



                     (|M |)f                                   (|M |)f                        (|V |)f
                                GG                                     EE
                                  GG                                     EE
                                    GG                                     EE
                                      GG                                     EE ∗        ≡Admin f
                                        G# ∗                                   
                                              M H      ≡Admin f    W
                                                 HH
                                                   HH
                                                     HH        ≡Admin f
                                                       HH ∗
                                                         #
                                                           W
                                                                                        Lemma 2
                            Lemma 3                                    M
                                                                           EE
                                          /   ∗                              EE
        M              (|M | f
                           )                      M                              EE
                                                                                   EE
                                                                                     EE
                                                  ≡Admin                 ≡Admin        EE
                                                           f                    f
                                                                                         EE
                                                                                          EE
                                              /
       a
         M              ( |f
                         |M )
                                              ∗
                                                  W                                          EE ∗
                                                                                               
                                                                         W                        W

A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi                    18 / 25
Simulating λlin with λalg
CPS encoding



       We define [|−|] : λlin → λalg

                                 [|x|]     =      λf. (f ) x
                                 [|0|]     =      0
                          [|λx.M |]        =      λf.(f ) λx.[|M |]
                        [|(M ) N |]        =      λf.([|M |]) λg.([|N |]) λh.((g) h) f
                           [|α · M |]      =      λf.(α · [|M |]) f
                       [|M + N |]          =      λf.([|M |] + [|N |]) f

       Now, given the continuation I = λx.x, if M → V we want
       ([|M |]) I →a W for some W related to [|V |]




A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi     19 / 25
The encoding for values


                                        Ψ(x)               =      x,
                                         Ψ(0)              =      0,
                                     Ψ(λx.M )              =      λx.[|M |],
                                     Ψ(α · V )             =      α · Ψ(V ),
                                    Ψ(V + W )              =      Ψ(V ) + Ψ(W ).

               Ψ(V ) is such that [|V |] →∗ Ψ(V ).
                                          a


       Theorem (Simulation)
                          M →∗ V                   ⇒            ([|M |]) λx.x →∗ Ψ(V ).
                                                                               a




A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi      20 / 25
An auxiliary definition


       Note that

                          ([|B|]) K = (λf.(f ) Ψ(B)) K →∗ (K) Ψ(B).
                                                        a


               We define the term B : K = (K) Ψ(B).
               We extend this definition to other terms in some
               not-so-easy way due to the algebraic properties of the
               language.
               It is the main difficulty in this proof.




A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi   21 / 25
The auxiliary definition

       Let (:) : λlin × λalg → λalg :

                           B : K = (K) Ψ(B)
                           (M + N ) : K = M : K + N : K
                           α · M : K = α · (M : K)
                           0:K=0
                           (U ) B : K = ((Ψ(U )) Ψ(B)) K
                           (U ) (V + W ) : K = ((U ) V + (U ) W ) : K
                           (U ) (α · B) : K = α · (U ) B : K
                           (U ) 0 : K = 0
                           (U ) N : K = N : λf.((Ψ(U )) f ) K
                           (M ) N : K = M : λg.([|N |]) λh.((g) h) K




A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi   22 / 25
Proof




       If M →∗ V ,

                                    ([|M |]) (λx.x)


                                                                       Ψ(V )




A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi   23 / 25
Proof

       If K is a value:
               For all M , ([|M |]) K →∗ M : K
                                       a
               If M → N then M : K →∗ N : K
                                    a
               If V is a value, V : K →∗ (K) Ψ(V )
                                       a

       If M →∗ V ,

                                    ([|M |]) (λx.x)             →∗ M : λx.x
                                                                 a



                                                                       Ψ(V )




A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi   23 / 25
Proof

       If K is a value:
               For all M , ([|M |]) K →∗ M : K
                                       a
               If M → N then M : K →∗ N : K
                                    a
               If V is a value, V : K →∗ (K) Ψ(V )
                                       a

       If M →∗ V ,

                                    ([|M |]) (λx.x)             →∗ M : λx.x
                                                                 a
                                                                →∗ V : λx.x
                                                                 a


                                                                       Ψ(V )




A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi   23 / 25
Proof

       If K is a value:
               For all M , ([|M |]) K →∗ M : K
                                       a
               If M → N then M : K →∗ N : K
                                    a
               If V is a value, V : K →∗ (K) Ψ(V )
                                       a

       If M →∗ V ,

                                    ([|M |]) (λx.x)             →∗ M : λx.x
                                                                 a
                                                                →∗ V : λx.x
                                                                 a
                                                                →∗ (λx.x) Ψ(V )
                                                                 a
                                                                   Ψ(V )




A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi   23 / 25
Proof

       If K is a value:
               For all M , ([|M |]) K →∗ M : K
                                       a
               If M → N then M : K →∗ N : K
                                    a
               If V is a value, V : K →∗ (K) Ψ(V )
                                       a

       If M →∗ V ,

                                    ([|M |]) (λx.x)             →∗
                                                                 a     M : λx.x
                                                                →∗
                                                                 a     V : λx.x
                                                                →∗
                                                                 a     (λx.x) Ψ(V )
                                                                →a     Ψ(V )




A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi   23 / 25
Future and ongoing work




       In classical lambda-calculus:
               CPS can also be done to interpret call-by-name in
               call-by-value [Plotkin 75].
               The thunk construction can be related to CPS [Hatcliff and
               Danvy 96].
       Can we relate to these?




A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi   24 / 25
Future and ongoing work




       Other interesting questions
               The choice between equality and reduction rules seems
               arbitrary.
       Can we exchange them?
       Are the simulations still valid?




A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi   25 / 25

More Related Content

What's hot

Common derivatives integrals_reduced
Common derivatives integrals_reducedCommon derivatives integrals_reduced
Common derivatives integrals_reduced
Kyro Fitkry
 
Lesson 6: Limits Involving Infinity (slides)
Lesson 6: Limits Involving Infinity (slides)Lesson 6: Limits Involving Infinity (slides)
Lesson 6: Limits Involving Infinity (slides)
Matthew Leingang
 
Lesson 5: Continuity (slides)
Lesson 5: Continuity (slides)Lesson 5: Continuity (slides)
Lesson 5: Continuity (slides)
Matthew Leingang
 
L. Jonke - A Twisted Look on Kappa-Minkowski: U(1) Gauge Theory
L. Jonke - A Twisted Look on Kappa-Minkowski: U(1) Gauge TheoryL. Jonke - A Twisted Look on Kappa-Minkowski: U(1) Gauge Theory
L. Jonke - A Twisted Look on Kappa-Minkowski: U(1) Gauge Theory
SEENET-MTP
 
Classification with mixtures of curved Mahalanobis metrics
Classification with mixtures of curved Mahalanobis metricsClassification with mixtures of curved Mahalanobis metrics
Classification with mixtures of curved Mahalanobis metrics
Frank Nielsen
 
A series of maximum entropy upper bounds of the differential entropy
A series of maximum entropy upper bounds of the differential entropyA series of maximum entropy upper bounds of the differential entropy
A series of maximum entropy upper bounds of the differential entropy
Frank Nielsen
 
Calculus cheat sheet_integrals
Calculus cheat sheet_integralsCalculus cheat sheet_integrals
Calculus cheat sheet_integrals
UrbanX4
 
Geodesic Method in Computer Vision and Graphics
Geodesic Method in Computer Vision and GraphicsGeodesic Method in Computer Vision and Graphics
Geodesic Method in Computer Vision and Graphics
Gabriel Peyré
 
Divergence clustering
Divergence clusteringDivergence clustering
Divergence clustering
Frank Nielsen
 
Divergence center-based clustering and their applications
Divergence center-based clustering and their applicationsDivergence center-based clustering and their applications
Divergence center-based clustering and their applications
Frank Nielsen
 
On the Jensen-Shannon symmetrization of distances relying on abstract means
On the Jensen-Shannon symmetrization of distances relying on abstract meansOn the Jensen-Shannon symmetrization of distances relying on abstract means
On the Jensen-Shannon symmetrization of distances relying on abstract means
Frank Nielsen
 
1533 game mathematics
1533 game mathematics1533 game mathematics
1533 game mathematics
Dr Fereidoun Dejahang
 
Patch Matching with Polynomial Exponential Families and Projective Divergences
Patch Matching with Polynomial Exponential Families and Projective DivergencesPatch Matching with Polynomial Exponential Families and Projective Divergences
Patch Matching with Polynomial Exponential Families and Projective Divergences
Frank Nielsen
 
Bregman divergences from comparative convexity
Bregman divergences from comparative convexityBregman divergences from comparative convexity
Bregman divergences from comparative convexity
Frank Nielsen
 
Taylor problem
Taylor problemTaylor problem
Taylor problem
dinhmyhuyenvi
 
Stuff You Must Know Cold for the AP Calculus BC Exam!
Stuff You Must Know Cold for the AP Calculus BC Exam!Stuff You Must Know Cold for the AP Calculus BC Exam!
Stuff You Must Know Cold for the AP Calculus BC Exam!
A Jorge Garcia
 
Lesson 21: Curve Sketching (slides)
Lesson 21: Curve Sketching (slides)Lesson 21: Curve Sketching (slides)
Lesson 21: Curve Sketching (slides)
Matthew Leingang
 
Proximal Splitting and Optimal Transport
Proximal Splitting and Optimal TransportProximal Splitting and Optimal Transport
Proximal Splitting and Optimal Transport
Gabriel Peyré
 
Computational Information Geometry: A quick review (ICMS)
Computational Information Geometry: A quick review (ICMS)Computational Information Geometry: A quick review (ICMS)
Computational Information Geometry: A quick review (ICMS)
Frank Nielsen
 

What's hot (19)

Common derivatives integrals_reduced
Common derivatives integrals_reducedCommon derivatives integrals_reduced
Common derivatives integrals_reduced
 
Lesson 6: Limits Involving Infinity (slides)
Lesson 6: Limits Involving Infinity (slides)Lesson 6: Limits Involving Infinity (slides)
Lesson 6: Limits Involving Infinity (slides)
 
Lesson 5: Continuity (slides)
Lesson 5: Continuity (slides)Lesson 5: Continuity (slides)
Lesson 5: Continuity (slides)
 
L. Jonke - A Twisted Look on Kappa-Minkowski: U(1) Gauge Theory
L. Jonke - A Twisted Look on Kappa-Minkowski: U(1) Gauge TheoryL. Jonke - A Twisted Look on Kappa-Minkowski: U(1) Gauge Theory
L. Jonke - A Twisted Look on Kappa-Minkowski: U(1) Gauge Theory
 
Classification with mixtures of curved Mahalanobis metrics
Classification with mixtures of curved Mahalanobis metricsClassification with mixtures of curved Mahalanobis metrics
Classification with mixtures of curved Mahalanobis metrics
 
A series of maximum entropy upper bounds of the differential entropy
A series of maximum entropy upper bounds of the differential entropyA series of maximum entropy upper bounds of the differential entropy
A series of maximum entropy upper bounds of the differential entropy
 
Calculus cheat sheet_integrals
Calculus cheat sheet_integralsCalculus cheat sheet_integrals
Calculus cheat sheet_integrals
 
Geodesic Method in Computer Vision and Graphics
Geodesic Method in Computer Vision and GraphicsGeodesic Method in Computer Vision and Graphics
Geodesic Method in Computer Vision and Graphics
 
Divergence clustering
Divergence clusteringDivergence clustering
Divergence clustering
 
Divergence center-based clustering and their applications
Divergence center-based clustering and their applicationsDivergence center-based clustering and their applications
Divergence center-based clustering and their applications
 
On the Jensen-Shannon symmetrization of distances relying on abstract means
On the Jensen-Shannon symmetrization of distances relying on abstract meansOn the Jensen-Shannon symmetrization of distances relying on abstract means
On the Jensen-Shannon symmetrization of distances relying on abstract means
 
1533 game mathematics
1533 game mathematics1533 game mathematics
1533 game mathematics
 
Patch Matching with Polynomial Exponential Families and Projective Divergences
Patch Matching with Polynomial Exponential Families and Projective DivergencesPatch Matching with Polynomial Exponential Families and Projective Divergences
Patch Matching with Polynomial Exponential Families and Projective Divergences
 
Bregman divergences from comparative convexity
Bregman divergences from comparative convexityBregman divergences from comparative convexity
Bregman divergences from comparative convexity
 
Taylor problem
Taylor problemTaylor problem
Taylor problem
 
Stuff You Must Know Cold for the AP Calculus BC Exam!
Stuff You Must Know Cold for the AP Calculus BC Exam!Stuff You Must Know Cold for the AP Calculus BC Exam!
Stuff You Must Know Cold for the AP Calculus BC Exam!
 
Lesson 21: Curve Sketching (slides)
Lesson 21: Curve Sketching (slides)Lesson 21: Curve Sketching (slides)
Lesson 21: Curve Sketching (slides)
 
Proximal Splitting and Optimal Transport
Proximal Splitting and Optimal TransportProximal Splitting and Optimal Transport
Proximal Splitting and Optimal Transport
 
Computational Information Geometry: A quick review (ICMS)
Computational Information Geometry: A quick review (ICMS)Computational Information Geometry: A quick review (ICMS)
Computational Information Geometry: A quick review (ICMS)
 

Viewers also liked

The probability of non-confluent systems
The probability of non-confluent systemsThe probability of non-confluent systems
The probability of non-confluent systems
Alejandro Díaz-Caro
 
Linearity in the non-deterministic call-by-value setting
Linearity in the non-deterministic call-by-value settingLinearity in the non-deterministic call-by-value setting
Linearity in the non-deterministic call-by-value setting
Alejandro Díaz-Caro
 
Vectorial types, non-determinism and probabilistic systems: Towards a computa...
Vectorial types, non-determinism and probabilistic systems: Towards a computa...Vectorial types, non-determinism and probabilistic systems: Towards a computa...
Vectorial types, non-determinism and probabilistic systems: Towards a computa...
Alejandro Díaz-Caro
 
Call-by-value non-determinism in a linear logic type discipline
Call-by-value non-determinism in a linear logic type disciplineCall-by-value non-determinism in a linear logic type discipline
Call-by-value non-determinism in a linear logic type discipline
Alejandro Díaz-Caro
 
Slides used during my thesis defense "Du typage vectoriel"
Slides used during my thesis defense "Du typage vectoriel"Slides used during my thesis defense "Du typage vectoriel"
Slides used during my thesis defense "Du typage vectoriel"
Alejandro Díaz-Caro
 
Non determinism through type isomophism
Non determinism through type isomophismNon determinism through type isomophism
Non determinism through type isomophism
Alejandro Díaz-Caro
 
Simply typed lambda-calculus modulo isomorphisms
Simply typed lambda-calculus modulo isomorphismsSimply typed lambda-calculus modulo isomorphisms
Simply typed lambda-calculus modulo isomorphisms
Alejandro Díaz-Caro
 
Quantum computing, non-determinism, probabilistic systems... and the logic be...
Quantum computing, non-determinism, probabilistic systems... and the logic be...Quantum computing, non-determinism, probabilistic systems... and the logic be...
Quantum computing, non-determinism, probabilistic systems... and the logic be...
Alejandro Díaz-Caro
 
Affine computation and affine automaton
Affine computation and affine automatonAffine computation and affine automaton
Affine computation and affine automaton
Alejandro Díaz-Caro
 
Towards a quantum lambda-calculus with quantum control
Towards a quantum lambda-calculus with quantum controlTowards a quantum lambda-calculus with quantum control
Towards a quantum lambda-calculus with quantum control
Alejandro Díaz-Caro
 
A System F accounting for scalars
A System F accounting for scalarsA System F accounting for scalars
A System F accounting for scalars
Alejandro Díaz-Caro
 
Slides QuAND 2011
Slides QuAND 2011Slides QuAND 2011
Slides QuAND 2011
Alejandro Díaz-Caro
 

Viewers also liked (12)

The probability of non-confluent systems
The probability of non-confluent systemsThe probability of non-confluent systems
The probability of non-confluent systems
 
Linearity in the non-deterministic call-by-value setting
Linearity in the non-deterministic call-by-value settingLinearity in the non-deterministic call-by-value setting
Linearity in the non-deterministic call-by-value setting
 
Vectorial types, non-determinism and probabilistic systems: Towards a computa...
Vectorial types, non-determinism and probabilistic systems: Towards a computa...Vectorial types, non-determinism and probabilistic systems: Towards a computa...
Vectorial types, non-determinism and probabilistic systems: Towards a computa...
 
Call-by-value non-determinism in a linear logic type discipline
Call-by-value non-determinism in a linear logic type disciplineCall-by-value non-determinism in a linear logic type discipline
Call-by-value non-determinism in a linear logic type discipline
 
Slides used during my thesis defense "Du typage vectoriel"
Slides used during my thesis defense "Du typage vectoriel"Slides used during my thesis defense "Du typage vectoriel"
Slides used during my thesis defense "Du typage vectoriel"
 
Non determinism through type isomophism
Non determinism through type isomophismNon determinism through type isomophism
Non determinism through type isomophism
 
Simply typed lambda-calculus modulo isomorphisms
Simply typed lambda-calculus modulo isomorphismsSimply typed lambda-calculus modulo isomorphisms
Simply typed lambda-calculus modulo isomorphisms
 
Quantum computing, non-determinism, probabilistic systems... and the logic be...
Quantum computing, non-determinism, probabilistic systems... and the logic be...Quantum computing, non-determinism, probabilistic systems... and the logic be...
Quantum computing, non-determinism, probabilistic systems... and the logic be...
 
Affine computation and affine automaton
Affine computation and affine automatonAffine computation and affine automaton
Affine computation and affine automaton
 
Towards a quantum lambda-calculus with quantum control
Towards a quantum lambda-calculus with quantum controlTowards a quantum lambda-calculus with quantum control
Towards a quantum lambda-calculus with quantum control
 
A System F accounting for scalars
A System F accounting for scalarsA System F accounting for scalars
A System F accounting for scalars
 
Slides QuAND 2011
Slides QuAND 2011Slides QuAND 2011
Slides QuAND 2011
 

Similar to Equivalence of algebraic λ-calculi

Metric space
Metric spaceMetric space
Metric space
NaliniSPatil
 
Yangs First Lecture Ppt
Yangs First Lecture PptYangs First Lecture Ppt
Yangs First Lecture Ppt
yangcaoisu
 
Introduction to Artificial Intelligence
Introduction to Artificial IntelligenceIntroduction to Artificial Intelligence
Introduction to Artificial Intelligence
Manoj Harsule
 
Lesson 4: Calculating Limits (slides)
Lesson 4: Calculating Limits (slides)Lesson 4: Calculating Limits (slides)
Lesson 4: Calculating Limits (slides)
Mel Anthony Pepito
 
Quantum fields on the de sitter spacetime - Ion Cotaescu
Quantum fields on the de sitter spacetime - Ion CotaescuQuantum fields on the de sitter spacetime - Ion Cotaescu
Quantum fields on the de sitter spacetime - Ion Cotaescu
SEENET-MTP
 
Mathematical-Formula-Handbook.pdf-76-watermark.pdf-68.pdf
Mathematical-Formula-Handbook.pdf-76-watermark.pdf-68.pdfMathematical-Formula-Handbook.pdf-76-watermark.pdf-68.pdf
Mathematical-Formula-Handbook.pdf-76-watermark.pdf-68.pdf
9866560321sv
 
Typing quantum superpositions and measurement
Typing quantum superpositions and measurementTyping quantum superpositions and measurement
Typing quantum superpositions and measurement
Alejandro Díaz-Caro
 
An implicit partial pivoting gauss elimination algorithm for linear system of...
An implicit partial pivoting gauss elimination algorithm for linear system of...An implicit partial pivoting gauss elimination algorithm for linear system of...
An implicit partial pivoting gauss elimination algorithm for linear system of...
Alexander Decker
 
Mac2311 study guide-tcm6-49721
Mac2311 study guide-tcm6-49721Mac2311 study guide-tcm6-49721
Mac2311 study guide-tcm6-49721
Glicerio Gavilan
 
introtogaugetheory.pdf
introtogaugetheory.pdfintrotogaugetheory.pdf
introtogaugetheory.pdf
asdfasdf214078
 
Matrix Computations in Machine Learning
Matrix Computations in Machine LearningMatrix Computations in Machine Learning
Matrix Computations in Machine Learning
butest
 
Ch4.pdf
Ch4.pdfCh4.pdf
Ch4.pdf
SnehSinha6
 
Density theorems for Euclidean point configurations
Density theorems for Euclidean point configurationsDensity theorems for Euclidean point configurations
Density theorems for Euclidean point configurations
VjekoslavKovac1
 
05_AJMS_16_18_RA.pdf
05_AJMS_16_18_RA.pdf05_AJMS_16_18_RA.pdf
05_AJMS_16_18_RA.pdf
BRNSS Publication Hub
 
05_AJMS_16_18_RA.pdf
05_AJMS_16_18_RA.pdf05_AJMS_16_18_RA.pdf
05_AJMS_16_18_RA.pdf
BRNSS Publication Hub
 
Density theorems for anisotropic point configurations
Density theorems for anisotropic point configurationsDensity theorems for anisotropic point configurations
Density theorems for anisotropic point configurations
VjekoslavKovac1
 
When youseeab
When youseeabWhen youseeab
When youseeab
jchartiersjsd
 
Intuitionistic First-Order Logic: Categorical semantics via the Curry-Howard ...
Intuitionistic First-Order Logic: Categorical semantics via the Curry-Howard ...Intuitionistic First-Order Logic: Categorical semantics via the Curry-Howard ...
Intuitionistic First-Order Logic: Categorical semantics via the Curry-Howard ...
Marco Benini
 
Comparison Results of Trapezoidal, Simpson’s 13 rule, Simpson’s 38 rule, and ...
Comparison Results of Trapezoidal, Simpson’s 13 rule, Simpson’s 38 rule, and ...Comparison Results of Trapezoidal, Simpson’s 13 rule, Simpson’s 38 rule, and ...
Comparison Results of Trapezoidal, Simpson’s 13 rule, Simpson’s 38 rule, and ...
BRNSS Publication Hub
 
Introduction to the theory of optimization
Introduction to the theory of optimizationIntroduction to the theory of optimization
Introduction to the theory of optimization
Delta Pi Systems
 

Similar to Equivalence of algebraic λ-calculi (20)

Metric space
Metric spaceMetric space
Metric space
 
Yangs First Lecture Ppt
Yangs First Lecture PptYangs First Lecture Ppt
Yangs First Lecture Ppt
 
Introduction to Artificial Intelligence
Introduction to Artificial IntelligenceIntroduction to Artificial Intelligence
Introduction to Artificial Intelligence
 
Lesson 4: Calculating Limits (slides)
Lesson 4: Calculating Limits (slides)Lesson 4: Calculating Limits (slides)
Lesson 4: Calculating Limits (slides)
 
Quantum fields on the de sitter spacetime - Ion Cotaescu
Quantum fields on the de sitter spacetime - Ion CotaescuQuantum fields on the de sitter spacetime - Ion Cotaescu
Quantum fields on the de sitter spacetime - Ion Cotaescu
 
Mathematical-Formula-Handbook.pdf-76-watermark.pdf-68.pdf
Mathematical-Formula-Handbook.pdf-76-watermark.pdf-68.pdfMathematical-Formula-Handbook.pdf-76-watermark.pdf-68.pdf
Mathematical-Formula-Handbook.pdf-76-watermark.pdf-68.pdf
 
Typing quantum superpositions and measurement
Typing quantum superpositions and measurementTyping quantum superpositions and measurement
Typing quantum superpositions and measurement
 
An implicit partial pivoting gauss elimination algorithm for linear system of...
An implicit partial pivoting gauss elimination algorithm for linear system of...An implicit partial pivoting gauss elimination algorithm for linear system of...
An implicit partial pivoting gauss elimination algorithm for linear system of...
 
Mac2311 study guide-tcm6-49721
Mac2311 study guide-tcm6-49721Mac2311 study guide-tcm6-49721
Mac2311 study guide-tcm6-49721
 
introtogaugetheory.pdf
introtogaugetheory.pdfintrotogaugetheory.pdf
introtogaugetheory.pdf
 
Matrix Computations in Machine Learning
Matrix Computations in Machine LearningMatrix Computations in Machine Learning
Matrix Computations in Machine Learning
 
Ch4.pdf
Ch4.pdfCh4.pdf
Ch4.pdf
 
Density theorems for Euclidean point configurations
Density theorems for Euclidean point configurationsDensity theorems for Euclidean point configurations
Density theorems for Euclidean point configurations
 
05_AJMS_16_18_RA.pdf
05_AJMS_16_18_RA.pdf05_AJMS_16_18_RA.pdf
05_AJMS_16_18_RA.pdf
 
05_AJMS_16_18_RA.pdf
05_AJMS_16_18_RA.pdf05_AJMS_16_18_RA.pdf
05_AJMS_16_18_RA.pdf
 
Density theorems for anisotropic point configurations
Density theorems for anisotropic point configurationsDensity theorems for anisotropic point configurations
Density theorems for anisotropic point configurations
 
When youseeab
When youseeabWhen youseeab
When youseeab
 
Intuitionistic First-Order Logic: Categorical semantics via the Curry-Howard ...
Intuitionistic First-Order Logic: Categorical semantics via the Curry-Howard ...Intuitionistic First-Order Logic: Categorical semantics via the Curry-Howard ...
Intuitionistic First-Order Logic: Categorical semantics via the Curry-Howard ...
 
Comparison Results of Trapezoidal, Simpson’s 13 rule, Simpson’s 38 rule, and ...
Comparison Results of Trapezoidal, Simpson’s 13 rule, Simpson’s 38 rule, and ...Comparison Results of Trapezoidal, Simpson’s 13 rule, Simpson’s 38 rule, and ...
Comparison Results of Trapezoidal, Simpson’s 13 rule, Simpson’s 38 rule, and ...
 
Introduction to the theory of optimization
Introduction to the theory of optimizationIntroduction to the theory of optimization
Introduction to the theory of optimization
 

Equivalence of algebraic λ-calculi

  • 1. Equivalence of Algebraic λ-calculi Alejandro Díaz-Caro1 Simon Perdrix12 Christine Tasson3 Benoît Valiron1 1 LIG, Université de Grenoble 2 CNRS 3 CEA-LIST, MeASI HOR • July 14th, 2010 • Edinburgh
  • 2. Algebraic calculi Algebraic ≡ Module structure 1 (λx.yx + · λx.y(yx)) λz.z 2 Two origins λalg −→ differential calculus λlin −→ quantum computation Differences in the encoding of the module structure how the reduction rules apply A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi 2 / 25
  • 3. λalg and λlin share the same set of terms M, N, L ::= V | (M ) N | M + N | α · M U, V, W ::= B | α · B | V + W | 0 B ::= x | λx.M closed under associativity and conmutativity M +N =N +M (M + N ) + L = M + (N + L) base term is either a variable or abstraction a value is either 0 or of the form αi · Bi ; a general term can be anything. A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi 3 / 25
  • 4. Rules for λalg Group E α · 0 =a 0 0 + M =a M α · (β · M ) =a (α × β) · M 0 · M =a 0 1 · M =a M α · (M + N ) =a α·M +α·N α·M +β·M =a (α + β) · M Group F Group A (M + N ) L =a (M ) L + (N ) L (α · M ) N =a α · (M ) N (0) M =a 0 Group B (λx.M ) N →a M [x := N ] A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi 4 / 25
  • 5. Rules for λlin Group E α·0 → 0 0+M → M α · (β · M ) → (α × β) · M 0·M → 0 1·M → M α · (M + N ) → α·M +α·N α·M +β·M → (α + β) · M Group F α·M +M → (α + 1) · M M +M → (1 + 1) · M Group A (M + N ) L → (M ) L + (N ) L (M ) (N + L) → (M ) N + (M ) L (α · M ) N → α · (M ) N (M ) α · N → α · (M ) N (0) M → 0 (M ) 0 → 0 Group B (λx.M ) B →a M [x := B] A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi 5 / 25
  • 6. Context rules Some common rules M →M M →M (M ) N → (M ) N M +N →M +N N →N M →M M +N →M +N α·M →α·M plus one additional rule for λlin M→ M (V ) M → (V ) M A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi 6 / 25
  • 7. Modifications to the original calculi The most important No reduction under lambda (à la Plotkin) λx.M is a base term for any M λx.(α · M + β · N ) = α · λx.M + β · λx.N A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi 7 / 25
  • 8. Confluence This system is not trivially confluent Example Let Yb = (λx.(b + (x) x)) (λx.(b + (x) x)), then 0 ← Yb − Yb → Yb + b − Yb → b Several possible solutions Type system → strong normalisation Take scalars as positive reals Restrict some of the reduction rules For this talk, we simply assume that confluence holds. A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi 8 / 25
  • 9. Question Can we simulate λlin with λalg and λalg with λlin ? A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi 9 / 25
  • 10. Simulating λalg with λlin Thunks Idea: encapsulating terms M as B = λf.M . So M ≡ (B) f A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi 10 / 25
  • 11. Simulating λalg with λlin Thunks Idea: encapsulating terms M as B = λf.M . So M ≡ (B) f (|x|)f = (x) f (|0|)f = 0 (|λx.M |)f = λx.(|M |)f (|(M ) N |)f = ((|M |)f ) λz.(|N |)f (|M + N |)f = (|M |)f + (|N |)f (|α · M |)f = α · (|M |)f If the encoding λalg → λlin is denoted with (|−|)f , one could expect the result M →∗ N a ⇒ (|M |)f →∗ (|N |)f A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi 10 / 25
  • 12. Problem Example (λx.λy.(y) x) I →a λy.(y) I, (|(λx.λy.(y) x) I|)f = (λx.λy.((y) f ) (λz.(x) f )) (λz λx.(x) f ) →∗ λy.((y) f ) (λz.(λz.λx.(x) f ) f ), (|λy.(y) I|)f = λy.((y) f ) (λz.λx.(x) f ) “Administrative” redex hidden in the first one A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi 11 / 25
  • 13. Removing administrative redexes Admin f 0 = 0 Admin f x = x Admin f (λf.M ) f = Admin f M Admin f (M ) N = (Admin f M ) Admin f N Admin f λx.M = λx.Admin f M (x = f ) Admin f M + N = Admin f M + Admin f N Admin f α · M = α · Admin f M Theorem (Simulation) For any program (i.e. closed term) M , and value V , if M →∗ V then exists a value W such that a (|M |)f →∗ W and Admin f W = Admin f (|V |)f A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi 12 / 25
  • 14. First, M /N ≡Admin f M Lemma If Admin f M = Admin f M and M → N then there exists N such that Admin f N = Admin f N and such that M →∗ N . A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi 13 / 25
  • 15. First, M /N ≡Admin f ≡Admin f M ∗/ N Lemma If Admin f M = Admin f M and M → N then there exists N such that Admin f N = Admin f N and such that M →∗ N . A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi 13 / 25
  • 16. Then, M ≡Admin f W Lemma If W is a value and M a term such that Admin f W = Admin f M , then there exists a value V such that M →∗ V and Admin f W = Admin f V . A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi 14 / 25
  • 17. Then, M OOO OOO OOO OOO OOO ≡Admin f OOO OOO OOO OO' ∗ W ≡Admin f V Lemma If W is a value and M a term such that Admin f W = Admin f M , then there exists a value V such that M →∗ V and Admin f W = Admin f V . A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi 14 / 25
  • 18. Finally, M a ∗/ N (|N |)f V Lemma For any program (i.e. closed term) M , if M →a N and (|N |)f →∗ V for a value V, then there exists M such that (|M |)f →∗ M such that Admin f M = Admin f V . A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi 15 / 25
  • 19. Finally, M (|M |)f / ∗M ≡Admin f a ∗/ N (|N |)f V Lemma For any program (i.e. closed term) M , if M →a N and (|N |)f →∗ V for a value V, then there exists M such that (|M |)f →∗ M such that Admin f M = Admin f V . A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi 15 / 25
  • 20. Now, we want ∗/ M aV (|M |)f (|V |)f A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi 16 / 25
  • 21. Now, we want ∗/ M aV (|M |)f (|V |)f FF FF FF ≡Admin f FF ∗ W A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi 16 / 25
  • 22. Base case V = V (|V |)f (|V |)f = = (|V |)f A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi 17 / 25
  • 23. Inductive case / ∗/ M aM aV (|M |)f (|M |)f (|V |)f EE EE EE ≡Admin f EE ∗ W Lemma 2 Lemma 3 M EE / ∗ EE M (|M | f ) M EE EE EE ≡Admin ≡Admin EE f f EE EE / a M ( |f |M ) ∗ W EE ∗ W W A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi 18 / 25
  • 24. Inductive case / ∗/ M aM aV (|M |)f (|M |)f (|V |)f GG EE GG EE GG EE GG EE ∗ ≡Admin f G# ∗ M ≡Admin f W Lemma 2 Lemma 3 M EE / ∗ EE M (|M | f ) M EE EE EE ≡Admin ≡Admin EE f f EE EE / a M ( |f |M ) ∗ W EE ∗ W ≡Admin f W A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi 18 / 25
  • 25. Inductive case / ∗/ M aM aV (|M |)f (|M |)f (|V |)f GG EE GG EE GG EE GG EE ∗ ≡Admin f G# ∗ M H ≡Admin f W HH HH HH ≡Admin f HH ∗ # W Lemma 2 Lemma 3 M EE / ∗ EE M (|M | f ) M EE EE EE ≡Admin ≡Admin EE f f EE EE / a M ( |f |M ) ∗ W EE ∗ W W A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi 18 / 25
  • 26. Simulating λlin with λalg CPS encoding We define [|−|] : λlin → λalg [|x|] = λf. (f ) x [|0|] = 0 [|λx.M |] = λf.(f ) λx.[|M |] [|(M ) N |] = λf.([|M |]) λg.([|N |]) λh.((g) h) f [|α · M |] = λf.(α · [|M |]) f [|M + N |] = λf.([|M |] + [|N |]) f Now, given the continuation I = λx.x, if M → V we want ([|M |]) I →a W for some W related to [|V |] A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi 19 / 25
  • 27. The encoding for values Ψ(x) = x, Ψ(0) = 0, Ψ(λx.M ) = λx.[|M |], Ψ(α · V ) = α · Ψ(V ), Ψ(V + W ) = Ψ(V ) + Ψ(W ). Ψ(V ) is such that [|V |] →∗ Ψ(V ). a Theorem (Simulation) M →∗ V ⇒ ([|M |]) λx.x →∗ Ψ(V ). a A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi 20 / 25
  • 28. An auxiliary definition Note that ([|B|]) K = (λf.(f ) Ψ(B)) K →∗ (K) Ψ(B). a We define the term B : K = (K) Ψ(B). We extend this definition to other terms in some not-so-easy way due to the algebraic properties of the language. It is the main difficulty in this proof. A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi 21 / 25
  • 29. The auxiliary definition Let (:) : λlin × λalg → λalg : B : K = (K) Ψ(B) (M + N ) : K = M : K + N : K α · M : K = α · (M : K) 0:K=0 (U ) B : K = ((Ψ(U )) Ψ(B)) K (U ) (V + W ) : K = ((U ) V + (U ) W ) : K (U ) (α · B) : K = α · (U ) B : K (U ) 0 : K = 0 (U ) N : K = N : λf.((Ψ(U )) f ) K (M ) N : K = M : λg.([|N |]) λh.((g) h) K A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi 22 / 25
  • 30. Proof If M →∗ V , ([|M |]) (λx.x) Ψ(V ) A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi 23 / 25
  • 31. Proof If K is a value: For all M , ([|M |]) K →∗ M : K a If M → N then M : K →∗ N : K a If V is a value, V : K →∗ (K) Ψ(V ) a If M →∗ V , ([|M |]) (λx.x) →∗ M : λx.x a Ψ(V ) A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi 23 / 25
  • 32. Proof If K is a value: For all M , ([|M |]) K →∗ M : K a If M → N then M : K →∗ N : K a If V is a value, V : K →∗ (K) Ψ(V ) a If M →∗ V , ([|M |]) (λx.x) →∗ M : λx.x a →∗ V : λx.x a Ψ(V ) A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi 23 / 25
  • 33. Proof If K is a value: For all M , ([|M |]) K →∗ M : K a If M → N then M : K →∗ N : K a If V is a value, V : K →∗ (K) Ψ(V ) a If M →∗ V , ([|M |]) (λx.x) →∗ M : λx.x a →∗ V : λx.x a →∗ (λx.x) Ψ(V ) a Ψ(V ) A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi 23 / 25
  • 34. Proof If K is a value: For all M , ([|M |]) K →∗ M : K a If M → N then M : K →∗ N : K a If V is a value, V : K →∗ (K) Ψ(V ) a If M →∗ V , ([|M |]) (λx.x) →∗ a M : λx.x →∗ a V : λx.x →∗ a (λx.x) Ψ(V ) →a Ψ(V ) A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi 23 / 25
  • 35. Future and ongoing work In classical lambda-calculus: CPS can also be done to interpret call-by-name in call-by-value [Plotkin 75]. The thunk construction can be related to CPS [Hatcliff and Danvy 96]. Can we relate to these? A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi 24 / 25
  • 36. Future and ongoing work Other interesting questions The choice between equality and reduction rules seems arbitrary. Can we exchange them? Are the simulations still valid? A. Díaz-Caro, S. Perdrix, C. Tasson, B. Valiron • Equivalence of Algebraic λ-calculi 25 / 25