COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter...

71
COMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University McGill University,Montréal, January 2020 Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 1 / 12

Transcript of COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter...

Page 1: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

COMP 302 Winter 2020 Final Review

Prakash Panangaden

School of Computer ScienceMcGill University

McGill University,Montréal, January 2020

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 1 / 12

Page 2: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Introduction

Goodbye to COMP 302

It is very sad to be ending the class in this way.

But there are much worse things happening these days.Today I will give a capsule summary of the course.Then I will describe the final exam.

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 2 / 12

Page 3: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Introduction

Goodbye to COMP 302

It is very sad to be ending the class in this way.But there are much worse things happening these days.

Today I will give a capsule summary of the course.Then I will describe the final exam.

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 2 / 12

Page 4: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Introduction

Goodbye to COMP 302

It is very sad to be ending the class in this way.But there are much worse things happening these days.Today I will give a capsule summary of the course.

Then I will describe the final exam.

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 2 / 12

Page 5: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Introduction

Goodbye to COMP 302

It is very sad to be ending the class in this way.But there are much worse things happening these days.Today I will give a capsule summary of the course.Then I will describe the final exam.

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 2 / 12

Page 6: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Introduction

Remember the course administration details

1 cs.mcgill.ca/~prakash/Courses/302/comp302.htmlLecture notes, assignments and solutions will be posted there.

2 I said that I would never use slides again.3 I lied.4 There is a MyCourses page with links to the course web site and

grades.5 The final exam is submitted through myCourses.6 Instructors and students will communicate using Piazza.

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 3 / 12

Page 7: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Introduction

Remember the course administration details

1 cs.mcgill.ca/~prakash/Courses/302/comp302.htmlLecture notes, assignments and solutions will be posted there.

2 I said that I would never use slides again.

3 I lied.4 There is a MyCourses page with links to the course web site and

grades.5 The final exam is submitted through myCourses.6 Instructors and students will communicate using Piazza.

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 3 / 12

Page 8: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Introduction

Remember the course administration details

1 cs.mcgill.ca/~prakash/Courses/302/comp302.htmlLecture notes, assignments and solutions will be posted there.

2 I said that I would never use slides again.3 I lied.

4 There is a MyCourses page with links to the course web site andgrades.

5 The final exam is submitted through myCourses.6 Instructors and students will communicate using Piazza.

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 3 / 12

Page 9: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Introduction

Remember the course administration details

1 cs.mcgill.ca/~prakash/Courses/302/comp302.htmlLecture notes, assignments and solutions will be posted there.

2 I said that I would never use slides again.3 I lied.4 There is a MyCourses page with links to the course web site and

grades.

5 The final exam is submitted through myCourses.6 Instructors and students will communicate using Piazza.

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 3 / 12

Page 10: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Introduction

Remember the course administration details

1 cs.mcgill.ca/~prakash/Courses/302/comp302.htmlLecture notes, assignments and solutions will be posted there.

2 I said that I would never use slides again.3 I lied.4 There is a MyCourses page with links to the course web site and

grades.5 The final exam is submitted through myCourses.

6 Instructors and students will communicate using Piazza.

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 3 / 12

Page 11: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Introduction

Remember the course administration details

1 cs.mcgill.ca/~prakash/Courses/302/comp302.htmlLecture notes, assignments and solutions will be posted there.

2 I said that I would never use slides again.3 I lied.4 There is a MyCourses page with links to the course web site and

grades.5 The final exam is submitted through myCourses.6 Instructors and students will communicate using Piazza.

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 3 / 12

Page 12: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Introduction

Grading

8 assignments : 24% Submitted through an automated systemusing LearnOCaml.

3 quizzes : 6% using the myCourses system.1 in-class midterm: 10% of your grade,Final exam: 60% of your total grade.

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 4 / 12

Page 13: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Introduction

Grading

8 assignments : 24% Submitted through an automated systemusing LearnOCaml.3 quizzes : 6% using the myCourses system.

1 in-class midterm: 10% of your grade,Final exam: 60% of your total grade.

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 4 / 12

Page 14: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Introduction

Grading

8 assignments : 24% Submitted through an automated systemusing LearnOCaml.3 quizzes : 6% using the myCourses system.1 in-class midterm: 10% of your grade,

