Nominal Syntax and Semantics

Size: px
Start display at page:

Download "Nominal Syntax and Semantics"

Transcription

1 Nominal Syntax and Semantics Andrew Pitts University of Cambridge Computer Laboratory APPSEM 2005, 1 - p. 1

2 How best to reconcile Mathematics of syntax syntactical issues to do with name-binding and α-conversion with a structural approach to semantics? Specifically: improved forms of structural recursion and structural induction for syntactical structures. APPSEM 2005, 1 - p. 2

3 How best to reconcile Mathematics of syntax syntactical issues to do with name-binding and α-conversion with a structural approach to semantics? Specifically: improved forms of structural recursion and structural induction for syntactical structures. Lectures provide a taster of the nominal sets model of names and name-binding. (Simplified version of [Gabbay-Pitts, 2002].) APPSEM 2005, 1 - p. 2

4 Lecture 1 Introduction: from structural to α-structural recursion. Nominal sets first look. Lecture 2 Nominal sets, continued. α-structural recursion proof sketch. Nominal signatures. Lecture 3 Extended example: NBE. Mechanization [extra]. Lecture materials available at: APPSEM 2005, 1 - p. 3

5 Lecture 1 APPSEM 2005, 1 - p. 4

6 Structural recursion and induction APPSEM 2005, 1 - p. 5

7 Structural recursion and induction position APPSEM 2005, 1 - p. 5

8 Structural recursion and induction positionality APPSEM 2005, 1 - p. 5

9 Structural recursion and induction Compositionality APPSEM 2005, 1 - p. 5

10 Structural recursion and induction Compositionality is crucial in [programming language] semantics it s preferable to give meaning to program constructions rather than just to whole programs. APPSEM 2005, 1 - p. 5

11 Structural recursion and induction In particular, as far as semantics is concerned, concrete syntax letrec f x = if x > 100 then x 10 else f ( f ( x + 11 ) ) in f ( x ) is unimportant compared to abstract syntax (ASTs): letrec f x if > x 100 x f x 101 f + x 11 APPSEM 2005, 1 - p. 5

12 Structural recursion and induction ASTs enable two fundamental (and inter-linked) tools in programming language semantics: Definition of functions on syntax by recursion on its structure. Proof of properties of syntax by induction on its structure. APPSEM 2005, 1 - p. 5

13 Concrete syntax: ASTs: Running example t ::= a t t λa.t letrec a a = t in t Λ µs.(v + (S S) + (V S) + (V V S S)) where V is some fixed, countably infinite set (of names a of variables). APPSEM 2005, 1 - p. 6

14 letrec f a = if a > 100 then a 10 else f(f(a + 11)) in f(a + 101) letrec f a if > a 100 a f a 101 f + a 11 APPSEM 2005, 1 - p. 7

15 Structural recursion for Λ [LN p 10] Given a set S and functions f V : V S f A : S S S f L : V S S f F : V V S S S, there is a unique function ˆf : Λ S satisfying ˆf a 1 = f V a 1 ˆf(t 1 t 2 ) = f A ( ˆf t 1, ˆf t 2 ) ˆf(λa 1.t 1 ) = f L (a 1, ˆf t 1 ) ˆf(letrec a 1 a 2 = t 1 in t 2 ) = f F (a 1, a 2, ˆf t 1, ˆf t 2 ) for all a 1, a 2 V and t 1, t 2 Λ. APPSEM 2005, 1 - p. 8

16 Structural recursion for Λ [LN p 10] Given a set S and functions f V : V S f A : S ĝ a 1 S= g V as 1 ĝ(t 1 t 2 ) = g A (t 1, t 2, ĝ t 1, ĝ t 2 ) f L : V S S ĝ(λa 1.t 1 ) = g L (a 1, t 1, ĝ t 1 ) f F : V V S S S, A more complicated version ( primitive recursion instead of iteration ) is derivable: ĝ(letrec a 1 a 2 = t 1 in t 2 ) = g F (a 1, a 2, t 1, t 2, ĝ t 1, ĝ t 2 ) there is a unique function ˆf : Λ S satisfying ˆf a 1 = f V a 1 ˆf(t 1 t 2 ) = f A ( ˆf t 1, ˆf t 2 ) ˆf(λa 1.t 1 ) = f L (a 1, ˆf t 1 ) ˆf(letrec a 1 a 2 = t 1 in t 2 ) = f F (a 1, a 2, ˆf t 1, ˆf t 2 ) for all a 1, a 2 V and t 1, t 2 Λ. APPSEM 2005, 1 - p. 8

17 Finite set of free variables fv t of an AST t: fv a 1 {a 1 } fv(t 1 t 2 ) (fv t 1 ) (fv t 2 ) fv(λa 1.t 1 ) (fv t 1 ) {a 1 } fv(letrec a 1 a 2 = t 1 in t 2 ) (fv t 1 ) {a 1, a 2 } (fv t 2 ) {a 1 } APPSEM 2005, 1 - p. 9

18 Finite set of free variables fv t of an AST t: fv a 1 {a 1 } fv(t 1 t 2 ) (fv t 1 ) (fv t 2 ) fv(λa 1.t 1 ) (fv t 1 ) {a 1 } fv(letrec a 1 a 2 = t 1 in t 2 ) (fv t 1 ) {a 1, a 2 } (fv t 2 ) {a 1 } defined by structural recursion using S P fin (V) (finite sets of variables), f V a 1 {a 1 }, f A (A 1, A 2 ) A 1 A 2, f L (a 1, A 1 ) A 1 {a 1 }, f F (a 1, a 2, A 1, A 2 ) (A 1 {a 1, a 2 }) (A 2 {a 1 }). APPSEM 2005, 1 - p. 9

19 Finite set of all variables var t of an AST t: var a 1 {a 1 } var(t 1 t 2 ) (var t 1 ) (var t 2 ) var(λa 1.t 1 ) (var t 1 ) {a 1 } var(letrec a 1 a 2 = t 1 in t 2 ) {a 1, a 2 } (var t 1 ) (var t 2 ) APPSEM 2005, 1 - p. 10

