Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull...

79
Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Transcript of Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull...

Page 1: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Developing Disciplined ProgramsSeminar at the James M. Hull College of Business

Clément Aubert

Augusta University30th January 2017

Page 2: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Introduction: What is the problem with my program?

program+

data

program+

data

answer

execution

code compilation

programming languagecoding

— operating system

— network

— hardware

— operating system

— network

— hardware

user-side

programmer-side

2

Page 3: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Introduction: What is the problem with my program?

program+

data

program+

data

answer

execution

code compilation

programming languagecoding

— operating system

— network

— hardware

— operating system

— network

— hardware

user-side

programmer-side

2

Page 4: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Introduction: What is the problem with my program?

program+

data

program+

data

answer

execution

code compilation

programming languagecoding

— operating system

— network

— hardware

— operating system

— network

— hardware

user-side

programmer-side

2

Page 5: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Introduction: What is the problem with my program?

program+

data

program+

data

answer

execution

code compilation

programming languagecoding

— operating system

— network

— hardware

— operating system

— network

— hardware

user-side

programmer-side

2

Page 6: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Introduction: What is the problem with my program?

program+

data

program+

data

answer

execution

code compilation

programming languagecoding

— operating system

— network

— hardware

— operating system

— network

— hardware

user-side

programmer-side

2

Page 7: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Introduction: What is the problem with my program?

program+

data

program+

data

answer

execution

code compilation

programming languagecoding

— operating system

— network

— hardware

— operating system

— network

— hardware

user-side

programmer-side

2

Page 8: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Introduction: What is the problem with my program?

program+

data

program+

data

answer

execution

code compilation

programming languagecoding

— operating system

— network

— hardware

— operating system

— network

— hardware

user-side

programmer-side

2

Page 9: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Introduction: What is the problem with my program?

program+

data

program+

data

answer

execution

code compilation

programming languagecoding

— operating system

— network

— hardware

— operating system

— network

— hardware

user-side

programmer-side

2

Page 10: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Introduction: What is the problem with my program?

program+

data

program+

data

answer

execution

code compilation

programming languagecoding

— operating system

— network

— hardware

— operating system

— network

— hardware

user-side

programmer-side

2

Page 11: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Developing Disciplined ProgramsSeminar at the James M. Hull College of Business

Clément Aubert

Augusta University30th January 2017

Page 12: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Developing Disciplined Programing LanguagesSeminar at the James M. Hull College of Business

Clément Aubert

Augusta University30th January 2017

Page 13: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Introduction: Type Theory

Program 1

Program 2

Data

Boolean (output)Integer (output)

Boolean (input)Integer (input)

5

Page 14: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Introduction: Type Theory

Program 1

Program 2

Data

Boolean (output)Integer (output)

Boolean (input)Integer (input)

5

Page 15: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Introduction: Type Theory

Program 1

Program 2

Data

Boolean (output)Integer (output)

Boolean (input)Integer (input)

5

Page 16: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Introduction: Type Theory

⊢ Program 1 : Bool → Int

⊢ Program 2 : Int → Bool ⊢ data : Int

⊢ Program 2 (data) : Bool

⊢ Program1 (Program 2 (data)) : Int

«

⊢ Bool → Int⊢ Int → Bool ⊢ Int

⊢ Bool⊢ Int

«

⊢x Bool → Int

⊢y Int → Bool ⊢z Int

⊢y+z+c Bool

⊢y+z+c+x+c′ Int

6

Page 17: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Introduction: Type Theory

⊢ Program 1 : Bool → Int

⊢ Program 2 : Int → Bool ⊢ data : Int

⊢ Program 2 (data) : Bool

⊢ Program1 (Program 2 (data)) : Int

«

⊢ Bool → Int⊢ Int → Bool ⊢ Int

⊢ Bool⊢ Int

«

⊢x Bool → Int

⊢y Int → Bool ⊢z Int

⊢y+z+c Bool

⊢y+z+c+x+c′ Int

