Unifjed Media Programming: An Algebraic Approach Simon Archipofg, - - PowerPoint PPT Presentation

unifjed media programming an algebraic approach
SMART_READER_LITE
LIVE PREVIEW

Unifjed Media Programming: An Algebraic Approach Simon Archipofg, - - PowerPoint PPT Presentation

Unifjed Media Programming: An Algebraic Approach Simon Archipofg, David Janin , LaBRI, Bordeaux INP, University of Bordeaux FARM@ICFP, Oxford, 9/9/2017 . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .


slide-1
SLIDE 1

Unifjed Media Programming: An Algebraic Approach

Simon Archipofg, David Janin, LaBRI, Bordeaux INP, University of Bordeaux FARM@ICFP, Oxford, 9/9/2017 . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-2
SLIDE 2

Plan of the talk

▶ Preamble: a glimpse of the future ▶ Opening: the turtle and its pen ▶ Theme I: monoid semantics ▶ Theme III: resettable monoid semantics ▶ Variation: the turtle and its time machine ▶ Finale: demo and conclusion ▶ More in the paper:Theme II: inverse monoid semantics

. . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-3
SLIDE 3

A glimpse of the futur

. . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-4
SLIDE 4

Preamble

Programer offjce

from Zero Theorem by Terry Gilliam, 2013. . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-5
SLIDE 5

Preamble

Programming device

from Zero Theorem by Terry Gilliam, 2013. . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-6
SLIDE 6

Preamble

Programming interface

from Zero Theorem by Terry Gilliam, 2013. . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-7
SLIDE 7

Preamble

Spinning the metaphor

The Terry Gilliam “correspondance”’

Program = proof = buidling and Programmer = prover = builder . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-8
SLIDE 8

The turtle and its pen

. . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-9
SLIDE 9

Opening : a turtle equipped with a pen

🐣

🖊 . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-10
SLIDE 10

Opening : the pen can be moved on or ofg the screen

🐣

🖊 drawing a point when pen is on… . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-11
SLIDE 11

Opening : the pen can be moved on or ofg the screen

🐣

🖊 drawing a point when pen is on… . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-12
SLIDE 12

Opening : the pen can be moved on or ofg the screen

🐣

🖊 drawing a point when pen is on… . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-13
SLIDE 13

Opening : the pen can be moved on or ofg the screen

🐣

🖊 drawing a point when pen is on… . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-14
SLIDE 14

Opening : the turtle can walk

🐣 🐣

🖊 🖊

🐣 🐣

🖊 🖊

🐣 🐣

🖊

🐣

🖊 drawing segments when pen is on… . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-15
SLIDE 15

Opening : the turtle can walk

🐣 🐣

🖊 🖊

🐣 🐣

🖊 🖊

🐣 🐣

🖊

🐣

🖊 drawing segments when pen is on… . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-16
SLIDE 16

Opening : the turtle can walk

🐣 🐣

🖊 🖊

🐣 🐣

🖊 🖊

🐣 🐣

🖊

🐣

🖊 drawing segments when pen is on… . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-17
SLIDE 17

Opening : the turtle can walk

🐣 🐣

🖊 🖊

🐣 🐣

🖊 🖊

🐣 🐣

🖊

🐣

🖊 drawing segments when pen is on… . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-18
SLIDE 18

Opening : the turtle can walk

🐣 🐣

🖊 🖊

🐣 🐣

🖊 🖊

🐣 🐣

🖊

🐣

🖊 drawing segments when pen is on… . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-19
SLIDE 19

Opening : the turtle can walk

🐣 🐣

🖊 🖊

🐣 🐣

🖊 🖊

🐣 🐣

🖊

🐣

🖊 drawing segments when pen is on… . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-20
SLIDE 20

Opening : the turtle can walk

🐣 🐣

🖊 🖊

🐣 🐣

🖊 🖊

🐣 🐣

🖊

🐣

🖊 drawing segments when pen is on… . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-21
SLIDE 21

Opening : the turtle can walk

🐣 🐣

🖊 🖊

🐣 🐣

