• 検索結果がありません。

Efficient implementation of evaluation strategies

N/A
N/A
Protected

Academic year: 2022

シェア "Efficient implementation of evaluation strategies"

Copied!
33
0
0

読み込み中.... (全文を見る)

全文

(1)

Efficient implementation of evaluation strategies

via token-guided graph rewriting

Koko Muroya & Dan R. Ghica (University of Birmingham)

(2)

Muroya (U. B’ham.)

TARGET

balancing space cost & time cost of program execution

2

abstract machines for

lambda-calculus

(3)

● abstract machines of same end result

○ number of beta-reduction

Motivation: series of non-strict evaluation

Sestoft’s abstract machine

Crégut’s lazy Krivine

abstract machine

Bologna optimal abstract machine Krivine

abstract machine

call by call by Lévy’s optimal

(4)

Muroya (U. B’ham.)

● abstract machines of same end result

○ number of beta-reduction

○ time cost

Motivation: series of non-strict evaluation

4

Krivine abstract machine

Sestoft’s abstract machine

Crégut’s lazy Krivine

abstract machine

Bologna optimal abstract machine call by

name

call by need

Accattoli et al.

Lévy’s optimal reduction

(5)

● abstract machines of same end result

○ number of beta-reduction

○ time cost

○ space cost

Motivation: series of non-strict evaluation

Krivine abstract machine

Sestoft’s abstract machine

Crégut’s lazy Krivine

abstract machine

Bologna optimal abstract machine call by call by

Accattoli et al.

Lévy’s optimal

(6)

Muroya (U. B’ham.)

● abstract machines of same end result

○ space cost

Motivation: series of non-strict evaluation

6

Krivine abstract machine

call by name interaction

abstract machine

[Danos & Regnier ‘99]

● GoI-style token passing

● fixed graph

● term rewriting

(7)

● abstract machines of same end result

○ space cost vs time cost… trade-off?

Question

Sestoft’s abstract machine

Crégut’s lazy Krivine

abstract machine

Bologna optimal abstract machine Krivine

abstract machine

call by call by Lévy’s

interaction abstract machine

(8)

Muroya (U. B’ham.)

GOAL

unified framework

that can balance space cost & time cost of program execution

8

(9)

GOAL

unified framework

that can balance space cost & time cost of program execution

token-guided graph-rewriting abstract machine for lambda-calculus

(10)

Muroya (U. B’ham.)

Token-guided graph rewriting

GoI-style token passing,

interleaved with graph rewriting

10

(11)

Token-guided graph rewriting

GoI-style token passing,

interleaved with graph rewriting

(12)

Muroya (U. B’ham.)

Token-guided graph rewriting

GoI-style token passing,

interleaved with graph rewriting

12

(13)

Token-guided graph rewriting

GoI-style token passing,

interleaved with graph rewriting

(14)

Muroya (U. B’ham.)

Token-guided graph rewriting

GoI-style token passing,

interleaved with graph rewriting

14

(15)

Token-guided graph rewriting

GoI-style token passing,

interleaved with graph rewriting

(16)

Muroya (U. B’ham.)

Token-guided graph rewriting

GoI-style token passing,

interleaved with graph rewriting

16

(17)

Token-guided graph rewriting

GoI-style token passing,

interleaved with graph rewriting

redex detected

(18)

Muroya (U. B’ham.)

Token-guided graph rewriting

GoI-style token passing,

interleaved with graph rewriting

18

(1) trigger rewriting

(19)

Token-guided graph rewriting

GoI-style token passing,

interleaved with graph rewriting

redex detected

(20)

Muroya (U. B’ham.)

Token-guided graph rewriting

GoI-style token passing,

interleaved with graph rewriting

20

(2) keep passing

(21)

Token-guided graph rewriting

GoI-style token passing,

interleaved with graph rewriting

(1) trigger rewriting

(2) keep passing

(22)

Muroya (U. B’ham.)

Token-guided graph rewriting for lambda-calculus

flexibility, by choices of:

● graph rewriting system, with token passing

○ proof nets

● interleaving strategy

○ trigger rewriting vs. keep passing

● translation of lambda-terms

○ !(A B), (!A) B

22

(23)

Token-guided graph rewriting for lambda-calculus

flexibility, by choices of:

● graph rewriting system, with token passing

● interleaving strategy

● translation of lambda-terms to…

● balance space cost & time cost

(24)

Muroya (U. B’ham.)

Non-strict evaluation:

