Unifying Notions of Feedback Sergey Goncharov FAU Tag der - - PowerPoint PPT Presentation

unifying notions of feedback
SMART_READER_LITE
LIVE PREVIEW

Unifying Notions of Feedback Sergey Goncharov FAU Tag der - - PowerPoint PPT Presentation

Unifying Notions of Feedback Sergey Goncharov FAU Tag der Informatik 2019, April 26 Unifying Notions of Feedback Sergey Goncharov FAU Tag der Informatik 2019, April 26 Outline Semantics of programs and specification frameworks is a rich


slide-1
SLIDE 1

Unifying Notions of Feedback

Sergey Goncharov

FAU Tag der Informatik 2019, April 26

slide-2
SLIDE 2

Unifying Notions of Feedback

Sergey Goncharov

FAU Tag der Informatik 2019, April 26

slide-3
SLIDE 3

Outline

Semantics of programs and specification frameworks is a rich ecosystem containing a tremendous bulk of methods and tools for dealing with various flavours of computation from classical, nondeterministic, probabilistic to quantum

1 19

slide-4
SLIDE 4

Outline

Semantics of programs and specification frameworks is a rich ecosystem containing a tremendous bulk of methods and tools for dealing with various flavours of computation from classical, nondeterministic, probabilistic to quantum A unifying language for semantics is category theory

1 19

slide-5
SLIDE 5

Outline

Semantics of programs and specification frameworks is a rich ecosystem containing a tremendous bulk of methods and tools for dealing with various flavours of computation from classical, nondeterministic, probabilistic to quantum A unifying language for semantics is category theory Feedback is a distinctive feature of complex systems, computationally interpreted e.g. as iteration or recursion

1 19

slide-6
SLIDE 6

Outline

Semantics of programs and specification frameworks is a rich ecosystem containing a tremendous bulk of methods and tools for dealing with various flavours of computation from classical, nondeterministic, probabilistic to quantum A unifying language for semantics is category theory Feedback is a distinctive feature of complex systems, computationally interpreted e.g. as iteration or recursion Total (but not partial!) feedback operators are categorically unified with traced (monoidal) categories

1 19

slide-7
SLIDE 7

Outline

Semantics of programs and specification frameworks is a rich ecosystem containing a tremendous bulk of methods and tools for dealing with various flavours of computation from classical, nondeterministic, probabilistic to quantum A unifying language for semantics is category theory Feedback is a distinctive feature of complex systems, computationally interpreted e.g. as iteration or recursion Total (but not partial!) feedback operators are categorically unified with traced (monoidal) categories Grand unification: Guarded Traced Categories

1 19

slide-8
SLIDE 8

Why Semantics?

slide-9
SLIDE 9

A Well-known Scenario

How do we know that automata q1 start q2 a b q1

1

start q1

2

q1

3

a b b a are equivalent?

2 19

slide-10
SLIDE 10

A Well-known Scenario

How do we know that automata q1 start q2 a b q1

1

start q1

2

q1

3

a b b a are equivalent? Because q1 “ pabq‹, q1

1 “ apbaq‹b ` 1 and: pabq‹ “ apbaq‹b ` 1

semantic brackets dinaturality identity

2 19

slide-11
SLIDE 11

Semantics in Computer Science

Semantics

3 19

slide-12
SLIDE 12

Semantics in Computer Science

Semantics Effectiveness (of presentation, decidability)

3 19

slide-13
SLIDE 13

Semantics in Computer Science

Semantics Effectiveness (of presentation, decidability) Efficiency (complexity

  • f computations,

efficient data structures)

3 19

slide-14
SLIDE 14

Semantics in Computer Science

Semantics Effectiveness (of presentation, decidability) Efficiency (complexity

  • f computations,

efficient data structures) Algorithms, implementations, concrete programming languages, compilers, interpreters, simulators, proof assistants, ...

3 19

slide-15
SLIDE 15

A Less Known Scenario

1 2 3 4 0.5 1