🖊 🖊

🐣 🐣

🖊

🐣

🖊 drawing segments when pen is on… . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-22
SLIDE 22

Opening : the turtle can walk

🐣 🐣

🖊 🖊

🐣 🐣

🖊 🖊

🐣 🐣

🖊

🐣

🖊 drawing segments when pen is on… . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-23
SLIDE 23

Opening : the turtle can walk

🐣 🐣

🖊 🖊

🐣 🐣

🖊 🖊

🐣 🐣

🖊

🐣

🖊 drawing segments when pen is on… . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-24
SLIDE 24

Opening : the turtle can walk

🐣 🐣

🖊 🖊

🐣 🐣

🖊 🖊

🐣 🐣

🖊

🐣

🖊 drawing segments when pen is on… . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-25
SLIDE 25

Opening : the turtle can walk

🐣 🐣

🖊 🖊

🐣 🐣

🖊 🖊

🐣 🐣

🖊

🐣

🖊 drawing segments when pen is on… . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-26
SLIDE 26

Opening : the turtle can walk

🐣 🐣

🖊 🖊

🐣 🐣

🖊 🖊

🐣 🐣

🖊

🐣

🖊 drawing segments when pen is on… . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-27
SLIDE 27

Opening : the turtle can turn

🐣 🐣

🖊

🐣

🖊

🐣

🖊

🐣

🖊

🐣

🖊

🐣

🖊

🐣

🖊

🐣

🖊 drawing 2D fjgures (or more)… . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-28
SLIDE 28

Opening : the turtle can turn

🐣 🐣

🖊

🐣

🖊

🐣

🖊

🐣

🖊

🐣

🖊

🐣

🖊

🐣

🖊

🐣

🖊 drawing 2D fjgures (or more)… . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-29
SLIDE 29

Opening : the turtle can turn

🐣 🐣

🖊

🐣

🖊

🐣

🖊

🐣

🖊

🐣

🖊

🐣

🖊

🐣

🖊

🐣

🖊 drawing 2D fjgures (or more)… . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-30
SLIDE 30

Opening : the turtle can turn

🐣 🐣

🖊

🐣

🖊

🐣

🖊

🐣

🖊

🐣

🖊

🐣

🖊

🐣

🖊

🐣

🖊 drawing 2D fjgures (or more)… . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-31
SLIDE 31

Opening : the turtle can turn

🐣 🐣

🖊

🐣

🖊

🐣

🖊

🐣

🖊

🐣

🖊

🐣

🖊

🐣

🖊

🐣

🖊 drawing 2D fjgures (or more)… . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-32
SLIDE 32

Opening : the turtle can turn

🐣 🐣

🖊

🐣

🖊

🐣

🖊

🐣

🖊

🐣

🖊

🐣

🖊

🐣

🖊

🐣

🖊 drawing 2D fjgures (or more)… . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-33
SLIDE 33

Opening : the turtle can turn

🐣 🐣

🖊

🐣

🖊

🐣

🖊

🐣

🖊

🐣

🖊

🐣

🖊

🐣

🖊

🐣

🖊 drawing 2D fjgures (or more)… . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-34
SLIDE 34

Opening : the turtle can turn

🐣 🐣

🖊

🐣

🖊

🐣

🖊

🐣

🖊

🐣

🖊

🐣

🖊

🐣

🖊

🐣

🖊 drawing 2D fjgures (or more)… . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-35
SLIDE 35

Opening : the turtle can turn

🐣 🐣

🖊

🐣

🖊

🐣

🖊

🐣

🖊

🐣

🖊

🐣

🖊

🐣

🖊

🐣

🖊 drawing 2D fjgures (or more)… . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-36
SLIDE 36

Opening : the turtle can turn

🐣 🐣

🖊

🐣

🖊

🐣

🖊

🐣

🖊

🐣

🖊

🐣

🖊

🐣

🖊

🐣

🖊 drawing 2D fjgures (or more)… . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-37
SLIDE 37

Opening : the turtle can turn

🐣 🐣

🖊

🐣

