控制共模式:往返之旅(扩展版)
Controlling Copatterns: There and Back Again (Extended Version)
AI总结:
本文利用 Danvy 的函数与语法对应,为整体式和组合式共模式分别推导出完整语义体系,并通过续延传递风格实现两种演算之间的往返转换。
摘要:
共模式为函数式程序提供了一种灵活的机制来响应其上下文,而组合可以极大地增强其表现力。然而,同样的表现力也使得精确刻画程序行为变得更加困难。利用 Danvy 在不同语义构件之间的函数对应与语法对应,我们为共模式推导出一整套语义,并且进行了两次。首先,一个整体式共模式演算经历了一段旅程,从小步操作语义到抽象机,再到续延传递风格。然后在续延传递风格内部,我们重构语义以推导出一个更一般的组合式共模式演算,并踏上返程,以相反的顺序推导出其他语义构件。
英文摘要:
Copatterns give functional programs a flexible mechanism for responding to their context, and composition can greatly enhance their expressiveness. However, that same expressive power makes it harder to precisely specify the behavior of programs. Using Danvy's functional and syntactic correspondence between different semantic artifacts, we derive a full suite of semantics for copatterns, twice. First, a calculus of monolithic copatterns is taken on a journey from small-step operational semantics to abstract machine to continuation-passing style. Then within continuation-passing style, we refactor the semantics to derive a more general calculus of compositional copatterns, and take the return journey back to derive the other semantic artifacts in reverse order.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。