A new algorithm for Higher-order model checking Jrmy Ledent Martin - - PowerPoint PPT Presentation

a new algorithm for higher order model checking
SMART_READER_LITE
LIVE PREVIEW

A new algorithm for Higher-order model checking Jrmy Ledent Martin - - PowerPoint PPT Presentation

A new algorithm for Higher-order model checking Jrmy Ledent Martin Hofmann 1 / 25 For first order programs (M. Hofmann & W. Chen) Let be a set of events and F a set of procedure identifiers. Syntax of expressions: e ::= a | f | e


slide-1
SLIDE 1

A new algorithm for Higher-order model checking

Jérémy Ledent Martin Hofmann

1 / 25

slide-2
SLIDE 2

For first order programs (M. Hofmann & W. Chen)

Let Σ be a set of events and F a set of procedure identifiers.

◮ Syntax of expressions:

e ::= a | f | e1; e2 | e1 + e2 where a ∈ Σ and f ∈ F

2 / 25

slide-3
SLIDE 3

For first order programs (M. Hofmann & W. Chen)

Let Σ be a set of events and F a set of procedure identifiers.

◮ Syntax of expressions:

e ::= a | f | e1; e2 | e1 + e2 where a ∈ Σ and f ∈ F

◮ Program: an expression ef for every f ∈ F.

Examples: f = a; b; g g = d + (c; f ) L(f ) = (abc)∗abd ∪ {(abc)ω}

2 / 25

slide-4
SLIDE 4

For first order programs (M. Hofmann & W. Chen)

Let Σ be a set of events and F a set of procedure identifiers.

◮ Syntax of expressions:

e ::= a | f | e1; e2 | e1 + e2 where a ∈ Σ and f ∈ F

◮ Program: an expression ef for every f ∈ F.

Examples: f = a; b; g g = d + (c; f ) u = a; v v = v L(f ) = (abc)∗abd ∪ {(abc)ω} L(u) = {a}

2 / 25

slide-5
SLIDE 5

For first order programs (M. Hofmann & W. Chen)

Let Σ be a set of events and F a set of procedure identifiers.

◮ Syntax of expressions:

e ::= a | f | e1; e2 | e1 + e2 where a ∈ Σ and f ∈ F

◮ Program: an expression ef for every f ∈ F.

Examples: f = a; b; g g = d + (c; f ) u = a; v v = v L∗(f ) = (abc)∗abd Lω(f ) = {(abc)ω} L∗(u) = ∅ Lω(u) = {a()ω}

2 / 25

slide-6
SLIDE 6

Policy Automaton

#define TIMEOUT 65536 while (true) { int i,s; i = s = 0; while (i++ < TIMEOUT && s == 0) { s = auth(); } work(); }

3 / 25

slide-7
SLIDE 7

Policy Automaton

#define TIMEOUT 65536 while (true) { int i,s; i = s = 0; while (i++ < TIMEOUT && s == 0) { s = auth(); /* a */ } /* c */ work(); /* b */ } f = g; b; f g = (a; g) + c

3 / 25

slide-8
SLIDE 8

Policy Automaton

#define TIMEOUT 65536 while (true) { int i,s; i = s = 0; while (i++ < TIMEOUT && s == 0) { s = auth(); /* a */ } /* c */ work(); /* b */ } f = g; b; f g = (a; g) + c q1 q0 q2 a, b, c a, b a, b, c b a, b, c “If c occurs infinitely often, then b occurs infinitely often.”

3 / 25

slide-9
SLIDE 9

Büchi type system

Let GFb = (a∗b)ω be a type asserting “b occurs infinitely often”. Consider the procedure: f = a; f Assuming f : GFb, we can derive (a; f ) : aGFb, and since aGFb = GFb, that means we have a derivation f : GFb ⊢ (a; f ) : GFb

4 / 25

slide-10
SLIDE 10

Büchi type system

Let GFb = (a∗b)ω be a type asserting “b occurs infinitely often”. Consider the procedure: f = a; f Assuming f : GFb, we can derive (a; f ) : aGFb, and since aGFb = GFb, that means we have a derivation f : GFb ⊢ (a; f ) : GFb Under “usual” typing rules, this would allow us to establish ⊢ f : GFb which is clearly wrong.

4 / 25

