differential combinatory algebras
play

Differential Combinatory Algebras June 26, 2012 Differential - PowerPoint PPT Presentation

Differential Combinatory Algebras June 26, 2012 Differential Combinatory Algebras June 26, 2012 1 / 42 Differential Combinatory Algebras June 26, 2012 2 / 42 Beginning (was on board) 1 1 The beginning of this talk was given on the board.


  1. Differential Combinatory Algebras June 26, 2012 Differential Combinatory Algebras June 26, 2012 1 / 42

  2. Differential Combinatory Algebras June 26, 2012 2 / 42

  3. Beginning (was on board) 1 1 The beginning of this talk was given on the board. Here we try to recap the interactive feel of the board. Differential Combinatory Algebras June 26, 2012 3 / 42

  4. Beginning (was on board) Applicative systems Differential Combinatory Algebras June 26, 2012 3 / 42

  5. Beginning (was on board) Applicative systems • : A × A − → A Differential Combinatory Algebras June 26, 2012 3 / 42

  6. Beginning (was on board) Applicative systems • : A × A − → A ���� “function” Differential Combinatory Algebras June 26, 2012 3 / 42

  7. Beginning (was on board) Applicative systems • : A × A − → A ���� “function” m : a − → b n : a m n : a − → b Differential Combinatory Algebras June 26, 2012 3 / 42

  8. How to make linear resource use available (on board) m : a − → b Differential Combinatory Algebras June 26, 2012 4 / 42

  9. How to make linear resource use available (on board) m : a − → b m :! a ⊸ b Linear Decompose Differential Combinatory Algebras June 26, 2012 4 / 42

  10. How to make linear resource use available (on board) m : a − → b m :! a ⊸ b δ [ m ] : ( a × ! a ) ⊸ b Coderlict Differential Combinatory Algebras June 26, 2012 4 / 42

  11. How to make linear resource use available (on board) m : a − → b m :! a ⊸ b δ [ m ] : ( a × ! a ) ⊸ b δ [ m ] : a ⊸ (! a ⊸ b ) Curry Differential Combinatory Algebras June 26, 2012 4 / 42

  12. How to make linear resource use available (on board) m : a − → b m :! a ⊸ b δ [ m ] : ( a × ! a ) ⊸ b δ [ m ] : a ⊸ (! a ⊸ b ) δ [ m ] : a ⊸ ( a − → b ) Differential Combinatory Algebras June 26, 2012 4 / 42

  13. How to make linear resource use available (on board) m : a − → b m :! a ⊸ b δ [ m ] : ( a × ! a ) ⊸ b δ [ m ] : a ⊸ (! a ⊸ b ) δ [ m ] : a ⊸ ( a − → b ) Given that m : a − → b , δ [ m ] makes a linear use of one thing of type a , and then returns the rest of the function a − → b . Differential Combinatory Algebras June 26, 2012 4 / 42

  14. How to make linear resource use available (on board) m : a − → b m :! a ⊸ b δ [ m ] : ( a × ! a ) ⊸ b δ [ m ] : a ⊸ (! a ⊸ b ) δ [ m ] : a ⊸ ( a − → b ) There are two options for adding linear resource use. Differential Combinatory Algebras June 26, 2012 4 / 42

  15. How to make linear resource use available (on board) m : a − → b m :! a ⊸ b δ [ m ] : ( a × ! a ) ⊸ b δ [ m ] : a ⊸ (! a ⊸ b ) δ [ m ] : a ⊸ ( a − → b ) Option 1: Add a linear application m : a − → b v : a p : a Lin app D ( m , v , p ) : b Differential Combinatory Algebras June 26, 2012 4 / 42

  16. How to make linear resource use available (on board) m : a − → b m :! a ⊸ b δ [ m ] : ( a × ! a ) ⊸ b δ [ m ] : a ⊸ (! a ⊸ b ) δ [ m ] : a ⊸ ( a − → b ) Option 2: Add a combinator d : ( a − → b ) − → ( a ⊸ ( a − → b )) Differential Combinatory Algebras June 26, 2012 4 / 42

  17. How to use linear application (on board) I will be a bit suggestive with the notation Differential Combinatory Algebras June 26, 2012 5 / 42

  18. How to use linear application (on board) We use a special kind of substitution operation which tries to use v in a linear way and p in a more classical way. → ∂ m D [ β ] D ( λ x . m , v , p ) − − − − ∂ x ( p ) · v Differential Combinatory Algebras June 26, 2012 5 / 42

  19. How to use linear application (on board) We use a special kind of substitution operation which tries to use v in a linear way and p in a more classical way. → ∂ m D [ β ] D ( λ x . m , v , p ) − − − − ∂ x ( p ) · v This notation turns out to be more than suggestive. The categorical models of this system are Blute et al ’s Differential Categories: examples are traditional systems of derivatives. Differential Combinatory Algebras June 26, 2012 5 / 42

  20. The derivative of application (on board) Recall m : a − → b n : a m n : b Differential Combinatory Algebras June 26, 2012 6 / 42

  21. The derivative of application (on board) m : a − → b n : a m n : b To be able to support this, application must be linear in the first variable. Differential Combinatory Algebras June 26, 2012 6 / 42

  22. The derivative of application (on board) m : a − → b n : a m n : b No assumptions are made about the second argument because we have no useful information about it. Differential Combinatory Algebras June 26, 2012 6 / 42

  23. The derivative of application (on board) m : a − → b n : a m n : b If x �∈ n then we can simplify what linear in the first argument means: � ∂ m � ∂ m n × �∈ n = ⇒ ∂ x ( p ) · v = ∂ x ( p ) · v n Differential Combinatory Algebras June 26, 2012 6 / 42

  24. Example Reduction (Resource λ versus Differential λ ) D ( λ x . xx , V , P ) ( λ x . x [ x ∞ ])[ V , P ∞ ] Differential Combinatory Algebras June 26, 2012 7 / 42

  25. Example Reduction (Resource λ versus Differential λ ) D ( λ x . xx , V , P ) ( λ x . x [ x ∞ ])[ V , P ∞ ] In the resource λ -calculus, reduction takes place one argument at a time. The argument of application is really a multiset, and is a choice of substitutions V and P . V is available once, and P is available forever. Differential Combinatory Algebras June 26, 2012 7 / 42

  26. Example Reduction (Resource λ versus Differential λ ) D ( λ x . xx , V , P ) ( λ x . x [ x ∞ ])[ V , P ∞ ] → ( λ x . V [ x ∞ ])[ P ∞ ] + ( λ x . P [ x ∞ ])[ V , P ∞ ] In one world, V is chosen as the argument, and it is used depleting it from the choice of arguments. In the other world, P is used; however as it is infinite, it remains in the bag. Differential Combinatory Algebras June 26, 2012 7 / 42

  27. Example Reduction (Resource λ versus Differential λ ) D ( λ x . xx , V , P ) ( λ x . x [ x ∞ ])[ V , P ∞ ] → ( λ x . V [ x ∞ ])[ P ∞ ] + ( λ x . P [ x ∞ ])[ V , P ∞ ] Differential Combinatory Algebras June 26, 2012 7 / 42

  28. Example Reduction (Resource λ versus Differential λ ) D ( λ x . xx , V , P ) → ∂ xx ( λ x . x [ x ∞ ])[ V , P ∞ ] ∂ x ( P ) · V → ( λ x . V [ x ∞ ])[ P ∞ ] + ( λ x . P [ x ∞ ])[ V , P ∞ ] On the differential side, there is just one rule, the reduction rule D [ β ] . Differential Combinatory Algebras June 26, 2012 7 / 42

  29. Example Reduction (Resource λ versus Differential λ ) D ( λ x . xx , V , P ) → ∂ xx ∂ x ( P ) · V ( λ x . x [ x ∞ ])[ V , P ∞ ] � ∂ x � → ( λ x . V [ x ∞ ])[ P ∞ ] = ∂ x ( P ) · V x [ P / x ] + ( λ x . P [ x ∞ ])[ V , P ∞ ] � � P , V , ∂ x + D ∂ x ( P ) · P Here we can see the derivative break up into two pieces. This is an application of the higher order chain rule at work. Note the component of the sum looks different than the second – this is because the derivative is linear in the first argument. Differential Combinatory Algebras June 26, 2012 7 / 42

  30. Example Reduction (Resource λ versus Differential λ ) D ( λ x . xx , V , P ) → ∂ xx ∂ x ( P ) · V ( λ x . x [ x ∞ ])[ V , P ∞ ] � ∂ x � → ( λ x . V [ x ∞ ])[ P ∞ ] = ∂ x ( P ) · V x [ P / x ] + ( λ x . P [ x ∞ ])[ V , P ∞ ] � � P , V , ∂ x + D ∂ x ( P ) · P This time we are substituting into an infinite variable. Differential Combinatory Algebras June 26, 2012 7 / 42

  31. Example Reduction (Resource λ versus Differential λ ) D ( λ x . xx , V , P ) → ∂ xx ∂ x ( P ) · V ( λ x . x [ x ∞ ])[ V , P ∞ ] � ∂ x � → ( λ x . V [ x ∞ ])[ P ∞ ] = ∂ x ( P ) · V x [ P / x ] + ( λ x . P [ x ∞ ])[ V , P ∞ ] � � P , V , ∂ x + D ∂ x ( P ) · P → V [ P ∞ ] + P [ V , P ∞ ] When substituting into an infinite variable, we get just a normal substitution. Differential Combinatory Algebras June 26, 2012 7 / 42

  32. Example Reduction (Resource λ versus Differential λ ) D ( λ x . xx , V , P ) → ∂ xx ∂ x ( P ) · V ( λ x . x [ x ∞ ])[ V , P ∞ ] � ∂ x � → ( λ x . V [ x ∞ ])[ P ∞ ] = ∂ x ( P ) · V x [ P / x ] + ( λ x . P [ x ∞ ])[ V , P ∞ ] � � P , V , ∂ x + D ∂ x ( P ) · P → V [ P ∞ ] + P [ V , P ∞ ] Differential Combinatory Algebras June 26, 2012 7 / 42

  33. Example Reduction (Resource λ versus Differential λ ) D ( λ x . xx , V , P ) → ∂ xx ∂ x ( P ) · V ( λ x . x [ x ∞ ])[ V , P ∞ ] � ∂ x � → ( λ x . V [ x ∞ ])[ P ∞ ] = ∂ x ( P ) · V x [ P / x ] + ( λ x . P [ x ∞ ])[ V , P ∞ ] � � P , V , ∂ x + D ∂ x ( P ) · P → V [ P ∞ ] + P [ V , P ∞ ] = V P + D ( P , V , P ) The derivative of a variable with respect to itself is just the “direction vector.” Differential Combinatory Algebras June 26, 2012 7 / 42

  34. Example Reduction (Resource λ versus Differential λ ) → V [ P ∞ ] + P [ V , P ∞ ] = V P + D ( P , V , P ) Differential Combinatory Algebras June 26, 2012 7 / 42

Recommend


More recommend