• Keine Ergebnisse gefunden

Task 1: Type Reconstruction

N/A
N/A
Protected

Academic year: 2022

Aktie "Task 1: Type Reconstruction"

Copied!
2
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Fachbereich Informatik

Programmiersprachen und Softwaretechnik

Prof. Dr. Klaus Ostermann

Responsible for the lab Philipp Schuster

philipp.schuster@uni-tuebingen.de

Programming Languages 2

Homework 10 – WS 18

Tübingen, 10. Januar 2019

In order to be admitted to the exam, you have to successfully submit your homework every week, except for 2 weeks. A successful submission is one where you get at least 1 point.

Handin Please submit this homework until Thursday, January 17, either via email to Philipp Schus- ter (philipp.schuster@uni-tuebingen.de) before 12:00, or on paper at the beginning of the lab.

Groups You can work in groups of up to 2 people. Please include the names and Matrikelnummern of all group members in your submission.

Points For each of the Tasks you get between 0 and 2 points for a total of 6 points. You get:

1 point, if your submission shows that you tried to solve the task.

2 points, if your submission is mostly correct.

Task 1: Type Reconstruction

Find suitable types for the question marks in the following program:

λx:?1.λf :?2.if(iszerox) thenxelsef x

Task 2: Weakest Unifier

Consider the following grammar of types with unification variablesTi: htypei::= Num|htypei → htypei|Ti

Find the weakest (most general) unifier (if it exists) of the following pairs of types with unification variables:

1. Num→T1 andT2 →Num 2. NumandT1 →T1

3. T1andT2

(2)

Task 3: Implement Type Reconstruction

Implement the type reconstruction algorithm from the lecture for lambda calculus extended with num- bers and addition but not recursion in a programming language of your choice. Do not try to write a parser but assume a representation of terms in memory. Examples for a representation of terms and types in Scala are on the website.

Seite 2/2

Referenzen

ÄHNLICHE DOKUMENTE

From a technical point of view, a novelty is the comparison of the π-calculus with a concurrent programming language using contextual semantics for may-convergence

As the salinity is mainly affected by the eastern outlet this could mean a stronger and more direct influence of the oceans water plume at spring tide in the middle of Segara

Typing rules are easy to specify w/o type annotations.. • But how can they

We consider the simply typed lambda calculus from the lecture, extended with unit and let. Show that the following terms are well typed in the given contexts by drawing a

Handin Please submit this homework until Thursday, February 7, either via email to Philipp Schus- ter (philipp.schuster@uni-tuebingen.de) before 12:00, or on paper at the beginning

In this article, we report an empirical study on software artifact papers (SAPs) published at the International Conference on Software Engineering (ICSE), in which we

In earlier work, Czarnecki and Antkiewicz [2005] implemented a tool environment to develop a product line of UML models, very similar to CIDE: they extended an existing UML editor

The implementation of the type inferrer is split into three Curry modules: AnnotatedFlatCurry, containing a version of FlatCurry datatypes that can be annotated with arbitrary