🤖 AI Summary
Traditional imperative programming relies on predefined textual instructions, requiring developers to anticipate state changes—a cognitively demanding and error-prone process. This work proposes an execution-centric, incremental approach to program construction: by directly manipulating data and recording execution traces, program behavior is transformed into an intermediate representation, with continuous alignment between program structure and execution state maintained through an explicit conceptual machine. Control structures are deterministically synthesized from observed execution behaviors—conditionals emerge from recorded comparisons, and loops are encapsulated as macros supporting nonlinear, incremental development. The system enables partial execution, refinement, and completion while preserving semantic consistency, and generates readable, correct code in multiple languages, including Python, C, C++, and Java. Empirical validation on standard algorithmic benchmarks demonstrates the method’s correctness, expressiveness, robustness, and language independence.
📝 Abstract
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.