🖊

🐣

🖊

🐣

🖊

🐣

🖊

🐣

🖊

🐣

🖊

🐣

🖊 drawing 2D fjgures (or more)… . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-38
SLIDE 38

Program syntax

A program is a sequence of elementary actions

▶ Flip pen on or ofg ▶ Walk d for some distance d ▶ Turn d for some angle d

The square example

Walk , Turn , Walk , Turn , Walk , Turn , Walk , Turn ! . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-39
SLIDE 39

Program syntax

A program is a sequence of elementary actions

▶ Flip pen on or ofg ▶ Walk d for some distance d ▶ Turn d for some angle d

The square example

Walk 1, Turn π/2, Walk 1, Turn π/2, Walk 1, Turn π/2, Walk 1, Turn π/2 ! . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-40
SLIDE 40

Monoid semantics

. . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-41
SLIDE 41

Goal

Programs form a monoid. We aim at defjning a monoid semantics model for turtle program. . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-42
SLIDE 42

Semantics elements : positions, fjgures, moves and drawings

State space

▶ Positions: P = R2 × R/2πR × B, ▶ Figures: F = P(R2 × R2).

Moves and drawings

Moves: M P P, Drawings: D P F. . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-43
SLIDE 43

Semantics elements : positions, fjgures, moves and drawings

State space

▶ Positions: P = R2 × R/2πR × B, ▶ Figures: F = P(R2 × R2).

Moves and drawings

▶ Moves: M = P → P, ▶ Drawings: D = P → F.

. . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-44
SLIDE 44

Monoid semantics

Elementary action semantics

Move semantics: P → P

▶ [

[ Flip ] ]M(p, a, b) = (p, a, ¬d)

▶ [

[ Walk d ] ]M(p, a, b) = (p + (d ∗ cos(a), d ∗ sin(a)), a, d)

▶ [

[ Turn d ] ]M(p, a, b) = (p, a + d, b) Drawing semantics: P F Flip D p a b p p when b when b Walk d D p a b p p d cos a d sin a when b when b Turn d D p a b . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-45
SLIDE 45

Monoid semantics

Elementary action semantics

Move semantics: P → P

▶ [

[ Flip ] ]M(p, a, b) = (p, a, ¬d)

▶ [

[ Walk d ] ]M(p, a, b) = (p + (d ∗ cos(a), d ∗ sin(a)), a, d)

▶ [

[ Turn d ] ]M(p, a, b) = (p, a + d, b) Drawing semantics: P → F

