Skip to content
beloch

The stages view

beloch render FILE --view stages draws how the selection of one construction (def-selection) went: which candidates the construction produced, which stage removed each of them, and the one that remains, or why none or several remain. Like the rest of CLI.md, this page describes the reference implementation and binds no other.

The view reads the trace that beloch fold --trace writes (FOLD.md, "The trace") and repeats no part of the selection. Every candidate, side, landing and distance it draws is one the trace carries.

Terminal window
beloch render FILE.bel|FILE.fold [OUT] --view stages [--stage N] [--checks]

Without further flags the view draws the construction of the statement a traced run failed at, and otherwise the last statement that chose from candidates, as the candidates view does.

FlagEffect
--stage NDraws stage N alone, with the program block and the legend.
--checksAdds the rows that say what each stage checks, for a figure that explains the selection.

The output is SVG or PNG, as for every view.

The view has one grammar for two readers. The author of a program is the reference case: which stage decided my candidates, and what do I write when none did. A figure in the specification adds, with --checks, what each stage checks. The flag changes which text rows appear and nothing in the drawing.

The figure is one column, read from top to bottom.

  • Program. The statement the view draws, in bold, after the statements that define the names it reads, directly or through other names, in program order. Statements in between are left out.
  • One row per stage, 0 to 4, in order. A row holds the paper on the left and on the right the title, the statement with the part the stage reads underlined, and the text rows. A long statement wraps between its items.
  • A stage the construction does not use keeps its place as a short gray row: its title and one line, "Skipped, as the fold names no heading." A stage the construction uses keeps its full row even when it removes nothing.
  • One square per candidate. When the marks of several candidates would cover each other, the stage draws one full-size square per candidate, stacked in the left column. The text stays on the right.
  • The closing block follows the last stage, in the right column: Outcome, and Next when the construction ends with several candidates or none.
  • The legend closes the figure. It shows only the marks the figure uses, drawn as they appear, in three groups: the states of a candidate, the paper and what the stages read, and the marks of the stages.

A rule between two stages separates their rows, and a heavier rule separates the last stage from the closing block. The drawing area reaches as far beyond the paper as its content does: a parabola, a landing past the edge.

Every stage title names what the stage does:

StageTitle
0generate candidates
1compare with the heading
2name the folding side
3check what the fold moves
4measure the landing

A candidate is numbered from 1 in the order the trace lists the candidates of stage 0, and keeps its number in every row. A line that creases no face is no candidate: stage 0 does not draw or number it.

The number is the candidate's identity. It stands in a circle at one end of the line, outside the paper, and in front of every text row about the candidate. Color repeats the number: blue, orange and purple from the highlight colors, in that order. Green and red are left out, since they read as pass and fail. Only candidates are colored; what a stage reads or constructs is slate.

StateLineNumber
in the selectionsolid, medium weightoutlined
eliminated by this stagehairlinecrossed out
eliminated by an earlier stagenot drawnnot drawn
kept, in the last stageas the fold it makes: valley, mountain or markfilled

The paper, its creases and its marks are drawn as in the crease-pattern view, and every mark keeps the meaning it has there. A dotted line is a line drawn on the paper and not folded.

RoleMark
what a stage readsa thin solid slate line, always labeled
an edge a stage readsa slate rail set inside the paper, parallel to the edge, labeled
a constructionthin slate: the circle of axiom 6, the parabolas of axiom 7
the toward or moving targeta filled black diamond, labeled
the side that folds overhatching in the candidate's color, its number inside; each candidate has its own hatch angle
a point that movesa filled dot, an arrow, and an outlined ring where it lands, labeled with a prime: .d becomes .d′
a piece of line that movesa filled bar, an arrow, and an outlined bar where it lands, labeled --ef′
a motion the paper cannot makea thin arrow from a cross where the missing paper would be, and a label naming it
where a point can land (stage 0)a thin line from the point to the landing, with a right-angle mark where the candidate crosses it
an anglean arc in the candidate's color, with its value
a distancea line from a dot on the nearest landed point to the target, its value in a tag with the candidate's number

A source is filled and its image is the same shape outlined, so a thing and the place it lands read as a pair. Every mark that belongs to a candidate carries its number: arrows, images, distances, hatched sides. A label never covers a line; it sits in a tag or at the end of a leader.

Every distinction above holds in black on white, where the numbers, the hatch angles and the line weights carry what color carries on screen.

Stage 0 constructs the candidates and removes none. The paper shows the construction of the axiom:

  • Axiom 5, a line onto a line: the two lines and, per candidate, the two equal angles it makes with them.
  • Axiom 6, a point onto a line through a point: the circle about the point on the crease through the point that moves, the target line drawn past the paper, and per candidate the landing and the line from the point to it.
  • Axiom 7, two points onto two lines: both parabolas. The candidates are their common tangents.

Its rows are Constructs, with --checks, and Yields, which names each candidate by what it is: "① halves the angle at the top right".

The heading line as input, and the angle of each candidate to it, as an arc with its value where the two meet. The candidates at the smallest angle pass; a tie passes on.

The target of toward or moving, and per candidate the hatched side that folds over. A candidate the item names no side of is eliminated here, with the reason: "--ab crosses it, so it names no side".

Per candidate and alignment, the motion that carries the alignment out. Whoever moves lands on the paper of the other object:

  • a point onto a line: the point, its arrow and its image on the line;
  • a line onto a point: a short piece of the line around the place that lands on the point, and its image through the point;
  • a line onto a line: the piece of the line that folds over, and its image on the other line.

With neither toward nor moving, the Result row names the side that folds and why: "the side of .d folds over, as the statement reads".

The images of what the stage measures, the target, and per candidate the distance from the nearest landed point. (toward …) measures the objects of the alignments; (x toward …) measures x alone.

RowStagesAppearsSays
Constructs0with --checkshow the axiom produces its candidates
Yields0alwayseach candidate, by what it is
Checks1 to 4with --checksthe stage's criterion in one sentence; a default names its reason
Result1 to 4alwaysper candidate its verdict, then what the stage measured
Outcomeclosing blockalwaysthe kept candidate, or that several or none remain
Nextclosing blockwhen several or none remainper candidate the item that keeps it

A Result line starts with the candidate's number, drawn in the state it has in the square, then the verdict: passes or eliminated, and in the Outcome holds. The verdict is bold; the line of an eliminated candidate is gray. A value shows as many decimals as it takes to tell two different values apart, at least two. Values that print alike are a tie in the exact comparison, and the line says so.

Next shows the suggestions the trace carries, one per remaining candidate: "① to keep it, add (toward .d)". The view computes none of them.