hclang 0.20.1 → 0.20.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,305 +10,355 @@ export const STANDARD_SOURCES = new Map([
10
10
  [
11
11
  "#!/usr/bin/env hc",
12
12
  "```",
13
- "Figures (#382)",
13
+ "Figures (#382, #395)",
14
14
  "",
15
- 'Ported from History 005.30c, "The Figure class as idiomatic HC", in',
16
- "`quilt+s3://protology#package=occurrence/history`. Relational Construction Theory",
17
- "has one generative operation: construct a Figure with optional, already",
18
- "constructed children. In HC that operation is the array literal, so nothing is",
19
- "added to get it. Every observer below answers a Figure, never a number or a",
20
- "Boolean: `A` means no and `B` means yes.",
15
+ "Relational Construction Theory has one generative operation: construct a Figure",
16
+ "out of zero or more already constructed Figures, its children. This module",
17
+ 'ports History 005.30c, "The Figure class as idiomatic HC", in',
18
+ "`quilt+s3://protology#package=occurrence/history`.",
21
19
  "",
22
- "30c was written against v0.16.0 and had to work around three behaviours that",
23
- "v0.17.0 changes. Its observers needed a boxed if/else, they could not use local",
24
- "names without writing onto the Figure observed, and identity-sameness was",
25
- "unanswerable. Here each one is written plainly.",
20
+ "`Figure` is a constructor closure, and the object it returns is the class: each",
21
+ "method below is documented by the paragraph above it. A paragraph ends in `;`,",
22
+ "so it is a statement of the object rather than one of its elements, and it",
23
+ "never affects `=`. Every observer answers a Figure, never a number or a",
24
+ "Boolean: `A`, with no children, means no, and `B` means yes. So every answer can",
25
+ "be a child, a receiver, or an argument, and the class is closed under its own",
26
+ "methods. Only Form and Text leave the class, on purpose: they answer a plain",
27
+ "bracket tree and its text, for reading a Figure rather than computing with it.",
26
28
  "",
27
- "The constructor is the bracket",
28
- "```",
29
- "; .A []; .B [A]; .C [B]; .D [C];",
30
- "; .E [A, B]; .F [B, C]; .G [E, F];",
31
- "; G",
32
- "# [[[], [[]]], [[[]], [[[]]]]]",
33
- "```",
34
- "A named closure is the one-child form, so a Figure can receive a reduce. For n",
35
- "children, write the bracket: a group passed to a closure stays one argument",
36
- "```",
37
- "; .Figure {[_]};",
38
- "; Figure (B)",
39
- "# [[[]]]",
40
- "; Figure (B, A)",
41
- "# [([[]], [])]",
42
- "; [B, A]",
43
- "# [[[]], []]",
44
- "```",
45
- "Manyness is a tally of the immediate children: one mark `B` for each child, so",
46
- "a count is a row of marks rather than a nest of successors. It maps the children",
47
- "and looks no deeper, so it needs no recursion and no way to take the rest of a",
48
- "Figure",
49
- "```",
50
- "; .many {_ & {B}};",
51
- "; many A",
52
- "# []",
53
- "; many B",
54
- "# [[[]]]",
55
- "; many E",
56
- "# [[[]], [[]]]",
57
- "; (many G) = (many E)",
29
+ "A method names its own Figure `_^`, because a bare name is looked up on the",
30
+ "argument first (spec 7), and the argument is usually another Figure. For the",
31
+ "same reason, a block inside a method reads only names the method bound",
32
+ "```",
33
+ ".Figure {[",
34
+ "```",
35
+ "**Children.** `Figure [c, …]` keeps exactly the Figures in the bracket, in",
36
+ "order, each one itself rather than a copy, so `(x.children .0) === c`",
37
+ "```;",
38
+ " .children (_ | []);",
39
+ "```",
40
+ "**Application**, `x y` (#375): a new Figure with x's children followed by y.",
41
+ "It leaves x unchanged and forgets nothing, so `ys | x` joins two Figures and",
42
+ "`cs | (Figure [])` constructs one out of a stream",
43
+ "```;",
44
+ " .apply {Figure ((_^.children | []) _)};",
45
+ "```",
46
+ "**Manyness**, `x.many()`: a tally with one mark `B` per immediate child. It",
47
+ "keeps how many children there are and forgets what they are, everything below",
48
+ "them, their order and their identity",
49
+ "```;",
50
+ " .many {Figure (_^.children & {B})};",
51
+ "```",
52
+ "**Size**, `x.size()`: a tally with one unit cell `U` per cell. Any Figure shaped",
53
+ "like `U` is a cell; every other Figure adds up the Sizes of its children by",
54
+ "joining them into `Tally Z`. It keeps the cell count and forgets shape, nesting,",
55
+ "order, reuse and identity. The unit case comes first, because a unit's only",
56
+ "child is `Z`",
57
+ "```;",
58
+ " .size {.kids _^.children;",
59
+ " (kids = U.children) ? {Figure [U]} : {((kids & {_.size()}) | (Tally Z)).row}};",
60
+ "```",
61
+ "**Multiplication**, `x.mul y`: y once for every cell of x, and `Z` when y is",
62
+ "`Z`. It keeps y's identity in every position and forgets x's shape",
63
+ "```;",
64
+ " .mul {.y _; .cells ((_^.size()).children);",
65
+ " (y = Z) ? {Z} : {Figure (cells & {y})}};",
66
+ "```",
67
+ "**Tally multiplication**, `x.size_mul y`: the Size of a Figure holding y once",
68
+ "per child of x. It keeps the cell count and forgets both shapes",
69
+ "```;",
70
+ " .size_mul {.y _; (Figure (_^.children & {y})).size()};",
71
+ "```",
72
+ "**Size-equivalence**, `x.size_equivalent y`: `U` when the two Sizes agree and",
73
+ "`Z` otherwise. It keeps only whether the cell counts agree",
74
+ "```;",
75
+ " .size_equivalent {((_^.size()) = (_.size())) ? {U} : {Z}};",
76
+ "```",
77
+ "**Sameness of form**, `x.sameform y`: `B` when `x = y`. It compares child by",
78
+ "child and forgets identity and reuse",
79
+ "```;",
80
+ " .sameform {(_^ = _) ? {B} : {A}};",
81
+ "```",
82
+ "**Sameness**, `x.sameness y`: `B` when `x === y`, the same constructed Figure.",
83
+ "It keeps identity only and forgets form",
84
+ "```;",
85
+ " .sameness {(_^ === _) ? {B} : {A}};",
86
+ "```",
87
+ "**Withness**, `x.withness [f, …]`: `B` when every f is an immediate child of x,",
88
+ "the same Figure rather than an equal-looking one. It is relative to one parent,",
89
+ "the receiver, and forgets the children's order, repeats, and everything below",
90
+ "them. A requested Figure is absent when no child is identical to it",
91
+ "```;",
92
+ " .withness {.kids _^.children;",
93
+ " .absent ((_ & {.f _;",
94
+ " .found ((kids & {(_ === f) ? {f}}) | []);",
95
+ " (found = []) ? {f}}) | []);",
96
+ " (absent = []) ? {B} : {A}};",
97
+ "```",
98
+ "**Form**, `x.form()`: the plain bracket tree of x, one bracket per Figure, the",
99
+ "way 005.30c wrote Figures before they were a class. It keeps shape and order,",
100
+ "and forgets identity and the methods",
101
+ "```;",
102
+ " .form {_^.children & {_.form()}};",
103
+ "```",
104
+ "**Text**, `“” x`: the form spelled as text, so a Figure interpolates as",
105
+ "`[[], [[]]]` rather than as every method it declares (#398). Printing x still",
106
+ "shows its full spelling, which reads back",
107
+ "```;",
108
+ " .toText {“” (_^.form())}",
109
+ "]};",
110
+ "```",
111
+ "**Tally** is a helper receiver, not a Figure. Its `row` starts at `Z`, and",
112
+ "applying a tally to it appends that tally's units, one at a time, through",
113
+ "`x y`, so a reduce into `Tally Z` adds counts",
114
+ "```",
115
+ ".Tally {[.row _; .apply {Tally (_.children | _^.row)}]};",
116
+ "```",
117
+ "## Construction",
118
+ "",
119
+ "The example family reuses one `A` under both `B` and `E`. Indexing reaches a",
120
+ "child itself, not a copy",
121
+ "```",
122
+ "; .A (Figure []); .B (Figure [A]); .C (Figure [B]); .D (Figure [C]);",
123
+ "; .E (Figure [A, B]); .F (Figure [B, C]); .G (Figure [E, F]);",
124
+ "; [(G.children .0) === E, (E.children .1) === B, (F.children .0) === B, (E.children .0) === (B.children .0)]",
125
+ "# [<>, <>, <>, <>]",
126
+ "```",
127
+ "Form is the bracket tree a Figure is built as, and text spells it",
128
+ "```",
129
+ "; [(E.form()) = [[], [[]]], (E.form()) = [A.form(), B.form()], ((Figure []).form()) = []]",
130
+ "# [<>, <>, <>]",
131
+ "; [(“” E) = “[[], [[]]]”, (“G is ” G) = “G is [[[], [[]]], [[[]], [[[]]]]]”]",
132
+ "# [<>, <>]",
133
+ "```",
134
+ "Equal children make equal Figures, but each construction is a different Figure",
135
+ "```",
136
+ "; [E = (Figure [A, B]), E == (Figure [A, B]), E === (Figure [A, B]), E = (Figure [B, A])]",
137
+ "# [<>, <>, (), ()]",
138
+ "```",
139
+ "Application appends one child and leaves the receiver alone, so a reduce into",
140
+ "an empty Figure constructs, and a map extends one Figure per element",
141
+ "```",
142
+ "; [(E B) = (Figure [A, B, B]), ((E B).children .2) === B, E = (Figure [A, B])]",
143
+ "# [<>, <>, <>]",
144
+ "; [([A, B] | (Figure [])) = E, ([A, B] | (Figure [])) === E]",
145
+ "# [<>, ()]",
146
+ "; ([A, B] & (Figure [C])) = [Figure [C, A], Figure [C, B]]",
58
147
  "# <>",
59
- "; (many E) = (many B)",
60
- "# ()",
61
- "```",
62
- "Size is recursive cell volume, not immediate Manyness. `Z` reuses `A` as the",
63
- "additive zero and `U` reuses `B` as the unit cell, the same mark Manyness uses.",
64
- "Size answers a tally, one `U` for every unit cell, so a count is itself a Figure",
65
- "of units, and the two observers agree on a flat row of units and part on",
66
- "nesting. `cat` adds two tallies by reducing one into the other, which collects",
67
- "into a fresh row and writes neither. `Tally` is a receiver that declares its own",
68
- "application: each row applied to it is added to the row it holds. Size maps",
69
- "every immediate child to its Size and reduces those into `Tally`. With no",
70
- "children there is nothing to reduce, so the reduce answers `Tally` itself, whose",
71
- "row is empty. The `U` case comes first because its child is `Z`. It tests form",
72
- "with `=`, so any Figure shaped like `U` is a unit cell and equal-looking Figures",
73
- "always have equal Size. HC supplies recursive control, child traversal, and",
74
- "structural `=`; Size needs no identity, and every mathematical value below is",
75
- "made only with the bracket Figure constructor",
148
+ "```",
149
+ "## Manyness and Size",
150
+ "",
151
+ "Manyness marks the immediate children and looks no deeper",
152
+ "```",
153
+ "; [(A.many()) = A, (E.many()) = (Figure [B, B]), (G.many()) = (E.many()), (E.many()) = (B.many())]",
154
+ "# [<>, <>, <>, ()]",
155
+ "```",
156
+ "Size is recursive cell volume. `Z` reuses `A` as the additive zero and `U`",
157
+ "reuses `B` as the unit cell, the same mark Manyness uses, so a count is itself a",
158
+ "Figure of units. Size maps each child to its Size and joins them into",
159
+ "`Tally Z`; the unit case comes first because a unit's only child is `Z`, and it",
160
+ "tests form, so any Figure shaped like `U` is a cell",
76
161
  "```",
77
162
  "; .Z A; .U B;",
78
- "; .cat {(_ .1) | (_ .0)};",
79
- "; .Tally [.row Z; .apply_ {@row (cat [row, _]);}];",
80
- "; .size {(_ = U) ? {[U]} : {((__ & {size _}) | Tally) .row}};",
81
- "; size Z",
82
- "# []",
83
- "; size U",
84
- "# [[[]]]",
85
- "; (size [U]) = (size [[A]])",
86
- "# <>",
87
- "; .row4 [U, U, U, U];",
88
- "; (size row4) = row4",
163
+ "; [(Z.size()) = Z, (U.size()) = (Figure [U]), ((Figure [U]).size()) = ((Figure [Figure [A]]).size())]",
164
+ "# [<>, <>, <>]",
165
+ "; .row2 (Figure [U, U]); .row3 (Figure [U, U, U]); .row4 (Figure [U, U, U, U]);",
166
+ "; .deep4 (Figure [Figure [Figure [row4]]]); .two_fours (Figure [row4, row4]);",
167
+ "; [(row4.size()) = row4, (deep4.size()) = row4, (two_fours.size()) = (row4.children | row4)]",
168
+ "# [<>, <>, <>]",
169
+ "; [(row4.many()) = (row4.size()), (deep4.many()) = (deep4.size()), (two_fours.many()) = row2]",
170
+ "# [<>, (), <>]",
171
+ "; ((Tally Z).row) = Z",
89
172
  "# <>",
90
- "; .deep4 [[[row4]]];",
91
- "; (size deep4) = row4",
92
- "# <>",
93
- "; [(many row4) = (size row4), (many deep4) = (size deep4)]",
94
- "# [<>, ()]",
95
- "; .two_fours [row4, row4];",
96
- "; size two_fours",
97
- "# [[[]], [[]], [[]], [[]], [[]], [[]], [[]], [[]]]",
98
- "; [(size two_fours) = (cat [row4, row4]), row4 = [U, U, U, U], many two_fours]",
99
- "# [<>, <>, [[[]], [[]]]]",
100
- "; Tally .row",
101
- "# []",
102
- "```",
103
- "A tally is its own Size, so Size is idempotent: every count it answers",
104
- "represents the class it names",
105
- "```",
106
- "; (size (size two_fours)) = (size two_fours)",
173
+ "```",
174
+ "A tally is its own Size, so Size is idempotent",
175
+ "```",
176
+ "; ((two_fours.size()).size()) = (two_fours.size())",
107
177
  "# <>",
108
178
  "```",
109
- "The semiring carrier is not raw Figures under structural or identity equality.",
110
- "Let `F` be the finite, well-founded Figures made with the bracket, with the",
111
- "form of `U` as the unit cell, and write `x ≈ y` when `(size x) = (size y)`.",
112
- "The carrier is the quotient `F/≈`; HC's structural `=` compares the tallies",
113
- "Size answers. Because Size reads only form, `x = y` implies `x ≈ y`. Its zero",
114
- "and one are `Z` and `U`. Addition constructs `Figure(x, y)`. Multiplication maps",
115
- "every cell of `size x` to `y`, so a product reuses `y` once for every cell of",
116
- "`x` while every result remains a Figure. A product by `Z` is `Z`, because one",
117
- "row of nothing would be `[Z]`, which has the form of `U` and would count as a",
118
- "cell. On tallies, `size_mul` is the same map followed by Size",
119
- "```",
120
- "; .figure_add {[(_ .0), (_ .1)]};",
121
- "; .figure_mul {.y (_ .1); (y = Z) ? {Z} : {(size (__ .0)) & {y}}};",
122
- "; .size_mul {size ((_ .0) & {__ .1})};",
123
- "; .size_equivalent {((size (_ .0)) = (size (_ .1))) ? {U} : {Z}};",
124
- "; [figure_mul [U, Z], size [Z]]",
125
- "# [[], [[[]]]]",
179
+ "## The semiring",
180
+ "",
181
+ "The carrier is not raw Figures. Let `F` be the finite, well-founded Figures,",
182
+ "with the form of `U` as the unit cell, and write `x ≈ y` when",
183
+ "`(x.size()) = (y.size())`. The carrier is the quotient `F/≈`, with zero `Z` and",
184
+ "one `U`. Addition is construction, `Figure [x, y]`. Multiplication maps every",
185
+ "cell of `x.size()` to `y`, so a product reuses `y` once per cell of `x`. A",
186
+ "product by `Z` is `Z`, because one row of nothing, `Figure [Z]`, has the form of",
187
+ "`U` and would count as a cell",
188
+ "```",
189
+ "; [(U.mul Z) = Z, ((Figure [Z]).size()) = (Figure [U])]",
190
+ "# [<>, <>]",
126
191
  "```",
127
192
  "A non-square product is two occurrences of one three-cell row, and both",
128
- "positions reuse the same `row3`. Manyness sees two rows, while Size counts six",
129
- "unit cells",
193
+ "positions are the same `row3`. Manyness sees two rows, while Size counts six",
130
194
  "```",
131
- "; .row2 [U, U]; .row3 [U, U, U];",
132
- "; .rectangle23 (figure_mul [row2, row3]);",
133
- "; rectangle23 = [row3, row3]",
134
- "# <>",
135
- "; [(rectangle23 .0) === row3, (rectangle23 .1) === row3]",
195
+ "; .rectangle23 (row2.mul row3);",
196
+ "; [rectangle23 = (Figure [row3, row3]), (rectangle23.children .0) === row3, (rectangle23.children .1) === row3]",
197
+ "# [<>, <>, <>]",
198
+ "; [(rectangle23.many()) = row2, (rectangle23.size()) = (Figure [U, U, U, U, U, U])]",
136
199
  "# [<>, <>]",
137
- "; size rectangle23",
138
- "# [[[]], [[]], [[]], [[]], [[]], [[]]]",
139
200
  "```",
140
- "The defining equations are executable: Size takes Figure addition to `cat`,",
141
- "and Figure multiplication to `size_mul`. Therefore both recipes respect `≈`;",
142
- "the representative checks also use differently nested, equal-Size inputs",
201
+ "Size takes construction to joining and multiplication to `size_mul`, so both",
202
+ "recipes respect `≈`; the checks also use differently nested, equal-Size inputs",
143
203
  "```",
144
- "; [(size (figure_add [row2, row3])) = (cat [size row2, size row3]), (size rectangle23) = (size_mul [size row2, size row3])]",
204
+ "; [((Figure [row2, row3]).size()) = (Figure [U, U, U, U, U]), (rectangle23.size()) = ((row2.size()).size_mul (row3.size()))]",
145
205
  "# [<>, <>]",
146
- "; .deep2 [[row2]]; .deep3 [[[row3]]];",
147
- "; [size_equivalent [row2, deep2], size_equivalent [row3, deep3], size_equivalent [figure_add [row2, row3], figure_add [deep2, deep3]], size_equivalent [figure_mul [row2, row3], figure_mul [deep2, deep3]]]",
148
- "# [[[]], [[]], [[]], [[]]]",
149
- "```",
150
- "Tallies are the natural numbers in unary, one row of `n` units for each count",
151
- "`n`, with `cat` as addition and `size_mul` as multiplication. Induction gives",
152
- "additive identity, associativity and commutativity; multiplicative identity,",
153
- "associativity and commutativity; both distributive laws; and both zero",
154
- "annihilations. Transport along Size proves those laws on `F/≈`. The raw product",
155
- "is not commutative: it maps over the Size of its left operand and reuses its",
156
- "right operand whole, so `row2` by `row3` is two rows of three, `row3` by `row2`",
157
- "is three rows of two, and they agree only in Size. These executed instances",
158
- "witness every law without replacing the inductive proof",
159
- "```",
160
- "; [(figure_mul [row2, row3]) = (figure_mul [row3, row2]), size_equivalent [figure_mul [row2, row3], figure_mul [row3, row2]]]",
161
- "# [(), [[]]]",
162
- "; [size_equivalent [figure_add [Z, row2], row2], size_equivalent [figure_add [row2, Z], row2]]",
163
- "# [[[]], [[]]]",
164
- "; [size_equivalent [figure_mul [U, row2], row2], size_equivalent [figure_mul [row2, U], row2]]",
165
- "# [[[]], [[]]]",
166
- "; [size_equivalent [figure_add [figure_add [row2, row3], row4], figure_add [row2, figure_add [row3, row4]]], size_equivalent [figure_add [row2, row3], figure_add [row3, row2]]]",
167
- "# [[[]], [[]]]",
168
- "; size_equivalent [figure_mul [figure_mul [row2, row3], row4], figure_mul [row2, figure_mul [row3, row4]]]",
169
- "# [[]]",
170
- "; [size_equivalent [figure_mul [row2, figure_add [row3, row4]], figure_add [figure_mul [row2, row3], figure_mul [row2, row4]]], size_equivalent [figure_mul [figure_add [row2, row3], row4], figure_add [figure_mul [row2, row4], figure_mul [row3, row4]]]]",
171
- "# [[[]], [[]]]",
172
- "; [size_equivalent [figure_mul [Z, row3], Z], size_equivalent [figure_mul [row3, Z], Z]]",
173
- "# [[[]], [[]]]",
174
- "```",
175
- "Sameness has two rungs. Sameness of form is `=`, and sameness of the",
176
- "constructed Figure is `===`, which 30c recorded as unanswerable in v0.16.0",
177
- "```",
178
- "; .sameform {((_ .0) = (_ .1)) ? {B} : {A}};",
179
- "; .sameness {((_ .0) === (_ .1)) ? {B} : {A}};",
180
- "; sameform [B, [A]]",
181
- "# [[]]",
182
- "; sameness [B, B]",
183
- "# [[]]",
184
- "; sameness [B, [A]]",
185
- "# []",
186
- "; sameness [(E .0), A]",
187
- "# [[]]",
188
- "; .B2 [A];",
189
- "; [B = B2, B == B2, B === B2]",
190
- "# [<>, <>, ()]",
206
+ "; .deep2 (Figure [Figure [row2]]); .deep3 (Figure [Figure [Figure [row3]]]);",
207
+ "; [row2.size_equivalent deep2, row3.size_equivalent deep3, (Figure [row2, row3]).size_equivalent (Figure [deep2, deep3]), (row2.mul row3).size_equivalent (deep2.mul deep3)] = [U, U, U, U]",
208
+ "# <>",
191
209
  "```",
192
- "Withness asks whether all requested Figures are immediate children of one",
193
- "parent. It uses identity `===`, not equal-looking form: `B` is reused under both",
194
- "`E` and `F`, while the separately constructed `B2` is not a child of either",
195
- "```",
196
- "; .absent {(figs & {(((parent & {(_ === __) ? {[<>]}}) | []) = []) ? {[<>]}}) | []};",
197
- "; .withness {((absent _) = []) ? {B} : {A}};",
198
- "; withness [.parent E; .figs [A, B];]",
199
- "# [[]]",
200
- "; withness [.parent F; .figs [A, B];]",
201
- "# []",
202
- "; withness [.parent G; .figs [E, F];]",
203
- "# [[]]",
204
- "; withness [.parent E; .figs [B2];]",
205
- "# []",
206
- "```",
207
- "Both edges follow from the empty reduce answering its receiver. An empty parent",
208
- "holds nothing, so no Figure is with it; and every one of no Figures is a child of",
209
- "any parent, so asking about none answers yes",
210
- "```",
211
- "; [withness [.parent A; .figs [B];], withness [.parent B; .figs [];]]",
212
- "# [[], [[]]]",
213
- "```",
214
- "The Fano construction starts with seven Figures of identical form: each original",
215
- "is a fresh `[]`, so all seven triples below have the same form `[[], [], []]`.",
216
- "The incidence pattern lives only in which originals each triple reuses, and",
217
- "Withness checks that common immediate containment by identity. Under structural",
218
- "`=` every original would be a child of every triple. `b_copy` is one more fresh",
219
- "`[]`, equal in form to every original and a child of no triple",
220
- "```",
221
- "; .a []; .b []; .c []; .d []; .e []; .f []; .g [];",
222
- "; .originals [a, b, c, d, e, f, g];",
223
- "; .abd [a, b, d]; .bce [b, c, e]; .cdf [c, d, f];",
224
- "; .deg [d, e, g]; .efa [e, f, a]; .fgb [f, g, b]; .gac [g, a, c];",
225
- "; .fano [abd, bce, cdf, deg, efa, fgb, gac];",
226
- "; .Three [U, U, U];",
227
- "; [many originals, (many originals) = (many fano)]",
228
- "# [[[[]], [[]], [[]], [[]], [[]], [[]], [[]]], <>]",
229
- "; (fano & {many _}) = (fano & {Three})",
210
+ "Tallies are the natural numbers in unary, so induction gives every semiring law",
211
+ "on tallies, and transport along Size gives them on `F/≈`. The raw product is not",
212
+ "commutative: `row2` by `row3` is two rows of three, `row3` by `row2` three rows",
213
+ "of two, and they agree only in Size. These instances witness each law without",
214
+ "replacing the proof",
215
+ "```",
216
+ "; [(row2.mul row3) = (row3.mul row2), ((row2.mul row3).size_equivalent (row3.mul row2)) = U]",
217
+ "# [(), <>]",
218
+ "; [(Figure [Z, row2]).size_equivalent row2, (Figure [row2, Z]).size_equivalent row2, (U.mul row2).size_equivalent row2, (row2.mul U).size_equivalent row2] = [U, U, U, U]",
230
219
  "# <>",
231
- "; [abd = bce, abd === bce]",
232
- "# [<>, ()]",
233
- "; [sameform [a, b], sameness [a, b], sameness [b, b]]",
234
- "# [[[]], [], [[]]]",
235
- "; .b_copy [];",
236
- "; b = b_copy",
220
+ "; [(Figure [Figure [row2, row3], row4]).size_equivalent (Figure [row2, Figure [row3, row4]]), (Figure [row2, row3]).size_equivalent (Figure [row3, row2])] = [U, U]",
221
+ "# <>",
222
+ "; (((row2.mul row3).mul row4).size_equivalent (row2.mul (row3.mul row4))) = U",
223
+ "# <>",
224
+ "; [(row2.mul (Figure [row3, row4])).size_equivalent (Figure [row2.mul row3, row2.mul row4]), ((Figure [row2, row3]).mul row4).size_equivalent (Figure [row2.mul row4, row3.mul row4])] = [U, U]",
225
+ "# <>",
226
+ "; [(Z.mul row3).size_equivalent Z, (row3.mul Z).size_equivalent Z] = [U, U]",
227
+ "# <>",
228
+ "```",
229
+ "## Sameness and Withness",
230
+ "",
231
+ "Sameness of form is `=` and sameness of the constructed Figure is `===`",
232
+ "```",
233
+ "; .B2 (Figure [A]);",
234
+ "; [B.sameform B2, B.sameness B, B.sameness B2, (E.children .0).sameness A] = [B, B, A, B]",
235
+ "# <>",
236
+ "```",
237
+ "Withness asks whether every requested Figure is an immediate child of the",
238
+ "receiver, by identity rather than form: `B` is reused under both `E` and `F`,",
239
+ "while the separately constructed `B2` is a child of neither. An empty parent",
240
+ "holds nothing, and every one of no Figures is a child of any parent",
241
+ "```",
242
+ "; [E.withness [A, B], F.withness [A, B], G.withness [E, F], E.withness [B2]] = [B, A, B, A]",
237
243
  "# <>",
238
- "; sameness [b, b_copy]",
239
- "# []",
240
- "; withness [.parent abd; .figs [a, b, d];]",
241
- "# [[]]",
242
- "; withness [.parent abd; .figs [a, c];]",
243
- "# []",
244
- "; withness [.parent abd; .figs [b_copy];]",
245
- "# []",
246
- "```",
247
- "Incidence is a table. `on` answers, for each triple, whether it holds every",
248
- "requested original, so its Size counts the triples that do. `point_table`",
249
- "applies it to every ordered pair of originals, generated with the Cartesian",
250
- "idiom of 005.30b rather than listed, so the check is exhaustive by",
251
- "construction. Two distinct originals lie in exactly one triple, and each",
252
- "original lies in three",
253
- "```",
254
- "; .on {fano & {withness [.parent _; .figs __;]}};",
255
- "; .point_table (originals & {.p _; originals & {size (on [p, _])}});",
256
- "; point_table = (originals & {.p _; originals & {(p === _) ? {Three} : {[U]}}})",
244
+ "; [A.withness [B], B.withness []] = [A, B]",
257
245
  "# <>",
258
246
  "```",
259
- "Dually, `meet` counts the originals two triples share. For each original,",
260
- "multiplying its two Figure-valued Withness answers leaves one cell exactly when",
261
- "both triples hold it. Two distinct triples share exactly one original, and each",
262
- "triple holds three. The two tables are equal, which is the plane's",
263
- "self-duality",
247
+ "## The Fano plane",
248
+ "",
249
+ "Seven originals of identical form, each a fresh `Figure []`, and seven triples",
250
+ "of identical form `[[], [], []]`. The incidence lives only in which originals",
251
+ "each triple reuses, so only Withness, by identity, can see it. `b_copy` equals",
252
+ "every original in form and is a child of no triple",
253
+ "```",
254
+ "; .a (Figure []); .b (Figure []); .c (Figure []); .d (Figure []); .e (Figure []); .f (Figure []); .g (Figure []);",
255
+ "; .originals (Figure [a, b, c, d, e, f, g]);",
256
+ "; .abd (Figure [a, b, d]); .bce (Figure [b, c, e]); .cdf (Figure [c, d, f]);",
257
+ "; .deg (Figure [d, e, g]); .efa (Figure [e, f, a]); .fgb (Figure [f, g, b]); .gac (Figure [g, a, c]);",
258
+ "; .fano (Figure [abd, bce, cdf, deg, efa, fgb, gac]);",
259
+ "; .Three (Figure [U, U, U]); .b_copy (Figure []);",
260
+ "; [(originals.many()) = (fano.many()), (fano.children & {_.many()}) = (fano.children & {Three})]",
261
+ "# [<>, <>]",
262
+ "; [abd = bce, abd === bce, b = b_copy, b === b_copy]",
263
+ "# [<>, (), <>, ()]",
264
+ "; [abd.withness [a, b, d], abd.withness [a, c], abd.withness [b_copy]] = [B, A, A]",
265
+ "# <>",
264
266
  "```",
265
- "; .meet {size (originals & {figure_mul [withness [.parent (__ .0); .figs [_];], withness [.parent (__ .1); .figs [_];]]})};",
266
- "; .line_table (fano & {.l _; fano & {meet [l, _]}});",
267
- "; line_table = (fano & {.l _; fano & {(l === _) ? {Three} : {[U]}}})",
267
+ "`on` answers one Withness mark per triple, so its Size counts the triples that",
268
+ "hold every requested original. Over every ordered pair, generated rather than",
269
+ "listed, two distinct originals lie in exactly one triple and each lies in three",
270
+ "```",
271
+ "; .on {.points _; Figure (fano.children & {_.withness points})};",
272
+ "; .point_table (originals.children & {.p _; originals.children & {(on [p, _]).size()}});",
273
+ "; point_table = (originals.children & {.p _; originals.children & {(p === _) ? {Three} : {Figure [U]}}})",
268
274
  "# <>",
269
- "; point_table = line_table",
275
+ "```",
276
+ "Dually, `meet` counts the originals two triples share: multiplying their two",
277
+ "Withness marks leaves one cell exactly when both hold it. The two tables are",
278
+ "equal, which is the plane's self-duality",
279
+ "```",
280
+ "; .meet {.lines _; (Figure (originals.children & {.o _; ((lines .0).withness [o]).mul ((lines .1).withness [o])})).size()};",
281
+ "; .line_table (fano.children & {.l _; fano.children & {meet [l, _]}});",
282
+ "; [line_table = (fano.children & {.l _; fano.children & {(l === _) ? {Three} : {Figure [U]}}}), point_table = line_table]",
283
+ "# [<>, <>]",
284
+ "```",
285
+ "`a, b, c, f` are four originals with no three in a triple",
286
+ "```",
287
+ "; ([[a, b, c], [a, b, f], [a, c, f], [b, c, f]] & {(on _).size()}) = [Z, Z, Z, Z]",
270
288
  "# <>",
271
289
  "```",
272
- "Finally `a, b, c, f` are four originals with no three in a triple. All four of",
273
- "their 3-subsets are listed, and no triple holds any of them",
274
- "```",
275
- "; [[a, b, c], [a, b, f], [a, c, f], [b, c, f]] & {size (on _)}",
276
- "# [[], [], [], []]",
277
- "```",
278
- "Both results use the bracket as their sole `Figure(children...)` constructor.",
279
- "HC, not the Figure theory, supplies child addressing and `&`/`|` traversal,",
280
- "closure calls, recursion and conditional control, fresh aggregate allocation,",
281
- "reference reuse and copy-on-write behavior, structural `=`, and identity",
282
- "`===`. The corpus derives Manyness, Size, Size-equivalence, the Figure-valued",
283
- "operations, Sameness, Withness, and the finite incidence checks from those",
284
- "services. The semiring uses only form; identity enters where the Fano pattern",
285
- "needs it, in Sameness and Withness. Multiplication invokes no copy primitive:",
286
- "its identity assertions show that it reuses `row3`. `b_copy` is a fresh bracket",
287
- "construction, not a derived copy operation. Neither the semiring laws nor the",
288
- "Fano pattern is claimed for arbitrary Figure observations outside the stated",
289
- "quotient and construction.",
290
- "Observation does not mutate, even with a local name inside a map",
291
- "```",
292
- "; E = [A, B]",
290
+ "## Closure",
291
+ "",
292
+ "Every answer is a Figure, so it can be observed again or become a child, and",
293
+ "observing does not mutate, even with a local name inside a map",
294
+ "```",
295
+ "; [((E.many()).many()) = (E.many()), ((Figure [E.many(), F.size()]).size()) = row4]",
296
+ "# [<>, <>]",
297
+ "; .E5 (Figure [A, Figure [A]]);",
298
+ "; E5.children & {.o _; o};",
299
+ "; [E5 = (Figure [A, B]), A = (Figure [])]",
300
+ "# [<>, <>]",
301
+ "```",
302
+ "## Names",
303
+ "",
304
+ "A bare name inside a block that a map applies to Figures reads each Figure's",
305
+ "own members first (spec 7), so it cannot reach the method's. That is why a",
306
+ "method names its own Figure `_^` and binds `kids` before its blocks read it",
307
+ "```",
308
+ "; (E.children & {children}) = [A.children, B.children]",
293
309
  "# <>",
294
- "; .E5 [A, [A]];",
295
- "; E5 & {.o _; o};",
296
- "; E5",
297
- "# [[], [[]]]",
298
- "; A",
299
- "# []",
300
- "```",
301
- "005.30b's Cartesian product, executed verbatim. The grid is one source element,",
302
- "so `Figure` is applied once and the answer has the grid as its sole child",
303
- "```",
304
- "; .Pa [“a”, “b”]; .Pb [“c”, “d”];",
305
- "; [(Pa & { Pb & { [__, _] } })] | Figure",
306
- "# [[[[“a”, “c”], [“a”, “d”]], [[“b”, “c”], [“b”, “d”]]]]",
307
- "; (many ([(Pa & { Pb & { [__, _] } })] | Figure)) = [U]",
310
+ "```",
311
+ "A method's own locals come ahead of any binding where it is called, and a",
312
+ "Figure passed as an argument contributes only its members, never the names of",
313
+ "the scope that built it. The Fano plane above already binds `f`, the name",
314
+ "Withness uses inside its blocks; these bind the other locals",
315
+ "```",
316
+ "; .kids 9; .y 9; .cells 9; .found 9; .absent 9;",
317
+ "; [(E.withness [A, B]) = B, (row2.mul row3) = rectangle23, (E.size()) = (Figure [U])]",
318
+ "# [<>, <>, <>]",
319
+ "```",
320
+ "A method's free names resolve where the method was written, never where its",
321
+ "receiver was read (#400). So a scope that binds its own `B` and reads a Figure",
322
+ "by name there still gets the class's `B` back from Manyness",
323
+ "```",
324
+ "; .theB B;",
325
+ "; .rebinds {.B 5; .mine (Figure [A]); ((mine.many()).children .0) === theB};",
326
+ "; rebinds()",
308
327
  "# <>",
309
- "; (([(Pa & { Pb & { [__, _] } })] | Figure) .0) = (Pa & { Pb & { [__, _] } })",
328
+ "```",
329
+ "## Functional updates",
330
+ "",
331
+ "A mutating method reached through an immutable handle is a functional update,",
332
+ "and it copies only what it writes (#401). A Figure the receiver holds is never",
333
+ "written, so the result holds the very same Figure, and identity observers",
334
+ "answer about it",
335
+ "```",
336
+ "; .keeper [.fig E; .touch_ {@fig fig;}];",
337
+ "; .kept ((keeper.touch_ ()).fig);",
338
+ "; [kept === E, (kept.children .0) === A]",
339
+ "# [<>, <>]",
340
+ "; [kept.sameness kept, kept.withness [kept.children .0]] = [B, B]",
310
341
  "# <>",
311
- "; (many (Pa & { Pb & { [__, _] } })) = [U, U]",
342
+ "```",
343
+ "A write that constructs answers a new Figure, which is a Figure like any other",
344
+ "```",
345
+ "; .grower [.fig E; .grow_ {@fig (fig B);}];",
346
+ "; .grown ((grower.grow_ ()).fig);",
347
+ "; [(grown.sameness grown) = B, (grown.withness [grown.children .2]) = B, grown === E]",
348
+ "# [<>, <>, ()]",
349
+ "```",
350
+ "## Spelling",
351
+ "",
352
+ "`(x)` is `x`, so `Figure (B)` collects B's elements, of which an object with",
353
+ "only properties has none. Write `Figure [B]`",
354
+ "```",
355
+ "; [(Figure (B)) = A, (Figure [B]) = C]",
356
+ "# [<>, <>]",
357
+ "```",
358
+ "Importing this file answers its last form, which the hosts' smoke tests read,",
359
+ "so the file ends on a claim that holds however the rest of it changes",
360
+ "```",
361
+ "; (Figure [A, B]) = E",
312
362
  "# <>",
313
363
  "",
314
364
  ].join("\n"),