diff --git a/src/Engine.ml b/src/Engine.ml
index 988ddf7c1166f88ca14f048e811bb7c3484b68f2..e37de2e1bb7c78fb7a60c6f026558c8b45c1fd75 100644
--- a/src/Engine.ml
+++ b/src/Engine.ml
@@ -714,6 +714,12 @@ module Make (T : TABLE) = struct
current states via their numbers (this seems cleaner than using OCaml's
polymorphic equality). *)
+ (* The two fields that are not compared by [equal], namely [error] and
+ [triple], are overwritten by the function [discard], which handles
+ [InputNeeded] checkpoints. Thus, if [equal env1 env2] holds, then the
+ checkpoints [input_needed env1] and [input_needed env2] are
+ equivalent: they lead the parser to behave in the same way. *)
+
let equal env1 env2 =
env1.stack == env2.stack &&
number env1.current = number env2.current
diff --git a/src/IncrementalEngine.ml b/src/IncrementalEngine.ml
index 78700c8c9483c2fccb7518c01d40a9e55a210cf2..d21d292ac9538428faea55ac8b6bc983f5a36fa7 100644
--- a/src/IncrementalEngine.ml
+++ b/src/IncrementalEngine.ml
@@ -290,11 +290,13 @@ module type INCREMENTAL_ENGINE = sig
val current_state_number: 'a env -> int
(* [equal env1 env2] tells whether the parser configurations [env1] and
- [env2] are equal in the sense that the automaton's current state is
- the same in [env1] and [env2] and the stack is *physically* the same
- in [env1] and [env2]. If [equal env1 env2] is [true], then the list
- of stack elements, as observed via [pop] and [top], must be the same
- in [env1] and [env2]. The function [equal] has time complexity O(1). *)
+ [env2] are equal in the sense that the automaton's current state is the
+ same in [env1] and [env2] and the stack is *physically* the same in
+ [env1] and [env2]. If [equal env1 env2] is [true], then the list of stack
+ elements, as observed via [pop] and [top], must be the same in [env1] and
+ [env2]. Also, if [equal env1 env2], then the checkpoints [input_needed
+ env1] and [input_needed env2] are equivalent. The function [equal] has
+ time complexity O(1). *)
val equal: 'a env -> 'a env -> bool