slide-11
SLIDE 11

Büchi type system

Idea: f : X ⊢ ef : T(X) ⊢ f : gfp(λX. T(X))

5 / 25

slide-12
SLIDE 12

Büchi type system

Idea: f : X ⊢ ef : T(X) ⊢ f : gfp(λX. T(X)) f = (a; f ) + b Looks like a language equation X = aX + b Smallest solution: X = a∗b Greatest solution: X = a∗b + aω = L(f )

5 / 25

slide-13
SLIDE 13

Büchi type system

Idea: f : X ⊢ ef : T(X) ⊢ f : gfp(λX. T(X)) f = (a; f ) + b Looks like a language equation X = aX + b Smallest solution: X = a∗b Greatest solution: X = a∗b + aω = L(f ) For first-order programs: T(X) = U · X + V gfp(T) = U ∗V + U ω

5 / 25

slide-14
SLIDE 14

Büchi Abstraction

Let L∗ = P(Σ∗) and Lω = P(Σω). Given the policy automaton A, we can construct complete lattices M∗ and Mω such that:

◮ They are finite.

6 / 25

slide-15
SLIDE 15

Büchi Abstraction

Let L∗ = P(Σ∗) and Lω = P(Σω). Given the policy automaton A, we can construct complete lattices M∗ and Mω such that:

◮ They are finite. ◮ They are related to L∗, Lω by a galois insertion. There are

α∗/ω : L∗/ω → M∗/ω and γ∗/ω : M∗/ω → L∗/ω such that γ∗/ω(α∗/ω(L)) ⊇ L and α∗/ω(γ∗/ω(U)) = U

6 / 25

slide-16
SLIDE 16

Büchi Abstraction

Let L∗ = P(Σ∗) and Lω = P(Σω). Given the policy automaton A, we can construct complete lattices M∗ and Mω such that:

◮ They are finite. ◮ They are related to L∗, Lω by a galois insertion. There are

α∗/ω : L∗/ω → M∗/ω and γ∗/ω : M∗/ω → L∗/ω such that γ∗/ω(α∗/ω(L)) ⊇ L and α∗/ω(γ∗/ω(U)) = U

◮ L ⊆ L(A) ⇐

⇒ α(L) ⊑ α(L(A))

6 / 25

slide-17
SLIDE 17

Büchi Abstraction

Let L∗ = P(Σ∗) and Lω = P(Σω). Given the policy automaton A, we can construct complete lattices M∗ and Mω such that:

◮ They are finite. ◮ They are related to L∗, Lω by a galois insertion. There are

α∗/ω : L∗/ω → M∗/ω and γ∗/ω : M∗/ω → L∗/ω such that γ∗/ω(α∗/ω(L)) ⊇ L and α∗/ω(γ∗/ω(U)) = U

◮ L ⊆ L(A) ⇐

⇒ α(L) ⊑ α(L(A))

◮ The abstraction function α preserves unions, concatenation,

least fixpoints and ω-iteration (but not greatest fixpoints !): M∗ Mω L∗ Lω

(−)(ω) (−)ω α∗ αω 6 / 25

slide-18
SLIDE 18

Büchi Abstraction

Define the equivalence relation ∼A on Σ+ as follows: u ∼A v iff ∀q, q′. (q

u

− → q′ ⇐ ⇒ q

v

− → q′) ∧ (q

u

− →F q′ ⇐ ⇒ q

v

− →F q′) and extend it to Σ∗ such that [ε] = {ε}.

7 / 25

slide-19
SLIDE 19

Büchi Abstraction

Define the equivalence relation ∼A on Σ+ as follows: u ∼A v iff ∀q, q′. (q

u

− → q′ ⇐ ⇒ q

v

− → q′) ∧ (q

u

− →F q′ ⇐ ⇒ q

v

− →F q′) and extend it to Σ∗ such that [ε] = {ε}.

◮ Equivalence classes are regular languages. ◮ There’s a finite number of classes.

7 / 25

slide-20
SLIDE 20

Büchi Abstraction

Define the equivalence relation ∼A on Σ+ as follows: u ∼A v iff ∀q, q′. (q

u

− → q′ ⇐ ⇒ q

v

− → q′) ∧ (q

u

− →F q′ ⇐ ⇒ q

v

− →F q′) and extend it to Σ∗ such that [ε] = {ε}.

