🤖 AI Summary
This work addresses the challenge in functional programming pedagogy where evaluation traces generated by algebraic steppers are often cluttered with trivial reduction steps that obscure core concepts and hinder learning. To remedy this, the authors propose an algebraic stepper equipped with a scoping-aware filter mechanism that enables users to selectively show or hide reduction steps via lightweight pattern expressions. Inner filters can override outer ones, facilitating focused, hierarchical trace exploration. The approach introduces the first composable, lexically scoped filtering framework for steppers, accompanied by a formal semantics proven consistent with the original language semantics. Notably, it supports stepping through programs containing holes or type errors—a capability not previously available. The system’s meta-theory, including preservation, progress, and simulation theorems, is mechanically verified in Agda and integrated into the Hazel live programming environment. Classroom deployment demonstrates that students intuitively adopt the tool, while instructors effectively construct concise, pedagogically optimized traces.
📝 Abstract
Algebraic steppers help students learn functional programming by displaying evaluation as a sequence of small-step reductions, but even simple programs produce long traces in which key ideas are buried under mundane reductions. This paper presents the filtered stepper calculus, a formal framework that gives users scoped, pattern-based control over which reduction steps are shown or hidden. Users annotate programs with lightweight filter expressions that match on the structure of redexes. Filters compose via lexical scoping so that inner filters override outer ones. We prove preservation, progress, and a simulation theorem establishing that the filtered stepper agrees with the underlying unfiltered semantics, and mechanize all proofs in Agda. We implement the calculus in the Hazel live programming environment, including its support for stepping programs with holes and type errors. To do so, we reconcile Hazel's internal environment-based evaluator with the substitution-based presentation expected in the classroom. We deploy the system in a university programming languages course. Our evaluation shows that students adopt the stepper organically, though more advanced uses of filters may require further instruction, and that instructors can use filters to craft focused traces for use in lectures.