Intensionality, Definability and Computation

Samson Abramsky

Oxford University Department of

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 1 / 48 Computability and Computer Science

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 2 / 48 Computability and Computer Science

Computability theory is concerned with computability of extensional objects: numbers, sets, functions ...

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 2 / 48 Computability and Computer Science

Computability theory is concerned with computability of extensional objects: numbers, sets, functions ... These objects are inherited from mathematics and logic.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 2 / 48 Computability and Computer Science

Computability theory is concerned with computability of extensional objects: numbers, sets, functions ... These objects are inherited from mathematics and logic. Computability requires additional structure: an algorithmic process for computing the set or function.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 2 / 48 Computability and Computer Science

Computability theory is concerned with computability of extensional objects: numbers, sets, functions ... These objects are inherited from mathematics and logic. Computability requires additional structure: an algorithmic process for computing the set or function. Relies on a characterization of algorithmic processes.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 2 / 48 Computability and Computer Science

Computability theory is concerned with computability of extensional objects: numbers, sets, functions ... These objects are inherited from mathematics and logic. Computability requires additional structure: an algorithmic process for computing the set or function. Relies on a characterization of algorithmic processes. Computer Science asks a broader question: What is a process?

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 2 / 48 Computability and Computer Science

Computability theory is concerned with computability of extensional objects: numbers, sets, functions ... These objects are inherited from mathematics and logic. Computability requires additional structure: an algorithmic process for computing the set or function. Relies on a characterization of algorithmic processes. Computer Science asks a broader question: What is a process?

No established mathematical theory of what processes are.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 2 / 48 Why processes matter in Computer Science

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 3 / 48 Why processes matter in Computer Science

The purpose of much of the software we routinely run is not to compute a function, but to exhibit some behaviour.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 3 / 48 Why processes matter in Computer Science

The purpose of much of the software we routinely run is not to compute a function, but to exhibit some behaviour.

What function does the Internet compute?

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 3 / 48 Why processes matter in Computer Science

The purpose of much of the software we routinely run is not to compute a function, but to exhibit some behaviour.

What function does the Internet compute?

Think of communication protocols, operating systems, browsers, iTunes, Facebook, Twitter, ...

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 3 / 48 Why processes matter in Computer Science

The purpose of much of the software we routinely run is not to compute a function, but to exhibit some behaviour.

What function does the Internet compute?

Think of communication protocols, operating systems, browsers, iTunes, Facebook, Twitter, ... What is a process? When are two processes equivalent?

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 3 / 48 Why processes matter in Computer Science

The purpose of much of the software we routinely run is not to compute a function, but to exhibit some behaviour.

What function does the Internet compute?

Think of communication protocols, operating systems, browsers, iTunes, Facebook, Twitter, ... What is a process? When are two processes equivalent? The situation is very different to that which we find in computability theory.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 3 / 48 The non-confluence of notions

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 4 / 48 The non-confluence of notions

In computability theory we have:

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 4 / 48 The non-confluence of notions

In computability theory we have: A confluence of notions

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 4 / 48 The non-confluence of notions

In computability theory we have: A confluence of notions A definitive calculus of functions: the λ-calculus.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 4 / 48 The non-confluence of notions

In computability theory we have: A confluence of notions A definitive calculus of functions: the λ-calculus.

There has been active research on concurrency theory and processes for the past 5 decades in CS. Many important concepts and results have emerged. However, one cannot help noticing that:

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 4 / 48 The non-confluence of notions

In computability theory we have: A confluence of notions A definitive calculus of functions: the λ-calculus.

There has been active research on concurrency theory and processes for the past 5 decades in CS. Many important concepts and results have emerged. However, one cannot help noticing that: Hundreds of different process calculi, equivalences, logics have been proposed.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 4 / 48 The non-confluence of notions

In computability theory we have: A confluence of notions A definitive calculus of functions: the λ-calculus.

There has been active research on concurrency theory and processes for the past 5 decades in CS. Many important concepts and results have emerged. However, one cannot help noticing that: Hundreds of different process calculi, equivalences, logics have been proposed. No λ-calculus for concurrency has emerged.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 4 / 48 The non-confluence of notions

In computability theory we have: A confluence of notions A definitive calculus of functions: the λ-calculus.

There has been active research on concurrency theory and processes for the past 5 decades in CS. Many important concepts and results have emerged. However, one cannot help noticing that: Hundreds of different process calculi, equivalences, logics have been proposed. No λ-calculus for concurrency has emerged. There is no plausible Church-Turing for processes.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 4 / 48 The non-confluence of notions

In computability theory we have: A confluence of notions A definitive calculus of functions: the λ-calculus.

There has been active research on concurrency theory and processes for the past 5 decades in CS. Many important concepts and results have emerged. However, one cannot help noticing that: Hundreds of different process calculi, equivalences, logics have been proposed. No λ-calculus for concurrency has emerged. There is no plausible Church-Turing thesis for processes.

The ‘next 700’ syndrome.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 4 / 48 The non-confluence of notions

In computability theory we have: A confluence of notions A definitive calculus of functions: the λ-calculus.

There has been active research on concurrency theory and processes for the past 5 decades in CS. Many important concepts and results have emerged. However, one cannot help noticing that: Hundreds of different process calculi, equivalences, logics have been proposed. No λ-calculus for concurrency has emerged. There is no plausible Church-Turing thesis for processes.

The ‘next 700’ syndrome. It’s a much harder problem!

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 4 / 48 Prospectus

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 5 / 48 Prospectus

We shall tell one success story: the characterization of sequential functional processes using game semantics, solving in best possible terms the ‘full abstraction problem’ for PCF.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 5 / 48 Prospectus

We shall tell one success story: the characterization of sequential functional processes using game semantics, solving in best possible terms the ‘full abstraction problem’ for PCF. Led on to many further developments: Full abstraction and full completeness results for a wide range of programming languages, type theories and logics. A basis for compositional program verification.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 5 / 48 Prospectus

We shall tell one success story: the characterization of sequential functional processes using game semantics, solving in best possible terms the ‘full abstraction problem’ for PCF. Led on to many further developments: Full abstraction and full completeness results for a wide range of programming languages, type theories and logics. A basis for compositional program verification.

Much ongoing work, a flourishing field.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 5 / 48 Prospectus

We shall tell one success story: the characterization of sequential functional processes using game semantics, solving in best possible terms the ‘full abstraction problem’ for PCF. Led on to many further developments: Full abstraction and full completeness results for a wide range of programming languages, type theories and logics. A basis for compositional program verification.

Much ongoing work, a flourishing field. A first step towards developing a positive theory of intensional structures, and finding the right notions of invariance.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 5 / 48 Intensionality vs. Extensionality

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 6 / 48 Intensionality vs. Extensionality

Axioms of extensionality:

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 6 / 48 Intensionality vs. Extensionality

Axioms of extensionality: For sets: x = y ↔ ∀z. z ∈ x ↔ z ∈ y.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 6 / 48 Intensionality vs. Extensionality

