Computability in Timed Sets in Opetaa, Estonia Robin Cockett Joaqu - - PowerPoint PPT Presentation

computability in timed sets in opetaa estonia
SMART_READER_LITE
LIVE PREVIEW

Computability in Timed Sets in Opetaa, Estonia Robin Cockett Joaqu - - PowerPoint PPT Presentation

Computability in Timed Sets in Opetaa, Estonia Robin Cockett Joaqu n D az-Bo ls Jonathan Gallagher Pavel Hrube s University ofCalgary February 4, 2013 Motivation Explicit versus implicit Timed sets Where are we going?


slide-1
SLIDE 1

Computability in Timed Sets in Opetaa, Estonia

Robin Cockett Joaqu´ ın D´ ıaz-Bo¨ ıls Jonathan Gallagher Pavel Hrubeˇ s

University ofCalgary

February 4, 2013

slide-2
SLIDE 2

Motivation Explicit versus implicit Timed sets Where are we going? Timing maps Complexity orders Restriction categories Computability in timed sets Iteration ... Splitting idempotents Getting non-zero size .. Computability Powerful objects Program objects Turing structure

2 of 63

slide-3
SLIDE 3

Explicit versus implicit

EXPLICIT

(model)

  • IMPLICIT

(axiomatic theory) PROBLEM: Need to know what one is modelling ... Need to know how to axiomatize the phenomenon

3 of 63

slide-4
SLIDE 4

Explicit versus implicit

EXPLICIT COMPUTABILITY

(particular model)

  • IMPLICIT

COMPUTABILITY

(axiomatic theory)

4 of 63

slide-5
SLIDE 5

Explicit computability

  • Turing machine computing (partial) functions
  • Kleene’s first model (natural numbers are codes for machines

which act on numbers)

  • Oracle computability (jump operators)
  • Combinatory and λ-algebras
  • Domain theory models.

5 of 63

slide-6
SLIDE 6

Implicit computability

  • Axiomatic/logic approaches to computability ...
  • Combinatory logic and λ-calculus ...
  • Turing categories

Turing categories = abstract computability MANY non-standard models!! ... all models are Turing categories.

6 of 63

slide-7
SLIDE 7

Explicit versus implicit

EXPLICIT COMPLEXITY

(particular model)

  • IMPLICIT

COMPLEXITY

(axiomatic theory)

7 of 63

slide-8
SLIDE 8

Explicit complexity

  • Time complexity: counting the ticks of a Turing/computing

machine

  • Space complexity: counting the storage required by a

Turing/computing machine Want these notions to be independent of the machine model ... Are they? Well not really! e.g. Turing machine versus pointer models at low complexity

8 of 63

slide-9
SLIDE 9

Implicit complexity

Why do it?

  • Theoretical understanding of complexity ...

wide variety of different models relationship between different models correspondence between axiomatic features and complexity

  • Type checking for complexity

real-time applications ...

9 of 63

slide-10
SLIDE 10

This talk looks at the explicit models complexity theorists themselves use!!! but with categorical eyes! Part of the program of abstract computability: unifies complexity and computability.

10 of 63

slide-11
SLIDE 11

Functional Complexity in a Timed Maps “Universe”

11 of 63

slide-12
SLIDE 12

Functional Complexity in a Timed Maps “Universe”

A surprise connection between partiality and complexity A categorical model/semantics of basic complexity theory A construction that builds models of computability whose total maps are precisely the maps of a given functional complexity class: P-time, Log-space, and above ... I.e. mimic what complexity theorists do ... BUT with categorical eyes.

12 of 63

slide-13
SLIDE 13

The timing of a partial map as a primitive

Start with a notion of timing/costing a partial map: A

f

  • |·|f
  • B

N f (x) ↓ ⇔ |x|f ↓

  • A partial function f may have different timings
  • Think of each timing as the cost (time/space/resource) of

computing f by an algorithm

13 of 63

slide-14
SLIDE 14

ASIDE: What is cost?

We shall assume cost is a natural number BUT the theory works more generally! A size monoid is a partially ordered commutative monoid (M, 0, +, ≤) such that

  • 0 ≤ x for all x ∈ M,
  • x ≤ x′ and y ≤ y′ implies x + y ≤ x′ + y′.

