• 中国计算机学会会刊
  • 中国科技核心期刊
  • 中文核心期刊

计算机工程与科学 ›› 2024, Vol. 46 ›› Issue (10): 1807-1814.

• 软件工程 • 上一篇    下一篇

以Barendregt的变量约定形式化编程语言研究

阿力木江·亚森1,艾合买提·阿不来提2,沙尔旦尔·帕尔哈提1,阿布都克力木·阿布力孜1,哈里旦木·阿布都克里木1   

  1. (1.新疆财经大学信息管理学院,新疆 乌鲁木齐 830000;2.新疆财经大学统计与数据科学学院,新疆 乌鲁木齐 830000)
  • 收稿日期:2023-09-15 修回日期:2023-11-12 接受日期:2024-10-25 出版日期:2024-10-25 发布日期:2024-10-29
  • 基金资助:
    国家自然科学基金(62241208,61966033);新疆维吾尔自治区自然科学基金(2023D01A72);新疆财经大学校级科研基金(2022XGC049,2022XGC070,2022XGC022)

A study of formalizing programming languages with Barendregt’s variable convention

ALIMUJIANG Yasen1,AIHEMAITI Abulaiti2,SHAERDANER Paerhati1,ABUDUKELIMU Abulizi1,HALIDANMU Abudukelimu1   

  1. (1.College of Information Management,Xinjiang University of Finance & Economics,Urumqi 830000;
    2.Institute of Statistics and Data Science,Xinjiang University of Finance & Economics,Urumqi 830000,China)
  • Received:2023-09-15 Revised:2023-11-12 Accepted:2024-10-25 Online:2024-10-25 Published:2024-10-29

摘要: 编程语言、类型系统和逻辑系统中常见的命名绑定,在实践中实现存在困难。在理论中以抽象思考发现并避免即将发生的变量捕获。在实践中变量捕获的检测需要定义笨拙的辅助操作,使形式化和证明变得复杂。现有几种命名绑定技术旨在表达式具有良好的可读性,无变量捕获的代换操作和直观的证明。然而,这些技术的形式化与理论之间存在差别,两者的表达式和证明过程可能有很大的不同。提出一种命名绑定技术,其中在代换操作和推理规则中引入的表达式刷新函数使形式化遵守Barendregt的变量约定,形式系统的形式化与其理论几乎相同。以无类型λ-演算和具有简单数据类型的λ-演算的形式化展示了该技术的优点。


关键词: 变量命名, 命名绑定, 形式系统, Barendregt的变量约定, 编程语言理论

Abstract: Implementing name bindings occurring in programming languages, types, and logical systems is not easy. In theory, the abstract thinking of the human mind can detect and avoid a possible variable capture. In implementation though, detecting variable capture requires clumsy auxiliary operations, which complicates formalization and proofs. Several name binding techniques have been proposed to have readable representations, capture-free substitutions, and intuitive proofs. However, their formalizations are quite different from theory: terms and proofs do not look like of theory. This paper proposes a name binding technique, substitutions and inference rules incorporating a term refreshing function comply with Barendregts variable convention, thus the formalization of formal systems almost identical to their theory. Untyped λ-calculus and simply typed λ-calculus are formalized to demonstrate the merits of this technique.

Key words: variable name, name binding, formal system, Barendregts variable convention, programming language theory