Logic diagrams
The pictures phase of the logic package: proof trees, truth trees and Venn diagrams. Automata and Kripke frames are graphs, drawn as on Drawing graphs.
Proof trees
A sequent derivation is a tree: each inference has its conclusion below a bar and its premises above, with the rule's name at the bar's right. proofTreeFigure(d) takes a Derivation from @ratmath/logic (or any { sequent, rule, premises }) and lays it out with treeLayoutOf: each subtree is as wide as its widest line, subtrees sit a fixed gap apart, and each conclusion is centred over its premises. Widths are counted in characters, so positions are exact whole numbers.
Truth trees
truthTreeFigure(t) draws an analytic tableau top down: the numbered lines of each node, with the rule and the line each came from; branches below; ✗ under a closed branch with the two lines that contradict, ○ under an open one. A tree whose every branch closes proves its premises inconsistent.
Venn diagrams
vennFigure(["A", "B", "C"], { shade }) draws up to three sets. shade picks regions by membership: a function such as (m) => m.A && !m.B, or strings such as "110" (in A and B, not in C). The eight regions of three sets are , , …, ; a syllogism's premises shade the regions they say are empty and marks put a cross in a region that has a member. The shading is a grid of cells, so it is estimated at the circles' edges; regions lists exactly which regions are shaded.
@ratmath/graphics and Core's Rational in scope. The last line's value is shown; PRINT(…) adds lines, TEX(…) typesets math, and SHOW(svg) draws a picture.