Bouncing ball is a simple Newtonian system specified by differential equation ¨ h “ ´g (g « 9.8) whose solution is hptq “ h0 ` v0t ´ gt2

2

with initial values: v0 “ 0, h0 ‰ 0 (peak height) h0 “ 0, v0 ‰ 0 (zero height) Features: deterministic hybrid: the velocity changes discretely at the bottom v ÞÑ ´cv, but it changes continuously in the meanwhile Zeno behaviour: the state of rest is only reachable in the limit

damping factor

4 19

slide-16
SLIDE 16

Hybrid Automata

The following hybrid automata "A" and "B" capture the bouncing ball behaviour:

❋❧② ˙ h “ v ˙ v “ ´g h ě 0 h “ 1, v “ 0 h “ 0 v :“ ´cv ❉♦✇♥ ˙ h “ v ˙ v “ ´g h ě 0 h “ 1, v “ 0 ❯♣ ˙ h “ v ˙ v “ ´g v ě 0 h “ 0 v :“ ´cv v “ 0

These automata are not equivalent under standard semantics, because A “ p , , , . . .q, but B “ p , , , , , . . .q

5 19

slide-17
SLIDE 17

Impact of Semantics

Knowing the semantics of automata, we can minimize them, transform, prove equivalence

6 19

slide-18
SLIDE 18

Impact of Semantics

Knowing the semantics of automata, we can minimize them, transform, prove equivalence We can transfer knowledge between different models, as the theories of nondeterministic, probablilistic, push-down, etc, etc automata have a lot in common

6 19

slide-19
SLIDE 19

Impact of Semantics

Knowing the semantics of automata, we can minimize them, transform, prove equivalence We can transfer knowledge between different models, as the theories of nondeterministic, probablilistic, push-down, etc, etc automata have a lot in common We can optimize programs, e.g.

while b do ... if b then ... else /* dead code */ done while b do ... Ñ ... done

and verify them (since, we know what they mean!)

6 19

slide-20
SLIDE 20

Impact of Semantics

Knowing the semantics of automata, we can minimize them, transform, prove equivalence We can transfer knowledge between different models, as the theories of nondeterministic, probablilistic, push-down, etc, etc automata have a lot in common We can optimize programs, e.g.

while b do ... if b then ... else /* dead code */ done while b do ... Ñ ... done

and verify them (since, we know what they mean!) Principled semantic foundations improve design of languages, software and hardware systems (types, compositionality, Curry-Howard correspondence, etc)

6 19

slide-21
SLIDE 21

Why Category Theory?

slide-22
SLIDE 22

[...] Kategorientheorie – ein sehr komplexes Gebiet mit tiefen mathematischen Wurzeln, und mit relativ wenigen Experten auf diesem Gebiet — Anonymous referee

7 19

slide-23
SLIDE 23

Categories: Quick Intro

A category C consists of wires (=objects) |C| and boxes (=morphisms) CpA, Bq with A, B P |C|, which can be combined:

A A

f g

A C B

identity wire sequential composition

8 19

slide-24
SLIDE 24

Categories: Quick Intro

A category C consists of wires (=objects) |C| and boxes (=morphisms) CpA, Bq with A, B P |C|, which can be combined:

A A

f g

A C B

A category is monoidal if morphisms can be tensored:

f g

A C b A C B D b B D

parallel composition identity wire sequential composition

8 19

slide-25
SLIDE 25

Categories: Quick Intro

A category C consists of wires (=objects) |C| and boxes (=morphisms) CpA, Bq with A, B P |C|, which can be combined:

A A

f g

A C B

A category is monoidal if morphisms can be tensored:

f g

A C b A C B D b B D

parallel composition

A monoidal category is symmetric if wires can be crossed:

A A B B

identity wire sequential composition

8 19

slide-26
SLIDE 26

Categories: Quick Intro

A category C consists of wires (=objects) |C| and boxes (=morphisms) CpA, Bq with A, B P |C|, which can be combined:

A A

f g

A C B

A category is monoidal if morphisms can be tensored:

f g

A C b A C B D b B D

parallel composition

A monoidal category is symmetric if wires can be crossed:

A A B B

Boxes are intuitively: programs, processes, components, automata; wires are types, communication channels

identity wire sequential composition

8 19

slide-27
SLIDE 27

Traced Categories

Traced categories additionally allow feedback loops, called traces:

f

U U A B

Traced categories provide a unifying framework for Iteration (roughly: while-loops) Recursion (roughly: fixpoint combinators of λ-calculus) Knot theory Operator theory (e.g. traces model quantum measurements)

9 19

slide-28
SLIDE 28

Why Guarded Traces?

slide-29
SLIDE 29

Automata, Revisited

Consider again the regular expressions pabq‹ and apbaq‹b ` 1 Here, Kleene star e‹ is the unique fixpoint of x ÞÑ ex ` 1 Equation pabq‹ “ apbaq‹b ` 1 is true, because apbaq‹b ` 1 is a fixpoint of the same map

10 19

slide-30
SLIDE 30

Automata, Revisited

Consider again the regular expressions pabq‹ and apbaq‹b ` 1 Here, Kleene star e‹ is the unique fixpoint of x ÞÑ ex ` 1 Equation pabq‹ “ apbaq‹b ` 1 is true, because apbaq‹b ` 1 is a fixpoint of the same map: apbaq‹b ` 1 “ appbaqpbaq‹ ` 1qb ` 1

