请输入您要查询的百科知识:

 

词条 Phase distinction
释义

  1. Theory

     Introduction 

  2. References

Phase Distinction is a property of programming languages that observe a strict division between types and terms. A concise rule for determining whether phase distinction is preserved in a language or not has been proposed by Luca Cardelli - If A is a compile-time term and B is a subterm of A, then B must also be a compile-time term. [1]

Most strongly typed languages conform to the principle of phase distinction. However, some languages with especially flexible and expressive type systems (notably dependently typed programming languages) allow types to be manipulated in the same ways as regular terms. They may be passed to functions or returned as results.

A language with phase distinction may have separate namespaces for types and run-time variables. In an optimizing compiler, phase distinction marks the boundary between expressions which are safe to erase.

Theory

Phase distinction is used in conjunction with static checking.[2] By using a calculus based system, phase distinction removes the need to enforce linear logic between different types and terms of programming.[3]

Introduction

Phase Distinction distinguishes between processing to be done at compile-time versus processing done at runtime.

Consider a simple language,[3] with terms:

and types:

Note how types and terms are distinct. At compile time, types are used to verify the validity of the terms. However, types do not play any role at runtime.

References

1. ^{{cite web |url=http://research.microsoft.com/pubs/67515/phasedistinctions.a4.pdf |title=Phase Distinctions in Type Theory |last=Cardelli|first=Luca |authorlink=Luca Cardelli|publisher=Digital Equipment Corporation|date=3 January 1988}}
2. ^{{cite web|title=Phase Distinctions in Type Theory|url=http://lucacardelli.name/Papers/PhaseDistinctions.pdf|first=Luca|last=Cardelli|authorlink=Luca Cardelli|date=3 January 1988|publisher=Digital Equipment Corporation}}
3. ^{{cite web|title=CMSC 336: Type Systems for Programming Languages; Lecture 7: Curry-Howard Isomorphism & Derived Forms|url=http://ttic.uchicago.edu/~pl/classes/CMSC336-Winter08/lectures/lec7.pdf|date=31 January 2008}}

1 : Computer programming

随便看

 

开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。

 

Copyright © 2023 OENC.NET All Rights Reserved
京ICP备2021023879号 更新时间:2024/11/13 9:58:14