Dynamic GoI machine Call-by-need and call-by-value graph rewriter Koko Muroya & Dan Ghica (Univ. Birmingham) S-REPLS 4 (London), 27 September 2016
GoI machine [Danos & Regnier ’99] [Mackie ’95] • abstract machine to interpret λ -calculus • a λ -term → a graph → moves of a token compositionally • Geometry of Interaction [Girard, ’89] • “an execution path on a proof net” 2 Muroya (U. Birmingham)
GoI machine [Danos & Regnier ’99] [Mackie ’95] ( λ x. x ) 1 q q 1 1 Muroya (U. Birmingham)
GoI machine [Danos & Regnier ’99] [Mackie ’95] ( λ x. x ) 1 q q 1 1 Muroya (U. Birmingham)
GoI machine [Danos & Regnier ’99] [Mackie ’95] call-by-name • a token on a static graph • space efficiency • compositionality / interaction between components • categorical GoI [Abramsky+, ’02] • compilation to digital circuits [Ghica+, ’07-] 4 Muroya (U. Birmingham)
GoI machine [Danos & Regnier ’99] [Mackie ’95] CPS transformation (Schöpp, Hoshino+) call-by-name call-by-value memory assigned to nodes (Hoshino+, Dal Lago+) • a token on a static graph parallelism: multiple tokens • space efficiency dynamic jumps (Dal Lago+) (Fernández+) 5 Muroya (U. Birmingham)
Dynamic GoI machine avoid repeated evaluation call-by-name call-by-value force evaluation of • a token on a static graph function arguments • dynamic rewrites & “checkpoint” mechanism • space time efficiency • compositional reasoning • categorical GoI [Abramsky+, ’02] 6 Muroya (U. Birmingham)
Avoid re-evaluation ( λ x. x + x ) (1 + 2) q q 3 q 3 6 7 Muroya (U. Birmingham)
Avoid re-evaluation ( λ x. x + x ) (1 + 2) q q 3 q 3 6 7 Muroya (U. Birmingham)
Avoid re-evaluation: dynamic rewrite ( λ x. x + x ) (1 + 2) 8 Muroya (U. Birmingham)
Avoid re-evaluation: dynamic rewrite ( λ x. x + x ) (1 + 2) 8 Muroya (U. Birmingham)
Avoid re-evaluation: dynamic rewrite ( λ x. x + x ) (1 + 2) 8 Muroya (U. Birmingham)
Avoid re-evaluation: dynamic rewrite ( λ x. x + x ) (1 + 2) 9 Muroya (U. Birmingham)
Avoid re-evaluation: dynamic rewrite ( λ x. x + x ) (1 + 2) 9 Muroya (U. Birmingham)
Avoid re-evaluation: dynamic rewrite ( λ x. x + x ) (1 + 2) 9 Muroya (U. Birmingham)
Avoid re-evaluation: dynamic rewrite ( λ x. x + x ) (1 + 2) 10 Muroya (U. Birmingham)
Avoid re-evaluation: dynamic rewrite ( λ x. x + x ) (1 + 2) 10 Muroya (U. Birmingham)
Avoid re-evaluation: dynamic rewrite ( λ x. x + x ) (1 + 2) 11 Muroya (U. Birmingham)
Avoid re-evaluation: dynamic rewrite ( λ x. x + x ) (1 + 2) 11 Muroya (U. Birmingham)
Avoid re-evaluation: dynamic rewrite ( λ x. x + x ) (1 + 2) 11 Muroya (U. Birmingham)
Avoid re-evaluation: dynamic rewrite ( λ x. x + x ) (1 + 2) 12 Muroya (U. Birmingham)
Avoid re-evaluation: dynamic rewrite ( λ x. x + x ) (1 + 2) 12 Muroya (U. Birmingham)
Avoid re-evaluation: dynamic rewrite ( λ x. x + x ) (1 + 2) 13 Muroya (U. Birmingham)
Avoid re-evaluation: dynamic rewrite ( λ x. x + x ) (1 + 2) 13 Muroya (U. Birmingham)
Avoid re-evaluation: dynamic rewrite ( λ x. x + x ) (1 + 2) 14 Muroya (U. Birmingham)
Avoid re-evaluation: dynamic rewrite ( λ x. x + x ) (1 + 2) 14 Muroya (U. Birmingham)
Avoid re-evaluation: dynamic rewrite ( λ x. x + x ) (1 + 2) 14 Muroya (U. Birmingham)
Avoid re-evaluation: dynamic rewrite ( λ x. x + x ) (1 + 2) 15 Muroya (U. Birmingham)
Avoid re-evaluation: dynamic rewrite ( λ x. x + x ) (1 + 2) 15 Muroya (U. Birmingham)
Avoid re-evaluation: dynamic rewrite ( λ x. x + x ) (1 + 2) 16 Muroya (U. Birmingham)
Avoid re-evaluation: dynamic rewrite ( λ x. x + x ) (1 + 2) 16 Muroya (U. Birmingham)
Avoid re-evaluation: dynamic rewrite ( λ x. x + x ) (1 + 2) 16 Muroya (U. Birmingham)
Avoid re-evaluation: dynamic rewrite ( λ x. x + x ) (1 + 2) 17 Muroya (U. Birmingham)
Avoid re-evaluation: dynamic rewrite ( λ x. x + x ) (1 + 2) 17 Muroya (U. Birmingham)
Dynamic GoI machine avoid repeated evaluation call-by-name call-by-need force evaluation of • a token on a static graph function arguments • dynamic rewrites • space time efficiency • compositional reasoning • categorical GoI [Abramsky+, ’02] 18 Muroya (U. Birmingham)
Force evaluation of arguments ( λ x. 0) (1 + 2) q q 3 6 19 Muroya (U. Birmingham)
Force evaluation of arguments ( λ x. 0) (1 + 2) q q 3 6 19 Muroya (U. Birmingham)
Force evaluation of arguments: checkpoint ( λ x. 0) (1 + 2) 20 Muroya (U. Birmingham)
Force evaluation of arguments: checkpoint ( λ x. 0) (1 + 2) 20 Muroya (U. Birmingham)
Force evaluation of arguments: checkpoint ( λ x. 0) (1 + 2) 20 Muroya (U. Birmingham)
Force evaluation of arguments: checkpoint ( λ x. 0) (1 + 2) 21 Muroya (U. Birmingham)
Force evaluation of arguments: checkpoint ( λ x. 0) (1 + 2) 21 Muroya (U. Birmingham)
Force evaluation of arguments: checkpoint ( λ x. 0) (1 + 2) 21 Muroya (U. Birmingham)
Force evaluation of arguments: checkpoint ( λ x. 0) (1 + 2) 22 Muroya (U. Birmingham)
Force evaluation of arguments: checkpoint ( λ x. 0) (1 + 2) 22 Muroya (U. Birmingham)
Force evaluation of arguments: checkpoint ( λ x. 0) (1 + 2) 23 Muroya (U. Birmingham)
Force evaluation of arguments: checkpoint ( λ x. 0) (1 + 2) 23 Muroya (U. Birmingham)
Force evaluation of arguments: checkpoint ( λ x. 0) (1 + 2) 23 Muroya (U. Birmingham)
Force evaluation of arguments: checkpoint ( λ x. 0) (1 + 2) 24 Muroya (U. Birmingham)
Force evaluation of arguments: checkpoint ( λ x. 0) (1 + 2) 24 Muroya (U. Birmingham)
Force evaluation of arguments: checkpoint ( λ x. 0) (1 + 2) 25 Muroya (U. Birmingham)
Force evaluation of arguments: checkpoint ( λ x. 0) (1 + 2) 25 Muroya (U. Birmingham)
Dynamic GoI machine, extended _ (( G, ` e , ` b ) , p, d, m ) 99K (( G, ` e , ` b ) , p 0 , d 0 , m 0 ) “move” transition ( α : p, m ) ( β : Ax : α : p, m ) ( α : p, m ) ( β : Cut : α : p, m ) 99K 99K Ax Ax β β α α ↑ ↓ ↓ ↑ ( β 0 : ( ⇧ , α 0 , α ) : β : p, m ) α α β β ( β : p, m ) Cut Cut 99K ( α l : p, m ) ( β : ($ , α r ) : α l : p, l : m ) ( β : p, l : m ) ( α l : ($ , α r ) : β : p, m ) 99K 99K α 0 α α 0 α α l α r α l α r α l α r α l α r ↓ ↑ $ $ $ $ " # ↓ ↑ β β β β β 0 β β 0 β ( α r : p, m ) ( β : ($ , α l ) : α r : p, r : m ) ( β : p, r : m ) ( α r : ($ , α l ) : β : p, m ) 99K 99K α l α r α l α r α l α r α l α r ↓ ↑ $ $ $ $ ↓ ↑ ( α : p, m ) ( β : D : α : p, m ) 99K β β β β α α ( α : p, m ) ( β : ! : α : p, m ) ( β : p, m ) ( α : ! : β : p, m ) ↓ 99K 99K α α α α D D ↓ ↑ ↓ ! ! ! ! β β ↓ ↑ ( α i : p, m ) ( β : C + : α i : p, m ) ( α : p, m ) ( β : C : α : p, m ) 99K 99K β β β β α k +1 α k +1 α 1 α i α 1 α i α α ↓ · · · · · · · · · · · · ↓ C 1 C 1 C k +1 C k +1 ↓ ↓ β β β β ( β : p, m ) ( α 1 : Sum1 : β : p, m ) ( α 1 : p, m ) ( α 2 : Sum2 : α 1 : p, m ) 99K 99K α 1 α 2 α 1 α 2 α 1 α 2 α 1 α 2 ↑ ↓ ↑ Sum Sum Sum Sum ↑ β β β β ( α 2 : p, m ) ( β : Sum : α 2 : p, m ) ( α : p, m ) ( α : ( Val , n ) : α : p, m ) 99K 99K α 1 α 2 α 1 α 2 ↓ n n Sum Sum ↑ ↓ ↓ α α β β 26 Muroya (U. Birmingham)
Recommend
More recommend