Axioms of extensionality: For sets: x = y ↔ ∀z. z ∈ x ↔ z ∈ y. A set is completely characterized by its members.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 6 / 48 Intensionality vs. Extensionality

Axioms of extensionality: For sets: x = y ↔ ∀z. z ∈ x ↔ z ∈ y. A set is completely characterized by its members.

For functions: f = g ↔ ∀x. f (x)= g(x).

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 6 / 48 Intensionality vs. Extensionality

Axioms of extensionality: For sets: x = y ↔ ∀z. z ∈ x ↔ z ∈ y. A set is completely characterized by its members.

For functions: f = g ↔ ∀x. f (x)= g(x). A function is completely characterized by the input-output correspondence (i.e. the set of input-output pairs) which it defines.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 6 / 48 Intensionality vs. Extensionality

Axioms of extensionality: For sets: x = y ↔ ∀z. z ∈ x ↔ z ∈ y. A set is completely characterized by its members.

For functions: f = g ↔ ∀x. f (x)= g(x). A function is completely characterized by the input-output correspondence (i.e. the set of input-output pairs) which it defines. Is intensionality just a failure to satisfy such properties?

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 6 / 48 Intensionality vs. Extensionality

Axioms of extensionality: For sets: x = y ↔ ∀z. z ∈ x ↔ z ∈ y. A set is completely characterized by its members.

For functions: f = g ↔ ∀x. f (x)= g(x). A function is completely characterized by the input-output correspondence (i.e. the set of input-output pairs) which it defines. Is intensionality just a failure to satisfy such properties? Or is there some positive story to tell?

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 6 / 48 Intrinsic vs. Extrinsic Properties of Functions

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 7 / 48 Intrinsic vs. Extrinsic Properties of Functions A property of functions f : A → B is intrinsic if it can be defined purely in terms of f (as a set of input-output pairs) and any structure pertaining to A and B.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 7 / 48 Intrinsic vs. Extrinsic Properties of Functions A property of functions f : A → B is intrinsic if it can be defined purely in terms of f (as a set of input-output pairs) and any structure pertaining to A and B. (More formally: using only bounded quantification over the structures A and B.)

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 7 / 48 Intrinsic vs. Extrinsic Properties of Functions A property of functions f : A → B is intrinsic if it can be defined purely in terms of f (as a set of input-output pairs) and any structure pertaining to A and B. (More formally: using only bounded quantification over the structures A and B.) Examples

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 7 / 48 Intrinsic vs. Extrinsic Properties of Functions A property of functions f : A → B is intrinsic if it can be defined purely in terms of f (as a set of input-output pairs) and any structure pertaining to A and B. (More formally: using only bounded quantification over the structures A and B.) Examples 1. A and B are groups. f : A → B is a group homomorphism if

f (xy)= f (x)f (y), f (e)= e.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 7 / 48 Intrinsic vs. Extrinsic Properties of Functions A property of functions f : A → B is intrinsic if it can be defined purely in terms of f (as a set of input-output pairs) and any structure pertaining to A and B. (More formally: using only bounded quantification over the structures A and B.) Examples 1. A and B are groups. f : A → B is a group homomorphism if

f (xy)= f (x)f (y), f (e)= e.

2. A and B are topological spaces. f : A → B is continuous if f −1(U) is open in the topology on A for every open subset U of B.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 7 / 48 Intrinsic vs. Extrinsic Properties of Functions A property of functions f : A → B is intrinsic if it can be defined purely in terms of f (as a set of input-output pairs) and any structure pertaining to A and B. (More formally: using only bounded quantification over the structures A and B.) Examples 1. A and B are groups. f : A → B is a group homomorphism if

f (xy)= f (x)f (y), f (e)= e.

2. A and B are topological spaces. f : A → B is continuous if f −1(U) is open in the topology on A for every open subset U of B. Computability is not an intrinsic property of partial functions

f : N ⇀ N

in this sense.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 7 / 48 Computability, Extrinsic Structure, and Intensionality

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 8 / 48 Computability, Extrinsic Structure, and Intensionality

In order to define whether a function is computable, we need to refer to something external; a process by which f is computed.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 8 / 48 Computability, Extrinsic Structure, and Intensionality

In order to define whether a function is computable, we need to refer to something external; a process by which f is computed. A function is computable if there is some algorithmic process which computes f .

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 8 / 48 Computability, Extrinsic Structure, and Intensionality

In order to define whether a function is computable, we need to refer to something external; a process by which f is computed. A function is computable if there is some algorithmic process which computes f . And what is a computable process?

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 8 / 48 Computability, Extrinsic Structure, and Intensionality

In order to define whether a function is computable, we need to refer to something external; a process by which f is computed. A function is computable if there is some algorithmic process which computes f . And what is a computable process? Turing’s analysis. Gandy et al.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 8 / 48 Computability, Extrinsic Structure, and Intensionality

In order to define whether a function is computable, we need to refer to something external; a process by which f is computed. A function is computable if there is some algorithmic process which computes f . And what is a computable process? Turing’s analysis. Gandy et al. There is no single canonical form of external structure witnessing computability.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 8 / 48 Computability, Extrinsic Structure, and Intensionality

In order to define whether a function is computable, we need to refer to something external; a process by which f is computed. A function is computable if there is some algorithmic process which computes f . And what is a computable process? Turing’s analysis. Gandy et al. There is no single canonical form of external structure witnessing computability. Rather, we have a confluence: all ‘reasonable’ notions lead to the same class of computable functions.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 8 / 48 Computability, Extrinsic Structure, and Intensionality

In order to define whether a function is computable, we need to refer to something external; a process by which f is computed. A function is computable if there is some algorithmic process which computes f . And what is a computable process? Turing’s analysis. Gandy et al. There is no single canonical form of external structure witnessing computability. Rather, we have a confluence: all ‘reasonable’ notions lead to the same class of computable functions. ‘Church-Turing thesis’.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 8 / 48 In Concrete Terms

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 9 / 48 In Concrete Terms We are given some function

f : {0, 1}∗ - {0, 1}

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 9 / 48 In Concrete Terms We are given some function

f : {0, 1}∗ - {0, 1}

We cannot say if f is computable just by looking at its input-graph and properties relating to the structure of {0, 1}∗ and {0, 1}.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 9 / 48 In Concrete Terms We are given some function

f : {0, 1}∗ - {0, 1}

We cannot say if f is computable just by looking at its input-graph and properties relating to the structure of {0, 1}∗ and {0, 1}. Need something more: notion of machine inductive definition of ‘function algebra’ or logical theory.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 9 / 48 In Concrete Terms We are given some function

f : {0, 1}∗ - {0, 1}

We cannot say if f is computable just by looking at its input-graph and properties relating to the structure of {0, 1}∗ and {0, 1}. Need something more: notion of machine inductive definition of ‘function algebra’ or logical theory.

Contrast: regular languages (those accepted by finite-state automata). Given L ⊆{0, 1}∗, define

