Powered by
2025 ACM SIGPLAN International Workshop on Partial Evaluation and Program Manipulation (PEPM 2025),
January 21, 2025,
Denver, CO, USA
2025 ACM SIGPLAN International Workshop on Partial Evaluation and Program Manipulation (PEPM 2025)
Frontmatter
Invited Contributions
Papers
Algebraic Stepper for Simple Modules
Kenichi Asai and
Hinano Akiyama
(Ochanomizu University, Japan)
An algebraic stepper is a pedagogical tool for showing the
intermediate steps of program execution.
This paper presents an algebraic stepper for OCaml that supports
simple modules with hierarchical reference to variables
(but without functors or signature sealing).
When we program with modules,
we can refer to a variable declared in a parent module directly,
whereas we need to specify a module path to refer to a
variable declared in a child module.
Therefore, when we build the stepper,
we attach a level to each variable (bound by let statement
without in)
and use it to maintain correct reference regardless of
where a variable is used.
In this paper, we present and formalize our stepper that implements
delayed substitution of variables, and discuss the interplay
between the stepper semantics and the level maintenance.
We further show that the execution in the stepper semantics is
consistent with the one in the standard small-step semantics.
The resulting stepper is implemented, supporting most of the basic
constructs of OCaml, and is used in an introductory OCaml course in
the authors' institution.
Article Search
proc time: 2.4