Final exam: 60% of your total grade.

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 4 / 12

Page 15: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Introduction

Grading

8 assignments : 24% Submitted through an automated systemusing LearnOCaml.3 quizzes : 6% using the myCourses system.1 in-class midterm: 10% of your grade,Final exam: 60% of your total grade.

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 4 / 12

Page 16: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Course contents

What did we cover?

1 Recursion

2 How to think about it3 Inductively defined types: lists, trees4 Environments and binding5 Higher-order functions6 Operational semantics7 Updatable data: references8 Closures and objects9 Typing rules and type checking

10 Polymorphic typing11 Parsing and compilers12 Streams and lazy evaluation13 Subtyping14 Subtyping and inheritance in Java

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 5 / 12

Page 17: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Course contents

What did we cover?

1 Recursion2 How to think about it

3 Inductively defined types: lists, trees4 Environments and binding5 Higher-order functions6 Operational semantics7 Updatable data: references8 Closures and objects9 Typing rules and type checking

10 Polymorphic typing11 Parsing and compilers12 Streams and lazy evaluation13 Subtyping14 Subtyping and inheritance in Java

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 5 / 12

Page 18: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Course contents

What did we cover?

1 Recursion2 How to think about it3 Inductively defined types: lists, trees

4 Environments and binding5 Higher-order functions6 Operational semantics7 Updatable data: references8 Closures and objects9 Typing rules and type checking

10 Polymorphic typing11 Parsing and compilers12 Streams and lazy evaluation13 Subtyping14 Subtyping and inheritance in Java

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 5 / 12

Page 19: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Course contents

What did we cover?

1 Recursion2 How to think about it3 Inductively defined types: lists, trees4 Environments and binding

5 Higher-order functions6 Operational semantics7 Updatable data: references8 Closures and objects9 Typing rules and type checking

10 Polymorphic typing11 Parsing and compilers12 Streams and lazy evaluation13 Subtyping14 Subtyping and inheritance in Java

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 5 / 12

Page 20: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Course contents

What did we cover?

1 Recursion2 How to think about it3 Inductively defined types: lists, trees4 Environments and binding5 Higher-order functions

6 Operational semantics7 Updatable data: references8 Closures and objects9 Typing rules and type checking

10 Polymorphic typing11 Parsing and compilers12 Streams and lazy evaluation13 Subtyping14 Subtyping and inheritance in Java

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 5 / 12

Page 21: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Course contents

What did we cover?

1 Recursion2 How to think about it3 Inductively defined types: lists, trees4 Environments and binding5 Higher-order functions6 Operational semantics

7 Updatable data: references8 Closures and objects9 Typing rules and type checking

10 Polymorphic typing11 Parsing and compilers12 Streams and lazy evaluation13 Subtyping14 Subtyping and inheritance in Java

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 5 / 12

Page 22: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Course contents

What did we cover?

1 Recursion2 How to think about it3 Inductively defined types: lists, trees4 Environments and binding5 Higher-order functions6 Operational semantics7 Updatable data: references

8 Closures and objects9 Typing rules and type checking

10 Polymorphic typing11 Parsing and compilers12 Streams and lazy evaluation13 Subtyping14 Subtyping and inheritance in Java

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 5 / 12

Page 23: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Course contents

What did we cover?

1 Recursion2 How to think about it3 Inductively defined types: lists, trees4 Environments and binding5 Higher-order functions6 Operational semantics7 Updatable data: references8 Closures and objects

9 Typing rules and type checking10 Polymorphic typing11 Parsing and compilers12 Streams and lazy evaluation13 Subtyping14 Subtyping and inheritance in Java

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 5 / 12

Page 24: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Course contents

What did we cover?

1 Recursion2 How to think about it3 Inductively defined types: lists, trees4 Environments and binding5 Higher-order functions6 Operational semantics7 Updatable data: references8 Closures and objects9 Typing rules and type checking

10 Polymorphic typing11 Parsing and compilers12 Streams and lazy evaluation13 Subtyping14 Subtyping and inheritance in Java

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 5 / 12

Page 25: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Course contents

What did we cover?