10 19

slide-31
SLIDE 31

Automata, Revisited

Consider again the regular expressions pabq‹ and apbaq‹b ` 1 Here, Kleene star e‹ is the unique fixpoint of x ÞÑ ex ` 1 Equation pabq‹ “ apbaq‹b ` 1 is true, because apbaq‹b ` 1 is a fixpoint of the same map: apbaq‹b ` 1 “ appbaqpbaq‹ ` 1qb ` 1 “ apbaqpbaq‹b ` a1b ` 1

10 19

slide-32
SLIDE 32

Automata, Revisited

Consider again the regular expressions pabq‹ and apbaq‹b ` 1 Here, Kleene star e‹ is the unique fixpoint of x ÞÑ ex ` 1 Equation pabq‹ “ apbaq‹b ` 1 is true, because apbaq‹b ` 1 is a fixpoint of the same map: apbaq‹b ` 1 “ appbaqpbaq‹ ` 1qb ` 1 “ apbaqpbaq‹b ` a1b ` 1 “ pabqapbaq‹b ` ab ` 1

10 19

slide-33
SLIDE 33

Automata, Revisited

Consider again the regular expressions pabq‹ and apbaq‹b ` 1 Here, Kleene star e‹ is the unique fixpoint of x ÞÑ ex ` 1 Equation pabq‹ “ apbaq‹b ` 1 is true, because apbaq‹b ` 1 is a fixpoint of the same map: apbaq‹b ` 1 “ appbaqpbaq‹ ` 1qb ` 1 “ apbaqpbaq‹b ` a1b ` 1 “ pabqapbaq‹b ` ab ` 1 “ pabqpapbaq‹b ` 1q ` 1

10 19

slide-34
SLIDE 34

Automata, Revisited

Consider again the regular expressions pabq‹ and apbaq‹b ` 1 Here, Kleene star e‹ is the unique fixpoint of x ÞÑ ex ` 1 Equation pabq‹ “ apbaq‹b ` 1 is true, because apbaq‹b ` 1 is a fixpoint of the same map: apbaq‹b ` 1 “ appbaqpbaq‹ ` 1qb ` 1 “ apbaqpbaq‹b ` a1b ` 1 “ pabqapbaq‹b ` ab ` 1 “ pabqpapbaq‹b ` 1q ` 1

10 19

slide-35
SLIDE 35

Automata, Revisited

Consider again the regular expressions pabq‹ and apbaq‹b ` 1 Here, Kleene star e‹ is the unique fixpoint of x ÞÑ ex ` 1 Equation pabq‹ “ apbaq‹b ` 1 is true, because apbaq‹b ` 1 is a fixpoint of the same map: apbaq‹b ` 1 “ appbaqpbaq‹ ` 1qb ` 1 “ apbaqpbaq‹b ` a1b ` 1 “ pabqapbaq‹b ` ab ` 1 “ pabqpapbaq‹b ` 1q ` 1 This only works because the map x ÞÑ abx ` 1 is guarded Contrastingly, the map x ÞÑ pa ` 1qx ` 1 is unguarded and has infinitely many fixpoints

