a graph-rewriting & rims, kyoto university) work in ...kmuroya/talks/srepls9.pdfmuroya (u....

38
Muroya (U. B’ham. & RIMS, Kyoto U.) A Graph-Rewriting Perspective of the Beta-Law Dan R. Ghica Todd Waugh Ambridge (University of Birmingham) S-REPLS 9 (Univ. Sussex), 25 May 2018 Koko Muroya (University of Birmingham & RIMS, Kyoto University) work in progress

Upload: others

Post on 24-May-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: A Graph-Rewriting & RIMS, Kyoto University) work in ...kmuroya/talks/srepls9.pdfMuroya (U. B’ham. & RIMS, Kyoto U.) A Graph-Rewriting Perspective of the Beta-Law Dan R. Ghica Todd

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

Page 2: A Graph-Rewriting & RIMS, Kyoto University) work in ...kmuroya/talks/srepls9.pdfMuroya (U. B’ham. & RIMS, Kyoto U.) A Graph-Rewriting Perspective of the Beta-Law Dan R. Ghica Todd

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?

Page 3: A Graph-Rewriting & RIMS, Kyoto University) work in ...kmuroya/talks/srepls9.pdfMuroya (U. B’ham. & RIMS, Kyoto U.) A Graph-Rewriting Perspective of the Beta-Law Dan R. Ghica Todd

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?

Page 4: A Graph-Rewriting & RIMS, Kyoto University) work in ...kmuroya/talks/srepls9.pdfMuroya (U. B’ham. & RIMS, Kyoto U.) A Graph-Rewriting Perspective of the Beta-Law Dan R. Ghica Todd

Muroya (U. B’ham. & RIMS, Kyoto U.)4

call-by-valueequational

theory

contextual(operational)equivalence[Plotkin ‘75]

Page 5: A Graph-Rewriting & RIMS, Kyoto University) work in ...kmuroya/talks/srepls9.pdfMuroya (U. B’ham. & RIMS, Kyoto U.) A Graph-Rewriting Perspective of the Beta-Law Dan R. Ghica Todd

Muroya (U. B’ham. & RIMS, Kyoto U.)

call-by-valueequational

theory

5

contextual(operational)equivalence[Plotkin ‘75]

Page 6: A Graph-Rewriting & RIMS, Kyoto University) work in ...kmuroya/talks/srepls9.pdfMuroya (U. B’ham. & RIMS, Kyoto U.) A Graph-Rewriting Perspective of the Beta-Law Dan R. Ghica Todd

Muroya (U. B’ham. & RIMS, Kyoto U.)6

call-by-valueequational

theory

contextual(operational)equivalence[Plotkin ‘75]

SECD machine

Page 7: A Graph-Rewriting & RIMS, Kyoto University) work in ...kmuroya/talks/srepls9.pdfMuroya (U. B’ham. & RIMS, Kyoto U.) A Graph-Rewriting Perspective of the Beta-Law Dan R. Ghica Todd

Muroya (U. B’ham. & RIMS, Kyoto U.)7

call-by-valueequational

theory

contextual(operational)equivalence

soundness

[Plotkin ‘75]

SECD machine

Page 8: A Graph-Rewriting & RIMS, Kyoto University) work in ...kmuroya/talks/srepls9.pdfMuroya (U. B’ham. & RIMS, Kyoto U.) A Graph-Rewriting Perspective of the Beta-Law Dan R. Ghica Todd

Muroya (U. B’ham. & RIMS, Kyoto U.)8

call-by-valueequational

theory

contextual(operational)equivalence

graph-rewritingmachine

graphically

Page 9: A Graph-Rewriting & RIMS, Kyoto University) work in ...kmuroya/talks/srepls9.pdfMuroya (U. B’ham. & RIMS, Kyoto U.) A Graph-Rewriting Perspective of the Beta-Law Dan R. Ghica Todd

Muroya (U. B’ham. & RIMS, Kyoto U.)9

call-by-valuegraph-equational

theory graphically

contextual(operational)equivalence

Page 10: A Graph-Rewriting & RIMS, Kyoto University) work in ...kmuroya/talks/srepls9.pdfMuroya (U. B’ham. & RIMS, Kyoto U.) A Graph-Rewriting Perspective of the Beta-Law Dan R. Ghica Todd

Muroya (U. B’ham. & RIMS, Kyoto U.)10