◮ Equivalence classes are regular languages. ◮ There’s a finite number of classes. ◮ For every class C, either C ∩ L∗(A) = ∅ or C ⊆ L∗(A).

7 / 25

slide-21
SLIDE 21

Büchi Abstraction

Define the equivalence relation ∼A on Σ+ as follows: u ∼A v iff ∀q, q′. (q

u

− → q′ ⇐ ⇒ q

v

− → q′) ∧ (q

u

− →F q′ ⇐ ⇒ q

v

− →F q′) and extend it to Σ∗ such that [ε] = {ε}.

◮ Equivalence classes are regular languages. ◮ There’s a finite number of classes. ◮ For every class C, either C ∩ L∗(A) = ∅ or C ⊆ L∗(A). ◮ For every C, D, either CDω ∩ Lω(A) = ∅ or CDω ⊆ Lω(A). ◮ For every w ∈ Σω, there are C, D such that w ∈ CDω.

The sets CDω behave almost like classes, but they may overlap !

7 / 25

slide-22
SLIDE 22

Büchi Abstraction

Define M∗ = P(Σ∗/ ∼A) γ∗(V) =

  • C∈V

C α∗(L) = {C | C ∩ L = ∅}

8 / 25

slide-23
SLIDE 23

Büchi Abstraction

Define M∗ = P(Σ∗/ ∼A) γ∗(V) =

  • C∈V

C α∗(L) = {C | C ∩ L = ∅} and Mω = {V ⊆ (Σ∗/ ∼A) × (Σ∗/ ∼A) | V is closed} γω(V) =

  • (C,D)∈V

CDω αω(L) = cl {(C, D) | CDω ∩ L = ∅}

8 / 25

slide-24
SLIDE 24

Extending to Higher-order

Terms: e ::= x | a | e1; e2 | e1 + e2 | fix e | λx. e | e1 e2

9 / 25

slide-25
SLIDE 25

Extending to Higher-order

Terms: e ::= x | a | e1; e2 | e1 + e2 | fix e | λx. e | e1 e2 Types: τ ::= o | τ1→τ2 Typing rules:

Γ ⊢ x : Γ(x) Γ ⊢ e1 : τ1 → τ2 Γ ⊢ e2 : τ1 Γ ⊢ e1 e2 : τ2 Γ, x : τ1 ⊢ e : τ2 Γ ⊢ λx.e : τ1 → τ2 Γ ⊢ e : τ → τ Γ ⊢ fix e : τ Γ ⊢ a : o Γ ⊢ e1 : o Γ ⊢ e2 : o Γ ⊢ e1 + e2 : o Γ ⊢ e1 : o Γ ⊢ e2 : o Γ ⊢ e1; e2 : o 9 / 25

slide-26
SLIDE 26

Extending to Higher-order

Terms: e ::= x | a | e1; e2 | e1 + e2 | fix e | λx. e | e1 e2 Types: τ ::= o | τ1→τ2 Typing rules:

Γ ⊢ x : Γ(x) Γ ⊢ e1 : τ1 → τ2 Γ ⊢ e2 : τ1 Γ ⊢ e1 e2 : τ2 Γ, x : τ1 ⊢ e : τ2 Γ ⊢ λx.e : τ1 → τ2 Γ ⊢ e : τ → τ Γ ⊢ fix e : τ Γ ⊢ a : o Γ ⊢ e1 : o Γ ⊢ e2 : o Γ ⊢ e1 + e2 : o Γ ⊢ e1 : o Γ ⊢ e2 : o Γ ⊢ e1; e2 : o

Program: closed term of type o.

9 / 25

slide-27
SLIDE 27

Examples

First order: only use fix : (o → o) → o.

◮ fix(λf . (a; f ) + b) ◮ fix(λf . a; b; fix(λg. d + (c; f )))

10 / 25

slide-28
SLIDE 28

Examples

First order: only use fix : (o → o) → o.

◮ fix(λf . (a; f ) + b) ◮ fix(λf . a; b; fix(λg. d + (c; f )))

Call-by-value versus call-by-name:

◮ e = (λx. a; x) b

− → L∗(e) = {ab}

10 / 25

slide-29
SLIDE 29

