Slicing Functional Programs: A Suspicion 10th CREST Open Workshop - - PowerPoint PPT Presentation

slicing functional programs a suspicion
SMART_READER_LITE
LIVE PREVIEW

Slicing Functional Programs: A Suspicion 10th CREST Open Workshop - - PowerPoint PPT Presentation

Slicing Functional Programs: A Suspicion 10th CREST Open Workshop on Program Analysis and Slicing Henrik Nilsson School of Computer Science The University of Nottingham, UK Slicing Functional Programs: A Suspicion p.1/6 Slicing


slide-1
SLIDE 1

Slicing Functional Programs: A Suspicion

10th CREST Open Workshop on Program Analysis and Slicing

Henrik Nilsson School of Computer Science The University of Nottingham, UK

Slicing Functional Programs: A Suspicion – p.1/6

slide-2
SLIDE 2

Slicing Functional Programs?

  • scSine 3.0
  • scSine f

*0.2

  • 0.25

+1.0

+

sciFi :: SF () Sample sciFi = proc () → do und ← arr (∗0.2) ≪ oscSine 3.0− ≺ 0 swp ← arr (+1.0) ≪ integral − ≺ −0.25 audio ← oscSine 440 − ≺ und + swp returnA− ≺ audio

Slicing Functional Programs: A Suspicion – p.2/6

slide-3
SLIDE 3

Behind the Scenes

A signal function (SF) is roughly represented as: data SF a b = SF (DTime → a → (b, SF a b))

Slicing Functional Programs: A Suspicion – p.3/6

slide-4
SLIDE 4

Behind the Scenes

A signal function (SF) is roughly represented as: data SF a b = SF (DTime → a → (b, SF a b))

  • Top level loop repeatedly apply the system SF

to input, computing output at that point in time and next system SF .

Slicing Functional Programs: A Suspicion – p.3/6

slide-5
SLIDE 5

Behind the Scenes

A signal function (SF) is roughly represented as: data SF a b = SF (DTime → a → (b, SF a b))

  • Top level loop repeatedly apply the system SF

to input, computing output at that point in time and next system SF .

  • Output depends on the entire SF computed

at the previous step.

Slicing Functional Programs: A Suspicion – p.3/6

slide-6
SLIDE 6

Behind the Scenes

A signal function (SF) is roughly represented as: data SF a b = SF (DTime → a → (b, SF a b))

  • Top level loop repeatedly apply the system SF

to input, computing output at that point in time and next system SF .

  • Output depends on the entire SF computed

at the previous step. Arguably a somewhat flamboyant (even frivolous?) style of programming!

Slicing Functional Programs: A Suspicion – p.3/6

slide-7
SLIDE 7

A Suspicion

Slicing Functional Programs: A Suspicion – p.4/6

slide-8
SLIDE 8

A Suspicion Style matters!

Slicing Functional Programs: A Suspicion – p.4/6

slide-9
SLIDE 9

Higher-order Abstractions

Higher-order abstractions are a staple of modern functional programming:

  • Monads
  • Arrows
  • Applicative functors
  • Continuation Passing Style (CPS)
  • . . .

Slicing Functional Programs: A Suspicion – p.5/6

slide-10
SLIDE 10

Higher-order Abstractions

Higher-order abstractions are a staple of modern functional programming:

  • Monads
  • Arrows
  • Applicative functors
  • Continuation Passing Style (CPS)
  • . . .

Flamboyance to be expected!

Slicing Functional Programs: A Suspicion – p.5/6

slide-11
SLIDE 11

Accounting for Style

Lost cause?

Slicing Functional Programs: A Suspicion – p.6/6

slide-12
SLIDE 12

Accounting for Style

Lost cause? Maybe not: these abstractions:

  • are principled
  • satisfy useful mathematical laws
  • capture simple ideas

Ought to be possible to exploit!

Slicing Functional Programs: A Suspicion – p.6/6

slide-13
SLIDE 13

Accounting for Style

Lost cause? Maybe not: these abstractions:

  • are principled
  • satisfy useful mathematical laws
  • capture simple ideas

Ought to be possible to exploit! Perhaps we need Stylish Slicing: extensible slicing tools capable of slicing with style!

Slicing Functional Programs: A Suspicion – p.6/6