Upload
others
View
1
Download
0
Embed Size (px)
Citation preview
Muroya (U. B’ham. & RIMS, Kyoto U.)
A Graph-Rewriting Perspective of the Beta-Law
Dan R. GhicaTodd Waugh Ambridge
(University of Birmingham)
S-REPLS 9 (Univ. Sussex), 25 May 2018
Koko Muroya(University of Birmingham& RIMS, Kyoto University)
work in progress
Muroya (U. B’ham. & RIMS, Kyoto U.)
Equivalence of programs
2
syntacticalequation
operationalequivalence
denotationalequality
t = u
Do t and u denote the same (mathematical) object?
Given any “closing” context C, do evaluations of C[t] and C[u] yield the same value?
Muroya (U. B’ham. & RIMS, Kyoto U.)
Equivalence of programs
3
syntacticalequation
operationalequivalence
denotationalequality
graphically?t = u
Do t and u denote the same (mathematical) object?
Given any “closing” context C, do evaluations of C[t] and C[u] yield the same value?
Muroya (U. B’ham. & RIMS, Kyoto U.)4
call-by-valueequational
theory
contextual(operational)equivalence[Plotkin ‘75]
Muroya (U. B’ham. & RIMS, Kyoto U.)
call-by-valueequational
theory
5
contextual(operational)equivalence[Plotkin ‘75]
Muroya (U. B’ham. & RIMS, Kyoto U.)6
call-by-valueequational
theory
contextual(operational)equivalence[Plotkin ‘75]
SECD machine
Muroya (U. B’ham. & RIMS, Kyoto U.)7
call-by-valueequational
theory
contextual(operational)equivalence
soundness
[Plotkin ‘75]
SECD machine
Muroya (U. B’ham. & RIMS, Kyoto U.)8
call-by-valueequational
theory
contextual(operational)equivalence
graph-rewritingmachine
graphically
Muroya (U. B’ham. & RIMS, Kyoto U.)9
call-by-valuegraph-equational
theory graphically
contextual(operational)equivalence
Muroya (U. B’ham. & RIMS, Kyoto U.)10
call-by-valuegraph-equational
theory graphically
contextual(operational)equivalence
all and only values are duplicable
Muroya (U. B’ham. & RIMS, Kyoto U.)11
call-by-valuegraph-equational
theory graphically
contextual(operational)equivalence
Muroya (U. B’ham. & RIMS, Kyoto U.)12
call-by-valuegraph-equational
theory graphically
contextual(operational)equivalence
alpha-law: trivialbeta-law: refined(cf. explicit substitution)
Muroya (U. B’ham. & RIMS, Kyoto U.)13
call-by-valuegraph-equational
theory graphically
contextual(operational)equivalence
alpha-law: trivialbeta-law: refined(cf. explicit substitution)
Muroya (U. B’ham. & RIMS, Kyoto U.)14
call-by-valuegraph-equational
theory graphically
contextual(operational)equivalence
alpha-law: trivialbeta-law: refined(cf. explicit substitution)
Muroya (U. B’ham. & RIMS, Kyoto U.)15
call-by-valuegraph-equational
theory graphically
contextual(operational)equivalence
alpha-law: trivialbeta-law: refined(cf. explicit substitution)
Muroya (U. B’ham. & RIMS, Kyoto U.)16
contextual(operational)equivalencegraphically
call-by-valuegraph-equational
theory
alpha-law: trivialbeta-law: refined (cf. explicit substitution)
SECD machine
Muroya (U. B’ham. & RIMS, Kyoto U.)17
call-by-valuegraph-equational
theory graphically
graph-contextual(operational)equivalence
alpha-law: trivialbeta-law: refined (cf. explicit substitution)
graph-rewritingmachine
Muroya (U. B’ham. & RIMS, Kyoto U.)18
call-by-valuegraph-equational
theory graphically
graph-contextual(operational)equivalence
alpha-law: trivialbeta-law: refined (cf. explicit substitution)
dGoImachine
Muroya (U. B’ham. & RIMS, Kyoto U.)19
SECD machine dGoI machine
● stack of closures● environment● control string● dump
● graph● evaluation control
(“token”)● rewriting flag● computation stack● box stack
Muroya (U. B’ham. & RIMS, Kyoto U.)20
SECD machine dGoI machine
Muroya (U. B’ham. & RIMS, Kyoto U.)21
SECD machine dGoI machine
Muroya (U. B’ham. & RIMS, Kyoto U.)
dGoI-machine transitions
22
Muroya (U. B’ham. & RIMS, Kyoto U.)23
call-by-valuegraph-equational
theory graphically
graph-contextual(operational)equivalence
alpha-law: trivialbeta-law: refined (cf. explicit substitution)
dGoImachine
Muroya (U. B’ham. & RIMS, Kyoto U.)24
call-by-valuegraph-equational
theory graphically
graph-contextual(operational)equivalence
alpha-law: trivialbeta-law: refined (cf. explicit substitution)
dGoImachine
soundness
Muroya (U. B’ham. & RIMS, Kyoto U.)25
call-by-valuegraph-equational
theory graphically
graph-contextual(operational)equivalence
soundness
alpha-law: trivialbeta-law: refined (cf. explicit substitution)
1. lift an axiom to a binary relation on (dGoI-machine) states
Muroya (U. B’ham. & RIMS, Kyoto U.)26
call-by-valuegraph-equational
theory graphically
graph-contextual(operational)equivalence
soundness
1. lift an axiom to a binary relation on (dGoI-machine) states
2. show the binary relation is a “U-simulation”
Muroya (U. B’ham. & RIMS, Kyoto U.)27
call-by-valuegraph-equational
theory graphically
graph-contextual(operational)equivalence
soundness
1. lift an axiom to a binary relation on (dGoI-machine) states
2. show the binary relation is a “U-simulation”
simulation
Muroya (U. B’ham. & RIMS, Kyoto U.)28
call-by-valuegraph-equational
theory graphically
graph-contextual(operational)equivalence
soundness
1. lift an axiom to a binary relation on (dGoI-machine) states
2. show the binary relation is a “U-simulation”
simulation...until the difference is reduced
Muroya (U. B’ham. & RIMS, Kyoto U.)
“Until the difference is reduced”
29
Muroya (U. B’ham. & RIMS, Kyoto U.)30
call-by-valuegraph-equational
theory graphically
graph-contextual(operational)equivalence
soundness
1. lift an axiom to a binary relation on (dGoI-machine) states
2. show the binary relation is a “U-simulation”
simulation...until the difference is reduced
Muroya (U. B’ham. & RIMS, Kyoto U.)31
call-by-valuegraph-equational
theory graphically
graph-contextual(operational)equivalence
alpha-law: trivialbeta-law: refined (cf. explicit substitution)
dGoImachine
soundness
modular proof using U-simulations
Muroya (U. B’ham. & RIMS, Kyoto U.)
Equivalence of programs
32
syntacticalequation
operationalequivalence
denotationalequality
graphically?t = u
Do t and u denote the same (mathematical) object?
Given any “closing” context C, do evaluations of C[t] and C[u] yield the same value?
Muroya (U. B’ham. & RIMS, Kyoto U.)
Equivalence of programs
33
syntacticalequation
operationalequivalence
denotationalequality
graphically?t = u
Do t and u denote the same (mathematical) object?
Given any “closing” context C, do evaluations of C[t] and C[u] yield the same value?
modular proof of soundnessusing U-simulations
Muroya (U. B’ham. & RIMS, Kyoto U.)
so what?
34
Muroya (U. B’ham. & RIMS, Kyoto U.)
Equivalence of programs
35
syntacticalequation
operationalequivalencegraphically?t = u
Given any “closing” context C, do evaluations of C[t] and C[u] yield the same value?
modular proof of soundnessusing U-simulations
Muroya (U. B’ham. & RIMS, Kyoto U.)
Equivalence of programs
36
syntacticalequation
operationalequivalencegraphically?t = u
Given any “closing” context C, do evaluations of C[t] and C[u] yield the same value?
modular proof of soundnessusing U-simulations
related proof techniques:logical relationsapplicative bisimulationsenvirionmental bisimulations...
Muroya (U. B’ham. & RIMS, Kyoto U.)
Equivalence of programs
37
syntacticalequation
operationalequivalencegraphically?t = u
Given any “closing” context C, do evaluations of C[t] and C[u] yield the same value?
modular proof of soundnessusing U-simulations
semantical criteria of primitive operations (function constants) to preserve beta-law?
Muroya (U. B’ham. & RIMS, Kyoto U.)
Equivalence of programs
38
syntacticalequation
operationalequivalencegraphically?t = u
Given any “closing” context C, do evaluations of C[t] and C[u] yield the same value?
modular proof of soundnessusing U-simulations
cost-sensitive equivalence?(cf. [Schmidt-Schauss & Dallmeyer, WPTE ’17]