首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >专栏 >「SF-PLF」10 Sub

「SF-PLF」10 Sub

作者头像
零式的天空
发布2022-03-02 17:37:30
发布2022-03-02 17:37:30
6590
举报
文章被收录于专栏:零域Blog零域Blog

Concepts

The Subsumption Rule

The Subtype Relation

Slide QA1

Record Subtyping…

row type

index? record impl as list

width/depth/permulation

  • multiple step rules

Java

  1. class - no index (thinking about offset)

having both width/permulation subtyping make impl slow

  • OOP - hmm
  • ML has no permulation - for perf reason (static structure) as C

ML has depth?

  • a little bit by equality

OCaml objection has all three

Slide QA2

Looking at Contravariant!

  1. (2) {i1:S,i2:T}→U <: {i1:S,i2:T,i3:V}→U
  2. (4) {i1:T,i2:V,i3:V} <: {i1:S,i2:U} * {i3:V} is interesting:

the interesting thing is, why don’t we make some subtyping rules for that as well?

  • there are definitely code can do that
  • their runtime semantics are different tho they carry same information
  • coercion can used for that

3 and 4. (5) …

A <: Top => Top -> A <: A -> A — contravariant

if we only care (A*T), can use T:Top

but to type the whole thing : A

Top -> A? but noticed that we said \z:A.z

can we pass A -> A into Top -> A? more specific more general

smallest -> most specific -> A -> A largest -> most specific -> Top -> A

  1. “The type Bool has no proper subtypes.” (I.e., the only type smaller than Bool is Bool itself.) Ture unless we have Bottom

hmm seems like Bottom in subtyping is different with Empty/Void, which is closer to logical Bottom ⊥ since Bottom here is subtyping of everything.. OH they are the same: (nice)

https://en.wikipedia.org/wiki/Bottom_type

  1. True

Inversion Lemmas for Subtyping

inversion doesn’t lose information, induction does.

auto rememeber?? —- dependent induction hetergeous equaltiy

In soundness proof

  • subtyping only affects Canonical Forms + T_Sub case in induction

Lemma: If Gamma ⊢ \x:S1.t2 ∈ T, then there is a type S2 such that x⊢>S1; Gamma ⊢ t2 ∈ S2 and S1 → S2 <: T.

why T not arrow? Top…

if including Bottom…many proof becomes hard, canonical form need to say…might be Bottom?

no, no value has type Bottom (Void)…

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2021-03-28,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • Concepts
    • The Subsumption Rule
    • The Subtype Relation
    • Slide QA1
    • Slide QA2
    • Inversion Lemmas for Subtyping
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档