167. Library contradictions resolved (graphs, strings, math)
Contradictions logged in spec/delta/doc-notes/ for graph, tree, flow,
search, mo, pair, strings, math, mod, ntt, geometry, rand, io and seq,
resolved by: a numbered decision wins, then library-wide conventions, then
the stub. Prose-only fixes are marked in the notes; the API changes:
dfsfollows decisions 146-147.Visit<V, A>isEnter(v, via: ?A),Exit(v, via: ?A),Again(from, via: A);dfs(g, from, seen: ?mut [V]Bool = None);step.prune()afterEnterskips the arcs.Rooted.tourandEvents.atuseVisit<V, V>with the parent asvia. Reason: agreed design, the stub lagged. Reverse: restore the two one-field variants.Adj,directed_of_triples,undirected_of_triplesremoved;*_of_pairsandadjacencyreturn[V]List<V>. Reason: graphs-trees.md namesGraphand[V]Listas the two representations, and positional(V, W)arcs are notWeighted. Reverse: restoreAdjfrom history.articulation_points→cut_vertices(now onEdgedNext, so parallel edges are right),edge_blocks→blocks,biconnected_componentsremoved. Reason: one name per idea; the chapter's names;blocksalready partitions edges. Reverse: rename back.kruskal'sby:reads the edge record (R -> K), not its key. Reason: the defaulte => e.walready did. Reverse: type itE -> K.- Strings follow decisions 1.6 and 16.2:
starts_with(pat, at: 0),split_first→split_once,trim_start/trim_endadded. Reason: numbered decisions beat the stub. Reverse: dropat:, rename back. nth_rootandSieve.each_divisorremoved (duplicates ofirootandSieve.divisors). Freeeach_divisorstays: unsorted and allocation-free beside the sorteddivisorslist. Reverse: restore from history.Rng.int(lo, hi), both ends inclusive, replacesint(r: Range<Int>). Reason: decision 21.4 and the prelude'srand(lo, hi). Reverse: take a range again (goldioi25_triplesupdated both ways).