Examples: N,R≥0, N × N... In fact, given any commutative monoid A set x ≤ y if there is a z with x + z = y then x ∼ y ≡ x ≤ y&y ≤ x then size(A) = A/ ∼ is the universal size monoid associated with A. Note: size monoids are orthogonal to commutative groups.

14 of 63

slide-15
SLIDE 15

The Category of Timed Sets

TSet:

  • Objects: Sets
  • Maps: Timed partial functions
  • Identity: The identity function with 0 cost
  • Composition:

A

f

  • |·|f
  • B

g

  • |·|g
  • C

N N = A

fg

  • |·|f +|f (·)|g
  • C

N

15 of 63

slide-16
SLIDE 16

The Category of Timed Sets

Too restrictive ... Two maps are equal only if their timing are exactly the same ... Need to capture O( ) the order of complexity ...

16 of 63

slide-17
SLIDE 17

Complexity Orders

An additive complexity order C is a class of monotone functions P : N − → N such that C is:

  • down-closed: P ∈ C and Q ≤ P then Q ∈ C;
  • closed to composition: if P, Q in C then PQ ∈ C;
  • additive: 0 ∈ C and if P, Q ∈ C then P + Q ∈ C.

17 of 63

slide-18
SLIDE 18

Examples of complexity orders

Linear: L = λx.nx|n ∈ N Polynomial: P =

  • λx.

n

  • i=1

aixi|n ∈ N

  • Where denotes down-closure.

18 of 63

slide-19
SLIDE 19

C-ordering

Every complexity order C induces a preorder enrichment on the maps

  • f TSet, f ≤C g:
  • g(x) ↓ implies f (x) ↓ and g(x) = f (x);
  • there is a P ∈ C such that for all x, |x|f ≤ P(|x|g).

19 of 63

slide-20
SLIDE 20

C-equivalence

C-equivalence is the congruence f =C g if: f ≤C g and g ≤C f E.g. f =L g if |x|f ≤ m|x|g and |x|g ≤ n|x|f

20 of 63

slide-21
SLIDE 21

Partiality: Restriction Categories

For each map f : A − → B: a restriction idempotent f : A − → A such that [R.1] f f = f [R.3] f g = f g [R.2] f g = g f [R.4] f h = fh f

  • A general framework for partiality [Cockett and Lack 2002]

E.g. Sets and partial functions: f is domain of definition

  • P-categories [Robinson and Rosolini 1988]
  • Influential paper by Robert Di Paola and Alex Heller on “dominical

categories” (1986) initiates abstract computability.

21 of 63

slide-22
SLIDE 22

Totality in Restriction Category

Recall that a map in a restriction category is total in case f = 1.

22 of 63

slide-23
SLIDE 23

Timed Sets and Restriction Structure

For TSet, the desired restriction is (f , |·|f ) = (f , |·|f ). However, this is not a restriction structure since [R.1] fails: (f , |·|f ) (f , |·|f ) = (f , |·|f + |·|f ) = (f , |·|f )

23 of 63

slide-24
SLIDE 24

The Restriction Category of Timed Sets

TSet may be quotiented by the congruence =C. Proposition. For any complexity order C, TSet/C is a restriction category where (f , |·|f ) = (f , |·|f ).

24 of 63

slide-25
SLIDE 25

Linking Complexity Order and Partiality

Every restriction category is partial order enriched by f ≤ g: f g = f . Lemma. In TSet/C, f ≤ g if and only if g ≤C f .

25 of 63

slide-26
SLIDE 26

Iteration in a restriction category f ⋆ g :

f ng (for at most one n) Intuitively g ⊔ fg ⊔ ffg ⊔ · · ·

26 of 63

slide-27
SLIDE 27

Iteration in a restriction category Iterate(f,g)(x) = while (x in dom(f)) x := f (x) g(x)

Iteration: one way to obtain computability ...

27 of 63

slide-28
SLIDE 28

Disjoint joins

Proposition. For every C, TSet/C has disjoint joins. What does that mean?

28 of 63

