AlgoTouch: 一种以执行为中心的命令式程序增量构建方法
AlgoTouch: An Execution-Centered Approach to Incremental Construction of Imperative Programs
AI总结:
提出AlgoTouch系统,通过直接操作程序数据并记录执行行为,增量构建命令式程序,自动合成控制结构并生成多种主流语言代码。
摘要:
命令式语言的程序构建仍然主要基于编写文本代码,这些代码指定操作程序数据的指令序列。这种方法要求开发者预知指令对演化数据状态的影响,增加了认知负荷以及早期和增量开发中出错的可能性。本文提出了AlgoTouch,一种基于执行的系统,通过直接操作程序数据来增量构建命令式程序。程序不是通过组装语法结构,而是通过执行具体的数据转换来构建,这些转换被记录并整合到内部中间表示中。AlgoTouch依赖于一个显式的概念机,它暴露数据存储、计算和控制流,使得观察到的执行与程序结构之间能够持续对齐。该系统的一个核心贡献在于从执行行为中确定性地合成控制结构。条件语句从观察到的比较中推导出来,而迭代行为则封装在循环宏中,支持非线性和增量构建。这种设计允许部分和不完整的程序被执行、细化和完成,同时保持语义一致性。AlgoTouch自动生成多种主流命令式语言(包括Python、C、C++和Java)的正确且可读的程序。该系统通过在一组代表性算法基准上进行工程级验证来评估,证明了正确性、表达力、鲁棒性和语言无关性。通过将执行、构建和代码生成集成在一个统一架构中,这项工作为交互式程序构建引入了一种替代模型,并贡献了一类新的以执行为中心的开发系统。
英文摘要:
Program construction in imperative languages remains largely based on writing textual code that specifies sequences of instructions operating on program data. This approach requires developers to anticipate the effects of instructions on evolving data states, which increases cognitive load and the likelihood of errors during early and incremental development. This paper presents AlgoTouch, an execution-based system for incremental construction of imperative programs through direct manipulation of program data. Rather than assembling syntactic structures, programs are constructed by executing concrete data transformations that are recorded and incorporated into an internal intermediate representation. AlgoTouch relies on an explicit notional machine that exposes data storage, computation, and control flow, enabling continuous alignment between observed execution and program structure. A central contribution of the system lies in its deterministic synthesis of control structures from execution behavior. Conditional statements are derived from observed comparisons, while iterative behaviors are encapsulated in loop macros that support non-linear and incremental construction. This design enables partial and incomplete programs to be executed, refined, and completed while preserving semantic consistency. AlgoTouch automatically generates correct and readable programs in several mainstream imperative languages, including Python, C, C++, and Java. The system is evaluated through engineering-level validation on a representative set of algorithmic benchmarks, demonstrating correctness, expressiveness, robustness, and language independence. By integrating execution, construction, and code generation within a unified architecture, this work introduces an alternative model for interactive program construction and contributes a new class of execution-centered development systems.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。