∗ s ≡L t ↔ ∀v ∈{0, 1} . sv ∈ L ↔ tv ∈ L.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 9 / 48 In Concrete Terms We are given some function

f : {0, 1}∗ - {0, 1}

We cannot say if f is computable just by looking at its input-graph and properties relating to the structure of {0, 1}∗ and {0, 1}. Need something more: notion of machine inductive definition of ‘function algebra’ or logical theory.

Contrast: regular languages (those accepted by finite-state automata). Given L ⊆{0, 1}∗, define

∗ s ≡L t ↔ ∀v ∈{0, 1} . sv ∈ L ↔ tv ∈ L.

Theorem (Myhill-Nerode) L is regular if and only if ≡L is of finite index.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 9 / 48 From functions to functionals

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 10 / 48 From functions to functionals The issues become clearer if we include functionals (functions which take functions as arguments) in our discussion.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 10 / 48 From functions to functionals The issues become clearer if we include functionals (functions which take functions as arguments) in our discussion. Type 0: N Type 1: N ⇀ N Type 2: [N ⇀ N] ⇀ N

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 10 / 48 From functions to functionals The issues become clearer if we include functionals (functions which take functions as arguments) in our discussion. Type 0: N Type 1: N ⇀ N Type 2: [N ⇀ N] ⇀ N Functionals are not so unfamiliar: e.g. the quantifiers!

∀, ∃ :[N → B] → B

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 10 / 48 From functions to functionals The issues become clearer if we include functionals (functions which take functions as arguments) in our discussion. Type 0: N Type 1: N ⇀ N Type 2: [N ⇀ N] ⇀ N Functionals are not so unfamiliar: e.g. the quantifiers!

∀, ∃ :[N → B] → B

Computing with a function (or procedure) parameter P.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 10 / 48 From functions to functionals The issues become clearer if we include functionals (functions which take functions as arguments) in our discussion. Type 0: N Type 1: N ⇀ N Type 2: [N ⇀ N] ⇀ N Functionals are not so unfamiliar: e.g. the quantifiers!

∀, ∃ :[N → B] → B

Computing with a function (or procedure) parameter P. Extensional paradigm: the only way we can interact with P is to call it on some arguments, and use the results: let m = P(n) in ... In any finite computation, we can only make finitely many such calls, and hence ‘observe’ a finite subset of the graph of the function defined by P:

{m1 = P(n1), m2 = P(n2),..., mk = P(nk )}

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 10 / 48 Intensional Paradigm

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 11 / 48 Intensional Paradigm

Intensional paradigm: we have access to the code of P. So we can compute such things as the code itself (as a text string), or how many symbols appear in it, etc.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 11 / 48 Intensional Paradigm

Intensional paradigm: we have access to the code of P. So we can compute such things as the code itself (as a text string), or how many symbols appear in it, etc. Examples: interpreters, other programs which manipulate programs.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 11 / 48 Intensional Paradigm

Intensional paradigm: we have access to the code of P. So we can compute such things as the code itself (as a text string), or how many symbols appear in it, etc. Examples: interpreters, other programs which manipulate programs. Usually though we keep programs as data (subject to manipulation) distinct from programs as code (performing manipulations).

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 11 / 48 Intensional Paradigm

Intensional paradigm: we have access to the code of P. So we can compute such things as the code itself (as a text string), or how many symbols appear in it, etc. Examples: interpreters, other programs which manipulate programs. Usually though we keep programs as data (subject to manipulation) distinct from programs as code (performing manipulations). Diagonalization arguments are exactly about switching between the two.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 11 / 48 Intrinsic structure of computable functionals

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 12 / 48 Intrinsic structure of computable functionals When we pass to functionals, some intrinsic structure begins to emerge.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 12 / 48 Intrinsic structure of computable functionals When we pass to functionals, some intrinsic structure begins to emerge. There is a natural ordering on partial functions:

f ⊑ g ↔ graph(f ) ⊆ graph(g).

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 12 / 48 Intrinsic structure of computable functionals When we pass to functionals, some intrinsic structure begins to emerge. There is a natural ordering on partial functions:

f ⊑ g ↔ graph(f ) ⊆ graph(g).

Theorem (Myhill-Sheperdson) An extensional computable functional F satisfies the following properties: Monotonicity : f ⊑ g ⇒ F (f ) ⊑ F (g). Continuity : For any increasing sequence of partial functions

f0 ⊑ f1 ⊑ f2 ⊑

we have F (G fi ) = G F (fi ). i i Moreover, there is a sort of converse (which still needs to appeal to the usual notion of computability for functions).

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 12 / 48 Generalization to Domains

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 13 / 48 Generalization to Domains

These ideas were elaborated into a beautiful mathematical theory of computation by Dana Scott and others.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 13 / 48 Generalization to Domains

These ideas were elaborated into a beautiful mathematical theory of computation by Dana Scott and others. Domains are partial orders with least elements and least upper bounds of increasing sequences.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 13 / 48 Generalization to Domains

These ideas were elaborated into a beautiful mathematical theory of computation by Dana Scott and others. Domains are partial orders with least elements and least upper bounds of increasing sequences. The corresponding functions are the monotonic and continuous ones. A function f : D → E is monotonic if, for all x, y ∈ D:

x ⊑ y =⇒ f (x) ⊑ f (y).

It is continuous if it is monotonic, and for all ω-chains (xn)n∈ω in D:

f ( G xn)= G f (xn). n∈ω n∈ω

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 13 / 48 Generalization to Domains

These ideas were elaborated into a beautiful mathematical theory of computation by Dana Scott and others. Domains are partial orders with least elements and least upper bounds of increasing sequences. The corresponding functions are the monotonic and continuous ones. A function f : D → E is monotonic if, for all x, y ∈ D:

x ⊑ y =⇒ f (x) ⊑ f (y).

It is continuous if it is monotonic, and for all ω-chains (xn)n∈ω in D:

f ( G xn)= G f (xn). n∈ω n∈ω

Continuity serves as an ‘intrinsic approximation’ to computability.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 13 / 48 Generalization to Domains

These ideas were elaborated into a beautiful mathematical theory of computation by Dana Scott and others. Domains are partial orders with least elements and least upper bounds of increasing sequences. The corresponding functions are the monotonic and continuous ones. A function f : D → E is monotonic if, for all x, y ∈ D:

x ⊑ y =⇒ f (x) ⊑ f (y).

It is continuous if it is monotonic, and for all ω-chains (xn)n∈ω in D:

f ( G xn)= G f (xn). n∈ω n∈ω

Continuity serves as an ‘intrinsic approximation’ to computability. X Models of type-free λ-calculus X =∼ X and many other things.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 13 / 48 Monotonicity and Continuity

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 14 / 48 Monotonicity and Continuity ∞ Examples We consider functions f : {0, 1} → B⊥.

1 f (x)= tt if x contains a 1, f (x)= ⊥ otherwise.