slide-29
SLIDE 29

Disjoint joins

Disjointness, means that “domains” do not overlap f g = ∅ The join of disjoint maps f , g is the join, ⊔, with respect to ≤. Must also be ”stable” with respect to composition: h(f ⊔ g) = hf ⊔ hg

29 of 63

slide-30
SLIDE 30

Disjoint joins and iteration

Need disjoint joins for iteration ... f ⋆ g = g ⊔ fg ⊔ ffg ⊔ · · · =

  • n

f ng Also need

  • n

f ng =C

  • n

f ′ng′ whenever f =C f ′ and g =C g′. This requires the complexity order satisfy an extra laxness condition ...

30 of 63

slide-31
SLIDE 31

Distributive Restriction Categories

  • Proposition. [Cockett and Lack 2007]

For a restriction category Distributivity ⇒ Extensiveness ⇒ Disjoint Joins

31 of 63

slide-32
SLIDE 32

The Distributive Restriction Category of Timed Sets

Proposition. For every complexity order C, TSet/C is a distributive restriction cate- gory.

32 of 63

slide-33
SLIDE 33

TSet/C has a restriction terminal object

1 = {⋆} is the restriction terminal object. !A : A − → 1 is always defined and has zero cost. Thus, for any f : A − → 1, f = f !A

33 of 63

slide-34
SLIDE 34

Restriction products

The binary restriction product of A, B is A × B with total projections π0, π1 and a unique pairing such that in U

g

  • f
  • f ,g
  • A

A × B

π0

  • π1

B

f , g π0 = g f and f , g π1 = f g.

34 of 63

slide-35
SLIDE 35

TSet/C has restriction products

A × B is as in Sets. Projections, π, are always defined and have zero cost. (f , |·|f ), (g, |·|g) := (f , g , |·|f ,g) where |x|f ,g := |x|f + |x|g

35 of 63

slide-36
SLIDE 36

TSet/C has an initial object

0 = ∅ is the initial object. Note also that TSet/C has nowhere defined maps: ∅ := (∅, ∅) : A − → B

36 of 63

slide-37
SLIDE 37

TSet/C has coproducts

A + B is as in Sets. Coprojections σ are always defined and have zero cost. [(f , |·|f ), (g, |·|g)] = ([f , g] , |·|[f ,g]) where |·|[f ,g] = [|·|f , |·|g]

37 of 63

slide-38
SLIDE 38

TSet/C is distributive

The map [A + σB, A + σC] : (A × B) + (A × C) − → A × (B + C) is an isomorphism in Sets, and is zero cost.

38 of 63

slide-39
SLIDE 39

Iteration

f : A − → A g : A − → B f , g disjoint f ⋆ g : A − → B where [Conway 1971]: W.1 (fg) ⋆ h = h ⊔ f ((gf ) ⋆ (gh)) W.2 (f ⊔ g) ⋆ h = (f ⋆ g) ⋆ (f ⋆ h) W.3 (f ⋆ g)h = f ⋆ (gh) W.4 1 × (f ⋆ g) = (1 × f ) ⋆ (1 × g) W.5 f ≤ f ′, g ≤ g′ then f ⋆ g ≤ f ′ ⋆ g′ For example W.1: f ⋆ h = h ⊔ f (f ⋆ h) = h ⊔ f (h ⊔ f (f ⋆ h)) = h ⊔ fh ⊔ f 2(f ⋆ h) = · · ·

39 of 63

slide-40
SLIDE 40

Iteration in TSet/C

Definition. A complexity order C is lax if it is generated by functions P, P(m) + P(n) ≤ P(m + n) Proposition. If C is lax, then TSet/C has iteration Both L and P are lax ..

40 of 63

slide-41
SLIDE 41

Iteration in TSet/C

Given disjoint timed maps f : A − → A, g : A − → B, f ⋆ g(x) :=

  • g(f n(x))

∃n.f n ∈ g ↑ else where the cost is |x|f ⋆g :=     

n−1

  • i=0

|f i(x)|f + |f n(x)|g ∃n.f n ∈ g ↑ else

41 of 63

slide-42
SLIDE 42

Structural Recap

