paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Symbolic and automatic differentiation of languages

语言的符号微分与自动微分
ICFP 5(ICFP)2021匹配度 2/10 · 论文属于程序语言与类型理论中的形式语言、解析和微分技术,虽然与PL理论相关,但未涉及用户核心关注的静态分析、LLM/Agent、浮点程序分析或贝叶斯程序分析。引用 6 inbox
Conal Elliott
crossref: 2026-09-10

AI 速览

一句话:将形式语言刻画为类型级字符串谓词,并导出正则表达式符号微分与 trie 自动微分两种对偶解析实现。

论文将形式语言从集合论定义转为类型论定义,把语言看作字符串上的类型级谓词:应用于字符串得到成员证明类型,证明描述解析方式。并、连接、Kleene 闭包等构件有精确规格,并可推广为谓词上的定义域/值域变换。作者给出语言(及列表到任意类型函数)的简单刻画,揭示语言“微分”用于识别的核心,形成一组类型级谓词引理。这些引理支撑两种对偶解析实现:归纳式正则表达式对应符号微分,余归纳式 trie 对应自动微分,代码相同但表示与原语操作互换。类型级语言的易证性质几乎无代价迁移到可判定实现,证明代数性质无需归纳或互模拟论证。

问题
如何避免集合论定义带来的操作策略混杂,为语言识别及其代数性质提供统一、易证明的基础。
方法
采用类型论,把语言建模为字符串上的类型级谓词,并用语言微分导出正则表达式与 trie 两种对偶解析实现。
评估
以一组类型级谓词引理和两个对偶实现展示,性质可迁移到可判定实现且无需归纳或互模拟论证;未涉及实验评估。
原文摘要(Abstract)

Formal languages are usually defined in terms of set theory. Choosing type theory instead gives us languages as type-level predicates over strings. Applying a language to a string yields a type whose elements are language membership proofs describing how a string parses in the language. The usual building blocks of languages (including union, concatenation, and Kleene closure) have precise and compelling specifications uncomplicated by operational strategies and are easily generalized to a few general domain-transforming and codomain-transforming operations on predicates. A simple characterization of languages (and indeed functions from lists to any type) captures the essential idea behind language “differentiation” as used for recognizing languages, leading to a collection of lemmas about type-level predicates. These lemmas are the heart of two dual parsing implementations—using (inductive) regular expressions and (coinductive) tries—each containing the same code but in dual arrangements (with representation and primitive operations trading places). The regular expression version corresponds to symbolic differentiation, while the trie version corresponds to automatic differentiation. The relatively easy-to-prove properties of type-level languages transfer almost effortlessly to the decidable implementations. In particular, despite the inductive and coinductive nature of regular expressions and tries respectively, we need neither inductive nor coinductive/bisimulation arguments to prove algebraic properties.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@article{paperbot1122,
  title = {Symbolic and automatic differentiation of languages},
  author = {Conal Elliott},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {5},
  number = {ICFP},
  year = {2021},
  doi = {10.1145/3473583}
}