6

Page 18: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Introduction: Type Theory

⊢ Program 1 : Bool → Int

⊢ Program 2 : Int → Bool ⊢ data : Int

⊢ Program 2 (data) : Bool

⊢ Program1 (Program 2 (data)) : Int

«

⊢ Bool → Int⊢ Int → Bool ⊢ Int

⊢ Bool⊢ Int

«

⊢x Bool → Int

⊢y Int → Bool ⊢z Int

⊢y+z+c Bool

⊢y+z+c+x+c′ Int

6

Page 19: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Introduction: Computational Complexity

Explicit

Computational Complexity— Sort problem by their difficulty

— Order of magnitude

— Benchmark: Turing Machine

Complete ProblemsLogarithmic Space (L): Acyclicity in undirected graphNon-Deterministic Logarithmic Space (NL): Acyclicity in directedgraphPolynomial Time (Ptime): Circuit value problem

— Machine-dependent

— “External” clock and “external” measure on the tape

7

Page 20: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Introduction: Computational Complexity

Explicit

Computational Complexity— Sort problem by their difficulty

— Order of magnitude

— Benchmark: Turing Machine

Complete ProblemsLogarithmic Space (L): Acyclicity in undirected graphNon-Deterministic Logarithmic Space (NL): Acyclicity in directedgraphPolynomial Time (Ptime): Circuit value problem

— Machine-dependent

— “External” clock and “external” measure on the tape

7

Page 21: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Introduction: Computational Complexity

Explicit

Computational Complexity— Sort problem by their difficulty

— Order of magnitude

— Benchmark: Turing Machine

Complete ProblemsLogarithmic Space (L): Acyclicity in undirected graphNon-Deterministic Logarithmic Space (NL): Acyclicity in directedgraphPolynomial Time (Ptime): Circuit value problem

— Machine-dependent

— “External” clock and “external” measure on the tape

7

Page 22: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Introduction: Computational Complexity

Explicit

Computational Complexity— Sort problem by their difficulty

— Order of magnitude

— Benchmark: Turing Machine

Complete ProblemsLogarithmic Space (L): Acyclicity in undirected graphNon-Deterministic Logarithmic Space (NL): Acyclicity in directedgraphPolynomial Time (Ptime): Circuit value problem

— Machine-dependent

— “External” clock and “external” measure on the tape

7

Page 23: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Introduction: Computational Complexity

Explicit Computational Complexity— Sort problem by their difficulty

— Order of magnitude

— Benchmark: Turing Machine

Complete ProblemsLogarithmic Space (L): Acyclicity in undirected graphNon-Deterministic Logarithmic Space (NL): Acyclicity in directedgraphPolynomial Time (Ptime): Circuit value problem

— Machine-dependent

— “External” clock and “external” measure on the tape

7

Page 24: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Introduction: Implicit Computational Complexity

(Dal Lago, 2011, p. 90)(lacl.fr/~caubert/AU/)

Implicit Computational Complexity (ICC)— Machine-independent

— Without explicit bounds

Some Achievements— Fine-grained type systems for Ptime, L, NL, Pspace, etc.

— Differential privacy (Gaboardi et al., 2013)

— Computation over the reals (Férée et al., 2015)

8

Page 25: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Introduction: Implicit Computational Complexity

(Dal Lago, 2011, p. 90)(lacl.fr/~caubert/AU/)

Implicit Computational Complexity (ICC)— Machine-independent

— Without explicit bounds

Some Achievements— Fine-grained type systems for Ptime, L, NL, Pspace, etc.

— Differential privacy (Gaboardi et al., 2013)

— Computation over the reals (Férée et al., 2015)

8

Page 26: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Introduction: Implicit Computational Complexity

(Dal Lago, 2011, p. 90)(lacl.fr/~caubert/AU/)

Implicit Computational Complexity (ICC)— Machine-independent

— Without explicit bounds

