Normalization by evaluation for Thorsten Altenkirch Tarmo Uustalu - - PowerPoint PPT Presentation

normalization by evaluation for
SMART_READER_LITE
LIVE PREVIEW

Normalization by evaluation for Thorsten Altenkirch Tarmo Uustalu - - PowerPoint PPT Presentation

Normalization by evaluation for Thorsten Altenkirch Tarmo Uustalu University of Nottingham Tallinn Technical University Normalization by evaluationfor p.1/21 Motivation Normalization by evaluationfor


slide-1
SLIDE 1

Normalization by evaluation for

  • Thorsten Altenkirch

Tarmo Uustalu University of Nottingham Tallinn Technical University

Normalization by evaluationfor

✁ ✂ ✄

– p.1/21

slide-2
SLIDE 2

Motivation

Normalization by evaluationfor

✁ ✂ ✄

– p.2/21

slide-3
SLIDE 3

Motivation

Implementations of typed

  • calculi to support

type-directed construction of certified, correct programs.

Normalization by evaluationfor

✁ ✂ ✄

– p.2/21

slide-4
SLIDE 4

Motivation

Implementations of typed

  • calculi to support

type-directed construction of certified, correct programs. Normalisation of evaluation (NbE) used in the actual implementation of recent tools such as Epigram.

Normalization by evaluationfor

✁ ✂ ✄

– p.2/21

slide-5
SLIDE 5

Motivation

Implementations of typed

  • calculi to support

type-directed construction of certified, correct programs. Normalisation of evaluation (NbE) used in the actual implementation of recent tools such as Epigram. Offers efficent implementations and straightforward correctness arguments.

Normalization by evaluationfor

✁ ✂ ✄

– p.2/21

slide-6
SLIDE 6

More motivation

Goal: make equality more extensional. From

to

.

Normalization by evaluationfor

✁ ✂ ✄

– p.3/21

slide-7
SLIDE 7

More motivation

Goal: make equality more extensional. From

to

. Study simple calculi first - here

= simple types (

  • ) + booleans (
  • ).

Normalization by evaluationfor

✁ ✂ ✄

– p.3/21

slide-8
SLIDE 8

More motivation

Goal: make equality more extensional. From

to

. Study simple calculi first - here

= simple types (

  • ) + booleans (
  • ).

Discuss extensions to more interesting systems.

Normalization by evaluationfor

✁ ✂ ✄

– p.3/21

slide-9
SLIDE 9

More motivation

Goal: make equality more extensional. From

to

. Study simple calculi first - here

= simple types (

  • ) + booleans (
  • ).

Discuss extensions to more interesting systems. Use type-theoretic methodology (on paper).

Normalization by evaluationfor

✁ ✂ ✄

– p.3/21

slide-10
SLIDE 10

More motivation

Goal: make equality more extensional. From

to

. Study simple calculi first - here

= simple types (

  • ) + booleans (
  • ).

Discuss extensions to more interesting systems. Use type-theoretic methodology (on paper). Here: Haskell as a poor man’s type theory.

Normalization by evaluationfor

✁ ✂ ✄

– p.3/21

slide-11
SLIDE 11

More motivation

Goal: make equality more extensional. From

to

. Study simple calculi first - here

= simple types (

  • ) + booleans (
  • ).

Discuss extensions to more interesting systems. Use type-theoretic methodology (on paper). Here: Haskell as a poor man’s type theory. In future: implementation within epigram.

Normalization by evaluationfor

✁ ✂ ✄

– p.3/21

slide-12
SLIDE 12

The simplest typed

  • calculus?

Normalization by evaluationfor

✁ ✂ ✄

– p.4/21

slide-13
SLIDE 13

The simplest typed

  • calculus?
  • needs type-variables

Normalization by evaluationfor

✁ ✂ ✄

– p.4/21

slide-14
SLIDE 14

The simplest typed

  • calculus?
  • needs type-variables

not as simple as it looks!

Normalization by evaluationfor

✁ ✂ ✄

– p.4/21

slide-15
SLIDE 15

The simplest typed

  • calculus?
  • needs type-variables

not as simple as it looks!

  • ,

without type-variables

Normalization by evaluationfor

✁ ✂ ✄

– p.4/21

slide-16
SLIDE 16

The simplest typed

  • calculus?
  • needs type-variables

not as simple as it looks!

  • ,

without type-variables are equationally inconsistent.

Normalization by evaluationfor