Examples

First order: only use fix : (o → o) → o.

◮ fix(λf . (a; f ) + b) ◮ fix(λf . a; b; fix(λg. d + (c; f )))

Call-by-value versus call-by-name:

◮ e = (λx. a; x) b

− → L∗(e) = {ab} Non context-free examples:

◮ e′ = fix(λf .λx. (a; f (b; x; c))+x)

L∗(e′ d) = {anbndcn | n ≥ 0} Lω(e′ d) = {aω}

10 / 25

slide-30
SLIDE 30

Examples

First order: only use fix : (o → o) → o.

◮ fix(λf . (a; f ) + b) ◮ fix(λf . a; b; fix(λg. d + (c; f )))

Call-by-value versus call-by-name:

◮ e = (λx. a; x) b

− → L∗(e) = {ab} Non context-free examples:

◮ e′ = fix(λf .λx. (a; f (b; x; c))+x)

L∗(e′ d) = {anbndcn | n ≥ 0} Lω(e′ d) = {aω}

◮ e′′ = fix(λx. (e′ d); x)

L∗(e′′) = ∅ Lω(e′′) = (L∗(e′ d))ω ∪ {aω}

10 / 25

slide-31
SLIDE 31

Related Work

Higher-order model checking (Ong & Kobayashi, Walukiewicz & Salvati, Melliès & Grellois).

◮ λY, higher-order recursion schemes, higher-order pushdown

automata with collapse.

◮ Model-checking of temporal logic, µ-calculus formulas. ◮ Relies heavily on tree properties, even if we are only interested

in traces.

11 / 25

slide-32
SLIDE 32

Related Work

Higher-order model checking (Ong & Kobayashi, Walukiewicz & Salvati, Melliès & Grellois).

◮ λY, higher-order recursion schemes, higher-order pushdown

automata with collapse.

◮ Model-checking of temporal logic, µ-calculus formulas. ◮ Relies heavily on tree properties, even if we are only interested

in traces. Example: λY. Choose first-order constants a : o → o → o b : o → o c : o M = Y(λf . λx. a x (f (b x))) Böhm-tree of (M c): a c a b c ...

11 / 25

slide-33
SLIDE 33

GFP semantics

We define the category GFP

◮ Its objects A are pairs (A∗, Aω) of complete lattices. ◮ A morphism f : A → B is a pair (f∗, fω) where

f∗ : A∗ → B∗ fω : A∗ × Aω → Bω

12 / 25

slide-34
SLIDE 34

GFP semantics

We define the category GFP

◮ Its objects A are pairs (A∗, Aω) of complete lattices. ◮ A morphism f : A → B is a pair (f∗, fω) where

f∗ : A∗ → B∗ fω : A∗ × Aω → Bω

Composition h = g ◦ f is given by

◮ h∗(a∗) = g∗(f∗(a∗)) ◮ hω(a∗, aω) = gω(f∗(a∗), fω(a∗, aω))

12 / 25

slide-35
SLIDE 35

GFP semantics

We define the category GFP

◮ Its objects A are pairs (A∗, Aω) of complete lattices. ◮ A morphism f : A → B is a pair (f∗, fω) where

f∗ : A∗ → B∗ fω : A∗ × Aω → Bω

Composition h = g ◦ f is given by

◮ h∗(a∗) = g∗(f∗(a∗)) ◮ hω(a∗, aω) = gω(f∗(a∗), fω(a∗, aω))

Proposition

GFP is cartesian-closed. Cartesian products

◮ (A × B)∗ = A∗ × B∗ ◮ (A × B)ω = Aω × Bω

Function spaces

◮ (A ⇒ B)∗ = BA∗

◮ (A ⇒ B)ω = BA∗×Aω

ω 12 / 25

slide-36
SLIDE 36

GFP semantics

GFP has the following fixpoint combinator for every A: fixA : (A ⇒ A) → A where

◮ (fixA)∗(f∗) = lfp(f∗) ◮ (fixA)ω(f∗, fω) = gfp(λaω. fω(lfp(f∗), aω))

Proposition

This is indeed a fixpoint: f (fixA(f )) = fixA(f ) holds in the internal language of GFP app ◦ idA⇒A, fixA = fixA

13 / 25

slide-37
SLIDE 37