Some Achievements— Fine-grained type systems for Ptime, L, NL, Pspace, etc.

— Differential privacy (Gaboardi et al., 2013)

— Computation over the reals (Férée et al., 2015)

8

Page 27: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

1 IntroductionWhat is the problem with my program?Type TheoryComputational ComplexityImplicit Computational Complexity

2 Automata and ICC

3 Logic Programming

4 A New Correspondence

5 Perspectives

Page 28: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

1 Introduction

2 Automata and ICCWhat is ICC, really?DefinitionsMain Characterizations

3 Logic Programming

4 A New Correspondence

5 Perspectives

Page 29: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Automata and ICC: What is ICC, really?

Machine-dependent

Machine-independent

Exp

licit

boun

ds

Turing machine,Random access machine,Counter machine, . . .

Bounded recursion on notation (Cobham, 1965),Bounded linear logic (Girard et al., 1992),Bounded arithmetic (Buss, 1986), . . .

Impl

icit

boun

ds

Automaton,Auxiliary pushdown machine,. . .

Descriptive complexity (Fagin, 1973),Recursion on notation (Bellantoni and Cook, 1992),Tiered recurrence (Leivant, 1993), . . .

(Girard et al., 1992, p. 18)

(Ibarra, 1971, p. 88)

11

Page 30: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Automata and ICC: What is ICC, really?

Machine-dependent Machine-independent

Exp

licit

boun

ds

Turing machine,Random access machine,Counter machine, . . .

Bounded recursion on notation (Cobham, 1965),Bounded linear logic (Girard et al., 1992),Bounded arithmetic (Buss, 1986), . . .

Impl

icit

boun

ds

Automaton,Auxiliary pushdown machine,. . .

Descriptive complexity (Fagin, 1973),Recursion on notation (Bellantoni and Cook, 1992),Tiered recurrence (Leivant, 1993), . . .

(Girard et al., 1992, p. 18)

(Ibarra, 1971, p. 88)

11

Page 31: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Automata and ICC: What is ICC, really?

Machine-dependent Machine-independent

Exp

licit

boun

ds

Turing machine,Random access machine,Counter machine, . . .

Bounded recursion on notation (Cobham, 1965),Bounded linear logic (Girard et al., 1992),Bounded arithmetic (Buss, 1986), . . .

Impl

icit

boun

ds

Automaton,Auxiliary pushdown machine,. . .

Descriptive complexity (Fagin, 1973),Recursion on notation (Bellantoni and Cook, 1992),Tiered recurrence (Leivant, 1993), . . .

(Girard et al., 1992, p. 18)

(Ibarra, 1971, p. 88)

11

Page 32: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Automata and ICC: What is ICC, really?

Machine-dependent Machine-independent

Exp

licit

boun

ds

Turing machine,Random access machine,Counter machine, . . .

Bounded recursion on notation (Cobham, 1965),Bounded linear logic (Girard et al., 1992),Bounded arithmetic (Buss, 1986), . . .

Impl

icit

boun

ds

Automaton,Auxiliary pushdown machine,. . .

Descriptive complexity (Fagin, 1973),Recursion on notation (Bellantoni and Cook, 1992),Tiered recurrence (Leivant, 1993), . . .

(Girard et al., 1992, p. 18)

(Ibarra, 1971, p. 88)

11

Page 33: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Automata and ICC: What is ICC, really?

Machine-dependent Machine-independent

Exp

licit

boun

ds

Turing machine,Random access machine,Counter machine, . . .

Bounded recursion on notation (Cobham, 1965),Bounded linear logic (Girard et al., 1992),Bounded arithmetic (Buss, 1986), . . .

Impl

icit

boun

ds

Automaton,Auxiliary pushdown machine,. . .

Descriptive complexity (Fagin, 1973),Recursion on notation (Bellantoni and Cook, 1992),Tiered recurrence (Leivant, 1993), . . .

(Girard et al., 1992, p. 18)

(Ibarra, 1971, p. 88)

11

