Principles of Programming languages

Fall 2007

Exam guidelines

 

 

*    This is a closed book written exam consisting of two types of tasks with almost the same weight:

 

              You should know how to define and explain theoretical PL concepts:

              You should be able to explain how a code snippet works and what kind of output will be supplied.

 

*    The questions Qi will try to cover all studied material including your assignment.

*    The exam grade is calculated as (Q1+Q2+…..+10)/10

*    All studied languages will be represented (ML, Java/C++, Prolog and Python)

*    Everything discussed during lectures can be used for an exam question.

*    A pass for this exam is valid only in combination with a pass for the assignment (>5.5)

 

 

Important topics :

 

Lecture

Conceptual terms

Programming

Weber’s book

2

Syntax,semantics

Grammars, ambiguity

Grammar and parse tree

Ch.2,3

3

Classical sequence, binding times

ML: functions

Ch.4, 5

4

Primitive types, constructed types

Enumerations, tuples

Type inference, annotations, type checking, type equivalence

ML: patterns

Ch.6,7

5

Polymorphism, overloading, coercion

ML: Anonymous function, pattern matching, high order functions currying

ML: high order functions (map, foldr)

Ch. 8,9

6

Scope, namespaces, Static scoping, dynamic scoping

Activation records, static allocation, stack allocation, heap allocation, garbage collection

Scope in ML, Java, C++

Activation records

Ch.10,12,14

7

Parameter correspondence, parameter passing Throwing/catching exceptions in Java, finally, error handling procedures,

 

Parameter passing Try/catch/finally

 

Ch.17,18

8

Prolog: terms, atoms, facts and rules

Lists, append, member, flexible vs. inflexible predicates, negation and failure, unification, backtracking, cuts

Code

Ch.19,20

9

Objects, inheritance,  polymorphism, static/dynamic method binding

 

 

Python: tuples, strings, lists, dictionaries,  functions

Static/dynamic method binding

 

 

 

Code

Ch.13,15,16

 

 

Slides

M. Lutz, Learning Python

Tutorials (see website)

10

Python: parameters, anonymous function, generators, list comprehension, OOP, exceptions

Code

 

Slides

M. Lutz, Learning Python

 

 

 

Natalia Silvis-Cividjian

Vrije Universiteit, Amsterdam