∞ 2 f (x)= tt if x contains a 1, f (0 )= ff, f (x)= ⊥ otherwise.

3 f (x)= tt if x contains a 1, f (x)= ff otherwise.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 14 / 48 Monotonicity and Continuity ∞ Examples We consider functions f : {0, 1} → B⊥.

1 f (x)= tt if x contains a 1, f (x)= ⊥ otherwise.

∞ 2 f (x)= tt if x contains a 1, f (0 )= ff, f (x)= ⊥ otherwise.

3 f (x)= tt if x contains a 1, f (x)= ff otherwise.

Of these: (1) is continuous, (2) is monotonic but not continuous, and (3) is not monotonic.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 14 / 48 Monotonicity and Continuity ∞ Examples We consider functions f : {0, 1} → B⊥.

1 f (x)= tt if x contains a 1, f (x)= ⊥ otherwise.

∞ 2 f (x)= tt if x contains a 1, f (0 )= ff, f (x)= ⊥ otherwise.

3 f (x)= tt if x contains a 1, f (x)= ff otherwise.

Of these: (1) is continuous, (2) is monotonic but not continuous, and (3) is not monotonic. The conceptual basis for monotonicity is that the information in Domain Theory is positive; negative information is not regarded as stable observable information. That is, if we are at some information state s, then for all we know, s may still increase to t, where s ⊑ t. This means that if we decide to produce information f (s) at s, then we must produce all this information, and possibly more, at t, yielding f (s) ⊑ f (t). Thus we can only make decisions at a given information state which are stable under every possible information increase from that state. This idea is very much akin to the use of partial orders in Kripke semantics for Intuitionistic Logic, in particular in connection with the interpretation of negation in that semantics. Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 14 / 48 Conceptual basis of continuity

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 15 / 48 Conceptual basis of continuity

The continuity condition, on the other hand, reflects the fact that a computational process will only have access to a finite amount of information at each finite stage of the computation. If we are provided with an infinite input, then any information we produce as output at any finite stage can only depend on some finite observation we have made of the input. This is reflected in one of the inequations corresponding to continuity:

f ( G xn) ⊑ G f (xn) n∈ω n∈ω

which says that the information produced at the limit of an infinite process of information increase is no more than what can be obtained as the limit of the information produced at the finite stages of the process. Note that the “other half” of continuity G f (xn) ⊑ f ( G xn) n∈ω n∈ω follows from monotonicity.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 15 / 48 The Fixpoint Theorem

Theorem (The Fixpoint Theorem) Let D be an ω-cpo with a least element, and f : D → D a continuous function. Then f has a least fixed point lfp(f ). Moreover, lfp(f ) is defined explicitly by:

n lfp(f )= G f (⊥). (1) n∈ω

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 16 / 48 The Fixpoint Theorem

Theorem (The Fixpoint Theorem) Let D be an ω-cpo with a least element, and f : D → D a continuous function. Then f has a least fixed point lfp(f ). Moreover, lfp(f ) is defined explicitly by:

n lfp(f )= G f (⊥). (1) n∈ω

This a central pillar of domain theory in its use in the semantics of computation, providing the basis for interpreting recursive definitions of all kinds.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 16 / 48 The Fixpoint Theorem

Theorem (The Fixpoint Theorem) Let D be an ω-cpo with a least element, and f : D → D a continuous function. Then f has a least fixed point lfp(f ). Moreover, lfp(f ) is defined explicitly by:

n lfp(f )= G f (⊥). (1) n∈ω

This a central pillar of domain theory in its use in the semantics of computation, providing the basis for interpreting recursive definitions of all kinds. Note however that the key fixpoint result for computability theory is the Kleene second recursion theorem, an intensional result.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 16 / 48 The Fixpoint Theorem

Theorem (The Fixpoint Theorem) Let D be an ω-cpo with a least element, and f : D → D a continuous function. Then f has a least fixed point lfp(f ). Moreover, lfp(f ) is defined explicitly by:

n lfp(f )= G f (⊥). (1) n∈ω

This a central pillar of domain theory in its use in the semantics of computation, providing the basis for interpreting recursive definitions of all kinds. Note however that the key fixpoint result for computability theory is the Kleene second recursion theorem, an intensional result. This theorem is strangely absent from Computer Science. There is surely some unexplored potential here ...

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 16 / 48 Trouble in Paradise

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 17 / 48 Trouble in Paradise The semantic theory of higher-type functional computation we get from domain theory seems compelling.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 17 / 48 Trouble in Paradise The semantic theory of higher-type functional computation we get from domain theory seems compelling. But there is a problem: a mismatch between what the semantic theory allows, and what we can actually compute in ‘natural’ programming languages.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 17 / 48 Trouble in Paradise The semantic theory of higher-type functional computation we get from domain theory seems compelling. But there is a problem: a mismatch between what the semantic theory allows, and what we can actually compute in ‘natural’ programming languages. Example: parallel or. por : B⊥ × B⊥ → B⊥ por ⊥ tt = tt = por tt ⊥, por ff ff = ff

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 17 / 48 Trouble in Paradise The semantic theory of higher-type functional computation we get from domain theory seems compelling. But there is a problem: a mismatch between what the semantic theory allows, and what we can actually compute in ‘natural’ programming languages. Example: parallel or. por : B⊥ × B⊥ → B⊥ por ⊥ tt = tt = por tt ⊥, por ff ff = ff This is the ‘strong or’ of Kleene 3-valued logic.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 17 / 48 Trouble in Paradise The semantic theory of higher-type functional computation we get from domain theory seems compelling. But there is a problem: a mismatch between what the semantic theory allows, and what we can actually compute in ‘natural’ programming languages. Example: parallel or. por : B⊥ × B⊥ → B⊥ por ⊥ tt = tt = por tt ⊥, por ff ff = ff This is the ‘strong or’ of Kleene 3-valued logic. This function lives in the semantic model, but is not definable in realistic languages — or those arising from logical calculi (essentially, the λ-calculus).

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 17 / 48 Trouble in Paradise The semantic theory of higher-type functional computation we get from domain theory seems compelling. But there is a problem: a mismatch between what the semantic theory allows, and what we can actually compute in ‘natural’ programming languages. Example: parallel or. por : B⊥ × B⊥ → B⊥ por ⊥ tt = tt = por tt ⊥, por ff ff = ff This is the ‘strong or’ of Kleene 3-valued logic. This function lives in the semantic model, but is not definable in realistic languages — or those arising from logical calculi (essentially, the λ-calculus). We can define second order functions which can only be distinguished by their values at parallel or; they will be observationally equivalent, but will have different denotations in a model which includes parallel or.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 17 / 48 Trouble in Paradise The semantic theory of higher-type functional computation we get from domain theory seems compelling. But there is a problem: a mismatch between what the semantic theory allows, and what we can actually compute in ‘natural’ programming languages. Example: parallel or. por : B⊥ × B⊥ → B⊥ por ⊥ tt = tt = por tt ⊥, por ff ff = ff This is the ‘strong or’ of Kleene 3-valued logic. This function lives in the semantic model, but is not definable in realistic languages — or those arising from logical calculi (essentially, the λ-calculus). We can define second order functions which can only be distinguished by their values at parallel or; they will be observationally equivalent, but will have different denotations in a model which includes parallel or. So definability and higher types are crucially important here.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 17 / 48 Trouble in Paradise The semantic theory of higher-type functional computation we get from domain theory seems compelling. But there is a problem: a mismatch between what the semantic theory allows, and what we can actually compute in ‘natural’ programming languages. Example: parallel or. por : B⊥ × B⊥ → B⊥ por ⊥ tt = tt = por tt ⊥, por ff ff = ff This is the ‘strong or’ of Kleene 3-valued logic. This function lives in the semantic model, but is not definable in realistic languages — or those arising from logical calculi (essentially, the λ-calculus). We can define second order functions which can only be distinguished by their values at parallel or; they will be observationally equivalent, but will have different denotations in a model which includes parallel or. So definability and higher types are crucially important here. This mismatch is known as failure of full abstraction.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 17 / 48 Sequentiality Consider the following functions, which are definable:

