FoPSS 2019
3rd Summer School
- n Foundations of Programming
and Software Systems
Warsaw, 10-15 September, 2019
Nominal Techniques
[ ] A Nominal Techniques Warsaw, 10-15 September, 2019 FoPSS - - PowerPoint PPT Presentation
FoPSS 2019 3rd Summer School on Foundations of Programming and Software Systems [ ] A Nominal Techniques Warsaw, 10-15 September, 2019 FoPSS Summer Schools on Foundations of Programming and Software Systems Supported by: This time also
FoPSS 2019
3rd Summer School
and Software Systems
Warsaw, 10-15 September, 2019
Nominal Techniques
FoPSS
2Summer Schools on Foundations of Programming and Software Systems
Supported by: This time also by:
FoPSS
32017: Braga (Portugal)
Probabilistic Programming
FoPSS
32017: Braga (Portugal)
Probabilistic Programming
2018: Oxford (UK)
Logic and Learning
FoPSS
32017: Braga (Portugal)
Probabilistic Programming
2018: Oxford (UK)
Logic and Learning
2019: Warsaw (Poland)
Nominal Techniques
Nominal game semantics
FoPSS 2019
4Our lecturers:
Nominal sets and functional programming
Computation theory with atoms
Nominal rewriting and unification
Nominal process calculi and modal logics
Advanced nominal techniques
Computation theory with atoms II
FoPSS 2019
Warsaw, 10-11 September, 2019
Basic Nominal Techniques
Bartek Klin University of Warsaw
What is it all about?
6local names and name dependence mathematics of, and computation with: Nominal techniques:
What is it all about?
6local names and name dependence mathematics of, and computation with: highly symmetrical structures Nominal techniques:
What is it all about?
6local names and name dependence mathematics of, and computation with: highly symmetrical structures “slightly infinite” structures Nominal techniques:
What is it all about?
6local names and name dependence mathematics of, and computation with: highly symmetrical structures “slightly infinite” structures structures acessible via limited interfaces Nominal techniques:
What is it all about?
7local names and name dependence mathematics of, and computation with: highly symmetrical structures “slightly infinite” structures structures acessible via limited interfaces Nominal techniques:
Concrete and abstract syntax
82 ∗ 3 + 3 ∗ (7 − 2) +
−
∗ 2 3 7 ∗ 3 2
parsing
Concrete and abstract syntax
82 ∗ 3 + 3 ∗ (7 − 2) +
−
∗ 2 3 7 ∗ 3 2
parsing Algebraic features:
Complications with local names
93
parsing
let x = 3 in let x = x + 1 in x + 5 let
x
let
x
+
x 1
+
x 5
Complications with local names
93
parsing
let x = 3 in let x = x + 1 in x + 5 let
x
let
x
+
x 1
+
x 5
Complications with local names
93
parsing
let x = 3 in let x = x + 1 in x + 5 let
x
let
x
+
x 1
+
x 5
Complications with local names
93
parsing
let x = 3 in let x = x + 1 in x + 5 let
x
let
x
+
x 1
+
x 5
Expressions depend
Name dependence
10Idea: Let every expression come equipped (or: atoms) that occur in it with an explicit dependence on some names
Name dependence
10Idea: Let every expression come equipped (or: atoms) that occur in it with an explicit dependence on some names nominal expressions
Name dependence
10Idea: Let every expression come equipped (or: atoms) that occur in it with an explicit dependence on some names nominal expressions More ambitious idea: Let everything come equipped (or: atoms) that occur in it with an explicit dependence on some names
Name dependence
10Idea: Let every expression come equipped (or: atoms) that occur in it with an explicit dependence on some names nominal expressions More ambitious idea: Let everything come equipped (or: atoms) that occur in it with an explicit dependence on some names nominal sets
Name dependence
11What does it mean to depend on a name? Q:
Name dependence
11What does it mean to depend on a name? Q: A: depends on a name
X
a a
if renaming to any other name would alter X
Name dependence
11What does it mean to depend on a name? Q: A: depends on a name
X
a a
if renaming to any other name would alter X Idea revisited: Let everything come equipped affects it with information on how renaming names nominal sets
What is it all about?
12local names and name dependence mathematics of, and computation with: highly symmetrical structures “slightly infinite” structures structures acessible via limited interfaces Nominal techniques:
A graph built of atoms
13atomic names:
ab a 6= b a 6= c ab bc
a, b, c, d, e, . . .
A graph built of atoms
13ab ac ad ba bc bd ca cb cd da db dc
atomic names:
ab a 6= b a 6= c ab bc
a, b, c, d, e, . . .
A graph built of atoms
13ab ac ad ba bc bd ca cb cd da db dc
atomic names:
ab a 6= b a 6= c ab bc
a, b, c, d, e, . . .
atom renaming:
a
b
c
A graph built of atoms
13ab ac ad ba bc bd ca cb cd da db dc
atomic names:
ab a 6= b a 6= c ab bc
a, b, c, d, e, . . .
atom renaming:
a
b
c
A graph built of atoms
13ab ac ad ba bc bd ca cb cd da db dc
atomic names:
ab a 6= b a 6= c ab bc
a, b, c, d, e, . . .
atom renaming:
a
b
c
A graph built of atoms
13ab ac ad ba bc bd ca cb cd da db dc
atomic names:
ab a 6= b a 6= c ab bc
a, b, c, d, e, . . .
atom renaming:
a
b
c
A graph built of atoms
13ab ac ad ba bc bd ca cb cd da db dc
atomic names:
ab a 6= b a 6= c ab bc
a, b, c, d, e, . . .
atom renaming:
a
b
c
A graph built of atoms
13ab ac ad ba bc bd ca cb cd da db dc
atomic names:
ab a 6= b a 6= c ab bc
a, b, c, d, e, . . .
atom renaming:
a
b
c
A graph built of atoms
13ab ac ad ba bc bd ca cb cd da db dc
atomic names:
ab a 6= b a 6= c ab bc
a, b, c, d, e, . . .
atom renaming:
a
b
c
What is it all about?
14local names and name dependence mathematics of, and computation with: highly symmetrical structures “slightly infinite” structures structures acessible via limited interfaces Nominal techniques:
Slightly infinite
15ab a 6= b a 6= c ab bc
The same graph:
Slightly infinite
15: a 6= b ^ b 6= c ^ a 6= c
ab a 6= b a 6= c ab bc
The same graph:
Slightly infinite
15: a 6= b ^ b 6= c ^ a 6= c
ab a 6= b a 6= c ab bc
The same graph: Infinite, but presented by finite means
An example problem
16ab a 6= b a 6= c ab bc
An example problem
16Is it 3-colorable?
ab a 6= b a 6= c ab bc
An example problem
16Is it 3-colorable?
ab a 6= b a 6= c ab bc
No.
ab ad bc be ca cd db de ea ec
An example problem
16Is it 3-colorable? Is 3-colorability decidable?
ab a 6= b a 6= c ab bc
No.
ab ad bc be ca cd db de ea ec
What is it all about?
17local names and name dependence mathematics of, and computation with: highly symmetrical structures “slightly infinite” structures structures acessible via limited interfaces Nominal techniques:
Computer Science 101
18Theorem: Every algorithm to sort numbers must work in time .
n
Ω(n log n)
Computer Science 101
18Theorem: Every algorithm to sort numbers must work in time .
n
Ω(n log n)
in the comparison model
Computer Science 101
18Theorem: Every algorithm to sort numbers must work in time .
n
Ω(n log n)
in the comparison model Here, numbers are atoms accessible via relations:
= <
Computer Science 101
18Theorem: Every algorithm to sort numbers must work in time .
n
Ω(n log n)
in the comparison model Here, numbers are atoms accessible via relations:
= <
This amounts to restricting the class
Nominal Sets: Basic Defnitions
Nominal Sets: Basic Defnitions
Atoms
20Let be an infinite, countable set of atoms.
A a, b, c, d, e, . . . ∈ A
Atoms
20Let be an infinite, countable set of atoms.
A a, b, c, d, e, . . . ∈ A Aut(A) - the group of all bijections of A
Atoms
20Let be an infinite, countable set of atoms.
A a, b, c, d, e, . . . ∈ A Aut(A) - the group of all bijections of A (π · σ) · ρ = π · (σ · ρ) π · π−1 = id π · id = π = id · π
Atoms
20Let be an infinite, countable set of atoms.
A a, b, c, d, e, . . . ∈ A Aut(A) - the group of all bijections of A (π · σ) · ρ = π · (σ · ρ) π · π−1 = id π · id = π = id · π
the dot omitted frow now on
Atoms
20Let be an infinite, countable set of atoms.
A a, b, c, d, e, . . . ∈ A Aut(A) - the group of all bijections of A (a b) ∈ Aut(A) - the swap of and
a
b
(π · σ) · ρ = π · (σ · ρ) π · π−1 = id π · id = π = id · π
the dot omitted frow now on
Atoms
20Let be an infinite, countable set of atoms.
A a, b, c, d, e, . . . ∈ A Aut(A) - the group of all bijections of A (a b) ∈ Aut(A) - the swap of and
a
b
(a b)(b c)(c a) = (b c)
For example:
(a b)−1 = (a b) (π · σ) · ρ = π · (σ · ρ) π · π−1 = id π · id = π = id · π
the dot omitted frow now on
Von Neumann hierarchy
21U0 = ∅ Uβ = S
α<β Uα
A hierarchy of universes:
Uα+1 = PUα
defined for every ordinal number.
Von Neumann hierarchy
21U0 = ∅ Uβ = S
α<β Uα
A hierarchy of universes:
Uα+1 = PUα
defined for every ordinal number.
Elements of sets are other sets, in a well founded way
Von Neumann hierarchy
21U0 = ∅ Uβ = S
α<β Uα
A hierarchy of universes:
Uα+1 = PUα
defined for every ordinal number.
Elements of sets are other sets, in a well founded way
Every set sits somewhere in this hierarchy.
Sets with atoms
22A - a countable set of atoms
U0 = ∅ Uα+1 = PUα + A Uβ = S
α<β Uα
A hierarchy of universes:
Sets with atoms
22A - a countable set of atoms
U0 = ∅ Uα+1 = PUα + A Uβ = S
α<β Uα
A hierarchy of universes:
Sets with atoms
22A - a countable set of atoms
Elements of sets with atoms are atoms
Renaming atoms
23A canonical renaming action:
· : U × Aut(A) → U
Renaming atoms
23A canonical renaming action:
· : U × Aut(A) → U
a · π = π(a) X · π = {x · π | x ∈ X}
Renaming atoms
23A canonical renaming action:
· : U × Aut(A) → U
a · π = π(a) X · π = {x · π | x ∈ X}
This is a group action of :
Aut(A) x · (πσ) = (x · π) · σ x · id = x
Renaming atoms
23A canonical renaming action:
· : U × Aut(A) → U
a · π = π(a) X · π = {x · π | x ∈ X}
This is a group action of :
Aut(A) x · (πσ) = (x · π) · σ x · id = x
Fact: For every , the function
π · π
is a bijection on .
U
Finite support
24S ⊆ A supports if ∀a ∈ S.π(a) = a x · π = x
implies
x
Finite support
24S ⊆ A supports if ∀a ∈ S.π(a) = a x · π = x
implies
π ∈ AutS(A)
x
Finite support
24S ⊆ A supports if ∀a ∈ S.π(a) = a x · π = x
implies A legal set with atoms, or nominal set:
π ∈ AutS(A)
x
Finite support
24S ⊆ A supports if ∀a ∈ S.π(a) = a x · π = x
implies A legal set with atoms, or nominal set:
A set is equivariant if it has empty support.
π ∈ AutS(A)
x
Examples
25{a} a ∈ A
is supported by
Examples
25{a} a ∈ A
is supported by
A
is equivariant
Examples
25{a} a ∈ A
is supported by
S S ⊆ A
is supported by
A
is equivariant
Examples
25{a} a ∈ A
is supported by
S S ⊆ A
is supported by
A \ S S
is supported by
A
is equivariant
Examples
25{a} a ∈ A
is supported by
S S ⊆ A
is supported by
A \ S S
is supported by
A
is equivariant Fact: is fin. supp. iff it is finite or co-finite
S ⊆ A
Examples
25{a} a ∈ A
is supported by
S S ⊆ A
is supported by
A \ S S
is supported by
A
is equivariant Fact: is fin. supp. iff it is finite or co-finite
S ⊆ A A(2) = {(d, e) | d, e 2 A, d 6= e} is equivariant
Examples
25{a} a ∈ A
is supported by
S S ⊆ A
is supported by
A \ S S
is supported by
A
is equivariant Fact: is fin. supp. iff it is finite or co-finite
S ⊆ A A(2) = {(d, e) | d, e 2 A, d 6= e} is equivariant ✓A 2 ◆ = {{d, e} | d, e 2 A, d 6= e} is equivariant
Basic Properties
Closure properties
27Fact: if and are legal sets then , , , , are legal. X Y X ∪ Y X ∩ Y X + Y X \ Y X × Y
Closure properties
27Fact: if and are legal sets then , , , , are legal. X Y X ∪ Y X ∩ Y X + Y X \ Y X × Y Indeed: if
S supports and supports X
T Y then S ∪ T supports , , ... X ∪ Y X ∩ Y
Closure properties
27Fact: if and are legal sets then , , , , are legal. X Y X ∪ Y X ∩ Y X + Y X \ Y X × Y Indeed: if
S supports and supports X
T Y then S ∪ T supports , , ... X ∪ Y X ∩ Y (But: does not support !) S ∩ T X ∩ Y
Closure properties
27Fact: if and are legal sets then , , , , are legal. X Y X ∪ Y X ∩ Y X + Y X \ Y X × Y Indeed: if
S supports and supports X
T Y then S ∪ T supports , , ... X ∪ Y X ∩ Y (But: does not support !) S ∩ T X ∩ Y Fact: if is legal and is finitely supported then is legal. X Y ⊆ X Y
Powersets
28Fact: is not legal (though it is equivariant).
PA
Powersets
28Fact: is not legal (though it is equivariant).
PA
Define: is finitely supported
PfsX = {Y ⊆ X | Y }
Powersets
28Fact: is not legal (though it is equivariant).
PA
Define: is finitely supported
PfsX = {Y ⊆ X | Y }
Fact: if is legal then is legal. X PfsX
Powersets
28Fact: is not legal (though it is equivariant).
PA
Define: is finitely supported
PfsX = {Y ⊆ X | Y }
Fact: if is legal then is legal. X PfsX Key step: if supports then supports .
S X S · π X · π
Powersets
28Fact: is not legal (though it is equivariant).
PA
Define: is finitely supported
PfsX = {Y ⊆ X | Y }
Fact: if is legal then is legal. X PfsX Key step: if supports then supports .
S X S · π X · π σ ∈ AutS·π(A) = ⇒ πσπ−1 ∈ AutS(A)
Powersets
28Fact: is not legal (though it is equivariant).
PA
Define: is finitely supported
PfsX = {Y ⊆ X | Y }
Fact: if is legal then is legal. X PfsX Key step: if supports then supports .
S X S · π X · π σ ∈ AutS·π(A) = ⇒ πσπ−1 ∈ AutS(A) X · π = (X · πσπ−1) · π = (X · π) · σ
Actions and supports
29Fact: if supports and then .
S X π|S = σ|S X · π = X · σ
Actions and supports
29Fact: if supports and then .
S X π|S = σ|S X · π = X · σ
Proof: if then
π|S = σ|S πσ−1 ∈ AutS(A)
so X · σ = (X · πσ−1) · σ = X · π
Actions and supports
29Fact: if supports and then .
S X π|S = σ|S X · π = X · σ
Proof: if then
π|S = σ|S πσ−1 ∈ AutS(A)
so X · σ = (X · πσ−1) · σ = X · π
Equivariant relations
30A (binary) relation is a set of pairs. Let’s see what equivariance means for such sets: R · π = R
(x, y) ∈ R = ⇒ (x, y) · π ∈ R
iff
Equivariant relations
30A (binary) relation is a set of pairs.
R ⊆ X × Y
is equivariant iff
xRy (x · π)R(y · π)
implies for all π
Let’s see what equivariance means for such sets: R · π = R
(x, y) ∈ R = ⇒ (x, y) · π ∈ R
iff
Equivariant relations
30A (binary) relation is a set of pairs.
R ⊆ X × Y
is equivariant iff
xRy (x · π)R(y · π)
implies for all π
Let’s see what equivariance means for such sets: R · π = R
(x, y) ∈ R = ⇒ (x, y) · π ∈ R
iff Similarly for -supported relations, but for
S π ∈ AutS(A)
Equivariant function
31A function is a binary relation.
R ⊆ X × Y
is equivariant iff
xRy (x · π)R(y · π)
implies for all π
Equivariant function
31A function is a binary relation.
R ⊆ X × Y
is equivariant iff
xRy (x · π)R(y · π)
implies for all π
π f : X → Y is equivariant iff f(x · π) = f(x) · π for all
Equivariant function
31A function is a binary relation.
R ⊆ X × Y
is equivariant iff
xRy (x · π)R(y · π)
implies for all π
Similarly for -supported functions, but for
S π ∈ AutS(A)
π f : X → Y is equivariant iff f(x · π) = f(x) · π for all
Examples
32For fixed :
2, 5 ∈ A
Examples
32R = {(5, 2)} ⇥ {(2, d) | d = 5} ⇥ {(d, d)}
2 5 5
2
R
For fixed :
2, 5 ∈ A
Examples
32R = {(5, 2)} ⇥ {(2, d) | d = 5} ⇥ {(d, d)}
2 5 5
2
R
2 5 5 2
R∗ For fixed :
2, 5 ∈ A
Examples
32R = {(5, 2)} ⇥ {(2, d) | d = 5} ⇥ {(d, d)}
2 5 5
2
R
2 5 5 2
R∗ For fixed :
2, 5 ∈ A
R , are supported by
R∗ {2, 5}
Examples ctd.
33Equivariant binary relations on :
A
Examples ctd.
33Equivariant binary relations on :
A
Examples ctd.
33Equivariant binary relations on :
A
No equivariant function from to , but
A
2
{({a, b}, a) | a, b ∈ A}
is an equivariant relation.
Examples ctd.
33Equivariant binary relations on :
A
No equivariant function from to , but
A
2
{({a, b}, a) | a, b ∈ A}
is an equivariant relation. Only equiv. functions from to are projections
A2
Only equiv. function from to is the diagonal
A A
A2
Intuition
34A relation/function/... is equivariant iff it only “checks” equality of atoms, and does not mention specific atoms.
Intuition
34A relation/function/... is equivariant iff it only “checks” equality of atoms, and does not mention specific atoms. A relation/function/... supported by , may additionally mention specific atoms from .
S S
Equivariant functions preserve supports
35Fact: if supports then supports .
S
and supports T
f : X → Y S ∪ T f(x) x ∈ X
Equivariant functions preserve supports
35Fact: if supports then supports .
S
and supports T
f : X → Y S ∪ T f(x) x ∈ X
Proof: AutS∪T (A) = AutS(A) ∩ AutT (A) so if π ∈ AutS∪T (A) then f(x) · π = f(x · π) = f(x)
Equivariant functions preserve supports
35Fact: if supports then supports .
S
and supports T
f : X → Y S ∪ T f(x) x ∈ X
Proof: AutS∪T (A) = AutS(A) ∩ AutT (A) so if π ∈ AutS∪T (A) then f(x) · π = f(x · π) = f(x)
Least supports
36Fact: for finite and ,
S
T if supports and supports X
S
T X then supports . S ∩ T X
Least supports
36Fact: for finite and ,
S
T if supports and supports X
S
T X then supports . S ∩ T X So: every legal has the least support . X supp(X)
Least supports
36Fact: for finite and ,
S
T if supports and supports X
S
T X then supports . S ∩ T X
One way: induction on . |S4T| So: every legal has the least support . X supp(X)
Proof
37Assume and support .
S
T X
S
T
Proof
37Assume and support .
S
T X
S
T
a
Proof
37Assume and support .
S
T X
S
T
a
Goal: supports . X S \ a
Proof
37Assume and support .
S
T X
S
T
a
Goal: supports . X S \ a Take any . π ∈ AutS\a(A)
Proof
37Assume and support .
S
T X
S
T
a
Goal: supports . X S \ a Take any . π ∈ AutS\a(A) b
π(b)
Pick a fresh : . b
b, π(b) 62 S [ T
Proof
37Assume and support .
S
T X
S
T
a
Goal: supports . X S \ a Take any . π ∈ AutS\a(A) b
π(b)
Pick a fresh : . b
b, π(b) 62 S [ T
Put , . Then:
σ = (a b) θ = (a π(b)) σ, θ = AutT (A)
Proof
37Assume and support .
S
T X
S
T
a
Goal: supports . X S \ a Take any . π ∈ AutS\a(A) b
π(b)
Pick a fresh : . b
b, π(b) 62 S [ T
Put , . Then:
σ = (a b) θ = (a π(b)) σ, θ = AutT (A) σπθ = AutS(A)
Proof
37Assume and support .
S
T X
S
T
a
Goal: supports . X S \ a Take any . π ∈ AutS\a(A) b
π(b)
Pick a fresh : . b
b, π(b) 62 S [ T
Put , . Then:
σ = (a b) θ = (a π(b)) σ, θ = AutT (A) σπθ = AutS(A)
so:
X · π = ((X · σ) · σπθ) · θ = X
Name abstraction
38For an (equivariant) set , X define a relation on so: ≈ A × X
(a, x) ≈ (b, y) ⇐ ⇒ x · (a c) = y · (b c)
for fresh :
c c 62 {a, b} [ supp(x, y)
Name abstraction
38For an (equivariant) set , X define a relation on so: ≈ A × X
(a, x) ≈ (b, y) ⇐ ⇒ x · (a c) = y · (b c)
for fresh :
c c 62 {a, b} [ supp(x, y)
Fact: is an equivariant equivalence relation. ≈
Name abstraction
38For an (equivariant) set , X define a relation on so: ≈ A × X
(a, x) ≈ (b, y) ⇐ ⇒ x · (a c) = y · (b c)
for fresh :
c c 62 {a, b} [ supp(x, y)
Fact: is an equivariant equivalence relation. ≈ Define:
[A]X = (A × X)/≈
Name abstraction
38For an (equivariant) set , X define a relation on so: ≈ A × X
(a, x) ≈ (b, y) ⇐ ⇒ x · (a c) = y · (b c)
for fresh :
c c 62 {a, b} [ supp(x, y)
Fact: is an equivariant equivalence relation. ≈ Define:
[A]X = (A × X)/≈
Fact: is an equivariant set.
[A]X supp([a, x]≈) = supp(x) \ {a}
Name abstraction
38For an (equivariant) set , X define a relation on so: ≈ A × X
(a, x) ≈ (b, y) ⇐ ⇒ x · (a c) = y · (b c)
for fresh :
c c 62 {a, b} [ supp(x, y)
Fact: is an equivariant equivalence relation. ≈ Define:
[A]X = (A × X)/≈
Fact: is an equivariant set.
[A]X supp([a, x]≈) = supp(x) \ {a} α-equivalence
Exercises
39f : X → Y
then supports .
S T g : Y → Z
S ∪ T
f; g : X → Z
Exercises
39f : X → Y
then supports .
X
function is equivariant.
(−)∗ : Pfs(X × X) → Pfs(X × X)
S T g : Y → Z
S ∪ T
f; g : X → Z
Exercises
39f : X → Y
then supports .
is equivariant. function supp : X → PfinA
X
X
function is equivariant.
(−)∗ : Pfs(X × X) → Pfs(X × X)
S T g : Y → Z
S ∪ T
f; g : X → Z
Exercises
39f : X → Y
then supports .
is equivariant. function supp : X → PfinA
X
X
function is equivariant.
(−)∗ : Pfs(X × X) → Pfs(X × X)
is equivariant.
S T g : Y → Z
S ∪ T
f; g : X → Z