一种轻量级Go语言类型定向翻译方案的语义保持
Semantic preservation for a type directed translation scheme of Featherweight Go
摘要:
轻量级Go(FG)是一个最小的核心演算,包括基本的Go功能,如重载方法和接口类型。FG程序的动态行为的最直接的语义描述是基于运行时类型信息解析方法调用。一种更有效的方法是应用类型导向的翻译方案,其中接口值被包含具体方法定义的字典替换。因此,方法调用可以通过在字典中简单查找方法定义来解决。建立经由类型定向翻译方案获得的目标程序保持原始FG程序的语义是重要的任务。为了建立这个属性,我们使用了逻辑关系,这些逻辑关系是通过类型来索引的,以将源程序和目标程序联系起来。我们提供了严格的证明,并详细讨论了我们遇到的许多微妙的角落,包括由于递归接口和方法定义需要一个步骤索引。
英文摘要:
Featherweight Go (FG) is a minimal core calculus that includes essential Go features such as overloaded methods and interface types. The most straightforward semantic description of the dynamic behavior of FG programs is to resolve method calls based on run-time type information. A more efficient approach is to apply a type-directed translation scheme where interface-values are replaced by dictionaries that contain concrete method definitions. Thus, method calls can be resolved by a simple lookup of the method definition in the dictionary. Establishing that the target program obtained via the type-directed translation scheme preserves the semantics of the original FG program is an important task. To establish this property we employ logical relations that are indexed by types to relate source and target programs. We provide rigorous proofs and give a detailed discussion of the many subtle corners that we have encountered including the need for a step index due to recursive interfaces and method definitions.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。