lsor(b1, b2) ≡ if b1 then tt else b2

rsor(b1, b2) ≡ if b2 then tt else b1 Note that lsor(tt, ⊥)= tt, lsor(⊥, tt)= ⊥ rsor(tt, ⊥)= ⊥, rsor(⊥, tt)= tt

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 18 / 48 Sequentiality Consider the following functions, which are definable:

lsor(b1, b2) ≡ if b1 then tt else b2

rsor(b1, b2) ≡ if b2 then tt else b1 Note that lsor(tt, ⊥)= tt, lsor(⊥, tt)= ⊥ rsor(tt, ⊥)= ⊥, rsor(⊥, tt)= tt

To get por, we need to run the processes for evaluating b1 and b2 in parallel.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 18 / 48 Sequentiality Consider the following functions, which are definable:

lsor(b1, b2) ≡ if b1 then tt else b2

rsor(b1, b2) ≡ if b2 then tt else b1 Note that lsor(tt, ⊥)= tt, lsor(⊥, tt)= ⊥ rsor(tt, ⊥)= ⊥, rsor(⊥, tt)= tt

To get por, we need to run the processes for evaluating b1 and b2 in parallel. This means that we need to have access, not just to the purely extensional information about the arguments — i.e. their values — but to their intensional descriptions.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 18 / 48 Sequentiality Consider the following functions, which are definable:

lsor(b1, b2) ≡ if b1 then tt else b2

rsor(b1, b2) ≡ if b2 then tt else b1 Note that lsor(tt, ⊥)= tt, lsor(⊥, tt)= ⊥ rsor(tt, ⊥)= ⊥, rsor(⊥, tt)= tt

To get por, we need to run the processes for evaluating b1 and b2 in parallel. This means that we need to have access, not just to the purely extensional information about the arguments — i.e. their values — but to their intensional descriptions. This form of parallel execution is not available in logical calculi and functional languages based on the λ-calculus.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 18 / 48 Sequentiality Consider the following functions, which are definable:

lsor(b1, b2) ≡ if b1 then tt else b2

rsor(b1, b2) ≡ if b2 then tt else b1 Note that lsor(tt, ⊥)= tt, lsor(⊥, tt)= ⊥ rsor(tt, ⊥)= ⊥, rsor(⊥, tt)= tt

To get por, we need to run the processes for evaluating b1 and b2 in parallel. This means that we need to have access, not just to the purely extensional information about the arguments — i.e. their values — but to their intensional descriptions. This form of parallel execution is not available in logical calculi and functional languages based on the λ-calculus. This raises the question: how can we capture the notion of sequential functional?

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 18 / 48 Sequentiality is extrinsic

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 19 / 48 Sequentiality is extrinsic We need additional information to characterize those functions which are sequential.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 19 / 48 Sequentiality is extrinsic We need additional information to characterize those functions which are sequential.

Theorem (Loader) The set of functionals definable in Finitary PCF, the typed λ-calculus over the booleans with conditionals and a term denoting ⊥, is not recursive.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 19 / 48 Sequentiality is extrinsic We need additional information to characterize those functions which are sequential.

Theorem (Loader) The set of functionals definable in Finitary PCF, the typed λ-calculus over the booleans with conditionals and a term denoting ⊥, is not recursive.

This rules out any hope of a reasonable intrinsic definition of the sequential functionals.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 19 / 48 Sequentiality is extrinsic We need additional information to characterize those functions which are sequential.

Theorem (Loader) The set of functionals definable in Finitary PCF, the typed λ-calculus over the booleans with conditionals and a term denoting ⊥, is not recursive.

This rules out any hope of a reasonable intrinsic definition of the sequential functionals. So the best we can do is to characterize which are the sequential functional processes — i.e. an intensional notion.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 19 / 48 Sequentiality is extrinsic We need additional information to characterize those functions which are sequential.

Theorem (Loader) The set of functionals definable in Finitary PCF, the typed λ-calculus over the booleans with conditionals and a term denoting ⊥, is not recursive.

This rules out any hope of a reasonable intrinsic definition of the sequential functionals. So the best we can do is to characterize which are the sequential functional processes — i.e. an intensional notion. Attempts by Kleene (Recursive Functionals and Quantifiers of Finite Type Revisited I–IV) and Gandy in 1980’s.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 19 / 48 Sequentiality is extrinsic We need additional information to characterize those functions which are sequential.

Theorem (Loader) The set of functionals definable in Finitary PCF, the typed λ-calculus over the booleans with conditionals and a term denoting ⊥, is not recursive.

This rules out any hope of a reasonable intrinsic definition of the sequential functionals. So the best we can do is to characterize which are the sequential functional processes — i.e. an intensional notion. Attempts by Kleene (Recursive Functionals and Quantifiers of Finite Type Revisited I–IV) and Gandy in 1980’s. This is what Game Semantics, developed in the 1990’s by SA, Radha Jagadeesan, Pasquale Malacaria, Martin Hyland and Luke Ong, achieved. Extensive subsequent developments by many people.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 19 / 48 Game Semantics: Basic Ideas

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 20 / 48 Game Semantics: Basic Ideas

Types of a programming language are interpreted as 2-person games: the Player is the System (program fragment) currently under consideration, while the Opponent is the Environment or context.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 20 / 48 Game Semantics: Basic Ideas

Types of a programming language are interpreted as 2-person games: the Player is the System (program fragment) currently under consideration, while the Opponent is the Environment or context.

Programs are strategies for these games.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 20 / 48 Game Semantics: Basic Ideas

Types of a programming language are interpreted as 2-person games: the Player is the System (program fragment) currently under consideration, while the Opponent is the Environment or context.

Programs are strategies for these games.

So game semantics is inherently a semantics of open systems; the meaning of a program is given by its potential interactions with its environment.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 20 / 48 Game Semantics: Basic Ideas

