Abstract
Learning LISP presents significant challenges for novice programmers, particularly regarding recursive logic and complex syntax. Traditional compilers often fail to provide constructive feedback, merely signaling the presence of errors without addressing underlying logical flaws. This paper introduces PHENARETE, an "intelligent interpreter" designed to bridge this gap. By performing "propositional interpretation," PHENARETE analyzes student code to infer intent and proposes a sequence of increasingly correct approximations. Deployed at Université Paris 8 for over 1,500 students, the system demonstrates a pedagogical approach to automated debugging.
Introduction
The steep learning curve of LISP is well-documented, characterized by its heavy reliance on nested parentheses and recursive structures. At Université Paris 8, instructors observed that students frequently encountered a consistent set of logical traps, such as mismanaging variables, swapping arguments, or failing to define base cases for recursion. Standard development environments typically offer little assistance beyond syntax checking. PHENARETE was developed as a "convivial" pedagogical tool to act as an intelligent intermediary, helping students understand why their logic fails and guiding them toward functional solutions.
Methodology: Propositional Interpretation
Unlike traditional interpreters that execute code line-by-line, PHENARETE treats a program as a set of logical propositions to be analyzed and refined. This process, termed "propositional interpretation," involves several key techniques:
- Structural Inference: The system analyzes the grouping of code blocks to infer missing control structures. For instance, if multiple clauses are provided without an explicit conditional, PHENARETE assumes a
CONDfunction was intended. - Heuristic Transformations: Drawing from a library of common student errors, the system applies transformation rules. A typical example is reordering clauses to ensure a base case is evaluated before a recursive call.
- Termination Analysis: A critical component of the system is its ability to analyze recursion. By examining how arguments evolve across calls, PHENARETE can detect non-terminating loops (e.g., failing to use
CDRto reduce a list) and suggest structural corrections to ensure convergence. - Iterative Refinement: The system does not simply output a final "correct" version. Instead, it generates a finite sequence of approximations, allowing the student to see the logical evolution from their original code to a working program.
Identifying Common LISP Errors
The development of PHENARETE was informed by a year-long observation of novice programmers. This research identified five primary categories of errors that the system is specifically tuned to detect:
- Absence of variables: Forgetting to declare or pass necessary parameters.
- Inversion of variables: Swapping the order of arguments in function calls.
- Grouping errors: Incorrect nesting of parentheses, a hallmark of LISP difficulty.
- Absence of conditional instructions: Failing to provide branching logic where required.
- Non-representation of termination: Creating recursive functions that lack a proper exit condition.
Pedagogical Philosophy
The core philosophy behind PHENARETE is that an interpreter should be a teaching aid rather than just an execution engine. By treating a buggy program as a series of inconsistencies to be resolved, the system performs a role similar to a human code reviewer. It makes "hypotheses" about the programmer's intent—for example, assuming a list-building function should eventually return the completed list—and works backward to identify where the logic diverges from this goal. The emphasis is on justifying modifications to the student, helping them internalize the underlying principles of the language.
Implementation and Results
PHENARETE was successfully implemented in VLISP-10 and integrated into the curriculum at Université Paris 8. At its peak, the system supported approximately 1,500 students annually, demonstrating its scalability and practical utility in a large-scale educational setting. Qualitative analysis, such as the transformation of a broken "reverse" (REV) function, shows that the system can effectively guide students through complex recursive debugging by providing clear, logical steps toward a solution.
Limitations and Future Directions
While PHENARETE proved effective in a classroom setting, several areas for improvement remain. The current research lacks a formal statistical evaluation comparing student outcomes (e.g., grades or debugging time) against a control group using standard tools. Additionally, while the system excels at catching the "five common errors," its performance on more idiosyncratic or complex algorithmic logic is less certain. Future work involves integrating PHENARETE into broader didactic frameworks like VISION and CAN to provide a more comprehensive learning environment.
Summary updated