GFP semantics

Interpretation of types: To every type τ, associate an object τ of GFP

  • = (L∗, Lω)

and σ → τ = σ ⇒ τ

14 / 25

slide-38
SLIDE 38

GFP semantics

Interpretation of types: To every type τ, associate an object τ of GFP

  • = (L∗, Lω)

and σ → τ = σ ⇒ τ Interpretation of contexts: To a context Γ = x1 : τ1, . . . , xn : τn, associate the object Γ = τ1 × . . . × τn

14 / 25

slide-39
SLIDE 39

GFP semantics

Interpretation of types: To every type τ, associate an object τ of GFP

  • = (L∗, Lω)

and σ → τ = σ ⇒ τ Interpretation of contexts: To a context Γ = x1 : τ1, . . . , xn : τn, associate the object Γ = τ1 × . . . × τn Interpretation of terms: To a derivation Γ ⊢ e : τ, associate a morphism e : Γ → τ

14 / 25

slide-40
SLIDE 40

GFP semantics

Interpretation of types: To every type τ, associate an object τ of GFP

  • = (L∗, Lω)

and σ → τ = σ ⇒ τ Interpretation of contexts: To a context Γ = x1 : τ1, . . . , xn : τn, associate the object Γ = τ1 × . . . × τn Interpretation of terms: To a derivation Γ ⊢ e : τ, associate a morphism e : Γ → τ

◮ a = ({a}, ∅)

14 / 25

slide-41
SLIDE 41

GFP semantics

Interpretation of types: To every type τ, associate an object τ of GFP

  • = (L∗, Lω)

and σ → τ = σ ⇒ τ Interpretation of contexts: To a context Γ = x1 : τ1, . . . , xn : τn, associate the object Γ = τ1 × . . . × τn Interpretation of terms: To a derivation Γ ⊢ e : τ, associate a morphism e : Γ → τ

◮ a = ({a}, ∅) ◮ +∗(X∗, Y∗) = X∗ ∪ Y∗

+ω(X∗, Y∗, Xω, Yω) = Xω ∪ Yω

14 / 25

slide-42
SLIDE 42

GFP semantics

Interpretation of types: To every type τ, associate an object τ of GFP

  • = (L∗, Lω)

and σ → τ = σ ⇒ τ Interpretation of contexts: To a context Γ = x1 : τ1, . . . , xn : τn, associate the object Γ = τ1 × . . . × τn Interpretation of terms: To a derivation Γ ⊢ e : τ, associate a morphism e : Γ → τ

◮ a = ({a}, ∅) ◮ +∗(X∗, Y∗) = X∗ ∪ Y∗

+ω(X∗, Y∗, Xω, Yω) = Xω ∪ Yω

◮ ; ∗(X∗, Y∗) = X∗Y∗

; ω(X∗, Y∗, Xω, Yω) = Xω ∪ X∗Yω

14 / 25

slide-43
SLIDE 43

GFP semantics

Reminder: a program is a closed term of type o. Let e be a program, then e : 1 → o is (isomorphic to) an element of L∗ × Lω.

Theorem

Let e be a program, write (L∗, Lω) = e its interpretation in GFP. Then we have L∗(e) = L∗ and Lω(e) = Lω.

15 / 25

slide-44
SLIDE 44

GFP semantics

Reminder: a program is a closed term of type o. Let e be a program, then e : 1 → o is (isomorphic to) an element of L∗ × Lω.

Theorem