Types of a programming language are interpreted as 2-person games: the Player is the System (program fragment) currently under consideration, while the Opponent is the Environment or context.

Programs are strategies for these games.

So game semantics is inherently a semantics of open systems; the meaning of a program is given by its potential interactions with its environment.

Compositionality. The key operation is plugging two strategies together, so that each actualizes part of the environment of the other. (Usual game idea corresponds to a closed system, with no residual environment). This exploits the game-theoretic P/O duality.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 20 / 48 Types as Games

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 21 / 48 Types as Games

A simple example of a basic datatype of natural numbers:

N = {q n | n ∈ N}

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 21 / 48 Types as Games

A simple example of a basic datatype of natural numbers:

N = {q n | n ∈ N}

Note a further classification of moves, orthgonal to the P/O duality; q is a question, n are answers. This turns out to be important for capturing control features of programming languages.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 21 / 48 Types as Games

A simple example of a basic datatype of natural numbers:

N = {q n | n ∈ N}

Note a further classification of moves, orthgonal to the P/O duality; q is a question, n are answers. This turns out to be important for capturing control features of programming languages.

Forming function or procedure types A ⇒ B. We form a new game from disjoint copies of A and B, with P/O roles in A reversed. Thus we think of A ⇒ B as a structured interface to the Environment; in B, we interact with the caller of the procedure, covariantly, while in A, we interact with the argument supplied to the procedure call, contravariantly.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 21 / 48 Example Strategy for λf : N ⇒ N. λx : N. f (x) + 2.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 22 / 48 Example Strategy for λf : N ⇒ N. λx : N. f (x) + 2. (This names the procedure P(f , x) such that P(f , x) returns f (x) + 2.)

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 22 / 48 Example Strategy for λf : N ⇒ N. λx : N. f (x) + 2. (This names the procedure P(f , x) such that P(f , x) returns f (x) + 2.)

( N ⇒ N ) ⇒ N ⇒ N

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 22 / 48 Example

Strategy for λf : N ⇒ N. λx : N. f (x) + 2. ( N ⇒ N ) ⇒ N ⇒ N O

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 23 / 48 Example

Strategy for λf : N ⇒ N. λx : N. f (x) + 2. ( N ⇒ N ) ⇒ N ⇒ N O q

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 24 / 48 Example

Strategy for λf : N ⇒ N. λx : N. f (x) + 2. ( N ⇒ N ) ⇒ N ⇒ N O q P q

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 25 / 48 Example

Strategy for λf : N ⇒ N. λx : N. f (x) + 2. ( N ⇒ N ) ⇒ N ⇒ N O q P q O q

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 26 / 48 Example

Strategy for λf : N ⇒ N. λx : N. f (x) + 2. ( N ⇒ N ) ⇒ N ⇒ N O q P q O q P q

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 27 / 48 Example

Strategy for λf : N ⇒ N. λx : N. f (x) + 2. ( N ⇒ N ) ⇒ N ⇒ N O q P q O q P q O n

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 28 / 48 Example

Strategy for λf : N ⇒ N. λx : N. f (x) + 2. ( N ⇒ N ) ⇒ N ⇒ N O q P q O q P q O n P n

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 29 / 48 Example

Strategy for λf : N ⇒ N. λx : N. f (x) + 2. ( N ⇒ N ) ⇒ N ⇒ N O q P q O q P q O n P n O m

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 30 / 48 Example

Strategy for λf : N ⇒ N. λx : N. f (x) + 2. ( N ⇒ N ) ⇒ N ⇒ N O q P q O q P q O n P n O m P m + 2

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 31 / 48 Composition

Apply λf : N ⇒ N. λx : N. f (x)+2 to λx : N. x 2.

N ⇒ N ( N ⇒ N ) × N ⇒ N

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 32 / 48 Composition

Apply λf : N ⇒ N. λx : N. f (x)+2 to λx : N. x 2.

N ⇒ N ( N ⇒ N ) × N ⇒ N q

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 33 / 48 Composition

Apply λf : N ⇒ N. λx : N. f (x)+2 to λx : N. x 2.

N ⇒ N ( N ⇒ N ) × N ⇒ N q q q

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 34 / 48 Composition

Apply λf : N ⇒ N. λx : N. f (x)+2 to λx : N. x 2.

N ⇒ N ( N ⇒ N ) × N ⇒ N q q q q q

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 35 / 48 Composition

Apply λf : N ⇒ N. λx : N. f (x)+2 to λx : N. x 2.

N ⇒ N ( N ⇒ N ) × N ⇒ N q q q q q q

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 36 / 48 Composition

Apply λf : N ⇒ N. λx : N. f (x)+2 to λx : N. x 2.

N ⇒ N ( N ⇒ N ) × N ⇒ N q q q q q q n

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 37 / 48 Composition

Apply λf : N ⇒ N. λx : N. f (x)+2 to λx : N. x 2.

N ⇒ N ( N ⇒ N ) × N ⇒ N q q q q q q n n n

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 38 / 48 Composition

Apply λf : N ⇒ N. λx : N. f (x)+2 to λx : N. x 2.

N ⇒ N ( N ⇒ N ) × N ⇒ N q q q q q q n n n n2 n2

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 39 / 48 Composition Apply λf : N ⇒ N. λx : N. f (x)+2 to λx : N. x 2.

N ⇒ N ( N ⇒ N ) × N ⇒ N q q q q q q n n n n2 n2 n2 +2

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 40 / 48 Composition Apply λf : N ⇒ N. λx : N. f (x)+2 to λx : N. x 2.

N ⇒ N ( N ⇒ N ) × N ⇒ N q q q q q q n n n n2 n2 n2 +2

Note that the residual strategy (after we hide the part where the interaction between function and argument occurs) is that for λx. x 2 + 2. Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 40 / 48 Technical Notes

Games and strategies organize themselves into a very nice mathematical structure — a cartesian closed category. We can then use standard methods of to give a compositional semantics for PCF.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 41 / 48 Technical Notes

Games and strategies organize themselves into a very nice mathematical structure — a cartesian closed category. We can then use standard methods of denotational semantics to give a compositional semantics for PCF. The key result is:

Every compact (even: recursive) strategy is definable by a PCF term

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 41 / 48 Technical Notes

Games and strategies organize themselves into a very nice mathematical structure — a cartesian closed category. We can then use standard methods of denotational semantics to give a compositional semantics for PCF. The key result is:

Every compact (even: recursive) strategy is definable by a PCF term

This is a completeness theorem! (‘Full completeness’).

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 41 / 48 Technical Notes

Games and strategies organize themselves into a very nice mathematical structure — a cartesian closed category. We can then use standard methods of denotational semantics to give a compositional semantics for PCF. The key result is:

Every compact (even: recursive) strategy is definable by a PCF term

This is a completeness theorem! (‘Full completeness’). Cf. Turing’s analysis, ordinary logical completeness wrt. provability, etc.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 41 / 48 Technical Notes

