Linear Dependent Types in a Subrecursive Setting

Size: px
Start display at page:

Download "Linear Dependent Types in a Subrecursive Setting"

Transcription

1 Linear Dependent Types in a Subrecursive Setting Ugo Dal Lago Bounded Linear Logic Workshop December 4th, 2013

2 Part I Linear Dependent Types: Motivations

3 Characterizing Complexity Classes L C

4 Characterizing Complexity Classes L C

5 Characterizing Complexity Classes L C P

6 Characterizing Complexity Classes L S C P

7 Proving S P P Ď S For every function f which can be computed within the bounds prescribed by P, there is a P P S such that P f. S Ď P Semantically For every P P S, P P P is proved by showing that an algorithm computing P exists which works within the prescribed resource bounds. P P L does not necessarily exhibit a nice computational behavior. Example: category-theoretic proofs [Hofmann09]. Operationally Sometimes, L can be endowed with an effective operational semantics. Let L P Ď L be the set of those programs which work within the bounds prescribed by C. S Ď P can be shown by proving S Ď L P.

8 Proving S P P Ď S For every function f which can be computed within the bounds prescribed by P, there is a P P S such that P f. S Ď P Semantically For every P P S, P P P is proved by showing that an algorithm computing P exists which works within the prescribed resource bounds. P P L does not necessarily exhibit a nice computational behavior. Example: category-theoretic proofs [Hofmann09]. Operationally Sometimes, L can be endowed with an effective operational semantics. Let L P Ď L be the set of those programs which work within the bounds prescribed by C. S Ď P can be shown by proving S Ď L P.

9 If Soundness is Proved Operationally... L L P S

10 If Soundness is Proved Operationally... L L P S

11 ICC Systems as Static Analyzers P L S Yes, P L P Don t know

12 ICC Systems as Static Analyzers P L S Yes, P L P + bounds Don t know

13 ICC: Intensional Expressive Power L L P S

14 ICC: Intensional Expressive Power L L P S

15 ICC: Intensional Expressive Power L L P S

16 ICC: Intensional Expressive Power L L P S

17 ICC: Intensional Expressive Power L L P S

18 ICC: Intensional Expressive Power L L P S Safe Recursion [BC92] Light Linear Logic [Girard97].

19 ICC: Intensional Expressive Power L L P S Bounded Recursion on Notation [Cobham63] Bounded Arithmetic [Buss80].