call-by-valuegraph-equational

theory graphically

contextual(operational)equivalence

all and only values are duplicable

Page 11: A Graph-Rewriting & RIMS, Kyoto University) work in ...kmuroya/talks/srepls9.pdfMuroya (U. B’ham. & RIMS, Kyoto U.) A Graph-Rewriting Perspective of the Beta-Law Dan R. Ghica Todd

Muroya (U. B’ham. & RIMS, Kyoto U.)11

call-by-valuegraph-equational

theory graphically

contextual(operational)equivalence

Page 12: A Graph-Rewriting & RIMS, Kyoto University) work in ...kmuroya/talks/srepls9.pdfMuroya (U. B’ham. & RIMS, Kyoto U.) A Graph-Rewriting Perspective of the Beta-Law Dan R. Ghica Todd

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)

Page 13: A Graph-Rewriting & RIMS, Kyoto University) work in ...kmuroya/talks/srepls9.pdfMuroya (U. B’ham. & RIMS, Kyoto U.) A Graph-Rewriting Perspective of the Beta-Law Dan R. Ghica Todd

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)

Page 14: A Graph-Rewriting & RIMS, Kyoto University) work in ...kmuroya/talks/srepls9.pdfMuroya (U. B’ham. & RIMS, Kyoto U.) A Graph-Rewriting Perspective of the Beta-Law Dan R. Ghica Todd

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)

Page 15: A Graph-Rewriting & RIMS, Kyoto University) work in ...kmuroya/talks/srepls9.pdfMuroya (U. B’ham. & RIMS, Kyoto U.) A Graph-Rewriting Perspective of the Beta-Law Dan R. Ghica Todd

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)

Page 16: A Graph-Rewriting & RIMS, Kyoto University) work in ...kmuroya/talks/srepls9.pdfMuroya (U. B’ham. & RIMS, Kyoto U.) A Graph-Rewriting Perspective of the Beta-Law Dan R. Ghica Todd

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

Page 17: A Graph-Rewriting & RIMS, Kyoto University) work in ...kmuroya/talks/srepls9.pdfMuroya (U. B’ham. & RIMS, Kyoto U.) A Graph-Rewriting Perspective of the Beta-Law Dan R. Ghica Todd

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

Page 18: A Graph-Rewriting & RIMS, Kyoto University) work in ...kmuroya/talks/srepls9.pdfMuroya (U. B’ham. & RIMS, Kyoto U.) A Graph-Rewriting Perspective of the Beta-Law Dan R. Ghica Todd

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

Page 19: A Graph-Rewriting & RIMS, Kyoto University) work in ...kmuroya/talks/srepls9.pdfMuroya (U. B’ham. & RIMS, Kyoto U.) A Graph-Rewriting Perspective of the Beta-Law Dan R. Ghica Todd

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

Page 20: A Graph-Rewriting & RIMS, Kyoto University) work in ...kmuroya/talks/srepls9.pdfMuroya (U. B’ham. & RIMS, Kyoto U.) A Graph-Rewriting Perspective of the Beta-Law Dan R. Ghica Todd

Muroya (U. B’ham. & RIMS, Kyoto U.)20

SECD machine dGoI machine

Page 21: A Graph-Rewriting & RIMS, Kyoto University) work in ...kmuroya/talks/srepls9.pdfMuroya (U. B’ham. & RIMS, Kyoto U.) A Graph-Rewriting Perspective of the Beta-Law Dan R. Ghica Todd

Muroya (U. B’ham. & RIMS, Kyoto U.)21

SECD machine dGoI machine

Page 22: A Graph-Rewriting & RIMS, Kyoto University) work in ...kmuroya/talks/srepls9.pdfMuroya (U. B’ham. & RIMS, Kyoto U.) A Graph-Rewriting Perspective of the Beta-Law Dan R. Ghica Todd

Muroya (U. B’ham. & RIMS, Kyoto U.)

dGoI-machine transitions

22

Page 23: A Graph-Rewriting & RIMS, Kyoto University) work in ...kmuroya/talks/srepls9.pdfMuroya (U. B’ham. & RIMS, Kyoto U.) A Graph-Rewriting Perspective of the Beta-Law Dan R. Ghica Todd

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