time cost improvement

24

● graph rewriting system with token passing

● interleaving strategy

● translation

of lambda-terms

● proof nets

● passes-only

● “call-by-value”

translation

interaction abstract machine token passing on fixed graph

call by name

call by need

(25)

call by

Non-strict evaluation:

time cost improvement

● graph rewriting system with token passing

● interleaving strategy

● translation

of lambda-terms

interaction abstract machine

● proof nets

● passes-only

● !(A B)

call-by-name time cost

token passing on fixed graph

(26)

Muroya (U. B’ham.)

Non-strict evaluation:

time cost improvement

26

● graph rewriting system with token passing

● interleaving strategy

● translation

of lambda-terms

interaction abstract machine

● proof nets

● passes-only

● !(A B)

call-by-name time cost

● proof nets

● rewrites-first

● !(A B)

call-by-need time cost [- & Ghica, CSL ‘17]

time cost analysis à la [Accattoli ’16]

token passing on fixed graph

graph rewriting

(27)

Non-strict evaluation:

space cost improvement?

● graph rewriting system with token passing

● interleaving strategy

● translation

of lambda-terms

● proof nets

● passes-only

● “call-by-value”

translation

interaction abstract machine token passing on fixed graph

Krivine abstract machine

term rewriting

(28)

Muroya (U. B’ham.)

Non-strict evaluation:

space cost improvement?

28

● graph rewriting system with token passing

● interleaving strategy

● translation

of lambda-terms

● proof nets

● passes-only

● “call-by-value”

translation

interaction abstract machine

Krivine abstract machine

● proof nets

● passes-only

● !(A B), (!A) B call-by-name time cost

token passing on fixed graph

call by name

term rewriting

(29)

Non-strict evaluation:

space cost improvement?

● graph rewriting system with token passing

● interleaving strategy

● translation

of lambda-terms

● proof nets

● passes-only

● “call-by-value”

translation

interaction abstract machine

Krivine abstract machine

● proof nets

● passes-only

● !(A B), (!A) B call-by-name time cost

token passing on fixed graph

● proof nets

● rewrites-first

● (!A) B

call-by-name time cost graph rewriting

(30)

Muroya (U. B’ham.)

Strict evaluation

30

● graph rewriting system with token passing

● interleaving strategy

● translation

of lambda-terms

● proof nets

● passes-only

● “call-by-value”

translation

● -graphs

● rewrites-first

● !(A B)

call-by-value time cost [- & Ghica, WPTE ‘17]

time cost analysis à la [Accattoli ’16]

graph rewriting

(31)

Token-guided graph rewriting for lambda-calculus

flexibility, by choices of:

● graph rewriting system, with token passing

● interleaving strategy

● translation of lambda-terms to…

● balance space cost & time cost

series of

● non-strict evaluation

● strict evaluation

(32)

Muroya (U. B’ham.)

Analyse token-guided graph rewriting

via term rewriting + explicit redex searching [Sinot ‘05]

32

https://cwtsteven.github.io/GoI-Visualiser/CBV-with-CBV-embedding/index.html

(33)

Token-guided graph rewriting for lambda-calculus

flexibility, by choices of:

● graph rewriting system, with token passing

● interleaving strategy

● translation of lambda-terms to…

● balance space cost & time cost

series of

● non-strict evaluation

● strict evaluation

analysis via term rewriting

参照

関連したドキュメント

The framework is based on a traced symmetric monoidal category, and it yields a certain compact closed category as a model of linear combinatory algebra, covering as much as

The mGoI framework provides token machine semantics of effectful computations, namely computations with algebraic effects, in which effectful λ-terms are translated to transducers..

Throughout our present work we study the Heston model of pricing for European call options on stocks with stochastic volatility (Heston [27]) by abstract analytic methods coming

Intervals graphs (denoted by INT ) are intersection graphs of intervals on a line, circular-arc graphs (CA ) are intersection graphs of intervals (arcs) on a circle, circle graphs (CI

An easy-to-use procedure is presented for improving the ε-constraint method for computing the efficient frontier of the portfolio selection problem endowed with additional cardinality

Given an extension of untyped λ-calculus, what semantic property of the extension validates the call-by-value

In real world, the company often makes use of supplier selection on fuzzy decision space to promote their commodities. The selection of supplier of enterprise

Two surface-links in R 4 are equivalent if and only if their marked graph diagrams can be transformed into each other by a finite sequence of 8 types of moves, called the