The basic structural ingredients for building a simple model of complexity:

  • Timed functions
  • C-equivalence
  • Distributivity
  • Iteration

42 of 63

slide-43
SLIDE 43

Additional Structure

Discreteness: the map ∆ : A − → A × A has a partial inverse: ∆−1(x, y) =

  • x

x = y ↑ else Ranges: restriction idempotents that act on the codomain; provides the image. Finite Joins: If f g = g f , then the stable join with respect to ≤ of f , g exists.

43 of 63

slide-44
SLIDE 44

Total maps

Problems: The total maps are zero cost maps (f , |·|f ) = 1 if, in particular, there is a P such that |·|f ≤ P(0) = 0. However, “running time” should be a function of input size.

44 of 63

slide-45
SLIDE 45

Restriction Idempotents in TSet/C

A restriction idempotent is a timed partial identity Restriction idempotents can be thought of as measuring the size of the input.

45 of 63

slide-46
SLIDE 46

Restriction Idempotents Splitting of TSet/C

An object in Split(TSetC) is a sized set e = (A, |·|e) A map f : e − → e′ is a timed map such that efe′ =C f : |x|e + |x|f + |f (x)|e′ ≤ P(|x|f ) Intuitively a function cannot be “faster” than the time required to read its input and produce its output!!

46 of 63

slide-47
SLIDE 47

Linking Complexity and Totality

Recall, in a restriction category, f is total if f = 1. In the restriction idempotent splitting: f : e − → e′ is total iff e = f In Split(TSetC), what doe this mean? P(|x|e) ≥ |x|f f is C-bounded by the size of its input. i.e. total maps are exactly the “C-timed” maps!!!

47 of 63

slide-48
SLIDE 48

The structure in Split(TSetC)

All the structure lifts to the idempotent splitting. Theorem. Split(TSetC) is a distributive restriction category with iteration where the total maps are precisely those with C-cost.

48 of 63

slide-49
SLIDE 49

Sizes are non-zero ..

Elements with zero size have no impact on complexity! How do we ensure all sizes are non-zero? Answer: Move to the slice Split(TSet/C)/⋆. ⋆ is the subobject 1 = {()} determined by the idempotent ⋆ : 1 − → 1 where |()|⋆ = 1. Lemma If C is a pointed complexity order an object Y ∈ Split(TSet/C) has a total map to ⋆ if and only if each element of Y has a non-zero size.

49 of 63

slide-50
SLIDE 50

Computability

The total maps in Split(TSet/P)/⋆ are by no means the standard PTIME maps of complexity theory:!

  • Not computable
  • Their P-timing are arbitrarily assigned.

To obtain a standard notion of say PTIME maps we must demand that the maps are realized by a machine. E.g. by a Turing machine with the standard timing. Shall show how this gives a Turing category whose total maps are precisely PTIME maps.

50 of 63

slide-51
SLIDE 51

Powerful and program objects

A is a powerful object in case there are total maps s× : A × A − → A and partial maps P0, P1 : A − → A such that sx P0, P1 = 1A×A. A non-trivial powerful object is List(Bool) with size given by x = 1 + 2 · len(x). There are then linear time maps s×, P0, and P1 which code and decode pairs:

s×(b:bs,b′:bs′)=1:b:1:b′:s×(bs,bs′) P0(1:b: : :rs) = b:P0(rs) s×([], b′ :bs′) = 0:0:1:b′ :s×([],bs′) P0(0 : 0 : : : rs) = [] s×(b : bs, []) = 1 : b : 0 : 0 : s×(bs, []) P1( : :1:b′ : :rs′) = b′ :P1(rs′) P1( : : 0 : 0 : rs′) = []

51 of 63

slide-52
SLIDE 52

Powerful and program objects

Given a powerful object A, an A-program object is an object P which has total operations comp, pair : P × P − → P together with total points Q0, Q1, Q : 1 − → P and a partial evaluation map ev : P × A − → A such that: A

Q,1 P × A ev

  • A

A

Q0,1A

  • P0
  • P × A

ev

A

P × P × A

1×ev

  • comp×1 P × A

ev

  • P × A

ev

A

A

