Type inference for monotonicity
Michael Arntzenius
University of Birmingham
S-REPLS 9, 2018
Type inference for monotonicity Michael Arntzenius University of - - PowerPoint PPT Presentation
Type inference for monotonicity Michael Arntzenius University of Birmingham S-REPLS 9, 2018 x + log x x x log x 4 ::= R | A B types A , B terms M , N ::= x | x . M | M N A Poset R = R A B =
Michael Arntzenius
University of Birmingham
S-REPLS 9, 2018
Composition UT is a monoid, with id neutral:
UT T
id
✷ ♦ U
id id
✷ ♦
id
✷ ♦ ✷ ✷ ✷ ✷ ♦ ♦ ♦ ♦ ✷ ♦
Composition UT and meet T ∧ U form a semiring! Other systems with semiring-valued annotations:
(FSCD 2017) massively generalizes this pattern. ... more?
SUBSUMPTION
SUBSUMPTION
SUBSUMPTION
SUBTYPING INTO ✷
SUBSUMPTION
SUBTYPING INTO ✷
✷-INTRODUCTION VIA SUBSUMPTION
f : ♦A → B ⇐ ⇒ f : A → ✷B
f : ♦A → B ⇐ ⇒ f : A → ✷B
Which suggests this elimination rule for ✷:
x : [T] A ⊢ M : ✷B x : [♦T] A ⊢ unbox M : B
f : ♦A → B ⇐ ⇒ f : A → ✷B
Which suggests this elimination rule for ✷:
x : [T] A ⊢ M : ✷B x : [♦T] A ⊢ unbox M : B
Happily, we can do this with subtyping!
SUBTYPING OUT OF ✷
[T] A <: B [T♦] ✷A <: B
✷-ELIMINATION VIA SUBSUMPTION
x : [T] A ⊢ M : ✷B x : [♦T] A ⊢ M : B