Page 34: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Automata and ICC: What is ICC, really?

Machine-dependent Machine-independent

Exp

licit

boun

ds

Turing machine,Random access machine,Counter machine, . . .

Bounded recursion on notation (Cobham, 1965),Bounded linear logic (Girard et al., 1992),Bounded arithmetic (Buss, 1986), . . .

Impl

icit

boun

ds

Automaton,Auxiliary pushdown machine,. . .

Descriptive complexity (Fagin, 1973),Recursion on notation (Bellantoni and Cook, 1992),Tiered recurrence (Leivant, 1993), . . .

(Girard et al., 1992, p. 18)

(Ibarra, 1971, p. 88)

11

Page 35: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Automata and ICC: What is ICC, really?

Machine-dependent Machine-independent

Exp

licit

boun

ds

Turing machine,Random access machine,Counter machine, . . .

Bounded recursion on notation (Cobham, 1965),Bounded linear logic (Girard et al., 1992),Bounded arithmetic (Buss, 1986), . . .

Impl

icit

boun

ds

Automaton,Auxiliary pushdown machine,. . .

Descriptive complexity (Fagin, 1973),Recursion on notation (Bellantoni and Cook, 1992),Tiered recurrence (Leivant, 1993), . . .

(Girard et al., 1992, p. 18)

(Ibarra, 1971, p. 88)

11

Page 36: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Automata and ICC: Definitions

2NFA(k,p)For k ⩾ 1, p ⩾ 0, a 2-way non-deterministic finite automaton withk-heads and p pushdown stacks is a tupleM = {S,A,B,⊳,⊲,⊡, σ} where:

— S is the finite set of states;

— A is the input alphabet, B is the stack alphabet;

— ⊳ and ⊲ are the left and right endmarkers, ⊳,⊲∉ A;

— ⊡ is the bottom symbol of the stack, ⊡ ∉ B;

—σ ⊆ (S × (A ∪ {⊳,⊲})k × (B ∪ {⊡})p)× (S × {−1,0,+1}k × {pop,peek,push(b)}p)

2NFA(k,p) = {L(M) ∣ M a 2NFA(k,p)}2NFA(∗,p) = ∪k⩾12NFA(k,p)

12

Page 37: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Automata and ICC: Main Characterizations

Main characterizationsAutomata Language / Predicate

2NFA(1,2) Computable2NFA(∗,1) Polynomial time (Ptime)2NFA(∗,0) Non-Deterministic Logarithmic space (NL)2NFA(1,1) Context-free2NFA(1,0) Regular

QuestionCan we use those results to develop disciplined programinglanguages?

13

Page 38: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Automata and ICC: Main Characterizations

Main characterizationsAutomata Language / Predicate

2NFA(1,2) Computable2NFA(∗,1) Polynomial time (Ptime)2NFA(∗,0) Non-Deterministic Logarithmic space (NL)2NFA(1,1) Context-free2NFA(1,0) Regular

QuestionCan we use those results to develop disciplined programinglanguages?

13

Page 39: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

1 Introduction

2 Automata and ICC

3 Logic ProgrammingRemindersFirst-order TermsFlows and WiringsSubsets of Flows

4 A New Correspondence

5 Perspectives

Page 40: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Logic Programming: Reminders

Logic Programming— A programming paradigm

— Computation = unification

— Turing-complete

Used in . . .— Prolog, Datalog

— Type-inference in Haskell and ML

— Models of Linear Logic (Baillot and Pedicini, 2001; Girard,2013)

15

Page 41: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Logic Programming: Reminders

Logic Programming— A programming paradigm

— Computation = unification

— Turing-complete

Used in . . .— Prolog, Datalog

— Type-inference in Haskell and ML

— Models of Linear Logic (Baillot and Pedicini, 2001; Girard,2013)

15

Page 42: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Logic Programming: First-order Terms

First-order termst ,u := c,d, . . . ∈ C