Page 24: A Graph-Rewriting & RIMS, Kyoto University) work in ...kmuroya/talks/srepls9.pdfMuroya (U. B’ham. & RIMS, Kyoto U.) A Graph-Rewriting Perspective of the Beta-Law Dan R. Ghica Todd

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

Page 25: A Graph-Rewriting & RIMS, Kyoto University) work in ...kmuroya/talks/srepls9.pdfMuroya (U. B’ham. & RIMS, Kyoto U.) A Graph-Rewriting Perspective of the Beta-Law Dan R. Ghica Todd

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

Page 26: A Graph-Rewriting & RIMS, Kyoto University) work in ...kmuroya/talks/srepls9.pdfMuroya (U. B’ham. & RIMS, Kyoto U.) A Graph-Rewriting Perspective of the Beta-Law Dan R. Ghica Todd

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”

Page 27: A Graph-Rewriting & RIMS, Kyoto University) work in ...kmuroya/talks/srepls9.pdfMuroya (U. B’ham. & RIMS, Kyoto U.) A Graph-Rewriting Perspective of the Beta-Law Dan R. Ghica Todd

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

Page 28: A Graph-Rewriting & RIMS, Kyoto University) work in ...kmuroya/talks/srepls9.pdfMuroya (U. B’ham. & RIMS, Kyoto U.) A Graph-Rewriting Perspective of the Beta-Law Dan R. Ghica Todd

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

Page 29: A Graph-Rewriting & RIMS, Kyoto University) work in ...kmuroya/talks/srepls9.pdfMuroya (U. B’ham. & RIMS, Kyoto U.) A Graph-Rewriting Perspective of the Beta-Law Dan R. Ghica Todd

Muroya (U. B’ham. & RIMS, Kyoto U.)

“Until the difference is reduced”

29

Page 30: A Graph-Rewriting & RIMS, Kyoto University) work in ...kmuroya/talks/srepls9.pdfMuroya (U. B’ham. & RIMS, Kyoto U.) A Graph-Rewriting Perspective of the Beta-Law Dan R. Ghica Todd

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

Page 31: A Graph-Rewriting & RIMS, Kyoto University) work in ...kmuroya/talks/srepls9.pdfMuroya (U. B’ham. & RIMS, Kyoto U.) A Graph-Rewriting Perspective of the Beta-Law Dan R. Ghica Todd

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

Page 32: A Graph-Rewriting & RIMS, Kyoto University) work in ...kmuroya/talks/srepls9.pdfMuroya (U. B’ham. & RIMS, Kyoto U.) A Graph-Rewriting Perspective of the Beta-Law Dan R. Ghica Todd

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?

Page 33: A Graph-Rewriting & RIMS, Kyoto University) work in ...kmuroya/talks/srepls9.pdfMuroya (U. B’ham. & RIMS, Kyoto U.) A Graph-Rewriting Perspective of the Beta-Law Dan R. Ghica Todd

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

Page 34: A Graph-Rewriting & RIMS, Kyoto University) work in ...kmuroya/talks/srepls9.pdfMuroya (U. B’ham. & RIMS, Kyoto U.) A Graph-Rewriting Perspective of the Beta-Law Dan R. Ghica Todd

Muroya (U. B’ham. & RIMS, Kyoto U.)

so what?

34

Page 35: A Graph-Rewriting & RIMS, Kyoto University) work in ...kmuroya/talks/srepls9.pdfMuroya (U. B’ham. & RIMS, Kyoto U.) A Graph-Rewriting Perspective of the Beta-Law Dan R. Ghica Todd

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

Page 36: A Graph-Rewriting & RIMS, Kyoto University) work in ...kmuroya/talks/srepls9.pdfMuroya (U. B’ham. & RIMS, Kyoto U.) A Graph-Rewriting Perspective of the Beta-Law Dan R. Ghica Todd

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...

Page 37: A Graph-Rewriting & RIMS, Kyoto University) work in ...kmuroya/talks/srepls9.pdfMuroya (U. B’ham. & RIMS, Kyoto U.) A Graph-Rewriting Perspective of the Beta-Law Dan R. Ghica Todd

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?

Page 38: A Graph-Rewriting & RIMS, Kyoto University) work in ...kmuroya/talks/srepls9.pdfMuroya (U. B’ham. & RIMS, Kyoto U.) A Graph-Rewriting Perspective of the Beta-Law Dan R. Ghica Todd

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]