全部书籍

专业

应用 关于 Coach 登录 开始阅读

书籍暂未推出简体中文版——当前显示英文版。

Computer Science · 术语表

什么是 Type safety, progress, preservation?

又称: type safety · progress · preservation · canonical form

Definition 6.4 University Computer Science — Year 3 · 第 6 章 — Type Systems and Type Inference

A type system is safe for a semantics if a well-typed closed program never reaches a stuck term. It is usually proved in two parts. Progress: a closed well-typed term is a value or can take a step. Preservation: if ⊢e:τ\vdash e : \tau and e→e′e \to e', then ⊢e′:τ\vdash e' : \tau. The canonical forms of a type are the shapes of its closed values.

Progress gives each well-typed term a next step unless it is a value; preservation carries the type  to the next term. Together they rule out the one bad outcome, a term that is neither a value nor able to step. A run may still go on forever.
Progress gives each well-typed term a next step unless it is a value; preservation carries the type τ\tau to the next term. Together they rule out the one bad outcome, a term that is neither a value nor able to step. A run may still go on forever.
在原文中阅读 →