Q1,1A

  • P1
  • P × A

ev

A

52 of 63

slide-53
SLIDE 53

Powerful and program objects

P × P × A

π0,π2,π1,π2

  • pair×1

P × A

ev

  • P × A × P × A

ev×ev

  • A × A

A

We shall say that P is a machine program object in case ev = step ⋆ halt where step ∨ halt = 1P×A. In other words ev is a trace of a machine transition which is total.

53 of 63

slide-54
SLIDE 54

Powerful and program objects

A map f : A − → A is said to be P-programmable in case there is an element ⌈f ⌉ : 1 − → P such that P × A ev

A

A

⌈f ⌉,1A

  • f
  • If X and Y are (particular) retracts of A then a map h : X −

→ Y is P-programmable if the map A

rX

− − → X

h

− − → Y

sY

− − → A is programmable. Theorem If A is an inhabited powerful object in X and P is an A-program

  • bject, then the subcategory of P-programmable maps, ProgP(X), on

powers of A forms a cartesian restriction subcategory.

54 of 63

slide-55
SLIDE 55

Turing structure

An object T, in a cartesian restriction category, is a Turing object in case:

  • Every object in the category is a retract of T.
  • There is an application map, also called a Turing morphism,
  • : T × T −

→ T such that for every (partial) map f : T × T − → T there is a total map f : A − → T such that: T × T

  • T

T × T

  • f ×1T
  • f
  • A cartesian category with a Turing object is a Turing category:

these provide a unifying formulation of abstract computability. When does an A-program object P make A a Turing object?

55 of 63

slide-56
SLIDE 56

Turing structure

Theorem If X is a cartesian restriction category with an inhabited powerful

  • bject A and an A-programming object P such that P is a retract of

A and comp, pair, ev, Q0, Q1, and Q are all P-programmable then ProgP(X) is a Turing category.

56 of 63

slide-57
SLIDE 57

Turing structure

Define the program q := ⌈P0, P1 f ⌉ then A × A

P0,P1×1

A × A × A

1×s×

  • rP×s×
  • A × A × A

s××1

  • 1×s×

A × A

rp×1

P × A

ev

  • P × A

sP×1

  • ev

A

A × A

  • (qsP)×1×1
  • A

q×1

  • P0,P1

A × A

f

  • where (q × 1)sPs× is the required total map and
  • := (P0, p1 × 1)(rP × s×)ev.

57 of 63

slide-58
SLIDE 58

Turing Categories and Total Maps

Theorem. The maps that are computable by a Turing machine within P-time in Split(TSetP) form a Turing category, TP, whose Total maps are the P-time maps. Theorem. The maps that are computable on a Transducer within Log-space in Split(TSetL) form a Turing category, TLg, whose Total maps are the Log-space maps.

58 of 63

slide-59
SLIDE 59

Turing Categories and Total Maps

Proof. Turing machines can be composed and paired in P-time in the size of their inputs. For evaluation use the fact that a universal Turing machine can simulate any Turing machine with just a polynomial overhead.

59 of 63

slide-60
SLIDE 60

From Log-space to P-time

There is a restriction preserving functor over Par between the above Turing categories: TLg

  • V

TP

  • Par

Recall that if T runs in Space(S) then it runs in at most Time(2S).

60 of 63

slide-61
SLIDE 61

And back again?

TLg

  • V

TP

?

  • Par

V is an isomorphism if and only if P-time = Log-space. If P-time and Log-space are equal, then for all T: Time(T) is Space(Log(T)). Open complexity problem ....

61 of 63

slide-62
SLIDE 62

In Conclusion

Ideas in complexity can now be translated into categorical notions. Open complexity problems have been re-expressed into categorical questions. There are Turing categories whose total maps are precisely those of functional complexity classes. Abstract computability unifies complexity and computability ....

62 of 63

slide-63
SLIDE 63

In Conclusion

For more: Robin Cockett, Joaquin Diaz-Bols, Jonathan Gallagher, Pavel Hrubes “Timed Sets, Functional Complexity, and Computability” Electronic Notes in Theoretical Computer Science Volume 286, 24 September 2012, Pages 117–137.

63 of 63