20 Program Logics Judgments: {P}C{Q} Some rules: precondition program postcondition tp re{xsu x : E tp u tp u skip tp u tp u C tqu tqu D tru tp u C; D tru R ñ P tp u C tqu Q ñ S tru C tsu

21 Program Logics Judgments: {P}C{Q} Some rules: precondition program postcondition tp re{xsu x : E tp u tp u skip tp u tp u C tqu tqu D tru tp u C; D tru R ñ P tp u C tqu Q ñ S tru C tsu

22 Program Logics: Relative Completeness The formal system is sound. If true formulas of PA are used as side-conditions. It s also relatively complete [Cook78]. All true assertions can be derived if all true PA formulas can be used as side-conditions. Concrete axiom systems can be derived by throwing in a concrete sound formal system F for PA. They are sound. They are incomplete, due to Gödel incompleteness. F is solely responsible for their incompleteness. A variety of FH logics enjoy the properties above. Including some for higher-order programs [Honda2000] and some in which the complexity of programs and not only their extensional behavior is taken into account.

23 Program Logics Property Complexity Degree of Completeness

24 ICC Systems Property Complexity Degree of Completeness

25 ICC Systems Property Complexity Degree of Completeness

26 ICC Systems Property Complexity Degree of Completeness

27 Some Examples Simply Types Well-typed programs do not go wrong. Type inference and type checking are often decidable. Dependent Types Type checking is decidable. Interesting, extensional properties can be specified. Intersection Types Sound and complete for termination. In certain cases, the complexity of evaluation of a λ-term can be read from its type derivation [decarvalho2008], [Lengrand2011]. Type inference is not decidable. Studying programs as functions requires considering an infinite family of type derivations.

28 Part II The System

29 [BLL] allows for the definition of all polynomial time computable functions and [...] can define datatypes via their Church encodings. Like in Cobham s system explicit size bounds need to be maintained; the difference is that enforcement of these bounds is intrinsically guaranteed by the type system and does neither rely on external reasoning nor on an ad hoc solutions such as cutting off at size overflow [...]. Unfortunately, BLL has received very little attention since its publication; a further elaboration might prove worthwhile. Martin Hofmann, Programming Languages Capturing Complexity Classes, ACM SIGACT News.

30 Bounded Linear Logic

31 Bounded Linear Logic One of the earliest examples of a system capturing polynomial time functions [GSS1992]. Extensionally! For every polytime function there is at least one proof in BLL computing it. Types: A :: αpp 1,..., p n q A b A A xăp A How many polytime proofs does BLL capture? There s evidence they are many [DLHofmann2010]. Type checking can be problematic. As an example: Γ,! xăp A,! yăq Atp ` y{xu $ B p ` q ď r Γ,! xăr A $ B X

32 Bounded Linear Logic One of the earliest examples of a system capturing polynomial time functions [GSS1992]. Extensionally! For every polytime function there is at least one proof in BLL computing it. Types: A :: αpp 1,..., p n q A b A A xăp A How many polytime proofs does BLL capture? There s evidence they are many [DLHofmann2010]. Type checking can be problematic. As an example: Γ,! xăp A,! yăq Atp ` y{xu $ B p ` q ď r Γ,! xăr A $ B X

33 BLL vs. MELL!A!Ab!A ó! xăp`q A! xăp Ab! xăq Atx ` p{xu

34 BLL vs. MELL!A!Ab!A ó! xăp`q A! xăp Ab! xăq Atx ` p{xu

35 BLL vs. MELL!A A ó! xă1 A At0{xu

36 BLL vs. MELL!A A ó! xă1 A At0{xu

37 BLL vs. MELL!A!!A ó! ř xă yăp q A! yăp! xăq Atx ` ÿ qtz{yu{xu zăy

38 BLL vs. MELL!A!!A ó! ř xă yăp q A! yăp! xăq Atx ` ÿ qtz{yu{xu zăy

39 BLL is not Intensionally Complete Everything works in polynomial time. Take: logpxq Ñ 1 rlog 2 p x qs ; exppxq Ñ 1 2 x. Consider: idpxq Ñ expplogpxqq. id is polytime, but cannot be typed in BLL, because exp cannot. How about hereditarily polytime algorithms? Polynomials seem to be too uniform anyway. Hard to capture algorithms which are polytime but not blindly polytime. A more general notion of a bound is needed!

40 Why?! aăi A ó At0{au b... b AtI 1{au

41 Why?! aăi A ó At0{au b... b AtI 1{au

42 dlpcf: a Bird s Eye View A type system for the λ-calculus with constants and full higher-order recursion. (i.e. PCF). Greatly inspired by BLL. Indices are not necessarily polynomials, but terms from a signature Σ. Symbols in Σ are given a meaning by an equational program E. Side conditions: K 1 ď H 1,..., K n ď H n ù E I ď J Types and modal types: A, B :: NatrI, Js F A basic types F, G :: ra ă Is A modal types

43 dlpcf: a Bird s Eye View A type system for the λ-calculus with constants and full higher-order recursion. (i.e. PCF). Greatly inspired by BLL. Indices are not necessarily polynomials, but terms from a signature Σ. Symbols in Σ are given a meaning by an equational program E. Side conditions: K 1 ď H 1,..., K n ď H n ù E I ď J Types and modal types: A, B :: NatrIs F A basic types F, G :: ra ă Is A modal types

44 dlpcf: a Bird s Eye View A type system for the λ-calculus with constants and full higher-order recursion. (i.e. PCF). Greatly inspired by BLL. Indices are not necessarily polynomials, but terms from a signature Σ. Symbols in Σ are given a meaning by an equational program E. Side conditions: K 1 ď H 1,..., K n ď H n ù E I ď J Types and modal types: A, B :: ta P Nat Iu F A basic types F, G :: ra ă Is A modal types

45 The Meaning of Types ra ă Is A B ó pat0{au b... b AtI 1{auq B

46 The Meaning of Types ra ă Is A B ó pat0{au b... b AtI 1{auq B

47 dlpcf: Some Rules $ E ra ă Is A Ď ra ă 1s B Γ, x : ra ă Is A $ E 0 x : Bt0{au V Weight

48 dlpcf: Some Rules $ E NatrI ` 1, J ` 1s Ď NatrK, Hs Γ $ E L M : NatrI, Js Γ $ E S L succpmq : NatrK, Hs

49 dlpcf: Some Rules $ E Σ Ď Γ Z ř aăi Γ $ E J M : ra ă Is A B $ E K N : A Σ $ E J`ř aďi K`I MN : B A

50 dlpcf: Some Rules Sum of Modal Types $ E Σ Ď Γ Z ř aăi Γ $ E J M : ra ă Is A B $ E K N : A Σ $ E J`ř aďi K`I MN : B A

51 dlpcf: Some Rules Bounded Sum of Modal Types $ E Σ Ď Γ Z ř aăi Γ $ E J M : ra ă Is A B $ E K N : A Σ $ E J`ř aďi K`I MN : B A

52 dlpcf: How Recursion Works b; x : ra ă Is A $ E J M : B Bt0{bu ra ă It0{bus At0{bu At0{but0{au At0{butIt0{bu 1{au Bt1{bu BtIt0{bu{bu ra ă It1{bus At1{bu. ra ă ItpIt0{buq{bus AtpIt0{buq{bu.

53 dlpcf: How Recursion Works b; x : ra ă Is A $ E J M : B Bt0{bu ra ă It0{bus At0{bu At0{but0{au At0{butIt0{bu 1{au Bt1{bu BtIt0{bu{bu ra ă It1{bus At1{bu. ra ă ItpIt0{buq{bus AtpIt0{buq{bu.

54 dlpcf: How Recursion Works b; x : ra ă Is A $ E J M : B Bt0{bu ra ă It0{bus At0{bu At0{but0{au At0{butIt0{bu 1{au Bt1{bu BtIt0{bu{bu ra ă It1{bus At1{bu. ra ă ItpIt0{buq{bus AtpIt0{buq{bu.

55 dlpcf: How Recursion Works b; x : ra ă Is A $ E J M : B Bt0{bu ra ă It0{bus At0{bu At0{but0{au At0{butIt0{bu 1{au Bt1{bu BtIt0{bu{bu ra ă It1{bus At1{bu. ra ă ItpIt0{buq{bus AtpIt0{buq{bu.

56 dlpcf: How Recursion Works b; x : ra ă Is A $ E J M : B Bt0{bu ra ă It0{bus At0{bu At0{but0{au At0{butIt0{bu 1{au Bt1{bu BtIt0{bu{bu ra ă It1{bus At1{bu. ra ă ItpIt0{buq{bus AtpIt0{buq{bu.

57 dlpcf: How Recursion Works b; x : ra ă Is A $ E J M : B Bt0{bu ra ă It0{bus At0{bu At0{but0{au At0{butIt0{bu 1{au Bt1{bu BtIt0{bu{bu ra ă It1{bus At1{bu. ra ă ItpIt0{buq{bus AtpIt0{buq{bu.

58 dlpcf: How Recursion Works b; x : ra ă Is A $ E J M : B Ï b I Bt0{bu It0{bu Bt1{bu It1{bu ItpIt0{auq{bu BtIt0{bu{bu

59 dlpcf: How Recursion Works b; x : ra ă Is A $ E J M : B Ï b I Bt0{bu It0{bu Bt1{bu It1{bu ItpIt0{auq{bu BtIt0{bu{bu

60 dlpcf: Intended Meaning $ I M : rjs Natras NatrK, Hs What does this mean? M computes a function from natural numbers to natural numbers. Something extensional: On input a natural number a, M returns a natural number in rk, Hs Something more intensional: The cost of evaluation of M on an input a is I ` J. Two questions: Is this correct? How many programs can be captured this way? Type soundness is somehow inherited from BLL.

61 dlpcf: Intended Meaning $ I M : rjs Natras NatrK, Hs What does this mean? M computes a function from natural numbers to natural numbers. Something extensional: On input a natural number a, M returns a natural number in rk, Hs Something more intensional: The cost of evaluation of M on an input a is I ` J. Two questions: Is this correct? How many programs can be captured this way? Type soundness is somehow inherited from BLL.

62 dlpcf: Intended Meaning $ I M : rjs Natras NatrK, Hs What does this mean? M computes a function from natural numbers to natural numbers. Something extensional: On input a natural number a, M returns a natural number in rk, Hs Something more intensional: The cost of evaluation of M on an input a is I ` J. Two questions: Is this correct? How many programs can be captured this way? Type soundness is somehow inherited from BLL.

63 dlpcf: Intended Meaning $ I M : rjs Natras NatrK, Hs What does this mean? M computes a function from natural numbers to natural numbers. Something extensional: On input a natural number a, M returns a natural number in rk, Hs Something more intensional: The cost of evaluation of M on an input a is I ` J. Two questions: Is this correct? How many programs can be captured this way? Type soundness is somehow inherited from BLL.

64 dlpcf: Intended Meaning $ I M : rjs Natras NatrK, Hs What does this mean? M computes a function from natural numbers to natural numbers. Something extensional: On input a natural number a, M returns a natural number in rk, Hs Something more intensional: The cost of evaluation of M on an input a is I ` J. Two questions: Is this correct? How many programs can be captured this way? Type soundness is somehow inherited from BLL.

65 dlpcf: Intended Meaning $ I M : rjs Natras NatrK, Hs What does this mean? M computes a function from natural numbers to natural numbers. Something extensional: On input a natural number a, M returns a natural number in rk, Hs Something more intensional: The cost of evaluation of M on an input a is I ` J. Two questions: Is this correct? How many programs can be captured this way? Type soundness is somehow inherited from BLL.

66 dlpcf: Intended Meaning $ I M : rjs Natras NatrK, Hs What does this mean? M computes a function from natural numbers to natural numbers. Something extensional: On input a natural number a, M returns a natural number in rk, Hs Something more intensional: The cost of evaluation of M on an input a is I ` J. Two questions: Is this correct? How many programs can be captured this way? Type soundness is somehow inherited from BLL.

67 Completeness for Programs The following holds only when E is universal. p A q is the PCF type underlying A, i.e. its skeleton. The type system can be lifted to configurations of an abstract machine à la Krivine. Lemma (Weighted Subject Expansion) If D has weight I and type A and C is typable with type p A q. Then, C Ñ D implies that C has weight J and type A, where ù J ď I ` 1. Theorem (Relative Completeness for Programs) Let M be a PCF program such that M ó n m. Then, there exist two index terms I and J such that I U ď n and J U m and such that the term M is typable in dlpcf as $ U I M : NatrJs.

68 Completeness for Programs The following holds only when E is universal. p A q is the PCF type underlying A, i.e. its skeleton. The type system can be lifted to configurations of an abstract machine à la Krivine. Lemma (Weighted Subject Expansion) If D has weight I and type A and C is typable with type p A q. Then, C Ñ D implies that C has weight J and type A, where ù J ď I ` 1. Theorem (Relative Completeness for Programs) Let M be a PCF program such that M ó n m. Then, there exist two index terms I and J such that I U ď n and J U m and such that the term M is typable in dlpcf as $ U I M : NatrJs.

69 Completeness for Programs The following holds only when E is universal. p A q is the PCF type underlying A, i.e. its skeleton. The type system can be lifted to configurations of an abstract machine à la Krivine. Lemma (Weighted Subject Expansion) If D has weight I and type A and C is typable with type p A q. Then, C Ñ D implies that C has weight J and type A, where ù J ď I ` 1. Theorem (Relative Completeness for Programs) Let M be a PCF program such that M ó n m. Then, there exist two index terms I and J such that I U ď n and J U m and such that the term M is typable in dlpcf as $ U I M : NatrJs.

70 Completeness for Functions It strongly relies on the universality of U. Suppose that tπ n u npn is an r.e. family of type derivations: For the same term M; Having the same PCF skeleton (as type derivations); Then we can turn them into a single, parametric type derivation. Theorem (Relative Completeness for Functions) Suppose that M is a PCF term such that $ M : Nat Ñ Nat. Moreover, suppose that there are two (total and computable) functions f, g : N Ñ N such that M n ó gpnq fpnq. Then there are terms I, J, K with I ` J ď g and K f, such that $ U I M : rjs Natras NatrKs.

71 Completeness for Functions It strongly relies on the universality of U. Suppose that tπ n u npn is an r.e. family of type derivations: For the same term M; Having the same PCF skeleton (as type derivations); Then we can turn them into a single, parametric type derivation. Theorem (Relative Completeness for Functions) Suppose that M is a PCF term such that $ M : Nat Ñ Nat. Moreover, suppose that there are two (total and computable) functions f, g : N Ñ N such that M n ó gpnq fpnq. Then there are terms I, J, K with I ` J ď g and K f, such that $ U I M : rjs Natras NatrKs.

72 Linear Dependent Types [DLGaboardi2011] Property Complexity BLL dlpcf Degree of Completeness

73 Part III Recent Contributions

74 Type Inference (joint with Petit) We have a powerful system for complexity analsysis, which is relatively complete. Thus undecidable! So what? It s the same situation as in program logics... But there are algorithms for weakest preconditions, there... We need something similar also here...

75 Type Inference (joint with Petit) We have a powerful system for complexity analsysis, which is relatively complete. Thus undecidable! So what? It s the same situation as in program logics... But there are algorithms for weakest preconditions, there... We need something similar also here...

76 Type Inference (joint with Petit) We have a powerful system for complexity analsysis, which is relatively complete. Thus undecidable! So what? It s the same situation as in program logics... But there are algorithms for weakest preconditions, there... We need something similar also here...

77 Type Inference (joint with Petit) We have a powerful system for complexity analsysis, which is relatively complete. Thus undecidable! So what? It s the same situation as in program logics... But there are algorithms for weakest preconditions, there... We need something similar also here...

78 Type Inference (joint with Petit) We have a powerful system for complexity analsysis, which is relatively complete. Thus undecidable! So what? It s the same situation as in program logics... But there are algorithms for weakest preconditions, there... We need something similar also here...

79 Type Inference (joint with Petit) t TI σ I E I $ E I t : σ P I. ù E E

80 Type Inference (joint with Petit) t TI σ I E I $ E I t : σ P I. ù E E

81 Linear Dependency in a Subrecursive Setting (joint with Baillot and Barthe, Ongoing) A necessary condition for completeness: universality of E. What if we restrict PCF to a subrecursive language similar to Gödel s T? We don t need the complicated machinery needed for handling recursion in PCF, anymore. We can easily handle references through effects. Judgments become: Γ $ E I M : A, ϕ Two interesting results on type inference: Linearity on higher-order variables implies termination of E; If all occurrences of recursion in the underlying program are first-order, then E is primitive recursive.

82 Linear Dependency in a Subrecursive Setting (joint with Baillot and Barthe, Ongoing) A necessary condition for completeness: universality of E. What if we restrict PCF to a subrecursive language similar to Gödel s T? We don t need the complicated machinery needed for handling recursion in PCF, anymore. We can easily handle references through effects. Judgments become: Γ $ E I M : A, ϕ Two interesting results on type inference: Linearity on higher-order variables implies termination of E; If all occurrences of recursion in the underlying program are first-order, then E is primitive recursive.

83 Linear Dependency and Session Types (Ongoing) Linear logic and session types are stongly related (e.g. [CairesPfenning10]). The type of a (potentially non-terminating) session between a bank and a customer could be, e.g. µα.nat Nat α With linear dependency, one could decorate the type as follows: µαpaq.natpbq NatpKq H I αpjq where I, H are boolean index term. If the rewrite system fpaq Ñ if I then fpjq else end is terminating, then the session above is finite.

84 Questions?

The Formal Semantics of Programming Languages An Introduction. Glynn Winskel. The MIT Press Cambridge, Massachusetts London, England

The Formal Semantics of Programming Languages An Introduction. Glynn Winskel. The MIT Press Cambridge, Massachusetts London, England The Formal Semantics of Programming Languages An Introduction Glynn Winskel The MIT Press Cambridge, Massachusetts London, England Series foreword Preface xiii xv 1 Basic set theory 1 1.1 Logical notation

More information

Chapter 3. Semantics. Topics. Introduction. Introduction. Introduction. Introduction

Chapter 3. Semantics. Topics. Introduction. Introduction. Introduction. Introduction Topics Chapter 3 Semantics Introduction Static Semantics Attribute Grammars Dynamic Semantics Operational Semantics Axiomatic Semantics Denotational Semantics 2 Introduction Introduction Language implementors

More information

Polymorphism and System-F (OV)

Polymorphism and System-F (OV) Polymorphism and System-F (OV) Theorie der Programmierung SoSe 2014 FAU the occurrence of something in several different forms Polymorphism? Polymorphic systems Type systems that allow a single piece of

More information

Lesson 4 Typed Arithmetic Typed Lambda Calculus

Lesson 4 Typed Arithmetic Typed Lambda Calculus Lesson 4 Typed Arithmetic Typed Lambda 1/28/03 Chapters 8, 9, 10 Outline Types for Arithmetic types the typing relation safety = progress + preservation The simply typed lambda calculus Function types

More information

3.7 Denotational Semantics

3.7 Denotational Semantics 3.7 Denotational Semantics Denotational semantics, also known as fixed-point semantics, associates to each programming language construct a well-defined and rigorously understood mathematical object. These

More information

More intensional versions of Rice s Theorem

More intensional versions of Rice s Theorem More intensional versions of Rice s Theorem Jean-Yves Moyen Jean-Yves.Moyen@univ-paris13.fr Jakob Grue Simonsen simonsen@diku.dk Department of Computer Science, University of Copenhagen (DIKU) Njalsgade

More information

Lectures 20, 21: Axiomatic Semantics

Lectures 20, 21: Axiomatic Semantics Lectures 20, 21: Axiomatic Semantics Polyvios Pratikakis Computer Science Department, University of Crete Type Systems and Static Analysis Based on slides by George Necula Pratikakis (CSD) Axiomatic Semantics

More information

T ::=Nat T T. zero : Nat. This rule can be instantiated for any type T, so it is actually a family of rules, one for each type.

T ::=Nat T T. zero : Nat. This rule can be instantiated for any type T, so it is actually a family of rules, one for each type. V Capretta 46 G54FOP 2018 Chapter 6 System T We have seen that the simple types of λ allow us to define only a limited class of operations. We can program addition and multiplication but not exponentiation.

More information

Integration of SMT Solvers with ITPs There and Back Again

Integration of SMT Solvers with ITPs There and Back Again Integration of SMT Solvers with ITPs There and Back Again Sascha Böhme and University of Sheffield 7 May 2010 1 2 Features: SMT-LIB vs. Yices Translation Techniques Caveats 3 4 Motivation Motivation System

More information

An Annotated Language

An Annotated Language Hoare Logic An Annotated Language State and Semantics Expressions are interpreted as functions from states to the corresponding domain of interpretation Operators have the obvious interpretation Free of

More information

Reasoning about programs

Reasoning about programs Reasoning about programs Last time Coming up This Thursday, Nov 30: 4 th in-class exercise sign up for group on moodle bring laptop to class Final projects: final project presentations: Tue Dec 12, in

More information

Programming Languages

Programming Languages CSE 230: Winter 2008 Principles of Programming Languages Ocaml/HW #3 Q-A Session Push deadline = Mar 10 Session Mon 3pm? Lecture 15: Type Systems Ranjit Jhala UC San Diego Why Typed Languages? Development

More information

Last time. Reasoning about programs. Coming up. Project Final Presentations. This Thursday, Nov 30: 4 th in-class exercise

Last time. Reasoning about programs. Coming up. Project Final Presentations. This Thursday, Nov 30: 4 th in-class exercise Last time Reasoning about programs Coming up This Thursday, Nov 30: 4 th in-class exercise sign up for group on moodle bring laptop to class Final projects: final project presentations: Tue Dec 12, in

More information

Introduction to Axiomatic Semantics (1/2)

Introduction to Axiomatic Semantics (1/2) #1 Introduction to Axiomatic Semantics (1/2) How s The Homework Going? Remember that you can t just define a meaning function in terms of itself you must use some fixed point machinery. #2 #3 Observations

More information

AXIOMS OF AN IMPERATIVE LANGUAGE PARTIAL CORRECTNESS WEAK AND STRONG CONDITIONS. THE AXIOM FOR nop

AXIOMS OF AN IMPERATIVE LANGUAGE PARTIAL CORRECTNESS WEAK AND STRONG CONDITIONS. THE AXIOM FOR nop AXIOMS OF AN IMPERATIVE LANGUAGE We will use the same language, with the same abstract syntax that we used for operational semantics. However, we will only be concerned with the commands, since the language

More information

Hoare Logic. COMP2600 Formal Methods for Software Engineering. Rajeev Goré

Hoare Logic. COMP2600 Formal Methods for Software Engineering. Rajeev Goré Hoare Logic COMP2600 Formal Methods for Software Engineering Rajeev Goré Australian National University Semester 2, 2016 (Slides courtesy of Ranald Clouston) COMP 2600 Hoare Logic 1 Australian Capital

More information

λ-calculus Lecture 1 Venanzio Capretta MGS Nottingham

λ-calculus Lecture 1 Venanzio Capretta MGS Nottingham λ-calculus Lecture 1 Venanzio Capretta MGS 2018 - Nottingham Table of contents 1. History of λ-calculus 2. Definition of λ-calculus 3. Data Structures 1 History of λ-calculus Hilbert s Program David Hilbert

More information

Introduction to Axiomatic Semantics

Introduction to Axiomatic Semantics Introduction to Axiomatic Semantics Meeting 10, CSCI 5535, Spring 2009 Announcements Homework 3 due tonight Homework 2 is graded 13 (mean), 14 (median), out of 21 total, but Graduate class: final project

More information

Lecture 2: NP-Completeness

Lecture 2: NP-Completeness NP and Latin Squares Instructor: Padraic Bartlett Lecture 2: NP-Completeness Week 4 Mathcamp 2014 In our last class, we introduced the complexity classes P and NP. To motivate why we grouped all of NP

More information

λ calculus is inconsistent

λ calculus is inconsistent Content Rough timeline COMP 4161 NICTA Advanced Course Advanced Topics in Software Verification Gerwin Klein, June Andronick, Toby Murray λ Intro & motivation, getting started [1] Foundations & Principles

More information

Subsumption. Principle of safe substitution

Subsumption. Principle of safe substitution Recap on Subtyping Subsumption Some types are better than others, in the sense that a value of one can always safely be used where a value of the other is expected. Which can be formalized as by introducing:

More information

a brief introduction to (dependent) type theory

a brief introduction to (dependent) type theory a brief introduction to (dependent) type theory Cory Knapp January 14, 2015 University of Birmingham what is type theory? What is type theory? formal language of terms with types x : A x has type A What

More information

A First-Order Logic with First-Class Types

A First-Order Logic with First-Class Types A First-Order Logic with First-Class Types joint work with Peter H. Schmitt and Mattias Ulbrich Institute for Theoretical Computer Science The 8th KeY Symposium, Speyer, 2009 Java Card DL modal logic based

More information

COMP 4161 NICTA Advanced Course. Advanced Topics in Software Verification. Toby Murray, June Andronick, Gerwin Klein

COMP 4161 NICTA Advanced Course. Advanced Topics in Software Verification. Toby Murray, June Andronick, Gerwin Klein COMP 4161 NICTA Advanced Course Advanced Topics in Software Verification Toby Murray, June Andronick, Gerwin Klein λ 1 Last time... λ calculus syntax free variables, substitution β reduction α and η conversion

More information

A CRASH COURSE IN SEMANTICS

A CRASH COURSE IN SEMANTICS LAST TIME Recdef More induction NICTA Advanced Course Well founded orders Slide 1 Theorem Proving Principles, Techniques, Applications Slide 3 Well founded recursion Calculations: also/finally {P}... {Q}

More information

Hoare triples. Floyd-Hoare Logic, Separation Logic

Hoare triples. Floyd-Hoare Logic, Separation Logic Hoare triples Floyd-Hoare Logic, Separation Logic 1. Floyd-Hoare Logic 1969 Reasoning about control Hoare triples {A} p {B} a Hoare triple partial correctness: if the initial state satisfies assertion

More information

Chapter 3. Semantics. Topics. Introduction. Introduction. Introduction. Introduction

Chapter 3. Semantics. Topics. Introduction. Introduction. Introduction. Introduction Topics Chapter 3 Semantics Introduction Static Semantics Attribute Grammars Dynamic Semantics Operational Semantics Axiomatic Semantics Denotational Semantics 2 Introduction Introduction Language implementors

More information

Concepts of programming languages

Concepts of programming languages Concepts of programming languages Lecture 5 Wouter Swierstra 1 Announcements Submit your project proposal to me by email on Friday; The presentation schedule in now online Exercise session after the lecture.

More information

From natural numbers to the lambda calculus

From natural numbers to the lambda calculus From natural numbers to the lambda calculus Benedikt Ahrens joint work with Ralph Matthes and Anders Mörtberg Outline 1 About UniMath 2 Signatures and associated syntax Outline 1 About UniMath 2 Signatures

More information

Programming Languages Lecture 14: Sum, Product, Recursive Types

Programming Languages Lecture 14: Sum, Product, Recursive Types CSE 230: Winter 200 Principles of Programming Languages Lecture 4: Sum, Product, Recursive Types The end is nigh HW 3 No HW 4 (= Final) Project (Meeting + Talk) Ranjit Jhala UC San Diego Recap Goal: Relate

More information

Runtime Behavior of Conversion Interpretation of Subtyping

Runtime Behavior of Conversion Interpretation of Subtyping Runtime Behavior of Conversion Interpretation of Subtyping Yasuhiko Minamide Institute of Information Sciences and Electronics University of Tsukuba and PRESTO, JST minamide@is.tsukuba.ac.jp Abstract.

More information

Reasoning About Imperative Programs. COS 441 Slides 10

Reasoning About Imperative Programs. COS 441 Slides 10 Reasoning About Imperative Programs COS 441 Slides 10 The last few weeks Agenda reasoning about functional programming It s very simple and very uniform: substitution of equal expressions for equal expressions

More information

Critical Analysis of Computer Science Methodology: Theory

Critical Analysis of Computer Science Methodology: Theory Critical Analysis of Computer Science Methodology: Theory Björn Lisper Dept. of Computer Science and Engineering Mälardalen University bjorn.lisper@mdh.se http://www.idt.mdh.se/ blr/ March 3, 2004 Critical

More information

Chapter 3 (part 3) Describing Syntax and Semantics

Chapter 3 (part 3) Describing Syntax and Semantics Chapter 3 (part 3) Describing Syntax and Semantics Chapter 3 Topics Introduction The General Problem of Describing Syntax Formal Methods of Describing Syntax Attribute Grammars Describing the Meanings

More information

Programming Language Concepts: Lecture 19

Programming Language Concepts: Lecture 19 Programming Language Concepts: Lecture 19 Madhavan Mukund Chennai Mathematical Institute madhavan@cmi.ac.in http://www.cmi.ac.in/~madhavan/courses/pl2009 PLC 2009, Lecture 19, 01 April 2009 Adding types

More information

Static semantics. Lecture 3-6: Semantics. Attribute grammars (2) Attribute grammars. Attribute grammars example. Dynamic semantics

Static semantics. Lecture 3-6: Semantics. Attribute grammars (2) Attribute grammars. Attribute grammars example. Dynamic semantics Lecture 3-6: Semantics Static semantics Attribute grammars Dynamic semantics Denotational semantics: semantic equations Axiomatic semantics: inference rules and correctness proofs Static semantics Semantics

More information

3.4 Deduction and Evaluation: Tools Conditional-Equational Logic

3.4 Deduction and Evaluation: Tools Conditional-Equational Logic 3.4 Deduction and Evaluation: Tools 3.4.1 Conditional-Equational Logic The general definition of a formal specification from above was based on the existence of a precisely defined semantics for the syntax

More information

Course notes for Data Compression - 2 Kolmogorov complexity Fall 2005

Course notes for Data Compression - 2 Kolmogorov complexity Fall 2005 Course notes for Data Compression - 2 Kolmogorov complexity Fall 2005 Peter Bro Miltersen September 29, 2005 Version 2.0 1 Kolmogorov Complexity In this section, we present the concept of Kolmogorov Complexity

More information

Finite Model Generation for Isabelle/HOL Using a SAT Solver

Finite Model Generation for Isabelle/HOL Using a SAT Solver Finite Model Generation for / Using a SAT Solver Tjark Weber webertj@in.tum.de Technische Universität München Winterhütte, März 2004 Finite Model Generation for / p.1/21 is a generic proof assistant: Highly

More information

Presented By : Abhinav Aggarwal CSI-IDD, V th yr Indian Institute of Technology Roorkee. Joint work with: Prof. Padam Kumar

Presented By : Abhinav Aggarwal CSI-IDD, V th yr Indian Institute of Technology Roorkee. Joint work with: Prof. Padam Kumar Presented By : Abhinav Aggarwal CSI-IDD, V th yr Indian Institute of Technology Roorkee Joint work with: Prof. Padam Kumar A Seminar Presentation on Recursiveness, Computability and The Halting Problem

More information

Defining Languages GMU

Defining Languages GMU Defining Languages CS463 @ GMU How do we discuss languages? We might focus on these qualities: readability: how well does a language explicitly and clearly describe its purpose? writability: how expressive

More information

Three Applications of Strictness in the Efficient Implementaton of Higher-Order Terms

Three Applications of Strictness in the Efficient Implementaton of Higher-Order Terms Three Applications of Strictness in the Efficient Implementaton of Higher-Order Terms Frank Pfenning Workshop on Implementation of Logic Réunion Island, France November 11, 2000 Joint work with Carsten

More information

The Inverse of a Schema Mapping

The Inverse of a Schema Mapping The Inverse of a Schema Mapping Jorge Pérez Department of Computer Science, Universidad de Chile Blanco Encalada 2120, Santiago, Chile jperez@dcc.uchile.cl Abstract The inversion of schema mappings has

More information

Meeting13:Denotations

Meeting13:Denotations Meeting13:Denotations Announcements Homework 3 due next week Friday at 6:00pm Homework2Comments Time: 29.2 hours avg Difficulty: 5.4 avg Issues Length? (Part 2 out Wed instead of Mon) Misunderstanding

More information

Types Summer School Gothenburg Sweden August Dogma oftype Theory. Everything has a type

Types Summer School Gothenburg Sweden August Dogma oftype Theory. Everything has a type Types Summer School Gothenburg Sweden August 2005 Formalising Mathematics in Type Theory Herman Geuvers Radboud University Nijmegen, NL Dogma oftype Theory Everything has a type M:A Types are a bit like

More information

From Types to Sets in Isabelle/HOL

From Types to Sets in Isabelle/HOL From Types to Sets in Isabelle/HOL Extented Abstract Ondřej Kunčar 1 and Andrei Popescu 1,2 1 Fakultät für Informatik, Technische Universität München, Germany 2 Institute of Mathematics Simion Stoilow

More information

Elementary Recursive Function Theory

Elementary Recursive Function Theory Chapter 6 Elementary Recursive Function Theory 6.1 Acceptable Indexings In a previous Section, we have exhibited a specific indexing of the partial recursive functions by encoding the RAM programs. Using

More information

Tradeoffs. CSE 505: Programming Languages. Lecture 15 Subtyping. Where shall we add useful completeness? Where shall we add completeness?

Tradeoffs. CSE 505: Programming Languages. Lecture 15 Subtyping. Where shall we add useful completeness? Where shall we add completeness? Tradeoffs CSE 505: Programming Languages Lecture 15 Subtyping Zach Tatlock Autumn 2017 Desirable type system properties (desiderata): soundness - exclude all programs that get stuck completeness - include

More information

CMSC 330: Organization of Programming Languages

CMSC 330: Organization of Programming Languages CMSC 330: Organization of Programming Languages Operational Semantics CMSC 330 Summer 2018 1 Formal Semantics of a Prog. Lang. Mathematical description of the meaning of programs written in that language

More information

Meeting14:Denotations

Meeting14:Denotations Meeting14:Denotations Announcements Homework 3 due next week Friday at 6:00pm Reminder: 5-minute feedback discussion with Sean is part of the assignment ("interview light") Talk (with me, with the class

More information

Introduction to Type Theory August 2007 Types Summer School Bertinoro, It. Herman Geuvers Nijmegen NL

Introduction to Type Theory August 2007 Types Summer School Bertinoro, It. Herman Geuvers Nijmegen NL Introduction to Type Theory August 2007 Types Summer School Bertinoro, It Herman Geuvers Nijmegen NL Lecture 2: Dependent Type Theory, Logical Framework 1 For λ : Direct representation (shallow embedding)

More information

Second-Order Type Systems

Second-Order Type Systems #1 Second-Order Type Systems Homework 5 Summary Student : 37.9704 Student : 44.4466 ORIGINAL : 50.2442 Student : 50.8275 Student : 50.8633 Student : 50.9181 Student : 52.1347 Student : 52.1633 Student

More information

CSE-321 Programming Languages 2011 Final

CSE-321 Programming Languages 2011 Final Name: Hemos ID: CSE-321 Programming Languages 2011 Final Prob 1 Prob 2 Prob 3 Prob 4 Prob 5 Prob 6 Total Score Max 15 15 10 17 18 25 100 There are six problems on 18 pages in this exam, including one extracredit

More information

Meta-programming with Names and Necessity p.1

Meta-programming with Names and Necessity p.1 Meta-programming with Names and Necessity Aleksandar Nanevski Carnegie Mellon University ICFP, Pittsburgh, 05 October 2002 Meta-programming with Names and Necessity p.1 Meta-programming Manipulation of

More information

Lecture 15: The subspace topology, Closed sets

Lecture 15: The subspace topology, Closed sets Lecture 15: The subspace topology, Closed sets 1 The Subspace Topology Definition 1.1. Let (X, T) be a topological space with topology T. subset of X, the collection If Y is a T Y = {Y U U T} is a topology

More information

Com S 541. Programming Languages I

Com S 541. Programming Languages I Programming Languages I Lecturer: TA: Markus Lumpe Department of Computer Science 113 Atanasoff Hall http://www.cs.iastate.edu/~lumpe/coms541.html TR 12:40-2, W 5 Pramod Bhanu Rama Rao Office hours: TR

More information

Negations in Refinement Type Systems

Negations in Refinement Type Systems Negations in Refinement Type Systems T. Tsukada (U. Tokyo) 14th March 2016 Shonan, JAPAN This Talk About refinement intersection type systems that refute judgements of other type systems. Background Refinement

More information

Dynamic Logic with Non-rigid Functions

Dynamic Logic with Non-rigid Functions Dynamic Logic with Non-rigid Functions A Basis for Object-oriented Program Verification Bernhard Beckert 1 André Platzer 2 1 University of Koblenz-Landau, Department of Computer Science beckert@uni-koblenz.de

More information

Calculus of Inductive Constructions

Calculus of Inductive Constructions Calculus of Inductive Constructions Software Formal Verification Maria João Frade Departmento de Informática Universidade do Minho 2008/2009 Maria João Frade (DI-UM) Calculus of Inductive Constructions

More information

This is already grossly inconvenient in present formalisms. Why do we want to make this convenient? GENERAL GOALS

This is already grossly inconvenient in present formalisms. Why do we want to make this convenient? GENERAL GOALS 1 THE FORMALIZATION OF MATHEMATICS by Harvey M. Friedman Ohio State University Department of Mathematics friedman@math.ohio-state.edu www.math.ohio-state.edu/~friedman/ May 21, 1997 Can mathematics be

More information

Programming Languages Third Edition

Programming Languages Third Edition Programming Languages Third Edition Chapter 12 Formal Semantics Objectives Become familiar with a sample small language for the purpose of semantic specification Understand operational semantics Understand

More information

On the Revision of Argumentation Systems: Minimal Change of Arguments Statuses

On the Revision of Argumentation Systems: Minimal Change of Arguments Statuses On the Revision of Argumentation Systems: Minimal Change of Arguments Statuses Sylvie Coste-Marquis Jean-Guy Mailly Sébastien Konieczny Pierre Marquis CRIL Univ. Artois CNRS UMR 8188 14th International

More information

Introduction to Axiomatic Semantics (1/2)

Introduction to Axiomatic Semantics (1/2) #1 Introduction to Axiomatic Semantics (1/2) How s The Homework Going? Remember: just do the counterexample guided abstraction refinement part of DPLL(T). If you notice any other errors, those are good

More information

n λxy.x n y, [inc] [add] [mul] [exp] λn.λxy.x(nxy) λmn.m[inc]0 λmn.m([add]n)0 λmn.n([mul]m)1

n λxy.x n y, [inc] [add] [mul] [exp] λn.λxy.x(nxy) λmn.m[inc]0 λmn.m([add]n)0 λmn.n([mul]m)1 LAMBDA CALCULUS 1. Background λ-calculus is a formal system with a variety of applications in mathematics, logic, and computer science. It examines the concept of functions as processes, rather than the

More information

Harvard School of Engineering and Applied Sciences CS 152: Programming Languages

Harvard School of Engineering and Applied Sciences CS 152: Programming Languages Harvard School of Engineering and Applied Sciences CS 152: Programming Languages Lecture 19 Tuesday, April 3, 2018 1 Introduction to axiomatic semantics The idea in axiomatic semantics is to give specifications

More information

1. Abstract syntax: deep structure and binding. 2. Static semantics: typing rules. 3. Dynamic semantics: execution rules.

1. Abstract syntax: deep structure and binding. 2. Static semantics: typing rules. 3. Dynamic semantics: execution rules. Introduction Formal definitions of programming languages have three parts: CMPSCI 630: Programming Languages Static and Dynamic Semantics Spring 2009 (with thanks to Robert Harper) 1. Abstract syntax:

More information

CS152: Programming Languages. Lecture 11 STLC Extensions and Related Topics. Dan Grossman Spring 2011

CS152: Programming Languages. Lecture 11 STLC Extensions and Related Topics. Dan Grossman Spring 2011 CS152: Programming Languages Lecture 11 STLC Extensions and Related Topics Dan Grossman Spring 2011 Review e ::= λx. e x e e c v ::= λx. e c τ ::= int τ τ Γ ::= Γ, x : τ (λx. e) v e[v/x] e 1 e 1 e 1 e

More information

Semantics with Applications 3. More on Operational Semantics

Semantics with Applications 3. More on Operational Semantics Semantics with Applications 3. More on Operational Semantics Hanne Riis Nielson, Flemming Nielson (thanks to Henrik Pilegaard) [SwA] Hanne Riis Nielson, Flemming Nielson Semantics with Applications: An

More information

Computing Fundamentals 2 Introduction to CafeOBJ

Computing Fundamentals 2 Introduction to CafeOBJ Computing Fundamentals 2 Introduction to CafeOBJ Lecturer: Patrick Browne Lecture Room: K408 Lab Room: A308 Based on work by: Nakamura Masaki, João Pascoal Faria, Prof. Heinrich Hußmann. See notes on slides

More information

Polymorphism. Lecture 19 CS 565 4/17/08

Polymorphism. Lecture 19 CS 565 4/17/08 Polymorphism Lecture 19 CS 565 4/17/08 The Limitations of F 1 (simply-typed λ- calculus) In F 1 each function works exactly for one type Example: the identity function id = λx:τ. x : τ τ We need to write

More information

Semantics. There is no single widely acceptable notation or formalism for describing semantics Operational Semantics

Semantics. There is no single widely acceptable notation or formalism for describing semantics Operational Semantics There is no single widely acceptable notation or formalism for describing semantics Operational Describe the meaning of a program by executing its statements on a machine, either simulated or actual. The

More information

Induction and Semantics in Dafny

Induction and Semantics in Dafny 15-414 Lecture 11 1 Instructor: Matt Fredrikson Induction and Semantics in Dafny TA: Ryan Wagner Encoding the syntax of Imp Recall the abstract syntax of Imp: a AExp ::= n Z x Var a 1 + a 2 b BExp ::=

More information

Lecture Notes on Data Representation

Lecture Notes on Data Representation Lecture Notes on Data Representation 15-814: Types and Programming Languages Frank Pfenning Lecture 9 Tuesday, October 2, 2018 1 Introduction In this lecture we ll see our type system in action. In particular

More information

Algebraic Processors

Algebraic Processors Algebraic Processors Algebraic Processors By Pouya Larjani, B.Sc. A Thesis Submitted to the School of Graduate Studies in partial fulfilment of the requirements for the degree of Master of Science Department

More information

Type Systems. Pierce Ch. 3, 8, 11, 15 CSE

Type Systems. Pierce Ch. 3, 8, 11, 15 CSE Type Systems Pierce Ch. 3, 8, 11, 15 CSE 6341 1 A Simple Language ::= true false if then else 0 succ pred iszero Simple untyped expressions Natural numbers encoded as succ succ

More information

Implicit Computational Complexity

Implicit Computational Complexity Implicit Computational Complexity Simone Martini Dipartimento di Scienze dell Informazione Università di Bologna Italy Bertinoro International Spring School for Graduate Studies in Computer Science, 6

More information

Chapter 3. Describing Syntax and Semantics

Chapter 3. Describing Syntax and Semantics Chapter 3 Describing Syntax and Semantics Chapter 3 Topics Introduction The General Problem of Describing Syntax Formal Methods of Describing Syntax Attribute Grammars Describing the Meanings of Programs:

More information

An Operational and Axiomatic Semantics for Non-determinism and Sequence Points in C

An Operational and Axiomatic Semantics for Non-determinism and Sequence Points in C An Operational and Axiomatic Semantics for Non-determinism and Sequence Points in C Robbert Krebbers Radboud University Nijmegen January 22, 2014 @ POPL, San Diego, USA 1 / 16 What is this program supposed

More information

14.1 Encoding for different models of computation

14.1 Encoding for different models of computation Lecture 14 Decidable languages In the previous lecture we discussed some examples of encoding schemes, through which various objects can be represented by strings over a given alphabet. We will begin this

More information

First-Class Type Classes

First-Class Type Classes First-Class Type Classes Matthieu Sozeau Joint work with Nicolas Oury LRI, Univ. Paris-Sud - Démons Team & INRIA Saclay - ProVal Project Gallium Seminar November 3rd 2008 INRIA Rocquencourt Solutions for

More information

6.001 Notes: Section 8.1

6.001 Notes: Section 8.1 6.001 Notes: Section 8.1 Slide 8.1.1 In this lecture we are going to introduce a new data type, specifically to deal with symbols. This may sound a bit odd, but if you step back, you may realize that everything

More information

dynamically typed dynamically scoped

dynamically typed dynamically scoped Reference Dynamically Typed Programming Languages Part 1: The Untyped λ-calculus Jim Royer CIS 352 April 19, 2018 Practical Foundations for Programming Languages, 2/e, Part VI: Dynamic Types, by Robert

More information

Operational semantics questions and answers

Operational semantics questions and answers Operational semantics questions and answers COMP 105 30 January 2019 Contents Functions vs syntactic forms............ 1 Environments and their notation......... 1 Function environments...............

More information

CSE-321 Programming Languages 2012 Midterm

CSE-321 Programming Languages 2012 Midterm Name: Hemos ID: CSE-321 Programming Languages 2012 Midterm Prob 1 Prob 2 Prob 3 Prob 4 Prob 5 Prob 6 Total Score Max 14 15 29 20 7 15 100 There are six problems on 24 pages in this exam. The maximum score

More information

Goals: Define the syntax of a simple imperative language Define a semantics using natural deduction 1

Goals: Define the syntax of a simple imperative language Define a semantics using natural deduction 1 Natural Semantics Goals: Define the syntax of a simple imperative language Define a semantics using natural deduction 1 1 Natural deduction is an instance of first-order logic; that is, it is the formal

More information

Toward explicit rewrite rules in the λπ-calculus modulo

Toward explicit rewrite rules in the λπ-calculus modulo Toward explicit rewrite rules in the λπ-calculus modulo Ronan Saillard (Olivier Hermant) Deducteam INRIA MINES ParisTech December 14th, 2013 1 / 29 Motivation Problem Checking, in a trustful way, that

More information

Refinement Types as Proof Irrelevance. William Lovas with Frank Pfenning

Refinement Types as Proof Irrelevance. William Lovas with Frank Pfenning Refinement Types as Proof Irrelevance William Lovas with Frank Pfenning Overview Refinement types sharpen existing type systems without complicating their metatheory Subset interpretation soundly and completely

More information

A NEW PROOF-ASSISTANT THAT REVISITS HOMOTOPY TYPE THEORY THE THEORETICAL FOUNDATIONS OF COQ USING NICOLAS TABAREAU

A NEW PROOF-ASSISTANT THAT REVISITS HOMOTOPY TYPE THEORY THE THEORETICAL FOUNDATIONS OF COQ USING NICOLAS TABAREAU COQHOTT A NEW PROOF-ASSISTANT THAT REVISITS THE THEORETICAL FOUNDATIONS OF COQ USING HOMOTOPY TYPE THEORY NICOLAS TABAREAU The CoqHoTT project Design and implement a brand-new proof assistant by revisiting

More information

Introduction to System F. Lecture 18 CS 565 4/20/09

Introduction to System F. Lecture 18 CS 565 4/20/09 Introduction to System F Lecture 18 CS 565 4/20/09 The Limitations of F 1 (simply-typed λ- calculus) In F 1 each function works exactly for one type Example: the identity function id = λx:τ. x : τ τ We

More information

Program Verification. Program Verification 307/434

Program Verification. Program Verification 307/434 Program Verification Program Verification 307/434 Outline Introduction: What and Why? Pre- and Postconditions Conditionals while-loops and Total Correctness Arrays Program Verification Introduction 308/434

More information

Semantic Subtyping with an SMT Solver

Semantic Subtyping with an SMT Solver Semantic Subtyping with an SMT Solver Cătălin Hrițcu, Saarland University, Saarbrücken, Germany Joint work with Andy Gordon, Gavin Bierman, and Dave Langworthy (all from Microsoft) Refinement Types + Type-test

More information

Gradual Parametricity, Revisited

Gradual Parametricity, Revisited aaachicbvddssmwge39nfov6qu30sf4y2lfuerk6i3etbbys0jtdmtle1lkgqj7nrh8am81sfwtrwvh8d3mo12ozshkpyc7zvkywlsrqwy7s9jbn5hcwm5sljdvvf2ds3tlsyyqqmtzywrlgbkorrtpqkkkbcvbaub4y0g8f1uw8/ecfpwu/vmcv+jhqcrhqjpawuuedfiucmqdecljy61nvfofruusouxdk1a7zll4czxjmqgpig0tw/vtdbwuy4wgxj2hsvpk5eopirkzvl5mkriaeqsjkucxk5efmued7qsqj2tnqguv3tyfes5taodgemvf9o1wrxv1onu9gzn1oezopwph4oyhhucsxygsevbcs21arhqfwseperqfjp9kpeacxdelfoi+tksofitkcws1rhlmnbzt1jr41sagcdse+oaqooav1camaoakweatp4aw8gk/gm/fufixb54yjzwf8gfh5a4h9n/m=

More information

University of Nevada, Las Vegas Computer Science 456/656 Fall 2016

University of Nevada, Las Vegas Computer Science 456/656 Fall 2016 University of Nevada, Las Vegas Computer Science 456/656 Fall 2016 The entire examination is 925 points. The real final will be much shorter. Name: No books, notes, scratch paper, or calculators. Use pen

More information

CMSC 336: Type Systems for Programming Languages Lecture 5: Simply Typed Lambda Calculus Acar & Ahmed January 24, 2008

CMSC 336: Type Systems for Programming Languages Lecture 5: Simply Typed Lambda Calculus Acar & Ahmed January 24, 2008 CMSC 336: Type Systems for Programming Languages Lecture 5: Simply Typed Lambda Calculus Acar & Ahmed January 24, 2008 Contents 1 Solution to the Exercise 1 1.1 Semantics for lambda calculus.......................

More information

Lecture Notes on Static and Dynamic Semantics

Lecture Notes on Static and Dynamic Semantics Lecture Notes on Static and Dynamic Semantics 15-312: Foundations of Programming Languages Frank Pfenning Lecture 4 September 9, 2004 In this lecture we illustrate the basic concepts underlying the static

More information

CS-XXX: Graduate Programming Languages. Lecture 9 Simply Typed Lambda Calculus. Dan Grossman 2012

CS-XXX: Graduate Programming Languages. Lecture 9 Simply Typed Lambda Calculus. Dan Grossman 2012 CS-XXX: Graduate Programming Languages Lecture 9 Simply Typed Lambda Calculus Dan Grossman 2012 Types Major new topic worthy of several lectures: Type systems Continue to use (CBV) Lambda Caluclus as our

More information

CS 531: Notes II. January 31, 2014

CS 531: Notes II. January 31, 2014 CS 531: Notes II January 31, 2014 1 Acceptable and Decidable Languages Let P be a program and x be a string. What happens when we run P on on input x. There are there possibilities. i) The program runs

More information

Lecture 9: Typed Lambda Calculus

Lecture 9: Typed Lambda Calculus Advanced Topics in Programming Languages Spring Semester, 2012 Lecture 9: Typed Lambda Calculus May 8, 2012 Lecturer: Mooly Sagiv Scribe: Guy Golan Gueta and Shachar Itzhaky 1 Defining a Type System for

More information

STABILITY AND PARADOX IN ALGORITHMIC LOGIC

STABILITY AND PARADOX IN ALGORITHMIC LOGIC STABILITY AND PARADOX IN ALGORITHMIC LOGIC WAYNE AITKEN, JEFFREY A. BARRETT Abstract. Algorithmic logic is the logic of basic statements concerning algorithms and the algorithmic rules of deduction between

More information

Foundations of AI. 9. Predicate Logic. Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution

Foundations of AI. 9. Predicate Logic. Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution Foundations of AI 9. Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution Wolfram Burgard, Andreas Karwath, Bernhard Nebel, and Martin Riedmiller 09/1 Contents Motivation

More information