The output of the program #
What the program ratpoints-lean prints for the points of a successful search. Its callback
Ratpoints.Cli.process, called for the points of a list L in turn from the data
Ratpoints.Cli.Data.ofOutput u o of the settings u of the output and the options o of the
search, counts the points of L that it keeps (Ratpoints.Cli.Data.keeps: all but those at
infinity under -i and the affine ones outside the search intervals of the command line), of these
only the first under -1, at which it stops the search (Ratpoints.Cli.countedPoints), and prints
them unless -z, each after the string before the points (-fs) if it is the first and else after
the string between them (-fm), in the format of -f: so the text printed, with the string before
the points when no point was printed, is the string before the points followed by the formatted
points with the string between them in between
(Ratpoints.Cli.out_append_deliver_process_ofOutput), and the count is their number
(Ratpoints.Cli.total_deliver_process). By the protocol of the delivery
(Ratpoints.map_findPointsWith_eq_map_findPoints), which says that for every value of the options
of the sieve the search delivers to a callback the points of Ratpoints.findPoints in their order
until a call stops it, this is what Ratpoints.Cli.run prints between the head of the report and
its end, without -v, whose report of the library comes between the points; under -q it is all
that it prints, with the string after the points (-fe) at the end, and under -1 the one point
printed is the first point of the list of Ratpoints.findPoints that the callback keeps. The search
runs on the search intervals of the command line joined (Ratpoints.Cli.joinIntervals).
The search region of the command line: the reading of -l and -u keeps an invariant
(Ratpoints.Cli.Intervals.ReadsWF: the exact ends are those of increasing and disjoint intervals
l ≤ u, checked by error 7, and the doubles of each interval hold it as far as the search goes),
which Ratpoints.Cli.Intervals.lower, Ratpoints.Cli.Intervals.upper and
Ratpoints.Cli.Intervals.complete keep, over the options by Ratpoints.Cli.checkOptions_preserves;
so the test of the callback is the exact search region of the command line, and the joined intervals
hold it for the numbers |x| ≤ H of the search. For words of fewer than 2 ^ 56 characters, the
doubles of the lower ends after the first are moreover the largest doubles at most their ends
(Ratpoints.Cli.Intervals.LowerMax), which makes the joined intervals well formed: the library
never refuses them, and error 9 is unreachable from the command line.
Main definitions #
Ratpoints.Cli.Data.keeps,Ratpoints.Cli.countedPoints: the points that the callback keeps, and those that it counts.Ratpoints.Cli.IntervalOf,Ratpoints.Cli.Intervals.ReadsWF,Ratpoints.Cli.Intervals.LowerMax: the invariants of the reading of the search intervals of the command line.
Main statements #
Ratpoints.Cli.deliver_process: the delivery of a list to the callback of the program.Ratpoints.Cli.out_append_deliver_process_ofOutput,Ratpoints.Cli.total_deliver_process: the text that the callback prints and the count.Ratpoints.Cli.run_eq_of_findPointsWith_eq_ok,Ratpoints.Cli.total_eq_of_findPointsWith_eq_ok: what the program prints for a successful search without-v, and the count that its report gives.Ratpoints.Cli.findPointsVerbose_eq_ok_of_findPointsWith_eq_ok,Ratpoints.Cli.verbose_eq_false_of_input_eq_ok: the search with the print channel that prints nothing, which the program runs without-v, and-qcancels-v.Ratpoints.Cli.run_eq_of_findPoints_eq_ok: what the program prints under-q.Ratpoints.Cli.run_eq_of_onePoint: under-q -1, the first point that the callback keeps.Ratpoints.Cli.reads_of_input_eq_ok: the search intervals of a command line that the program accepts.Ratpoints.Cli.inRegion_iff_of_input_eq_ok,Ratpoints.Cli.inIntervals_joinIntervals_of_inExactRegion,Ratpoints.Cli.intervalsWF_joinIntervals_of_input_eq_ok: the test of the callback is the exact search region of the command line (Ratpoints.Cli.InExactRegion), and the joined search intervals hold it for|x| ≤ Hand, for words of fewer than2 ^ 56characters, are well formed.Ratpoints.Cli.mem_filter_keeps_iff_of_input_eq_ok: assuming Sturm's theorem when the Sturm step is on, the points that the program prints are exactly the points in the exact search region of its command line.
The points that the callback counts #
Whether the callback Ratpoints.Cli.process of the program with the data d keeps the point
p = (x, y, z), counting it, printing it unless -z and stopping the search at it under -1:
a point at infinity (z = 0) unless the points at infinity are passed over (-i), and an affine
point when the command line gives no search intervals or x / z lies in one of them
(Ratpoints.Cli.inRegion).
Equations
Instances For
The points of the list L, in their order, that the callback Ratpoints.Cli.process of the
program counts when it is called for the points of L in turn, from data that keeps the points
that pass keep (Ratpoints.Cli.Data.keeps) and whose setting of one point is onePoint, while it
has not stopped the search: the points of L that pass keep, and of these only the first when
one point is enough (-1, onePoint set), at which the callback stops the search.
Equations
- Ratpoints.Cli.countedPoints keep onePoint L = if onePoint = true then List.take 1 (List.filter keep L) else List.filter keep L
Instances For
What the callback prints #
The data d of the callback Ratpoints.Cli.process after it has printed the point
p = (x, y, z): d itself when no point is printed (-z), and otherwise d with the flag
printBetween set and with the text of the point appended to the text printed so far, the string
between the points (-fm) if a point was printed before and else the string before the points
(-fs), then the point in the format (Ratpoints.Cli.formatPoint). This is what a call of the
callback that does not pass over the point does to its data.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Once a point was printed, each point printed appends the string between the points and the point in the format.
From data that has printed nothing, the text printed for the points of K, with the string
before the points when no point was printed, is the string before the points followed by the
points printed in the format, with the string between them in between: none under -z.
The delivery to the callback #
A call of the callback for a point p = (x, y, z) that it keeps (Ratpoints.Cli.Data.keeps)
prints it (Ratpoints.Cli.Data.printPoint), counts it and stops the search under -1.
The delivery of the points of L to the callback of the program from the data d and the
count t, with the flag of the stop clear: the points that the callback counts
(Ratpoints.Cli.countedPoints) are printed in turn and counted, and the search is stopped when one
point is enough and L has a point that the callback keeps (Ratpoints.Cli.Data.keeps).
The text that the callback of the program prints for the points of L, from the data of the
settings u of the output and the options o of the search, with the string before the points
when it printed no point, as the program prints it: the string before the points, then the points
that the callback counts (Ratpoints.Cli.countedPoints), in the format, with the string between
the points in between, none under -z.
The program #
A search with the print channel that prints nothing returns the outcome of
Ratpoints.findPointsVerbose with that channel.
What the program prints for a command line that it reads as the coefficients c, the height
bound H, the options s of the sieve, the options o of the search and the settings u of the
output, without -v, when the search Ratpoints.findPoints with the program's array size on the
search intervals of the command line joined (Ratpoints.Cli.joinIntervals) returns the list L and
the search with the callback of the program the outcome r: the head of the report, the string
before the points, the points of L that the callback counts (Ratpoints.Cli.countedPoints: those
that it keeps, Ratpoints.Cli.Data.keeps, only the first of these under -1) in the format, with
the string between them in between, none under -z, the string after the points and the end of the
report; the protocol of the delivery holds for every value of the options
(Ratpoints.map_findPointsWith_eq_map_findPoints).
The count of the points that the report of the program gives: the number of the points of the
list of Ratpoints.findPoints that the callback of the program counts
(Ratpoints.Cli.countedPoints), for every value of the options of the sieve.
What a command line that the program accepts gives: the options are words of the command line,
the height bound is a positive long, the reading of the options from the defaults succeeds, the
search intervals of the options and the exact ends of the settings of the output are those of the
intervals read and completed (Ratpoints.Cli.Intervals.complete), and -q cancels -v.
The program reads -v only without -q: under -q the settings of the output have the flag of
the report of the library clear.
What the program prints under -q for a command line on which the search
Ratpoints.findPoints on the search intervals of the command line joined returns the list L: the
string before the points, the points of L that the callback of the program counts
(Ratpoints.Cli.countedPoints: those that it keeps, Ratpoints.Cli.Data.keeps, only the first of
these under -1) in the format, with the string between them in between, none under -z, and the
string after the points; it exits with the status 0.
Under -q -1, without -z, the program prints the first point p of the list of
Ratpoints.findPoints on the search intervals of the command line joined that the callback keeps
(Ratpoints.Cli.Data.keeps: all of it but the points at infinity under -i and the affine points
outside the search intervals of the command line), in the format, between the string before the
points and the string after them.
The search region of the command line #
The interval d of doubles holds the exact interval from el to eu of the command line as
far as the search goes: neither end of d is a NaN, the lower end of d is at most its upper end,
and every x with |x| ≤ H between the exact ends lies in d.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The reading iv of the search intervals of the command line for the height bound H, with
n complete intervals and a lower end read after them when l: the arrays have their
2 maxDegree entries and room for the intervals, the exact ends are infinite only as ±1 and are
the ends of increasing and disjoint intervals l ≤ u, the double of a pending lower end is below
it, and the doubles of each complete interval hold it as far as the search goes.
The exact ends have their
2 maxDegreeentries.The doubles of the intervals have their
2 maxDegreeentries.There is room for the intervals read.
An exact end is infinite only as
-1or1.The exact ends read are the ends of increasing and disjoint intervals
l ≤ u.- pending : l = true → iv.domain[n]!.1.isNaN = false ∧ doubleValue iv.domain[n]!.1.bits ≤ iv.ends[2 * n]!.value
The double of a pending lower end is not a NaN and lies at or below it.
The doubles of each complete interval hold it as far as the search goes.
Instances For
An end set after the ends of increasing and disjoint intervals l ≤ u continues them when it
lies at or above the last one, strictly above an upper end.
The first interval of an upper end without a lower one, [-∞, e] of the command line, and its
doubles [-h, d], or [-∞, d] when d lies below -h.
The last interval of a lower end without an upper one, [el, +∞] of the command line, and its
doubles [l, h], or [l, +∞] when h lies below l.
Closing the pending interval of a reading with the exact upper end e and the upper double u,
which hold it as far as the search goes, keeps the invariant, whatever the field lSeen of the
result, which the invariant does not read: the step of both Ratpoints.Cli.Intervals.upper and
Ratpoints.Cli.Intervals.complete.
The doubles of the lower ends after the first that the reading iv of the search intervals has
read, n complete intervals and a pending lower end when l, are the largest doubles at most their
exact ends, as outward from the double that strtod reads makes them.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Closing the pending interval of a reading keeps the doubles of the lower ends the largest doubles at most their exact ends: the lower ends do not change.
What a command line that the program accepts gives for its search intervals: the height bound
is a positive long, and the reading of the intervals ends with complete intervals that keep the
invariant, the search intervals of the options being their doubles and the exact ends of the
settings of the output their exact ends.
The test of the callback, the binary search of in_region over the exact ends of the search
intervals of a command line that the program accepts, which are increasing and disjoint by the
checks of error 7, is the membership of a / b in one of them.
The search intervals that the program gives the library hold the exact search region of its
command line as far as the search goes, for |x| ≤ H: their ends are the doubles outward of the
exact ends (Ratpoints.Cli.outward), or ∓h for a missing first lower or last upper end, which
lie beyond the height bound.
The search intervals that the program gives the library for a command line that it accepts,
whose words have fewer than 2 ^ 56 characters, are well formed, so that the library never
refuses them (error 9 is unreachable): the doubles of the lower ends after the first are the
largest doubles at most the exact ends, which increase, so that join_intervals joins the
intervals whose doubles meet into intervals that are increasing and strictly apart. Without the
bound on the length, a word of LONG_MAX / 20 digits could make scan_end stop taking the digits
of its exponent.
For a point of height at most H of a command line that the program accepts, the search
region of the search on the joined intervals is that of the range of the denominators, given that
x / z lies in the exact search region of the command line when there is one.
Assuming Sturm's theorem when the Sturm step is on (Ratpoints.SturmTheorem, which a command
line with -s does not need), without -x, the points of the list of Ratpoints.findPoints on
the joined search intervals of a command line that the callback of the program keeps
(Ratpoints.Cli.Data.keeps), which it prints under -q
(Ratpoints.Cli.run_eq_of_findPoints_eq_ok), are exactly the points of height at most H in the
exact search region of the command line, those with y ≥ 0 under -y: the points at infinity
unless -i, and the affine points with the denominator in the range of -dl and -du and x / z
in one of the intervals of -l and -u when there are some.