▶ [

[ Flip ] ]D(p, a, b) = { {(p, p)} when b = 0 ∅ when b = 1

▶ [

[ Walk d ] ]D(p, a, b) =    {(p, p + (d ∗ cos(a), d ∗ sin(a)))} when b = 1 ∅ when b = 0

▶ [

[ Turn d ] ]D(p, a, b) = ∅ . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-46
SLIDE 46

Monoid semantics

The monoid

Set S = P → P

M

× P → P(F)

  • D

equipped with product (m1, d1) · (m2, d2) = (m2 ◦ m1, d1 ∪ d2 ◦ m1).

Program semantics

Inductively defjne by composition of elementary action semantics with empty program , ap a M a D p for all elementary action a and program p.

Remark

Semantics is the morphism generated from the (free) monoids of programs into the semantics monoids. . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-47
SLIDE 47

Monoid semantics

The monoid

Set S = P → P

M

× P → P(F)

  • D

equipped with product (m1, d1) · (m2, d2) = (m2 ◦ m1, d1 ∪ d2 ◦ m1).

Program semantics

Inductively defjne by composition of elementary action semantics

▶ [

[ ϵ ] ] = ∅ with empty program ϵ,

▶ [

[ ap ] ] = ([ [ a ] ]M, [ [ a ] ]D) · [ [ p ] ] for all elementary action a and program p.

Remark

Semantics is the morphism generated from the (free) monoids of programs into the semantics monoids. . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-48
SLIDE 48

Monoid semantics

The monoid

Set S = P → P

M

× P → P(F)

  • D

equipped with product (m1, d1) · (m2, d2) = (m2 ◦ m1, d1 ∪ d2 ◦ m1).

Program semantics

Inductively defjne by composition of elementary action semantics

▶ [

[ ϵ ] ] = ∅ with empty program ϵ,

▶ [

[ ap ] ] = ([ [ a ] ]M, [ [ a ] ]D) · [ [ p ] ] for all elementary action a and program p.

Remark

Semantics is the morphism generated from the (free) monoids of programs into the semantics monoids. . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-49
SLIDE 49

Monoid semantics

Lemma

▶ moves under (fmipped) composition form a monoid, ▶ drawings under (element-wise) union form a monoid, ▶ moves act by endomorphisms over drawings by m ∗ d = d ◦ m, ▶ and we have S = M ⋉ D, i.e. semantics monoid is a

semi-direct product. . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-50
SLIDE 50

Resettable monoid semantics

. . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-51
SLIDE 51

Resettable monoid semantics

Program reset

For every program p, defjne reset(p) by [ [ reset(p) ] ] = (id, [ [ p ] ]D).

General construct

Given a monoid M acting by endomorphisms on a lattice L, the semi-direct product M L is a resettable monoid. That is, given m d R d , we have: M L R L is a idempotent commutative submonoid, m d R is the least left unit of m d . This is known in the York school as a left semi-adequate monoid. Moreover, for all x y z M L, we have: xR yR zx R zy R (left Ehresmann), xy Rx xyR (left restriction). . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-52
SLIDE 52

Resettable monoid semantics

Program reset

For every program p, defjne reset(p) by [ [ reset(p) ] ] = (id, [ [ p ] ]D).

General construct

Given a monoid M acting by endomorphisms on a lattice L, the semi-direct product M ⋉ L is a resettable monoid. That is, given m d R d , we have: M L R L is a idempotent commutative submonoid, m d R is the least left unit of m d . This is known in the York school as a left semi-adequate monoid. Moreover, for all x y z M L, we have: xR yR zx R zy R (left Ehresmann), xy Rx xyR (left restriction). . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-53
SLIDE 53

Resettable monoid semantics

Program reset

For every program p, defjne reset(p) by [ [ reset(p) ] ] = (id, [ [ p ] ]D).

General construct

Given a monoid M acting by endomorphisms on a lattice L, the semi-direct product M ⋉ L is a resettable monoid. That is, given (m, d)R = (1, d), we have:

▶ (M ⋉ L)R = {1} ⋉ L is a idempotent commutative submonoid, ▶ (m, d)R is the least left unit of (m, d).

This is known in the York school as a left semi-adequate monoid. Moreover, for all x y z M L, we have: xR yR zx R zy R (left Ehresmann), xy Rx xyR (left restriction). . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-54
SLIDE 54

Resettable monoid semantics

Program reset

For every program p, defjne reset(p) by [ [ reset(p) ] ] = (id, [ [ p ] ]D).

General construct

Given a monoid M acting by endomorphisms on a lattice L, the semi-direct product M ⋉ L is a resettable monoid. That is, given (m, d)R = (1, d), we have:

▶ (M ⋉ L)R = {1} ⋉ L is a idempotent commutative submonoid, ▶ (m, d)R is the least left unit of (m, d).

This is known in the York school as a left semi-adequate monoid. Moreover, for all x y z M L, we have: xR yR zx R zy R (left Ehresmann), xy Rx xyR (left restriction). . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-55
SLIDE 55

Resettable monoid semantics

Program reset

For every program p, defjne reset(p) by [ [ reset(p) ] ] = (id, [ [ p ] ]D).

General construct

Given a monoid M acting by endomorphisms on a lattice L, the semi-direct product M ⋉ L is a resettable monoid. That is, given (m, d)R = (1, d), we have:

▶ (M ⋉ L)R = {1} ⋉ L is a idempotent commutative submonoid, ▶ (m, d)R is the least left unit of (m, d).

This is known in the York school as a left semi-adequate monoid. Moreover, for all x, y, z ∈ M ⋉ L, we have:

▶ xR = yR ⇒ (zx)R = (zy)R (left Ehresmann), ▶ (xy)Rx = xyR (left restriction).

. . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-56
SLIDE 56

Resettable monoid semantics

Extending Turtle Programs

▶ Moves can be extended to non injective moves, e.g.

projection.

Interpretation of the reset

Resets act as kind of a fork operator: reset p q can be understood as “fork a sub turtle behaving like p” and “keep

  • n executing q”.

. . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-57
SLIDE 57

Resettable monoid semantics

Extending Turtle Programs

▶ Moves can be extended to non injective moves, e.g.

projection.

Interpretation of the reset

▶ Resets act as kind of a fork operator: reset(p) <> q can be

understood as “fork a sub turtle behaving like p” and “keep

  • n executing q”.

. . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-58
SLIDE 58

The turtle and its violin

. . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-59
SLIDE 59

The violin metaphor

We want our turtle “to play violin” or, more seriously, to act also

  • ver the time dimension…

. . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-60
SLIDE 60

Temporal turtle semantics

Temporal moves and animations

Let T be a timescale, e.g. T = R.

▶ Temporal moves: TM = T → T (possibly partial), ▶ Animation A = T → S,

where S = (M, D) is the (inverse monoid of) turtle 2D semantics.

Temporal semantics

TM is a monoid under fmipped composition, A is a monoid under point-wise extension of the 2D product, TM acts by endomorphism on A by tm a a tm (with a tm t in the case tm t is undefjned), so that TS TM A is a inverse (or at least resettable) monoid for temporal turtle program semantics. . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-61
SLIDE 61

Temporal turtle semantics

Temporal moves and animations

Let T be a timescale, e.g. T = R.

▶ Temporal moves: TM = T → T (possibly partial), ▶ Animation A = T → S,

where S = (M, D) is the (inverse monoid of) turtle 2D semantics.

Temporal semantics

▶ TM is a monoid under fmipped composition, ▶ A is a monoid under point-wise extension of the 2D product, ▶ TM acts by endomorphism on A by tm ∗ a = a ◦ tm

(with a ◦ tm(t) = ∅ in the case tm(t) is undefjned), so that TS = TM ⋉ A is a inverse (or at least resettable) monoid for temporal turtle program semantics. . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-62
SLIDE 62

Temporal turtle elementary programs

Examples

Bijection over time:

▶ [

[ Delay d ] ] = (t → t + d, ϵ),

▶ [

[ Strech f ] ] = (t → t ∗ f, ϵ),

  • r partial bijection over time (extending action of TM over A

accordingly)

▶ [

[ Start ] ] = (t → t if t ≥ 0, ϵ),

▶ [

[ Stop ] ] = (t → t if t ≤ 0, ϵ), which can be combined with delay to defjne Play t1 t2 that cuts the timescale from t1 to t2…

A programing API

In a modern language such as Haskell, the above functions may be part of a timed monoid class type. . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-63
SLIDE 63

Temporal turtle elementary programs

Examples

Bijection over time:

▶ [

[ Delay d ] ] = (t → t + d, ϵ),

▶ [

[ Strech f ] ] = (t → t ∗ f, ϵ),

  • r partial bijection over time (extending action of TM over A

accordingly)

▶ [

[ Start ] ] = (t → t if t ≥ 0, ϵ),

▶ [

[ Stop ] ] = (t → t if t ≤ 0, ϵ), which can be combined with delay to defjne Play t1 t2 that cuts the timescale from t1 to t2…

A programing API

In a modern language such as Haskell, the above functions may be part of a timed monoid class type. . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-64
SLIDE 64

Musical extension

Let E be a set of musical events, e.g. note on n+ and ofg n− one for each note n ∈ N. Let T be the symbolic temporal scale.

Symbolic music monoid

Consider D T T (partial) and P T E T with M D P and the induced (resettable) submonoid generated by n t t t n t n t

  • ne for each note n

N together with Delay, Shift, Start and Stop. Then, the monoids M contains all fjnite polyphonic symbolic melodies. . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-65
SLIDE 65

Musical extension

Let E be a set of musical events, e.g. note on n+ and ofg n− one for each note n ∈ N. Let T be the symbolic temporal scale.

Symbolic music monoid

Consider D = T → T (partial) and P = T → P(E × T) with M = D ⋉ P and the induced (resettable) submonoid generated by [ [ n ] ] = (t → t + 1, t → {(n+, t), (n−, t + 1)})

  • ne for each note n ∈ N together with Delay, Shift, Start and Stop.

Then, the monoids M contains all fjnite polyphonic symbolic melodies. . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-66
SLIDE 66

Musical extension

Let E be a set of musical events, e.g. note on n+ and ofg n− one for each note n ∈ N. Let T be the symbolic temporal scale.

Symbolic music monoid

Consider D = T → T (partial) and P = T → P(E × T) with M = D ⋉ P and the induced (resettable) submonoid generated by [ [ n ] ] = (t → t + 1, t → {(n+, t), (n−, t + 1)})

  • ne for each note n ∈ N together with Delay, Shift, Start and Stop.

Then, the monoids M contains all fjnite polyphonic symbolic melodies. . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-67
SLIDE 67

Our actual implementation

. . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-68
SLIDE 68

3D by extrusion

. . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-69
SLIDE 69

Painting vs extruding

Extrusion is easier

▶ pen down : “control” points (or curves), ▶ move : combining complex moves, ▶ pen down : “control” points (or curves), ▶ move : combining complex moves, ▶ etc..

and compute automatically…curves (surfaces), curve tangents (or surface normals), resolutions, interpolations…

Drawing specifjcation

With reset, a drawing specifjcation is a tree structures set of “control points”… . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-70
SLIDE 70

Painting vs extruding

Extrusion is easier

▶ pen down : “control” points (or curves), ▶ move : combining complex moves, ▶ pen down : “control” points (or curves), ▶ move : combining complex moves, ▶ etc..

and compute automatically…curves (surfaces), curve tangents (or surface normals), resolutions, interpolations…

Drawing specifjcation

With reset, a drawing specifjcation is a tree structures set of “control points”… . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-71
SLIDE 71

From Haskell to GPU

A three layer architecture

▶ Haskell animated 3D scene syntax, ▶ Haskell animated 3D scene specifjcation, ▶ GPU rendering.

Effjciency

5000 drawing elements specifjed (on CPU) up to 1000000 triangles drawn (on GPU) at decent animation rate (from 30 to 70 fps). . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-72
SLIDE 72

From Haskell to GPU

A three layer architecture

▶ Haskell animated 3D scene syntax, ▶ Haskell animated 3D scene specifjcation, ▶ GPU rendering.

Effjciency

▶ 5000 drawing elements specifjed (on CPU) ▶ up to 1000000 triangles drawn (on GPU) ▶ at decent animation rate (from 30 to 70 fps).

. . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-73
SLIDE 73

Drawing examples

. . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-74
SLIDE 74

Drawing examples

. . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-75
SLIDE 75

Drawing examples

. . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-76
SLIDE 76

To do list

. . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-77
SLIDE 77

Normal forms

The need for normal forms

So far, we have seen ways of synthesizing/writing temporal media. Temporal media transformations require ways of analyzing/reading temporal media. Normal forms should allow this.

Stronger needs when on-the-fmy

Temporal media must be read (in reactive program) in a time coherent way. . . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-78
SLIDE 78

Other needs

▶ Generic handling of piles of semi-direct product (much like

Monad transformers)

▶ Cut monoids vs enveloppe monoids (dual construction ?) ▶ Richer geometry (with bounded size instances to be sent to

the GPU),

▶ Heterogeneous dimension (points, curves, surfaces, volumes,

etc...),

▶ Examples library (pandemonium)

. . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .

slide-79
SLIDE 79

Octopus on the grid:

https://github.com/OctopusFarm/Octopus

. . . . . .. . . . . . . .. . . . . . . .. . . . . . . .. . . .. . . . . .