gpt4 book ai didi

compiler-construction - 什么是 A 范式?

转载 作者:行者123 更新时间:2023-12-04 02:16:21 26 4
gpt4 key购买 nike

我正在阅读各种中间形式,但除了类似 wiki 的条目之外,我无法获得有关 A-normal 形式的信息。这里有人知道这件事或有关于它的好资源吗?

最佳答案

Administrative normal form .

In computer science, administrativenormal form (abbreviated ANF) is acanonical form of programs, which wasintroduced by Flanagan et al 1993 toserve as an intermediaterepresentation in functional compilersto make subsequent transformations tomachine code more direct.


In ANF, all arguments to a functionmust be trivial. That is, evaluationof each argument must haltimmediately.


Grammar

The following BNF grammar describesthe pure λ-calculus modified tosupport the constraints of ANF:

EXP ::= VAL 
| let VAR = VAL in EXP
| let VAR = VAL VAL in EXP

VAL ::= VAR
| λ VAR . EXP

Variants of ANF used in compilers orin research often allow constants,records, tuples, multiargumentfunctions, primitive operations andconditional expressions as well.


弗拉纳根,科马克;萨布里,阿姆尔;杜巴,布鲁斯 F.;费莱森,马蒂亚斯。 "The Essence of Compiling with Continuations"可能是最终的来源。
还在 cs252r : Advanced Functional Programming 上找到了一些注释.

关于compiler-construction - 什么是 A 范式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/828144/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com