∣ x ,y ,z, . . . ∈ V∣ An(t1, . . . , tn) n ∈ N∗

∣ t ●u with t ●u ●v := t ●(u ●v)

Example

x A1

c

A2

y y

A1

z

x ●A1(c) A2(y ,y) ●A1(z)

16

Page 43: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Logic Programming: First-order Terms

First-order termst ,u := c,d, . . . ∈ C

∣ x ,y ,z, . . . ∈ V∣ An(t1, . . . , tn) n ∈ N∗

∣ t ●u with t ●u ●v := t ●(u ●v)

Example

x A1

c

A2

w w

A1

z

x ●A1(c) A2(w ,w) ●A1(z)

16

Page 44: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Logic Programming: First-order Terms

First-order termst ,u := c,d, . . . ∈ C

∣ x ,y ,z, . . . ∈ V∣ An(t1, . . . , tn) n ∈ N∗

∣ t ●u with t ●u ●v := t ●(u ●v)

Example

x A1

c

A2

w w

A1

z

x ●A1(c) A2(w ,w) ●A1(z) Unifiable?

16

Page 45: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Logic Programming: First-order Terms

First-order termst ,u := c,d, . . . ∈ C

∣ x ,y ,z, . . . ∈ V∣ An(t1, . . . , tn) n ∈ N∗

∣ t ●u with t ●u ●v := t ●(u ●v)

Example

x A1

c

A2

w w

A1

z

x ●A1(c) A2(w ,w) ●A1(z) Unifiable?

θ = [x ← A2(w ,w);z ← c]

16

Page 46: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Logic Programming: First-order Terms

First-order termst ,u := c,d, . . . ∈ C

∣ x ,y ,z, . . . ∈ V∣ An(t1, . . . , tn) n ∈ N∗

∣ t ●u with t ●u ●v := t ●(u ●v)

Example

x A1

c

A2

w w

A1

d

x ●A1(c) A2(w ,w) ●A1(d) Unifiable?

×

c ≠ d

16

Page 47: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Logic Programming: Flows and Wirings

Flows and WiringsA flow is a pair of terms t ↼ u with Var(t) ⊆ Var(u).A wiring is a finite set of flows.

Composition of FlowsLet u ↼ v and t ↼ w be two flows, Var(v) ∩ Var(w) = ∅,

(u ↼ v)(t ↼ w) :=⎧⎪⎪⎨⎪⎪⎩

uθ ↼ wθ if vθ = tθ

undefined otherwise

Examples(f(x)↼ x)(f(y)↼ g(y)) = f(f(y))↼ g(y)

(x ●c↼ (y ●y) ●x)((c ●c) ●x ↼ y ●x) = x ●c↼ c ●x

17

Page 48: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Logic Programming: Flows and Wirings

Flows and WiringsA flow is a pair of terms t ↼ u with Var(t) ⊆ Var(u).A wiring is a finite set of flows.

Composition of FlowsLet u ↼ v and t ↼ w be two flows, Var(v) ∩ Var(w) = ∅,

(u ↼ v)(t ↼ w) :=⎧⎪⎪⎨⎪⎪⎩

uθ ↼ wθ if vθ = tθ

undefined otherwise

Examples(f(x)↼ x)(f(y)↼ g(y)) = f(f(y))↼ g(y)

(x ●c↼ (y ●y) ●x)((c ●c) ●x ↼ y ●x) = x ●c↼ c ●x

17

Page 49: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Logic Programming: Flows and Wirings

Flows and WiringsA flow is a pair of terms t ↼ u with Var(t) ⊆ Var(u).A wiring is a finite set of flows.

Composition of FlowsLet u ↼ v and t ↼ w be two flows, Var(v) ∩ Var(w) = ∅,

(u ↼ v)(t ↼ w) :=⎧⎪⎪⎨⎪⎪⎩

uθ ↼ wθ if vθ = tθ

undefined otherwise

Examples(f(x)↼ x)(f(y)↼ g(y)) = f(f(y))↼ g(y)