20 t{b/a} replace all occurrences of a with b in an AST t: a 1 {b/a} if a 1 = a then b else a 1 (t 1 t 2 ){b/a} (t 1 {b/a}) (t 2 {b/a}) (λa 1. t 1 ){b/a} λa 1 {b/a}. t 1 {b/a} (letrec a 1 a 2 = t 1 in t 2 letrec (a 1 {b/a})(a 2 {b/a}) = t 1 {b/a} in t 2 {b/a} APPSEM 2005, 1 - p. 11

21 Given a set S and functions Structural recursion for Λ f V : V S f A : S S S f L : V S S f F : V V S S S, there is a unique function ˆf : Λ S satisfying ˆf a 1 = f V a 1 ˆf(t 1 t 2 ) = f A ( ˆf t 1, ˆf t 2 ) ˆf(λa 1.t 1 ) = f L (a 1, ˆf t 1 ) ˆf(letrec a 1 a 2 = t 1 in t 2 ) = f F (a 1, a 2, ˆf t 1, ˆf t 2 ) for all a 1, a 2 V and t 1, t 2 Λ. APPSEM 2005, 1 - p. 12

22 Given a set S and functions Structural recursion for Λ f V : V S f A : S S S f L : V S S f F : V V S S S, there is a unique function ˆf : Λ S satisfying ˆf a 1 = f V a 1 ˆf(t 1 t 2 ) = f A ( ˆf t 1, ˆf t 2 ) ˆf(λa 1.t 1 ) = f L (a 1, ˆf t 1 ) ˆf(letrec a 1 a 2 = t 1 in t 2 ) = f F (a 1, a 2, ˆf t 1, ˆf t 2 ) for all a 1, a 2 V and t 1, t 2 Λ. Doesn t take binding into account! APPSEM 2005, 1 - p. 12

23 letrec f a = if a > 100 then a 10 else f(f(a + 11)) in f(a + 101) letrec f a if > a 100 a f a 101 f + a 11 APPSEM 2005, 1 - p. 13

24 letrec f a = if a > 100 then a 10 else f(f(a + 11)) in f(a + 101) letrec f a if > a 100 a f a 101 f + a 11 APPSEM 2005, 1 - p. 13

25 letrec f a = if a > 100 then a 10 else f(f(a + 11)) in f(a + 101) letrec f a if > a 100 a 10 f a 101 f + a 11 APPSEM 2005, 1 - p. 13

26 α-equivalence [LN p 11] Smallest binary relation = α on Λ closed under the rules: t 1 = α t 1 t 2 = α t 2 a V t 1 t 2 = α t 1 a = α a t 2 t 1 {a 1 /a 1} = α t 1 {a 1 /a 1 } a 1 / var(a 1, t 1, a 1, t 1 ) λa 1. t 1 = α λa 1. t 1 t 1 {a 1, a 2 /a 1, a 2 } = α t 1 {a 1, a 2 /a 1, a 2 } t 2 {a 1 /a 1} = α t 2 {a 1 /a 1 } a 1 a 2 a 1, a 2 / var(a 1, a 2, t 1, t 2, a 1, a 2, t 1, t 2 ) letrec a 1 a 2 = t 1 in t 2 = α letrec a 1 a 2 = t 1 in t 2 APPSEM 2005, 1 - p. 14

27 Exercise: prove that α-equivalence = α is transitive (and reflexive and symmetric). Smallest binary relation = α on Λ closed under the rules: t 1 = α t 1 t 2 = α t 2 a V t 1 t 2 = α t 1 a = α a t 2 t 1 {a 1 /a 1} = α t 1 {a 1 /a 1 } a 1 / var(a 1, t 1, a 1, t 1 ) λa 1. t 1 = α λa 1. t 1 t 1 {a 1, a 2 /a 1, a 2 } = α t 1 {a 1, a 2 /a 1, a 2 } t 2 {a 1 /a 1} = α t 2 {a 1 /a 1 } a 1 a 2 a 1, a 2 / var(a 1, a 2, t 1, t 2, a 1, a 2, t 1, t 2 ) letrec a 1 a 2 = t 1 in t 2 = α letrec a 1 a 2 = t 1 in t 2 [LN p 11] APPSEM 2005, 1 - p. 14

28 Abstract syntax / α Dealing with issues to do with binders and α-conversion is irritating (want to get on with more interesting aspects of semantics!) pervasive (very many languages involve binding operations; cf. POPLMark Challenge [TPHOLs 05]) difficult to formalise/mechanise without losing sight of common informal practice: APPSEM 2005, 1 - p. 15

29 Abstract syntax / α Dealing with issues to do with binders and α-conversion is irritating (want to get on with more interesting aspects of semantics!) pervasive (very many languages involve binding operations; cf. POPLMark Challenge [TPHOLs 05]) difficult to formalise/mechanise without losing sight of common informal practice: We identify expressions up to α-equivalence... APPSEM 2005, 1 - p. 15

30 Abstract syntax / α Dealing with issues to do with binders and α-conversion is irritating (want to get on with more interesting aspects of semantics!) pervasive (very many languages involve binding operations; cf. POPLMark Challenge [TPHOLs 05]) difficult to formalise/mechanise without losing sight of common informal practice: We identify expressions up to α-equivalence and then forget about it, referring to α-equivalence classes e = [t] α only via representatives, t. For example... APPSEM 2005, 1 - p. 15

31 E.g. capture-avoiding substitution (a := e)e 1 = substitute e Λ/= α for all free occurrences of a in e 1 Λ/= α, avoiding capture of free variables in e by binders in e 1. APPSEM 2005, 1 - p. 16

32 E.g. capture-avoiding substitution (a := e)a 1 if a 1 = a then e else a 1 (a := e)(e 1 e 2 ) ((a := e)e 1 )((a := e)e 2 ) (a := e)(λa 1.e 1 ) if a 1 / fv(a, e) then λa 1.(a := e)e 1 else don t care! (a := e)(letrec a 1 a 2 = e 1 in e 2 )? APPSEM 2005, 1 - p. 16

33 E.g. capture-avoiding substitution (a := e)a 1 if a 1 = a then e else a 1 (a := e)(e 1 e 2 ) ((a := e)e 1 )((a := e)e 2 ) (a := e)(λa 1.e 1 ) if a 1 / fv(a, e) then λa 1.(a := e)e 1 else don t care! (a := e)(letrec a 1 a 2 = e 1 in e 2 ) if a 1, a 2 / fv(a, e) & a 2 / fv(a 1, e 2 ) then letrec a 1 a 2 = (a := e)e 1 in (a := e)e 2 else don t care! APPSEM 2005, 1 - p. 16

34 E.g. capture-avoiding substitution (a := e)a 1 if a 1 = a then e else a 1 (a := e)(e 1 e 2 ) ((a := e)e 1 )((a := e)e 2 ) (a := e)(λa 1.e 1 ) if a 1 / fv(a, e) then λa 1.(a := e)e 1 else don t care! (a := e)(letrec a 1 a 2 = e 1 in e 2 ) if a 1, a 2 / fv(a, e) & a 2 / fv(a 1, e 2 ) then letrec a 1 a 2 = (a := e)e 1 in (a := e)e 2 else don t care! Does uniquely specify a well-defined function on α-equivalence classes, (a := e)( ) : Λ/α Λ/α, but not via an obvious, structurally recursive definition of a function ˆf : Λ Λ respecting α-equivalence. APPSEM 2005, 1 - p. 16

35 E.g. denotational semantics of Λ/α in some suitable domain D: a 1 ρ ρ(a 1 ) e 1 e 2 ρ app( e 1 ρ, e 2 ρ) λa 1.e 1 ρ fun(λd D. e 1 (ρ[a 1 d])) letrec a 1 a 2 = e 1 in e 2 ρ where - ρ ranges over environments mapping variables to elements of D - D comes equipped with continuous functions app : D D D and fun : (D D) D. APPSEM 2005, 1 - p. 17

36 E.g. denotational semantics of Λ/α in some suitable domain D: a 1 ρ ρ(a 1 ) e 1 e 2 ρ app( e 1 ρ, e 2 ρ) λa 1.e 1 ρ fun(λd D. e 1 (ρ[a 1 d])) letrec a 1 a 2 = e 1 in e 2 ρ Why is this (very standard) definition independent of the choice of bound variable a 1? APPSEM 2005, 1 - p. 17

37 E.g. denotational semantics of Λ/α in some suitable domain D: a 1 ρ ρ(a 1 ) e 1 e 2 ρ app( e 1 ρ, e 2 ρ) λa 1.e 1 ρ fun(λd D. e 1 (ρ[a 1 d])) letrec a 1 a 2 = e 1 in e 2 ρ In this case we can use ordinary structural recursion to first define denotations of ASTs and then prove that they respect α-equivalence. But is there a quicker way, working directly with ASTs/α? APPSEM 2005, 1 - p. 17

38 α-structural recursion Is there a recursion principle for Λ/α that legitimises these definitions of (a := e)( ) : Λ/α Λ/α and : Λ/α D (and many other e.g.s)? APPSEM 2005, 1 - p. 18

39 α-structural recursion Is there a recursion principle for Λ/α that legitimises these definitions of (a := e)( ) : Λ/α Λ/α and : Λ/α D (and many other e.g.s)? Yes! α-structural recursion (and induction too see lecture notes). APPSEM 2005, 1 - p. 18

40 α-structural recursion Is there a recursion principle for Λ/α that legitimises these definitions of (a := e)( ) : Λ/α Λ/α and : Λ/α D (and many other e.g.s)? Yes! α-structural recursion (and induction too see lecture notes). What about other languages with binders? APPSEM 2005, 1 - p. 18

41 α-structural recursion Is there a recursion principle for Λ/α that legitimises these definitions of (a := e)( ) : Λ/α Λ/α and : Λ/α D (and many other e.g.s)? Yes! α-structural recursion (and induction too see lecture notes). What about other languages with binders? Yes! available for any nominal signature. APPSEM 2005, 1 - p. 18

42 α-structural recursion Is there a recursion principle for Λ/α that legitimises these definitions of (a := e)( ) : Λ/α Λ/α and : Λ/α D (and many other e.g.s)? Yes! α-structural recursion (and induction too see lecture notes). What about other languages with binders? Yes! available for any nominal signature. Great. What s the catch? APPSEM 2005, 1 - p. 18

43 α-structural recursion Is there a recursion principle for Λ/α that legitimises these definitions of (a := e)( ) : Λ/α Λ/α and : Λ/α D (and many other e.g.s)? Yes! α-structural recursion (and induction too see lecture notes). What about other languages with binders? Yes! available for any nominal signature. Great. What s the catch? Need to learn a bit of possibly unfamiliar math, to do with permutations and support. APPSEM 2005, 1 - p. 18

44 Pause APPSEM 2005, 1 - p. 19

45 Concrete syntax: ASTs: Running example (reminder) t ::= a t t λa.t letrec a a = t in t Λ µs.(v + (S S) + (V S) + (V V S S)) where V is some fixed, countably infinite set (of names a of variables). APPSEM 2005, 1 - p. 20

46 Structural recursion for Λ [LN p 10] Given a set S and functions f V : V S f A : S S S f L : V S S f F : V V S S S, there is a unique function ˆf : Λ S satisfying ˆf a 1 = f V a 1 ˆf(t 1 t 2 ) = f A ( ˆf t 1, ˆf t 2 ) ˆf(λa 1.t 1 ) = f L (a 1, ˆf t 1 ) ˆf(letrec a 1 a 2 = t 1 in t 2 ) = f F (a 1, a 2, ˆf t 1, ˆf t 2 ) for all a 1, a 2 V and t 1, t 2 Λ. APPSEM 2005, 1 - p. 21

47 α-structural recursion for Λ/α [LN p 31] Given a nominal set X f V : V X f A : X X X and functions f L : V X X f F : V V X X X, all supported by a finite subset A V, there is a unique function ˆf : Λ/α X such that... APPSEM 2005, 1 - p. 22

48 α-structural recursion for Λ/α [LN p 31]...! function ˆf : Λ/α X such that: ˆf a 1 = f V a 1 ˆf(e 1 e 2 ) = f A ( ˆf e 1, ˆf e 2 ) a 1 / A ˆf(λa 1.e 1 ) = f L (a 1, ˆf e 1 ) a 1, a 2 / A & a 1 a 2 & a 2 / fv(e 2 ) ˆf(letrec a 1 a 2 = e 1 in e 2 ) = f F (a 1, a 2, ˆf e 1, ˆf e 2 ) for all a 1, a 2 V & e 1, e 2 Λ/α, APPSEM 2005, 1 - p. 22

49 α-structural recursion for Λ/α [LN p 31]...! function ˆf : Λ/α X such that: ˆf a 1 = f V a 1 ˆf(e 1 e 2 ) = f A ( ˆf e 1, ˆf e 2 ) a 1 / A ˆf(λa 1.e 1 ) = f L (a 1, ˆf e 1 ) a 1, a 2 / A & a 1 a 2 & a 2 / fv(e 2 ) ˆf(letrec a 1 a 2 = e 1 in e 2 ) = f F (a 1, a 2, ˆf e 1, ˆf e 2 ) provided freshness condition for binders (FCB) holds for f L : ( a 1 / A)( x X) a 1 # f L (a 1, x) for f F : ( a 1, a 2 / A) a 1 a 2 & ( x 1, x 2 X) a 2 # x 1 a 1, a 2 # f F (a 1, a 2, x 1, x 2 ) APPSEM 2005, 1 - p. 22

50 α-structural recursion for Λ/α [LN p 31]. The..! freshness function relation ˆf : Λ/α ( ) X# such ( ) between that: names and elements of nominal ˆf asets 1 = generalises f V a 1 the ( ) / fv( ) relation ˆf(ebetween 1 e 2 ) = variables f A ( ˆf e 1, ˆf and e 2 ) ASTs. E.g. for a 1 the / Acapture-avoiding ˆf(λa 1.e 1 ) = substitution f L (a 1, ˆf e 1 ) example, fa L 1 (a, a 12, e) / A λa & a 1.e 1 and a 2 (FCB) & a 2 / holds fv(e 2 trivially ) because aˆf(letrec a a 2 = e 1 in e 2 ) = f F (a 1, a 2, ˆf e 1, ˆf 1 / fv(λa 1.e) (and similarly for f F ). e 2 ) provided freshness condition for binders (FCB) holds for f L : ( a 1 / A)( x X) a 1 # f L (a 1, x) for f F : ( a 1, a 2 / A) a 1 a 2 & ( x 1, x 2 X) a 2 # x 1 a 1, a 2 # f F (a 1, a 2, x 1, x 2 ) APPSEM 2005, 1 - p. 22

51 To be explained: Nominal sets, support and the freshness relation, ( ) # ( ). How is α-structural recursion proved? How to generalise α-structural recursion from the example language Λ to general languages with binders? What s involved with applying α-structural recursion in any particular case? Example: normalisation by evaluation. Machine-assisted support? APPSEM 2005, 1 - p. 23

52 Atoms [LN p 7] From now on assume bindable names in ASTs are drawn from a fixed, countably infinite set A (elements called atoms) Need different flavours of names (variables, references, channels, nonces,... ), so assume A is partitioned into countably infinite number of sorts. Write sort(a) for the sort of a A. There are infinitely many atoms of each sort. APPSEM 2005, 1 - p. 24

53 Atoms [LN p 7] From now on assume bindable names in ASTs are drawn from a fixed, countably infinite set A (elements called atoms) The mathematical model of bindable names we use is very abstract: in the world of nominal sets, the only attributes of an atom are identity and sort. Probably interesting & pragmatically useful to consider more structured atoms (!), e.g. linearly ordered ones, but we don t do that here. APPSEM 2005, 1 - p. 24

54 Permutations [LN p 12] Set Perm of atom-permutations consists of all bijections π : A A such that {a A π(a) a} is finite sort(π(a)) = sort(a) (all a A). Perm is a group: multiplication π π = function composition π π : π π (a) π(π (a)) identity element ι = identity function on A inverse π 1 of π Perm is inverse qua function. APPSEM 2005, 1 - p. 25

55 Permutations [LN p 12] Set Perm of atom-permutations consists of all bijections π : A A such that {a A π(a) a} is finite sort(π(a)) = sort(a) (all a A). Given a 1, a 2 A with sort(a 1 ) = sort(a 2 ), transposition (a 1 a 2 ) is the π Perm given by a 2 if a = a 1 π(a) a 1 if a = a 2 a otherwise APPSEM 2005, 1 - p. 25

56 Permutations [LN p 12] Set Perm of atom-permutations consists of all bijections π : A A such that {a A π(a) a} is finite sort(π(a)) = sort(a) (all a A). Given a 1, a 2 A with sort(a 1 ) = sort(a 2 ), transposition (a 1 a 2 ) is the π Perm given by Exercise: prove that every a 2 πif a Perm = a 1 can be expressed as aπ(a) composition a 1 of if a (finitely = a 2 many) transpositions. a otherwise APPSEM 2005, 1 - p. 25

57 Actions of permutations An action of Perm on a set S is a function Perm S S written (π, s) π s satisfying ι s = s and π (π s) = (ππ ) s A Perm-set is a set S equipped with an action of Perm on S. APPSEM 2005, 1 - p. 26

58 Actions of permutations An action of Perm on a set S is a function Perm S S written (π, s) π s satisfying ι s = s and π (π s) = (ππ ) s Three simple examples of Perm-sets: Natural numbers N with trivial action: π n = n. A with action: π a = π(a). Perm itself with conjugation action: π π = π π π 1. More examples in a mo. APPSEM 2005, 1 - p. 26

59 Finite support [LN p 12] Definition. A finite subset A A supports an element s S of a Perm-set S if (a a ) s = s holds for all a, a A (of same sort) not in A A nominal set is a Perm-set all of whose elements have a finite support. APPSEM 2005, 1 - p. 27

60 Lemma. If s S has a finite support, then it has a smallest one, written supp(s). APPSEM 2005, 1 - p. 28

61 Lemma. If s S has a finite support, then it has a smallest one, written supp(s). Proof Suffices to show that if the finite sets A 1 and A 2 support s, so does A 1 A 2. APPSEM 2005, 1 - p. 28

62 Lemma. If s S has a finite support, then it has a smallest one, written supp(s). Proof Suffices to show that if the finite sets A 1 and A 2 support s, so does A 1 A 2. So given a, a A (A 1 A 2 ), have to show (a a ) s = s. W.l.o.g. a a. APPSEM 2005, 1 - p. 28

63 Lemma. If s S has a finite support, then it has a smallest one, written supp(s). Proof Suffices to show that if the finite sets A 1 and A 2 support s, so does A 1 A 2. So given a, a A (A 1 A 2 ), have to show (a a ) s = s. W.l.o.g. a a. Pick any a (of same sort) in the infinite set A (A 1 A 2 {a, a }). Then (a a ) = (a a ) (a a ) (a a ) is a composition of transpositions each of which fixes s. APPSEM 2005, 1 - p. 28

64 Freshness relation [LN P 18] Given nominal sets X and Y and elements x X and y Y, write x # y to mean supp(x) supp(y) =. APPSEM 2005, 1 - p. 29

65 Freshness relation [LN P 18] Given nominal sets X and Y and elements x X and y Y, write x # y to mean supp(x) supp(y) =. So if a A, then a # x means a / supp(x). APPSEM 2005, 1 - p. 29

66 Freshness relation [LN P 18] Given nominal sets X and Y and elements x X and y Y, write x # y to mean supp(x) supp(y) =. So if a A, then a # x means a / supp(x). Hence Key fact for atoms a and a of the same sort: (a, a ) # x (a a ) x = x APPSEM 2005, 1 - p. 29

67 Languages/α form nominal sets [LN p 13] For example, there s a Perm-action on Λ/α satisfying: π a = π(a) π (e 1 e 2 ) = (π e 1 )(π e 2 ) π (λa.e) = λπ(a).(π e) π (letrec a 1 a 2 = e 1 in e 2 ) = letrec π(a 1 ) π(a 2 ) = π e 1 in π e 2 APPSEM 2005, 1 - p. 30

68 Languages/α form nominal sets [LN p 13] For example, there s a Perm-action on Λ/α satisfying: π a = π(a) π (e 1 e 2 ) = (π e 1 )(π e 2 ) π (λa.e) = λπ(a).(π e) π (letrec a 1 a 2 = e 1 in e 2 ) = letrec π(a 1 ) π(a 2 ) = π e 1 in π e 2 N.B. binding and non-binding constructs are treated just the same APPSEM 2005, 1 - p. 30

69 Languages/α form nominal sets [LN p 13] For example, there s a Perm-action on Λ/α satisfying: π a = π(a) π (e 1 e 2 ) = (π e 1 )(π e 2 ) π (λa.e) = λπ(a).(π e) π (letrec a 1 a 2 = e 1 in e 2 ) = letrec π(a 1 ) π(a 2 ) = π e 1 in π e 2 Proof (exercise) First define π ( ) : Λ Λ by structural recursion, and then prove that t = α t ( π Perm) π t = α π t. APPSEM 2005, 1 - p. 30

70 Languages/α form nominal sets [LN p 13] For example, there s a Perm-action on Λ/α satisfying: π a = π(a) π (e 1 e 2 ) = (π e 1 )(π e 2 ) π (λa.e) = λπ(a).(π e) π (letrec a 1 a 2 = e 1 in e 2 ) = letrec π(a 1 ) π(a 2 ) = π e 1 in π e 2 For this action, it is not hard to see (exercise) that e Λ/α is supported by any finite set of variables containing all those occurring free in e and hence a # e iff a / fv(e). APPSEM 2005, 1 - p. 30

71 End of lecture 1 APPSEM 2005, 1 - p. 31

Alpha-Structural Recursion and Induction

Alpha-Structural Recursion and Induction Alpha-Structural Recursion and Induction ANDREW M. PITTS Cambridge University, Cambridge, UK Abstract. The nominal approach to abstract syntax deals with the issues of bound names and α-equivalence by

More information

Names and Symmetry in Computer Science

Names and Symmetry in Computer Science 1/27 Names and Symmetry in Computer Science Andrew Pitts Computer Laboratory LICS 2015 Tutorial 2/27 An introduction to nominal techniques motivated by Programming language semantics Automata theory Constructive

More information

A Recursion Combinator for Nominal Datatypes Implemented in Isabelle/HOL

A Recursion Combinator for Nominal Datatypes Implemented in Isabelle/HOL A Recursion Combinator for Nominal Datatypes Implemented in Isabelle/HOL Christian Urban and Stefan Berghofer Technische Universität München {urbanc,berghofe}@in.tum.de Abstract. The nominal datatype package

More information

Binding in Nominal Equational Logic

Binding in Nominal Equational Logic MFPS 2010 Binding in Nominal Equational Logic Ranald Clouston 1,2 Computer Laboratory, University of Cambridge, Cambridge CB3 0DF, United Kingdom Abstract Many formal systems, particularly in computer

More information

Nominal Completion for Rewrite Systems with Binders

Nominal Completion for Rewrite Systems with Binders Nominal Completion for Rewrite Systems with Binders Maribel Fernández King s College London July 2012 Joint work with Albert Rubio Summary Motivations Nominal Rewriting Closed nominal rules Confluence

More information

Completeness and Incompleteness in nominal Kleene algebra

Completeness and Incompleteness in nominal Kleene algebra 1/35 Completeness and Incompleteness in nominal Kleene algebra Dexter Kozen, Konstantinos Mamouras, Alexandra Silva Cornell University, University College London & HasLab INESC TEC September 28th, 2015

More information

Nominal Lawvere Theories: A Category Theoretic Account of Equational Theories with Names

Nominal Lawvere Theories: A Category Theoretic Account of Equational Theories with Names Nominal Lawvere Theories: A Category Theoretic Account of Equational Theories with Names Ranald Clouston 1 Logic and Computation Group, Research School of Computer Science, The Australian National University,

More information

Generalised Name Abstraction for Nominal Sets

Generalised Name Abstraction for Nominal Sets Generalised Name Abstraction for Nominal Sets Ranald Clouston Logic and Computation Group, Research School of Computer Science, The Australian National University, Canberra, ACT 0200, Australia ranald.clouston@anu.edu.au

More information

Most General Unifiers in Generalized Nominal Unification

Most General Unifiers in Generalized Nominal Unification Most General Unifiers in Generalized Nominal Unification Yunus D K Kutz 1 and Manfred Schmidt-Schauß 2 1 Goethe-University Frankfurt am Main, Germany, kutz@kiinformatikuni-frankfurtde 2 Goethe-University

More information

Type Systems. Today. 1. What is the Lambda Calculus. 1. What is the Lambda Calculus. Lecture 2 Oct. 27th, 2004 Sebastian Maneth

Type Systems. Today. 1. What is the Lambda Calculus. 1. What is the Lambda Calculus. Lecture 2 Oct. 27th, 2004 Sebastian Maneth Today 1. What is the Lambda Calculus? Type Systems 2. Its Syntax and Semantics 3. Church Booleans and Church Numerals 4. Lazy vs. Eager Evaluation (call-by-name vs. call-by-value) Lecture 2 Oct. 27th,

More information

COSE212: Programming Languages. Lecture 1 Inductive Definitions (1)

COSE212: Programming Languages. Lecture 1 Inductive Definitions (1) COSE212: Programming Languages Lecture 1 Inductive Definitions (1) Hakjoo Oh 2017 Fall Hakjoo Oh COSE212 2017 Fall, Lecture 1 September 4, 2017 1 / 9 Inductive Definitions Inductive definition (induction)

More information

Nominal Unification. Key words: Abstract Syntax, Alpha-Conversion, Binding Operations, Unification

Nominal Unification. Key words: Abstract Syntax, Alpha-Conversion, Binding Operations, Unification Nominal Unification Christian Urban a Andrew M. Pitts a Murdoch J. Gabbay b a University of Cambridge, Cambridge, UK b INRIA, Paris, France Abstract We present a generalisation of first-order unification

More information

CS522 - Programming Language Semantics

CS522 - Programming Language Semantics 1 CS522 - Programming Language Semantics Simply Typed Lambda Calculus Grigore Roşu Department of Computer Science University of Illinois at Urbana-Champaign 2 We now discuss a non-trivial extension of

More information

Nominal Equational Logic

Nominal Equational Logic Electronic Notes in Theoretical Computer Science 172 (2007) 223 257 www.elsevier.com/locate/entcs Nominal Equational Logic Ranald A. Clouston 1 Andrew M. Pitts 2 Computer Laboratory, University of Cambridge,

More information

COSE212: Programming Languages. Lecture 1 Inductive Definitions (1)

COSE212: Programming Languages. Lecture 1 Inductive Definitions (1) COSE212: Programming Languages Lecture 1 Inductive Definitions (1) Hakjoo Oh 2018 Fall Hakjoo Oh COSE212 2018 Fall, Lecture 1 September 5, 2018 1 / 10 Inductive Definitions Inductive definition (induction)

More information

Step-Indexed Biorthogonality: a Tutorial Example

Step-Indexed Biorthogonality: a Tutorial Example Step-Indexed Biorthogonality: a Tutorial Example Andrew Pitts University of Cambridge Computer Laboratory 1 Introduction The purpose of this note is to illustrate the use of step-indexing [2] combined

More information

Relating Nominal and Higher-Order Pattern Unification

Relating Nominal and Higher-Order Pattern Unification Relating Nominal and Higher-Order Pattern Unification James Cheney University of Edinburgh UNIF 2005 April 22, 2005 1 Motivation Higher-order unification: studied since ca. 1970 Undecidable, infinitary,

More information

Beyond First-Order Logic

Beyond First-Order Logic Beyond First-Order Logic Software Formal Verification Maria João Frade Departmento de Informática Universidade do Minho 2008/2009 Maria João Frade (DI-UM) Beyond First-Order Logic MFES 2008/09 1 / 37 FOL

More information

Type Systems. Lecture 2 Oct. 27th, 2004 Sebastian Maneth.

Type Systems. Lecture 2 Oct. 27th, 2004 Sebastian Maneth. Type Systems Lecture 2 Oct. 27th, 2004 Sebastian Maneth http://lampwww.epfl.ch/teaching/typesystems/2004 Today 1. What is the Lambda Calculus? 2. Its Syntax and Semantics 3. Church Booleans and Church

More information

Complete Partial Orders, PCF, and Control

Complete Partial Orders, PCF, and Control Complete Partial Orders, PCF, and Control Andrew R. Plummer TIE Report Draft January 2010 Abstract We develop the theory of directed complete partial orders and complete partial orders. We review the syntax

More information

COMP4141 Theory of Computation

COMP4141 Theory of Computation COMP4141 Theory of Computation Lecture 4 Regular Languages cont. Ron van der Meyden CSE, UNSW Revision: 2013/03/14 (Credits: David Dill, Thomas Wilke, Kai Engelhardt, Peter Höfner, Rob van Glabbeek) Regular

More information

Introduction to Kleene Algebras

Introduction to Kleene Algebras Introduction to Kleene Algebras Riccardo Pucella Basic Notions Seminar December 1, 2005 Introduction to Kleene Algebras p.1 Idempotent Semirings An idempotent semiring is a structure S = (S, +,, 1, 0)

More information

Structural recursion with locally scoped names

Structural recursion with locally scoped names JFP 21 (3): 235 286, 2011. c Cambridge University Press 2011 doi:10.1017/s0956796811000116 235 Structural recursion with locally scoped names ANDREW M. PITTS University of Cambridge Computer Laboratory

More information

Systems of modal logic

Systems of modal logic 499 Modal and Temporal Logic Systems of modal logic Marek Sergot Department of Computing Imperial College, London utumn 2008 Further reading: B.F. Chellas, Modal logic: an introduction. Cambridge University

More information

uring Reducibility Dept. of Computer Sc. & Engg., IIT Kharagpur 1 Turing Reducibility

uring Reducibility Dept. of Computer Sc. & Engg., IIT Kharagpur 1 Turing Reducibility uring Reducibility Dept. of Computer Sc. & Engg., IIT Kharagpur 1 Turing Reducibility uring Reducibility Dept. of Computer Sc. & Engg., IIT Kharagpur 2 FINITE We have already seen that the language FINITE

More information

cse547, math547 DISCRETE MATHEMATICS Professor Anita Wasilewska

cse547, math547 DISCRETE MATHEMATICS Professor Anita Wasilewska cse547, math547 DISCRETE MATHEMATICS Professor Anita Wasilewska LECTURE 1 INTRODUCTION Course Web Page www.cs.stonybrook.edu/ cse547 The webpage contains: detailed lectures notes slides; very detailed

More information

Definitions. Notations. Injective, Surjective and Bijective. Divides. Cartesian Product. Relations. Equivalence Relations

Definitions. Notations. Injective, Surjective and Bijective. Divides. Cartesian Product. Relations. Equivalence Relations Page 1 Definitions Tuesday, May 8, 2018 12:23 AM Notations " " means "equals, by definition" the set of all real numbers the set of integers Denote a function from a set to a set by Denote the image of

More information

CITS2211 Discrete Structures (2017) Cardinality and Countability

CITS2211 Discrete Structures (2017) Cardinality and Countability CITS2211 Discrete Structures (2017) Cardinality and Countability Highlights What is cardinality? Is it the same as size? Types of cardinality and infinite sets Reading Sections 45 and 81 84 of Mathematics

More information

Equational Logic. Chapter Syntax Terms and Term Algebras

Equational Logic. Chapter Syntax Terms and Term Algebras Chapter 2 Equational Logic 2.1 Syntax 2.1.1 Terms and Term Algebras The natural logic of algebra is equational logic, whose propositions are universally quantified identities between terms built up from

More information

3 Propositional Logic

3 Propositional Logic 3 Propositional Logic 3.1 Syntax 3.2 Semantics 3.3 Equivalence and Normal Forms 3.4 Proof Procedures 3.5 Properties Propositional Logic (25th October 2007) 1 3.1 Syntax Definition 3.0 An alphabet Σ consists

More information

Automated Reasoning Lecture 5: First-Order Logic

Automated Reasoning Lecture 5: First-Order Logic Automated Reasoning Lecture 5: First-Order Logic Jacques Fleuriot jdf@inf.ac.uk Recap Over the last three lectures, we have looked at: Propositional logic, semantics and proof systems Doing propositional

More information

An introduction to process calculi: Calculus of Communicating Systems (CCS)

An introduction to process calculi: Calculus of Communicating Systems (CCS) An introduction to process calculi: Calculus of Communicating Systems (CCS) Lecture 2 of Modelli Matematici dei Processi Concorrenti Paweł Sobociński University of Southampton, UK Intro to process calculi:

More information

T (s, xa) = T (T (s, x), a). The language recognized by M, denoted L(M), is the set of strings accepted by M. That is,

T (s, xa) = T (T (s, x), a). The language recognized by M, denoted L(M), is the set of strings accepted by M. That is, Recall A deterministic finite automaton is a five-tuple where S is a finite set of states, M = (S, Σ, T, s 0, F ) Σ is an alphabet the input alphabet, T : S Σ S is the transition function, s 0 S is the

More information

CS611 Lecture 25 Solving Domain Equations 22 October 2007 Lecturer: Andrew Myers

CS611 Lecture 25 Solving Domain Equations 22 October 2007 Lecturer: Andrew Myers CS611 Lecture 25 Solving Domain Equations 22 October 2007 Lecturer: Andrew Myers To develop a denotational semantics for a language with recursive types, or to give a denotational semantics for the untyped

More information

Nominal Automata. Mikolaj Bojanczyk 1, Bartek Klin 12, Slawomir Lasota 1 1. University of Cambridge. Warsaw University 2. Leicester, 04/03/11

Nominal Automata. Mikolaj Bojanczyk 1, Bartek Klin 12, Slawomir Lasota 1 1. University of Cambridge. Warsaw University 2. Leicester, 04/03/11 Nominal Automata Mikolaj Bojanczyk 1, Bartek Klin 12, Slawomir Lasota 1 1 Warsaw University 2 University of Cambridge Leicester, 04/03/11 Finite automata An automaton: - set Q of states - alphabet A -

More information

Normalisation by evaluation

Normalisation by evaluation Normalisation by evaluation Sam Lindley Laboratory for Foundations of Computer Science The University of Edinburgh Sam.Lindley@ed.ac.uk August 11th, 2016 Normalisation and embedded domain specific languages

More information

CMPS 217 Logic in Computer Science. Lecture #17

CMPS 217 Logic in Computer Science.   Lecture #17 CMPS 217 Logic in Computer Science https://courses.soe.ucsc.edu/courses/cmps217/spring13/01 Lecture #17 1 The Complexity of FO-Truth on a Structure Structure A Complexity of Th(A) Structure of the natural

More information

Modal and temporal logic

Modal and temporal logic Modal and temporal logic N. Bezhanishvili I. Hodkinson C. Kupke Imperial College London 1 / 83 Overview Part II 1 Soundness and completeness. Canonical models. 3 lectures. 2 Finite model property. Filtrations.

More information

20 Ordinals. Definition A set α is an ordinal iff: (i) α is transitive; and. (ii) α is linearly ordered by. Example 20.2.

20 Ordinals. Definition A set α is an ordinal iff: (i) α is transitive; and. (ii) α is linearly ordered by. Example 20.2. 20 Definition 20.1. A set α is an ordinal iff: (i) α is transitive; and (ii) α is linearly ordered by. Example 20.2. (a) Each natural number n is an ordinal. (b) ω is an ordinal. (a) ω {ω} is an ordinal.

More information

The Locally Nameless Representation

The Locally Nameless Representation Noname manuscript No. (will be inserted by the editor) The Locally Nameless Representation Arthur Charguéraud Received: date / Accepted: date Abstract This paper provides an introduction to the locally

More information

CONSTRAINT SOLVING IN NON-PERMUTATIVE NOMINAL ABSTRACT SYNTAX

CONSTRAINT SOLVING IN NON-PERMUTATIVE NOMINAL ABSTRACT SYNTAX Logical Methods in Computer Science Vol. 7 (3:06) 2011, pp. 1 31 www.lmcs-online.org Submitted Jan. 3, 2011 Published Aug. 25, 2011 CONSTRAINT SOLVING IN NON-PERMUTATIVE NOMINAL ABSTRACT SYNTAX MATTHEW

More information

Consequence Relations and Natural Deduction

Consequence Relations and Natural Deduction Consequence Relations and Natural Deduction Joshua D. Guttman Worcester Polytechnic Institute September 9, 2010 Contents 1 Consequence Relations 1 2 A Derivation System for Natural Deduction 3 3 Derivations

More information

Denotational Semantics

Denotational Semantics Q Lecture Notes on Denotational Semantics for Part II of the Computer Science Tripos Dr Andrew M. Pitts Cambridge University Computer Laboratory c A. M. Pitts, 1997-9 First edition 1997. Revised 1998,

More information

SUPPLEMENTARY NOTES: CHAPTER 1

SUPPLEMENTARY NOTES: CHAPTER 1 SUPPLEMENTARY NOTES: CHAPTER 1 1. Groups A group G is a set with single binary operation which takes two elements a, b G and produces a third, denoted ab and generally called their product. (Mathspeak:

More information

Theorem 5.3. Let E/F, E = F (u), be a simple field extension. Then u is algebraic if and only if E/F is finite. In this case, [E : F ] = deg f u.

Theorem 5.3. Let E/F, E = F (u), be a simple field extension. Then u is algebraic if and only if E/F is finite. In this case, [E : F ] = deg f u. 5. Fields 5.1. Field extensions. Let F E be a subfield of the field E. We also describe this situation by saying that E is an extension field of F, and we write E/F to express this fact. If E/F is a field

More information

First Order Logic vs Propositional Logic CS477 Formal Software Dev Methods

First Order Logic vs Propositional Logic CS477 Formal Software Dev Methods First Order Logic vs Propositional Logic CS477 Formal Software Dev Methods Elsa L Gunter 2112 SC, UIUC egunter@illinois.edu http://courses.engr.illinois.edu/cs477 Slides based in part on previous lectures

More information

Topology in Denotational Semantics

Topology in Denotational Semantics Journées Topologie et Informatique Thomas Ehrhard Preuves, Programmes et Systèmes (PPS) Université Paris Diderot - Paris 7 and CNRS March 21, 2013 What is denotational semantics? The usual stateful approach

More information

CS411 Notes 3 Induction and Recursion

CS411 Notes 3 Induction and Recursion CS411 Notes 3 Induction and Recursion A. Demers 5 Feb 2001 These notes present inductive techniques for defining sets and subsets, for defining functions over sets, and for proving that a property holds

More information

CSE 20 DISCRETE MATH. Fall

CSE 20 DISCRETE MATH. Fall CSE 20 DISCRETE MATH Fall 2017 http://cseweb.ucsd.edu/classes/fa17/cse20-ab/ Today's learning goals Define and compute the cardinality of a set. Use functions to compare the sizes of sets. Classify sets

More information

Lecture Notes: The Halting Problem; Reductions

Lecture Notes: The Halting Problem; Reductions Lecture Notes: The Halting Problem; Reductions COMS W3261 Columbia University 20 Mar 2012 1 Review Key point. Turing machines can be encoded as strings, and other Turing machines can read those strings

More information

SUPPLEMENT ON THE SYMMETRIC GROUP

SUPPLEMENT ON THE SYMMETRIC GROUP SUPPLEMENT ON THE SYMMETRIC GROUP RUSS WOODROOFE I presented a couple of aspects of the theory of the symmetric group S n differently than what is in Herstein. These notes will sketch this material. You

More information

On the Correctness and Efficiency of the Krivine Machine

On the Correctness and Efficiency of the Krivine Machine On the Correctness and Efficiency of the Krivine Machine Mitchell Wand Northeastern University Daniel P. Friedman Indiana University February 12, 2003 Abstract We provide a short derivation of the Krivine

More information

Mathematical Synthesis of Equational Deduction Systems. Marcelo Fiore. Computer Laboratory University of Cambridge

Mathematical Synthesis of Equational Deduction Systems. Marcelo Fiore. Computer Laboratory University of Cambridge Mathematical Synthesis of Equational Deduction Systems Marcelo Fiore Computer Laboratory University of Cambridge TLCA 2009 3.VII.2009 Context concrete theories meta-theories Context concrete theories meta-theories

More information

Gluing Nominal Theories

Gluing Nominal Theories École ormale Supérieure de Lyon Master d Informatique Fondamentale, 1 re année Gluing ominal Theories Florian Hatat with Roy L. Crole University of Leicester June August 2007 Contents 1 Introduction 2

More information

7 RC Simulates RA. Lemma: For every RA expression E(A 1... A k ) there exists a DRC formula F with F V (F ) = {A 1,..., A k } and

7 RC Simulates RA. Lemma: For every RA expression E(A 1... A k ) there exists a DRC formula F with F V (F ) = {A 1,..., A k } and 7 RC Simulates RA. We now show that DRC (and hence TRC) is at least as expressive as RA. That is, given an RA expression E that mentions at most C, there is an equivalent DRC expression E that mentions

More information

CS 154, Lecture 4: Limitations on DFAs (I), Pumping Lemma, Minimizing DFAs

CS 154, Lecture 4: Limitations on DFAs (I), Pumping Lemma, Minimizing DFAs CS 154, Lecture 4: Limitations on FAs (I), Pumping Lemma, Minimizing FAs Regular or Not? Non-Regular Languages = { w w has equal number of occurrences of 01 and 10 } REGULAR! C = { w w has equal number

More information

Axioms of Kleene Algebra

Axioms of Kleene Algebra Introduction to Kleene Algebra Lecture 2 CS786 Spring 2004 January 28, 2004 Axioms of Kleene Algebra In this lecture we give the formal definition of a Kleene algebra and derive some basic consequences.

More information

Algebras with finite descriptions

Algebras with finite descriptions Algebras with finite descriptions André Nies The University of Auckland July 19, 2005 Part 1: FA-presentability A countable structure in a finite signature is finite-automaton presentable (or automatic)

More information

Combinatorial algorithms

Combinatorial algorithms Combinatorial algorithms computing subset rank and unrank, Gray codes, k-element subset rank and unrank, computing permutation rank and unrank Jiří Vyskočil, Radek Mařík 2012 Combinatorial Generation definition:

More information

Forcing-based cut-elimination for Gentzen-style intuitionistic sequent calculus

Forcing-based cut-elimination for Gentzen-style intuitionistic sequent calculus Forcing-based cut-elimination for Gentzen-style intuitionistic sequent calculus Hugo Herbelin 1 and Gyesik Lee 2 1 INRIA & PPS, Paris Université 7 Paris, France Hugo.Herbelin@inria.fr 2 ROSAEC center,

More information

MATH 13 SAMPLE FINAL EXAM SOLUTIONS

MATH 13 SAMPLE FINAL EXAM SOLUTIONS MATH 13 SAMPLE FINAL EXAM SOLUTIONS WINTER 2014 Problem 1 (15 points). For each statement below, circle T or F according to whether the statement is true or false. You do NOT need to justify your answers.

More information

Relating Nominal and Higher-Order Pattern Unification

Relating Nominal and Higher-Order Pattern Unification Relating Nominal and Higher-Order Pattern Unification James Cheney University of Edinburgh jcheney@inf.ed.ac.uk Abstract. Higher-order pattern unification and nominal unification are two approaches to

More information

Lecture Notes 7 Random Processes. Markov Processes Markov Chains. Random Processes

Lecture Notes 7 Random Processes. Markov Processes Markov Chains. Random Processes Lecture Notes 7 Random Processes Definition IID Processes Bernoulli Process Binomial Counting Process Interarrival Time Process Markov Processes Markov Chains Classification of States Steady State Probabilities

More information

cse541 LOGIC FOR COMPUTER SCIENCE

cse541 LOGIC FOR COMPUTER SCIENCE cse541 LOGIC FOR COMPUTER SCIENCE Professor Anita Wasilewska Spring 2015 LECTURE 2 Chapter 2 Introduction to Classical Propositional Logic PART 1: Classical Propositional Model Assumptions PART 2: Syntax

More information

1. Object Calculus. Object calculus is to OO languages what lambda calculus is to functional languages

1. Object Calculus. Object calculus is to OO languages what lambda calculus is to functional languages 1. Object Calculus In this section we will introduce a calculus of objects that gives a simple but powerful mathematical model to study object based languages. Object calculus is to OO languages what lambda

More information

An Introduction to Logical Relations Proving Program Properties Using Logical Relations

An Introduction to Logical Relations Proving Program Properties Using Logical Relations An Introduction to Logical Relations Proving Program Properties Using Logical Relations Lau Skorstengaard lask@cs.au.dk July 27, 2018 Contents 1 Introduction 2 1.1 Simply Typed Lambda Calculus....................

More information

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska LECTURE 1 Course Web Page www3.cs.stonybrook.edu/ cse303 The webpage contains: lectures notes slides; very detailed solutions to

More information

CS 6110 Lecture 35 Solving Domain Equations 19 April 2013 Lecturer: Andrew Myers

CS 6110 Lecture 35 Solving Domain Equations 19 April 2013 Lecturer: Andrew Myers CS 6110 Lecture 35 Solving Domain Equations 19 April 2013 Lecturer: Andrew Myers To develop a denotational semantics for a language with recursive types, or to give a denotational semantics for the untyped

More information

The Absoluteness of Constructibility

The Absoluteness of Constructibility Lecture: The Absoluteness of Constructibility We would like to show that L is a model of V = L, or, more precisely, that L is an interpretation of ZF + V = L in ZF. We have already verified that σ L holds

More information

Groupe de travail. Analysis of Mobile Systems by Abstract Interpretation

Groupe de travail. Analysis of Mobile Systems by Abstract Interpretation Groupe de travail Analysis of Mobile Systems by Abstract Interpretation Jérôme Feret École Normale Supérieure http://www.di.ens.fr/ feret 31/03/2005 Introduction I We propose a unifying framework to design

More information

Lecture Notes 1 Basic Concepts of Mathematics MATH 352

Lecture Notes 1 Basic Concepts of Mathematics MATH 352 Lecture Notes 1 Basic Concepts of Mathematics MATH 352 Ivan Avramidi New Mexico Institute of Mining and Technology Socorro, NM 87801 June 3, 2004 Author: Ivan Avramidi; File: absmath.tex; Date: June 11,

More information

Equational Logic and Term Rewriting: Lecture I

Equational Logic and Term Rewriting: Lecture I Why so many logics? You all know classical propositional logic. Why would we want anything more? Equational Logic and Term Rewriting: Lecture I One reason is that we might want to change some basic logical

More information

Joseph Muscat Universal Algebras. 1 March 2013

Joseph Muscat Universal Algebras. 1 March 2013 Joseph Muscat 2015 1 Universal Algebras 1 Operations joseph.muscat@um.edu.mt 1 March 2013 A universal algebra is a set X with some operations : X n X and relations 1 X m. For example, there may be specific

More information

To hand in: (a) Prove that a group G is abelian (= commutative) if and only if (xy) 2 = x 2 y 2 for all x, y G.

To hand in: (a) Prove that a group G is abelian (= commutative) if and only if (xy) 2 = x 2 y 2 for all x, y G. Homework #6. Due Thursday, October 14th Reading: For this homework assignment: Sections 3.3 and 3.4 (up to page 167) Before the class next Thursday: Sections 3.5 and 3.4 (pp. 168-171). Also review the

More information

Local Representations of Binding

Local Representations of Binding Local Representations of Binding Randy Pollack LFCS, University of Edinburgh Joint work with James McKinna, Christian Urban, Arthur Charguéraud, Brian Aydemir, Benjamin Pierce, Stephanie Weirich Version

More information

Clones (3&4) Martin Goldstern. TACL Olomouc, June Discrete Mathematics and Geometry, TU Wien

Clones (3&4) Martin Goldstern. TACL Olomouc, June Discrete Mathematics and Geometry, TU Wien Martin Goldstern Discrete Mathematics and Geometry, TU Wien TACL Olomouc, June 2017 Galois connections Let A, B be sets, R A B. For any S A and any T B let S u := {b B a S : arb} T l := {a A b T : arb}.

More information

Type Systems Winter Semester 2006

Type Systems Winter Semester 2006 Type Systems Winter Semester 2006 Week 7 November 29 November 29, 2006 - version 1.0 Plan PREVIOUSLY: 1. type safety as progress and preservation 2. typed arithmetic expressions 3. simply typed lambda

More information

Sets, Logic and Categories Solutions to Exercises: Chapter 2

Sets, Logic and Categories Solutions to Exercises: Chapter 2 Sets, Logic and Categories Solutions to Exercises: Chapter 2 2.1 Prove that the ordered sum and lexicographic product of totally ordered (resp., well-ordered) sets is totally ordered (resp., well-ordered).

More information

Applied Logic. Lecture 1 - Propositional logic. Marcin Szczuka. Institute of Informatics, The University of Warsaw

Applied Logic. Lecture 1 - Propositional logic. Marcin Szczuka. Institute of Informatics, The University of Warsaw Applied Logic Lecture 1 - Propositional logic Marcin Szczuka Institute of Informatics, The University of Warsaw Monographic lecture, Spring semester 2017/2018 Marcin Szczuka (MIMUW) Applied Logic 2018

More information

PROPOSITIONAL MIXED LOGIC: ITS SYNTAX AND SEMANTICS

PROPOSITIONAL MIXED LOGIC: ITS SYNTAX AND SEMANTICS PROPOSITIONAL MIXED LOGIC: ITS SYNTAX AND SEMANTICS Karim NOUR 1 and Abir NOUR 2 Abstract In this paper, we present a propositional logic (called mixed logic) containing disjoint copies of minimal, intuitionistic

More information

Harvard CS121 and CSCI E-121 Lecture 2: Mathematical Preliminaries

Harvard CS121 and CSCI E-121 Lecture 2: Mathematical Preliminaries Harvard CS121 and CSCI E-121 Lecture 2: Mathematical Preliminaries Harry Lewis September 5, 2013 Reading: Sipser, Chapter 0 Sets Sets are defined by their members A = B means that for every x, x A iff

More information

The tensor product of commutative monoids

The tensor product of commutative monoids The tensor product of commutative monoids We work throughout in the category Cmd of commutative monoids. In other words, all the monoids we meet are commutative, and consequently we say monoid in place

More information

Fourier analysis of boolean functions in quantum computation

Fourier analysis of boolean functions in quantum computation Fourier analysis of boolean functions in quantum computation Ashley Montanaro Centre for Quantum Information and Foundations, Department of Applied Mathematics and Theoretical Physics, University of Cambridge

More information

arxiv: v1 [cs.lo] 20 Nov 2011

arxiv: v1 [cs.lo] 20 Nov 2011 From nominal sets binding to functions and λ-abstraction: connecting the logic of permutation models with the logic of functions Gilles Dowek www-roc.inria.fr/who/gilles.dowek arxiv:1111.4611v1 [cs.lo]

More information

Exercises for Unit VI (Infinite constructions in set theory)

Exercises for Unit VI (Infinite constructions in set theory) Exercises for Unit VI (Infinite constructions in set theory) VI.1 : Indexed families and set theoretic operations (Halmos, 4, 8 9; Lipschutz, 5.3 5.4) Lipschutz : 5.3 5.6, 5.29 5.32, 9.14 1. Generalize

More information

16.1 Countability. CS125 Lecture 16 Fall 2014

16.1 Countability. CS125 Lecture 16 Fall 2014 CS125 Lecture 16 Fall 2014 16.1 Countability Proving the non-existence of algorithms for computational problems can be very difficult. Indeed, we do not know how to prove P NP. So a natural question is

More information

2) e = e G G such that if a G 0 =0 G G such that if a G e a = a e = a. 0 +a = a+0 = a.

2) e = e G G such that if a G 0 =0 G G such that if a G e a = a e = a. 0 +a = a+0 = a. Chapter 2 Groups Groups are the central objects of algebra. In later chapters we will define rings and modules and see that they are special cases of groups. Also ring homomorphisms and module homomorphisms

More information

Final Exam (100 points)

Final Exam (100 points) Final Exam (100 points) Honor Code: Each question is worth 10 points. There is one bonus question worth 5 points. In contrast to the homework assignments, you may not collaborate on this final exam. You

More information

Axioms of separation

Axioms of separation Axioms of separation These notes discuss the same topic as Sections 31, 32, 33, 34, 35, and also 7, 10 of Munkres book. Some notions (hereditarily normal, perfectly normal, collectionwise normal, monotonically

More information

What does the partial order "mean"?

What does the partial order mean? What does the partial order "mean"? Domain theory developed by Dana Scott and Gordon Plotkin in the late '60s use partial order to represent (informally): approximates carries more information than better

More information

AM 121: Intro to Optimization

AM 121: Intro to Optimization AM 121: Intro to Optimization Models and Methods Lecture 6: Phase I, degeneracy, smallest subscript rule. Yiling Chen SEAS Lesson Plan Phase 1 (initialization) Degeneracy and cycling Smallest subscript

More information

Theoretical Computer Science 323 (2004) Nominal unication. Cambridge CB3 OFD, UK b INRIA, Paris, France

Theoretical Computer Science 323 (2004) Nominal unication. Cambridge CB3 OFD, UK b INRIA, Paris, France Theoretical Computer Science 323 (2004) 473 497 www.elsevier.com/locate/tcs Nominal unication Christian Urban a, Andrew M. Pitts a;, Murdoch J. Gabbay b a University of Cambridge, Marconi Laboratory, William

More information

EQUIVALENCE RELATIONS (NOTES FOR STUDENTS) 1. RELATIONS

EQUIVALENCE RELATIONS (NOTES FOR STUDENTS) 1. RELATIONS EQUIVALENCE RELATIONS (NOTES FOR STUDENTS) LIOR SILBERMAN Version 1.0 compiled September 9, 2015. 1.1. List of examples. 1. RELATIONS Equality of real numbers: for some x,y R we have x = y. For other pairs

More information

GALOIS THEORY : LECTURE 4 LEO GOLDMAKHER

GALOIS THEORY : LECTURE 4 LEO GOLDMAKHER GALOIS THEORY : LECTURE 4 LEO GOLDMAKHER 1. A BRIEF REVIEW OF S n The rest of the lecture relies on familiarity with the symmetric group of n elements, denoted S n (this is the group of all permutations

More information

Notes on Proving Arithmetic Equations

Notes on Proving Arithmetic Equations Massachusetts Institute of Technology Course Notes 1 6.844, Spring 03: Computability Theory of and with Scheme February 10 Prof. Albert Meyer revised February 25, 2003, 1300 minutes Notes on Proving Arithmetic

More information

The constructible universe

The constructible universe The constructible universe In this set of notes I want to sketch Gödel s proof that CH is consistent with the other axioms of set theory. Gödel s argument goes well beyond this result; his identification

More information

MATH1050 Greatest/least element, upper/lower bound

MATH1050 Greatest/least element, upper/lower bound MATH1050 Greatest/ element, upper/lower bound 1 Definition Let S be a subset of R x λ (a) Let λ S λ is said to be a element of S if, for any x S, x λ (b) S is said to have a element if there exists some

More information

First-Order Logic. 1 Syntax. Domain of Discourse. FO Vocabulary. Terms

First-Order Logic. 1 Syntax. Domain of Discourse. FO Vocabulary. Terms First-Order Logic 1 Syntax Domain of Discourse The domain of discourse for first order logic is FO structures or models. A FO structure contains Relations Functions Constants (functions of arity 0) FO

More information

CSC 2541: Bayesian Methods for Machine Learning

CSC 2541: Bayesian Methods for Machine Learning CSC 2541: Bayesian Methods for Machine Learning Radford M. Neal, University of Toronto, 2011 Lecture 3 More Markov Chain Monte Carlo Methods The Metropolis algorithm isn t the only way to do MCMC. We ll

More information