✁ ✂ ✄

– p.4/21

slide-17
SLIDE 17

The simplest typed

  • calculus?
  • needs type-variables

not as simple as it looks!

  • ,

without type-variables are equationally inconsistent.

without type-variables

Normalization by evaluationfor

✁ ✂ ✄

– p.4/21

slide-18
SLIDE 18

The simplest typed

  • calculus?
  • needs type-variables

not as simple as it looks!

  • ,

without type-variables are equationally inconsistent.

without type-variables the simplest (interesting) typed

  • calculus!

Normalization by evaluationfor

✁ ✂ ✄

– p.4/21

slide-19
SLIDE 19
  • in a nutshell

Normalization by evaluationfor

✁ ✂ ✄

– p.5/21

slide-20
SLIDE 20
  • in a nutshell
✂✁ ✄ ☎✝✆ ✞✠✟ ✡✠☛ ☎ ☞ ✌✠✍ ✍ ✡ ✎ ☞ ✌ ✍ ✍ ✡ ✏
✏ ✁ ☞ ✑ ✒ ✓ ✎ ✏
✁ ☞ ✑

Normalization by evaluationfor

✁ ✂ ✄

– p.5/21

slide-21
SLIDE 21
  • in a nutshell
✂✁ ✄ ☎✝✆ ✞✠✟ ✡✠☛ ☎ ☞ ✌✠✍ ✍ ✡ ✎ ☞ ✌ ✍ ✍ ✡ ✏
✏ ✁ ☞ ✑ ✒ ✓ ✎ ✏
✁ ☞ ✑ ✒ ✓ ✂✁ ✄ ☎ ✏
✂ ✏
✒ ✓ ✞✠✟ ✡ ☛ ☎ ✏
✂ ✏ ✁
✒ ✓ ✎ ✂✁ ✄ ☎ ✞ ✟ ✡ ☛ ☎
✂ ✎
✓ ✎ ✏
✁ ✁
✂ ✒ ✓ ✎
✁ ✁

Normalization by evaluationfor

✁ ✂ ✄

– p.5/21

slide-22
SLIDE 22
  • in a nutshell
✂✁ ✄ ☎✝✆ ✞✠✟ ✡✠☛ ☎ ☞ ✌✠✍ ✍ ✡ ✎ ☞ ✌ ✍ ✍ ✡ ✏
✏ ✁ ☞ ✑ ✒ ✓ ✎ ✏
✁ ☞ ✑ ✒ ✓ ✂✁ ✄ ☎ ✏
✂ ✏
✒ ✓ ✞✠✟ ✡ ☛ ☎ ✏
✂ ✏ ✁
✒ ✓ ✎ ✂✁ ✄ ☎ ✞ ✟ ✡ ☛ ☎
✂ ✎
✓ ✎ ✏
✁ ✁
✂ ✒ ✓ ✎
✁ ✁

Categorically:

✄ ☎
✆ ✑ ✁ ✝
✆ ✑ ✁ ✄
✆ ✑ ✁

Normalization by evaluationfor

✁ ✂ ✄

– p.5/21

slide-23
SLIDE 23

Example

✂✄ ☎ ✆ ✝ ✞✠✟ ✟ ✡ ☛ ✞✠✟ ✟ ✡ ✆✌☞ ✞✠✟ ✟ ✡ ✝ ☞ ✍✏✎ ✑ ✂✄ ☎ ✆ ✝ ✞✠✟ ✟ ✡ ☛ ✞✠✟ ✟ ✡ ✆✌☞ ✞✠✟ ✟ ✡ ✝ ✒ ✝ ☞ ✓ ✍ ✔✖✕ ✑ ✂ ✄ ☎ ✆ ✝ ✞✠✟ ✟ ✡ ☛ ✞✠✟ ✟ ✡ ✆✌☞ ✞✠✟ ✟ ✡ ✝ ✒ ✝ ✒ ✝ ☞ ✓ ✓
✂ ✄✘✗ ✍✏✎ ✑ ✂✄ ✗ ✍ ✔✖✕ ✑ ✂ ✄ ✙ ✒✛✚
✢ ✚
✓ ✢ ✒✛✚
✢ ✚

Normalization by evaluationfor

✁ ✂ ✄

– p.6/21

slide-24
SLIDE 24

Example

