The delivery of a list of points #
The reference of the delivery of a search, Ratpoints.Delivery.deliver, the fold over a list of
points that calls the callback for each of them while the flag of the stop is clear: its unfolding
on the empty list, on a point in front and on a concatenation; a delivery whose flag is set is
left as it is, whatever the list, so that the delivery of a list is that of a prefix of it once the
flag is set after the prefix; with the appending callback Ratpoints.appendPoint the array of the
data grows by the list and the count by its length; and in general the calls made are those of the
points of a prefix of the list, before each of which the flag is clear, the whole list or the
prefix up to and including the first point whose call sets the flag.
Main statements #
Ratpoints.Delivery.deliver_nil,Ratpoints.Delivery.deliver_cons,Ratpoints.Delivery.deliver_append: the unfolding.Ratpoints.Delivery.deliver_of_quit,Ratpoints.Delivery.deliver_append_of_quit,Ratpoints.Delivery.deliver_eq_of_prefix,Ratpoints.Delivery.ite_quit_eq_deliver_append: nothing changes once the flag is set.Ratpoints.Delivery.deliver_appendPoint: the appending callback.Ratpoints.Delivery.exists_prefix_deliver_eq: the calls made are those of a prefix of the list, before each point of which the flag is clear, up to and including the first call that sets the flag.
Implementation notes #
The file uses Lean core only, so that the contracts of the sieve in the files without Mathlib
(Ratpoints.Proof.Stages, Ratpoints.Proof.Scan, Ratpoints.Proof.SiftBits,
Ratpoints.Proof.Sift) can state what they deliver with it.
The unfolding #
The stop #
Once a call has set the flag, the delivery of a list is that of a prefix of it after which the flag is set: the points that follow are passed over.
Ratpoints.Delivery.deliver_eq_of_prefix for the concatenations of the lists f a of the
elements a of a prefix l₁ of l₂.
The delivery r₁ of the points of L₁, followed, unless the callback has stopped the search,
by a delivery r₂ of the points of L₂ from r₁, is the delivery of the points of L₁ ++ L₂.
The appending callback #
The calls made #
The calls that the delivery of L makes are those of the points of a prefix M of L: the
flag is clear before each point of M, so that each gets its call, and unless M is all of L,
the flag is set after them, by the call of the last point of M, or at the start when M is
empty.