(x ●c↼ (y ●y) ●x)((c ●c) ●x ↼ y ●x) = x ●c↼ c ●x

17

Page 50: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Logic Programming: Subsets of Flows

BalancedA flow f = t ↼ u is balanced if for any x ∈ Var(t) ∪ Var(u), alloccurrences of x in both t and u have the same height.

Examples●

y A1

y

A2

x y

A1

y

↼ ×

UnaryA flow is unary if it is built using only unary function symbols anda variable.

18

Page 51: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Logic Programming: Subsets of Flows

BalancedA flow f = t ↼ u is balanced if for any x ∈ Var(t) ∪ Var(u), alloccurrences of x in both t and u have the same height.

Examples●

x A1

y

A2

x y

A1

y

↼ ×

UnaryA flow is unary if it is built using only unary function symbols anda variable.

18

Page 52: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Logic Programming: Subsets of Flows

BalancedA flow f = t ↼ u is balanced if for any x ∈ Var(t) ∪ Var(u), alloccurrences of x in both t and u have the same height.

Examples●

c A1

y

A2

x y

A1

y

↼ ✓

UnaryA flow is unary if it is built using only unary function symbols anda variable.

18

Page 53: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Logic Programming: Subsets of Flows

BalancedA flow f = t ↼ u is balanced if for any x ∈ Var(t) ∪ Var(u), alloccurrences of x in both t and u have the same height.

Examples●

c A1

y

A2

x y

A1

y

↼ ✓

UnaryA flow is unary if it is built using only unary function symbols anda variable.

18

Page 54: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

1 Introduction

2 Automata and ICC

3 Logic Programming

4 A New CorrespondenceNew ResultsNew Connexions

5 Perspectives

Page 55: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

A New Correspondence: New Results

NL

2NFA(∗,0) Acyclicityin directed graph

Balanced Flows

Completeness Soundness

20

Page 56: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

A New Correspondence: New Results

NL

2NFA(∗,0) Acyclicityin directed graph

Balanced Flows

Completeness Soundness

20

Page 57: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

A New Correspondence: New Results

NL

2NFA(∗,0) Acyclicityin directed graph

Balanced Flows

Completeness Soundness

20

Page 58: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

A New Correspondence: New Results

NL

2NFA(∗,0) Acyclicityin directed graph

Balanced Flows

Completeness Soundness

20

Page 59: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

A New Correspondence: New Results

Ptime

2NFA(∗,1)

Balanced and UnaryFlows

Completeness

Soundness

21

Page 60: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

A New Correspondence: New Results

Ptime

2NFA(∗,1)

Balanced and UnaryFlows

Completeness

Soundness

21

Page 61: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

A New Correspondence: New Results

Ptime

2NFA(∗,1)

Balanced and UnaryFlows

Completeness

Soundness

21

Page 62: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

A New Correspondence: New Connexions

Complexity

Automata

Programming Language

Linear Logic

Category Theory

22

Page 63: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

1 Introduction

2 Automata and ICC

3 Logic Programming

4 A New Correspondence

5 PerspectivesLooking BackLooking Forward

Page 64: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Perspectives: Looking Back

Results of a series of works (Aubert, 2015; Aubert and Bagnol,2014; Aubert, Bagnol, and Seiller, 2016; Aubert and Seiller,2016a,b; Aubert et al., 2014) whose story remains to be told.

— From Proof Theory to simulations

— Algebraic techniques

— Pushdown Systems (PDS)?

— Functional complexity?

24

Page 65: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Perspectives: Looking Back

Results of a series of works (Aubert, 2015; Aubert and Bagnol,2014; Aubert, Bagnol, and Seiller, 2016; Aubert and Seiller,2016a,b; Aubert et al., 2014) whose story remains to be told.

— From Proof Theory to simulations

— Algebraic techniques

— Pushdown Systems (PDS)?

— Functional complexity?

24

Page 66: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Perspectives: Looking Back