10 19

slide-36
SLIDE 36

Guarded Traces

Automata can be organized into a traced symmetric category, e.g. pabq‹ is expressed as

a b 1

But we do not have an explicit distinction between guarded and unguarded loops Guarded traces are simpler and better behaved They often have special useful properties, e.g. uniqueness Sometimes, there is no candidate for a total trace operator

case distinction nondeterministic choice guards

11 19

slide-37
SLIDE 37

Guarded Categories

Guarded (monoidal) categories are defined in terms of decorated diagrams, subject to the axioms:

f g f g f g

Only the paths from left bars to right bars are considered guarded

12 19

slide-38
SLIDE 38

Guarded Traces

A guarded category is guarded traced if it supports guarded traces:

f

Intuitively, we are allowed to close the loop because it only runs through the interface of f indicated by the black bars

13 19

slide-39
SLIDE 39

Total Guardedness and Vacuous Guardedness

With guarded categories we mediate between symmetric monoidal categories and traced symmetric ones with vacuous guardedness: there are no guarded paths at all (symmetric monoidal categories) total guardedness: every path is guarded (traced symmetric categories) motivating examples (such as automata) occur properly between these two extremes

14 19

slide-40
SLIDE 40

Bouncing Ball Revisited

Guardedness in hybrid semantics means progressiveness, i.e. consuming non-zero time The behaviour of bouncing ball is described in terms of velocity and height v, h P R2:

R2 yes no R2 R2 R2 R2 R2 R R2

fly till h “ 0 v>0 v “ ´cv fly till h “ 0 h, v ÞÑ h

In contrast to general traces, guarded ones are computed as least fixpoints

15 19

slide-41
SLIDE 41

Further Examples

Complete metric spaces: guardedness = contractiveness, fixpoints are computed via Banach’s fixpoint theorem Infinite-dimentional Hilbert spaces under vacuous guardedness, traces = traces of bounded linear operators Infinite trace semantics: guardedness by actions, traces are greatest fixpoints, e.g. a‹ ` aω is the canonical fixpoint of x ÞÑ ax ` 1, and not just a‹

16 19

slide-42
SLIDE 42

Completeness Problem

Q: Can we make sense of the following diagram?

f g

17 19

slide-43
SLIDE 43

Completeness Problem

Q: Can we make sense of the following diagram?

f g

17 19

slide-44
SLIDE 44

Completeness Problem

Q: Can we make sense of the following diagram? A: Yes, because we can redraw it as

f g

17 19

slide-45
SLIDE 45

Completeness Problem

Q: What about this one:

f h g

18 19

slide-46
SLIDE 46

Completeness Problem

Q: What about this one:

f h g

harmless unguarded path

18 19

slide-47
SLIDE 47

Completeness Problem

Q: What about this one:

f h g

harmless unguarded path

Morally, this diagram should be OK, but we cannot rearrange it so as to be able to derive it from the axioms of guardedness

18 19

slide-48
SLIDE 48

Completeness Problem

Q: What about this one:

f h g

harmless unguarded path

Morally, this diagram should be OK, but we cannot rearrange it so as to be able to derive it from the axioms of guardedness Open Problem: resolve the discrepancy between geometric guardedness and structural guardedness

18 19

slide-49
SLIDE 49

Conclusions

Guarded traced categories are abound in semantics and beyond Abstract notion of guardedness unifies various principles behind partiality of feedback: delay, progress, contractivity, etc Guarded categories come together with a semantically justified unifying diagrammatic metalanguage, suitable for visual programming and modelling (e.g. hybrid systems) Abstract guardedness helps to identify well-behaved notions of feedback (unique, least, greatest), which come together with the corresponding reasoning principles (co-induction, Scott induction)

19 / 19