论文标题
外行:布局敏感语法的交互式设计
Lay-it-out: Interactive Design of Layout-Sensitive Grammars
论文作者
论文摘要
布局敏感的语法已在许多现代编程语言中采用。但是,对这种语法的工具支持仍然有限和不成熟。在本文中,我们介绍了Lay-It-Out,这是一种用于布局敏感语法设计的交互式框架。从用户定义的模棱两可的语法开始,我们的框架通过通过用户交互来综合布局约束来完善它。为了易于互动,我们有限的模棱两可检查器自动生成了最短的非歧义句子(如果存在)。我们的SMT编码的健全性和完整性是在COQ证明助手中机械化的。关于真实语法的案例研究,包括完整的语法,证明了我们方法的实用性和可扩展性。
Layout-sensitive grammars have been adopted in many modern programming languages. However, tool support for this kind of grammars still remains limited and immature. In this paper, we present Lay-it-out, an interactive framework for layout-sensitive grammar design. Beginning with a user-defined ambiguous grammar, our framework refines it by synthesizing layout constraints through user interaction. For ease of interaction, a shortest nonempty ambiguous sentence (if exists) is automatically generated by our bounded ambiguity checker via SMT solving. The soundness and completeness of our SMT encoding are mechanized in the Coq proof assistant. Case studies on real grammars, including a full grammar, demonstrate the practicality and scalability of our approach.