Results of a series of works (Aubert, 2015; Aubert and Bagnol,2014; Aubert, Bagnol, and Seiller, 2016; Aubert and Seiller,2016a,b; Aubert et al., 2014) whose story remains to be told.

— From Proof Theory to simulations

— Algebraic techniques

— Pushdown Systems (PDS)?

— Functional complexity?

24

Page 67: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Perspectives: Looking Back

Results of a series of works (Aubert, 2015; Aubert and Bagnol,2014; Aubert, Bagnol, and Seiller, 2016; Aubert and Seiller,2016a,b; Aubert et al., 2014) whose story remains to be told.

— From Proof Theory to simulations

— Algebraic techniques

— Pushdown Systems (PDS)?

— Functional complexity?

24

Page 68: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Perspectives: Looking Forward

In increasing order of complexity:

— Write an intepreter for Automata (Chakraborty, Saxena, andKatti, 2011)

— The odd status of input in logic programming: can we havenon-deterministic data?

— Transfer results from automata to logic programming!

— Encode other variations of automata

— Go back to the type system

Thanks!

F=f

25

Page 69: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Perspectives: Looking Forward

In increasing order of complexity:

— Write an intepreter for Automata (Chakraborty, Saxena, andKatti, 2011)

— The odd status of input in logic programming: can we havenon-deterministic data?

— Transfer results from automata to logic programming!

— Encode other variations of automata

— Go back to the type system

Thanks!

F=f

25

Page 70: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Perspectives: Looking Forward

In increasing order of complexity:

— Write an intepreter for Automata (Chakraborty, Saxena, andKatti, 2011)

— The odd status of input in logic programming: can we havenon-deterministic data?

— Transfer results from automata to logic programming!

— Encode other variations of automata

— Go back to the type system

Thanks!

F=f

25

Page 71: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Perspectives: Looking Forward

In increasing order of complexity:

— Write an intepreter for Automata (Chakraborty, Saxena, andKatti, 2011)

— The odd status of input in logic programming: can we havenon-deterministic data?

— Transfer results from automata to logic programming!

— Encode other variations of automata

— Go back to the type system

Thanks!

F=f

25

Page 72: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Perspectives: Looking Forward

In increasing order of complexity:

— Write an intepreter for Automata (Chakraborty, Saxena, andKatti, 2011)

— The odd status of input in logic programming: can we havenon-deterministic data?

— Transfer results from automata to logic programming!

— Encode other variations of automata

— Go back to the type system

Thanks!

F=f

25

Page 73: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Perspectives: Looking Forward

In increasing order of complexity:

— Write an intepreter for Automata (Chakraborty, Saxena, andKatti, 2011)

— The odd status of input in logic programming: can we havenon-deterministic data?

— Transfer results from automata to logic programming!

— Encode other variations of automata

— Go back to the type system

Thanks!

F=f

25

Page 74: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Perspectives: References

Aubert, Clément (2015). An in-between "implicit" and "explicit"complexity: Automata. Research Report. 5 pp. arXiv:1502.00145 [cs.LO]. Communication at DICE 2015.

Aubert, Clément and Marc Bagnol (2014). “Unification andLogarithmic Space”. In: RTA-TLCA. Ed. by Gilles Dowek.Vol. 8650. LNCS. Springer, pp. 77–92. arXiv: 1402.4327[cs.LO].

Aubert, Clément, Marc Bagnol, and Thomas Seiller (2016).“Unary Resolution: Characterizing Ptime”. In: FoSSaCS.Ed. by Bart Jacobs and Christof Löding. Vol. 9634. LNCS.Springer, pp. 373–389.

Aubert, Clément and Thomas Seiller (2016a). “Characterizingco-NL by a group action”. In: MSCS 26 (04), pp. 606–638.

26

Page 75: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Perspectives: References