Let e be a program, write (L∗, Lω) = e its interpretation in GFP. Then we have L∗(e) = L∗ and Lω(e) = Lω. If we choose o = (M∗, Mω) instead, everything is computable. But α doesn’t commute with greatest fixpoints :-(

15 / 25

slide-45
SLIDE 45

Affine Functions

For first-order fixpoints: The denotation of f : o → o has two components:

◮ f ∗ : L∗ → L∗ ◮ f ω : L∗ × Lω → Lω

fix f involves some gfp of f ω.

16 / 25

slide-46
SLIDE 46

Affine Functions

For first-order fixpoints: The denotation of f : o → o has two components:

◮ f ∗ : L∗ → L∗ ◮ f ω : L∗ × Lω → Lω

fix f involves some gfp of f ω. But every function F : L∗ × Lω → Lω that actually occurs as the interpretation of a term is affine: there exists A : L∗ → L∗ and B : L∗ → Lω such that F(x, X) = A(x) · X ∪ B(x) Then gfp(F(x, −)) = A(x)∗B(x) ∪ A(x)ω commutes with α.

16 / 25

slide-47
SLIDE 47

Affine Functions

For higher-order fixpoints: Consider f : (τ → o) → (τ → o), then f ω : τ → o∗ × (τ∗ × τω ⇒ Lω) → (τ∗ × τω ⇒ Lω)

17 / 25

slide-48
SLIDE 48

Affine Functions

For higher-order fixpoints: Consider f : (τ → o) → (τ → o), then f ω : τ → o∗ × (τ∗ × τω ⇒ Lω) → (τ∗ × τω ⇒ Lω) A function F : S × (T ⇒ Lω) → (T ⇒ Lω) that occurs as the interpretation of a term will have the form: F(s, X) = λt. A(s, t) ∪

  • t′∈T

B(s, t, t′) · X(t′)

17 / 25

slide-49
SLIDE 49

Affine Functions

For higher-order fixpoints: Consider f : (τ → o) → (τ → o), then f ω : τ → o∗ × (τ∗ × τω ⇒ Lω) → (τ∗ × τω ⇒ Lω) A function F : S × (T ⇒ Lω) → (T ⇒ Lω) that occurs as the interpretation of a term will have the form: F(s, X) = λt. A(s, t) ∪

  • t′∈T

B(s, t, t′) · X(t′) Then gfp(F(s, −))(t) =

  • (tk)∈TN

t0=t ∞

  • i=0

B(s, ti, ti+1) ∪

  • t1,...,tn∈T

B(s, t, t1) · B(s, t1, t2) · · · B(s, tn−1, tn) · A(s, tn)

17 / 25

slide-50
SLIDE 50

ω-semigroups (Perrin, Pin)

An ω-semigroup is a pair of sets S = (S+, Sω) equipped with:

◮ a mapping S+ × S+ → S+ called binary product ◮ a mapping S+ × Sω → Sω called mixed product ◮ a mapping π : SN

+ → Sω called infinite product

such that

◮ S+ with the binary product is a semigroup ◮ for each s, t ∈ S+ and u ∈ Sω, s(tu) = (st)u ◮ for every increasing sequence (kn)n ∈ NN and (sn)n ∈ SN

+,

  • ne has π((sn)n) = π((tn)n) where t0 = s0s1 . . . sk0 and

tn+1 = skn+1 . . . skn+1

◮ s · π(s0, s1, s2, . . .) = π(s, s0, s1, s2, . . .)

18 / 25

slide-51
SLIDE 51

ω-semigroups (Perrin, Pin)

An ω-semigroup is a pair of sets S = (S+, Sω) equipped with:

◮ a mapping S+ × S+ → S+ called binary product ◮ a mapping S+ × Sω → Sω called mixed product ◮ a mapping π : SN

+ → Sω called infinite product

such that

◮ S+ with the binary product is a semigroup ◮ for each s, t ∈ S+ and u ∈ Sω, s(tu) = (st)u ◮ for every increasing sequence (kn)n ∈ NN and (sn)n ∈ SN

+,

  • ne has π((sn)n) = π((tn)n) where t0 = s0s1 . . . sk0 and

tn+1 = skn+1 . . . skn+1

◮ s · π(s0, s1, s2, . . .) = π(s, s0, s1, s2, . . .)

Remark: An ω-semigroup is in particular a Wilke algebra.

18 / 25

slide-52
SLIDE 52

M is an ω-semigroup

Examples of ω-semigroups:

◮ (Σ+, Σω) with the usual products

19 / 25

slide-53
SLIDE 53

M is an ω-semigroup

Examples of ω-semigroups:

◮ (Σ+, Σω) with the usual products ◮ (L+, Lω) with the usual products

19 / 25

slide-54
SLIDE 54

M is an ω-semigroup

Examples of ω-semigroups:

◮ (Σ+, Σω) with the usual products ◮ (L+, Lω) with the usual products ◮ (M+, Mω): the infinitary product is defined as follows.

Given (sn) ∈ MN

+, define

π((sn)n) = αω(

  • n=0

γ∗(sn))

19 / 25

slide-55
SLIDE 55

M is an ω-semigroup

Examples of ω-semigroups:

◮ (Σ+, Σω) with the usual products ◮ (L+, Lω) with the usual products ◮ (M+, Mω): the infinitary product is defined as follows.

Given (sn) ∈ MN

+, define

π((sn)n) = αω(

  • n=0

γ∗(sn))

Proposition

The abstraction function α : L → M is a morphism of ω-semigroups. In particular, for (Ln)n∈N a family of languages, αω(

  • i=0

Ln) = π((α∗(Ln))n)

19 / 25

slide-56
SLIDE 56

Back to affine functions

Idea: Restrict to the sub-category of GFP

◮ whose objects are of the form (X∗, LXarg

ω

)

◮ whose morphisms f : X → Y have an infinitary component

fω : X∗ × LXarg

ω

→ LYarg

ω

which is affine w.r.t. its second argument.

20 / 25

slide-57
SLIDE 57

Back to affine functions

Idea: Restrict to the sub-category of GFP

◮ whose objects are of the form (X∗, LXarg

ω

)

◮ whose morphisms f : X → Y have an infinitary component

fω : X∗ × LXarg

ω

→ LYarg

ω

which is affine w.r.t. its second argument. What is an affine function ?

20 / 25

slide-58
SLIDE 58

Back to affine functions

Idea: Restrict to the sub-category of GFP

◮ whose objects are of the form (X∗, LXarg

ω

)

◮ whose morphisms f : X → Y have an infinitary component

fω : X∗ × LXarg

ω

→ LYarg

ω

which is affine w.r.t. its second argument. What is an affine function ? − → a function of the form f (x) = ax + b.

20 / 25

slide-59
SLIDE 59

Back to affine functions

Idea: Restrict to the sub-category of GFP

◮ whose objects are of the form (X∗, LXarg

ω

)

◮ whose morphisms f : X → Y have an infinitary component

fω : X∗ × LXarg

ω

→ LYarg

ω

which is affine w.r.t. its second argument. What is an affine function ? − → a function of the form f (x) = ax + b. − → a pair (a, b).

20 / 25

slide-60
SLIDE 60

The category AFFS

Let S = (S+, Sω) be an ω-semigroup.

◮ Objects are pairs (X∗, Xarg) ◮ A morphism f : X → Y is given by

f∗ : X∗ → Y∗ farg : X∗ × Yarg → Sω × S

Xop

arg

21 / 25

slide-61
SLIDE 61

The category AFFS

Let S = (S+, Sω) be an ω-semigroup.

◮ Objects are pairs (X∗, Xarg) ◮ A morphism f : X → Y is given by

f∗ : X∗ → Y∗ farg : X∗ × Yarg → Sω × S

Xop

arg

Notation: we decompose farg in two components fc : X∗ × Yarg → Sω and fp : X∗ × Yarg × X op

arg → S∗ 21 / 25

slide-62
SLIDE 62

The category AFFS

Let S = (S+, Sω) be an ω-semigroup.

◮ Objects are pairs (X∗, Xarg) ◮ A morphism f : X → Y is given by

f∗ : X∗ → Y∗ farg : X∗ × Yarg → Sω × S

Xop

arg

Notation: we decompose farg in two components fc : X∗ × Yarg → Sω and fp : X∗ × Yarg × X op

arg → S∗

There is a functor Ext : AFFS → GFP defined as:

◮ Ext(X∗, Xarg) = (X∗, SXarg

ω

)

◮ Ext(f∗, farg) = (f∗, fω) where fω : X∗ × SXarg

ω

→ SYarg

ω

is defined as fω(x, X, η) = fc(x, η) ∪

  • ξ∈Xarg

fp(x, η, ξ) · X(ξ)

21 / 25

slide-63
SLIDE 63

The category AFFS

Composition is defined so that Ext(g ◦ f ) = Ext(g) ◦ Ext(f ).

22 / 25

slide-64
SLIDE 64

The category AFFS

Composition is defined so that Ext(g ◦ f ) = Ext(g) ◦ Ext(f ). The cartesian product (X × Y ) is given by:

◮ (X × Y )∗ = X∗ × Y∗ ◮ (X × Y )arg = Xarg + Yarg

22 / 25

slide-65
SLIDE 65

The category AFFS

Composition is defined so that Ext(g ◦ f ) = Ext(g) ◦ Ext(f ). The cartesian product (X × Y ) is given by:

◮ (X × Y )∗ = X∗ × Y∗ ◮ (X × Y )arg = Xarg + Yarg

The function space (X ⇒ Y ) is given by:

◮ (X ⇒ Y )∗ = X∗ ⇒ (Y∗ × SYarg×Xop arg

)

◮ (X ⇒ Y )arg = X∗ × Yarg

22 / 25

slide-66
SLIDE 66

The category AFFS

Composition is defined so that Ext(g ◦ f ) = Ext(g) ◦ Ext(f ). The cartesian product (X × Y ) is given by:

◮ (X × Y )∗ = X∗ × Y∗ ◮ (X × Y )arg = Xarg + Yarg

The function space (X ⇒ Y ) is given by:

◮ (X ⇒ Y )∗ = X∗ ⇒ (Y∗ × SYarg×Xop arg

)

◮ (X ⇒ Y )arg = X∗ × Yarg

Proposition

The category AFFS is cartesian-closed.

22 / 25

slide-67
SLIDE 67

Affine Semantics

Base type:

  • = (S∗, {⋆})

23 / 25

slide-68
SLIDE 68

Affine Semantics

Base type:

  • = (S∗, {⋆})

Terms:

a∗(⋆) = a aarg(⋆) = (∅, ∅)

+∗(s1, s2) = s1 ∪ s2 +arg(s1, s2, ⋆) = (∅, λη. ε)

; ∗(s1, s2) = s1s2 ; arg(s1, s2, ⋆) =

  • ∅, λη. case(η)
  • inl ⋆ → ε

inr ⋆ → s1

  • 23 / 25
slide-69
SLIDE 69

Affine Semantics

Base type:

  • = (S∗, {⋆})

Terms:

a∗(⋆) = a aarg(⋆) = (∅, ∅)

+∗(s1, s2) = s1 ∪ s2 +arg(s1, s2, ⋆) = (∅, λη. ε)

; ∗(s1, s2) = s1s2 ; arg(s1, s2, ⋆) =

  • ∅, λη. case(η)
  • inl ⋆ → ε

inr ⋆ → s1

  • Remarks:

◮ One needs an element a ∈ S∗: pick {a} for L∗ and [a] for M∗.

23 / 25

slide-70
SLIDE 70

Affine Semantics

Base type:

  • = (S∗, {⋆})

Terms:

a∗(⋆) = a aarg(⋆) = (∅, ∅)

+∗(s1, s2) = s1 ∪ s2 +arg(s1, s2, ⋆) = (∅, λη. ε)

; ∗(s1, s2) = s1s2 ; arg(s1, s2, ⋆) =

  • ∅, λη. case(η)
  • inl ⋆ → ε

inr ⋆ → s1

  • Remarks:

◮ One needs an element a ∈ S∗: pick {a} for L∗ and [a] for M∗. ◮ The fixpoint operator can be defined accordingly.

23 / 25

slide-71
SLIDE 71

Putting it all together

Theorem

For every program e, we have eGFP = Ext(eL).

24 / 25

slide-72
SLIDE 72

Putting it all together

Theorem

For every program e, we have eGFP = Ext(eL).

Corollary

For every program e, eL = (L∗(e), Lω(e)).

24 / 25

slide-73
SLIDE 73

Putting it all together

Theorem

For every program e, we have eGFP = Ext(eL).

Corollary

For every program e, eL = (L∗(e), Lω(e)).

Theorem

For every program e, α(eL) = eM.

24 / 25

slide-74
SLIDE 74

Putting it all together

Theorem

For every program e, we have eGFP = Ext(eL).

Corollary

For every program e, eL = (L∗(e), Lω(e)).

Theorem

For every program e, α(eL) = eM.

Corollary

Let e be a program, and write eM = (X∗, Xω). Then L∗/ω(e) ⊆ L∗/ω(A) ⇐ ⇒ X∗/ω ⊑ α∗/ω(L∗/ω(A)). Moreover, eM is effectively computable.

24 / 25

slide-75
SLIDE 75

Thanks !

25 / 25