Informatik LS XIV Software Engineering Prof. Dr. Jakob Rehof Jan Bessai
Übungen zur Vorlesung
Komponenten- und Service-orientiere Softwarekonstruktion
Sommersemester 2017 Übungsblatt Nr. 8
Abgabetermin: 28.6.2017 (in der Übung, vorher per Mail oder in der Vorlesung); Alternativ:
Bis am 30.6.2017 per Mail oder in OH14, Raum 129 Aufgaben(teile) mit der Markierung
⋆ sind Zusatzaufgaben.
Gemeinsame Abgaben von Gruppen bis zu 3 Personen sind möglich. 23.6.2017
Type assignment rules for combinatory logic with intersection types and distributing covariant constructors.
n∈N0 Natural number or zero
x, y, z∈O Combinators
α, β, γ∈V Type Variables
C, C1, C2, . . . , Cn∈C Constructor Symbols
| · |:C→N0 Constructor Arity
≤C⊆ {(C1, C2)∈C×C| |C1|=|C2|}Constructor Preorder
S:V→T Substitution
S∗(σ) = Slifted toTV→T
C(S∗(σ1), S∗(σ2), . . . , S∗(σ|C|)) ifτ=C(σ1, σ2, . . . , σ|C|)
ω ifτ=ω
S∗(σ)→S∗(τ) ifτ=σ→τ
S∗(σ)∩S∗(τ) ifτ=σ∩τ
S(α) ifτ=α
TV∋σ, τ, ρ, σ1, σ2, . . . , σn::= Type Scheme C(σ1, σ2, . . . , σ|C|) constant
ω omega
σ→τ function
σ∩τ intersection
α variable ofV
T=T∅∋a,a1,a2, . . . ,an
b,b1,b2, . . . ,bn
Type T ∋M, N, N1, N2, . . . , Nn::= Term
x variable
(M N) application
Γ :O→TV Type Context
WF⊆V→T Function space of
well-formed substitutions Subtyping(≤ ⊆T×T):
C1≤CC2 |C1|=|C2| ∀n:an≤bn
(CAx) C1(a1,a2, . . . ,a|C1|)≤C2(b1,b2, . . . ,b|C2|)
(≤ω) a≤ω
(CDist) C1(a1,a2, . . . ,a|C1|)∩C1(b1,b2, . . . ,b|C1|)≤C1(a1∩b1,a2∩b2, . . . ,a|C1|∩b|C1|)
(→ω)
ω≤ω→ω a2≤a1 b1≤b2
(Sub) a1→b1≤a2→b2
(Dist) (a→b1)∩(a→b2)≤a→b1∩b2
(Idem)
a≤a∩a a1≤a2 a2≤a3
(Trans) a1≤a3
a≤b1 a≤b2
(GLB) a≤b1∩b2
(LUB1)
a∩b≤a (LUB2)
a∩b≤b Type assignment(⊢ ⊆(O→TV)× T ×T):
Γ(x) =τ S∈WF (Var) Γ⊢x:S∗(τ)
Γ⊢M:a→b Γ⊢N:a (→E) Γ⊢(M N) :b
Γ⊢M:a a≤b (≤) Γ⊢M:b
Γ⊢MΓ:⊢aM:aΓ∩⊢bM:b (∩I)