✂✄ ☎ ✆ ✝ ✞✠✟ ✟ ✡ ☛ ✞✠✟ ✟ ✡ ✆✌☞ ✞✠✟ ✟ ✡ ✝ ☞ ✍✏✎ ✑ ✂✄ ☎ ✆ ✝ ✞✠✟ ✟ ✡ ☛ ✞✠✟ ✟ ✡ ✆✌☞ ✞✠✟ ✟ ✡ ✝ ✒ ✝ ☞ ✓ ✍ ✔✖✕ ✑ ✂ ✄ ☎ ✆ ✝ ✞✠✟ ✟ ✡ ☛ ✞✠✟ ✟ ✡ ✆✌☞ ✞✠✟ ✟ ✡ ✝ ✒ ✝ ✒ ✝ ☞ ✓ ✓
✂ ✄✘✗ ✍✏✎ ✑ ✂✄ ✗ ✍ ✔✖✕ ✑ ✂ ✄ ✙ ✒✛✚
✢ ✚
✓ ✢ ✒✛✚
✢ ✚
✂ ✄
✁ ✂ ✍✏✎ ✑ ✂ ✄

Normalization by evaluationfor

✁ ✂ ✄

– p.6/21

slide-25
SLIDE 25

Example

✂✄ ☎ ✆ ✝ ✞✠✟ ✟ ✡ ☛ ✞✠✟ ✟ ✡ ✆✌☞ ✞✠✟ ✟ ✡ ✝ ☞ ✍✏✎ ✑ ✂✄ ☎ ✆ ✝ ✞✠✟ ✟ ✡ ☛ ✞✠✟ ✟ ✡ ✆✌☞ ✞✠✟ ✟ ✡ ✝ ✒ ✝ ☞ ✓ ✍ ✔✖✕ ✑ ✂ ✄ ☎ ✆ ✝ ✞✠✟ ✟ ✡ ☛ ✞✠✟ ✟ ✡ ✆✌☞ ✞✠✟ ✟ ✡ ✝ ✒ ✝ ✒ ✝ ☞ ✓ ✓
✂ ✄✘✗ ✍✏✎ ✑ ✂✄ ✗ ✍ ✔✖✕ ✑ ✂ ✄ ✙ ✒✛✚
✢ ✚
✓ ✢ ✒✛✚
✢ ✚
✂ ✄
✁ ✂ ✍✏✎ ✑ ✂ ✄
✂ ✄ ☎ ✁ ✂ ✍ ✔✖✕ ✑ ✂✄

Normalization by evaluationfor

✁ ✂ ✄

– p.6/21

slide-26
SLIDE 26

Why ?

Normalization by evaluationfor

✁ ✂ ✄

– p.7/21

slide-27
SLIDE 27

Why ?

  • ✂☎✄
✆ ✝ ✞ ✞ ✟ ✠ ✡ ☛ ☞ ✁
  • ✂☎✄
✆ ✝ ✞ ✁
  • ✂☎✄
✆ ✝ ✞ ✞ ✁
✍ ✡✏✎ ✝ ✞ ✞ ✟ ✠ ✡ ☛ ☞ ✁
  • ✂☎✄
✆ ✝ ✞ ✂ ✄ ✆ ✝ ✁
✍ ✡ ✎ ✝ ✞ ✞ ✟ ✠ ✡ ☛ ☞ ✁
  • ✂☎✄
✆ ✝ ✞ ✂ ✄ ✆ ✝ ✁ ☛ ☞ ✁
✍ ✡ ✎ ✝ ✞ ✁
✄ ✆ ✝ ✞ ✁
✍ ✡ ✎ ✝ ✞ ✞ ✟ ✠ ✡ ☛ ☞ ✁
  • ✂☎✄
✆ ✝ ✞ ✂ ✄ ✆ ✝ ✁ ☛ ☞ ✁
✍ ✡ ✎ ✝ ✞ ✌ ✍ ✡✏✎ ✝ ✌ ✍ ✡✏✎ ✝ ✞ ✟ ✠ ✡ ☛ ☞ ✁
  • ✂☎✄
✆ ✝ ✞ ✂ ✄ ✆ ✝ ✌ ✍ ✡ ✎ ✝ ✟ ✠ ✡
  • ✂☎✄
✆ ✝

Symmetrically, we can show that

✍ ✡ ✎ ✝ ✞ ✞ ✟ ✠ ✡
✍ ✡ ✎ ✝

, and hence