1 Recursion2 How to think about it3 Inductively defined types: lists, trees4 Environments and binding5 Higher-order functions6 Operational semantics7 Updatable data: references8 Closures and objects9 Typing rules and type checking

10 Polymorphic typing

11 Parsing and compilers12 Streams and lazy evaluation13 Subtyping14 Subtyping and inheritance in Java

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 5 / 12

Page 26: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Course contents

What did we cover?

1 Recursion2 How to think about it3 Inductively defined types: lists, trees4 Environments and binding5 Higher-order functions6 Operational semantics7 Updatable data: references8 Closures and objects9 Typing rules and type checking

10 Polymorphic typing11 Parsing and compilers

12 Streams and lazy evaluation13 Subtyping14 Subtyping and inheritance in Java

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 5 / 12

Page 27: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Course contents

What did we cover?

1 Recursion2 How to think about it3 Inductively defined types: lists, trees4 Environments and binding5 Higher-order functions6 Operational semantics7 Updatable data: references8 Closures and objects9 Typing rules and type checking

10 Polymorphic typing11 Parsing and compilers12 Streams and lazy evaluation

13 Subtyping14 Subtyping and inheritance in Java

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 5 / 12

Page 28: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Course contents

What did we cover?

1 Recursion2 How to think about it3 Inductively defined types: lists, trees4 Environments and binding5 Higher-order functions6 Operational semantics7 Updatable data: references8 Closures and objects9 Typing rules and type checking

10 Polymorphic typing11 Parsing and compilers12 Streams and lazy evaluation13 Subtyping

14 Subtyping and inheritance in Java

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 5 / 12

Page 29: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Course contents

What did we cover?

1 Recursion2 How to think about it3 Inductively defined types: lists, trees4 Environments and binding5 Higher-order functions6 Operational semantics7 Updatable data: references8 Closures and objects9 Typing rules and type checking

10 Polymorphic typing11 Parsing and compilers12 Streams and lazy evaluation13 Subtyping14 Subtyping and inheritance in Java

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 5 / 12

Page 30: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Course contents

Types

1 Classify values

2 and expressions3 and functions and procedures4 in order to restrict what can be expressed.5 Give up expressive power for6 guarantees of good behaviour.

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 6 / 12

Page 31: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Course contents

Types

1 Classify values2 and expressions

3 and functions and procedures4 in order to restrict what can be expressed.5 Give up expressive power for6 guarantees of good behaviour.

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 6 / 12

Page 32: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Course contents

Types

1 Classify values2 and expressions3 and functions and procedures

4 in order to restrict what can be expressed.5 Give up expressive power for6 guarantees of good behaviour.

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 6 / 12

Page 33: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Course contents

Types

1 Classify values2 and expressions3 and functions and procedures4 in order to restrict what can be expressed.

5 Give up expressive power for6 guarantees of good behaviour.

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 6 / 12

Page 34: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Course contents

Types

1 Classify values2 and expressions3 and functions and procedures4 in order to restrict what can be expressed.5 Give up expressive power for

6 guarantees of good behaviour.

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 6 / 12

Page 35: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Course contents

Types

1 Classify values2 and expressions3 and functions and procedures4 in order to restrict what can be expressed.5 Give up expressive power for6 guarantees of good behaviour.

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 6 / 12

Page 36: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Course contents

What to understand

1 Names: binding and scoping

2 Evaluation rules: expressions → values3 Typing rules,4 which may not be exclusive.

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 7 / 12

Page 37: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Course contents

What to understand

1 Names: binding and scoping2 Evaluation rules: expressions → values

3 Typing rules,4 which may not be exclusive.

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 7 / 12

Page 38: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Course contents

What to understand

1 Names: binding and scoping2 Evaluation rules: expressions → values3 Typing rules,

4 which may not be exclusive.

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 7 / 12

Page 39: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Course contents

What to understand

1 Names: binding and scoping2 Evaluation rules: expressions → values3 Typing rules,4 which may not be exclusive.

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 7 / 12

Page 40: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Course contents

Where do we go from here?

1 Intimate connection between logic and computation: theCurry-Howard isomorphism

2 New directions in type theory: guaranteeing security3 New logics and new programming paradigms: linear logic4 Probabilistic programming languages designed for machine