Aubert, Clément and Thomas Seiller (2016b). “LogarithmicSpace and Permutations”. In: Inf. Comput. 248. Ed. bySimona Ronchi Della Rocca and Virgile Mogbil. Developmenton Implicit Computational Complexity (DICE 2013), pp. 2–21.

Aubert, Clément, Marc Bagnol, Paolo Pistone, andThomas Seiller (2014). “Logic Programming and LogarithmicSpace”. In: APLAS. Ed. by Jacques Garrigue. Vol. 8858.LNCS. Springer, pp. 39–57. arXiv: 1406.2110 [cs.LO].

Baillot, Patrick and Marco Pedicini (2001). “ElementaryComplexity and Geometry of Interaction”. In: Fund. Inform.45.1–2, pp. 1–31.

27

Page 76: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Perspectives: References

Bellantoni, Stephen J. and Stephen Arthur Cook (1992). “A NewRecursion-Theoretic Characterization of the PolytimeFunctions (Extended Abstract)”. In: STOC. Ed. byS. Rao Kosaraju, Mike Fellows, Avi Wigderson, andJohn A. Ellis. ACM, pp. 283–93.

Buss, Samuel R. (1986). Bounded Arithmetic. Vol. 3. Studies inProof Theory. Lecture Notes. Bibliopolis.

Chakraborty, Pinaki, Prem Chandra Saxena, andChittaranjan Padmanabha Katti (2011). “Fifty years ofautomata simulation: a review”. In: Inroads 2.4, pp. 59–70.

28

Page 77: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Perspectives: References

Cobham, Alan (1965). “The intrinsic computational difficulty offunctions”. In: Logic, methodology and philosophy of science:Proceedings of the 1964 international congress held at theHebrew university of Jerusalem, Israel, from August 26 toSeptember 2, 1964. Ed. by Yehoshua Bar-Hillel. Studies inLogic and the foundations of mathematics. North-HollandPublishing Company, pp. 24–30.

Dal Lago, Ugo (2011). “A Short Introduction to ImplicitComputational Complexity”. In: ESSLLI. Ed. byNick Bezhanishvili and Valentin Goranko. Vol. 7388. LNCS.Springer, pp. 89–109.

Fagin, Ronald (1973). “Contributions to the Model Theory ofFinite Structures”. PhD thesis. University of California,Berkeley.

29

Page 78: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Perspectives: References

Férée, Hugo, Emmanuel Hainry, Mathieu Hoyrup, andRomain Péchoux (2015). “Characterizing polynomial timecomplexity of stream programs using interpretations”. In:Theoret. Comput. Sci. 585, pp. 41–54.

Gaboardi, Marco, Andreas Haeberlen, Justin Hsu,Arjun Narayan, and Benjamin C. Pierce (2013). “Lineardependent types for differential privacy”. In: POPL. Ed. byRoberto Giacobazzi and Radhia Cousot. ACM, pp. 357–370.

Girard, Jean-Yves (2013). “Three lightings of logic”. In: CSL.Ed. by Simona Ronchi Della Rocca. Vol. 23. LIPIcs. SchlossDagstuhl - Leibniz-Zentrum für Informatik, pp. 11–23.

Girard, Jean-Yves, Andre Scedrov, and Philip J. Scott (1992).“Bounded linear logic: a modular approach to polynomial-timecomputability”. In: Theoret. Comput. Sci. 97.1, pp. 1–66.

30

Page 79: Developing Disciplined Programs · Developing Disciplined Programs Seminar at the James M. Hull College of Business Clément Aubert Augusta University 30th January 2017

Perspectives: References

Ibarra, Oscar H. (1971). “Characterizations of Some Tape andTime Complexity Classes of Turing Machines in Terms ofMultihead and Auxiliary Stack Automata”. In: J. Comput. Syst.Sci. 5.2, pp. 88–117.

Leivant, Daniel (1993). “Stratified Functional Programs andComputational Complexity”. In: POPL. Ed. byMary S. Van Deusen and Bernard Lang. ACM Press,pp. 325–333.

31