hclang 0.48.0 → 0.50.0
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.
- package/esm/lib/bundle/hc-sources.js +657 -625
- package/esm/lib/execute/{demi-prologue.js → denum-prologue.js} +24 -36
- package/esm/lib/execute/hc-eval.js +2 -2
- package/esm/lib/execute/resource-import.js +1 -1
- package/esm/lib/execute/router-prologue.js +16 -20
- package/esm/lib/frames/fourth-hash.js +103 -45
- package/esm/lib/frames/frame-array.js +2 -2
- package/esm/lib/frames/frame-lazy.js +1 -1
- package/esm/lib/frames/frame-name.js +10 -2
- package/esm/lib/frames/frame.js +23 -8
- package/esm/lib/frames.js +1 -1
- package/esm/lib/version.js +1 -1
- package/package.json +1 -1
|
@@ -699,8 +699,8 @@ export const HC_SOURCES = new Map([
|
|
|
699
699
|
"Sizes; schemas retain their description/alternative quantities. Other opaque",
|
|
700
700
|
"values have Size 1. `.###` alternates child Sizes on non-schema lists, or returns",
|
|
701
701
|
"Count parity (`.# mod 2`) on every other value with a Count; schemas have nil",
|
|
702
|
-
"residual, and `<>` observes as `[]`. `.####` derives a
|
|
703
|
-
"the class in `hc/
|
|
702
|
+
"residual, and `<>` observes as `[]`. `.####` derives a Denum, an instance of",
|
|
703
|
+
"the class in `hc/denum.hc`, which keeps the source's whole Count, returning nil at",
|
|
704
704
|
"zero Count or nil residual and propagating failed observations.",
|
|
705
705
|
"```",
|
|
706
706
|
"; [.meta 1; 2, 3] .#",
|
|
@@ -1637,7 +1637,7 @@ export const HC_SOURCES = new Map([
|
|
|
1637
1637
|
[
|
|
1638
1638
|
"#!/usr/bin/env hc",
|
|
1639
1639
|
"```",
|
|
1640
|
-
"
|
|
1640
|
+
"Denum constructed physical state: VACT witness and scope (Explore 022.06)",
|
|
1641
1641
|
"",
|
|
1642
1642
|
"Implements the corrected handoff in occurrence/explore 022.05a, pinned at",
|
|
1643
1643
|
"9d966bd95a783849c0363d82ee295586e0ffc6db581815b443140d746843eec8:",
|
|
@@ -1663,7 +1663,7 @@ export const HC_SOURCES = new Map([
|
|
|
1663
1663
|
"read such a host; it is outside the closed Inlay construction family. No declared hash methods, declared parents, cycles, or arbitrary",
|
|
1664
1664
|
"property-editing operations are in the uniform contract. This is a domain for",
|
|
1665
1665
|
"this construction/observation experiment, not a special ontology of pure Figures.",
|
|
1666
|
-
"Other finite Frames can have
|
|
1666
|
+
"Other finite Frames can have Denum readings; their constructor laws require their",
|
|
1667
1667
|
"own domain checks. In particular, mixed-array append is illustrated below but",
|
|
1668
1668
|
"mixed-array Star is outside this contract.",
|
|
1669
1669
|
"",
|
|
@@ -1672,15 +1672,14 @@ export const HC_SOURCES = new Map([
|
|
|
1672
1672
|
"the sum of its immediate child Sizes, and A alternates + and - across those",
|
|
1673
1673
|
"children, starting +. Properties do not enter these sums. D(X) = X.#### is",
|
|
1674
1674
|
"nil for the empty host; otherwise it has Count n, loads L = (S+A)/2, R = (S-A)/2",
|
|
1675
|
-
"and
|
|
1676
|
-
"
|
|
1677
|
-
"the phase is its parity. Nesting, identities, properties and the distribution",
|
|
1675
|
+
"and the next load is n %% 2. Read these with `.count` (or `.#`), `.loads .0`,",
|
|
1676
|
+
"`.loads .1` and `.# %% 2`. n is kept whole (007.25c). Nesting, identities, properties and the distribution",
|
|
1678
1677
|
"within each load are forgotten.",
|
|
1679
1678
|
"```",
|
|
1680
1679
|
"; .E []; .X [[], [[], []], []];",
|
|
1681
1680
|
"; [E.#, E.##, E.###, E.####]",
|
|
1682
1681
|
"# [0, 1, 0, ()]",
|
|
1683
|
-
"; [X.#, X.##, X.###, X
|
|
1682
|
+
"; [X.#, X.##, X.###, X.#### .# %% 2, X.#### .loads .0, X.#### .loads .1]",
|
|
1684
1683
|
"# [3, 4, 0, 1, 2, 2]",
|
|
1685
1684
|
"; .decorated [.label 99; [], [[], []], []];",
|
|
1686
1685
|
"; [decorated.#### = X.####, decorated.label, X.#### = X.####]",
|
|
@@ -1693,7 +1692,7 @@ export const HC_SOURCES = new Map([
|
|
|
1693
1692
|
"```",
|
|
1694
1693
|
"Generation and selective compression",
|
|
1695
1694
|
"",
|
|
1696
|
-
"No
|
|
1695
|
+
"No Denum is initialized when building X. The native reading derives from the",
|
|
1697
1696
|
"constructed host. Equal readings can hide different nesting, while another",
|
|
1698
1697
|
"construction gives a different reading. The reading keeps the Count, so two",
|
|
1699
1698
|
"hosts with the same loads and phase but different Counts have different",
|
|
@@ -1703,10 +1702,10 @@ export const HC_SOURCES = new Map([
|
|
|
1703
1702
|
"; [A = B, A.#### = B.####, A.#### === B.####]",
|
|
1704
1703
|
"# [(), <>, ()]",
|
|
1705
1704
|
"; .C [[[], []], [[], []]]; .F [[], [], [], []];",
|
|
1706
|
-
"; [C.#, F.#, C = F, C.#### = F.####, C
|
|
1705
|
+
"; [C.#, F.#, C = F, C.#### = F.####, (C.#### .loads .0) = (F.#### .loads .0), (C.#### .loads .1) = (F.#### .loads .1), (C.#### .# %% 2) = (F.#### .# %% 2), A.#### = C.####]",
|
|
1707
1706
|
"# [2, 4, (), (), <>, <>, <>, ()]",
|
|
1708
1707
|
"; [“” A.####, “” C.####, “” F.####, “” [[], [[], []]].####]",
|
|
1709
|
-
"# [“
|
|
1708
|
+
"# [“Denum(1,[1, 0])”, “Denum(2,[2, 2])”, “Denum(4,[2, 2])”, “Denum(2,[1, 2])”]",
|
|
1710
1709
|
"```",
|
|
1711
1710
|
"Uniform append and Inlay, including successive compositions",
|
|
1712
1711
|
"",
|
|
@@ -1720,7 +1719,7 @@ export const HC_SOURCES = new Map([
|
|
|
1720
1719
|
"; [(A Y).#### = (A.#### Y), (C Y).#### = (C.#### Y), (X Y).#### = (X.#### Y)]",
|
|
1721
1720
|
"# [<>, <>, <>]",
|
|
1722
1721
|
"; [“” (A Y).####, “” (C Y).####, “” ((C Y) []).####]",
|
|
1723
|
-
"# [“
|
|
1722
|
+
"# [“Denum(2,[1, 3])”, “Denum(3,[5, 2])”, “Denum(4,[5, 3])”]",
|
|
1724
1723
|
"; ([5, “ab”] []).#### = ([5, “ab”].#### [])",
|
|
1725
1724
|
"# <>",
|
|
1726
1725
|
"```",
|
|
@@ -1742,41 +1741,41 @@ export const HC_SOURCES = new Map([
|
|
|
1742
1741
|
"```",
|
|
1743
1742
|
"Origin and channel names",
|
|
1744
1743
|
"",
|
|
1745
|
-
"The empty host has no
|
|
1744
|
+
"The empty host has no Denum, despite Size 1. Its first append generates a",
|
|
1746
1745
|
"present reading. Applying nil is not the append update; a zero-load phase-2",
|
|
1747
|
-
"
|
|
1746
|
+
"Denum of Count zero is an explicit initialized-router convention, not a",
|
|
1748
1747
|
"preconstruction state secretly stored in []. A zero Size deposit still adds one",
|
|
1749
1748
|
"to the Count and so changes routing phase.",
|
|
1750
1749
|
"```",
|
|
1751
|
-
"; [([] [])
|
|
1750
|
+
"; [([] []).#### .# %% 2, ([] []).#### .loads .0, ([] []).#### .loads .1]",
|
|
1752
1751
|
"# [1, 1, 0]",
|
|
1753
1752
|
"; [([] Y).#### = ([].#### Y), ([] * Y).#### = Y.####]",
|
|
1754
1753
|
"# [(), <>]",
|
|
1755
|
-
";
|
|
1756
|
-
"; ([] Y).#### = ((
|
|
1754
|
+
"; Denums <- './hc/denum.hc';",
|
|
1755
|
+
"; ([] Y).#### = ((Denums.Denum [0, [0, 0]]) Y)",
|
|
1757
1756
|
"# <>",
|
|
1758
|
-
"; [“” [0].####, “” ([0].#### 0), [].#### = [0].####, [].#### = (
|
|
1759
|
-
"# [“
|
|
1757
|
+
"; [“” [0].####, “” ([0].#### 0), [].#### = [0].####, [].#### = (Denums.Denum [0, [0, 0]]), (Denums.Denum [0, [0, 0]]).#### = (Denums.Denum [0, [0, 0]])]",
|
|
1758
|
+
"# [“Denum(1,[0, 0])”, “Denum(2,[0, 0])”, (), (), <>]",
|
|
1760
1759
|
"```",
|
|
1761
1760
|
"For a proposed relabeling, exchange the loads AND toggle which named channel",
|
|
1762
1761
|
"is next: J(n,L,R) = (n+1,R,L). Toggling the phase changes the parity of the",
|
|
1763
|
-
"Count, and a
|
|
1762
|
+
"Count, and a Denum derives its phase from its Count, so the relabeling moves the",
|
|
1764
1763
|
"Count by one rather than leaving it fixed; the Count has no mirror image of its",
|
|
1765
1764
|
"own. Total load stays fixed and residual changes sign. J commutes with deposit",
|
|
1766
1765
|
"and scale; this is equivariance of a named router representation, not",
|
|
1767
1766
|
"invariance of its signed readout, not reversal of the host, and not a new native",
|
|
1768
1767
|
"constructor. Applying J twice returns the loads and the phase, with the Count",
|
|
1769
1768
|
"two higher, so it is an involution on phase and loads and not on Count. The",
|
|
1770
|
-
"following closure only checks that explicit relabeling using the existing
|
|
1769
|
+
"following closure only checks that explicit relabeling using the existing Denum",
|
|
1771
1770
|
"class.",
|
|
1772
1771
|
"```",
|
|
1773
|
-
"; .swap {.d _;
|
|
1772
|
+
"; .swap {.d _; Denums.Denum [(d.count + 1), [d.loads .1, d.loads .0]]};",
|
|
1774
1773
|
"; .q [[], [[], []]].####;",
|
|
1775
1774
|
"; [“” q, “” (swap q), (swap q).## = q.##, (swap q).### = (0 - q.###)]",
|
|
1776
|
-
"# [“
|
|
1775
|
+
"# [“Denum(2,[1, 2])”, “Denum(3,[2, 1])”, <>, <>]",
|
|
1777
1776
|
"; [(swap (q Y)) = ((swap q) Y), (swap ((q Y) [])) = (((swap q) Y) []), (swap (q.scale_ 3)) = ((swap q).scale_ 3)]",
|
|
1778
1777
|
"# [<>, <>, <>]",
|
|
1779
|
-
"; [(swap (swap q))
|
|
1778
|
+
"; [((swap (swap q)).# %% 2) = (q.# %% 2), ((swap (swap q)).loads .0) = (q.loads .0), ((swap (swap q)).loads .1) = (q.loads .1), (swap (swap q)).count = (q.count + 2), (swap (swap q)) = q]",
|
|
1780
1779
|
"# [<>, <>, <>, <>, ()]",
|
|
1781
1780
|
"```",
|
|
1782
1781
|
"Future sufficiency, at its earned scope",
|
|
@@ -1812,7 +1811,7 @@ export const HC_SOURCES = new Map([
|
|
|
1812
1811
|
"position repeats only in parity, S by counting all",
|
|
1813
1812
|
"terminal sticks, and A by subtracting the bin populations. No separately",
|
|
1814
1813
|
"supplied state vector or stochastic routing law is needed. The empty host's",
|
|
1815
|
-
"one terminal stick is not an immediate child deposit: report no
|
|
1814
|
+
"one terminal stick is not an immediate child deposit: report no Denum until",
|
|
1816
1815
|
"construction places a first child. A physical pointer's initial left choice",
|
|
1817
1816
|
"is part of this selected measurement convention.",
|
|
1818
1817
|
"",
|
|
@@ -1836,13 +1835,13 @@ export const HC_SOURCES = new Map([
|
|
|
1836
1835
|
"Five-criterion verdict and evidence scope",
|
|
1837
1836
|
"",
|
|
1838
1837
|
"1. Derived: VACTED by execution for the examples; uniformly vacted under the",
|
|
1839
|
-
" construction/observer contract. Hosts are built before their
|
|
1838
|
+
" construction/observer contract. Hosts are built before their Denum is read.",
|
|
1840
1839
|
"2. Compressive: VACTED by distinct equal-reading constructions. Representation",
|
|
1841
1840
|
" has three unbounded Counts, n, L and R, with the phase derived from n; fixed",
|
|
1842
1841
|
" dimension is not bounded bits.",
|
|
1843
1842
|
"3. Forced update: VACTED by execution for the displayed compositions; uniformly",
|
|
1844
1843
|
" vacted by the append and substitution recipes on the declared domain.",
|
|
1845
|
-
"4. Origin: VACTED for no supplied host
|
|
1844
|
+
"4. Origin: VACTED for no supplied host Denum and the first-construction boundary.",
|
|
1846
1845
|
" Channel relabeling is CONDITIONALLY VACTED as the explicit router",
|
|
1847
1846
|
" equivariance above. Full origin/gauge invariance is NOT YET VACTED.",
|
|
1848
1847
|
"5. Earned forgetting: uniformly vacted for the specified future constructor",
|
|
@@ -1929,117 +1928,120 @@ export const HC_SOURCES = new Map([
|
|
|
1929
1928
|
].join("\n"),
|
|
1930
1929
|
],
|
|
1931
1930
|
[
|
|
1932
|
-
"hc/
|
|
1931
|
+
"hc/denum.hc",
|
|
1933
1932
|
[
|
|
1934
1933
|
"#!/usr/bin/env hc",
|
|
1935
1934
|
"```",
|
|
1936
|
-
"
|
|
1935
|
+
"Denum (occurrence/figure 011.20, 007.25c)",
|
|
1937
1936
|
"",
|
|
1938
|
-
"A
|
|
1939
|
-
"Applying a
|
|
1940
|
-
"
|
|
1941
|
-
"
|
|
1942
|
-
"
|
|
1943
|
-
"
|
|
1937
|
+
"A Denum is a closed state of k ordered channels, k ≥ 1: a Count and k loads.",
|
|
1938
|
+
"Applying a Denum to a Frame deposits that Frame's Size into load `C mod k` and",
|
|
1939
|
+
"adds one to the Count, so a Denum follows round-robin construction one",
|
|
1940
|
+
"observation at a time and remembers how many it has seen. Every arity is the",
|
|
1941
|
+
"same class, with the same fields, methods and text; two loads are not a special",
|
|
1942
|
+
"case. It is what the fourth hash answers: `x.####` is the Denum of x's Count,",
|
|
1943
|
+
"Size and residual, with Count x.# and the two loads (Size + residual)/2 and",
|
|
1944
1944
|
"(Size − residual)/2.",
|
|
1945
1945
|
"",
|
|
1946
|
-
"`
|
|
1946
|
+
"`Denum` is an ordinary HC class: a constructor closure answering a fresh",
|
|
1947
1947
|
"aggregate whose fields are its state and whose methods are the class. Nothing",
|
|
1948
1948
|
"about it is native. The fourth hash keeps only its derivation and builds its",
|
|
1949
1949
|
"answer with this constructor, which the evaluator reads from this file, compiled",
|
|
1950
1950
|
"in, the first time `.####` needs one. So this file is both the definition every",
|
|
1951
1951
|
"evaluator uses and its specification, and it works without a resource root.",
|
|
1952
|
-
"Import it to construct
|
|
1953
|
-
"`
|
|
1954
|
-
"",
|
|
1955
|
-
"**State (007.25c).**
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
"is the full application Count the state has recorded, not its parity, so",
|
|
1959
|
-
"`
|
|
1960
|
-
"
|
|
1961
|
-
"
|
|
1962
|
-
"`
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
"
|
|
1966
|
-
"",
|
|
1967
|
-
"
|
|
1968
|
-
"
|
|
1969
|
-
"
|
|
1970
|
-
"
|
|
1971
|
-
"
|
|
1972
|
-
"
|
|
1973
|
-
"
|
|
1974
|
-
"
|
|
1975
|
-
"",
|
|
1976
|
-
"
|
|
1977
|
-
"Count `C`, its total load `L+R` and the signed difference `L−R`. An aggregate",
|
|
1978
|
-
"otherwise observes its elements, and a Demi has none, so without these it",
|
|
1952
|
+
"Import it to construct Denums directly: `Denums <- './hc/denum.hc'`, then",
|
|
1953
|
+
"`Denums.Denum [0, [0, 0]]`.",
|
|
1954
|
+
"",
|
|
1955
|
+
"**State (007.25c, 007.40).** A Denum stores exactly two fields: `count`, the",
|
|
1956
|
+
"Count `C`, and `loads`, its ordered loads. Nothing else is stored, so nothing",
|
|
1957
|
+
"can disagree with them. `d.count` and `d.#` are `C`, and `d.loads` is the list.",
|
|
1958
|
+
"`C` is the full application Count the state has recorded, not its parity, so",
|
|
1959
|
+
"`Denum [2, [5, 1]]` and `Denum [4, [5, 1]]` are different states with the same",
|
|
1960
|
+
"loads. Two Denums are `=` exactly when their Count and loads are.",
|
|
1961
|
+
"",
|
|
1962
|
+
"**Constructor forms.** `Denum [C, loads]` takes a Count and a nonempty list of",
|
|
1963
|
+
"Counts, any of them zero. `Denum [loads]`, a single list, is the default-Count",
|
|
1964
|
+
"form with `C = 1` (007.40): `Denum [[2, 5]]` is `Denum [1, [2, 5]]`. It is a",
|
|
1965
|
+
"constructor convention, not a claim that the state was reached by one",
|
|
1966
|
+
"application, and an explicit Count always wins, so `Denum [0, [2, 5]]` keeps",
|
|
1967
|
+
"Count zero. There is no other form: the three-argument `Denum [C, L, R]` of",
|
|
1968
|
+
"earlier versions is refused too. Anything else is refused with",
|
|
1969
|
+
"`$!!.invalid-denum`, a named error, as Figures refuses an unsupported host. A host declaration such as",
|
|
1970
|
+
"`(.# C;)` is not a constructor option. `Denum [0, [0]]` is the neutral start of",
|
|
1971
|
+
"arity one, `Denum [0, [0, 0]]` of arity two.",
|
|
1972
|
+
"",
|
|
1973
|
+
"**Observers.** A Denum declares its own Count, Size and residual (011.20): its",
|
|
1974
|
+
"Count `C`, the sum of its loads and their alternating sum `e0 − e1 + e2 − …`,",
|
|
1975
|
+
"the list residual, which for two loads is `L − R`. An aggregate",
|
|
1976
|
+
"otherwise observes its elements, and a Denum has none, so without these it",
|
|
1979
1977
|
"would observe as 0, 1, 0. Its fourth hash is not declared: no class can",
|
|
1980
1978
|
"declare `.####`. The derivation from the three observers cannot tell an empty",
|
|
1981
|
-
"host from a
|
|
1982
|
-
"for either. A
|
|
1979
|
+
"host from a Denum of Count zero, because both read 0, 0, 0, and it answers nil",
|
|
1980
|
+
"for either. A Denum of Count zero is a present state, so the fourth hash",
|
|
1983
1981
|
"recognizes an instance of this class intrinsically (007.25e,",
|
|
1984
|
-
"`lib/frames/fourth-hash.ts`): a Frame whose stored `count
|
|
1985
|
-
"
|
|
1986
|
-
"answers that fresh reconstruction, an equal instance for every `C`. Nothing of",
|
|
1982
|
+
"`lib/frames/fourth-hash.ts`): a Frame whose stored `count` is a Count and whose",
|
|
1983
|
+
"stored `loads` is a nonempty list of Counts, and which is `==` to the Denum this",
|
|
1984
|
+
"constructor builds from them, answers that fresh reconstruction, an equal instance for every `C`. Nothing of",
|
|
1987
1985
|
"the source runs, so a foreign aggregate that forges `#`, `##`, `###` or a",
|
|
1988
1986
|
"`.####` method gets only the ordinary derived fourth hash. `[].####` and",
|
|
1989
1987
|
"`0.####` stay nil: those are hosts with no children, and a host with no",
|
|
1990
|
-
"children has no
|
|
1988
|
+
"children has no Denum.",
|
|
1991
1989
|
"",
|
|
1992
|
-
"**Application**, `d x`: observe x's Size once, deposit it into
|
|
1993
|
-
"
|
|
1994
|
-
"which flips the phase. A Size of zero still counts. If x has no Size, its",
|
|
1990
|
+
"**Application**, `d x`: observe x's Size once, deposit it into load",
|
|
1991
|
+
"`C mod k` and add one to the Count. A Size of zero still counts. If x has no Size, its",
|
|
1995
1992
|
"failure is the answer rather than a deposit. It is a mutating method, `apply_`,",
|
|
1996
|
-
"so through a name, `d x` is a functional update: it answers a new
|
|
1993
|
+
"so through a name, `d x` is a functional update: it answers a new Denum and",
|
|
1997
1994
|
"leaves d unchanged.",
|
|
1998
1995
|
"",
|
|
1999
|
-
"**Scaling**, `d.scale_ k`: multiply
|
|
1996
|
+
"**Scaling**, `d.scale_ k`: multiply every load by a Count k, keeping the",
|
|
2000
1997
|
"Count. It is the numerical shadow of Star: `(x * y).####` is",
|
|
2001
1998
|
"`x.####.scale_ (y.##)` for a nonempty host x, Count included. `scale_` stays,",
|
|
2002
1999
|
"as the name the fourth hash and Star correspondence use; `d * k` answers the",
|
|
2003
|
-
"same
|
|
2000
|
+
"same Denum through the operator below.",
|
|
2004
2001
|
"",
|
|
2005
2002
|
"**Arithmetic**, `d + x`, `d - x` and `d * x` (015.11). A class answers an",
|
|
2006
2003
|
"operator by declaring a method under its name, found on the operand and its",
|
|
2007
2004
|
"declared parents, the chain its other methods come from, so an operator in a",
|
|
2008
2005
|
"method body keeps its global meaning rather than recurring into the class that",
|
|
2009
|
-
"is running. All three **construct a fresh
|
|
2006
|
+
"is running. All three **construct a fresh Denum state** from the one Size",
|
|
2010
2007
|
"observation `x.##` of their operand, keeping Figure 008's distinction between",
|
|
2011
2008
|
"construction and observation. They are **fixed-channel load transformations**",
|
|
2012
|
-
"on the
|
|
2009
|
+
"on the loads, consistent with the channel loads of a `RotorRouter`",
|
|
2013
2010
|
"(`hc/rotor-router.hc`): `+` and `-` add `x.##` to one fixed channel's load the",
|
|
2014
2011
|
"way a route adds a Frame's Size to the channel it lands in, and `*` is the Star",
|
|
2015
2012
|
"shadow `scale_`. These are correspondences, not a claim that the Router",
|
|
2016
2013
|
"declares named `+`, `-` or `*` methods. None of the three is application: **all",
|
|
2017
|
-
"keep `C
|
|
2014
|
+
"keep `C`**, and each answers a fresh value and leaves `d` as it",
|
|
2018
2015
|
"was. Because they change loads without an application, they can reach a state",
|
|
2019
2016
|
"no run of applications reaches, such as `C = 0` with a nonzero load.",
|
|
2020
2017
|
"",
|
|
2021
|
-
"- `d + x` is the **tally** operator: it deposits `x.##` on the
|
|
2022
|
-
"
|
|
2023
|
-
" application. It is `d.
|
|
2024
|
-
"
|
|
2025
|
-
"
|
|
2026
|
-
"
|
|
2027
|
-
"
|
|
2028
|
-
"
|
|
2029
|
-
"-
|
|
2030
|
-
"
|
|
2018
|
+
"- `d + x` is the **tally** operator: it deposits `x.##` on load 1, the first",
|
|
2019
|
+
" load the residual subtracts. A sizeless host's failure is the answer, as it is",
|
|
2020
|
+
" for application. It is `d.deposit_ [1, x.##]`, a load-only functional",
|
|
2021
|
+
" update. With one load there is no load 1, and `+` is `$!!.invalid-arity`.",
|
|
2022
|
+
"- `d - x` is the **alternator** operator: it deposits on load 0, the first load",
|
|
2023
|
+
" the residual adds, as `d.deposit_ [0, x.##]`. It is not subtraction: a",
|
|
2024
|
+
" deposit only ever adds, so a load never goes negative and stays a whole Count.",
|
|
2025
|
+
" `+` lowers the residual and `-` raises it, the reverse of ordinary",
|
|
2026
|
+
" signed-scalar `+` and `-`.",
|
|
2027
|
+
"- `d * x` is the **inlay** operator: it scales every load by the operand's Size",
|
|
2028
|
+
" `x.##`, keeping `C`. It reads the operand",
|
|
2031
2029
|
" through the one Size observer, as `+` and `-` do, so any sized Frame scales a",
|
|
2032
|
-
"
|
|
2030
|
+
" Denum, not only a bare Count. It is literally `d.scale_ (x.##)`.",
|
|
2033
2031
|
"",
|
|
2034
|
-
"None of the three names the `
|
|
2032
|
+
"None of the three names the `Denum` constructor inside its method. A bare name",
|
|
2035
2033
|
"in a method is looked up on the argument first (spec 7), and a decimal is",
|
|
2036
|
-
"unit-taggable, so inside `d + 2.5` the name `
|
|
2037
|
-
"number, and applying that to `[C,
|
|
2034
|
+
"unit-taggable, so inside `d + 2.5` the name `Denum` read `2.5.Denum`, a tagged",
|
|
2035
|
+
"number, and applying that to `[C, loads]` was `$!.repetition-domain` (007.25e,",
|
|
2038
2036
|
"PR #480 review). Each operator now hands the one Size it observed to a",
|
|
2039
|
-
"load-only functional update on the receiver, `
|
|
2040
|
-
"
|
|
2041
|
-
"
|
|
2042
|
-
"
|
|
2037
|
+
"load-only functional update on the receiver, `deposit_` or `scale_`, so",
|
|
2038
|
+
"`D + 2.5`, `D - 2.5` and `D * 2.5` all read `(2.5).## = 2`.",
|
|
2039
|
+
"",
|
|
2040
|
+
"**Deposit**, `d.deposit_ [i, k]`: add the Count k to load i and keep the Count,",
|
|
2041
|
+
"a load-only functional update for any index of any arity. A k that is not a",
|
|
2042
|
+
"Count, or an argument that is not a pair, is `$!!.invalid-denum`, since a",
|
|
2043
|
+
"negative deposit is no Denum; an index that is not a load of this Denum is",
|
|
2044
|
+
"`$!!.invalid-arity`.",
|
|
2043
2045
|
"",
|
|
2044
2046
|
"**Rational readings (007.25).** Because `C` is kept, two exact ratios are read",
|
|
2045
2047
|
"from the state. They are unary observations of the stored state, not `/` and",
|
|
@@ -2048,8 +2050,8 @@ export const HC_SOURCES = new Map([
|
|
|
2048
2050
|
"`$!!.unary-observation`, so `d.size-ratio 4` is refused rather than read as a",
|
|
2049
2051
|
"division by 4.",
|
|
2050
2052
|
"",
|
|
2051
|
-
"- `d.size-ratio ()` is `S / C` for `S =
|
|
2052
|
-
"- `d.residual-ratio ()` is `Δ / C` for `Δ =
|
|
2053
|
+
"- `d.size-ratio ()` is `S / C` for `S = d.##`, exact and nonnegative.",
|
|
2054
|
+
"- `d.residual-ratio ()` is `Δ / C` for `Δ = d.###`, exact and signed.",
|
|
2053
2055
|
"",
|
|
2054
2056
|
"Both are **nil when `C = 0`**, whatever the loads: the state exists and its Size",
|
|
2055
2057
|
"and residual still read, but the ratio is absent, so there is no `0/0`, infinity",
|
|
@@ -2063,220 +2065,216 @@ export const HC_SOURCES = new Map([
|
|
|
2063
2065
|
"and `S / C` and `Δ / C` are arithmetic readings of it, not a construction of",
|
|
2064
2066
|
"rational geometry.",
|
|
2065
2067
|
"",
|
|
2066
|
-
"**Text.** A
|
|
2067
|
-
"text it reads `
|
|
2068
|
-
"",
|
|
2069
|
-
"**Channels and division (007.27).** The two loads are the arity-two case of an",
|
|
2070
|
-
"ordered list of channel loads. `Demi [C, loads]` takes a Count and a nonempty",
|
|
2071
|
-
"list of Counts: two loads are this binary Demi, the same instance",
|
|
2072
|
-
"`Demi [C, L, R]` builds, and any other number is a channel Demi. Every Demi",
|
|
2073
|
-
"stores `count` and `loads`; only the binary one also has `left`, `right` and",
|
|
2074
|
-
"`phase`, which it writes together with `loads`. A channel Demi of arity k",
|
|
2075
|
-
"deposits into channel `C mod k`, which for k = 2 is the phase's channel. Its",
|
|
2076
|
-
"Size is the sum of its loads and its residual their alternating sum",
|
|
2077
|
-
"`e0 − e1 + e2 − …`, the list residual, which for two loads is `L − R`. Its",
|
|
2078
|
-
"fourth hash is intrinsic too: a fresh equal Demi of the same arity. Its `*`,",
|
|
2079
|
-
"`scale_` and ratios are as here. Its `+` and `-` follow the residual's signs:",
|
|
2080
|
-
"`-` deposits on the first even load, load 0, raising the residual, and `+` on",
|
|
2081
|
-
"the first odd load, load 1, lowering it, which for two loads are left and",
|
|
2082
|
-
"right; with one load `+` is `$!!.invalid-arity`. Text reads `Demi(C,[e0, e1,",
|
|
2083
|
-
"…])`.",
|
|
2068
|
+
"**Text.** A Denum prints as what it is, an aggregate of fields and methods. As",
|
|
2069
|
+
"text it reads `Denum(C,[e0, e1, …])`, the Count and its loads, for every arity.",
|
|
2084
2070
|
"",
|
|
2085
2071
|
"`d ./ n`, also spelled `d / n`, redistributes the Size: it keeps C and the",
|
|
2086
2072
|
"total S and deals S Size units round-robin into n channels, so the first",
|
|
2087
2073
|
"S mod n hold ⌈S/n⌉ and the rest ⌊S/n⌋. It is idempotent, `(d ./ n) ./ m` is",
|
|
2088
|
-
"`d ./ m`, and equal Count and Size give equal results, so `
|
|
2089
|
-
"`
|
|
2074
|
+
"`d ./ m`, and equal Count and Size give equal results, so `Denum(3,[5,2])` and",
|
|
2075
|
+
"`Denum(3,[4,3])` divide into the same `Denum(3,[3,2,2])`. It is not scalar",
|
|
2090
2076
|
"division and not the ratios: no number is answered. The divisor is a positive",
|
|
2091
2077
|
"Count, refused as a list refuses it (`$!.division-by-zero /`,",
|
|
2092
2078
|
"`$!.division-domain /`), never read as a Size. `hc/division.hc` is its",
|
|
2093
2079
|
"specification, with the list and RotorRouter divisions beside it.",
|
|
2094
2080
|
"",
|
|
2095
2081
|
"**Methods read their own state through `_^`.** A bare name inside a method is",
|
|
2096
|
-
"looked up on the argument first (spec 7), and a
|
|
2097
|
-
"Frames, so a bare `
|
|
2082
|
+
"looked up on the argument first (spec 7), and a Denum is applied to arbitrary",
|
|
2083
|
+
"Frames, so a bare `loads` could read the argument's field. `_^` is the receiver",
|
|
2098
2084
|
"from a method's body, and `_^^` from a block one level in, because carets",
|
|
2099
2085
|
"count lexically (spec a06). What a branch needs is bound as a local at method",
|
|
2100
|
-
"level, where nested blocks read it
|
|
2101
|
-
"
|
|
2102
|
-
"
|
|
2086
|
+
"level, where nested blocks read it; a deposit builds its own small cursor",
|
|
2087
|
+
"there, which adds a Size at one load index when the loads are reduced through",
|
|
2088
|
+
"it, so a Denum printed and read back still applies. The file's own names, the",
|
|
2089
|
+
"constructor `Denum` and the helper `redistribution` (the round-robin loads of S",
|
|
2103
2090
|
"units in n channels), are read the same way, through the scope a caret ladder",
|
|
2104
|
-
"reaches, `(_^^^ .
|
|
2091
|
+
"reaches, `(_^^^ .Denum)` from a branch, so an argument's fields never stand in",
|
|
2105
2092
|
"for them.",
|
|
2106
2093
|
"```",
|
|
2107
|
-
".deposit-at {.at (_ .0); .by (_ .1); [.index 0; .target at; .amount by; .out [];",
|
|
2108
|
-
" .apply_ {.v _; .i (_^ .index); .t (_^ .target); .a (_^ .amount); .o (_^ .out);",
|
|
2109
|
-
" @out (o ((i = t) ? {v + a} : {v})); @index (i + 1);}]};",
|
|
2110
2094
|
".redistribution {.s (_ .0); .ways (_ .1); .r (s %% ways); .q (((s - r) / ways).##);",
|
|
2111
2095
|
" ((ways - r) [q]) | (r [(q + 1)])};",
|
|
2112
|
-
".
|
|
2113
|
-
" .count c;",
|
|
2114
|
-
" .phase p;",
|
|
2115
|
-
" .left l;",
|
|
2116
|
-
" .right r;",
|
|
2117
|
-
" .loads [l, r];",
|
|
2118
|
-
" .# {_^.count};",
|
|
2119
|
-
" .## {_^.left + _^.right};",
|
|
2120
|
-
" .### {_^.left - _^.right};",
|
|
2121
|
-
" .apply_ {.s (_ .##); .c (_^ .count); .l (_^ .left); .r (_^ .right); .p (_^ .phase);",
|
|
2122
|
-
" (s ~ (0.<>)) ? {(p = 2) ? {@left (l + s); @loads [(l + s), r]; @phase 1;} : {@right (r + s); @loads [l, (r + s)]; @phase 2;}; @count (c + 1); _^^} : {s}};",
|
|
2123
|
-
" .scale_ {.k _; .l (_^ .left); .r (_^ .right);",
|
|
2124
|
-
" (k ~ (0.<>)) ? {@left (l * k); @right (r * k); @loads [(l * k), (r * k)]; _^^} : {$!!.invalid-scale}};",
|
|
2125
|
-
" .deposit-right_ {.k _; .l (_^ .left); .r (_^ .right);",
|
|
2126
|
-
" (k ~ (0.<>)) ? {@right (r + k); @loads [l, (r + k)]; _^^} : {$!!.invalid-demi}};",
|
|
2127
|
-
" .deposit-left_ {.k _; .l (_^ .left); .r (_^ .right);",
|
|
2128
|
-
" (k ~ (0.<>)) ? {@left (l + k); @loads [(l + k), r]; _^^} : {$!!.invalid-demi}};",
|
|
2129
|
-
" .+ {.s (_ .##);",
|
|
2130
|
-
" (s ~ (0.<>)) ? {(_^^ .deposit-right_ s)} : {s}};",
|
|
2131
|
-
" .- {.s (_ .##);",
|
|
2132
|
-
" (s ~ (0.<>)) ? {(_^^ .deposit-left_ s)} : {s}};",
|
|
2133
|
-
" .* {.s (_ .##);",
|
|
2134
|
-
" (s ~ (0.<>)) ? {(_^^ .scale_ s)} : {s}};",
|
|
2135
|
-
" ./ {.ways _; .c (_^ .count); .s (_^ .##); .v ([] / ways);",
|
|
2136
|
-
" (v ~ ([].<>)) ? {(_^^^ .Demi) [c, ((_^^^ .redistribution) [s, ways])]} : {v}};",
|
|
2137
|
-
" .size-ratio {.c (_^ .count); .s (_^ .##); .u ((_ = ()) ? {1} : {0});",
|
|
2138
|
-
" (c .> 0) ? {(u = 1) ? {s / c} : {$!!.unary-observation}}};",
|
|
2139
|
-
" .residual-ratio {.c (_^ .count); .d (_^ .###); .u ((_ = ()) ? {1} : {0});",
|
|
2140
|
-
" (c .> 0) ? {(u = 1) ? {d / c} : {$!!.unary-observation}}};",
|
|
2141
|
-
" .toText {“Demi(” (_^ .count) “,” (_^ .left) “,” (_^ .right) “)”}",
|
|
2142
|
-
" ]};",
|
|
2143
|
-
".channel-demi {.c (_ .0); .e (_ .1); [",
|
|
2096
|
+
".denum-instance {.c (_ .0); .e (_ .1); [",
|
|
2144
2097
|
" .count c;",
|
|
2145
2098
|
" .loads e;",
|
|
2146
2099
|
" .# {_^.count};",
|
|
2147
2100
|
" .## {(_^ .loads).##};",
|
|
2148
2101
|
" .### {(_^ .loads).###};",
|
|
2149
2102
|
" .apply_ {.s (_ .##); .c (_^ .count); .e (_^ .loads);",
|
|
2150
|
-
" (
|
|
2103
|
+
" .at (c %% (e.#)); .cursor [.index 0; .target at; .amount s; .out []; .apply_ {.v _; .i (_^ .index); .t (_^ .target); .a (_^ .amount); .o (_^ .out); @out (o ((i = t) ? {v + a} : {v})); @index (i + 1);}];",
|
|
2104
|
+
" (s ~ (0.<>)) ? {@loads ((e | cursor) .out); @count (c + 1); _^^} : {s}};",
|
|
2151
2105
|
" .scale_ {.k _; .e (_^ .loads);",
|
|
2152
2106
|
" (k ~ (0.<>)) ? {@loads (e & {_ * k}); _^^} : {$!!.invalid-scale}};",
|
|
2153
|
-
" .
|
|
2154
|
-
" ((
|
|
2155
|
-
"
|
|
2156
|
-
" (
|
|
2107
|
+
" .deposit_ {.a _; .e (_^ .loads);",
|
|
2108
|
+
" .ok (((a ~ ([].<>)) ? {((a.#) = 2) ? {(a .1) ~ (0.<>)}}) ? {1} : {0});",
|
|
2109
|
+
" .at ((ok = 1) ? {a .0} : {0}); .k ((ok = 1) ? {a .1} : {0});",
|
|
2110
|
+
" .ix (((ok = 1) ? {(at ~ (0.<>)) ? {(e.#) .> at}}) ? {1} : {0});",
|
|
2111
|
+
" .cursor [.index 0; .target at; .amount k; .out []; .apply_ {.v _; .i (_^ .index); .t (_^ .target); .a (_^ .amount); .o (_^ .out); @out (o ((i = t) ? {v + a} : {v})); @index (i + 1);}];",
|
|
2112
|
+
" (ix = 1) ? {@loads ((e | cursor) .out); _^^} : {(ok = 1) ? {$!!.invalid-arity} : {$!!.invalid-denum}}};",
|
|
2157
2113
|
" .+ {.s (_ .##);",
|
|
2158
|
-
" (s ~ (0.<>)) ? {(_^^ .
|
|
2114
|
+
" (s ~ (0.<>)) ? {(_^^ .deposit_ [1, s])} : {s}};",
|
|
2159
2115
|
" .- {.s (_ .##);",
|
|
2160
|
-
" (s ~ (0.<>)) ? {(_^^ .
|
|
2116
|
+
" (s ~ (0.<>)) ? {(_^^ .deposit_ [0, s])} : {s}};",
|
|
2161
2117
|
" .* {.s (_ .##);",
|
|
2162
2118
|
" (s ~ (0.<>)) ? {(_^^ .scale_ s)} : {s}};",
|
|
2163
2119
|
" ./ {.ways _; .c (_^ .count); .s (_^ .##); .v ([] / ways);",
|
|
2164
|
-
" (v ~ ([].<>)) ? {(_^^^ .
|
|
2120
|
+
" (v ~ ([].<>)) ? {(_^^^ .Denum) [c, ((_^^^ .redistribution) [s, ways])]} : {v}};",
|
|
2165
2121
|
" .size-ratio {.c (_^ .count); .s (_^ .##); .u ((_ = ()) ? {1} : {0});",
|
|
2166
2122
|
" (c .> 0) ? {(u = 1) ? {s / c} : {$!!.unary-observation}}};",
|
|
2167
2123
|
" .residual-ratio {.c (_^ .count); .d (_^ .###); .u ((_ = ()) ? {1} : {0});",
|
|
2168
2124
|
" (c .> 0) ? {(u = 1) ? {d / c} : {$!!.unary-observation}}};",
|
|
2169
|
-
" .toText {“
|
|
2125
|
+
" .toText {“Denum(” (_^ .count) “,” (_^ .loads) “)”}",
|
|
2170
2126
|
" ]};",
|
|
2171
|
-
".
|
|
2172
|
-
" .
|
|
2127
|
+
".Denum {((_ ~ ([].<>)) ? {(__ .#) ~ <1, 2>}) ? {.a __; .n (a.#);",
|
|
2128
|
+
" .c ((n = 1) ? {1} : {a .0});",
|
|
2129
|
+
" .boxed ((n = 2) ? {[a .1]} : {[a .0]});",
|
|
2173
2130
|
" ((c ~ (0.<>)) ? {(boxed .0) ~ ([].<>)}) ? {.e (boxed .0); .k (e.#);",
|
|
2174
2131
|
" ((k .> 0) ? {(e &| {.x _; (x ~ (0.<>)) ? {[]} : {[x]}}).# = 0}) ? {",
|
|
2175
|
-
"
|
|
2176
|
-
" } : {$!!.invalid-
|
|
2132
|
+
" denum-instance [c, (e | [])]",
|
|
2133
|
+
" } : {$!!.invalid-denum}} : {$!!.invalid-denum}} : {$!!.invalid-denum}};",
|
|
2177
2134
|
"```",
|
|
2178
2135
|
"## Construction",
|
|
2179
2136
|
"",
|
|
2180
|
-
"A
|
|
2181
|
-
"
|
|
2182
|
-
"
|
|
2137
|
+
"A Denum holds its Count and its loads. Each instance is its own: two built",
|
|
2138
|
+
"from the same constructor share nothing. The neutral start `Denum [0, [0, 0]]`",
|
|
2139
|
+
"is present, with Count zero",
|
|
2183
2140
|
"```",
|
|
2184
|
-
"; .d (
|
|
2185
|
-
"; [d.count, d.
|
|
2186
|
-
"# [0,
|
|
2187
|
-
"; .a (
|
|
2188
|
-
"; [“” a, “” b, a.
|
|
2189
|
-
"# [“
|
|
2141
|
+
"; .d (Denum [0, [0, 0]]);",
|
|
2142
|
+
"; [d.count, d.# %% 2, d.loads .0, d.loads .1, d.loads, d.#, d.##, d.###, “” d]",
|
|
2143
|
+
"# [0, 0, 0, 0, [0, 0], 0, 0, 0, “Denum(0,[0, 0])”]",
|
|
2144
|
+
"; .a (Denum [2, [5, 3]]); .b (Denum [1, [7, 0]]);",
|
|
2145
|
+
"; [“” a, “” b, a.loads .0, b.loads .0, a.# %% 2, b.# %% 2]",
|
|
2146
|
+
"# [“Denum(2,[5, 3])”, “Denum(1,[7, 0])”, 5, 7, 0, 1]",
|
|
2190
2147
|
"```",
|
|
2191
|
-
"Any Counts are a state.
|
|
2192
|
-
"
|
|
2148
|
+
"Any Counts are a state. With two loads the next load is the Count's parity,",
|
|
2149
|
+
"`C %% 2`: 0 when even, zero included, and 1 when odd",
|
|
2193
2150
|
"```",
|
|
2194
|
-
"; [0, 1, 2, 3, 4, 5, 100, 101] & {(
|
|
2195
|
-
"# [
|
|
2196
|
-
"; [(
|
|
2197
|
-
"# [2, 4, 100,
|
|
2151
|
+
"; [0, 1, 2, 3, 4, 5, 100, 101] & {(Denum [_, [5, 3]]).# %% 2}",
|
|
2152
|
+
"# [0, 1, 0, 1, 0, 1, 0, 1]",
|
|
2153
|
+
"; [(Denum [2, [5, 3]]).#, (Denum [4, [5, 3]]).#, (Denum [100, [5, 3]]).count, (Denum [100, [5, 3]]).# %% 2, (Denum [3, [5, 3]]).# %% 2]",
|
|
2154
|
+
"# [2, 4, 100, 0, 1]",
|
|
2198
2155
|
"```",
|
|
2199
2156
|
"A positive Count over empty loads and nonzero loads over a zero Count are both",
|
|
2200
2157
|
"states. Anything that is not three Counts is refused",
|
|
2201
2158
|
"```",
|
|
2202
|
-
"; [“” (
|
|
2203
|
-
"# [“
|
|
2204
|
-
"; [
|
|
2205
|
-
"# [$!!.invalid-
|
|
2159
|
+
"; [“” (Denum [3, [0, 0]]), “” (Denum [0, [3, 0]]), “” (Denum [0, [0, 4]])]",
|
|
2160
|
+
"# [“Denum(3,[0, 0])”, “Denum(0,[3, 0])”, “Denum(0,[0, 4])”]",
|
|
2161
|
+
"; [Denum [2, [(0 - 1), 0]], Denum [(0 - 1), [1, 1]], Denum [(5 - 3), [(5 - 7), 0]], Denum [2, 1], Denum 5, Denum [2, [1.5, 0]], Denum [2, 1, 0, 0]]",
|
|
2162
|
+
"# [$!!.invalid-denum, $!!.invalid-denum, $!!.invalid-denum, $!!.invalid-denum, $!!.invalid-denum, $!!.invalid-denum, $!!.invalid-denum]",
|
|
2163
|
+
"```",
|
|
2164
|
+
"## Constructor forms",
|
|
2165
|
+
"",
|
|
2166
|
+
"`Denum [loads]` is the default-Count form: the Count is 1. It is a constructor",
|
|
2167
|
+
"convention. An explicit Count, zero included, is kept as given. `[C, loads]` is",
|
|
2168
|
+
"the explicit form, and any arity of one or more loads is a Denum. The",
|
|
2169
|
+
"three-argument form of earlier versions is refused",
|
|
2170
|
+
"```",
|
|
2171
|
+
"; [“” (Denum [[2, 5]]), “” (Denum [0, [2, 5]]), “” (Denum [[7]]), “” (Denum [[2, 5, 3]])]",
|
|
2172
|
+
"# [“Denum(1,[2, 5])”, “Denum(0,[2, 5])”, “Denum(1,[7])”, “Denum(1,[2, 5, 3])”]",
|
|
2173
|
+
"; [Denum [2, 5, 3], Denum [0, 0, 0], Denum [3, 12, 3]]",
|
|
2174
|
+
"# [$!!.invalid-denum, $!!.invalid-denum, $!!.invalid-denum]",
|
|
2175
|
+
"; [“” (Denum [3, [2, 5, 3, 7, 4]]), “” (Denum [0, [1]]), “” (Denum [2, [2, 5]]), “” (Denum [3, [4]])]",
|
|
2176
|
+
"# [“Denum(3,[2, 5, 3, 7, 4])”, “Denum(0,[1])”, “Denum(2,[2, 5])”, “Denum(3,[4])”]",
|
|
2177
|
+
"; [(Denum [[2, 5]]).#, (Denum [[2, 5]]).##, (Denum [[2, 5]]) = (Denum [1, [2, 5]]), (Denum [[2, 5]]) = (Denum [1, [2, 5]])]",
|
|
2178
|
+
"# [1, 7, <>, <>]",
|
|
2179
|
+
"; (Denum [[123456789012345678901234567890, 5, 3]]).##",
|
|
2180
|
+
"# 123456789012345678901234567898",
|
|
2181
|
+
"```",
|
|
2182
|
+
"A default form is refused like an explicit one when its loads are not whole,",
|
|
2183
|
+
"and the one-argument form takes a list of loads, never a bare number",
|
|
2184
|
+
"```",
|
|
2185
|
+
"; [Denum [[]], Denum [[1, (0 - 1)]], Denum [[1.5, 2]], Denum [[“a”]], Denum [5], Denum [(0 - 1)], Denum [[[1]]], Denum [[2, 5], [1]], Denum []]",
|
|
2186
|
+
"# [$!!.invalid-denum, $!!.invalid-denum, $!!.invalid-denum, $!!.invalid-denum, $!!.invalid-denum, $!!.invalid-denum, $!!.invalid-denum, $!!.invalid-denum, $!!.invalid-denum]",
|
|
2187
|
+
"; [Denum [1.5, [2, 5]], Denum [(0 - 1), [2, 5]], Denum [“a”, [2, 5]], Denum [2, [2, (0 - 1)]], Denum [2, []], Denum [2, 5], Denum [2, 1, 2, 3]]",
|
|
2188
|
+
"# [$!!.invalid-denum, $!!.invalid-denum, $!!.invalid-denum, $!!.invalid-denum, $!!.invalid-denum, $!!.invalid-denum, $!!.invalid-denum]",
|
|
2189
|
+
"```",
|
|
2190
|
+
"Routing follows the Count alone: application deposits into load",
|
|
2191
|
+
"`C mod arity`, here `C mod 2`, so two Denums with the same loads and Counts of",
|
|
2192
|
+
"different parity route to different loads",
|
|
2193
|
+
"```",
|
|
2194
|
+
"; [(Denum [2, [0, 0]]) 5, (Denum [3, [0, 0]]) 5] & {“” _}",
|
|
2195
|
+
"# [“Denum(3,[5, 0])”, “Denum(4,[0, 5])”]",
|
|
2196
|
+
"```",
|
|
2197
|
+
"A Denum stores its Count and loads and nothing else, whatever its arity. Along",
|
|
2198
|
+
"any run of applications, deposits and scalings its Size is the sum of its loads",
|
|
2199
|
+
"and its fourth hash is the state itself",
|
|
2200
|
+
"```",
|
|
2201
|
+
"; .walk {.s _; [s, (s 5), ((s 5) - 2), (((s 5) - 2) + 3), ((((s 5) - 2) + 3) * 2), (((((s 5) - 2) + 3) * 2) 0)]};",
|
|
2202
|
+
"; .agree {.k _; (k.## = (k.loads).##) ? {k.#### = k}};",
|
|
2203
|
+
"; [(walk (Denum [0, [0, 0]])) & agree, (walk (Denum [1, [4, 1]])) & agree, (walk (Denum [2, [1, 2, 3]])) & agree]",
|
|
2204
|
+
"# [[<>, <>, <>, <>, <>, <>], [<>, <>, <>, <>, <>, <>], [<>, <>, <>, <>, <>, <>]]",
|
|
2206
2205
|
"```",
|
|
2207
2206
|
"## Application",
|
|
2208
2207
|
"",
|
|
2209
|
-
"Each application deposits the argument's Size into
|
|
2210
|
-
"
|
|
2211
|
-
"as it was",
|
|
2208
|
+
"Each application deposits the argument's Size into load `C mod k` and adds one",
|
|
2209
|
+
"to the Count. The receiver is left as it was",
|
|
2212
2210
|
"```",
|
|
2213
2211
|
"; “” (d [5, 3])",
|
|
2214
|
-
"# “
|
|
2212
|
+
"# “Denum(1,[8, 0])”",
|
|
2215
2213
|
"; “” d",
|
|
2216
|
-
"# “
|
|
2214
|
+
"# “Denum(0,[0, 0])”",
|
|
2217
2215
|
"; “” (((d 5) 3) 7)",
|
|
2218
|
-
"# “
|
|
2216
|
+
"# “Denum(3,[12, 3])”",
|
|
2219
2217
|
"```",
|
|
2220
|
-
"A Size of zero deposits nothing and still counts, in both
|
|
2218
|
+
"A Size of zero deposits nothing and still counts, in both parities",
|
|
2221
2219
|
"```",
|
|
2222
|
-
"; [(d 0).count, ((d 0) 0).count, (d 0)
|
|
2223
|
-
"# [1, 2, 1,
|
|
2220
|
+
"; [(d 0).count, ((d 0) 0).count, (d 0).# %% 2, ((d 0) 0).# %% 2, (d 0).loads .0, ((d 0) 0).loads .1]",
|
|
2221
|
+
"# [1, 2, 1, 0, 0, 0]",
|
|
2224
2222
|
"```",
|
|
2225
2223
|
"Any Frame is applied by its Size, measured without running it: text, the",
|
|
2226
2224
|
"empty aggregate and all (Size 1 each), nested aggregates, a closure (one per",
|
|
2227
2225
|
"word, so `{5 + 3}` is 9), empty text, and loads too large for a machine integer",
|
|
2228
2226
|
"```",
|
|
2229
2227
|
"; “” ((((((d “hello”) []) <>) [[1, 2], [3]]) {5 + 3}) “”)",
|
|
2230
|
-
"# “
|
|
2228
|
+
"# “Denum(6,[15, 7])”",
|
|
2231
2229
|
"; “” ((d 123456789012345678901234567890) 987654321098765432109876543210)",
|
|
2232
|
-
"# “
|
|
2230
|
+
"# “Denum(2,[123456789012345678901234567890, 987654321098765432109876543210])”",
|
|
2233
2231
|
"```",
|
|
2234
2232
|
"A Frame without a Size is not deposited: its failure is the answer",
|
|
2235
2233
|
"```",
|
|
2236
2234
|
"; d ([].nope)",
|
|
2237
2235
|
"# $!.name-missing “...",
|
|
2238
2236
|
"; “” d",
|
|
2239
|
-
"# “
|
|
2237
|
+
"# “Denum(0,[0, 0])”",
|
|
2240
2238
|
"```",
|
|
2241
2239
|
"Deposit reads the receiver through `_^`, so an argument that holds fields of",
|
|
2242
2240
|
"the same names deposits by its Size and nothing else",
|
|
2243
2241
|
"```",
|
|
2244
2242
|
"; “” (d [.count 50; .left 99; .phase 1; .s 100; 4])",
|
|
2245
|
-
"# “
|
|
2246
|
-
"; “” ((
|
|
2247
|
-
"# “
|
|
2243
|
+
"# “Denum(1,[4, 0])”",
|
|
2244
|
+
"; “” ((Denum [2, [5, 3]]) [.count 50; .left 99; .right 7; 4])",
|
|
2245
|
+
"# “Denum(3,[9, 3])”",
|
|
2248
2246
|
"```",
|
|
2249
|
-
"A
|
|
2247
|
+
"A Denum captured by a closure, mapped, or reduced is applied the same way, and",
|
|
2250
2248
|
"the captured one stays as it was",
|
|
2251
2249
|
"```",
|
|
2252
|
-
"; .start (
|
|
2250
|
+
"; .start (Denum [0, [0, 0]]); .step {start _};",
|
|
2253
2251
|
"; [“” (step 5), “” (step 3), “” start]",
|
|
2254
|
-
"# [“
|
|
2252
|
+
"# [“Denum(1,[5, 0])”, “Denum(1,[3, 0])”, “Denum(0,[0, 0])”]",
|
|
2255
2253
|
"; [d, a] & {“” (_ 5)}",
|
|
2256
|
-
"# [“
|
|
2257
|
-
"; “” ([5, 3, 7] | (
|
|
2258
|
-
"# “
|
|
2254
|
+
"# [“Denum(1,[5, 0])”, “Denum(3,[10, 3])”]",
|
|
2255
|
+
"; “” ([5, 3, 7] | (Denum [0, [0, 0]]))",
|
|
2256
|
+
"# “Denum(3,[12, 3])”",
|
|
2259
2257
|
"```",
|
|
2260
|
-
"Through a mutable name, application writes the
|
|
2258
|
+
"Through a mutable name, application writes the Denum in place",
|
|
2261
2259
|
"```",
|
|
2262
|
-
"; .m_ (
|
|
2260
|
+
"; .m_ (Denum [0, [0, 0]]);",
|
|
2263
2261
|
"; m_ 5;",
|
|
2264
2262
|
"; m_ 3;",
|
|
2265
|
-
"; [“” m_, m_.count, m_
|
|
2266
|
-
"# [“
|
|
2263
|
+
"; [“” m_, m_.count, m_.# %% 2]",
|
|
2264
|
+
"# [“Denum(2,[5, 3])”, 2, 0]",
|
|
2267
2265
|
"```",
|
|
2268
2266
|
"## Application counts",
|
|
2269
2267
|
"",
|
|
2270
|
-
"Starting at Count 0
|
|
2271
|
-
"
|
|
2272
|
-
"
|
|
2268
|
+
"Starting at Count 0 or at Count 1, applying 5, 3, 7 and 2 in turn grows the",
|
|
2269
|
+
"Count by exactly one each time and alternates the load. The Size and residual",
|
|
2270
|
+
"are the alternating route's, from load 0 or from load 1",
|
|
2273
2271
|
"```",
|
|
2274
2272
|
"; .chain {.s _; [s, (s 5), ((s 5) 3), (((s 5) 3) 7), ((((s 5) 3) 7) 2)]};",
|
|
2275
|
-
"; .c0 (chain (
|
|
2276
|
-
"; [c0 & {_.count}, c0 & {_
|
|
2277
|
-
"# [[0, 1, 2, 3, 4], [
|
|
2278
|
-
"; [c1 & {_.count}, c1 & {_
|
|
2279
|
-
"# [[1, 2, 3, 4, 5], [1,
|
|
2273
|
+
"; .c0 (chain (Denum [0, [0, 0]])); .c1 (chain (Denum [1, [0, 0]]));",
|
|
2274
|
+
"; [c0 & {_.count}, c0 & {_.# %% 2}, c0 & {_.##}, c0 & {_.###}]",
|
|
2275
|
+
"# [[0, 1, 2, 3, 4], [0, 1, 0, 1, 0], [0, 5, 8, 15, 17], [0, 5, 2, 9, 7]]",
|
|
2276
|
+
"; [c1 & {_.count}, c1 & {_.# %% 2}, c1 & {_.##}, c1 & {_.###}]",
|
|
2277
|
+
"# [[1, 2, 3, 4, 5], [1, 0, 1, 0, 1], [0, 5, 8, 15, 17], [0, -5, -2, -9, -7]]",
|
|
2280
2278
|
"```",
|
|
2281
2279
|
"The Count and the loads together are the state, and the fourth hash of each step",
|
|
2282
2280
|
"is that step, Count included",
|
|
@@ -2286,38 +2284,38 @@ export const HC_SOURCES = new Map([
|
|
|
2286
2284
|
"```",
|
|
2287
2285
|
"## Observers",
|
|
2288
2286
|
"",
|
|
2289
|
-
"A
|
|
2290
|
-
"signed difference, including a present zero-load
|
|
2287
|
+
"A Denum's Count is its stored Count, its Size the total load and its residual the",
|
|
2288
|
+
"signed difference, including a present zero-load Denum in either parity",
|
|
2291
2289
|
"```",
|
|
2292
|
-
"; .e (
|
|
2293
|
-
"; [e.#, e.##, e.###, e
|
|
2290
|
+
"; .e (Denum [3, [12, 3]]);",
|
|
2291
|
+
"; [e.#, e.##, e.###, e.# %% 2]",
|
|
2294
2292
|
"# [3, 15, 9, 1]",
|
|
2295
|
-
"; [d.#, d.##, d.###, (
|
|
2293
|
+
"; [d.#, d.##, d.###, (Denum [1, [0, 0]]).#, (Denum [1, [0, 0]]).# %% 2]",
|
|
2296
2294
|
"# [0, 0, 0, 1, 1]",
|
|
2297
2295
|
"```",
|
|
2298
|
-
"Count is `.#`, not
|
|
2296
|
+
"Count is `.#`, not its parity. The same parity and loads with a different Count are",
|
|
2299
2297
|
"different states with the same Size and residual",
|
|
2300
2298
|
"```",
|
|
2301
|
-
"; .f2 (
|
|
2302
|
-
"; [f2
|
|
2299
|
+
"; .f2 (Denum [2, [5, 1]]); .f4 (Denum [4, [5, 1]]);",
|
|
2300
|
+
"; [(f2.# %% 2) = (f4.# %% 2), f2.## = f4.##, f2.### = f4.###, f2.# = f4.#, f2 = f4, f2 = (Denum [2, [5, 1]])]",
|
|
2303
2301
|
"# [<>, <>, <>, (), (), <>]",
|
|
2304
|
-
"; [f2.#, f4.#, f2.##, f2.###, f2
|
|
2305
|
-
"# [2, 4, 6, 4,
|
|
2302
|
+
"; [f2.#, f4.#, f2.##, f2.###, f2.# %% 2, f4.# %% 2]",
|
|
2303
|
+
"# [2, 4, 6, 4, 0, 0]",
|
|
2306
2304
|
"```",
|
|
2307
|
-
"A
|
|
2305
|
+
"A Denum inside an aggregate contributes its declared Size",
|
|
2308
2306
|
"```",
|
|
2309
|
-
"; [[e, e].##, [e, d].###, [e].#### = (
|
|
2307
|
+
"; [[e, e].##, [e, d].###, [e].#### = (Denum [1, [15, 0]])]",
|
|
2310
2308
|
"# [30, 15, <>]",
|
|
2311
2309
|
"```",
|
|
2312
2310
|
"## The fourth hash",
|
|
2313
2311
|
"",
|
|
2314
|
-
"`.####` of a
|
|
2312
|
+
"`.####` of a Denum is that Denum, however often it is taken. It is equal, not",
|
|
2315
2313
|
"identical: each observation builds a new instance. Its Count is kept for every",
|
|
2316
2314
|
"Count, including zero",
|
|
2317
2315
|
"```",
|
|
2318
2316
|
"; [e.#### = e, e.#### === e, e.#### == e, ((e.####).####).#### = e, (e.####).# = e.#]",
|
|
2319
2317
|
"# [<>, (), <>, <>, <>]",
|
|
2320
|
-
"; [d.#### = d, (
|
|
2318
|
+
"; [d.#### = d, (Denum [1, [0, 0]]).#### = (Denum [1, [0, 0]]), (Denum [100, [5, 3]]).####.count, (Denum [0, [3, 0]]).#### = (Denum [0, [3, 0]])]",
|
|
2321
2319
|
"# [<>, <>, 100, <>]",
|
|
2322
2320
|
"; [f2.####.# , f4.####.#, f2.#### = f4.####, f2.#### = f2]",
|
|
2323
2321
|
"# [2, 4, (), <>]",
|
|
@@ -2326,47 +2324,47 @@ export const HC_SOURCES = new Map([
|
|
|
2326
2324
|
"so it compares equal to one built here. The host's whole Count is kept: it is",
|
|
2327
2325
|
"not reduced to its parity",
|
|
2328
2326
|
"```",
|
|
2329
|
-
"; [[5, 3].#### = (
|
|
2327
|
+
"; [[5, 3].#### = (Denum [2, [5, 3]]), “hello”.#### = (Denum [5, [3, 2]]), [0].#### = (Denum [1, [0, 0]])]",
|
|
2330
2328
|
"# [<>, <>, <>]",
|
|
2331
|
-
"; [[5, 3].####.#, “hello”.####.#, “hello
|
|
2329
|
+
"; [[5, 3].####.#, “hello”.####.#, “hello”.#### .# %% 2, [5, 3, 7].####.#, [5, 3, 7].#### .# %% 2]",
|
|
2332
2330
|
"# [2, 5, 1, 3, 1]",
|
|
2333
2331
|
"; “” [5, 3, 7].####",
|
|
2334
|
-
"# “
|
|
2332
|
+
"# “Denum(3,[12, 3])”",
|
|
2335
2333
|
"```",
|
|
2336
2334
|
"Hosts whose Counts differ by an even number do not share a fourth hash, though",
|
|
2337
|
-
"they share
|
|
2335
|
+
"they share parity and, here, loads",
|
|
2338
2336
|
"```",
|
|
2339
|
-
"; [[5, 3].#### = [5, 3, 0, 0].####, [5, 3]
|
|
2337
|
+
"; [[5, 3].#### = [5, 3, 0, 0].####, ([5, 3].#### .# %% 2) = ([5, 3, 0, 0].#### .# %% 2), [5, 3].####.## = [5, 3, 0, 0].####.##]",
|
|
2340
2338
|
"# [(), <>, <>]",
|
|
2341
2339
|
"```",
|
|
2342
|
-
"It is nil where there is no
|
|
2343
|
-
"residual. A host with no children is not a
|
|
2340
|
+
"It is nil where there is no Denum: an empty host, Count zero, no Count, or no",
|
|
2341
|
+
"residual. A host with no children is not a Denum of Count zero. Properties are",
|
|
2344
2342
|
"not elements, sharing counts each occurrence, and a group observes as its",
|
|
2345
2343
|
"elements",
|
|
2346
2344
|
"```",
|
|
2347
2345
|
"; [[].####, 0.####, ().####, <2,3,5>.####, “”.####]",
|
|
2348
2346
|
"# [(), (), (), (), ()]",
|
|
2349
2347
|
"; .shared [1, 2];",
|
|
2350
|
-
"; [[.a 100; 5, 3].#### = [5, 3].####, [shared, shared].#### = (
|
|
2348
|
+
"; [[.a 100; 5, 3].#### = [5, 3].####, [shared, shared].#### = (Denum [2, [3, 3]]), (5, 3).#### = (Denum [2, [5, 3]])]",
|
|
2351
2349
|
"# [<>, <>, <>]",
|
|
2352
2350
|
"```",
|
|
2353
|
-
"The two zero-Count cases are different. A constructed `
|
|
2351
|
+
"The two zero-Count cases are different. A constructed `Denum [0, [0, 0]]` is a",
|
|
2354
2352
|
"present value, while the empty host and the Count 0 have none. They agree on",
|
|
2355
2353
|
"Count, Size and residual, so the difference is not read from the observers: the",
|
|
2356
2354
|
"fourth hash recognizes an instance of this class (007.25e)",
|
|
2357
2355
|
"```",
|
|
2358
2356
|
"; [[].# = d.#, [].## = d.##, 0.## = d.##, 0.### = d.###]",
|
|
2359
2357
|
"# [<>, (), <>, <>]",
|
|
2360
|
-
"; [[].#### = (), 0.#### = (), d.#### = d, ((
|
|
2358
|
+
"; [[].#### = (), 0.#### = (), d.#### = d, ((Denum [0, [0, 0]]).####).count]",
|
|
2361
2359
|
"# [<>, <>, <>, 0]",
|
|
2362
2360
|
"```",
|
|
2363
|
-
"Zero-Count
|
|
2361
|
+
"Zero-Count Denums reached without an application are present too, and so is",
|
|
2364
2362
|
"each functional update of one",
|
|
2365
2363
|
"```",
|
|
2366
|
-
"; [“” ((
|
|
2367
|
-
"# [“
|
|
2364
|
+
"; [“” ((Denum [0, [3, 0]]).####), “” ((d + 4).####), “” ((d - 2.5).####), “” ((d * 7).####)]",
|
|
2365
|
+
"# [“Denum(0,[3, 0])”, “Denum(0,[0, 4])”, “Denum(0,[2, 0])”, “Denum(0,[0, 0])”]",
|
|
2368
2366
|
"```",
|
|
2369
|
-
"## Only a
|
|
2367
|
+
"## Only a Denum is a Denum",
|
|
2370
2368
|
"",
|
|
2371
2369
|
"No class declares its own `.####`. An aggregate that declares a method under",
|
|
2372
2370
|
"that name keeps it as an ordinary property, which the fourth hash never runs:",
|
|
@@ -2376,30 +2374,30 @@ export const HC_SOURCES = new Map([
|
|
|
2376
2374
|
"```",
|
|
2377
2375
|
"; .noted_ [.n 0; .bump_ {@n (_^.n + 1);}];",
|
|
2378
2376
|
"; .Liar [.#### {[.# {0}; .## {0}; .### {0}]}];",
|
|
2379
|
-
"; .Loud [.#### {noted_.bump_ ();
|
|
2377
|
+
"; .Loud [.#### {noted_.bump_ (); Denum [0, [0, 0]]}];",
|
|
2380
2378
|
"; .Selfish [.#### {_^.####}];",
|
|
2381
2379
|
"; .Broken [.#### {[].nope}];",
|
|
2382
2380
|
"; [Liar.####, Loud.####, Selfish.####, Broken.####, noted_.n]",
|
|
2383
2381
|
"# [(), (), (), (), 0]",
|
|
2384
|
-
"; [“” ([.#### {
|
|
2385
|
-
"# [“
|
|
2382
|
+
"; [“” ([.#### {Denum [9, [9, 9]]}; 5, 3].####), [.#### {Denum [9, [9, 9]]}; 5, 3].#### = [5, 3].####]",
|
|
2383
|
+
"# [“Denum(2,[5, 3])”, <>]",
|
|
2386
2384
|
"```",
|
|
2387
|
-
"Forged observers do not make a
|
|
2388
|
-
"residual 0, 0, 0 reads exactly as `
|
|
2389
|
-
"because it is not one; with a nonzero Count it gets the derived
|
|
2385
|
+
"Forged observers do not make a Denum. An aggregate declaring Count, Size and",
|
|
2386
|
+
"residual 0, 0, 0 reads exactly as `Denum [0, [0, 0]]` does, and still has no Denum,",
|
|
2387
|
+
"because it is not one; with a nonzero Count it gets the derived Denum of those",
|
|
2390
2388
|
"observers, a fresh instance of this class, never the aggregate itself",
|
|
2391
2389
|
"```",
|
|
2392
2390
|
"; .Zero [.# {0}; .## {0}; .### {0}];",
|
|
2393
2391
|
"; .Three [.# {3}; .## {5}; .### {1}];",
|
|
2394
2392
|
"; [[Zero.#, Zero.##, Zero.###] = [d.#, d.##, d.###], Zero.####, “” Three.####, Three.#### = Three]",
|
|
2395
|
-
"# [<>, (), “
|
|
2393
|
+
"# [<>, (), “Denum(3,[3, 2])”, ()]",
|
|
2396
2394
|
"```",
|
|
2397
|
-
"Fields named like a
|
|
2398
|
-
"whole instance, fields and methods, by typed equality `==` with the
|
|
2399
|
-
"constructor builds from the stored `count
|
|
2400
|
-
"of those fields,
|
|
2395
|
+
"Fields named like a Denum's are not enough either. Recognition compares the",
|
|
2396
|
+
"whole instance, fields and methods, by typed equality `==` with the Denum the",
|
|
2397
|
+
"constructor builds from the stored `count` and `loads`. So a bare record",
|
|
2398
|
+
"of those fields, a record in the old shape with a stored phase, one whose Count is a",
|
|
2401
2399
|
"decimal, and one that adds a field are foreign, and with Count zero they have",
|
|
2402
|
-
"no
|
|
2400
|
+
"no Denum",
|
|
2403
2401
|
"```",
|
|
2404
2402
|
"; .Rec [.count 0; .phase 2; .left 0; .right 0];",
|
|
2405
2403
|
"; .Fake [.count 0; .phase 1; .left 0; .right 0; .# {_^ .count}; .## {_^ .left + _^ .right}; .### {_^ .left - _^ .right}];",
|
|
@@ -2407,15 +2405,15 @@ export const HC_SOURCES = new Map([
|
|
|
2407
2405
|
"; [Rec.####, Fake.####, Dec.####, [.extra 1; .count 0; .left 0; .right 0].####]",
|
|
2408
2406
|
"# [(), (), (), ()]",
|
|
2409
2407
|
"```",
|
|
2410
|
-
"A
|
|
2408
|
+
"A Denum with a Count is recognized as one, and what it answers is a fresh",
|
|
2411
2409
|
"reconstruction from its stored state, equal to it and not it",
|
|
2412
2410
|
"```",
|
|
2413
|
-
"; [(
|
|
2414
|
-
"# [<>, (), “
|
|
2411
|
+
"; [(Denum [3, [5, 1]]).#### == (Denum [3, [5, 1]]), (Denum [3, [5, 1]]).#### === (Denum [3, [5, 1]]), “” (Denum [3, [5, 1]]).####]",
|
|
2412
|
+
"# [<>, (), “Denum(3,[5, 1])”]",
|
|
2415
2413
|
"```",
|
|
2416
2414
|
"## Observing commutes with applying",
|
|
2417
2415
|
"",
|
|
2418
|
-
"For a nonempty host X, observing X Y is applying X's
|
|
2416
|
+
"For a nonempty host X, observing X Y is applying X's Denum to Y, and both equal",
|
|
2419
2417
|
"the observation of the array X Y constructs, with Count one greater",
|
|
2420
2418
|
"```",
|
|
2421
2419
|
"; .X [5, “ab”, [1, 2]];",
|
|
@@ -2424,22 +2422,22 @@ export const HC_SOURCES = new Map([
|
|
|
2424
2422
|
"```",
|
|
2425
2423
|
"The empty host is the boundary. `[].####` is nil, a choice of convention",
|
|
2426
2424
|
"(011.15g) rather than a theorem, and applying nil answers the argument, so",
|
|
2427
|
-
"the equation as written fails there. Lifting the empty host to the
|
|
2425
|
+
"the equation as written fails there. Lifting the empty host to the Denum of",
|
|
2428
2426
|
"Count zero restores it: that is the initialized-router reading, and it is also",
|
|
2429
2427
|
"what a reduce starts from",
|
|
2430
2428
|
"```",
|
|
2431
|
-
"; [([] 7).#### = ([].#### 7), ([] 7).#### = ((
|
|
2429
|
+
"; [([] 7).#### = ([].#### 7), ([] 7).#### = ((Denum [0, [0, 0]]) 7), ([] 7).#### = ([7] | (Denum [0, [0, 0]]))]",
|
|
2432
2430
|
"# [(), <>, <>]",
|
|
2433
|
-
"; [] | (
|
|
2431
|
+
"; [] | (Denum [0, [0, 0]]) = (Denum [0, [0, 0]])",
|
|
2434
2432
|
"# <>",
|
|
2435
2433
|
"```",
|
|
2436
2434
|
"## Scaling and Star",
|
|
2437
2435
|
"",
|
|
2438
|
-
"Scaling multiplies
|
|
2436
|
+
"Scaling multiplies every load and keeps the Count: zero annihilates,",
|
|
2439
2437
|
"one is the identity, and scaling composes",
|
|
2440
2438
|
"```",
|
|
2441
2439
|
"; [“” (e.scale_ 2), “” (e.scale_ 0), (e.scale_ 1) = e, ((e.scale_ 2).scale_ 3) = (e.scale_ 6), (e.scale_ 2).#]",
|
|
2442
|
-
"# [“
|
|
2440
|
+
"# [“Denum(3,[24, 6])”, “Denum(3,[0, 0])”, <>, <>, 3]",
|
|
2443
2441
|
"; e.scale_ (0 - 2)",
|
|
2444
2442
|
"# $!!.invalid-scale",
|
|
2445
2443
|
"```",
|
|
@@ -2450,46 +2448,46 @@ export const HC_SOURCES = new Map([
|
|
|
2450
2448
|
"```",
|
|
2451
2449
|
"## Arithmetic",
|
|
2452
2450
|
"",
|
|
2453
|
-
"Three operators act on a
|
|
2451
|
+
"Three operators act on a Denum's state, each reading its operand through the one",
|
|
2454
2452
|
"Size observer `x.##`. They are fixed-channel load transformations consistent",
|
|
2455
2453
|
"with a `RotorRouter`'s channel loads (`hc/rotor-router.hc`), not named Router",
|
|
2456
|
-
"methods. `+`, `-` and `*` **construct a fresh
|
|
2457
|
-
"operands: `+` is tally, depositing `x.##` on
|
|
2458
|
-
"depositing on
|
|
2459
|
-
"`scale_`, the Star shadow. Each keeps the Count,
|
|
2454
|
+
"methods. `+`, `-` and `*` **construct a fresh Denum** from observations of their",
|
|
2455
|
+
"operands: `+` is tally, depositing `x.##` on load 1; `-` is alternator,",
|
|
2456
|
+
"depositing on load 0; and `*` is inlay, scaling every load by `x.##` through",
|
|
2457
|
+
"`scale_`, the Star shadow. Each keeps the Count, answers a",
|
|
2460
2458
|
"fresh value and leaves its operand as it was, so they compose by nesting",
|
|
2461
2459
|
"```",
|
|
2462
|
-
"; .D (
|
|
2460
|
+
"; .D (Denum [2, [5, 3]]);",
|
|
2463
2461
|
"; [“” (D + 4), “” (D - 4), “” (D * 3)]",
|
|
2464
|
-
"# [“
|
|
2462
|
+
"# [“Denum(2,[5, 7])”, “Denum(2,[9, 3])”, “Denum(2,[15, 9])”]",
|
|
2465
2463
|
"; [“” ((D + 4) - 2), “” ((D - 2) + 4), “” ((D + 4) * 3)]",
|
|
2466
|
-
"# [“
|
|
2464
|
+
"# [“Denum(2,[7, 7])”, “Denum(2,[7, 7])”, “Denum(2,[15, 21])”]",
|
|
2467
2465
|
"; “” D",
|
|
2468
|
-
"# “
|
|
2466
|
+
"# “Denum(2,[5, 3])”",
|
|
2469
2467
|
"```",
|
|
2470
|
-
"A deposit keeps the Count
|
|
2471
|
-
"
|
|
2468
|
+
"A deposit keeps the Count, including an odd one, where application would",
|
|
2469
|
+
"change its parity, and a zero Size deposits nothing while still answering a Denum. The",
|
|
2472
2470
|
"operand is measured by its Size, so any sized Frame deposits",
|
|
2473
2471
|
"```",
|
|
2474
|
-
"; [(D + 4).#, (D - 4).#, (D * 3).#, (D + 4).count, (D + 4)
|
|
2475
|
-
"# [2, 2, 2, 2,
|
|
2476
|
-
"; .P (
|
|
2477
|
-
"; [“” (P + 4), (P + 4).#, (P + 4)
|
|
2478
|
-
"# [“
|
|
2472
|
+
"; [(D + 4).#, (D - 4).#, (D * 3).#, (D + 4).count, (D + 4).# %% 2]",
|
|
2473
|
+
"# [2, 2, 2, 2, 0]",
|
|
2474
|
+
"; .P (Denum [1, [5, 3]]);",
|
|
2475
|
+
"; [“” (P + 4), (P + 4).#, (P + 4).# %% 2, “” (P - 4)]",
|
|
2476
|
+
"# [“Denum(1,[5, 7])”, 1, 1, “Denum(1,[9, 3])”]",
|
|
2479
2477
|
"; [“” (D + 0), “” (D - 0), “” (D [3, 4])]",
|
|
2480
|
-
"# [“
|
|
2478
|
+
"# [“Denum(2,[5, 3])”, “Denum(2,[5, 3])”, “Denum(3,[12, 3])”]",
|
|
2481
2479
|
"```",
|
|
2482
2480
|
"Deposit is not application and deposit is not subtraction. `D x` adds one to the",
|
|
2483
|
-
"Count and
|
|
2484
|
-
"states; `D - x` adds to
|
|
2481
|
+
"Count and changes its parity, and `D + x` does not, so they reach different",
|
|
2482
|
+
"states; `D - x` adds to load 0 and never takes from load 1, so a load",
|
|
2485
2483
|
"stays a whole Count and the signed residual only rises",
|
|
2486
2484
|
"```",
|
|
2487
2485
|
"; [(D + 4).###, (D - 4).###, D.###]",
|
|
2488
2486
|
"# [-2, 6, 2]",
|
|
2489
|
-
"; [((D 4).# = (D + 4).#), (D 4).###, (D + 4).###, (D 4).#, (D 4)
|
|
2487
|
+
"; [((D 4).# = (D + 4).#), (D 4).###, (D + 4).###, (D 4).#, (D 4).# %% 2]",
|
|
2490
2488
|
"# [(), 6, -2, 3, 1]",
|
|
2491
2489
|
"```",
|
|
2492
|
-
"Order of a
|
|
2490
|
+
"Order of a load-1 then a load-0 deposit does not matter, and scaling after a",
|
|
2493
2491
|
"balanced deposit is the Star shadow of scaling first",
|
|
2494
2492
|
"```",
|
|
2495
2493
|
"; [((D + 4) - 2) = ((D - 2) + 4), ((D + 4) * 3) = ((D * 3) + 12)]",
|
|
@@ -2497,7 +2495,7 @@ export const HC_SOURCES = new Map([
|
|
|
2497
2495
|
"```",
|
|
2498
2496
|
"A sizeless host refuses on all three operators, its failure the answer, as",
|
|
2499
2497
|
"application refuses it. `*` reads its operand's Size rather than demanding a",
|
|
2500
|
-
"bare Count, so a
|
|
2498
|
+
"bare Count, so a Denum, an aggregate or a decimal works through its `.##`, while",
|
|
2501
2499
|
"`D * 0` still annihilates",
|
|
2502
2500
|
"```",
|
|
2503
2501
|
"; [D + ([].nope), D - ([].nope), D * ([].nope)]",
|
|
@@ -2507,55 +2505,58 @@ export const HC_SOURCES = new Map([
|
|
|
2507
2505
|
"",
|
|
2508
2506
|
"`+` and `-` read their operand through the one Size observer as `*` does, so",
|
|
2509
2507
|
"any sized Frame deposits its Size: a decimal its truncated magnitude, text its",
|
|
2510
|
-
"characters, an aggregate its element count, a
|
|
2511
|
-
"per word. These are the review's own examples, from `
|
|
2508
|
+
"characters, an aggregate its element count, a Denum `L + R`, and a closure one",
|
|
2509
|
+
"per word. These are the review's own examples, from `Denum [0, [0, 0]]`",
|
|
2512
2510
|
"```",
|
|
2513
2511
|
"; [(2.5).##, (1.5).##, (0 - 1.5).##]",
|
|
2514
2512
|
"# [2, 1, 1]",
|
|
2515
|
-
"; [“” ((
|
|
2516
|
-
"# [“
|
|
2513
|
+
"; [“” ((Denum [0, [0, 0]]) + 2), “” ((Denum [0, [0, 0]]) + 2.5), “” ((Denum [0, [0, 0]]) - 1.5), “” ((Denum [1, [2, 2]]) * 2.5)]",
|
|
2514
|
+
"# [“Denum(0,[0, 2])”, “Denum(0,[0, 2])”, “Denum(0,[1, 0])”, “Denum(1,[4, 4])”]",
|
|
2517
2515
|
"; [“” (D + 2.5), “” (D - 2.5), “” (P + 0.5), “” (P - (0 - 3.5))]",
|
|
2518
|
-
"# [“
|
|
2519
|
-
"; [“” (D + “abc”), “” (D - [[], []]), “” (D + (
|
|
2520
|
-
"# [“
|
|
2516
|
+
"# [“Denum(2,[5, 5])”, “Denum(2,[7, 3])”, “Denum(1,[5, 3])”, “Denum(1,[8, 3])”]",
|
|
2517
|
+
"; [“” (D + “abc”), “” (D - [[], []]), “” (D + (Denum [1, [2, 4]])), “” (D - {5 + 3}), “” (D + <>), “” (D - [])]",
|
|
2518
|
+
"# [“Denum(2,[5, 6])”, “Denum(2,[7, 3])”, “Denum(2,[5, 9])”, “Denum(2,[14, 3])”, “Denum(2,[5, 4])”, “Denum(2,[6, 3])”]",
|
|
2521
2519
|
"```",
|
|
2522
|
-
"Each keeps the full Count,
|
|
2520
|
+
"Each keeps the full Count, in both parities; leaves the",
|
|
2523
2521
|
"receiver as it was, even through a mutable name; and refuses a sizeless operand",
|
|
2524
2522
|
"with its failure",
|
|
2525
2523
|
"```",
|
|
2526
|
-
"; [(D + 2.5).#, (D + 2.5)
|
|
2527
|
-
"# [2,
|
|
2528
|
-
"; .q_ (
|
|
2524
|
+
"; [(D + 2.5).#, (D + 2.5).# %% 2, (P - 1.5).#, (P - 1.5).# %% 2, “” D, “” P]",
|
|
2525
|
+
"# [2, 0, 1, 1, “Denum(2,[5, 3])”, “Denum(1,[5, 3])”]",
|
|
2526
|
+
"; .q_ (Denum [2, [5, 3]]);",
|
|
2529
2527
|
"; [“” (q_ + 2.5), “” (q_ - 2.5), “” (q_ * 2.5), “” q_]",
|
|
2530
|
-
"# [“
|
|
2531
|
-
"; [D + ([2.5].nope), D - ([2.5].nope), (
|
|
2528
|
+
"# [“Denum(2,[5, 5])”, “Denum(2,[7, 3])”, “Denum(2,[10, 6])”, “Denum(2,[5, 3])”]",
|
|
2529
|
+
"; [D + ([2.5].nope), D - ([2.5].nope), (Denum [0, [0, 0]]) + ([].nope)]",
|
|
2532
2530
|
"# [$!.name-missing “..., $!.name-missing “..., $!.name-missing “...]",
|
|
2533
2531
|
"```",
|
|
2534
2532
|
"The argument cannot reach the receiver's names. A decimal is unit-taggable,",
|
|
2535
|
-
"`2.5.
|
|
2533
|
+
"`2.5.Denum` is a tagged number, and an aggregate can hold fields named like the",
|
|
2536
2534
|
"receiver's or its locals; none of them changes which state is updated, and",
|
|
2537
2535
|
"such an aggregate deposits only its elements' Size, here 4",
|
|
2538
2536
|
"```",
|
|
2539
|
-
"; (2.5).
|
|
2540
|
-
"# 2.5.
|
|
2541
|
-
"; [“” (D + [.
|
|
2542
|
-
"# [“
|
|
2537
|
+
"; (2.5).Denum",
|
|
2538
|
+
"# 2.5.Denum",
|
|
2539
|
+
"; [“” (D + [.Denum 9; .right 99; .left 99; .count 7; .k 50; 4]), “” (D - [.Denum 9; .left 99; .l 99; .s 50; 4])]",
|
|
2540
|
+
"# [“Denum(2,[5, 7])”, “Denum(2,[9, 3])”]",
|
|
2543
2541
|
"```",
|
|
2544
|
-
"The
|
|
2545
|
-
"deposit is not a
|
|
2542
|
+
"The deposit behind them takes a load index and a Count, for any arity, so a",
|
|
2543
|
+
"negative or fractional deposit is not a Denum and an index past the loads is",
|
|
2544
|
+
"refused",
|
|
2546
2545
|
"```",
|
|
2547
|
-
"; [D.
|
|
2548
|
-
"# [
|
|
2546
|
+
"; [“” (D.deposit_ [1, 2]), “” (D.deposit_ [0, 2]), “” ((Denum [0, [1, 2, 3]]).deposit_ [2, 4]), “” D]",
|
|
2547
|
+
"# [“Denum(2,[5, 5])”, “Denum(2,[7, 3])”, “Denum(0,[1, 2, 7])”, “Denum(2,[5, 3])”]",
|
|
2548
|
+
"; [D.deposit_ [1, (0 - 1)], D.deposit_ [0, 2.5], D.deposit_ 2, D.deposit_ [1, 2, 3], D.deposit_ [2, 1], D.deposit_ [(0 - 1), 1], D.deposit_ [“a”, 1]]",
|
|
2549
|
+
"# [$!!.invalid-denum, $!!.invalid-denum, $!!.invalid-denum, $!!.invalid-denum, $!!.invalid-arity, $!!.invalid-arity, $!!.invalid-arity]",
|
|
2549
2550
|
"```",
|
|
2550
|
-
"`*` scales by the operand's Size, so its domain is every sized Frame: a
|
|
2551
|
+
"`*` scales by the operand's Size, so its domain is every sized Frame: a Denum",
|
|
2551
2552
|
"contributes `L + R`, an aggregate its element count, a decimal its truncated",
|
|
2552
2553
|
"magnitude, and a zero Size annihilates both loads. `D * 3` is unchanged, since",
|
|
2553
2554
|
"`3.## = 3`, and the result keeps the Count in either parity",
|
|
2554
2555
|
"```",
|
|
2555
|
-
"; [“” (D * (
|
|
2556
|
-
"# [“
|
|
2556
|
+
"; [“” (D * (Denum [1, [2, 4]])), “” (D * [[], []]), “” (D * 2.5), “” (D * 0)]",
|
|
2557
|
+
"# [“Denum(2,[30, 18])”, “Denum(2,[10, 6])”, “Denum(2,[10, 6])”, “Denum(2,[0, 0])”]",
|
|
2557
2558
|
"; [“” (D * 1), (D * 3).#, (P * 3).#, “” (P * 3)]",
|
|
2558
|
-
"# [“
|
|
2559
|
+
"# [“Denum(2,[5, 3])”, 2, 1, “Denum(1,[15, 9])”]",
|
|
2559
2560
|
"```",
|
|
2560
2561
|
"The signed-scalar reading misleads: `+` lowers the residual and `-` raises it,",
|
|
2561
2562
|
"so `D + 4` is not “larger” than `D`, and `D - 4` is not `D` made smaller",
|
|
@@ -2567,11 +2568,11 @@ export const HC_SOURCES = new Map([
|
|
|
2567
2568
|
"Count and can leave a zero Count over nonzero loads. That state is present, and",
|
|
2568
2569
|
"its Size and residual read",
|
|
2569
2570
|
"```",
|
|
2570
|
-
"; .Y ((
|
|
2571
|
-
"; [“” Y, “” ((
|
|
2572
|
-
"# [“
|
|
2573
|
-
"; [“” (D * 3), (D.scale_ 2).#, ((D + 4) 1).#, ((D + 4) 1)
|
|
2574
|
-
"# [“
|
|
2571
|
+
"; .Y ((Denum [0, [0, 0]]) + 4);",
|
|
2572
|
+
"; [“” Y, “” ((Denum [0, [0, 0]]) - 4), Y.count, Y.# %% 2, Y.##, Y.###]",
|
|
2573
|
+
"# [“Denum(0,[0, 4])”, “Denum(0,[4, 0])”, 0, 0, 4, -4]",
|
|
2574
|
+
"; [“” (D * 3), (D.scale_ 2).#, ((D + 4) 1).#, ((D + 4) 1).# %% 2]",
|
|
2575
|
+
"# [“Denum(2,[15, 9])”, 2, 3, 1]",
|
|
2575
2576
|
"```",
|
|
2576
2577
|
"## Rational readings",
|
|
2577
2578
|
"",
|
|
@@ -2580,7 +2581,7 @@ export const HC_SOURCES = new Map([
|
|
|
2580
2581
|
"loads swapped the Size reading is unchanged and the residual reading changes",
|
|
2581
2582
|
"sign. With `L = 5`, `R = 0` they are the improper 5/2, neither 2 nor 3",
|
|
2582
2583
|
"```",
|
|
2583
|
-
"; .A (
|
|
2584
|
+
"; .A (Denum [2, [5, 1]]); .B (Denum [2, [1, 5]]); .D5 (Denum [2, [5, 0]]);",
|
|
2584
2585
|
"; [[A.##, A.###, A.size-ratio (), A.residual-ratio ()], [B.##, B.###, B.size-ratio (), B.residual-ratio ()], [D5.##, D5.###, D5.size-ratio (), D5.residual-ratio ()]]",
|
|
2585
2586
|
"# [[6, 4, 3, 2], [6, -4, 3, -2], [5, 5, 5/2, 5/2]]",
|
|
2586
2587
|
"```",
|
|
@@ -2588,16 +2589,16 @@ export const HC_SOURCES = new Map([
|
|
|
2588
2589
|
"reduces them: 6/4 reads 3/2, 8/6 reads 4/3. At `C = 1` they are the Size and the",
|
|
2589
2590
|
"residual, and an odd Count works as an even one does",
|
|
2590
2591
|
"```",
|
|
2591
|
-
"; [(
|
|
2592
|
+
"; [(Denum [2, [3, 2]]).size-ratio (), (Denum [2, [3, 2]]).residual-ratio ()]",
|
|
2592
2593
|
"# [5/2, 1/2]",
|
|
2593
|
-
"; [(
|
|
2594
|
+
"; [(Denum [4, [6, 0]]).size-ratio (), (Denum [4, [6, 0]]).residual-ratio (), (Denum [4, [5, 1]]).size-ratio (), (Denum [4, [5, 1]]).residual-ratio ()]",
|
|
2594
2595
|
"# [3/2, 3/2, 3/2, 1]",
|
|
2595
|
-
"; [(
|
|
2596
|
+
"; [(Denum [6, [10, 2]]).size-ratio (), (Denum [6, [10, 2]]).residual-ratio (), (Denum [3, [5, 1]]).size-ratio (), (Denum [3, [5, 1]]).residual-ratio ()]",
|
|
2596
2597
|
"# [2, 4/3, 2, 4/3]",
|
|
2597
|
-
"; [(
|
|
2598
|
+
"; [(Denum [1, [7, 2]]).size-ratio (), (Denum [1, [7, 2]]).residual-ratio (), (Denum [1, [2, 7]]).size-ratio (), (Denum [1, [2, 7]]).residual-ratio ()]",
|
|
2598
2599
|
"# [9, 5, 9, -5]",
|
|
2599
2600
|
"```",
|
|
2600
|
-
"Two Counts with the same
|
|
2601
|
+
"Two Counts with the same parity and loads give different ratios, as they are",
|
|
2601
2602
|
"different states: the ratio is what distinguishes `[2, 5, 1]` from `[4, 5, 1]`",
|
|
2602
2603
|
"beyond their identity",
|
|
2603
2604
|
"```",
|
|
@@ -2609,7 +2610,7 @@ export const HC_SOURCES = new Map([
|
|
|
2609
2610
|
"is a FrameInt, a non-whole one a FrameRational, and the residual reading is",
|
|
2610
2611
|
"signed",
|
|
2611
2612
|
"```",
|
|
2612
|
-
"; [(
|
|
2613
|
+
"; [(Denum [3, [1, 0]]).size-ratio (), (Denum [3, [0, 1]]).residual-ratio (), ((Denum [3, [1, 0]]).size-ratio ()) * 3]",
|
|
2613
2614
|
"# [1/3, -1/3, 1]",
|
|
2614
2615
|
"; [(A.size-ratio ()) * A.count = A.##, (A.residual-ratio ()) * A.count = A.###, (B.residual-ratio ()) * B.count = B.###, (D5.size-ratio ()) * D5.count = D5.##]",
|
|
2615
2616
|
"# [<>, <>, <>, <>]",
|
|
@@ -2617,16 +2618,16 @@ export const HC_SOURCES = new Map([
|
|
|
2617
2618
|
"# [<>, <>, (), <>, ()]",
|
|
2618
2619
|
"```",
|
|
2619
2620
|
"An empty state, a balanced nonempty one and a positive Count over empty loads all",
|
|
2620
|
-
"read zero, in either
|
|
2621
|
+
"read zero, in either parity",
|
|
2621
2622
|
"```",
|
|
2622
|
-
"; [(
|
|
2623
|
+
"; [(Denum [2, [0, 0]]).size-ratio (), (Denum [1, [0, 0]]).size-ratio (), (Denum [3, [0, 0]]).residual-ratio ()]",
|
|
2623
2624
|
"# [0, 0, 0]",
|
|
2624
|
-
"; [(
|
|
2625
|
+
"; [(Denum [2, [3, 3]]).size-ratio (), (Denum [2, [3, 3]]).residual-ratio (), (Denum [1, [3, 3]]).size-ratio (), (Denum [1, [3, 3]]).residual-ratio ()]",
|
|
2625
2626
|
"# [3, 0, 6, 0]",
|
|
2626
2627
|
"```",
|
|
2627
2628
|
"Loads too large for a machine integer give the same exact readings",
|
|
2628
2629
|
"```",
|
|
2629
|
-
"; .G (
|
|
2630
|
+
"; .G (Denum [1000000007, [123456789012345678901234567890, 987654321098765432109876543210]]);",
|
|
2630
2631
|
"; [(G.size-ratio ()) * G.count = G.##, (G.residual-ratio ()) * G.count = G.###, G.###]",
|
|
2631
2632
|
"# [<>, <>, -864197532086419753208641975320]",
|
|
2632
2633
|
"```",
|
|
@@ -2636,7 +2637,7 @@ export const HC_SOURCES = new Map([
|
|
|
2636
2637
|
"and its Size and residual still read, including after loads were added without",
|
|
2637
2638
|
"any application. This is absence, not a zero, a division error or an infinity",
|
|
2638
2639
|
"```",
|
|
2639
|
-
"; .Z0 (
|
|
2640
|
+
"; .Z0 (Denum [0, [3, 0]]); .Z1 (Denum [0, [0, 0]]); .Z2 ((Denum [0, [0, 0]]) + 4);",
|
|
2640
2641
|
"; [[Z0.##, Z0.###, Z0.size-ratio (), Z0.residual-ratio ()], [Z1.##, Z1.###, Z1.size-ratio (), Z1.residual-ratio ()], [Z2.##, Z2.###, Z2.size-ratio (), Z2.residual-ratio ()]]",
|
|
2641
2642
|
"# [[3, 3, (), ()], [0, 0, (), ()], [4, -4, (), ()]]",
|
|
2642
2643
|
"```",
|
|
@@ -2652,13 +2653,13 @@ export const HC_SOURCES = new Map([
|
|
|
2652
2653
|
"rather than read as the divisor, so it is neither `/` nor `%%`. The class",
|
|
2653
2654
|
"declares no `%%`, which answers nil as for any aggregate without one. Its `/`,",
|
|
2654
2655
|
"also spelled `./`, is not a ratio either: it redistributes the Size into that",
|
|
2655
|
-
"many channels and keeps the Count (007.27, below), so `A / 4` is a
|
|
2656
|
+
"many channels and keeps the Count (007.27, below), so `A / 4` is a Denum of four",
|
|
2656
2657
|
"loads and no number",
|
|
2657
2658
|
"```",
|
|
2658
2659
|
"; [A.size-ratio 4, A.residual-ratio [], A.size-ratio 0, A.residual-ratio “abc”]",
|
|
2659
2660
|
"# [$!!.unary-observation, $!!.unary-observation, $!!.unary-observation, $!!.unary-observation]",
|
|
2660
2661
|
"; [“” (A / 4), A %% 4]",
|
|
2661
|
-
"# [“
|
|
2662
|
+
"# [“Denum(2,[2, 2, 1, 1])”, ()]",
|
|
2662
2663
|
"```",
|
|
2663
2664
|
"A reading at the wrong depth fails safe. Inside a branch `_^` is not the",
|
|
2664
2665
|
"receiver, so a reading written that way answers `$!.name-missing` and no ratio",
|
|
@@ -2674,12 +2675,12 @@ export const HC_SOURCES = new Map([
|
|
|
2674
2675
|
"the 25 states have both readings absent",
|
|
2675
2676
|
"```",
|
|
2676
2677
|
"; .ccs [1, 2, 3, 4, 5]; .ls [0, 1, 2, 3, 4];",
|
|
2677
|
-
"; .statesP (ccs &| {.c _; ls &| {.l _; ls & {
|
|
2678
|
+
"; .statesP (ccs &| {.c _; ls &| {.l _; ls & {Denum [c, [l, _]]}}});",
|
|
2678
2679
|
"; .lawP {.k _; .c (k.count); [(((k.size-ratio ()) * c) = k.##), (((k.residual-ratio ()) * c) = k.###)]};",
|
|
2679
2680
|
"; .checksP (statesP &| lawP);",
|
|
2680
2681
|
"; [statesP.#, checksP.#, checksP = (checksP & {<>})]",
|
|
2681
2682
|
"# [125, 250, <>]",
|
|
2682
|
-
"; .statesZ (ls &| {.l _; ls & {
|
|
2683
|
+
"; .statesZ (ls &| {.l _; ls & {Denum [0, [l, _]]}});",
|
|
2683
2684
|
"; .lawZ {.k _; [(k.size-ratio () = ()), (k.residual-ratio () = ())]};",
|
|
2684
2685
|
"; .checksZ (statesZ &| lawZ);",
|
|
2685
2686
|
"; [statesZ.#, checksZ.#, checksZ = (checksZ & {<>})]",
|
|
@@ -2711,27 +2712,92 @@ export const HC_SOURCES = new Map([
|
|
|
2711
2712
|
"children it has routed, `left.# + right.#`, and its Size and residual from the",
|
|
2712
2713
|
"Sizes of those children. That is a structural count of the stored channels, not",
|
|
2713
2714
|
"a counter and not its phase. A router that routed two children from the empty",
|
|
2714
|
-
"state shares its Count, Size and residual with the
|
|
2715
|
+
"state shares its Count, Size and residual with the Denum that applied the same",
|
|
2715
2716
|
"two Sizes, and so does its fourth hash. This is a comparison of readings, not",
|
|
2716
|
-
"an identity: the router keeps the Frames and a
|
|
2717
|
+
"an identity: the router keeps the Frames and a Denum forgets them",
|
|
2717
2718
|
"```",
|
|
2718
2719
|
"; Routers <- './hc/rotor-router.hc';",
|
|
2719
2720
|
"; .rr (((Routers.RotorRouter [[], []]) 5) 1);",
|
|
2720
|
-
"; .kk (((
|
|
2721
|
-
"; [rr.#, rr.##, rr.###, kk.count, kk.#, kk.##, kk.###, (rr.
|
|
2721
|
+
"; .kk (((Denum [0, [0, 0]]) 5) 1);",
|
|
2722
|
+
"; [rr.#, rr.##, rr.###, kk.count, kk.#, kk.##, kk.###, ((rr.channels .0).# + (rr.channels .1).#), rr.#### = kk.####, (rr.# %% 2) = (kk.# %% 2)]",
|
|
2722
2723
|
"# [2, 6, 4, 2, 2, 6, 4, 2, <>, <>]",
|
|
2723
2724
|
"; .r4 (((rr 7) 2)); .k4 (((kk 7) 2));",
|
|
2724
|
-
"; [r4.#, k4.count, r4
|
|
2725
|
-
"# [4, 4,
|
|
2725
|
+
"; [r4.#, k4.count, (r4.# %% 2), k4.# %% 2, r4.#### = k4.####, (k4.size-ratio ()), (k4.residual-ratio ())]",
|
|
2726
|
+
"# [4, 4, 0, 0, <>, 15/4, 9/4]",
|
|
2727
|
+
"```",
|
|
2728
|
+
"## Count binding, `.#%`",
|
|
2729
|
+
"",
|
|
2730
|
+
"`d.#%` binds a Denum to its own Count (occurrence/figure 007.39a). For",
|
|
2731
|
+
"`d = (C; [a0, …, a(A−1)])` with `C > 0` it answers a new Denum of Count C and",
|
|
2732
|
+
"exactly C loads, where load j is the sum of every source load whose index is",
|
|
2733
|
+
"congruent to j mod C. With fewer loads than C the loads are copied and the rest",
|
|
2734
|
+
"are zero; with exactly C they are kept; with more, each further load folds onto",
|
|
2735
|
+
"the load its index names mod C. Nothing is cycled, replicated or cancelled. It",
|
|
2736
|
+
"is not the redistribution `./ n`, which deals Size units and ignores the",
|
|
2737
|
+
"order of the loads, and it is not a rank: it answers a Denum, never a number",
|
|
2738
|
+
"```",
|
|
2739
|
+
"; [“” ((Denum [3, [2, 5]]).#%), “” ((Denum [3, [2, 5, 3]]).#%), “” ((Denum [3, [2, 5, 3, 7]]).#%), “” ((Denum [3, [2, 5, 3, 7, 4]]).#%)]",
|
|
2740
|
+
"# [“Denum(3,[2, 5, 0])”, “Denum(3,[2, 5, 3])”, “Denum(3,[9, 5, 3])”, “Denum(3,[9, 9, 3])”]",
|
|
2741
|
+
"; [“” ((Denum [[2, 5, 3, 7, 4]]).#%), “” ((Denum [4, [6]]).#%), “” ((Denum [2, [4]]).#%), “” ((Denum [3, [0, 0, 0, 0, 0]]).#%), “” ((Denum [2, [5, 3]]).#%)]",
|
|
2742
|
+
"# [“Denum(1,[21])”, “Denum(4,[6, 0, 0, 0])”, “Denum(2,[4, 0])”, “Denum(3,[0, 0, 0])”, “Denum(2,[5, 3])”]",
|
|
2743
|
+
"```",
|
|
2744
|
+
"It keeps the Count, the total Size and nonnegative loads, its arity is the",
|
|
2745
|
+
"Count, it is idempotent, and its answer is an instance of this same class, so",
|
|
2746
|
+
"its fourth hash is itself. The receiver is left as it was",
|
|
2747
|
+
"```",
|
|
2748
|
+
"; .Bd (Denum [3, [2, 5, 3, 7, 4]]); .Bn (Bd.#%);",
|
|
2749
|
+
"; [Bn.#, Bn.##, Bd.##, Bn.loads.#, (Bn.#%) = Bn, Bn.#### = Bn, “” Bd]",
|
|
2750
|
+
"# [3, 21, 21, 3, <>, <>, “Denum(3,[2, 5, 3, 7, 4])”]",
|
|
2751
|
+
"; .lawB {.k _; .n (k.#%); [n.# = k.#, n.## = k.##, n.loads.# = k.#, (n.#%) = n]};",
|
|
2752
|
+
"; [Denum [1, [4, 4]], Denum [2, [1, 2, 3]], Denum [5, [9]], Denum [4, [1, 2, 3, 4, 5, 6, 7, 8, 9]], Denum [3, [123456789012345678901234567890, 1]]] &| lawB",
|
|
2753
|
+
"# [<>, <>, <>, <>, <>, <>, <>, <>, <>, <>, <>, <>, <>, <>, <>, <>, <>, <>, <>, <>]",
|
|
2754
|
+
"```",
|
|
2755
|
+
"Order matters. The same loads in another order can bind differently, so",
|
|
2756
|
+
"binding is neither permutation-invariant nor invertible",
|
|
2757
|
+
"```",
|
|
2758
|
+
"; [“” ((Denum [2, [1, 2, 3]]).#%), “” ((Denum [2, [3, 2, 1]]).#%), “” ((Denum [2, [2, 1, 3]]).#%), (Denum [2, [3, 1]]).#% = (Denum [2, [1, 3]]).#%]",
|
|
2759
|
+
"# [“Denum(2,[4, 2])”, “Denum(2,[4, 2])”, “Denum(2,[5, 1])”, ()]",
|
|
2760
|
+
"```",
|
|
2761
|
+
"Binding follows application: a Denum whose Count has grown past its arity binds",
|
|
2762
|
+
"into as many loads as it has seen",
|
|
2763
|
+
"```",
|
|
2764
|
+
"; .G3 ((((Denum [0, [0, 0]]) 2) 5) 3);",
|
|
2765
|
+
"; [“” G3, “” (G3.#%)]",
|
|
2766
|
+
"# [“Denum(3,[5, 5])”, “Denum(3,[5, 5, 0])”]",
|
|
2767
|
+
"```",
|
|
2768
|
+
"A Denum of Count zero is present, under `.####` too, but has no channel to bind",
|
|
2769
|
+
"into, so `.#%` refuses it with a stable named failure rather than nil, an empty",
|
|
2770
|
+
"Denum or a division by zero. Anything that is not a Denum is refused too, the",
|
|
2771
|
+
"way `.####` recognizes one: hosts, numbers, nil, forged records and aggregates",
|
|
2772
|
+
"that declare a `#%` of their own. A Count too large to materialize is refused",
|
|
2773
|
+
"separately, and nothing is allocated. The limit is 65536 loads: a Count of",
|
|
2774
|
+
"exactly 65536 binds into 65536 loads, and 65537 is refused",
|
|
2775
|
+
"```",
|
|
2776
|
+
"; .Z (Denum [0, [2, 5]]);",
|
|
2777
|
+
"; [Z.#### = Z, Z.#%, (Z.####).#%, [].####]",
|
|
2778
|
+
"# [<>, $!.denum-binding-zero-count, $!.denum-binding-zero-count, ()]",
|
|
2779
|
+
"; [[5, 3].#%, 3.#%, ().#%, “ab”.#%, {1}.#%, [.count 3; .loads [1, 2]].#%, [.#% {Denum [1, [1]]}].#%]",
|
|
2780
|
+
"# [$!.denum-binding-receiver, $!.denum-binding-receiver, $!.denum-binding-receiver, $!.denum-binding-receiver, $!.denum-binding-receiver, $!.denum-binding-receiver, $!.denum-binding-receiver]",
|
|
2781
|
+
"; [(Denum [70000, [1]]).#%, (Denum [123456789012345678901234567890, [1]]).#%, ([].nope).#%]",
|
|
2782
|
+
"# [$!.denum-binding-capacity, $!.denum-binding-capacity, $!.name-missing “...]",
|
|
2783
|
+
"; .Edge ((Denum [65536, [1, 2]]).#%);",
|
|
2784
|
+
"; [Edge.#, (Edge.loads).#, Edge.##, (Edge.loads) .0, (Edge.loads) .1, (Edge.loads) .65535, (Denum [65537, [1, 2]]).#%]",
|
|
2785
|
+
"# [65536, 65536, 3, 1, 2, 0, $!.denum-binding-capacity]",
|
|
2786
|
+
"```",
|
|
2787
|
+
"`.#%` is one token. `.#`, `%%` and a comment are read as before, and `.#%%`,",
|
|
2788
|
+
"which could be either, is refused by the lexer: write `.# %%`",
|
|
2789
|
+
"```",
|
|
2790
|
+
"; [[5, 3, 1].# %% 2, (Denum [3, [1]]).# %% 2, (Denum [3, [1]]).#% .#] # a comment after",
|
|
2791
|
+
"# [1, 1, 3]",
|
|
2726
2792
|
"```",
|
|
2727
2793
|
"## Importing",
|
|
2728
2794
|
"",
|
|
2729
2795
|
"Imported, the file binds the same class. The import is an example line, so",
|
|
2730
2796
|
"the evaluator, which reads this file without a root, never runs it",
|
|
2731
2797
|
"```",
|
|
2732
|
-
";
|
|
2733
|
-
"; [(
|
|
2734
|
-
"# [<>, “
|
|
2798
|
+
"; Denums <- './hc/denum.hc';",
|
|
2799
|
+
"; [(Denums.Denum [2, [5, 3]]) = [5, 3].####, “” ((Denums.Denum [0, [0, 0]]) 4)]",
|
|
2800
|
+
"# [<>, “Denum(1,[4, 0])”]",
|
|
2735
2801
|
"",
|
|
2736
2802
|
].join("\n"),
|
|
2737
2803
|
],
|
|
@@ -2767,21 +2833,21 @@ export const HC_SOURCES = new Map([
|
|
|
2767
2833
|
" channels, which a round-robin history fixes, and routes that history through",
|
|
2768
2834
|
" a fresh router of n channels. Its Count is unchanged and its next route goes",
|
|
2769
2835
|
" to channel C mod n.",
|
|
2770
|
-
"- **A
|
|
2836
|
+
"- **A Denum** (`hc/denum.hc`) forgot its Frames and kept only their Sizes, so it",
|
|
2771
2837
|
" deals Size units. `D ./ n` keeps the Count C and the total Size S and",
|
|
2772
2838
|
" canonicalizes the loads to S units dealt round-robin into n channels, so the",
|
|
2773
2839
|
" first S mod n channels hold ⌈S/n⌉ and the rest ⌊S/n⌋. Its next application",
|
|
2774
2840
|
" deposits into channel C mod n.",
|
|
2775
2841
|
"",
|
|
2776
|
-
"Router and list deal whole Frames, and a
|
|
2842
|
+
"Router and list deal whole Frames, and a Denum deals Size units. Both conserve",
|
|
2777
2843
|
"the summed Size, but their channel loads differ in general: children of Sizes",
|
|
2778
|
-
"5 and 2 dealt whole into two channels load them 5 and 2, while a
|
|
2844
|
+
"5 and 2 dealt whole into two channels load them 5 and 2, while a Denum of Size 7",
|
|
2779
2845
|
"normalizes to 4 and 3. No law makes them commute, and none is claimed here.",
|
|
2780
2846
|
"",
|
|
2781
2847
|
"Refusals are the native ones for all three: a divisor of zero is",
|
|
2782
2848
|
"`$!.division-by-zero /`, as it is for numbers, and anything but a Count is",
|
|
2783
2849
|
"`$!.division-domain /`, a negative or fractional number, a decimal, text, an",
|
|
2784
|
-
"aggregate or a
|
|
2850
|
+
"aggregate or a Denum included. A divisor above both 1,000,000 and the element count is `$!.repetition-size 1000000`, checked before anything is built; up to the element count is always allowed, so the answer stays proportional to the list.",
|
|
2785
2851
|
"```",
|
|
2786
2852
|
"```",
|
|
2787
2853
|
"## Lists",
|
|
@@ -2806,13 +2872,13 @@ export const HC_SOURCES = new Map([
|
|
|
2806
2872
|
"; [([A, A, A] ./ 2).channels, ([A, A, A] ./ 2).channels &| {_} &| {[_ === A]}]",
|
|
2807
2873
|
"# [[[[1, [2]], [1, [2]]], [[1, [2]]]], [<>, <>, <>]]",
|
|
2808
2874
|
"```",
|
|
2809
|
-
"Two channels are
|
|
2875
|
+
"Two channels are a router like any other. One",
|
|
2810
2876
|
"channel is the whole list, and more channels than elements leave the last ones",
|
|
2811
2877
|
"empty. An empty list deals into n empty channels; empty elements are dealt",
|
|
2812
2878
|
"like any other",
|
|
2813
2879
|
"```",
|
|
2814
|
-
"; [“” ([1, 2, 3] ./ 2), ([1, 2, 3] ./ 2).
|
|
2815
|
-
"# [“RotorRouter([1, 3],[2])”, [1, 3], 1]",
|
|
2880
|
+
"; [“” ([1, 2, 3] ./ 2), (([1, 2, 3] ./ 2).channels .0), (([1, 2, 3] ./ 2).# %% 2)]",
|
|
2881
|
+
"# [“RotorRouter([[1, 3], [2]])”, [1, 3], 1]",
|
|
2816
2882
|
"; [(xs ./ 1).channels, ([1, 2] ./ 5).channels, ([] ./ 3).channels, ([[], []] ./ 2).channels]",
|
|
2817
2883
|
"# [[[[1, [2]], “b”, { 5 + 3 }, [.k 9; 4], 5, (6, 7), 7]], [[1], [2], [], [], []], [[], [], []], [[[]], [[]]]]",
|
|
2818
2884
|
"```",
|
|
@@ -2837,7 +2903,7 @@ export const HC_SOURCES = new Map([
|
|
|
2837
2903
|
"```",
|
|
2838
2904
|
"; .X [A, 2, 3, 4, 5, 6];",
|
|
2839
2905
|
"; [“” (X ./ 2), “” ((X ./ 2) ./ 2), ((X ./ 2) ./ 2) = (X ./ 2), ((X ./ 2) ./ 3) = (X ./ 3), ((X ./ 3) ./ 2) = (X ./ 2)]",
|
|
2840
|
-
"# [“RotorRouter([[1, [2]], 3, 5],[2, 4, 6])”, “RotorRouter([[1, [2]], 3, 5],[2, 4, 6])”, <>, <>, <>]",
|
|
2906
|
+
"# [“RotorRouter([[[1, [2]], 3, 5], [2, 4, 6]])”, “RotorRouter([[[1, [2]], 3, 5], [2, 4, 6]])”, <>, <>, <>]",
|
|
2841
2907
|
"; [((X ./ 2) ./ 3).channels, (((X ./ 2) ./ 3).channels .0 .0) === A]",
|
|
2842
2908
|
"# [[[[1, [2]], 4], [2, 5], [3, 6]], <>]",
|
|
2843
2909
|
"```",
|
|
@@ -2845,8 +2911,8 @@ export const HC_SOURCES = new Map([
|
|
|
2845
2911
|
"two whole Frames, dealt as such, even when they look like channels",
|
|
2846
2912
|
"```",
|
|
2847
2913
|
"; .N [[1, 3, 5], [2, 4, 6]];",
|
|
2848
|
-
"; [“” (N ./ 2), (N ./ 2).
|
|
2849
|
-
"# [“RotorRouter([[1, 3, 5]],[[2, 4, 6]])”, <>, 2, “RotorRouter([[1, 3, 5]],[[2, 4, 6]])”]",
|
|
2914
|
+
"; [“” (N ./ 2), ((N ./ 2).channels .0) .0 = [1, 3, 5], (N ./ 2).# , “” ((N ./ 2) ./ 2)]",
|
|
2915
|
+
"# [“RotorRouter([[[1, 3, 5]], [[2, 4, 6]]])”, <>, 2, “RotorRouter([[[1, 3, 5]], [[2, 4, 6]]])”]",
|
|
2850
2916
|
"```",
|
|
2851
2917
|
"Uneven channels read back in dealt order: seven Frames into three channels,",
|
|
2852
2918
|
"then into one, give the seven in order; into two they are dealt again from",
|
|
@@ -2854,7 +2920,7 @@ export const HC_SOURCES = new Map([
|
|
|
2854
2920
|
"```",
|
|
2855
2921
|
"; .Y [1, 2, 3, 4, 5, 6, 7];",
|
|
2856
2922
|
"; [“” (Y ./ 3), (((Y ./ 3) ./ 1).channels .0) = Y, “” ((Y ./ 3) ./ 2), ((Y ./ 3) ./ 2) = (Y ./ 2)]",
|
|
2857
|
-
"# [“RotorRouter([[1, 4, 7], [2, 5], [3, 6]])”, <>, “RotorRouter([1, 3, 5, 7],[2, 4, 6])”, <>]",
|
|
2923
|
+
"# [“RotorRouter([[1, 4, 7], [2, 5], [3, 6]])”, <>, “RotorRouter([[1, 3, 5, 7], [2, 4, 6]])”, <>]",
|
|
2858
2924
|
"```",
|
|
2859
2925
|
"Channels that no round-robin history left have no dealt order to read, so no",
|
|
2860
2926
|
"router holds them and they are not divided: the constructor refuses them, and",
|
|
@@ -2869,7 +2935,7 @@ export const HC_SOURCES = new Map([
|
|
|
2869
2935
|
"",
|
|
2870
2936
|
"The divisor is a positive Count. Zero is division by zero, and anything else is",
|
|
2871
2937
|
"outside the domain, whatever its Size: a negative or fractional number, a",
|
|
2872
|
-
"decimal, text, an aggregate, a
|
|
2938
|
+
"decimal, text, an aggregate, a Denum. A divisor that is already an error is",
|
|
2873
2939
|
"answered as it is",
|
|
2874
2940
|
"```",
|
|
2875
2941
|
"; [[1, 2] ./ 0, [1, 2] ./ (3 - 1), [1, 2] ./ (0 - 2), [1, 2] ./ (1 / 2), [1, 2] ./ 1.5, [1, 2] ./ “two”, [1, 2] ./ [2]]",
|
|
@@ -2912,34 +2978,33 @@ export const HC_SOURCES = new Map([
|
|
|
2912
2978
|
"; ([Failing, 1] ./ 2).##",
|
|
2913
2979
|
"# $!.name-missing “...",
|
|
2914
2980
|
"```",
|
|
2915
|
-
"##
|
|
2981
|
+
"## Denum",
|
|
2916
2982
|
"",
|
|
2917
|
-
"A
|
|
2918
|
-
"Counts.
|
|
2919
|
-
"
|
|
2920
|
-
"Demi, which reads as `Demi(C,[…])`. Every Demi stores `count` and `loads`",
|
|
2983
|
+
"A Denum of any arity is `Denum [C, loads]`, a Count and a nonempty list of",
|
|
2984
|
+
"Counts. Every arity is the same class and reads as `Denum(C,[…])`.",
|
|
2985
|
+
"Every Denum stores `count` and `loads`",
|
|
2921
2986
|
"```",
|
|
2922
|
-
";
|
|
2923
|
-
"; .
|
|
2924
|
-
"; [“” (
|
|
2925
|
-
"# [“
|
|
2926
|
-
"; [“” (
|
|
2927
|
-
"# [“
|
|
2987
|
+
"; Denums <- './hc/denum.hc';",
|
|
2988
|
+
"; .Denum Denums.Denum;",
|
|
2989
|
+
"; [“” (Denum [3, [5, 2]]), (Denum [3, [5, 2]]) == (Denum [3, [5, 2]]), (Denum [3, [5, 2]]).loads .0, (Denum [3, [5, 2]]).loads]",
|
|
2990
|
+
"# [“Denum(3,[5, 2])”, <>, 5, [5, 2]]",
|
|
2991
|
+
"; [“” (Denum [0, [0, 0, 0]]), “” (Denum [4, [7]]), “” (Denum [2, [1, 2, 3, 4]]), (Denum [2, [1, 2, 3]]).loads, (Denum [2, [1, 2, 3]]).count]",
|
|
2992
|
+
"# [“Denum(0,[0, 0, 0])”, “Denum(4,[7])”, “Denum(2,[1, 2, 3, 4])”, [1, 2, 3], 2]",
|
|
2928
2993
|
"```",
|
|
2929
2994
|
"No channels, a load that is not a Count, and any other shape are refused",
|
|
2930
2995
|
"```",
|
|
2931
|
-
"; [
|
|
2932
|
-
"# [$!!.invalid-
|
|
2996
|
+
"; [Denum [2, []], Denum [2, [1, (0 - 1), 3]], Denum [2, [1, 1.5]], Denum [2, [1, [2]]], Denum [(0 - 2), [1]], Denum [2, 5], Denum [2, [[1], 3]], Denum [2, [1, 2], 3, 4]]",
|
|
2997
|
+
"# [$!!.invalid-denum, $!!.invalid-denum, $!!.invalid-denum, $!!.invalid-denum, $!!.invalid-denum, $!!.invalid-denum, $!!.invalid-denum, $!!.invalid-denum]",
|
|
2933
2998
|
"```",
|
|
2934
|
-
"A
|
|
2999
|
+
"A Denum observes as its loads do: its Count is C, its Size the sum of",
|
|
2935
3000
|
"its loads, and its residual their alternating sum, `e0 − e1 + e2 − …`, the",
|
|
2936
3001
|
"list residual, which for two loads is `L − R`",
|
|
2937
3002
|
"```",
|
|
2938
|
-
"; .d7 (
|
|
3003
|
+
"; .d7 (Denum [3, [5, 2]]); .q3 (d7 ./ 3);",
|
|
2939
3004
|
"; [q3.#, q3.##, q3.###, q3.count, q3.loads]",
|
|
2940
3005
|
"# [3, 7, 3, 3, [3, 2, 2]]",
|
|
2941
3006
|
"```",
|
|
2942
|
-
"##
|
|
3007
|
+
"## Denum division redistributes Size units",
|
|
2943
3008
|
"",
|
|
2944
3009
|
"`D ./ n` keeps the Count and the Size and deals the Size units round-robin into",
|
|
2945
3010
|
"n channels. For S = 7: into 2, 4 and 3; into 3, 3, 2 and 2; into 4, 2, 2, 2",
|
|
@@ -2947,30 +3012,30 @@ export const HC_SOURCES = new Map([
|
|
|
2947
3012
|
"the last are empty",
|
|
2948
3013
|
"```",
|
|
2949
3014
|
"; [“” (d7 ./ 2), “” (d7 ./ 3), “” (d7 ./ 4), “” (d7 ./ 1), “” (d7 ./ 9)]",
|
|
2950
|
-
"# [“
|
|
3015
|
+
"# [“Denum(3,[4, 3])”, “Denum(3,[3, 2, 2])”, “Denum(3,[2, 2, 2, 1])”, “Denum(3,[7])”, “Denum(3,[1, 1, 1, 1, 1, 1, 1, 0, 0])”]",
|
|
2951
3016
|
"```",
|
|
2952
|
-
"`
|
|
2953
|
-
"`
|
|
3017
|
+
"`Denum(3,[5,2]) ./ 3` is `Denum(3,[3,2,2])`, and so is the different state",
|
|
3018
|
+
"`Denum(3,[4,3]) ./ 3`. Normalization is many-to-one: equal Count and Size give",
|
|
2954
3019
|
"the same result, and the original distribution cannot be recovered",
|
|
2955
3020
|
"```",
|
|
2956
|
-
"; [q3 = (
|
|
3021
|
+
"; [q3 = (Denum [3, [3, 2, 2]]), ((Denum [3, [4, 3]]) ./ 3) = q3, (Denum [3, [4, 3]]) = d7, (d7 / 3) = q3, q3 = d7]",
|
|
2957
3022
|
"# [<>, <>, (), <>, ()]",
|
|
2958
3023
|
"```",
|
|
2959
3024
|
"It is idempotent, and dividing again renormalizes from the same Count and Size,",
|
|
2960
3025
|
"so the earlier division leaves no trace",
|
|
2961
3026
|
"```",
|
|
2962
3027
|
"; [(q3 ./ 3) = q3, (q3 ./ 2) = (d7 ./ 2), ((d7 ./ 4) ./ 3) = q3, “” (q3 ./ 2), ((q3 ./ 2) ./ 3) = q3]",
|
|
2963
|
-
"# [<>, <>, <>, “
|
|
3028
|
+
"# [<>, <>, <>, “Denum(3,[4, 3])”, <>]",
|
|
2964
3029
|
"```",
|
|
2965
3030
|
"Zero Size, zero Count, one channel, and more channels than Size or Count",
|
|
2966
3031
|
"```",
|
|
2967
|
-
"; [“” ((
|
|
2968
|
-
"# [“
|
|
3032
|
+
"; [“” ((Denum [0, [0, 0]]) ./ 3), “” ((Denum [0, [9, 0]]) ./ 4), “” ((Denum [0, [9, 0]]) ./ 1), “” ((Denum [2, [1, 1]]) ./ 5), “” ((Denum [1, [0, 0]]) ./ 2)]",
|
|
3033
|
+
"# [“Denum(0,[0, 0, 0])”, “Denum(0,[3, 2, 2, 2])”, “Denum(0,[9])”, “Denum(2,[1, 1, 0, 0, 0])”, “Denum(1,[0, 0])”]",
|
|
2969
3034
|
"```",
|
|
2970
3035
|
"The divisor is a channel Count, refused as a list refuses it, never coerced to",
|
|
2971
3036
|
"its Size",
|
|
2972
3037
|
"```",
|
|
2973
|
-
"; [d7 ./ 0, d7 ./ (3 - 1), d7 ./ 1.5, d7 ./ (1 / 2), d7 ./ [3], d7 ./ “three”, d7 ./ (
|
|
3038
|
+
"; [d7 ./ 0, d7 ./ (3 - 1), d7 ./ 1.5, d7 ./ (1 / 2), d7 ./ [3], d7 ./ “three”, d7 ./ (Denum [1, [1, 1]])]",
|
|
2974
3039
|
"# [$!.division-by-zero /, $!.division-domain /, $!.division-domain /, $!.division-domain /, $!.division-domain /, $!.division-domain /, $!.division-domain /]",
|
|
2975
3040
|
"```",
|
|
2976
3041
|
"## Applying after division",
|
|
@@ -2980,23 +3045,23 @@ export const HC_SOURCES = new Map([
|
|
|
2980
3045
|
"channels 0, 1, 2, 0 in turn",
|
|
2981
3046
|
"```",
|
|
2982
3047
|
"; [“” (q3 10), “” ((q3 10) 1), “” (((q3 10) 1) 1), “” ((((q3 10) 1) 1) 1)]",
|
|
2983
|
-
"# [“
|
|
2984
|
-
"; [“” ((
|
|
2985
|
-
"# [“
|
|
3048
|
+
"# [“Denum(4,[13, 2, 2])”, “Denum(5,[13, 3, 2])”, “Denum(6,[13, 3, 3])”, “Denum(7,[14, 3, 3])”]",
|
|
3049
|
+
"; [“” ((Denum [0, [0, 0, 0]]) 4), “” (((Denum [0, [0, 0, 0]]) 4) 0), “” ((((Denum [0, [0, 0, 0]]) 4) 0) 6)]",
|
|
3050
|
+
"# [“Denum(1,[4, 0, 0])”, “Denum(2,[4, 0, 0])”, “Denum(3,[4, 0, 6])”]",
|
|
2986
3051
|
"```",
|
|
2987
3052
|
"A reduce applies it the same way, and through a mutable name it writes in",
|
|
2988
|
-
"place. One channel takes every deposit, and two channels
|
|
3053
|
+
"place. One channel takes every deposit, and two channels alternate by the Count's",
|
|
2989
3054
|
"parity",
|
|
2990
3055
|
"```",
|
|
2991
|
-
"; “” ([5, 2, 7, 1, 0] | (
|
|
2992
|
-
"# “
|
|
2993
|
-
"; .m_ (
|
|
3056
|
+
"; “” ([5, 2, 7, 1, 0] | (Denum [0, [0, 0, 0]]))",
|
|
3057
|
+
"# “Denum(5,[6, 2, 7])”",
|
|
3058
|
+
"; .m_ (Denum [0, [0, 0, 0]]);",
|
|
2994
3059
|
"; m_ 5;",
|
|
2995
3060
|
"; m_ 6;",
|
|
2996
3061
|
"; [“” m_, “” ((d7 ./ 1) 4), “” ((d7 ./ 2) 4), “” (d7 4)]",
|
|
2997
|
-
"# [“
|
|
3062
|
+
"# [“Denum(2,[5, 6, 0])”, “Denum(4,[11])”, “Denum(4,[4, 7])”, “Denum(4,[5, 6])”]",
|
|
2998
3063
|
"```",
|
|
2999
|
-
"##
|
|
3064
|
+
"## Denum laws",
|
|
3000
3065
|
"",
|
|
3001
3066
|
"For every Count 0 to 3, every pair of loads 0 to 4 (100 states) and every n",
|
|
3002
3067
|
"from 1 to 4: the Count and Size are kept, there are n loads, they are the",
|
|
@@ -3004,55 +3069,54 @@ export const HC_SOURCES = new Map([
|
|
|
3004
3069
|
"m from 1 to 4 dividing by n then m is dividing by m",
|
|
3005
3070
|
"```",
|
|
3006
3071
|
"; .cs [0, 1, 2, 3]; .ls [0, 1, 2, 3, 4]; .ns [1, 2, 3, 4];",
|
|
3007
|
-
"; .states (cs &| {.c _; ls &| {.l _; ls & {
|
|
3072
|
+
"; .states (cs &| {.c _; ls &| {.l _; ls & {Denum [c, [l, _]]}}});",
|
|
3008
3073
|
"; .law {.k _; ns &| {.n _; .q (k ./ n); [q.# = k.#, q.## = k.##, q.loads.# = n, q.loads = (((k.## [1]) ./ n).channels & {_.#}), (q ./ n) = q]}};",
|
|
3009
3074
|
"; .renorm {.k _; ns &| {.n _; ns & {.m _; ((k ./ n) ./ m) = (k ./ m)}}};",
|
|
3010
3075
|
"; .checks ((states &| law) | (states &| renorm));",
|
|
3011
3076
|
"; [states.#, checks.#, checks = (checks & {<>})]",
|
|
3012
3077
|
"# [100, 3600, <>]",
|
|
3013
3078
|
"```",
|
|
3014
|
-
"##
|
|
3079
|
+
"## Denum operations",
|
|
3015
3080
|
"",
|
|
3016
|
-
"Its fourth hash is intrinsic
|
|
3017
|
-
"
|
|
3018
|
-
"
|
|
3081
|
+
"Its fourth hash is intrinsic for every arity: a fresh equal Denum of the same",
|
|
3082
|
+
"arity, Count zero included. A record that only spells the fields is not one, and",
|
|
3083
|
+
"forged observers give the ordinary derived Denum of two loads",
|
|
3019
3084
|
"```",
|
|
3020
|
-
"; [(q3.####) == q3, (q3.####) === q3, ((
|
|
3085
|
+
"; [(q3.####) == q3, (q3.####) === q3, ((Denum [0, [0, 0, 0]]).####) = (Denum [0, [0, 0, 0]]), ([5, 2].#### ./ 3) = (Denum [2, [3, 2, 2]])]",
|
|
3021
3086
|
"# [<>, (), <>, <>]",
|
|
3022
3087
|
"; [[.count 3; .loads [3, 2, 2]].####, “” ([.count 3; .loads [3, 2, 2]; .# {3}; .## {7}; .### {3}].####)]",
|
|
3023
|
-
"# [(), “
|
|
3088
|
+
"# [(), “Denum(3,[5, 2])”]",
|
|
3024
3089
|
"```",
|
|
3025
3090
|
"`*` and `scale_` scale every load and keep the Count; the ratios read Size and",
|
|
3026
3091
|
"residual over the Count, nil at Count zero",
|
|
3027
3092
|
"```",
|
|
3028
|
-
"; [“” (q3 * 2), “” (q3.scale_ 3), q3.size-ratio (), q3.residual-ratio (), (
|
|
3029
|
-
"# [“
|
|
3093
|
+
"; [“” (q3 * 2), “” (q3.scale_ 3), q3.size-ratio (), q3.residual-ratio (), (Denum [0, [3, 2, 2]]).size-ratio ()]",
|
|
3094
|
+
"# [“Denum(3,[6, 4, 4])”, “Denum(3,[9, 6, 6])”, 7/3, 1, ()]",
|
|
3030
3095
|
"```",
|
|
3031
3096
|
"`+` and `-` follow the residual's signs. The residual adds the loads at even",
|
|
3032
3097
|
"indices and subtracts those at odd ones, so `-` deposits `x.##` on the first",
|
|
3033
3098
|
"even load, load 0, and raises the residual, and `+` deposits on the first odd",
|
|
3034
|
-
"load, load 1, and lowers it.
|
|
3035
|
-
"
|
|
3036
|
-
"by the operand's Size. One load has no odd index, so there `+` is",
|
|
3099
|
+
"load, load 1, and lowers it. Both keep the Count, and both are `deposit_ [0, x.##]` and",
|
|
3100
|
+
"`deposit_ [1, x.##]`. One load has no odd index, so there `+` is",
|
|
3037
3101
|
"`$!!.invalid-arity`",
|
|
3038
3102
|
"```",
|
|
3039
3103
|
"; [“” (q3 + 1), “” (q3 - 1), q3.###, (q3 + 1).###, (q3 - 1).###, (q3 + 1).#]",
|
|
3040
|
-
"# [“
|
|
3104
|
+
"# [“Denum(3,[3, 3, 2])”, “Denum(3,[4, 2, 2])”, 3, 2, 4, 3]",
|
|
3041
3105
|
"; [“” ((d7 ./ 4) + 1), “” ((d7 ./ 4) - 2.5), (d7 ./ 1) + 1, “” ((d7 ./ 1) - 1), “” (d7 + 1), “” (d7 - 1)]",
|
|
3042
|
-
"# [“
|
|
3043
|
-
"; [((q3 + 4) - 2) = ((q3 - 2) + 4), ((q3 + 1) ./ 3) = ((q3 - 1) ./ 3), q3 + ([].nope), q3.
|
|
3044
|
-
"# [<>, <>, $!.name-missing “..., $!!.invalid-
|
|
3106
|
+
"# [“Denum(3,[2, 3, 2, 1])”, “Denum(3,[4, 2, 2, 1])”, $!!.invalid-arity, “Denum(3,[8])”, “Denum(3,[5, 3])”, “Denum(3,[6, 2])”]",
|
|
3107
|
+
"; [((q3 + 4) - 2) = ((q3 - 2) + 4), ((q3 + 1) ./ 3) = ((q3 - 1) ./ 3), q3 + ([].nope), q3.deposit_ [1, (0 - 1)], q3.deposit_ [0, 1.5], “” q3]",
|
|
3108
|
+
"# [<>, <>, $!.name-missing “..., $!!.invalid-denum, $!!.invalid-denum, “Denum(3,[3, 2, 2])”]",
|
|
3045
3109
|
"```",
|
|
3046
3110
|
"## RotorRouter",
|
|
3047
3111
|
"",
|
|
3048
|
-
"`RotorRouter [ch0, …, chk−1]` takes k ≥ 1 channel arrays
|
|
3049
|
-
"
|
|
3112
|
+
"`RotorRouter [ch0, …, chk−1]` takes k ≥ 1 channel arrays, and every router, of",
|
|
3113
|
+
"any number of channels, is the same class and stores `channels`.",
|
|
3050
3114
|
"A round-robin history from channel 0 fills the channels so that the first",
|
|
3051
3115
|
"C mod k hold one more than the rest, so the constructor admits exactly the",
|
|
3052
3116
|
"channels whose Counts are the dealing of C into k, and refuses every other",
|
|
3053
3117
|
"```",
|
|
3054
3118
|
"; [[[]], [[], []], [[], [], []], [[], [], [], []]] & {“” (RotorRouter _)}",
|
|
3055
|
-
"# [“RotorRouter([[]])”, “RotorRouter([],[])”, “RotorRouter([[], [], []])”, “RotorRouter([[], [], [], []])”]",
|
|
3119
|
+
"# [“RotorRouter([[]])”, “RotorRouter([[], []])”, “RotorRouter([[], [], []])”, “RotorRouter([[], [], [], []])”]",
|
|
3056
3120
|
"; [[[5]], [[5], [6]], [[5], [], []], [[5], [6], []], [[5, 8], [6], [7]], [[5, 9], [6], [7], [8]]] & {(RotorRouter _).#}",
|
|
3057
3121
|
"# [1, 2, 1, 2, 4, 5]",
|
|
3058
3122
|
"; [RotorRouter [[1], [2], [3, 4]], RotorRouter [[1], [], [2]], RotorRouter [[1, 2, 3], [4], [5]], RotorRouter [[], [1]], RotorRouter [[1, 2], [3], [4], [5], [6, 7]], RotorRouter []]",
|
|
@@ -3082,15 +3146,15 @@ export const HC_SOURCES = new Map([
|
|
|
3082
3146
|
"# [[<>, (), ()], [<>, ()], 9, <>]",
|
|
3083
3147
|
"```",
|
|
3084
3148
|
"Division is idempotent and renormalizes: dividing again re-deals the same",
|
|
3085
|
-
"history, so a router divided by 3 and then 2 is the
|
|
3149
|
+
"history, so a router divided by 3 and then 2 is the two-channel router it came",
|
|
3086
3150
|
"from. The empty router divides into empty channels",
|
|
3087
3151
|
"```",
|
|
3088
3152
|
"; [(t3 ./ 3) = t3, (t3 ./ 2) = r7, ((r7 ./ 4) ./ 3) = t3, ((t3 ./ 4) ./ 2) = r7, “” (r0 ./ 3), (r0 ./ 3).#, ((RotorRouter [[], [], []]) ./ 2) = r0]",
|
|
3089
3153
|
"# [<>, <>, <>, <>, “RotorRouter([[], [], []])”, 0, <>]",
|
|
3090
3154
|
"```",
|
|
3091
3155
|
"After division the next route goes to channel C mod n: `t3` has Count 7, so 8,",
|
|
3092
|
-
"9 and 10 go to channels 1, 2 and 0. Divided back into two, it is the
|
|
3093
|
-
"router that routed the same Frames",
|
|
3156
|
+
"9 and 10 go to channels 1, 2 and 0. Divided back into two, it is the",
|
|
3157
|
+
"two-channel router that routed the same Frames",
|
|
3094
3158
|
"```",
|
|
3095
3159
|
"; [“” (t3 8), “” ((t3 8) 9), “” (((t3 8) 9) 10)]",
|
|
3096
3160
|
"# [“RotorRouter([[[1, [2]], [.k 9; 4], 7], [“b”, 5, 8], [{ 5 + 3 }, (6, 7)]])”, “RotorRouter([[[1, [2]], [.k 9; 4], 7], [“b”, 5, 8], [{ 5 + 3 }, (6, 7), 9]])”, “RotorRouter([[[1, [2]], [.k 9; 4], 7, 10], [“b”, 5, 8], [{ 5 + 3 }, (6, 7), 9]])”]",
|
|
@@ -3135,23 +3199,22 @@ export const HC_SOURCES = new Map([
|
|
|
3135
3199
|
"```",
|
|
3136
3200
|
"The divisor is refused as for a list",
|
|
3137
3201
|
"```",
|
|
3138
|
-
"; [r7 ./ 0, r7 ./ (3 - 1), r7 ./ 1.5, r7 ./ [2], r7 ./ (
|
|
3202
|
+
"; [r7 ./ 0, r7 ./ (3 - 1), r7 ./ 1.5, r7 ./ [2], r7 ./ (Denum [1, [1, 1]]), r7 ./ “two”]",
|
|
3139
3203
|
"# [$!.division-by-zero /, $!.division-domain /, $!.division-domain /, $!.division-domain /, $!.division-domain /, $!.division-domain /]",
|
|
3140
3204
|
"```",
|
|
3141
3205
|
"## A router's observers and fourth hash",
|
|
3142
3206
|
"",
|
|
3143
3207
|
"A router of any arity declares its Count C, its Size, the sum of its channel",
|
|
3144
|
-
"loads, and its residual, their alternating sum, as
|
|
3145
|
-
"fourth hash is the
|
|
3146
|
-
"
|
|
3147
|
-
"answers `
|
|
3148
|
-
"C mod k as its
|
|
3149
|
-
"
|
|
3150
|
-
"
|
|
3151
|
-
"
|
|
3152
|
-
"# [7, 42, 30, “Demi(7,[14, 6, 22])”, <>, <>, <>]",
|
|
3208
|
+
"loads, and its residual, their alternating sum, as its Denum does. Its",
|
|
3209
|
+
"fourth hash is the Denum of the same arity: a router of k channels is",
|
|
3210
|
+
"recognized intrinsically, as an instance of the shipped class, and",
|
|
3211
|
+
"answers `Denum [C, loads]`, one load per channel, so it routes to channel",
|
|
3212
|
+
"C mod k as its Denum deposits there. At Count zero there is no Denum, for any arity",
|
|
3213
|
+
"```",
|
|
3214
|
+
"; [t3.#, t3.##, t3.###, “” t3.####, t3.#### = (Denum [7, [14, 6, 22]]), t3.####.## = t3.##, t3.####.### = t3.###]",
|
|
3215
|
+
"# [7, 42, 30, “Denum(7,[14, 6, 22])”, <>, <>, <>]",
|
|
3153
3216
|
"; [“” (r7.####), ([] ./ 3).####, (RotorRouter [[], [], []]).####, “” ((([] ./ 3) 5).####)]",
|
|
3154
|
-
"# [“
|
|
3217
|
+
"# [“Denum(7,[24, 18])”, (), (), “Denum(1,[5, 0, 0])”]",
|
|
3155
3218
|
"```",
|
|
3156
3219
|
"So the projection law `(r y).#### = r.#### y` holds for every arity: routing y",
|
|
3157
3220
|
"to channel C mod k and observing is depositing `y.##` there",
|
|
@@ -3160,7 +3223,7 @@ export const HC_SOURCES = new Map([
|
|
|
3160
3223
|
"; [1, 2, 3, 4, 5] & {.r (nine ./ _); ((r 10).####) = ((r.####) 10)}",
|
|
3161
3224
|
"# [<>, <>, <>, <>, <>]",
|
|
3162
3225
|
"; [“” ((t3 10).####), “” ((nine ./ 1).####), “” ((nine ./ 4).####)]",
|
|
3163
|
-
"# [“
|
|
3226
|
+
"# [“Denum(8,[14, 16, 22])”, “Denum(9,[45])”, “Denum(9,[15, 8, 10, 12])”]",
|
|
3164
3227
|
"```",
|
|
3165
3228
|
"Recognition reads nothing the router computes: a record that only spells",
|
|
3166
3229
|
"`channels` is not a router, and a failed child Size is answered as it is",
|
|
@@ -3172,12 +3235,12 @@ export const HC_SOURCES = new Map([
|
|
|
3172
3235
|
"",
|
|
3173
3236
|
"Whole-Frame division and Size-unit division agree on the total and differ on",
|
|
3174
3237
|
"the channels. Children of Sizes 5 and 2 dealt into two channels load them 5",
|
|
3175
|
-
"and 2, as list and router; the
|
|
3238
|
+
"and 2, as list and router; the Denum of the same list, normalized, loads them 4",
|
|
3176
3239
|
"and 3. They are different states with the same Size, and neither is wrong",
|
|
3177
3240
|
"```",
|
|
3178
3241
|
"; .two [5, 2];",
|
|
3179
3242
|
"; [loads (two ./ 2).channels, ((two | r0) ./ 2).channels & {load _}, “” (two.#### ./ 2), ((two | r0) ./ 2).#### = (two.#### ./ 2), ((two | r0) ./ 2).####.## = (two.#### ./ 2).##]",
|
|
3180
|
-
"# [[5, 2], [5, 2], “
|
|
3243
|
+
"# [[5, 2], [5, 2], “Denum(2,[4, 3])”, (), <>]",
|
|
3181
3244
|
"```",
|
|
3182
3245
|
"They agree when every child has Size one, since then each Frame is one Size",
|
|
3183
3246
|
"unit. With other Sizes they need not",
|
|
@@ -3394,47 +3457,47 @@ export const HC_SOURCES = new Map([
|
|
|
3394
3457
|
"; [.tag 1;] * [[]]",
|
|
3395
3458
|
"# $!.star-metadata *",
|
|
3396
3459
|
"```",
|
|
3397
|
-
"The fourth observer derives a
|
|
3398
|
-
"A zero Count or absent residual gives no
|
|
3399
|
-
"as an explicit element contributes Size normally, even though its own
|
|
3400
|
-
"A present
|
|
3460
|
+
"The fourth observer derives a Denum from Count, Size and residual.",
|
|
3461
|
+
"A zero Count or absent residual gives no Denum; errors propagate. A schema used",
|
|
3462
|
+
"as an explicit element contributes Size normally, even though its own Denum is nil.",
|
|
3463
|
+
"A present Denum has Count C, Size L+R and residual L−R. Its Count is its full",
|
|
3401
3464
|
"application Count (007.25c), and its phase is derived from the parity of that",
|
|
3402
3465
|
"Count: 2 for even and 1 for odd. The derivation therefore reconstructs its data",
|
|
3403
|
-
"value on repeated fourth observation, including present zero loads; a
|
|
3466
|
+
"value on repeated fourth observation, including present zero loads; a Denum of",
|
|
3404
3467
|
"Count zero, which the observers cannot tell from an empty host, declares its own",
|
|
3405
|
-
"fourth hash (`hc/
|
|
3406
|
-
"A present
|
|
3407
|
-
"reads as text `
|
|
3468
|
+
"fourth hash (`hc/denum.hc`).",
|
|
3469
|
+
"A present Denum is an instance of the HC class in `hc/denum.hc` (011.20), and",
|
|
3470
|
+
"reads as text `Denum(count,left,right)`. Applying a Denum to Y deposits Y's Size",
|
|
3408
3471
|
"and adds one to the Count, so for a nonempty Figure host X, (X Y).#### is",
|
|
3409
|
-
"X.#### Y; for an empty host, start from the
|
|
3472
|
+
"X.#### Y; for an empty host, start from the Denum of Count zero instead,",
|
|
3410
3473
|
"because [].#### is nil. Scaling is the method `scale_`, the shadow of Star:",
|
|
3411
3474
|
"(X * Y).#### is X.####.scale_ (Y.##) for a nonempty host. Count is a terminal",
|
|
3412
3475
|
"quantity: positive Counts agree with pure Figures of that terminal Size, but 0",
|
|
3413
|
-
"has Size 0 while [] has Size 1. Mixed values may have present zero-load
|
|
3476
|
+
"has Size 0 while [] has Size 1. Mixed values may have present zero-load Denums,",
|
|
3414
3477
|
"including [0].####.",
|
|
3415
3478
|
"```",
|
|
3416
3479
|
"; [[].####, 0.####, “” “hello”.####, <2,3,5>.####]",
|
|
3417
|
-
"# [(), (), “
|
|
3480
|
+
"# [(), (), “Denum(5,[3, 2])”, ()]",
|
|
3418
3481
|
"; [(10 - 5).#### = 5.####, (0 - 5).#### = 5.####, (5.0).#### = 5.####, “hello”.#### = 5.####]",
|
|
3419
3482
|
"# [<>, <>, <>, <>]",
|
|
3420
3483
|
"; [<>.#, <>.##, <>.###, ().##]",
|
|
3421
3484
|
"# [0, 1, 0, 1]",
|
|
3422
3485
|
"; [1, 2, 3, 7] & {“” _.####}",
|
|
3423
|
-
"# [“
|
|
3486
|
+
"# [“Denum(1,[1, 0])”, “Denum(2,[1, 1])”, “Denum(3,[2, 1])”, “Denum(7,[4, 3])”]",
|
|
3424
3487
|
"; [[0], [“hello”], [<2,3,5>,2], {5 + 3}] & {“” _.####}",
|
|
3425
|
-
"# [“
|
|
3488
|
+
"# [“Denum(1,[0, 0])”, “Denum(1,[5, 0])”, “Denum(2,[3, 2])”, “Denum(3,[8, 1])”]",
|
|
3426
3489
|
"; [“” ([[],[]].#### 3), “” (7.####.scale_ 2), ([[],[]] 3).#### = ([[],[]].#### 3)]",
|
|
3427
|
-
"# [“
|
|
3490
|
+
"# [“Denum(3,[4, 1])”, “Denum(7,[8, 6])”, <>]",
|
|
3428
3491
|
"```",
|
|
3429
3492
|
"A RotorRouter, the class in `hc/rotor-router.hc` (011.21), keeps the routed",
|
|
3430
3493
|
"Figures themselves in two ordered channels and declares the observers that make",
|
|
3431
|
-
"its fourth hash their
|
|
3494
|
+
"its fourth hash their Denum. Routing a Figure's children in turn from the initial",
|
|
3432
3495
|
"router sends the even positions left and the odd ones right, and that router's",
|
|
3433
3496
|
"fourth hash is the Figure's.",
|
|
3434
3497
|
"```",
|
|
3435
3498
|
"; Routers <- './hc/rotor-router.hc';",
|
|
3436
3499
|
"; .fr ([[], [[], []], []] | (Routers.RotorRouter [[], []]));",
|
|
3437
|
-
"; [fr.
|
|
3500
|
+
"; [(fr.channels .0), (fr.channels .1), fr.#### = [[], [[], []], []].####]",
|
|
3438
3501
|
"# [[[], []], [[[], []]], <>]",
|
|
3439
3502
|
"",
|
|
3440
3503
|
"```",
|
|
@@ -4060,100 +4123,82 @@ export const HC_SOURCES = new Map([
|
|
|
4060
4123
|
"```",
|
|
4061
4124
|
"RotorRouter (occurrence/figure 011.21)",
|
|
4062
4125
|
"",
|
|
4063
|
-
"A RotorRouter is a
|
|
4064
|
-
"
|
|
4065
|
-
"else. Applying a router to a Frame appends that Frame, the same Frame,
|
|
4066
|
-
"channel
|
|
4067
|
-
"router keeps the children, so its numerical shadow
|
|
4068
|
-
"everything that shadow forgets: which Frames, in
|
|
4126
|
+
"A RotorRouter is a router of k ordered channels, k ≥ 1, that keeps what it",
|
|
4127
|
+
"routes. Its state is the channels, arrays of the Frames routed into them, and",
|
|
4128
|
+
"nothing else. Applying a router to a Frame appends that Frame, the same Frame,",
|
|
4129
|
+
"to channel `C mod k`, where C is the children it holds. A Denum follows the same",
|
|
4130
|
+
"round-robin by Size alone; a router keeps the children, so its numerical shadow",
|
|
4131
|
+
"is a Denum and its state is everything that shadow forgets: which Frames, in",
|
|
4132
|
+
"what order, and which channel. Every number of channels is the same class, with",
|
|
4133
|
+
"the same fields, methods and text; two channels are not a special case.",
|
|
4069
4134
|
"",
|
|
4070
|
-
"`RotorRouter` is an ordinary HC class, like `
|
|
4135
|
+
"`RotorRouter` is an ordinary HC class, like `Denum` in `hc/denum.hc`: a",
|
|
4071
4136
|
"constructor closure answering a fresh aggregate whose fields are its state and",
|
|
4072
4137
|
"whose methods are the class. Import it with",
|
|
4073
4138
|
"`Routers <- './hc/rotor-router.hc'`, then `Routers.RotorRouter [[], []]`.",
|
|
4074
4139
|
"",
|
|
4075
|
-
"**State (007.25e).** `RotorRouter [
|
|
4076
|
-
"ordered channels.
|
|
4077
|
-
"
|
|
4078
|
-
"
|
|
4079
|
-
"
|
|
4080
|
-
"
|
|
4081
|
-
"
|
|
4082
|
-
"",
|
|
4083
|
-
"**Admissibility.** Routing from empty channels starts
|
|
4084
|
-
"
|
|
4085
|
-
"
|
|
4086
|
-
"
|
|
4087
|
-
"
|
|
4088
|
-
"
|
|
4140
|
+
"**State (007.25e, 007.40).** `RotorRouter [ch0, …, chk−1]` takes k ≥ 1 arrays,",
|
|
4141
|
+
"the ordered channels. A router stores exactly one field, `channels`, so nothing",
|
|
4142
|
+
"can disagree with it. Its Count C is the children it holds, and the next route",
|
|
4143
|
+
"goes to channel `C mod k`. There is no phase argument: earlier versions took",
|
|
4144
|
+
"`RotorRouter [phase, left, right]`, a free phase beside the channels; that form",
|
|
4145
|
+
"is removed, with no alias. Through v0.49.0 the two-channel router was a",
|
|
4146
|
+
"separate builder that also stored `left`, `right` and `phase`.",
|
|
4147
|
+
"",
|
|
4148
|
+
"**Admissibility.** Routing from empty channels starts at channel 0 and deals",
|
|
4149
|
+
"round-robin, so a routed history leaves the first `C mod k` channels one longer",
|
|
4150
|
+
"than the rest, and conversely every such profile is the one history that sent",
|
|
4151
|
+
"`ch0.0`, `ch1.0`, …, `ch0.1`, … in turn. The constructor admits exactly the",
|
|
4152
|
+
"channels whose Counts are the dealing of C children into k,",
|
|
4153
|
+
"`round-robin [C, k]`, and refuses every other with `$!!.invalid-router`, a",
|
|
4154
|
+
"named error, as `Denum` refuses with `$!!.invalid-denum`: with two channels,",
|
|
4089
4155
|
"`RotorRouter [[A], [B, C]]` and `RotorRouter [[A, B], []]` are not histories,",
|
|
4090
4156
|
"and no history or offset is invented for them. Routing keeps the invariant, so",
|
|
4091
4157
|
"every router a program can hold satisfies it. A channel is its elements: an",
|
|
4092
4158
|
"array's properties are configuration, not routed Frames, so the constructor",
|
|
4093
4159
|
"keeps the elements in a fresh array of its own, counts them there, and a",
|
|
4094
4160
|
"channel argument that declares `apply` cannot change what appending means.",
|
|
4095
|
-
"Anything that is not a nonempty list of arrays is refused the same way
|
|
4096
|
-
"
|
|
4097
|
-
"",
|
|
4098
|
-
"
|
|
4099
|
-
"
|
|
4100
|
-
"
|
|
4101
|
-
"it
|
|
4102
|
-
"
|
|
4103
|
-
"
|
|
4104
|
-
"other. A Frame of Size zero still takes a slot and flips the phase. It is a",
|
|
4161
|
+
"Anything that is not a nonempty list of arrays is refused the same way.",
|
|
4162
|
+
"",
|
|
4163
|
+
"**Routing**, `router x`: append x as one member of channel `C mod k`; the Count",
|
|
4164
|
+
"grows by one. A small cursor, built in the route itself, rebuilds the list of",
|
|
4165
|
+
"channels with the Frame added to that one, so a route costs one pass over the k channels and",
|
|
4166
|
+
"never replays the history (PR #482 review). Routing never evaluates x, never",
|
|
4167
|
+
"measures it, and never runs its methods, so a closure is kept uncalled, an",
|
|
4168
|
+
"array or group is kept as one member, and a Frame whose Size fails or runs code",
|
|
4169
|
+
"is routed like any other. A Frame of Size zero still takes a slot. It is a",
|
|
4105
4170
|
"mutating method, `apply_`, so through a name it is a functional update that",
|
|
4106
4171
|
"leaves the router as it was, and through a mutable name it writes the router in",
|
|
4107
4172
|
"place. Routing nil routes nothing and leaves the router as it was, as applying a",
|
|
4108
|
-
"
|
|
4173
|
+
"Denum to nil does. A flagged error such as `1 / 0` is the answer of the",
|
|
4109
4174
|
"expression that applies the router, so it is never routed.",
|
|
4110
4175
|
"",
|
|
4111
|
-
"**Observers.** A router declares its Count, Size and residual as a
|
|
4112
|
-
"(007.25c): its Count C, its
|
|
4113
|
-
"each load is the sum of the Sizes of the children routed into that
|
|
4114
|
-
"
|
|
4115
|
-
"
|
|
4116
|
-
"
|
|
4117
|
-
"
|
|
4118
|
-
"
|
|
4119
|
-
"
|
|
4120
|
-
"
|
|
4121
|
-
"
|
|
4176
|
+
"**Observers.** A router declares its Count, Size and residual as a Denum does",
|
|
4177
|
+
"(007.25c): its Count C, the sum of its channel loads and their alternating sum,",
|
|
4178
|
+
"where each load is the sum of the Sizes of the children routed into that",
|
|
4179
|
+
"channel. An empty channel has load 0, the empty sum; a nonempty channel's load",
|
|
4180
|
+
"is its native Size, which is that sum. Its fourth hash is the Denum of its",
|
|
4181
|
+
"Count and channel loads, `Denum [C, [load0, …]]`: the fourth hash recognizes",
|
|
4182
|
+
"an instance of this class intrinsically, as it recognizes a Denum, and reads",
|
|
4183
|
+
"each channel's Size once. That Denum is the router's numerical shadow; at",
|
|
4184
|
+
"Count zero there is none. Observation is where children are measured, so it is",
|
|
4185
|
+
"where their failures show, and declared observers run only when the router is",
|
|
4186
|
+
"observed: routing runs none of them, and observing writes nothing. The Denum",
|
|
4187
|
+
"forgets which Frames were routed and their order, so distinct routers can share",
|
|
4188
|
+
"one.",
|
|
4122
4189
|
"",
|
|
4123
4190
|
"**The projection law.** For every router r whose fourth hash exists, that is",
|
|
4124
4191
|
"every router with C ≥ 1 whose children have Sizes, and every Frame y,",
|
|
4125
|
-
"`(r y).#### = (r.####) y`: routing y into
|
|
4126
|
-
"
|
|
4127
|
-
"
|
|
4128
|
-
"
|
|
4129
|
-
"
|
|
4130
|
-
"
|
|
4131
|
-
"`(r0 y).#### = (Demi [0, 0, 0]) y`.",
|
|
4192
|
+
"`(r y).#### = (r.####) y`: routing y into channel `C mod k` and then observing",
|
|
4193
|
+
"adds `y.##` to that channel's load and one to C, which is exactly what applying",
|
|
4194
|
+
"the Denum to y does. The empty router is the boundary: it has routed nothing,",
|
|
4195
|
+
"so like the empty host `[]` its Count is zero and `.####` is nil, not a Denum",
|
|
4196
|
+
"conjured to make the equation look true. There the law reads through the",
|
|
4197
|
+
"zero-Count lifting the Denum class names, `(r0 y).#### = (Denum [0, [0, 0]]) y`.",
|
|
4132
4198
|
"",
|
|
4133
4199
|
"**Text.** A router prints as its fields and methods, and as text reads",
|
|
4134
|
-
"`RotorRouter([
|
|
4135
|
-
"
|
|
4136
|
-
"",
|
|
4137
|
-
"**Channels and division (007.27).** Two channels are the arity-two case of k",
|
|
4138
|
-
"ordered channels. `RotorRouter [ch0, …, chk−1]` takes k ≥ 1 arrays; two are",
|
|
4139
|
-
"this binary router, and any other number is a channel router. Every router",
|
|
4140
|
-
"stores `channels`; only the binary one also has `left`, `right` and `phase`,",
|
|
4141
|
-
"which it writes together with `channels`. A round-robin history from channel 0",
|
|
4142
|
-
"leaves the first C mod k channels one longer than the rest, so a channel",
|
|
4143
|
-
"router admits exactly the channels whose Counts are the dealing of C children",
|
|
4144
|
-
"into k, `round-robin [C, k]`, and refuses every other with",
|
|
4145
|
-
"`$!!.invalid-router`.",
|
|
4146
|
-
"Routing appends to channel C mod k, which for k = 2 is the phase's channel,",
|
|
4147
|
-
"directly, as the binary router does: a small cursor, `append-at`, rebuilds the",
|
|
4148
|
-
"list of channels with the Frame added to that one, so a route costs one pass",
|
|
4149
|
-
"over the k channels and never replays the history (PR #482 review).",
|
|
4150
|
-
"Its Size is the sum of its channel loads and its residual their alternating",
|
|
4151
|
-
"sum, as a channel Demi's are. Its fourth hash is the channel Demi of its",
|
|
4152
|
-
"Count and channel loads, `Demi [C, [load0, …]]`: the fourth hash recognizes an",
|
|
4153
|
-
"instance of this class with other than two channels intrinsically, as it",
|
|
4154
|
-
"recognizes a Demi, because the binary Demi the observers derive follows",
|
|
4155
|
-
"parity and not C mod k. So the projection law `(r y).#### = r.#### y` holds",
|
|
4156
|
-
"for every arity; at Count zero there is no Demi. Text reads `RotorRouter([ch0, ch1, …])`.",
|
|
4200
|
+
"`RotorRouter([ch0, ch1, …])`, the list of its channels, for every number of",
|
|
4201
|
+
"channels.",
|
|
4157
4202
|
"",
|
|
4158
4203
|
"`router ./ n`, also spelled `router / n`, re-deals the Frames it holds: it",
|
|
4159
4204
|
"reconstructs the order they were routed in from its channels, which their",
|
|
@@ -4187,30 +4232,16 @@ export const HC_SOURCES = new Map([
|
|
|
4187
4232
|
" .padded ((even = 1) ? {cs} : {cs & {.ch _; (ch.# = w) ? {ch} : {ch pad}}});",
|
|
4188
4233
|
" .flat ((((padded &| {_}) / w) .channels) &| {_});",
|
|
4189
4234
|
" (even = 1) ? {flat} : {flat &| {.x _; (x === (_^^^^ .pad)) ? {[]} : {[x]}}}}}};",
|
|
4190
|
-
".append-at {.at (_ .0); .item (_ .1); [.index 0; .target at; .item item; .out [];",
|
|
4191
|
-
" .apply_ {.v _; .i (_^ .index); .t (_^ .target); .it (_^ .item); .o (_^ .out);",
|
|
4192
|
-
" @out (o ((i = t) ? {it | v} : {v})); @index (i + 1);}]};",
|
|
4193
4235
|
".round-robin {.s (_ .0); .ways (_ .1); .q (((s - (s %% ways)) / ways).##);",
|
|
4194
4236
|
" [.low q; .short 0; .ok 1;",
|
|
4195
4237
|
" .apply_ {.c _; .lo (_^ .low); .seen (_^ .short); .fine (_^ .ok);",
|
|
4196
4238
|
" @ok ((((c = (lo + 1)) ? {seen = 0} : {c = lo}) ? {fine = 1}) ? {1} : {0}); @short ((c = lo) ? {1} : {seen});}]};",
|
|
4197
|
-
".
|
|
4198
|
-
" .phase (((lc.#) = (rc.#)) ? {2} : {1});",
|
|
4199
|
-
" .left lc;",
|
|
4200
|
-
" .right rc;",
|
|
4201
|
-
" .channels [lc, rc];",
|
|
4202
|
-
" .apply_ {.x _; .l (_^ .left); .r (_^ .right); .n (l.# + r.#);",
|
|
4203
|
-
" ((n %% 2) = 0) ? {.nl (l x); @left nl; @channels [nl, r]; @phase 1;} : {.nr (r x); @right nr; @channels [l, nr]; @phase 2;};};",
|
|
4204
|
-
" .# {.l (_^ .left); .r (_^ .right); l.# + r.#};",
|
|
4205
|
-
" .## {(channel-load (_^ .left)) + (channel-load (_^ .right))};",
|
|
4206
|
-
" .### {(channel-load (_^ .left)) - (channel-load (_^ .right))};",
|
|
4207
|
-
" ./ {.ways _; ((_^^ .history) (_^ .channels)) / ways};",
|
|
4208
|
-
" .toText {“RotorRouter(” (_^ .left) “,” (_^ .right) “)”}",
|
|
4209
|
-
" ]};",
|
|
4210
|
-
".channel-router {.cs _; [",
|
|
4239
|
+
".router-instance {.cs _; [",
|
|
4211
4240
|
" .channels cs;",
|
|
4212
4241
|
" .apply_ {.x _; .cs (_^ .channels); .n ((cs & {_.#}).##);",
|
|
4213
|
-
"
|
|
4242
|
+
" .at (n %% (cs.#)); .item [x];",
|
|
4243
|
+
" .cursor [.index 0; .target at; .item item; .out []; .apply_ {.v _; .i (_^ .index); .t (_^ .target); .it (_^ .item); .o (_^ .out); @out (o ((i = t) ? {it | v} : {v})); @index (i + 1);}];",
|
|
4244
|
+
" @channels ((cs | cursor) .out);};",
|
|
4214
4245
|
" .# {((_^ .channels) &| {_}).#};",
|
|
4215
4246
|
" .## {((_^ .channels) & {channel-load _}).##};",
|
|
4216
4247
|
" .### {((_^ .channels) & {channel-load _}).###};",
|
|
@@ -4219,27 +4250,28 @@ export const HC_SOURCES = new Map([
|
|
|
4219
4250
|
" ]};",
|
|
4220
4251
|
".RotorRouter {((_ ~ ([].<>)) ? {(__ .#) .> 0}) ? {.a __;",
|
|
4221
4252
|
" ((a &| {.x _; (x ~ ([].<>)) ? {[]} : {[x]}}).# = 0) ? {.cs (a & {_ | []}); .k (cs.#); .n ((cs &| {_}).#);",
|
|
4222
|
-
" ((k .> 0) ? {(((cs & {_.#}) | (round-robin [n, k])) .ok) = 1}) ? {
|
|
4253
|
+
" ((k .> 0) ? {(((cs & {_.#}) | (round-robin [n, k])) .ok) = 1}) ? {router-instance cs} : {$!!.invalid-router}",
|
|
4223
4254
|
" } : {$!!.invalid-router}} : {$!!.invalid-router}};",
|
|
4224
4255
|
"```",
|
|
4225
4256
|
"## Construction",
|
|
4226
4257
|
"",
|
|
4227
|
-
"A router holds exactly its
|
|
4228
|
-
"
|
|
4258
|
+
"A router holds exactly its channels. The initial router of two channels is",
|
|
4259
|
+
"present, both channels empty, Count zero, next route to channel 0",
|
|
4229
4260
|
"```",
|
|
4230
4261
|
"; .r0 (RotorRouter [[], []]);",
|
|
4231
|
-
"; [r0
|
|
4232
|
-
"# [
|
|
4262
|
+
"; [(r0.# %% 2), (r0.channels .0), (r0.channels .1), r0.#, “” r0]",
|
|
4263
|
+
"# [0, [], [], 0, “RotorRouter([[], []])”]",
|
|
4233
4264
|
"```",
|
|
4234
|
-
"Every admissible pair is a router,
|
|
4235
|
-
"children
|
|
4265
|
+
"Every admissible pair is a router, its next channel the parity of its Count: as",
|
|
4266
|
+
"many children in channel 0 as in channel 1 is even and next 0, one more in",
|
|
4267
|
+
"channel 0 is odd and next 1.",
|
|
4236
4268
|
"Preloads of any length are admitted on the same terms",
|
|
4237
4269
|
"```",
|
|
4238
|
-
"; [RotorRouter [[5], []], RotorRouter [[5], [6]], RotorRouter [[5, 7], [6]], RotorRouter [[1, 2, 3, 4], [5, 6, 7, 8]], RotorRouter [[1, 2, 3, 4, 5], [6, 7, 8, 9]]] & {[_.#, _
|
|
4239
|
-
"# [[1, 1], [2,
|
|
4270
|
+
"; [RotorRouter [[5], []], RotorRouter [[5], [6]], RotorRouter [[5, 7], [6]], RotorRouter [[1, 2, 3, 4], [5, 6, 7, 8]], RotorRouter [[1, 2, 3, 4, 5], [6, 7, 8, 9]]] & {[_.#, (_.# %% 2)]}",
|
|
4271
|
+
"# [[1, 1], [2, 0], [3, 1], [8, 0], [9, 1]]",
|
|
4240
4272
|
"```",
|
|
4241
|
-
"A pair that is not a
|
|
4242
|
-
"
|
|
4273
|
+
"A pair that is not a round-robin history from channel 0 is refused: channel 1",
|
|
4274
|
+
"ahead of channel 0, channel 0 more than one ahead, and the old phase-first form, whose three",
|
|
4243
4275
|
"arguments are not two channels. No history is invented for them",
|
|
4244
4276
|
"```",
|
|
4245
4277
|
"; [RotorRouter [[], [5]], RotorRouter [[5], [6, 7]], RotorRouter [[5, 6], []], RotorRouter [[1, 2, 3], [4]], RotorRouter [[], [1, 2, 3]]]",
|
|
@@ -4258,34 +4290,34 @@ export const HC_SOURCES = new Map([
|
|
|
4258
4290
|
"elements are counted for admissibility",
|
|
4259
4291
|
"```",
|
|
4260
4292
|
"; .Hijack [.apply {“hijack”}; 1];",
|
|
4261
|
-
"; [(RotorRouter [[.tag 9; 5], []]).
|
|
4293
|
+
"; [((RotorRouter [[.tag 9; 5], []]).channels .0), (((RotorRouter [Hijack, []]) 7).channels .1), RotorRouter [[.a 1; .b 2], [5]]]",
|
|
4262
4294
|
"# [[5], [7], $!!.invalid-router]",
|
|
4263
4295
|
"```",
|
|
4264
4296
|
"## Routing alternates",
|
|
4265
4297
|
"",
|
|
4266
|
-
"From the initial router, routing A, B and C sends A and C
|
|
4267
|
-
"and the next route goes
|
|
4298
|
+
"From the initial router, routing A, B and C sends A and C to channel 0 and B to",
|
|
4299
|
+
"channel 1, and the next route goes to channel 1",
|
|
4268
4300
|
"```",
|
|
4269
4301
|
"; .A [1, [2]]; .B “b”; .C {5 + 3};",
|
|
4270
4302
|
"; .r3 (((r0 A) B) C);",
|
|
4271
|
-
"; [r3
|
|
4303
|
+
"; [(r3.# %% 2), (r3.channels .0), (r3.channels .1), r3.#]",
|
|
4272
4304
|
"# [1, [[1, [2]], { 5 + 3 }], [“b”], 3]",
|
|
4273
4305
|
"; “” r3",
|
|
4274
|
-
"# “RotorRouter([[1, [2]], { 5 + 3 }],[“b”])”",
|
|
4306
|
+
"# “RotorRouter([[[1, [2]], { 5 + 3 }], [“b”]])”",
|
|
4275
4307
|
"```",
|
|
4276
4308
|
"The router that was routed into is left as it was",
|
|
4277
4309
|
"```",
|
|
4278
|
-
"; [r0
|
|
4279
|
-
"# [
|
|
4310
|
+
"; [(r0.# %% 2), (r0.channels .0), (r0.channels .1)]",
|
|
4311
|
+
"# [0, [], []]",
|
|
4280
4312
|
"```",
|
|
4281
|
-
"The
|
|
4282
|
-
"admissible again: routing from Count 0 through Count 6 alternates",
|
|
4283
|
-
"
|
|
4313
|
+
"The next channel is the parity of the Count after every route, so each",
|
|
4314
|
+
"successor is admissible again: routing from Count 0 through Count 6 alternates",
|
|
4315
|
+
"channel 0, 1, 0, …",
|
|
4284
4316
|
"```",
|
|
4285
4317
|
"; .steps [r0, (r0 1), ((r0 1) 2), (((r0 1) 2) 3), ((((r0 1) 2) 3) 4), (((((r0 1) 2) 3) 4) 5), ((((((r0 1) 2) 3) 4) 5) 6)];",
|
|
4286
|
-
"; [steps & {_.#}, steps & {_
|
|
4287
|
-
"# [[0, 1, 2, 3, 4, 5, 6], [
|
|
4288
|
-
"; steps & {(RotorRouter [_.
|
|
4318
|
+
"; [steps & {_.#}, steps & {(_.# %% 2)}, steps & {(_.channels .0).#}, steps & {(_.channels .1).#}]",
|
|
4319
|
+
"# [[0, 1, 2, 3, 4, 5, 6], [0, 1, 0, 1, 0, 1, 0], [0, 1, 1, 2, 2, 3, 3], [0, 0, 1, 1, 2, 2, 3]]",
|
|
4320
|
+
"; steps & {(RotorRouter [(_.channels .0), (_.channels .1)]) = _}",
|
|
4289
4321
|
"# [<>, <>, <>, <>, <>, <>, <>]",
|
|
4290
4322
|
"```",
|
|
4291
4323
|
"## Routing keeps the Frame",
|
|
@@ -4293,13 +4325,13 @@ export const HC_SOURCES = new Map([
|
|
|
4293
4325
|
"A channel member is the routed Frame itself. An array or a group is routed as",
|
|
4294
4326
|
"one member, never spread into its elements, and a closure is kept, not called.",
|
|
4295
4327
|
"Iterating a channel yields its members as they are. Reading a closure by dot",
|
|
4296
|
-
"from an aggregate, `r3.
|
|
4328
|
+
"from an aggregate, `(r3.channels .0) .1`, answers a method bound to that aggregate,",
|
|
4297
4329
|
"which is the general rule for methods and not the router's, so the closure's",
|
|
4298
4330
|
"identity is seen by iterating",
|
|
4299
4331
|
"```",
|
|
4300
|
-
"; [r3.
|
|
4332
|
+
"; [(r3.channels .0) .0 === A, (r3.channels .1) .0 === B, (r3.channels .0) & {_ === C}]",
|
|
4301
4333
|
"# [<>, <>, [(), <>]]",
|
|
4302
|
-
"; [(r0 [1, 2]).
|
|
4334
|
+
"; [((r0 [1, 2]).channels .0), ((r0 (4, 5)).channels .0), ((r0 {5 + 3}).channels .0), ((r0 []).channels .0)]",
|
|
4303
4335
|
"# [[[1, 2]], [(4, 5)], [{ 5 + 3 }], [[]]]",
|
|
4304
4336
|
"```",
|
|
4305
4337
|
"A Frame held through a mutable name is the same Frame in the channel, so a",
|
|
@@ -4309,19 +4341,19 @@ export const HC_SOURCES = new Map([
|
|
|
4309
4341
|
"; .kid_ [.n 1; .set_ {@n _;}];",
|
|
4310
4342
|
"; .rk (r0 kid_);",
|
|
4311
4343
|
"; kid_.set_ 5;",
|
|
4312
|
-
"; [rk.
|
|
4344
|
+
"; [((rk.channels .0) .0) === kid_, ((rk.channels .0) .0).n]",
|
|
4313
4345
|
"# [<>, 5]",
|
|
4314
|
-
"; [(rk.
|
|
4346
|
+
"; [(((rk.channels .0) .0).set_ 9).n, kid_.n, ((rk.channels .0) .0).n]",
|
|
4315
4347
|
"# [9, 5, 5]",
|
|
4316
4348
|
"```",
|
|
4317
4349
|
"## Preloaded states",
|
|
4318
4350
|
"",
|
|
4319
|
-
"An admissible preload continues its history: here one child
|
|
4320
|
-
"
|
|
4351
|
+
"An admissible preload continues its history: here one child in channel 0, so",
|
|
4352
|
+
"Count 1, and the next two routes go to channel 1 then channel 0",
|
|
4321
4353
|
"```",
|
|
4322
4354
|
"; .p1 (RotorRouter [[A], []]);",
|
|
4323
4355
|
"; .p2 ((p1 B) C);",
|
|
4324
|
-
"; [p1
|
|
4356
|
+
"; [(p1.# %% 2), p1.#, (p2.# %% 2), (p2.channels .0), (p2.channels .1), (p1.channels .1)]",
|
|
4325
4357
|
"# [1, 1, 1, [[1, [2]], { 5 + 3 }], [“b”], []]",
|
|
4326
4358
|
"; [p2 = r3, p2 = (RotorRouter [[A, C], [B]])]",
|
|
4327
4359
|
"# [<>, <>]",
|
|
@@ -4335,21 +4367,21 @@ export const HC_SOURCES = new Map([
|
|
|
4335
4367
|
"; .m_ (RotorRouter [ch, []]);",
|
|
4336
4368
|
"; m_ B;",
|
|
4337
4369
|
"; m_ C;",
|
|
4338
|
-
"; [m_
|
|
4370
|
+
"; [(m_.# %% 2), (m_.channels .0), (m_.channels .1), (u.channels .0), (v.channels .0), ch]",
|
|
4339
4371
|
"# [1, [[1, [2]], { 5 + 3 }], [“b”], [[1, [2]]], [[1, [2]]], [[1, [2]]]]",
|
|
4340
|
-
"; [u.
|
|
4372
|
+
"; [(u.channels .0) === ch, (u.channels .0) === (v.channels .0), ((u.channels .0) .0) === ((v.channels .0) .0)]",
|
|
4341
4373
|
"# [(), (), <>]",
|
|
4342
4374
|
"```",
|
|
4343
4375
|
"A router captured by a closure, mapped, or reduced into routes the same way,",
|
|
4344
4376
|
"and the captured one stays as it was",
|
|
4345
4377
|
"```",
|
|
4346
4378
|
"; .start (RotorRouter [[], []]); .step {start _};",
|
|
4347
|
-
"; [(step 5).
|
|
4379
|
+
"; [((step 5).channels .0), ((step 3).channels .0), (start.channels .0)]",
|
|
4348
4380
|
"# [[5], [3], []]",
|
|
4349
|
-
"; [r0, p1] & {(_ 5).
|
|
4381
|
+
"; [r0, p1] & {((_ 5).channels .1)}",
|
|
4350
4382
|
"# [[], [5]]",
|
|
4351
4383
|
"; “” ([A, B, C] | r0)",
|
|
4352
|
-
"# “RotorRouter([[1, [2]], { 5 + 3 }],[“b”])”",
|
|
4384
|
+
"# “RotorRouter([[[1, [2]], { 5 + 3 }], [“b”]])”",
|
|
4353
4385
|
"```",
|
|
4354
4386
|
"## Routing measures nothing",
|
|
4355
4387
|
"",
|
|
@@ -4362,21 +4394,21 @@ export const HC_SOURCES = new Map([
|
|
|
4362
4394
|
"; .Failing [.## {[].nope}; 1];",
|
|
4363
4395
|
"; .Cyclic [.## {_^.##}];",
|
|
4364
4396
|
"; .rf ((((r0 Counted) Failing) Cyclic) Counted);",
|
|
4365
|
-
"; [rf
|
|
4366
|
-
"# [
|
|
4397
|
+
"; [(rf.# %% 2), (rf.channels .0).#, (rf.channels .1).#, counter_.n]",
|
|
4398
|
+
"# [0, 2, 2, 0]",
|
|
4367
4399
|
"```",
|
|
4368
4400
|
"Observing the router is where they are measured, so it is where they fail and",
|
|
4369
|
-
"where the counting code runs. The fourth hash reads
|
|
4370
|
-
"
|
|
4401
|
+
"where the counting code runs. The fourth hash reads each channel's Size once,",
|
|
4402
|
+
"so a child's Size is read once",
|
|
4371
4403
|
"```",
|
|
4372
4404
|
"; (r0 Failing).####",
|
|
4373
4405
|
"# $!.name-missing “...",
|
|
4374
4406
|
"; (r0 Cyclic).####",
|
|
4375
4407
|
"# $!.cyclic-observation .##",
|
|
4376
4408
|
"; “” ((r0 Counted).####)",
|
|
4377
|
-
"# “
|
|
4409
|
+
"# “Denum(1,[5, 0])”",
|
|
4378
4410
|
"; counter_.n",
|
|
4379
|
-
"#
|
|
4411
|
+
"# 1",
|
|
4380
4412
|
"```",
|
|
4381
4413
|
"An error is the answer of the expression that applies the router, so it is",
|
|
4382
4414
|
"never routed. A diagnostic failure such as a missing name is an error too",
|
|
@@ -4389,32 +4421,32 @@ export const HC_SOURCES = new Map([
|
|
|
4389
4421
|
"```",
|
|
4390
4422
|
"Routing nil routes nothing",
|
|
4391
4423
|
"```",
|
|
4392
|
-
"; [(r0 ())
|
|
4393
|
-
"# [
|
|
4424
|
+
"; [((r0 ()).# %% 2), ((r0 ()).channels .0), (p1 ()).#]",
|
|
4425
|
+
"# [0, [], 1]",
|
|
4394
4426
|
"```",
|
|
4395
4427
|
"## Empty and zero",
|
|
4396
4428
|
"",
|
|
4397
4429
|
"The initial router has routed no children, so its Count is zero, and like the",
|
|
4398
|
-
"empty host it has no
|
|
4399
|
-
"present router
|
|
4430
|
+
"empty host it has no Denum. Its Size and residual still read zero, and it is a",
|
|
4431
|
+
"present router. The Denum of Count zero is a different thing, a Denum",
|
|
4400
4432
|
"constructed as such, which routing from the router reaches after one route",
|
|
4401
4433
|
"```",
|
|
4402
|
-
"; [r0.#, r0.##, r0.###, r0
|
|
4403
|
-
"# [0, 0, 0,
|
|
4404
|
-
";
|
|
4405
|
-
"; [((r0 0).####) = ((
|
|
4434
|
+
"; [r0.#, r0.##, r0.###, (r0.# %% 2), r0.####, [].####]",
|
|
4435
|
+
"# [0, 0, 0, 0, (), ()]",
|
|
4436
|
+
"; Denums <- './hc/denum.hc';",
|
|
4437
|
+
"; [((r0 0).####) = ((Denums.Denum [0, [0, 0]]) 0), ((r0 []).####) = ([] []).####]",
|
|
4406
4438
|
"# [<>, <>]",
|
|
4407
4439
|
"```",
|
|
4408
|
-
"A Frame of Size zero takes a slot and
|
|
4440
|
+
"A Frame of Size zero takes a slot and moves the next channel, and an empty array",
|
|
4409
4441
|
"routed as a child has Size 1, while an empty channel has load 0",
|
|
4410
4442
|
"```",
|
|
4411
4443
|
"; .z (r0 0);",
|
|
4412
|
-
"; [z
|
|
4413
|
-
"# [1, [0], 1, “
|
|
4444
|
+
"; [(z.# %% 2), (z.channels .0), z.#, “” (z.####)]",
|
|
4445
|
+
"# [1, [0], 1, “Denum(1,[0, 0])”]",
|
|
4414
4446
|
"; [“” ((r0 []).####), “” (((r0 []) []).####), “” ((((r0 0) 0) 0).####)]",
|
|
4415
|
-
"# [“
|
|
4447
|
+
"# [“Denum(1,[1, 0])”, “Denum(2,[1, 1])”, “Denum(3,[0, 0])”]",
|
|
4416
4448
|
"```",
|
|
4417
|
-
"## The router's
|
|
4449
|
+
"## The router's Denum",
|
|
4418
4450
|
"",
|
|
4419
4451
|
"Each load is the sum of its channel's child Sizes, as exact Counts, over text,",
|
|
4420
4452
|
"numbers, nested arrays, groups, closures, all, and a Frame routed twice, which",
|
|
@@ -4422,39 +4454,39 @@ export const HC_SOURCES = new Map([
|
|
|
4422
4454
|
"```",
|
|
4423
4455
|
"; .shared [[], []];",
|
|
4424
4456
|
"; .mix ((((((((r0 “hello”) 7) [[1, 2], [3]]) (4, 5)) shared) shared) {5 + 3}) <>);",
|
|
4425
|
-
"; [mix.
|
|
4457
|
+
"; [(mix.channels .0), (mix.channels .1)]",
|
|
4426
4458
|
"# [[“hello”, [[1, 2], [3]], [[], []], { 5 + 3 }], [7, (4, 5), [[], []], <>]]",
|
|
4427
|
-
"; [mix.
|
|
4428
|
-
"# [[5, 6, 2, 9], [7, 9, 2, 1], “
|
|
4459
|
+
"; [(mix.channels .0) & {_.##}, (mix.channels .1) & {_.##}, “” (mix.####)]",
|
|
4460
|
+
"# [[5, 6, 2, 9], [7, 9, 2, 1], “Denum(8,[22, 19])”]",
|
|
4429
4461
|
"; “” (((r0 123456789012345678901234567890) 987654321098765432109876543210).####)",
|
|
4430
|
-
"# “
|
|
4462
|
+
"# “Denum(2,[123456789012345678901234567890, 987654321098765432109876543210])”",
|
|
4431
4463
|
"```",
|
|
4432
|
-
"A router's
|
|
4433
|
-
"router's
|
|
4464
|
+
"A router's Denum is `Denum [C, [load0, load1]]` of its own channels, and its",
|
|
4465
|
+
"parity is the router's, for every Count from 1 to 6 and for preloads",
|
|
4434
4466
|
"```",
|
|
4435
4467
|
"; .sh (steps & {_.####});",
|
|
4436
4468
|
"; [sh & {_ = ()}, sh & {_.#}]",
|
|
4437
4469
|
"# [[<>, (), (), (), (), (), ()], [(), 1, 2, 3, 4, 5, 6]]",
|
|
4438
|
-
"; [steps &| {.k _; (k.# .> 0) ? {[k
|
|
4470
|
+
"; [steps &| {.k _; (k.# .> 0) ? {[(k.# %% 2) = (k.#### .# %% 2)]} : {[]}}, (RotorRouter [[2, 3], [1]]).#### = (Denums.Denum [3, [5, 1]])]",
|
|
4439
4471
|
"# [[<>, <>, <>, <>, <>, <>], <>]",
|
|
4440
4472
|
"```",
|
|
4441
4473
|
"## Observing commutes with routing",
|
|
4442
4474
|
"",
|
|
4443
4475
|
"Routing each child of an array X in turn, from the initial router, is the",
|
|
4444
|
-
"reduce `X | r0`. Its
|
|
4445
|
-
"
|
|
4476
|
+
"reduce `X | r0`. Its channel 0 holds the children at even positions and its",
|
|
4477
|
+
"channel 1 those at odd positions, and its next channel is the parity of X's Count.",
|
|
4446
4478
|
"That interleaving is the admissibility invariant, so the same router is",
|
|
4447
4479
|
"constructed directly from the two channels",
|
|
4448
4480
|
"```",
|
|
4449
4481
|
"; .X [5, “ab”, [1, 2]];",
|
|
4450
4482
|
"; .rx (X | r0);",
|
|
4451
|
-
"; [rx.
|
|
4483
|
+
"; [(rx.channels .0), (rx.channels .1), (rx.# %% 2), rx = (RotorRouter [[5, [1, 2]], [“ab”]])]",
|
|
4452
4484
|
"# [[5, [1, 2]], [“ab”], 1, <>]",
|
|
4453
4485
|
"```",
|
|
4454
4486
|
"For every router whose fourth hash exists, routing Y then observing is applying",
|
|
4455
|
-
"the router's
|
|
4487
|
+
"the router's Denum to Y, which adds one to the Count. Its fourth hash is X's,",
|
|
4456
4488
|
"Count included. The law holds for routers built by routing and for admissible",
|
|
4457
|
-
"preloads alike, in both
|
|
4489
|
+
"preloads alike, in both parities, and for a zero-Size child",
|
|
4458
4490
|
"```",
|
|
4459
4491
|
"; .Y [[], [], []];",
|
|
4460
4492
|
"; [(rx.####) = X.####, ((rx Y).####) = (X Y).####, ((rx Y).####) = ((rx.####) Y), (rx.####).# = X.#, ((rx Y).####).# = (X.# + 1)]",
|
|
@@ -4462,38 +4494,38 @@ export const HC_SOURCES = new Map([
|
|
|
4462
4494
|
"; [((p1 Y).####) = ((p1.####) Y), ((p2 {5 + 3}).####) = ((p2.####) {5 + 3}), ((p1 0).####) = ((p1.####) 0)]",
|
|
4463
4495
|
"# [<>, <>, <>]",
|
|
4464
4496
|
"; .pre [RotorRouter [[A], []], RotorRouter [[A], [B]], RotorRouter [[A, B], [C]], RotorRouter [[1, 2, 3, 4], [5, 6, 7, 8]], RotorRouter [[1, 2, 3, 4, 5], [6, 7, 8, 9]]];",
|
|
4465
|
-
"; [pre & {((_ Y).####) = ((_.####) Y)}, pre & {((_ 0).####) = ((_.####) 0)}, pre & {(_ Y)
|
|
4497
|
+
"; [pre & {((_ Y).####) = ((_.####) Y)}, pre & {((_ 0).####) = ((_.####) 0)}, pre & {((_ Y).# %% 2) = (((_.####) Y).# %% 2)}]",
|
|
4466
4498
|
"# [[<>, <>, <>, <>, <>], [<>, <>, <>, <>, <>], [<>, <>, <>, <>, <>]]",
|
|
4467
4499
|
"```",
|
|
4468
4500
|
"The same holds at every step of a walk, Count 1 to 6, and a router can never",
|
|
4469
|
-
"route to the channel its
|
|
4501
|
+
"route to the channel its Denum does not deposit into",
|
|
4470
4502
|
"```",
|
|
4471
4503
|
"; steps &| {.k _; (k.# .> 0) ? {[((k Y).####) = ((k.####) Y)]} : {[]}}",
|
|
4472
4504
|
"# [<>, <>, <>, <>, <>, <>]",
|
|
4473
|
-
"; steps &| {.k _; (k.# .> 0) ? {[[((k 4).
|
|
4505
|
+
"; steps &| {.k _; (k.# .> 0) ? {[[(((k 4).channels .0).# - (k.channels .0).#), ((((k.####) 4).loads .0) - (k.#### .loads .0))]]} : {[]}}",
|
|
4474
4506
|
"# [[0, 0], [1, 4], [0, 0], [1, 4], [0, 0], [1, 4]]",
|
|
4475
4507
|
"```",
|
|
4476
4508
|
"A failed Size is the answer on both sides: the router routes the Frame and its",
|
|
4477
|
-
"
|
|
4509
|
+
"Denum fails when observed, and the Denum refuses the deposit with the same error",
|
|
4478
4510
|
"```",
|
|
4479
4511
|
"; [((p1 Failing).####), ((p1.####) Failing)]",
|
|
4480
4512
|
"# [$!.name-missing “..., $!.name-missing “...]",
|
|
4481
4513
|
"```",
|
|
4482
4514
|
"The empty host is the boundary. `[].####` is nil, so `X.####` fails the first",
|
|
4483
4515
|
"equation when X is empty, and so does the initial router, which has routed",
|
|
4484
|
-
"nothing and so has Count zero: it has no
|
|
4485
|
-
"reads through the
|
|
4516
|
+
"nothing and so has Count zero: it has no Denum, and none is faked. The law there",
|
|
4517
|
+
"reads through the Denum class's zero-Count lifting, `Denum [0, [0, 0]]`, and after",
|
|
4486
4518
|
"one route the equation holds again",
|
|
4487
4519
|
"```",
|
|
4488
|
-
"; [r0.####, ([] | r0) = r0, (([] | r0).####) = [].####, (([Y] | r0).####) = ([] Y).####, ((r0 Y).####) = ((
|
|
4520
|
+
"; [r0.####, ([] | r0) = r0, (([] | r0).####) = [].####, (([Y] | r0).####) = ([] Y).####, ((r0 Y).####) = ((Denums.Denum [0, [0, 0]]) Y), ((r0 0).####) = ((Denums.Denum [0, [0, 0]]) 0)]",
|
|
4489
4521
|
"# [(), <>, <>, <>, <>, <>]",
|
|
4490
4522
|
"```",
|
|
4491
|
-
"## The
|
|
4523
|
+
"## The Denum forgets",
|
|
4492
4524
|
"",
|
|
4493
|
-
"Distinct routers can share a
|
|
4525
|
+
"Distinct routers can share a Denum: the fourth hash keeps only the Count and two",
|
|
4494
4526
|
"sums, not which Frames were routed, nor their order, nor how the load was split",
|
|
4495
4527
|
"among them. It does keep how many were routed, so a router with fewer children",
|
|
4496
|
-
"and the same loads has a different
|
|
4528
|
+
"and the same loads has a different Denum",
|
|
4497
4529
|
"```",
|
|
4498
4530
|
"; .s1 (RotorRouter [[2, 3], [1]]); .s2 (RotorRouter [[5], [1]]); .s3 (RotorRouter [[3, 2], [1]]); .s4 (RotorRouter [[1, 4], [1]]);",
|
|
4499
4531
|
"; [s1 = s2, s1 = s3, (s1.####) = (s3.####), (s1.####) = (s4.####), (s1.####) = (s2.####), s1.#, s2.#, s1.##, s2.##]",
|
|
@@ -4501,10 +4533,10 @@ export const HC_SOURCES = new Map([
|
|
|
4501
4533
|
"```",
|
|
4502
4534
|
"## Observers, declared",
|
|
4503
4535
|
"",
|
|
4504
|
-
"A router's Count, Size and residual are its
|
|
4505
|
-
"
|
|
4536
|
+
"A router's Count, Size and residual are its Denum's, and its fourth hash is a",
|
|
4537
|
+
"Denum, not the router: equal, it would have to be the same class. Its channels",
|
|
4506
4538
|
"are fields, not elements, so iterating a router yields nothing. A router",
|
|
4507
|
-
"inside an aggregate contributes its declared Size, as a
|
|
4539
|
+
"inside an aggregate contributes its declared Size, as a Denum does",
|
|
4508
4540
|
"```",
|
|
4509
4541
|
"; [[r3.#, r3.##, r3.###] = [r3.####.#, r3.####.##, r3.####.###], r3.#### = r3, r3.####.#### = r3.####]",
|
|
4510
4542
|
"# [<>, (), <>]",
|
|
@@ -4516,7 +4548,7 @@ export const HC_SOURCES = new Map([
|
|
|
4516
4548
|
"```",
|
|
4517
4549
|
"; .seen (((r0 A) B) C);",
|
|
4518
4550
|
"; seen.####;",
|
|
4519
|
-
"; [seen = r3, seen
|
|
4551
|
+
"; [seen = r3, (seen.# %% 2), (seen.channels .0).#, (seen.channels .1).#]",
|
|
4520
4552
|
"# [<>, 1, 2, 1]",
|
|
4521
4553
|
"```",
|
|
4522
4554
|
"## Reading the receiver",
|
|
@@ -4525,7 +4557,7 @@ export const HC_SOURCES = new Map([
|
|
|
4525
4557
|
"as one member, and the router reads only its own fields and its own Count",
|
|
4526
4558
|
"```",
|
|
4527
4559
|
"; .masked (r0 [.phase 1; .left [8]; .x 9; .l [7]; .n 1; 4]);",
|
|
4528
|
-
"; [masked
|
|
4560
|
+
"; [(masked.# %% 2), (masked.channels .0).#, ((masked.channels .0) .0).x, (masked.channels .1)]",
|
|
4529
4561
|
"# [1, 1, 9, []]",
|
|
4530
4562
|
"```",
|
|
4531
4563
|
"Carets count lexically (spec a06). Inside a branch, `_^` is the method's own",
|
|
@@ -4553,8 +4585,8 @@ export const HC_SOURCES = new Map([
|
|
|
4553
4585
|
"printed form is matched here by its beginning",
|
|
4554
4586
|
"```",
|
|
4555
4587
|
"; RotorRouter [[5], []]",
|
|
4556
|
-
"# [.
|
|
4557
|
-
"; (RotorRouter [[5], []]) = [.
|
|
4588
|
+
"# [.channels [[5], []]; .apply_ {...",
|
|
4589
|
+
"; (RotorRouter [[5], []]) = [.channels [[5], []]; .apply_ { .x _; .cs (_^ .channels); .n ((cs & { _ .# }) .##); .at (n %% (cs .#)); .item [x]; .cursor [.index 0; .target at; .item item; .out []; .apply_ { .v _; .i (_^ .index); .t (_^ .target); .it (_^ .item); .o (_^ .out); @out (o ((i = t) ? { it | v } : { v })); @index (i + 1); }]; @channels ((cs | cursor) .out); }; .# { ((_^ .channels) &| { _ }) .# }; .## { ((_^ .channels) & { channel-load _ }) .## }; .### { ((_^ .channels) & { channel-load _ }) .### }; ./ { .ways _; ((_^^ .history) (_^ .channels)) / ways }; .toText { “RotorRouter(” (_^ .channels) “)” };]",
|
|
4558
4590
|
"# <>",
|
|
4559
4591
|
"```",
|
|
4560
4592
|
"## Importing",
|
|
@@ -4564,7 +4596,7 @@ export const HC_SOURCES = new Map([
|
|
|
4564
4596
|
"```",
|
|
4565
4597
|
"; Routers <- './hc/rotor-router.hc';",
|
|
4566
4598
|
"; [(Routers.RotorRouter [[], []]) = r0, “” ((Routers.RotorRouter [[], []]) 4), (((Routers.RotorRouter [[], []]) 4).####) = [4].####]",
|
|
4567
|
-
"# [<>, “RotorRouter([4],[])”, <>]",
|
|
4599
|
+
"# [<>, “RotorRouter([[4], []])”, <>]",
|
|
4568
4600
|
"",
|
|
4569
4601
|
].join("\n"),
|
|
4570
4602
|
],
|