learning

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 8 / 12

Page 41: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Course contents

Where do we go from here?

1 Intimate connection between logic and computation: theCurry-Howard isomorphism

2 New directions in type theory: guaranteeing security

3 New logics and new programming paradigms: linear logic4 Probabilistic programming languages designed for machine

learning

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 8 / 12

Page 42: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Course contents

Where do we go from here?

1 Intimate connection between logic and computation: theCurry-Howard isomorphism

2 New directions in type theory: guaranteeing security3 New logics and new programming paradigms: linear logic

4 Probabilistic programming languages designed for machinelearning

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 8 / 12

Page 43: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Course contents

Where do we go from here?

1 Intimate connection between logic and computation: theCurry-Howard isomorphism

2 New directions in type theory: guaranteeing security3 New logics and new programming paradigms: linear logic4 Probabilistic programming languages designed for machine

learning

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 8 / 12

Page 44: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

OCaml

Overview of OCaml

1 Functional - functions are the main entities.2 Higher-order - functions may take other functions as arguments

and3 may even return functions as results.4 Typed - every entity has a type.5 Types are described in their own little language; types are not just

the basic types6 but are polymorphic and one can have new user-defined types.

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 9 / 12

Page 45: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Final Exam

Structure of the exam

There are 6 questions in total.

2 questions on recursion on lists.One is straightforward and one is not.One question on higher-order functions.One question on higher-order functions with refs.One question where you have to give an informal derivation ofthe polymorphic type of a function.One collection of true/false questions. No explanations areneeded.

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 10 / 12

Page 46: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Final Exam

Structure of the exam

There are 6 questions in total.2 questions on recursion on lists.

One is straightforward and one is not.One question on higher-order functions.One question on higher-order functions with refs.One question where you have to give an informal derivation ofthe polymorphic type of a function.One collection of true/false questions. No explanations areneeded.

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 10 / 12

Page 47: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Final Exam

Structure of the exam

There are 6 questions in total.2 questions on recursion on lists.One is straightforward and one is not.

One question on higher-order functions.One question on higher-order functions with refs.One question where you have to give an informal derivation ofthe polymorphic type of a function.One collection of true/false questions. No explanations areneeded.

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 10 / 12

Page 48: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Final Exam

Structure of the exam

There are 6 questions in total.2 questions on recursion on lists.One is straightforward and one is not.One question on higher-order functions.

One question on higher-order functions with refs.One question where you have to give an informal derivation ofthe polymorphic type of a function.One collection of true/false questions. No explanations areneeded.

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 10 / 12

Page 49: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Final Exam

Structure of the exam

There are 6 questions in total.2 questions on recursion on lists.One is straightforward and one is not.One question on higher-order functions.One question on higher-order functions with refs.

One question where you have to give an informal derivation ofthe polymorphic type of a function.One collection of true/false questions. No explanations areneeded.

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 10 / 12

Page 50: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Final Exam

Structure of the exam

There are 6 questions in total.2 questions on recursion on lists.One is straightforward and one is not.One question on higher-order functions.One question on higher-order functions with refs.One question where you have to give an informal derivation ofthe polymorphic type of a function.

One collection of true/false questions. No explanations areneeded.

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 10 / 12

Page 51: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Final Exam

Structure of the exam

There are 6 questions in total.2 questions on recursion on lists.One is straightforward and one is not.One question on higher-order functions.One question on higher-order functions with refs.One question where you have to give an informal derivation ofthe polymorphic type of a function.One collection of true/false questions. No explanations areneeded.

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 10 / 12

Page 52: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Final Exam

Topics

1 Recursion

2 Inductively defined types: lists, trees3 Environments and binding4 Higher-order functions5 Updatable data: references6 Closures and objects7 Typing rules and type checking8 Polymorphic typing9 Streams and lazy evaluation

10 Subtyping

What isn’t here isn’t on the exam.

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 11 / 12

Page 53: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Final Exam

Topics

1 Recursion2 Inductively defined types: lists, trees

3 Environments and binding4 Higher-order functions5 Updatable data: references6 Closures and objects7 Typing rules and type checking8 Polymorphic typing9 Streams and lazy evaluation