Games and strategies organize themselves into a very nice mathematical structure — a cartesian closed category. We can then use standard methods of denotational semantics to give a compositional semantics for PCF. The key result is:

Every compact (even: recursive) strategy is definable by a PCF term

This is a completeness theorem! (‘Full completeness’). Cf. Turing’s analysis, ordinary logical completeness wrt. provability, etc. First move is head variable, or last rule in a proof. Decomposing the strategy progressively uncovers the defining term.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 41 / 48 Technical Notes

Games and strategies organize themselves into a very nice mathematical structure — a cartesian closed category. We can then use standard methods of denotational semantics to give a compositional semantics for PCF. The key result is:

Every compact (even: recursive) strategy is definable by a PCF term

This is a completeness theorem! (‘Full completeness’). Cf. Turing’s analysis, ordinary logical completeness wrt. provability, etc. First move is head variable, or last rule in a proof. Decomposing the strategy progressively uncovers the defining term. In order to achieve this result, strategies must be constrained. This is our first major example of sub- (or non-) expressiveness.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 41 / 48 Constraints on Strategies

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 42 / 48 Constraints on Strategies

Two main kinds:

1 Strategies do not have perfect information about the previous computation history (play of the game).

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 42 / 48 Constraints on Strategies

Two main kinds:

1 Strategies do not have perfect information about the previous computation history (play of the game). Why? ft1t2

When it is evaluated (called) by f , t2 should not ‘know’ whether t1 has already been evaluated — and vice versa.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 42 / 48 Constraints on Strategies

Two main kinds:

1 Strategies do not have perfect information about the previous computation history (play of the game). Why? ft1t2

When it is evaluated (called) by f , t2 should not ‘know’ whether t1 has already been evaluated — and vice versa. Note that if we had imperative state, the arguments could use this to pass such information to each other. 2 Properly nested call-return flow of control. The ‘stack discipline’. No non-local control.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 42 / 48 Constraints on Strategies

Two main kinds:

1 Strategies do not have perfect information about the previous computation history (play of the game). Why? ft1t2

When it is evaluated (called) by f , t2 should not ‘know’ whether t1 has already been evaluated — and vice versa. Note that if we had imperative state, the arguments could use this to pass such information to each other. 2 Properly nested call-return flow of control. The ‘stack discipline’. No non-local control. Both these constraints can be formulated precisely (the first as ‘innocence’ or ‘history-freedom’, the second as ‘well-bracketing’), and shown to be closed under composition etc.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 42 / 48 Constraints on Strategies

Two main kinds:

1 Strategies do not have perfect information about the previous computation history (play of the game). Why? ft1t2

When it is evaluated (called) by f , t2 should not ‘know’ whether t1 has already been evaluated — and vice versa. Note that if we had imperative state, the arguments could use this to pass such information to each other. 2 Properly nested call-return flow of control. The ‘stack discipline’. No non-local control. Both these constraints can be formulated precisely (the first as ‘innocence’ or ‘history-freedom’, the second as ‘well-bracketing’), and shown to be closed under composition etc. The resulting cartesian closed categories of games and constrained strategies yield the definability results.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 42 / 48 Discussion of the PCF Result

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 43 / 48 Discussion of the PCF Result

We get a definability result — but strategies are much finer grained than functions. They correspond to certain ‘PCF evaluation trees’. To get an equationally fully abstract model, we must quotient the games model.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 43 / 48 Discussion of the PCF Result

We get a definability result — but strategies are much finer grained than functions. They correspond to certain ‘PCF evaluation trees’. To get an equationally fully abstract model, we must quotient the games model. This is unavoidable by Loader’s Theorem: the fully abstract model even for Finitary PCF is not effectively presentable.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 43 / 48 Discussion of the PCF Result

We get a definability result — but strategies are much finer grained than functions. They correspond to certain ‘PCF evaluation trees’. To get an equationally fully abstract model, we must quotient the games model. This is unavoidable by Loader’s Theorem: the fully abstract model even for Finitary PCF is not effectively presentable. What is the significance of the result? In retrospect, the real payoff is in other cases — but the PCF result is the keystone of the whole development.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 43 / 48 Discussion of the PCF Result

We get a definability result — but strategies are much finer grained than functions. They correspond to certain ‘PCF evaluation trees’. To get an equationally fully abstract model, we must quotient the games model. This is unavoidable by Loader’s Theorem: the fully abstract model even for Finitary PCF is not effectively presentable. What is the significance of the result? In retrospect, the real payoff is in other cases — but the PCF result is the keystone of the whole development. More generally: the point of conceptual interest is to find positive reasons — structural invariants — for non-expressiveness.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 43 / 48 Discussion of the PCF Result

We get a definability result — but strategies are much finer grained than functions. They correspond to certain ‘PCF evaluation trees’. To get an equationally fully abstract model, we must quotient the games model. This is unavoidable by Loader’s Theorem: the fully abstract model even for Finitary PCF is not effectively presentable. What is the significance of the result? In retrospect, the real payoff is in other cases — but the PCF result is the keystone of the whole development. More generally: the point of conceptual interest is to find positive reasons — structural invariants — for non-expressiveness. This is a positive story for a form of intensionality.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 43 / 48 Discussion of the PCF Result

We get a definability result — but strategies are much finer grained than functions. They correspond to certain ‘PCF evaluation trees’. To get an equationally fully abstract model, we must quotient the games model. This is unavoidable by Loader’s Theorem: the fully abstract model even for Finitary PCF is not effectively presentable. What is the significance of the result? In retrospect, the real payoff is in other cases — but the PCF result is the keystone of the whole development. More generally: the point of conceptual interest is to find positive reasons — structural invariants — for non-expressiveness. This is a positive story for a form of intensionality. Relaxing the constraints which characterize functional computation leads to fully abstract models for languages with (locally scoped) state, or control operators, or both.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 43 / 48 The Game Semantics Landscape

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 44 / 48 The Game Semantics Landscape Game semantics has proved to be a flexible and powerful paradigm for constructing highly structured fully abstract semantics for languages with a wide range of computational features: (higher-order) functions and procedures call by name and call by value locally scoped state general reference types control features (continuations, exceptions) non-determinism, probabilities concurrency names and freshness

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 44 / 48 The Game Semantics Landscape Game semantics has proved to be a flexible and powerful paradigm for constructing highly structured fully abstract semantics for languages with a wide range of computational features: (higher-order) functions and procedures call by name and call by value locally scoped state general reference types control features (continuations, exceptions) non-determinism, probabilities concurrency names and freshness In many cases, game semantics have yielded the first, and often still the only, semantics construction of a fully abstract model for the language in question.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 44 / 48 The Game Semantics Landscape Game semantics has proved to be a flexible and powerful paradigm for constructing highly structured fully abstract semantics for languages with a wide range of computational features: (higher-order) functions and procedures call by name and call by value locally scoped state general reference types control features (continuations, exceptions) non-determinism, probabilities concurrency names and freshness In many cases, game semantics have yielded the first, and often still the only, semantics construction of a fully abstract model for the language in question. Where sufficient computational features (typically state or control) are present, the game semantics captures the fully abstract model directly, without the need for any quotient.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 44 / 48 The Game Semantics Landscape Game semantics has proved to be a flexible and powerful paradigm for constructing highly structured fully abstract semantics for languages with a wide range of computational features: (higher-order) functions and procedures call by name and call by value locally scoped state general reference types control features (continuations, exceptions) non-determinism, probabilities concurrency names and freshness In many cases, game semantics have yielded the first, and often still the only, semantics construction of a fully abstract model for the language in question. Where sufficient computational features (typically state or control) are present, the game semantics captures the fully abstract model directly, without the need for any quotient. Intensions become extensions!

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 44 / 48 The Game Semantics Landscape Game semantics has proved to be a flexible and powerful paradigm for constructing highly structured fully abstract semantics for languages with a wide range of computational features: (higher-order) functions and procedures call by name and call by value locally scoped state general reference types control features (continuations, exceptions) non-determinism, probabilities concurrency names and freshness In many cases, game semantics have yielded the first, and often still the only, semantics construction of a fully abstract model for the language in question. Where sufficient computational features (typically state or control) are present, the game semantics captures the fully abstract model directly, without the need for any quotient. Intensions become extensions! The beginnings of a structural theory of processes. Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 44 / 48 Mathematical Aside

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 45 / 48 Mathematical Aside