✑ ✒ ✄ ✓✕✔ ✝ ✟ ✖
✘ ✘ ✙ ✚ ✗ ✘ ✘ ✙ ✖✜✛ ✗ ✘ ✘ ✙
✞ ✞ ✟ ✠ ✡ ✖
✘ ✘ ✙ ✚ ✗ ✘ ✘ ✙ ✖✜✛ ✗ ✘ ✘ ✙ ☛ ☞ ✛ ✁
✄ ✆ ✝ ✞ ✞ ✞ ✁
✍ ✡ ✎ ✝ ✞ ✞ ✞ ✟ ✠ ✡ ✖
✘ ✘ ✙ ✚ ✗ ✘ ✘ ✙ ✖✜✛ ✗ ✘ ✘ ✙ ☛ ☞ ✛ ✁
✄ ✆ ✝ ✞ ✁
✍ ✡ ✎ ✝ ✞ ✟ ✠ ✡ ✖
✘ ✘ ✙ ✚ ✗ ✘ ✘ ✙ ✖✜✛ ✗ ✘ ✘ ✙
✟ ✟ ✢ ✔ ✝

Normalization by evaluationfor

✁ ✂ ✄

– p.7/21

slide-28
SLIDE 28

A simpler proof ?

Normalization by evaluationfor

✁ ✂ ✄

– p.8/21

slide-29
SLIDE 29

A simpler proof ?

  • ✂✁
✄ ☎ ✆ ✆ ✝✟✞ ✆✡✠ ✆ ☛

Normalization by evaluationfor

✁ ✂ ✄

– p.8/21

slide-30
SLIDE 30

A simpler proof ?

  • ✂✁
✄ ☎ ✆ ✆ ✝✟✞ ✆✡✠ ✆ ☛ ☎
✂ ✁ ✄ ☎ ✆ ✆
✝✟✞ ✆✡✠ ✆ ☛

Normalization by evaluationfor

✁ ✂ ✄

– p.8/21

slide-31
SLIDE 31

A simpler proof ?

  • ✂✁
✄ ☎ ✆ ✆ ✝✟✞ ✆✡✠ ✆ ☛ ☎
✂ ✁ ✄ ☎ ✆ ✆
✝✟✞ ✆✡✠ ✆ ☛
✂ ✄
  • Normalization by evaluationfor
✁ ✂ ✄

– p.8/21

slide-32
SLIDE 32

A simpler proof ?

  • ✂✁
✄ ☎ ✆ ✆ ✝✟✞ ✆✡✠ ✆ ☛ ☎
✂ ✁ ✄ ☎ ✆ ✆
✝✟✞ ✆✡✠ ✆ ☛
✂ ✄
  • Why does this hold for

?

Normalization by evaluationfor

✁ ✂ ✄

– p.8/21

slide-33
SLIDE 33

A simpler proof ?

  • ✂✁
✄ ☎ ✆ ✆ ✝✟✞ ✆✡✠ ✆ ☛ ☎
✂ ✁ ✄ ☎ ✆ ✆
✝✟✞ ✆✡✠ ✆ ☛
✂ ✄
  • Why does this hold for

? Corollary of our NbE construction.

Normalization by evaluationfor

✁ ✂ ✄

– p.8/21

slide-34
SLIDE 34

Another corollary: normalisation

Main> once Lam (Bool :-> Bool) "f" (Lam Bool "x" (App (Var "f") (Var "x"))) Main> :t nf nf :: Ty -> Tm -> Tm Main> :t nf’ nf’ :: Tm -> Maybe (Ty,Tm) Main> nf’ once Just ((Bool :-> Bool) :-> (Bool :-> Bool),Lam (Bool :-> Bool) "x" (If (App (Var "x") TTrue) (If (App (Var "x") TFalse) (Lam Bool "x" TTrue) (Lam Bool "x" (Var "x"))) (If (App (Var "x") TFalse) (Lam Bool "x" (If (Var "x") TFalse TTrue)) (Lam Bool "x" TFalse)))) Main> nf’ thrice Just ((Bool :-> Bool) :-> (Bool :-> Bool),Lam (Bool :-> Bool) "x" (If (App (Var "x") TTrue) (If (App (Var "x") TFalse) (Lam Bool "x" TTrue) (Lam Bool "x" (Var "x"))) (If (App (Var "x") TFalse) (Lam Bool "x" (If (Var "x") TFalse TTrue)) (Lam Bool "x" TFalse))))

Normalization by evaluationfor

✁ ✂ ✄

