Muroya (U. B’ham.)
The dynamic Geometry of Interaction machine
a call-by-need graph rewriter
Koko Muroya & Dan R. Ghica (University of Birmingham)
CSL (Stockholm), 21 Aug. 2017
Muroya (U. B’ham.)
Quantitative analysis
by GoI-style token passing of
space-time trade-off
of program execution cost
2
Muroya (U. B’ham.)
Quantitative analysis
by GoI-style token passing of
space-time trade-off
of program execution cost
semantics of linear logic
3
Muroya (U. B’ham.)
Quantitative analysis
by GoI-style token passing of
space-time trade-off
of program execution cost
semantics of linear logic
abstract machines for lambda-calculus
4
Muroya (U. B’ham.)
Interaction abstract machine (IAM)
●[Danos & Regnier ’99]
●call-by-name evaluation
●designed after Geometry of Interaction [Girard ’89]
semantics of linear logic
5
Muroya (U. B’ham.)
6
Interaction abstract machine (IAM)
GoI token passing fixed graph
Muroya (U. B’ham.)
7
Interaction abstract machine (IAM)
GoI token passing fixed graph
Muroya (U. B’ham.)
8
Interaction abstract machine (IAM)
GoI token passing fixed graph
Muroya (U. B’ham.)
9
Interaction abstract machine (IAM)
GoI token passing fixed graph
Muroya (U. B’ham.)
10
Interaction abstract machine (IAM)
GoI token passing fixed graph
Muroya (U. B’ham.)
11
Interaction abstract machine (IAM)
GoI token passing fixed graph
Muroya (U. B’ham.)
12
Interaction abstract machine (IAM)
GoI token passing fixed graph
Muroya (U. B’ham.)
13
Interaction abstract machine (IAM)
GoI token passing fixed graph
Muroya (U. B’ham.)
14
Interaction abstract machine (IAM)
GoI token passing fixed graph
Muroya (U. B’ham.)
15
Interaction abstract machine (IAM)
GoI token passing fixed graph
Muroya (U. B’ham.)
16
Interaction abstract machine (IAM)
GoI token passing fixed graph
Muroya (U. B’ham.)
17
Interaction abstract machine (IAM)
GoI token passing fixed graph
Muroya (U. B’ham.)
18
Interaction abstract machine (IAM)
GoI token passing fixed graph
Muroya (U. B’ham.)
19
Interaction abstract machine (IAM)
GoI token passing fixed graph
Muroya (U. B’ham.)
20
Interaction abstract machine (IAM)
GoI token passing fixed graph
Muroya (U. B’ham.)
21
Interaction abstract machine (IAM)
GoI token passing fixed graph
Muroya (U. B’ham.)
22
Interaction abstract machine (IAM)
GoI token passing fixed graph
Muroya (U. B’ham.)
23
Interaction abstract machine (IAM)
GoI token passing fixed graph
Muroya (U. B’ham.)
24
Interaction abstract machine (IAM)
GoI token passing fixed graph
Muroya (U. B’ham.)
25
Interaction abstract machine (IAM)
GoI token passing fixed graph
Muroya (U. B’ham.)
26
Interaction abstract machine (IAM)
GoI token passing fixed graph
Muroya (U. B’ham.)
27
Interaction abstract machine (IAM)
GoI token passing fixed graph
Muroya (U. B’ham.)
28
Interaction abstract machine (IAM)
GoI token passing fixed graph
Muroya (U. B’ham.)
29
Interaction abstract machine (IAM)
GoI token passing fixed graph
Muroya (U. B’ham.)
30
Interaction abstract machine (IAM)
GoI token passing fixed graph
Muroya (U. B’ham.)
31
Interaction abstract machine (IAM)
GoI token passing fixed graph
Muroya (U. B’ham.)
32
Interaction abstract machine (IAM)
GoI token passing fixed graph
Muroya (U. B’ham.)
33
Interaction abstract machine (IAM)
GoI token passing fixed graph
Muroya (U. B’ham.)
34
Interaction abstract machine (IAM)
GoI token passing fixed graph
Muroya (U. B’ham.)
35
Interaction abstract machine (IAM)
GoI token passing fixed graph
Muroya (U. B’ham.)
36
Interaction abstract machine (IAM)
GoI token passing fixed graph
Muroya (U. B’ham.)
37
Interaction abstract machine (IAM)
GoI token passing fixed graph
Muroya (U. B’ham.)
38
Interaction abstract machine (IAM)
GoI token passing fixed graph
Muroya (U. B’ham.)
39
Interaction abstract machine (IAM)
GoI token passing fixed graph
Muroya (U. B’ham.)
40
Interaction abstract machine (IAM)
GoI token passing fixed graph
Muroya (U. B’ham.)
41
Interaction abstract machine (IAM)
GoI token passing fixed graph
Muroya (U. B’ham.)
42
Interaction abstract machine (IAM)
GoI token passing fixed graph
Muroya (U. B’ham.)
43
Interaction abstract machine (IAM)
GoI token passing fixed graph
Muroya (U. B’ham.)
44
Interaction abstract machine (IAM)
GoI token passing fixed graph
Muroya (U. B’ham.)
45
Interaction abstract machine (IAM)
GoI token passing fixed graph
Muroya (U. B’ham.)
46
Interaction abstract machine (IAM)
GoI token passing fixed graph
Muroya (U. B’ham.)
47
Interaction abstract machine (IAM)
GoI token passing fixed graph
Muroya (U. B’ham.)
48
Interaction abstract machine (IAM)
GoI token passing fixed graph
Muroya (U. B’ham.)
49
Interaction abstract machine (IAM)
GoI token passing fixed graph
Muroya (U. B’ham.)
50
Interaction abstract machine (IAM)
GoI token passing fixed graph
Muroya (U. B’ham.)
51
Interaction abstract machine (IAM)
GoI token passing fixed graph
Muroya (U. B’ham.)
52
Interaction abstract machine (IAM)
GoI token passing fixed graph
Muroya (U. B’ham.)
53
Interaction abstract machine (IAM)
GoI token passing fixed graph
Muroya (U. B’ham.)
54
Interaction abstract machine (IAM)
GoI token passing fixed graph
Muroya (U. B’ham.)
Storeless abstract machine (SAM)
●[Danvy & Zerny ’13]
●call-by-need evaluation
●syntactical environment
55
Muroya (U. B’ham.)
Storeless abstract machine (SAM)
redex searching term rewriting
56
Muroya (U. B’ham.)
Storeless abstract machine (SAM)
redex searching term rewriting
57
Muroya (U. B’ham.)
Storeless abstract machine (SAM)
redex searching term rewriting
58
Muroya (U. B’ham.)
Storeless abstract machine (SAM)
redex searching term rewriting
59
Muroya (U. B’ham.)
Storeless abstract machine (SAM)
redex searching term rewriting
60
Muroya (U. B’ham.)
Storeless abstract machine (SAM)
redex searching term rewriting
61
Muroya (U. B’ham.)
Storeless abstract machine (SAM)
redex searching term rewriting
62
Muroya (U. B’ham.)
Storeless abstract machine (SAM)
redex searching term rewriting
63
Muroya (U. B’ham.)
Storeless abstract machine (SAM)
redex searching term rewriting
64
Muroya (U. B’ham.)
Storeless abstract machine (SAM)
redex searching term rewriting
65
Muroya (U. B’ham.)
Storeless abstract machine (SAM)
redex searching term rewriting
66
Muroya (U. B’ham.)
IAM vs. SAM
67
GoI token passing fixed graph
redex searching term rewriting
IAM (call-by-name) SAM (call-by-need)
Muroya (U. B’ham.)
IAM vs. SAM
68
GoI token passing fixed graph
redex searching term rewriting
IAM (call-by-name) SAM (call-by-need)
space efficient
time efficient
Muroya (U. B’ham.)
IAM vs. SAM
69
GoI token passing fixed graph
redex searching term rewriting
IAM (call-by-name) SAM (call-by-need)
space efficient
time efficient unified
framework?
Muroya (U. B’ham.)
Quantitative analysis
by GoI-style token passing of
space-time trade-off
of program execution cost
semantics of linear logic
abstract machines for lambda-calculus
70
Muroya (U. B’ham.)
IAM vs. SAM
71
GoI token passing fixed graph
redex searching term rewriting
IAM (call-by-name) SAM (call-by-need)
space efficient
time efficient unified
framework?
Muroya (U. B’ham.)
72
GoI token passing fixed graph
redex searching term rewriting
IAM (call-by-name) SAM (call-by-need)
space efficient
time efficient
GoI token passing graph rewriting
Dynamic GoI machine (DGoIM)
unified framework?
Muroya (U. B’ham.)
73
GoI token passing fixed graph
redex searching term rewriting
IAM (call-by-name) SAM (call-by-need)
space efficient
time efficient
GoI token passing graph rewriting
Dynamic GoI machine (DGoIM)
unified framework?
[Sinot ’05 & ’06]
Muroya (U. B’ham.)
74
GoI token passing fixed graph
redex searching term rewriting
IAM (call-by-name) SAM (call-by-need)
space efficient
time efficient
GoI token passing graph rewriting
Dynamic GoI machine (DGoIM)
unified framework?
Muroya (U. B’ham.)
75
DGoIM = IAM + proof-net cut elimination
GoI token passing graph rewriting
Muroya (U. B’ham.)
76
DGoIM = IAM + proof-net cut elimination
GoI token passing graph rewriting
Muroya (U. B’ham.)
77
DGoIM = IAM + proof-net cut elimination
GoI token passing graph rewriting
Muroya (U. B’ham.)
78
DGoIM = IAM + proof-net cut elimination
GoI token passing graph rewriting
Muroya (U. B’ham.)
79
DGoIM = IAM + proof-net cut elimination
GoI token passing graph rewriting
Muroya (U. B’ham.)
80
DGoIM = IAM + proof-net cut elimination
GoI token passing graph rewriting
Muroya (U. B’ham.)
81
DGoIM = IAM + proof-net cut elimination
GoI token passing graph rewriting
redex detected
Muroya (U. B’ham.)
82
DGoIM = IAM + proof-net cut elimination
GoI token passing graph rewriting
(1) trigger rewriting
Muroya (U. B’ham.)
83
DGoIM = IAM + proof-net cut elimination
GoI token passing graph rewriting
redex detected
Muroya (U. B’ham.)
84
DGoIM = IAM + proof-net cut elimination
GoI token passing graph rewriting
(2) keep passing
Muroya (U. B’ham.)
DGoIM: flexible interleaving
85
GoI token passing fixed graph
redex searching term rewriting
IAM (call-by-name) SAM (call-by-need)
space efficient
time efficient
GoI token passing graph rewriting
DGoIM
passes-only
unified framework?
Muroya (U. B’ham.)
DGoIM: flexible interleaving
86
GoI token passing fixed graph
redex searching term rewriting
IAM (call-by-name) SAM (call-by-need)
space efficient
time efficient
GoI token passing graph rewriting
DGoIM
passes-only rewrites-first
unified framework?
Muroya (U. B’ham.)
Quantitative analysis
by GoI-style token passing of
space-time trade-off
of program execution cost
semantics of linear logic
abstract machines for lambda-calculus
87
Muroya (U. B’ham.)
DGoIM: flexible interleaving
88
GoI token passing fixed graph
redex searching term rewriting
IAM (call-by-name) SAM (call-by-need)
space efficient
time efficient
GoI token passing graph rewriting
DGoIM
passes-only rewrites-first
unified framework?
Muroya (U. B’ham.)
DGoIM: rewrites-first interleaving
89
GoI token passing fixed graph
redex searching term rewriting
IAM (call-by-name) SAM (call-by-need)
space efficient
time efficient
GoI token passing graph rewriting
DGoIM
passes-only rewrites-first
unified framework?
Muroya (U. B’ham.)
Rewrites-first DGoIM: states
90
Muroya (U. B’ham.)
Rewrites-first DGoIM: states
91
multiplicative-exponential proof net
Muroya (U. B’ham.)
Rewrites-first DGoIM: states
92
simplified data of IAM
multiplicative-exponential proof net
Muroya (U. B’ham.)
Rewrites-first DGoIM: transitions
93
pass transitions rewrite transitions
proof-net cut elimination selected
GoI token passing
Muroya (U. B’ham.)
Rewrites-first DGoIM: transitions
94
pass transitions rewrite transitions
proof-net cut elimination selected
GoI token passing
Muroya (U. B’ham.)
Rewrites-first DGoIM: transitions
95
pass transitions rewrite transitions
rewrites-first interleaving
proof-net cut elimination selected
GoI token passing
Muroya (U. B’ham.)
Translate lambda-terms
96
“call-by-value translation” of intuitionistic logic to linear logic [Girard ’87]
only values can be copied
Muroya (U. B’ham.)
Rewrites-first DGoIM: implement call-by-need
97
SAM (call-by-need)
DGoIM
correctness via weak simulation
Muroya (U. B’ham.)
Rewrites-first DGoIM: implement call-by-need
98
time efficient
time cost analysis à la [Accattoli ’16]
Muroya (U. B’ham.)
DGoIM: rewrites-first interleaving
99
GoI token passing fixed graph
redex searching term rewriting
IAM (call-by-name) SAM (call-by-need)
space efficient
time efficient
GoI token passing graph rewriting
DGoIM
passes-only rewrites-first
unified framework?
Muroya (U. B’ham.)
IAM vs. rewrites-first DGoIM
100
Muroya (U. B’ham.)
IAM vs. rewrites-first DGoIM
101
Muroya (U. B’ham.)
IAM vs. rewrites-first DGoIM
102
Muroya (U. B’ham.)
IAM vs. rewrites-first DGoIM
103
Muroya (U. B’ham.)
IAM vs. rewrites-first DGoIM
104
Muroya (U. B’ham.)
IAM vs. rewrites-first DGoIM
105
Muroya (U. B’ham.)
106
IAM vs. rewrites-first DGoIM
Muroya (U. B’ham.)
107
IAM vs. rewrites-first DGoIM
Muroya (U. B’ham.)
108
IAM vs. rewrites-first DGoIM
Muroya (U. B’ham.)
109
IAM vs. rewrites-first DGoIM
Muroya (U. B’ham.)
110
IAM vs. rewrites-first DGoIM
Muroya (U. B’ham.)
111
IAM vs. rewrites-first DGoIM
Muroya (U. B’ham.)
112
IAM vs. rewrites-first DGoIM
Muroya (U. B’ham.)
113
IAM vs. rewrites-first DGoIM
Muroya (U. B’ham.)
114
IAM vs. rewrites-first DGoIM
Muroya (U. B’ham.)
115
IAM vs. rewrites-first DGoIM
Muroya (U. B’ham.)
116
IAM vs. rewrites-first DGoIM
Muroya (U. B’ham.)
117
IAM vs. rewrites-first DGoIM
Muroya (U. B’ham.)
118
IAM vs. rewrites-first DGoIM
Muroya (U. B’ham.)
119
IAM vs. rewrites-first DGoIM
Muroya (U. B’ham.)
120
IAM vs. rewrites-first DGoIM
Muroya (U. B’ham.)
121
IAM vs. rewrites-first DGoIM
Muroya (U. B’ham.)
122
IAM vs. rewrites-first DGoIM
Muroya (U. B’ham.)
123
IAM vs. rewrites-first DGoIM
Muroya (U. B’ham.)
124
IAM vs. rewrites-first DGoIM
Muroya (U. B’ham.)
125
IAM vs. rewrites-first DGoIM
Muroya (U. B’ham.)
126
IAM vs. rewrites-first DGoIM
Muroya (U. B’ham.)
127
IAM vs. rewrites-first DGoIM
Muroya (U. B’ham.)
128
IAM vs. rewrites-first DGoIM
Muroya (U. B’ham.)
129
IAM vs. rewrites-first DGoIM
Muroya (U. B’ham.)
130
IAM vs. rewrites-first DGoIM
Muroya (U. B’ham.)
131
IAM vs. rewrites-first DGoIM
Muroya (U. B’ham.)
132
IAM vs. rewrites-first DGoIM
Muroya (U. B’ham.)
133
IAM vs. rewrites-first DGoIM
Muroya (U. B’ham.)
134
IAM vs. rewrites-first DGoIM
Muroya (U. B’ham.)
135
IAM vs. rewrites-first DGoIM
Muroya (U. B’ham.)
136
IAM vs. rewrites-first DGoIM
Muroya (U. B’ham.)
137
IAM vs. rewrites-first DGoIM
Muroya (U. B’ham.)
138
IAM vs. rewrites-first DGoIM
Muroya (U. B’ham.)
139
IAM vs. rewrites-first DGoIM
Muroya (U. B’ham.)
140
IAM vs. rewrites-first DGoIM
Muroya (U. B’ham.)
141
IAM vs. rewrites-first DGoIM
Muroya (U. B’ham.)
142
IAM vs. rewrites-first DGoIM
Muroya (U. B’ham.)
143
IAM vs. rewrites-first DGoIM
Muroya (U. B’ham.)
144
IAM vs. rewrites-first DGoIM
Muroya (U. B’ham.)
145
29 passes 16 rewrites
IAM vs. rewrites-first DGoIM
Muroya (U. B’ham.)
146
29 passes 16 rewrites
IAM vs. rewrites-first DGoIM
Muroya (U. B’ham.)
147
29 passes 16 rewrites
IAM vs. rewrites-first DGoIM
Muroya (U. B’ham.)
148
48 passes 29 passes
16 rewrites
IAM vs. rewrites-first DGoIM
Muroya (U. B’ham.)
Quantitative analysis
by GoI-style token passing of
space-time trade-off
of program execution cost
semantics of linear logic
abstract machines for lambda-calculus
149
Muroya (U. B’ham.)
DGoIM: flexible interleaving
150
GoI token passing fixed graph
redex searching term rewriting
IAM (call-by-name) SAM (call-by-need)
space efficient
time efficient
GoI token passing graph rewriting
DGoIM
passes-only rewrites-first
unified framework?
Muroya (U. B’ham.)
Future work
●flexible interleaving
○IAM (call-by-name) -- SAM (call-by-need) spectrum
○call-by-value?
●token-guided rewriting of “higher-order” data-flow graphs?
○TensorFlow (https://www.tensorflow.org/)
○self-adjusting computation (
http://www.umut-acar.org/self-adjusting-computation)
151