Categories of games and strategies have fascinating mathematical structure in their own right. They give rise to: Constructions of free categories with structure of various kinds Full completeness results characterizing the “space of proofs” for various logical systems There are even connections with geometry, e.g. Temperley-Lieb and other diagram algebras.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 45 / 48 Algorithmic Game Semantics

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 46 / 48 Algorithmic Game Semantics

We can take advantage of the concrete nature of game semantics. A play is a sequence of moves, so a strategy can be represented by the set of its plays, i.e. by a language over the alphabet of moves, and hence by an automaton.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 46 / 48 Algorithmic Game Semantics

We can take advantage of the concrete nature of game semantics. A play is a sequence of moves, so a strategy can be represented by the set of its plays, i.e. by a language over the alphabet of moves, and hence by an automaton. There are significant finite-state fragments of the semantics for various interesting languages, as first observed by Ghica and McCusker (ICALP 00).

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 46 / 48 Algorithmic Game Semantics

We can take advantage of the concrete nature of game semantics. A play is a sequence of moves, so a strategy can be represented by the set of its plays, i.e. by a language over the alphabet of moves, and hence by an automaton. There are significant finite-state fragments of the semantics for various interesting languages, as first observed by Ghica and McCusker (ICALP 00). This means we can compositionally construct automata as (representations of) the meanings of open (incomplete) programs, giving a powerful basis for compositional software model-checking.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 46 / 48 Algorithmic Game Semantics

We can take advantage of the concrete nature of game semantics. A play is a sequence of moves, so a strategy can be represented by the set of its plays, i.e. by a language over the alphabet of moves, and hence by an automaton. There are significant finite-state fragments of the semantics for various interesting languages, as first observed by Ghica and McCusker (ICALP 00). This means we can compositionally construct automata as (representations of) the meanings of open (incomplete) programs, giving a powerful basis for compositional software model-checking. There has now been an extensive development of these ideas, by Ghica, Ong, Murawski, Tzevelekos et al.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 46 / 48 Some Dreams

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 47 / 48 Some Dreams

Can we use intensional recursion to give more realistic models of reflexive phenomena in biology, cognition, economics, etc.?

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 47 / 48 Some Dreams

Can we use intensional recursion to give more realistic models of reflexive phenomena in biology, cognition, economics, etc.? Working with codes seems more like what biological or social mechanisms might plausibly do, rather than with abstract mathematical objects in extenso.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 47 / 48 Some Dreams

Can we use intensional recursion to give more realistic models of reflexive phenomena in biology, cognition, economics, etc.? Working with codes seems more like what biological or social mechanisms might plausibly do, rather than with abstract mathematical objects in extenso.

How does this relate to current interest in higher categories, homotopy type theory etc., where equalities are replaced by witnesses?

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 47 / 48 Some Dreams

Can we use intensional recursion to give more realistic models of reflexive phenomena in biology, cognition, economics, etc.? Working with codes seems more like what biological or social mechanisms might plausibly do, rather than with abstract mathematical objects in extenso.

How does this relate to current interest in higher categories, homotopy type theory etc., where equalities are replaced by witnesses?

Develop a positive theory of intensional structures, and find the right notions of invariance.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 47 / 48 Some Dreams

Can we use intensional recursion to give more realistic models of reflexive phenomena in biology, cognition, economics, etc.? Working with codes seems more like what biological or social mechanisms might plausibly do, rather than with abstract mathematical objects in extenso.

How does this relate to current interest in higher categories, homotopy type theory etc., where equalities are replaced by witnesses?

Develop a positive theory of intensional structures, and find the right notions of invariance.

The dream: to use this to give some (best-possible) intrinsic characterization of computability, and of complexity classes.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 47 / 48 Some Dreams

Can we use intensional recursion to give more realistic models of reflexive phenomena in biology, cognition, economics, etc.? Working with codes seems more like what biological or social mechanisms might plausibly do, rather than with abstract mathematical objects in extenso.

How does this relate to current interest in higher categories, homotopy type theory etc., where equalities are replaced by witnesses?

Develop a positive theory of intensional structures, and find the right notions of invariance.

The dream: to use this to give some (best-possible) intrinsic characterization of computability, and of complexity classes.

Could this even be the missing ingredient to help us separate classes? Well, we can dream!

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 47 / 48 Some References

S. Abramsky and R. Jagadeesan, “Games and Full Completeness for Multiplicative Linear Logic”, Journal of Symbolic Logic, (1994), vol. 59, no. 2, 543–574. S. Abramsky, Semantics of Interaction: an introduction to Game Semantics, in Proceedings of the 1996 CLiCS Summer School, Isaac Newton Institute, P. Dybjer and A. Pitts, eds. (Cambridge University Press) 1997, 1–31. S. Abramsky and G. McCusker, Game Semantics, in Computational Logic: Proceedings of the 1997 Marktoberdorf Summer School, H. Schwichtenberg and U. Berger, eds. (Springer-Verlag) 1999, 1–56. S. Abramsky, Algorithmic Game Semantics: A Tutorial Introduction, in Proof and System Reliability, H. Schichtenberg and R. Steinbruggen, eds., Proceedings of the NATO Advanced Study Institute, Marktoberdorf, Kluwer Academic Publishers, 2001, 21–47. S. Abramsky, Information, Processes and Games. In: Handbook of the Philosophy of Information, ed. P. Adriaans and J. van Benthem, Elsevier, 2008, 583–649.

Samson Abramsky (Oxford University Department of ComputerIntensionality,Science) Definability and Computation 48 / 48