– p.9/21

slide-35
SLIDE 35

NbE : the basic idea

Normalization by evaluationfor

✁ ✂ ✄

– p.10/21

slide-36
SLIDE 36

NbE : the basic idea

  • 1. Define a semantic interpretation
✎ ☞ ✑
✁ ✁
✁ ✎
✂ ✏

Normalization by evaluationfor

✁ ✂ ✄

– p.10/21

slide-37
SLIDE 37

NbE : the basic idea

  • 1. Define a semantic interpretation
✎ ☞ ✑
✁ ✁
✁ ✎
✂ ✏
  • 2. Invert evaluation, i.e. define
✂ ✄✆☎ ✝ ✁
✁ ✞✠✟ ✑
✂ ✄ ☎ ✝
✂ ✎

Normalization by evaluationfor

✁ ✂ ✄

– p.10/21

slide-38
SLIDE 38

NbE : the basic idea

  • 1. Define a semantic interpretation
✎ ☞ ✑
✁ ✁
✁ ✎
✂ ✏
  • 2. Invert evaluation, i.e. define
✂ ✄✆☎ ✝ ✁
✁ ✞✠✟ ✑
✂ ✄ ☎ ✝
✂ ✎
  • 3. Now define
✝ ✎
✂ ✄ ☎ ✝

Normalization by evaluationfor

✁ ✂ ✄

– p.10/21

slide-39
SLIDE 39
✂ ✎ ✎
✂ ✏

Normalization by evaluationfor

✁ ✂ ✄

– p.11/21

slide-40
SLIDE 40
✂ ✎ ✎
✂ ✏

is effective because our development takes place in a constructive set theory (ala Martin-Löf).

Normalization by evaluationfor

✁ ✂ ✄

– p.11/21

slide-41
SLIDE 41
✂ ✎ ✎
✂ ✏

is effective because our development takes place in a constructive set theory (ala Martin-Löf). The effectiveness of

is witnessed by an implementation in Haskell.

Normalization by evaluationfor

✁ ✂ ✄

– p.11/21

slide-42
SLIDE 42

Implementation in Haskell

Haskell-types can only approximate the intended types, e.g.

✁ ✝
  • ✁✄✂
✞ ✟ ✑ ✞✠✟ ✑

is implemented as nf :: Ty -> Tm -> Tm

Normalization by evaluationfor

✁ ✂ ✄

– p.12/21

slide-43
SLIDE 43

The semantics

  • ✌✠✍
✍ ✡ ✁
  • ✂✁
✄ ☎ ✆ ✆ ✝✟✞ ✆ ✠ ✆ ☛

Implementation in Haskell

data El = STrue | SFalse | SLam Ty (El -> El)

Normalization by evaluationfor

✁ ✂ ✄

– p.13/21

slide-44
SLIDE 44

Decision trees

Normalization by evaluationfor

✁ ✂ ✄

– p.14/21

slide-45
SLIDE 45

Decision trees

We use decision trees to enumerate types.

✂☎✄ ✂✝✆ ✞ ✞

where

☞ ✁ ✠
☛✝☞ ✌ ☞ ✁ ✂✝✆ ✞ ✞
✗ ✎ ✁ ✂✝✆ ✞ ✞
✑ ✒ ✓✕✔ ✞ ✍ ✎ ✁ ✂✝✆ ✞ ✞
  • Normalization by evaluationfor
✁ ✂ ✄

– p.14/21

slide-46
SLIDE 46

Decision trees

We use decision trees to enumerate types.

✂☎✄ ✂✝✆ ✞ ✞

where

☞ ✁ ✠
☛✝☞ ✌ ☞ ✁ ✂✝✆ ✞ ✞
✗ ✎ ✁ ✂✝✆ ✞ ✞
✑ ✒ ✓✕✔ ✞ ✍ ✎ ✁ ✂✝✆ ✞ ✞
  • We define by simultanous recursion over
✑ ✁ ✞✁ ☎
✟ ✑ ✁ ✞✄✂ ☎ ☎ ✑
☎ ☎ ✄ ✆ ✂
✑ ✁
✍ ✍ ✡ ✁

Normalization by evaluationfor

✁ ✂ ✄

– p.14/21

slide-47
SLIDE 47

Decision tree for

✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ☎ ✆ ✝ ✞ ✟ ✠ ✡☞☛ ✌☞✍ ✟ ✎✑✏✓✒ ✆ ✝ ✞ ✟ ✎ ✏✓✒ ✔ ✏ ✎ ✏✓✒ ✡ ☛ ✌☞✍ ✟ ☎ ✡☞☛ ✌ ✍ ✟ ✠ ✆ ✝ ✞ ✟ ☎ ✡☞☛ ✌☞✍ ✟ ✠ ✆ ✝ ✞ ✟ ☎ ✆ ✝ ✞ ✟ ✠ ✆ ✝ ✞ ✟ ☎ ✡☞☛ ✌☞✍ ✟ ✠ ✡☞☛ ✌☞✍ ✟ ☎ ✡☞☛ ✌ ✍ ✟ ✠ ✡☞☛ ✌☞✍ ✟ ✎✑✏✓✒ ✏

Normalization by evaluationfor

✁ ✂ ✄

– p.15/21

slide-48
SLIDE 48
  • We also implement
✁ ✁ ✂
  • ✌✠✍
✍ ✡ ✁✄ ☎ ✁ ✁ ✞✄✂ ☎ ☎
✁ ✁ ✆ ☎ ✁ ✝
✁ ☎ ✁ ✁

where

✁ ✆ ☎ ✁

expresses that the length of

matches the depth of

☎ ✁

.

Normalization by evaluationfor

✁ ✂ ✄

– p.16/21

slide-49
SLIDE 49

Implementing

✂☎✄
✂ ✄ ☎ ✝ ✁ ✞ ✟ ✑

Normalization by evaluationfor

✁ ✂ ✄

– p.17/21

slide-50
SLIDE 50

Implementing

✂☎✄
✂ ✄ ☎ ✝ ✁ ✞ ✟ ✑
✒ ✂ ✞ ✞ ✟ ✟ ✡ ✄✆☎ ✝ ✞ ☎ ✟ ✕ ✠ ✄
✒ ✂ ✞ ✞✠✟ ✟ ✡☛✡ ☞ ✌✎✍ ✞ ☎ ✏✒✑ ✜✒✓ ✄

Normalization by evaluationfor

✁ ✂ ✄

– p.17/21

slide-51
SLIDE 51

Implementing

✂☎✄
✂ ✄ ☎ ✝ ✁ ✞ ✟ ✑
✒ ✂ ✞ ✞ ✟ ✟ ✡ ✄✆☎ ✝ ✞ ☎ ✟ ✕ ✠ ✄
✒ ✂ ✞ ✞✠✟ ✟ ✡☛✡ ☞ ✌✎✍ ✞ ☎ ✏✒✑ ✜✒✓ ✄
✒ ✂ ✞
✁ ✝ ☎

Normalization by evaluationfor

✁ ✂ ✄

– p.17/21

slide-52
SLIDE 52

Implementing

✂☎✄
✂ ✄ ☎ ✝ ✁ ✞ ✟ ✑
✒ ✂ ✞ ✞ ✟ ✟ ✡ ✄✆☎ ✝ ✞ ☎ ✟ ✕ ✠ ✄
✒ ✂ ✞ ✞✠✟ ✟ ✡☛✡ ☞ ✌✎✍ ✞ ☎ ✏✒✑ ✜✒✓ ✄
✒ ✂ ✞
✁ ✝ ☎ ✆
  • ✂✁
✄✆☎ ✝✟✞ ✠ ✡ ☛✌☞
☞ ✎
✞✏ ✂ ✓ ✒ ☎ ✏ ✞ ✠ ✡
✒ ✒✆✓ ☞ ✔ ✒ ✒
✒ ✂ ✞ ✕ ✓ ✁ ✝ ✓ ✒ ✞ ☎ ✁ ✓ ✞✖ ✗

Normalization by evaluationfor

✁ ✂ ✄

– p.17/21

slide-53
SLIDE 53

Implementing

✂☎✄
✂ ✄ ☎ ✝ ✁ ✞ ✟ ✑
✒ ✂ ✞ ✞ ✟ ✟ ✡ ✄✆☎ ✝ ✞ ☎ ✟ ✕ ✠ ✄
✒ ✂ ✞ ✞✠✟ ✟ ✡☛✡ ☞ ✌✎✍ ✞ ☎ ✏✒✑ ✜✒✓ ✄
✒ ✂ ✞
✁ ✝ ☎ ✆
  • ✂✁