10 Subtyping

What isn’t here isn’t on the exam.

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 11 / 12

Page 54: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Final Exam

Topics

1 Recursion2 Inductively defined types: lists, trees3 Environments and binding

4 Higher-order functions5 Updatable data: references6 Closures and objects7 Typing rules and type checking8 Polymorphic typing9 Streams and lazy evaluation

10 Subtyping

What isn’t here isn’t on the exam.

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 11 / 12

Page 55: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Final Exam

Topics

1 Recursion2 Inductively defined types: lists, trees3 Environments and binding4 Higher-order functions

5 Updatable data: references6 Closures and objects7 Typing rules and type checking8 Polymorphic typing9 Streams and lazy evaluation

10 Subtyping

What isn’t here isn’t on the exam.

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 11 / 12

Page 56: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Final Exam

Topics

1 Recursion2 Inductively defined types: lists, trees3 Environments and binding4 Higher-order functions5 Updatable data: references

6 Closures and objects7 Typing rules and type checking8 Polymorphic typing9 Streams and lazy evaluation

10 Subtyping

What isn’t here isn’t on the exam.

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 11 / 12

Page 57: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Final Exam

Topics

1 Recursion2 Inductively defined types: lists, trees3 Environments and binding4 Higher-order functions5 Updatable data: references6 Closures and objects

7 Typing rules and type checking8 Polymorphic typing9 Streams and lazy evaluation

10 Subtyping

What isn’t here isn’t on the exam.

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 11 / 12

Page 58: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Final Exam

Topics

1 Recursion2 Inductively defined types: lists, trees3 Environments and binding4 Higher-order functions5 Updatable data: references6 Closures and objects7 Typing rules and type checking

8 Polymorphic typing9 Streams and lazy evaluation

10 Subtyping

What isn’t here isn’t on the exam.

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 11 / 12

Page 59: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Final Exam

Topics

1 Recursion2 Inductively defined types: lists, trees3 Environments and binding4 Higher-order functions5 Updatable data: references6 Closures and objects7 Typing rules and type checking8 Polymorphic typing

9 Streams and lazy evaluation10 Subtyping

What isn’t here isn’t on the exam.

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 11 / 12

Page 60: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Final Exam

Topics

1 Recursion2 Inductively defined types: lists, trees3 Environments and binding4 Higher-order functions5 Updatable data: references6 Closures and objects7 Typing rules and type checking8 Polymorphic typing9 Streams and lazy evaluation

10 Subtyping

What isn’t here isn’t on the exam.

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 11 / 12

Page 61: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Final Exam

Topics

1 Recursion2 Inductively defined types: lists, trees3 Environments and binding4 Higher-order functions5 Updatable data: references6 Closures and objects7 Typing rules and type checking8 Polymorphic typing9 Streams and lazy evaluation

10 Subtyping

What isn’t here isn’t on the exam.

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 11 / 12

Page 62: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Final Exam

Topics

1 Recursion2 Inductively defined types: lists, trees3 Environments and binding4 Higher-order functions5 Updatable data: references6 Closures and objects7 Typing rules and type checking8 Polymorphic typing9 Streams and lazy evaluation

10 Subtyping

What isn’t here isn’t on the exam.

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 11 / 12

Page 63: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Final Exam

How to submit

At 6:30pm on the 22nd of April the exam will be posted on thecourse web page. There will be links in Piazza and on myCoursesto this exam.

The exam is a pdf file. Make sure you have a pdf viewer.The solutions must be written in plain text in one single file.I DO NOT WANT pdf, latex, Word, handwritten scans or anythingelse. I don’t want each question in a new file.I will NOT accept an exam emailed to me or the TAs.Don’t wait for the last minute to upload and then tell me that youhad an internet connection problem. I will not accept an emailedexam.Once you upload your solution the system will not accept updates.

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 12 / 12

Page 64: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Final Exam

How to submit

At 6:30pm on the 22nd of April the exam will be posted on thecourse web page. There will be links in Piazza and on myCoursesto this exam.The exam is a pdf file. Make sure you have a pdf viewer.