✄✆☎ ✝✟✞ ✠ ✡ ☛✌☞
☞ ✎
✞✏ ✂ ✓ ✒ ☎ ✏ ✞ ✠ ✡
✒ ✒✆✓ ☞ ✔ ✒ ✒
✒ ✂ ✞ ✕ ✓ ✁ ✝ ✓ ✒ ✞ ☎ ✁ ✓ ✞✖ ✗

Note that we need only one bound variable!

Normalization by evaluationfor

✁ ✂ ✄

– p.17/21

slide-54
SLIDE 54

Correctness of

✂☎✄

How do we show

✎ ☞ ✑
✂ ✄✆☎ ✝
✂ ✎
  • Normalization by evaluationfor
✁ ✂ ✄

– p.18/21

slide-55
SLIDE 55

Logical relations

Normalization by evaluationfor

✁ ✂ ✄

– p.19/21

slide-56
SLIDE 56

Logical relations

✂☎✄
✂ ✓
✞ ✖ ✗

Normalization by evaluationfor

✁ ✂ ✄

– p.19/21

slide-57
SLIDE 57

Logical relations

✂☎✄
✂ ✓
✞ ✖ ✗
✟ ✟ ✡ ✄✆☎ ✝ ✞ ☎
✁ ✂ ✟ ✕ ✠ ✄
✟ ✟ ✡ ✡ ☞ ✌✎✍ ✞ ☎
✁ ✂ ✏✒✑ ✜✒✓ ✄
☛ ✁ ✝ ☎ ✂☎✄
✢ ✝✟✞ ✞
✝ ✆

Normalization by evaluationfor

✁ ✂ ✄

– p.19/21

slide-58
SLIDE 58

Logical relations

✂☎✄
✂ ✓
✞ ✖ ✗
✟ ✟ ✡ ✄✆☎ ✝ ✞ ☎
✁ ✂ ✟ ✕ ✠ ✄
✟ ✟ ✡ ✡ ☞ ✌✎✍ ✞ ☎
✁ ✂ ✏✒✑ ✜✒✓ ✄
☛ ✁ ✝ ☎ ✂☎✄
✢ ✝✟✞ ✞
✝ ✆

Fundamental theorem:

Normalization by evaluationfor

✁ ✂ ✄

– p.19/21

slide-59
SLIDE 59

Logical relations

✂☎✄
✂ ✓
✞ ✖ ✗
✟ ✟ ✡ ✄✆☎ ✝ ✞ ☎
✁ ✂ ✟ ✕ ✠ ✄
✟ ✟ ✡ ✡ ☞ ✌✎✍ ✞ ☎
✁ ✂ ✏✒✑ ✜✒✓ ✄
☛ ✁ ✝ ☎ ✂☎✄
✢ ✝✟✞ ✞
✝ ✆

Fundamental theorem:

Main lemma:

✁ ✂
✒ ✂ ✞ ☞

Normalization by evaluationfor

✁ ✂ ✄

– p.19/21

slide-60
SLIDE 60

Further work

Normalization by evaluationfor

– p.20/21

slide-61
SLIDE 61

Further work

Extend the construction to

✂✄ ☎ ✆

(almost done).

Normalization by evaluationfor

– p.20/21

slide-62
SLIDE 62

Further work

Extend the construction to

✂✄ ☎ ✆

(almost done). Extend the construction to

✂✄ ✂

(finite Type Theory) Useful as a hardware description language

Normalization by evaluationfor

– p.20/21

slide-63
SLIDE 63

Further work

Extend the construction to

✂✄ ☎ ✆

(almost done). Extend the construction to

✂✄ ✂

(finite Type Theory) Useful as a hardware description language Use BDDs instead of Decision Trees to improve efficiency.

Normalization by evaluationfor

– p.20/21

slide-64
SLIDE 64

Further work

Extend the construction to

✂✄ ☎ ✆

(almost done). Extend the construction to

✂✄ ✂

(finite Type Theory) Useful as a hardware description language Use BDDs instead of Decision Trees to improve efficiency. Can we extend this approach to type variables?

Normalization by evaluationfor

– p.20/21

slide-65
SLIDE 65

Related Work

Neil Ghani Adjoint Rewriting PhD, 1995 Thorsten Altenkirch,Peter Dybjer, Martin Hofmann,Phil Scott Normalization by evaluation for typed lambda calculus with coproducts LICS 2001 Vincent Balat Une étude des sommes fortes : isomorphismes et formes normales PhD thesis, 2002

Normalization by evaluationfor

– p.21/21