The solutions must be written in plain text in one single file.I DO NOT WANT pdf, latex, Word, handwritten scans or anythingelse. I don’t want each question in a new file.I will NOT accept an exam emailed to me or the TAs.Don’t wait for the last minute to upload and then tell me that youhad an internet connection problem. I will not accept an emailedexam.Once you upload your solution the system will not accept updates.

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 12 / 12

Page 65: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Final Exam

How to submit

At 6:30pm on the 22nd of April the exam will be posted on thecourse web page. There will be links in Piazza and on myCoursesto this exam.The exam is a pdf file. Make sure you have a pdf viewer.The solutions must be written in plain text in one single file.

I DO NOT WANT pdf, latex, Word, handwritten scans or anythingelse. I don’t want each question in a new file.I will NOT accept an exam emailed to me or the TAs.Don’t wait for the last minute to upload and then tell me that youhad an internet connection problem. I will not accept an emailedexam.Once you upload your solution the system will not accept updates.

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 12 / 12

Page 66: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Final Exam

How to submit

At 6:30pm on the 22nd of April the exam will be posted on thecourse web page. There will be links in Piazza and on myCoursesto this exam.The exam is a pdf file. Make sure you have a pdf viewer.The solutions must be written in plain text in one single file.I DO NOT WANT pdf, latex, Word, handwritten scans or anythingelse. I don’t want each question in a new file.

I will NOT accept an exam emailed to me or the TAs.Don’t wait for the last minute to upload and then tell me that youhad an internet connection problem. I will not accept an emailedexam.Once you upload your solution the system will not accept updates.

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 12 / 12

Page 67: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Final Exam

How to submit

At 6:30pm on the 22nd of April the exam will be posted on thecourse web page. There will be links in Piazza and on myCoursesto this exam.The exam is a pdf file. Make sure you have a pdf viewer.The solutions must be written in plain text in one single file.I DO NOT WANT pdf, latex, Word, handwritten scans or anythingelse. I don’t want each question in a new file.I will NOT accept an exam emailed to me or the TAs.

Don’t wait for the last minute to upload and then tell me that youhad an internet connection problem. I will not accept an emailedexam.Once you upload your solution the system will not accept updates.

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 12 / 12

Page 68: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Final Exam

How to submit

At 6:30pm on the 22nd of April the exam will be posted on thecourse web page. There will be links in Piazza and on myCoursesto this exam.The exam is a pdf file. Make sure you have a pdf viewer.The solutions must be written in plain text in one single file.I DO NOT WANT pdf, latex, Word, handwritten scans or anythingelse. I don’t want each question in a new file.I will NOT accept an exam emailed to me or the TAs.Don’t wait for the last minute to upload and then tell me that youhad an internet connection problem. I will not accept an emailedexam.

Once you upload your solution the system will not accept updates.

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 12 / 12

Page 69: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Final Exam

How to submit

At 6:30pm on the 22nd of April the exam will be posted on thecourse web page. There will be links in Piazza and on myCoursesto this exam.The exam is a pdf file. Make sure you have a pdf viewer.The solutions must be written in plain text in one single file.I DO NOT WANT pdf, latex, Word, handwritten scans or anythingelse. I don’t want each question in a new file.I will NOT accept an exam emailed to me or the TAs.Don’t wait for the last minute to upload and then tell me that youhad an internet connection problem. I will not accept an emailedexam.Once you upload your solution the system will not accept updates.

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 12 / 12

Page 70: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Final Exam

Submission

I will create a new dummy assignment with zero weight whereyou will upload the final exam solutions. myCourses only allowsstudents to submit assignments, so we have to pretend that thefinal is an assignment.

The actual final exam marks will be entered in the proper place inthe Grade book.

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 13 / 12

Page 71: COMP 302 Winter 2020 Final Review - cs.mcgill.caprakash/Courses/302/final_review.pdfCOMP 302 Winter 2020 Final Review Prakash Panangaden School of Computer Science McGill University

Final Exam

Submission

I will create a new dummy assignment with zero weight whereyou will upload the final exam solutions. myCourses only allowsstudents to submit assignments, so we have to pretend that thefinal is an assignment.The actual final exam marks will be entered in the proper place inthe Grade book.

Panangaden (McGill University) COMP 302 Winter 2020 Final Review Montréal, April 2020 13 / 12