hclang 0.45.0 → 0.47.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 +640 -182
- package/esm/lib/execute/denum-prologue.js +62 -33
- package/esm/lib/frames/denum-hash.js +65 -51
- package/esm/lib/frames/denum.js +326 -82
- package/esm/lib/frames.js +1 -1
- package/esm/lib/ops/denum.js +151 -33
- package/esm/lib/version.js +1 -1
- package/package.json +1 -1
|
@@ -2740,27 +2740,70 @@ export const HC_SOURCES = new Map([
|
|
|
2740
2740
|
[
|
|
2741
2741
|
"#!/usr/bin/env hc",
|
|
2742
2742
|
"```",
|
|
2743
|
-
"Denum (occurrence/figure 007.31, 007.32, 007.32b
|
|
2744
|
-
"",
|
|
2745
|
-
"
|
|
2746
|
-
"
|
|
2747
|
-
"
|
|
2748
|
-
"
|
|
2749
|
-
"
|
|
2750
|
-
"
|
|
2751
|
-
"",
|
|
2752
|
-
"
|
|
2753
|
-
|
|
2754
|
-
"
|
|
2755
|
-
"
|
|
2756
|
-
"
|
|
2743
|
+
"Denum and its derived CD view (occurrence/figure 007.31, 007.32, 007.32b, 007.35,",
|
|
2744
|
+
"007.35b, 007.36)",
|
|
2745
|
+
"",
|
|
2746
|
+
"There is one public constructor of retained state, `Denum [Count, loads]`, over",
|
|
2747
|
+
"a Count and a nonempty ordered list of nonnegative integer loads, one per",
|
|
2748
|
+
"channel, of any positive arity. It stores no rank and no schema, and it is not a",
|
|
2749
|
+
"conventional number. The signed Cayley–Dickson algebra is a *view* of a Denum,",
|
|
2750
|
+
"requested by `d.cd ()`:",
|
|
2751
|
+
"",
|
|
2752
|
+
" d = Denum [7, [3, 2, 1, 4]] the only retained state",
|
|
2753
|
+
" e = x.#2 a ranked observation: a Denum, never a view",
|
|
2754
|
+
" c = d.cd () an explicit Cayley–Dickson view of d",
|
|
2755
|
+
" t = (Denum [7, [3, 2, 1]]).cd () refused: $!.denum-unsupported-arity",
|
|
2756
|
+
"",
|
|
2757
|
+
"**One constructor, one retained Figure.** There is no `CD [Count, loads]`",
|
|
2758
|
+
"constructor, no `Denum.cd [Count, loads]` and no conversion constructor. The",
|
|
2759
|
+
"view holds the state of the Denum it was derived from and reads its `count` and",
|
|
2760
|
+
"`loads` from that state; it has no Count, loads, rank or schema of its own that",
|
|
2761
|
+
"could disagree. Every view operation answers a view of a newly derived Denum",
|
|
2762
|
+
"state, and `v.denum ()` recovers that state as a Denum. The algebra is supplied",
|
|
2763
|
+
"by the request, not inferred from the arity: a Denum with four, eight or",
|
|
2764
|
+
"thirty-two loads is generic until `.cd ()` is asked, and the arity alone never",
|
|
2765
|
+
"selects the multiplication law. The only algebra published here is the binary",
|
|
2766
|
+
"Cayley–Dickson ladder, CD[0] to CD[5]: there is no Fano primitive and no",
|
|
2767
|
+
"algebraic reconstruction claim.",
|
|
2768
|
+
"",
|
|
2769
|
+
"Both are ordinary HC classes, like `Demi`. The view arithmetic is the",
|
|
2770
|
+
"Cayley–Dickson recurrence `(a,b)(c,d) = (ac − d̄b, da + bc̄)`, computed by the one",
|
|
2771
|
+
"pure native seam `denum-engine` (`lib/ops/denum.ts`, over the typed reference in",
|
|
2757
2772
|
"`lib/frames/denum.ts`), so no multiplication table is written in HC or in",
|
|
2758
|
-
"TypeScript.
|
|
2759
|
-
"",
|
|
2760
|
-
"
|
|
2761
|
-
"
|
|
2762
|
-
"
|
|
2763
|
-
"
|
|
2773
|
+
"TypeScript. The engine's CD operations accept only native view frames, which",
|
|
2774
|
+
"only the `view` operation makes, and only from a native Denum state, so a raw",
|
|
2775
|
+
"`[count, loads]` payload, a lookalike aggregate or a bare `2ⁿ`-load array has no",
|
|
2776
|
+
"CD capability. Everything else either type does is in this file.",
|
|
2777
|
+
"",
|
|
2778
|
+
"**The generic Denum.** `Denum [count, loads]` accepts every positive arity",
|
|
2779
|
+
"(1, 2, 3, 4, 5, 6, 8, 33, 64, ...). Its observers are `d.count`, `d.loads`,",
|
|
2780
|
+
"`d.#` (the Count), `d.##` (the total load), `d.rank ()` (`⌊log₂ A⌋` of the arity",
|
|
2781
|
+
"`A = d.loads.#`, by integer arithmetic and never from the Count), `d.schema ()`",
|
|
2782
|
+
"(always `Arity[A]`, even at A = 1, 2, 4, 8, 16, 32) and text",
|
|
2783
|
+
"`Denum(Arity[A], C=.., W=[..])`. Its one operation is `+` with another Denum of",
|
|
2784
|
+
"the same arity: Counts add, loads add componentwise, nothing cancels and the",
|
|
2785
|
+
"result is a fresh Denum. A different arity is `$!.denum-arity-mismatch`; nothing",
|
|
2786
|
+
"is padded, truncated or aligned. Everything that needs a signature law (`-`,",
|
|
2787
|
+
"`*`, `opp`, `conj`, `promote`, `coordinates`, `observe`, `signatures`, `d.###`)",
|
|
2788
|
+
"answers the named refusal `$!.denum-not-cd`, whatever the arity: a generic Denum",
|
|
2789
|
+
"has no residual, opposite or product. These methods are defined, to refuse,",
|
|
2790
|
+
"rather than absent. A Denum of zero loads is present, not nil.",
|
|
2791
|
+
"",
|
|
2792
|
+
"**The view.** `d.cd ()` is a unary, pure observation. It needs one of the",
|
|
2793
|
+
"shipped channel arities 1, 2, 4, 8, 16, 32; any other arity is",
|
|
2794
|
+
"`$!.denum-unsupported-arity`. Any argument but nil is `$!!.unary-observation`.",
|
|
2795
|
+
"The source is neither changed nor reordered, and asking twice answers equal",
|
|
2796
|
+
"views. The rank `v.rank ()` is again derived, `v.schema ()` is `CD[n]` with text",
|
|
2797
|
+
"`CD[n](C=.., W=[..])`. View identity is the class, not the arity: a `+`, `-` or",
|
|
2798
|
+
"`*` operand must equal the view that `.cd ()` derives from its own `count` and",
|
|
2799
|
+
"`loads`, so a lookalike aggregate with the same fields is `$!!.invalid-denum`,",
|
|
2800
|
+
"and a Denum with the same fields is not a view. A view is not a source for the",
|
|
2801
|
+
"ranked hash, and a Denum is not an operand of a view operation.",
|
|
2802
|
+
"",
|
|
2803
|
+
"**Ranks and channels of a view.** On rank n the schema is `CD[n]`, the rung of",
|
|
2804
|
+
"the step ladder. Rank 0 has one unsigned channel, `e_ε`. Rank n of 1 or more has",
|
|
2805
|
+
"2ⁿ channels, `±e_b` for every direction `b` of n−1 bits, positives first and",
|
|
2806
|
+
"then negatives, each in direction order:",
|
|
2764
2807
|
"",
|
|
2765
2808
|
" CD[0] e_ε",
|
|
2766
2809
|
" CD[1] e_ε, -e_ε",
|
|
@@ -2770,22 +2813,24 @@ export const HC_SOURCES = new Map([
|
|
|
2770
2813
|
" CD[5] ±e_b for b in {0,1}⁴ 32 channels",
|
|
2771
2814
|
"",
|
|
2772
2815
|
"A minus names a *signature*, never a negative load: every load is a Count.",
|
|
2773
|
-
"`
|
|
2774
|
-
"",
|
|
2775
|
-
"
|
|
2776
|
-
"
|
|
2777
|
-
"
|
|
2778
|
-
"
|
|
2779
|
-
"
|
|
2780
|
-
"`
|
|
2781
|
-
"",
|
|
2782
|
-
"
|
|
2783
|
-
"
|
|
2784
|
-
"
|
|
2785
|
-
"
|
|
2786
|
-
"
|
|
2787
|
-
"
|
|
2788
|
-
"
|
|
2816
|
+
"`v.signatures ()` lists the native names in channel order. Opposite channels stay",
|
|
2817
|
+
"separately counted after every operation, so `X + Opp X` is a present, nonempty",
|
|
2818
|
+
"view that merely observes as zero. The conventional algebraic value is an",
|
|
2819
|
+
"observation, `v.coordinates ()`.",
|
|
2820
|
+
"",
|
|
2821
|
+
"**State.** `d.count` (the full application Count, kept apart from the loads)",
|
|
2822
|
+
"and `d.loads` (one Count per channel) are the whole retained state. The",
|
|
2823
|
+
"observers `d.rank ()` and `d.schema ()` are computed from the loads on each call,",
|
|
2824
|
+
"so there is no stored rank to drift; the v0.46.0 data spelling `d.rank` and",
|
|
2825
|
+
"`d.schema` is replaced by these calls. Anything that is not a Count and a",
|
|
2826
|
+
"nonempty list of Counts, including the old three-field `[rank, count, loads]`,",
|
|
2827
|
+
"is refused with `$!!.invalid-denum`. `Denum [0, [0]]`, an explicit zero-load",
|
|
2828
|
+
"state, is present: it is neither the missing host that `[].#0` leaves nil nor a",
|
|
2829
|
+
"nonempty value that observes as zero.",
|
|
2830
|
+
"",
|
|
2831
|
+
"**View arithmetic.** `+`, `-` and `*` take another view, and only a view.",
|
|
2832
|
+
"Operands of different rank are both promoted to the larger rank first",
|
|
2833
|
+
"(`promote`), and the result is a view of a fresh Denum of that rank:",
|
|
2789
2834
|
"",
|
|
2790
2835
|
"- `a + b` adds corresponding loads and keeps opposite channels separate.",
|
|
2791
2836
|
"- `a * b` is the ordered Cartesian product of weighted signatures: loads",
|
|
@@ -2794,109 +2839,365 @@ export const HC_SOURCES = new Map([
|
|
|
2794
2839
|
" rank 4 the product is not associative.",
|
|
2795
2840
|
"- `a - b` is `a + b.opp ()`: subtraction is addition of the opposite, observed,",
|
|
2796
2841
|
" never erased.",
|
|
2797
|
-
"- `
|
|
2798
|
-
"- `
|
|
2799
|
-
"- `
|
|
2842
|
+
"- `v.opp ()` swaps the loads of `+e_b` and `-e_b`; a D0 is promoted to D1 first.",
|
|
2843
|
+
"- `v.conj ()` keeps the scalar signatures and swaps every other pair.",
|
|
2844
|
+
"- `v.promote k` embeds into rank k by the old-summand map, `±e_b ↦ ±e_(0b)`,",
|
|
2800
2845
|
" keeping Count and loads and starting new channels at zero. A lower k is",
|
|
2801
2846
|
" `$!.denum-demotion`.",
|
|
2802
|
-
"- `
|
|
2803
|
-
" direction, positive load minus negative load
|
|
2804
|
-
"
|
|
2847
|
+
"- `v.coordinates ()` is the algebraic observation: the signed coordinate of each",
|
|
2848
|
+
" direction, positive load minus negative load, `S_b = W₊,b − W₋,b`.",
|
|
2849
|
+
" `v.coordinates <>` is the directional observation: the unsigned coordinate,",
|
|
2850
|
+
" positive load plus negative load, `U_b = W₊,b + W₋,b`, which forgets the",
|
|
2851
|
+
" signature and keeps all load. Each is an ordered list of integers, width 1 at",
|
|
2852
|
+
" rank 0 and 2ⁿ⁻¹ at rank n, and not the view; neither changes the view or",
|
|
2853
|
+
" returns its Count. At rank 0 both are `[W_ε]`. The only arguments are nil",
|
|
2854
|
+
" `()` and true `<>`; any other argument (a Count, text, a list) is",
|
|
2855
|
+
" `$!!.unary-observation`, never coerced by truthiness.",
|
|
2856
|
+
"- `v.observe ()` is the deprecated v0.45.0 spelling of `v.coordinates ()`,",
|
|
2857
|
+
" kept only as a compatibility alias with exactly the signed result. It takes",
|
|
2858
|
+
" no unsigned argument; use `v.coordinates`.",
|
|
2859
|
+
"",
|
|
2860
|
+
"**Mixed operands.** A generic Denum and a view never combine, in either order, at",
|
|
2861
|
+
"equal arity or equal rank: `Denum + view` and `view + Denum` answer",
|
|
2862
|
+
"`$!.denum-mixed`, as do a view `-` or `*` with a Denum operand. A generic `-` or",
|
|
2863
|
+
"`*` is already the CD-only refusal `$!.denum-not-cd`. Nothing is reinterpreted",
|
|
2864
|
+
"and nothing is coerced.",
|
|
2805
2865
|
"",
|
|
2806
2866
|
"**Count.** The candidate laws of 007.32 section 6 hold for these new operations",
|
|
2807
|
-
"only: `C(a+b) = C(a)+C(b)
|
|
2808
|
-
"promotion and conjugation keep Count. Count is
|
|
2809
|
-
"loads, and it is not the application phase
|
|
2810
|
-
"`-`, `*` and `./` are unchanged. This is a
|
|
2811
|
-
"recurrence, not a derivation of it from bare
|
|
2812
|
-
"",
|
|
2813
|
-
"
|
|
2814
|
-
"
|
|
2815
|
-
"
|
|
2816
|
-
"
|
|
2817
|
-
"",
|
|
2818
|
-
"
|
|
2819
|
-
"
|
|
2820
|
-
"
|
|
2821
|
-
"
|
|
2822
|
-
"
|
|
2823
|
-
"
|
|
2824
|
-
"
|
|
2825
|
-
"
|
|
2826
|
-
"
|
|
2827
|
-
"
|
|
2828
|
-
"
|
|
2829
|
-
"
|
|
2830
|
-
"
|
|
2831
|
-
"
|
|
2832
|
-
"
|
|
2833
|
-
"",
|
|
2834
|
-
"
|
|
2835
|
-
"
|
|
2836
|
-
"
|
|
2837
|
-
"
|
|
2838
|
-
"
|
|
2839
|
-
"
|
|
2840
|
-
"
|
|
2867
|
+
"only: `C(a+b) = C(a)+C(b)` (generic and view), `C(a*b) = C(a)·C(b)` and",
|
|
2868
|
+
"`C(Opp a) = C(a)` for views, and promotion and conjugation keep Count. Count is",
|
|
2869
|
+
"carried, never derived from the loads, and it is not the application phase",
|
|
2870
|
+
"`C mod arity`. `Demi` and its `+`, `-`, `*` and `./` are unchanged. This is a",
|
|
2871
|
+
"software construction of a supplied recurrence, not a derivation of it from bare",
|
|
2872
|
+
"counting.",
|
|
2873
|
+
"",
|
|
2874
|
+
"**Observers.** Both types declare their own Count (`d.#`) and Size (`d.##`, the",
|
|
2875
|
+
"total load). A view also declares its residual (`v.###`, positive minus negative",
|
|
2876
|
+
"total, 0 at rank 0), so its `.####` is the ordinary derived Demi of those three,",
|
|
2877
|
+
"which is binary and forgets the directions. A generic Denum has no residual",
|
|
2878
|
+
"(`d.###` is `$!.denum-not-cd`).",
|
|
2879
|
+
"",
|
|
2880
|
+
"**The ranked hash.** `x.#n` is an explicit rung operation, n from 0 to 5, and",
|
|
2881
|
+
"there is no `#n=`. It answers a generic Denum, never a view. For any Frame x that",
|
|
2882
|
+
"is not a Denum or a view, `x.#n` answers the Denum of rank n, `nil` when x has no",
|
|
2883
|
+
"Count or Count zero, as `x.####` does. For an ordinary or binary host `x.#1` has",
|
|
2884
|
+
"the Count and the left and right loads of `x.####`. A `RotorRouter` of more than",
|
|
2885
|
+
"two channels is the exception: `.####` answers its channel Demi, and `.#n` does",
|
|
2886
|
+
"not special-case it, so it is the two-channel projection of the router's Count,",
|
|
2887
|
+
"Size and residual. Bare `x.#` is still the Count. The host is built from the",
|
|
2888
|
+
"three observers it answers, Count C, Size s and residual r: rank 0 keeps the load",
|
|
2889
|
+
"s, and rank n ≥ 1 puts (s+r)/2 on the first channel and (s−r)/2 on the first",
|
|
2890
|
+
"channel of the second half, the two the fourth hash reads as left and right,",
|
|
2891
|
+
"with every other channel zero. A host's applications carry no higher signature,",
|
|
2892
|
+
"so none is routed to them. That is construction, and it is not promotion. A Denum",
|
|
2893
|
+
"of a shipped binary arity (1, 2, 4, 8, 16, 32) answers `x.#n` by the structural",
|
|
2894
|
+
"load-preserving embedding at rung n, keeping Count and loads, and",
|
|
2895
|
+
"`$!.denum-demotion` below its own rank. The embedding does not invoke the view,",
|
|
2896
|
+
"so the answer is a Denum; it is the same map `v.promote` applies, with no CD",
|
|
2897
|
+
"operation attached. A Denum of another arity has no embedding and answers",
|
|
2898
|
+
"`$!.denum-unsupported-arity`: nothing is truncated, padded or read as `2^rank`.",
|
|
2899
|
+
"A view is not a source: `x.#n` answers `$!.denum-view-source` for it (ask the",
|
|
2900
|
+
"Denum it views, `v.denum ()`). A forged lookalike is not recognized as either.",
|
|
2901
|
+
"A rank above 5 is `$!.denum-rank`.",
|
|
2902
|
+
"",
|
|
2903
|
+
"The classes are evaluated from the compiled-in bundle the first time a ranked",
|
|
2904
|
+
"hash needs them, in a namespace of its own (`lib/execute/denum-prologue.ts`), so",
|
|
2905
|
+
"this file must not import.",
|
|
2906
|
+
"```",
|
|
2907
|
+
".denum-state {.s _; .c (s .0); .l (s .1); [",
|
|
2908
|
+
" .state s;",
|
|
2909
|
+
" .rank {.u ((_ = ()) ? {1} : {0}); .me _^;",
|
|
2910
|
+
" (u = 1) ? {denum-engine [11, (me .count), (me .loads)]} : {$!!.unary-observation}};",
|
|
2911
|
+
" .schema {.u ((_ = ()) ? {1} : {0}); .me _^;",
|
|
2912
|
+
" (u = 1) ? {denum-engine [13, (me .count), (me .loads)]} : {$!!.unary-observation}};",
|
|
2913
|
+
" .count c;",
|
|
2914
|
+
" .loads l;",
|
|
2915
|
+
" .# {_^.count};",
|
|
2916
|
+
" .## {(_^ .loads).##};",
|
|
2917
|
+
" .### {denum-engine [15]};",
|
|
2918
|
+
" .+ {.o (_^^ .operand-denum _); .me _^; .f (_^^ .finish-denum);",
|
|
2919
|
+
" (f (denum-engine [12, (me .count), (me .loads), (o .count), (o .loads)]))};",
|
|
2920
|
+
" .- {denum-engine [15]};",
|
|
2921
|
+
" .* {denum-engine [15]};",
|
|
2922
|
+
" .promote {denum-engine [15]};",
|
|
2923
|
+
" .opp {denum-engine [15]};",
|
|
2924
|
+
" .conj {denum-engine [15]};",
|
|
2925
|
+
" .coordinates {denum-engine [15]};",
|
|
2926
|
+
" .observe {denum-engine [15]};",
|
|
2927
|
+
" .signatures {denum-engine [15]};",
|
|
2928
|
+
" .cd {.u ((_ = ()) ? {1} : {0}); .me _^; .f (_^^ .finish-cd);",
|
|
2929
|
+
" (u = 1) ? {(f (denum-engine [14, (me .state)]))} : {$!!.unary-observation}};",
|
|
2930
|
+
" .toText {“Denum(” (_^ .schema ()) “, C=” (_^ .count) “, W=” (_^ .loads) “)”}",
|
|
2931
|
+
" ]};",
|
|
2932
|
+
".cd-state {.s _; .c (s .0); .l (s .1); [",
|
|
2933
|
+
" .state s;",
|
|
2934
|
+
" .rank {.u ((_ = ()) ? {1} : {0}); .me _^;",
|
|
2935
|
+
" (u = 1) ? {denum-engine [11, (me .count), (me .loads)]} : {$!!.unary-observation}};",
|
|
2936
|
+
" .schema {.u ((_ = ()) ? {1} : {0}); .me _^;",
|
|
2937
|
+
" (u = 1) ? {denum-engine [9, (me .state)]} : {$!!.unary-observation}};",
|
|
2841
2938
|
" .count c;",
|
|
2842
2939
|
" .loads l;",
|
|
2843
2940
|
" .# {_^.count};",
|
|
2844
2941
|
" .## {(_^ .loads).##};",
|
|
2845
|
-
" .### {denum-engine [10, (_^ .
|
|
2846
|
-
" .+ {.o (_^^ .operand _); .me _^; .f (_^^ .finish);",
|
|
2847
|
-
" (f (denum-engine [1, (me .
|
|
2848
|
-
" .- {.o (_^^ .operand _); .me _^; .f (_^^ .finish);",
|
|
2849
|
-
" (f (denum-engine [2, (me .
|
|
2850
|
-
" .* {.o (_^^ .operand _); .me _^; .f (_^^ .finish);",
|
|
2851
|
-
" (f (denum-engine [3, (me .
|
|
2852
|
-
" .promote {.k _; .me _^; .f (_^^ .finish);",
|
|
2853
|
-
" (f (denum-engine [6, (me .
|
|
2854
|
-
" .opp {.u ((_ = ()) ? {1} : {0}); .me _^; .f (_^^ .finish);",
|
|
2855
|
-
" (u = 1) ? {(f (denum-engine [4, (me .
|
|
2856
|
-
" .conj {.u ((_ = ()) ? {1} : {0}); .me _^; .f (_^^ .finish);",
|
|
2857
|
-
" (u = 1) ? {(f (denum-engine [5, (me .
|
|
2942
|
+
" .### {denum-engine [10, (_^ .state)]};",
|
|
2943
|
+
" .+ {.o (_^^ .operand-cd _); .me _^; .f (_^^ .finish-cd);",
|
|
2944
|
+
" (f (denum-engine [1, (me .state), (o .state)]))};",
|
|
2945
|
+
" .- {.o (_^^ .operand-cd _); .me _^; .f (_^^ .finish-cd);",
|
|
2946
|
+
" (f (denum-engine [2, (me .state), (o .state)]))};",
|
|
2947
|
+
" .* {.o (_^^ .operand-cd _); .me _^; .f (_^^ .finish-cd);",
|
|
2948
|
+
" (f (denum-engine [3, (me .state), (o .state)]))};",
|
|
2949
|
+
" .promote {.k _; .me _^; .f (_^^ .finish-cd);",
|
|
2950
|
+
" (f (denum-engine [6, (me .state), k]))};",
|
|
2951
|
+
" .opp {.u ((_ = ()) ? {1} : {0}); .me _^; .f (_^^ .finish-cd);",
|
|
2952
|
+
" (u = 1) ? {(f (denum-engine [4, (me .state)]))} : {$!!.unary-observation}};",
|
|
2953
|
+
" .conj {.u ((_ = ()) ? {1} : {0}); .me _^; .f (_^^ .finish-cd);",
|
|
2954
|
+
" (u = 1) ? {(f (denum-engine [5, (me .state)]))} : {$!!.unary-observation}};",
|
|
2955
|
+
" .coordinates {.s ((_ = ()) ? {1} : {0}); .t ((_ = <>) ? {1} : {0}); .me _^;",
|
|
2956
|
+
" ((s + t) = 1) ? {denum-engine [7, (me .state), t]} : {$!!.unary-observation}};",
|
|
2858
2957
|
" .observe {.u ((_ = ()) ? {1} : {0}); .me _^;",
|
|
2859
|
-
" (u = 1) ? {denum-engine [7, (me .
|
|
2958
|
+
" (u = 1) ? {denum-engine [7, (me .state), 0]} : {$!!.unary-observation}};",
|
|
2860
2959
|
" .signatures {.u ((_ = ()) ? {1} : {0}); .me _^;",
|
|
2861
|
-
" (u = 1) ? {denum-engine [8, (me .
|
|
2862
|
-
" .
|
|
2960
|
+
" (u = 1) ? {denum-engine [8, (me .state)]} : {$!!.unary-observation}};",
|
|
2961
|
+
" .denum {.u ((_ = ()) ? {1} : {0}); .me _^; .d (_^^ .Denum);",
|
|
2962
|
+
" (u = 1) ? {(d [(me .count), (me .loads)])} : {$!!.unary-observation}};",
|
|
2963
|
+
" .toText {(_^ .schema ()) “(C=” (_^ .count) “, W=” (_^ .loads) “)”}",
|
|
2863
2964
|
" ]};",
|
|
2864
|
-
".
|
|
2865
|
-
".
|
|
2866
|
-
"
|
|
2867
|
-
"
|
|
2965
|
+
".view-of {.d _; (d .cd ())};",
|
|
2966
|
+
".operand-denum {.o _; .r (Denum [(o .count), (o .loads)]);",
|
|
2967
|
+
" (o = r) ? {o} : {(refuse-operand o)}};",
|
|
2968
|
+
".viewable {.g _; ((g ~ ([].<>)) ? {(denum-engine [17, (g .state)])} : {0})};",
|
|
2969
|
+
".operand-cd {.o _; .g (Denum [(o .count), (o .loads)]);",
|
|
2970
|
+
" ((viewable g) = 1) ? {.r (view-of g); (o = r) ? {o} : {(refuse-operand o)}} : {(refuse-operand o)}};",
|
|
2971
|
+
".refuse-operand {.o _; .g (Denum [(o .count), (o .loads)]);",
|
|
2972
|
+
" .ig (((g ~ ([].<>)) ? {(o = g)}) ? {1} : {0});",
|
|
2973
|
+
" .ic (((viewable g) = 1) ? {.c (view-of g); (o = c) ? {1} : {0}} : {0});",
|
|
2974
|
+
" ((ig + ic) = 1) ? {denum-engine [16]} : {$!!.invalid-denum}};",
|
|
2975
|
+
".finish-denum {.s _; ((s ~ ([].<>)) ? {denum-state s} : {s})};",
|
|
2976
|
+
".finish-cd {.s _; ((s ~ ([].<>)) ? {cd-state s} : {s})};",
|
|
2977
|
+
".Denum {.a _; ((a ~ ([].<>)) ? {(a .#) = 2}) ? {.s (denum-engine [0, (a .0), (a .1)]);",
|
|
2978
|
+
" (s ~ ([].<>)) ? {denum-state s} : {$!!.invalid-denum}} : {$!!.invalid-denum}}",
|
|
2868
2979
|
"```",
|
|
2869
2980
|
"## Construction",
|
|
2870
2981
|
"",
|
|
2871
|
-
"
|
|
2872
|
-
"
|
|
2982
|
+
"There is one public constructor of retained state, `Denum [count, loads]`, and",
|
|
2983
|
+
"the explicit Cayley–Dickson interpretation is a request on the result, `d.cd ()`.",
|
|
2984
|
+
"Both views and Denums hold only the Count and one load per channel; the rank",
|
|
2985
|
+
"and schema are observed from the loads, never stored. In this file `V [count,",
|
|
2986
|
+
"loads]` is shorthand for `(Denum [count, loads]).cd ()`, defined once for the",
|
|
2987
|
+
"examples. It is not a constructor of the bundled classes: there is no `CD` name",
|
|
2988
|
+
"in them, and `V` exists only in these examples",
|
|
2989
|
+
"```",
|
|
2990
|
+
"; .V {.d (Denum _); (d .cd ())};",
|
|
2991
|
+
"; .z (V [0, [0]]);",
|
|
2992
|
+
"; [z.rank (), z.schema (), z.count, z.loads, z.#, z.##, z.###, “” z]",
|
|
2993
|
+
"# [0, “CD[0]”, 0, [0], 0, 0, 0, “CD[0](C=0, W=[0])”]",
|
|
2994
|
+
"```",
|
|
2995
|
+
"A Denum of zero loads is equally present: it is not nil and not a view",
|
|
2873
2996
|
"```",
|
|
2874
|
-
"; .
|
|
2875
|
-
"; [
|
|
2876
|
-
"# [0,
|
|
2997
|
+
"; .gz (Denum [0, [0, 0, 0, 0]]);",
|
|
2998
|
+
"; [“” gz, gz.rank (), gz.schema (), gz.count, gz.loads, gz.##, gz = ()]",
|
|
2999
|
+
"# [“Denum(Arity[4], C=0, W=[0, 0, 0, 0])”, 2, “Arity[4]”, 0, [0, 0, 0, 0], 0, ()]",
|
|
2877
3000
|
"```",
|
|
2878
3001
|
"The loads are Counts, one per channel, and the Count is kept apart from them: a",
|
|
2879
|
-
"
|
|
2880
|
-
"
|
|
2881
|
-
"non-list (a bare Count or text for the
|
|
3002
|
+
"state may hold loads at Count zero, or a Count over zero loads. A negative Count",
|
|
3003
|
+
"or load, a fractional load, an empty load list, the legacy three-field",
|
|
3004
|
+
"`[rank, count, loads]` constructor and a non-list (a bare Count or text for the",
|
|
3005
|
+
"loads included) are refused by `Denum`, and so by every view request, because no",
|
|
3006
|
+
"view exists without a Denum",
|
|
3007
|
+
"```",
|
|
3008
|
+
"; [“” (V [7, [3, 2, 0, 1]]), “” (V [0, [4, 0]]), “” (V [5, [0, 0]])]",
|
|
3009
|
+
"# [“CD[2](C=7, W=[3, 2, 0, 1])”, “CD[1](C=0, W=[4, 0])”, “CD[1](C=5, W=[0, 0])”]",
|
|
3010
|
+
"; [Denum [(0 - 1), [0, 0]], Denum [0, [0, (0 - 1)]], Denum [0, [0, 1.5]], Denum [0, []], Denum 5, Denum [0], Denum [1, 0, [0, 0]], Denum [2, 7, [3, 2, 0, 1]], Denum [0, [0, 0], 9], Denum [0, 5], Denum [0, “x”]]",
|
|
3011
|
+
"# [$!!.invalid-denum, $!!.invalid-denum, $!!.invalid-denum, $!!.invalid-denum, $!!.invalid-denum, $!!.invalid-denum, $!!.invalid-denum, $!!.invalid-denum, $!!.invalid-denum, $!!.invalid-denum, $!!.invalid-denum]",
|
|
3012
|
+
"```",
|
|
3013
|
+
"## One constructor, a derived view",
|
|
3014
|
+
"",
|
|
3015
|
+
"`Denum [7, [3, 2, 1, 4]]` is generic. It has the arity 4, the rank 2, the Count 7",
|
|
3016
|
+
"and the Size 10, but the channel count does not select the algebra: only the",
|
|
3017
|
+
"request `.cd ()` does, and it answers a different type. The Denum schema is",
|
|
3018
|
+
"`Arity[4]`, the view's `CD[2]`, the texts differ, and the two are not equal. The",
|
|
3019
|
+
"view reads its Count and loads from the Denum it was derived from, and the Denum",
|
|
3020
|
+
"is unchanged",
|
|
3021
|
+
"```",
|
|
3022
|
+
"; .gd (Denum [7, [3, 2, 1, 4]]); .dc (gd.cd ());",
|
|
3023
|
+
"; [gd.#, dc.#, gd.##, dc.##, gd.rank (), dc.rank (), gd.schema (), dc.schema ()]",
|
|
3024
|
+
"# [7, 7, 10, 10, 2, 2, “Arity[4]”, “CD[2]”]",
|
|
3025
|
+
"; [“” gd, “” dc, gd = dc, dc = gd, gd.loads = dc.loads, gd.count = dc.count]",
|
|
3026
|
+
"# [“Denum(Arity[4], C=7, W=[3, 2, 1, 4])”, “CD[2](C=7, W=[3, 2, 1, 4])”, (), (), <>, <>]",
|
|
3027
|
+
"```",
|
|
3028
|
+
"Deriving the view again is deterministic, and the source is untouched: still",
|
|
3029
|
+
"generic, still equal to its own reconstruction. The Denum behind a view is",
|
|
3030
|
+
"recovered with `v.denum ()`, equal to the original",
|
|
3031
|
+
"```",
|
|
3032
|
+
"; [gd.cd () = dc, dc.denum () = gd, “” (dc.denum ()), gd.loads, gd.count, gd = (Denum [7, [3, 2, 1, 4]])]",
|
|
3033
|
+
"# [<>, <>, “Denum(Arity[4], C=7, W=[3, 2, 1, 4])”, [3, 2, 1, 4], 7, <>]",
|
|
3034
|
+
"```",
|
|
3035
|
+
"Only the view has the signed and unsigned coordinates and the signatures. The",
|
|
3036
|
+
"Denum has no CD interpretation: every CD-only operation on it answers the named",
|
|
3037
|
+
"refusal `$!.denum-not-cd`, whatever its arity, and its loads are untouched",
|
|
3038
|
+
"```",
|
|
3039
|
+
"; [dc.coordinates (), dc.coordinates <>, dc.signatures (), dc.###]",
|
|
3040
|
+
"# [[2, -2], [4, 6], [“e_0”, “e_1”, “-e_0”, “-e_1”], 0]",
|
|
3041
|
+
"; [gd.coordinates (), gd.coordinates <>, gd.observe (), gd.signatures (), gd.###]",
|
|
3042
|
+
"# [$!.denum-not-cd, $!.denum-not-cd, $!.denum-not-cd, $!.denum-not-cd, $!.denum-not-cd]",
|
|
3043
|
+
"; [gd.opp (), gd.conj (), gd.promote 3, gd * gd, gd - gd, gd.loads, gd.count]",
|
|
3044
|
+
"# [$!.denum-not-cd, $!.denum-not-cd, $!.denum-not-cd, $!.denum-not-cd, $!.denum-not-cd, [3, 2, 1, 4], 7]",
|
|
3045
|
+
"```",
|
|
3046
|
+
"The request is unary. Any argument but nil is refused by name, and the Denum is",
|
|
3047
|
+
"unchanged. A view has no `.cd`, and none of the old constructor spellings exist",
|
|
3048
|
+
"```",
|
|
3049
|
+
"; [gd.cd 1, gd.cd <>, gd.cd “x”, gd.cd [1]]",
|
|
3050
|
+
"# [$!!.unary-observation, $!!.unary-observation, $!!.unary-observation, $!!.unary-observation]",
|
|
3051
|
+
"; [dc.denum 1, dc.denum <>, gd.loads]",
|
|
3052
|
+
"# [$!!.unary-observation, $!!.unary-observation, [3, 2, 1, 4]]",
|
|
3053
|
+
"```",
|
|
3054
|
+
"## Derived rank and arbitrary arity",
|
|
3055
|
+
"",
|
|
3056
|
+
"The rank is `⌊log₂ A⌋` of the arity `A = d.loads.#`, by integer arithmetic. It is",
|
|
3057
|
+
"never the Count `d.#`, and there is no rank field: `d.rank ()` computes it from",
|
|
3058
|
+
"the loads alone each time it is asked. This is an explicit call, so the v0.46.0",
|
|
3059
|
+
"data spelling `d.rank` is gone, and any argument but `()` is",
|
|
3060
|
+
"`$!!.unary-observation`. Any positive number of loads is a Denum, so",
|
|
3061
|
+
"`Denum [7, [3, 2, 1]]` has Count 7, three loads, Size 6 and rank 1, and no",
|
|
3062
|
+
"channel is dropped or added",
|
|
3063
|
+
"```",
|
|
3064
|
+
"; .three (Denum [7, [3, 2, 1]]);",
|
|
3065
|
+
"; [three.#, three.loads, three.loads.#, three.##, three.rank (), three.schema ()]",
|
|
3066
|
+
"# [7, [3, 2, 1], 3, 6, 1, “Arity[3]”]",
|
|
3067
|
+
"; [three.rank 1, three.rank <>, “” three]",
|
|
3068
|
+
"# [$!!.unary-observation, $!!.unary-observation, “Denum(Arity[3], C=7, W=[3, 2, 1])”]",
|
|
3069
|
+
"```",
|
|
3070
|
+
"The rank steps at every power of two, whatever the loads or the Count, and the",
|
|
3071
|
+
"same holds for the view observer",
|
|
3072
|
+
"```",
|
|
3073
|
+
"; .z4 [0, 0, 0, 0]; .z8 [0, 0, 0, 0, 0, 0, 0, 0];",
|
|
3074
|
+
"; [(Denum [0, [0]]).rank (), (Denum [0, [0, 0]]).rank (), three.rank (), (Denum [0, z4]).rank (), (Denum [0, [1, 2, 3, 4, 5]]).rank (), (Denum [0, [1, 2, 3, 4, 5, 6]]).rank (), (Denum [0, [1, 2, 3, 4, 5, 6, 7]]).rank (), (Denum [0, z8]).rank ()]",
|
|
3075
|
+
"# [0, 1, 1, 2, 2, 2, 2, 3]",
|
|
3076
|
+
"; [(V [0, [0]]).rank (), (V [0, [0, 0]]).rank (), (V [0, z4]).rank (), (V [0, z8]).rank ()]",
|
|
3077
|
+
"# [0, 1, 2, 3]",
|
|
3078
|
+
"```",
|
|
3079
|
+
"Identical loads at different Counts have the same rank, and the Count never",
|
|
3080
|
+
"enters it",
|
|
3081
|
+
"```",
|
|
3082
|
+
"; [(Denum [0, [3, 2, 1]]).rank (), (Denum [99, [3, 2, 1]]).rank (), (Denum [1000, [0]]).rank (), (Denum [1000, [0, 0]]).rank ()]",
|
|
3083
|
+
"# [1, 1, 0, 1]",
|
|
3084
|
+
"```",
|
|
3085
|
+
"A Denum accepts every positive arity, including 5, 6, 33 and 64, whose rank 6 is",
|
|
3086
|
+
"above the shipped CD rung 5. Its schema text is `Arity[A]`",
|
|
3087
|
+
"```",
|
|
3088
|
+
"; .t6 (Denum [1, [1, 2, 3, 4, 5, 6]]);",
|
|
3089
|
+
"; .t33 (Denum [1, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]); .t64 (Denum [2, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]);",
|
|
3090
|
+
"; [t6.schema (), t6.rank (), t33.schema (), t33.rank (), t64.schema (), t64.rank (), t64.loads.#, t64.##, (Denum [0, [0, 0, 0, 0, 0]]).schema ()]",
|
|
3091
|
+
"# [“Arity[6]”, 2, “Arity[33]”, 5, “Arity[64]”, 6, 64, 0, “Arity[5]”]",
|
|
3092
|
+
"```",
|
|
3093
|
+
"## Generic addition",
|
|
3094
|
+
"",
|
|
3095
|
+
"Two Denums of the same arity add componentwise: Counts add, loads add, nothing",
|
|
3096
|
+
"cancels, and the result is a fresh Denum of that arity. This is true at an odd",
|
|
3097
|
+
"arity and at a power of two alike, and the Count is independent of the Size",
|
|
3098
|
+
"```",
|
|
3099
|
+
"; .p3 (Denum [7, [3, 2, 1]]); .q3 (Denum [2, [4, 0, 0]]); .r3 (p3 + q3);",
|
|
3100
|
+
"; [r3.count, r3.loads, r3.##, r3.rank (), r3.schema (), “” r3, p3.loads, q3.loads]",
|
|
3101
|
+
"# [9, [7, 2, 1], 10, 1, “Arity[3]”, “Denum(Arity[3], C=9, W=[7, 2, 1])”, [3, 2, 1], [4, 0, 0]]",
|
|
3102
|
+
"; .p4 (Denum [7, [3, 2, 1, 4]]); .q4 (Denum [2, [4, 0, 0, 5]]); .r4 (p4 + q4);",
|
|
3103
|
+
"; [r4.count, r4.loads, r4.##, r4.rank (), r4.schema (), “” r4]",
|
|
3104
|
+
"# [9, [7, 2, 1, 9], 19, 2, “Arity[4]”, “Denum(Arity[4], C=9, W=[7, 2, 1, 9])”]",
|
|
3105
|
+
"```",
|
|
3106
|
+
"Opposite-looking channels are only loads here. They add, with no sign and no",
|
|
3107
|
+
"cancellation, and a sum is a new value, not an operand. Chaining stays generic",
|
|
3108
|
+
"```",
|
|
3109
|
+
"; .o4 (Denum [1, [2, 0, 1, 0]]); .u4 (Denum [1, [0, 3, 0, 2]]);",
|
|
3110
|
+
"; [(o4 + u4).loads, (o4 + u4).count, (o4 + u4) = o4, (o4 + u4) = (o4 + u4), ((o4 + u4) + o4).loads, “” ((o4 + u4) + o4)]",
|
|
3111
|
+
"# [[2, 3, 1, 2], 2, (), <>, [4, 3, 2, 2], “Denum(Arity[4], C=3, W=[4, 3, 2, 2])”]",
|
|
3112
|
+
"; [((Denum [1, [2]]) + (Denum [2, [5]])).loads, ((Denum [1, [2]]) + (Denum [2, [5]])).count, ((Denum [0, [1, 2, 3, 4, 5]]) + (Denum [0, [5, 4, 3, 2, 1]])).loads]",
|
|
3113
|
+
"# [[7], 3, [6, 6, 6, 6, 6]]",
|
|
3114
|
+
"```",
|
|
3115
|
+
"Different arities are refused by name (`$!.denum-arity-mismatch`); nothing is",
|
|
3116
|
+
"padded, truncated or aligned",
|
|
3117
|
+
"```",
|
|
3118
|
+
"; [p3 + p4, p4 + p3, p3 + (Denum [1, [1]]), (Denum [1, [1, 2]]) + p3]",
|
|
3119
|
+
"# [$!.denum-arity-mismatch, $!.denum-arity-mismatch, $!.denum-arity-mismatch, $!.denum-arity-mismatch]",
|
|
3120
|
+
"```",
|
|
3121
|
+
"## View eligibility",
|
|
3122
|
+
"",
|
|
3123
|
+
"`d.cd ()` needs one of the shipped channel arities 1, 2, 4, 8, 16 or 32. Any",
|
|
3124
|
+
"other arity is the named refusal `$!.denum-unsupported-arity`; no channel is",
|
|
3125
|
+
"padded, truncated or dropped, and the Denum is unchanged",
|
|
3126
|
+
"```",
|
|
3127
|
+
"; [“” ((Denum [7, [3, 2, 1, 4]]).cd ()), “” ((Denum [0, [0]]).cd ())]",
|
|
3128
|
+
"# [“CD[2](C=7, W=[3, 2, 1, 4])”, “CD[0](C=0, W=[0])”]",
|
|
3129
|
+
"; .zeros33 [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];",
|
|
3130
|
+
"; [(Denum [7, [3, 2, 1]]).cd (), (Denum [7, [3, 2, 1, 4, 5]]).cd (), (Denum [1, [1, 2, 3, 4, 5, 6]]).cd (), (Denum [0, zeros33]).cd (), t64.cd ()]",
|
|
3131
|
+
"# [$!.denum-unsupported-arity, $!.denum-unsupported-arity, $!.denum-unsupported-arity, $!.denum-unsupported-arity, $!.denum-unsupported-arity]",
|
|
3132
|
+
"```",
|
|
3133
|
+
"There is no way to ask for a view without a Denum. A view of a Denum is not a",
|
|
3134
|
+
"new constructor of state: its Count and loads are the Denum's, and the Denum",
|
|
3135
|
+
"behind it is recovered, equal, with `v.denum ()`. A fresh Denum built from the",
|
|
3136
|
+
"same fields is the same Denum, and so derives the same view",
|
|
3137
|
+
"```",
|
|
3138
|
+
"; .src (Denum [7, [3, 2, 1, 4]]); .made ((Denum [(src.count), (src.loads)]).cd ());",
|
|
3139
|
+
"; [“” made, made = src, made = (src.cd ()), src.schema (), made.schema (), src.loads]",
|
|
3140
|
+
"# [“CD[2](C=7, W=[3, 2, 1, 4])”, (), <>, “Arity[4]”, “CD[2]”, [3, 2, 1, 4]]",
|
|
3141
|
+
"```",
|
|
3142
|
+
"## Mixed operands",
|
|
3143
|
+
"",
|
|
3144
|
+
"A Denum and a view never combine, in either order and at any arity or rank. The",
|
|
3145
|
+
"Denum is not reinterpreted as a view at a matching arity, and a view is not read",
|
|
3146
|
+
"as a Denum either. `+` answers `$!.denum-mixed`; a generic `-` or `*` is the",
|
|
3147
|
+
"CD-only refusal `$!.denum-not-cd` on its own, and a view `-` or `*` with a Denum",
|
|
3148
|
+
"operand is `$!.denum-mixed`",
|
|
2882
3149
|
"```",
|
|
2883
|
-
"; [
|
|
2884
|
-
"# [
|
|
2885
|
-
";
|
|
2886
|
-
"
|
|
3150
|
+
"; [gd + dc, dc + gd, dc - gd, dc * gd, gd - dc, gd * dc]",
|
|
3151
|
+
"# [$!.denum-mixed, $!.denum-mixed, $!.denum-mixed, $!.denum-mixed, $!.denum-not-cd, $!.denum-not-cd]",
|
|
3152
|
+
"; .dc1 (V [1, [1, 0]]); .gd1 (Denum [1, [1, 0]]); .gd2 (Denum [1, [1]]); .dc0 (V [1, [1]]);",
|
|
3153
|
+
"; [dc1 + gd1, gd1 + dc1, dc1 * gd1, dc0 + gd2, gd2 + dc0, dc + (Denum [1, [1, 2, 3]]), (Denum [1, [1, 2, 3]]) + dc]",
|
|
3154
|
+
"# [$!.denum-mixed, $!.denum-mixed, $!.denum-mixed, $!.denum-mixed, $!.denum-mixed, $!.denum-mixed, $!.denum-mixed]",
|
|
3155
|
+
"```",
|
|
3156
|
+
"Neither identity is forged by copying `count` and `loads`: a plain aggregate with",
|
|
3157
|
+
"the same fields is neither a Denum nor a view, whatever the operation or the",
|
|
3158
|
+
"order",
|
|
3159
|
+
"```",
|
|
3160
|
+
"; .fake [.count 7; .loads [3, 2, 1, 4]];",
|
|
3161
|
+
"; [gd + fake, dc + fake, dc - fake, dc * fake, gd + [.count 7; .loads [3, 2, 1]], dc + [.count 7; .loads [3, 2, 1]]]",
|
|
3162
|
+
"# [$!!.invalid-denum, $!!.invalid-denum, $!!.invalid-denum, $!!.invalid-denum, $!!.invalid-denum, $!!.invalid-denum]",
|
|
3163
|
+
"; .lookalike [.count 7; .loads [3, 2, 1, 4]; .rank {2}; .schema {“CD[2]”}];",
|
|
3164
|
+
"; [dc + lookalike, gd + lookalike, dc * lookalike, fake = dc, fake = gd]",
|
|
3165
|
+
"# [$!!.invalid-denum, $!!.invalid-denum, $!!.invalid-denum, (), ()]",
|
|
3166
|
+
"```",
|
|
3167
|
+
"## Native capability",
|
|
3168
|
+
"",
|
|
3169
|
+
"The engine's CD operations do not take payloads. They take native view frames,",
|
|
3170
|
+
"which only the `view` operation makes, and only from a native Denum state. An",
|
|
3171
|
+
"arbitrary `[count, loads]` payload, a state built by hand, a lookalike with a",
|
|
3172
|
+
"`state` field and a bare `2ⁿ`-load array all lack that capability. The raw",
|
|
3173
|
+
"spelling of the old operations is refused by name, and so is a view request on a",
|
|
3174
|
+
"payload (`$!!.invalid-denum`)",
|
|
3175
|
+
"```",
|
|
3176
|
+
"; [denum-engine [3, 1, [0, 1, 0, 0], 1, [0, 1, 0, 0]], denum-engine [1, 7, [3, 2, 1, 4], 1, [0, 1, 0, 0]], denum-engine [7, 7, [3, 2, 1, 4]], denum-engine [14, 7, [3, 2, 1, 4]]]",
|
|
3177
|
+
"# [$!.denum-not-view, $!.denum-not-view, $!.denum-not-view, $!!.invalid-denum]",
|
|
3178
|
+
"; .forged [.count 7; .loads [3, 2, 1, 4]; .state [7, [3, 2, 1, 4]]];",
|
|
3179
|
+
"; [denum-engine [14, (forged .state)], denum-engine [7, (forged .state), 0], denum-engine [14, [7, [3, 2, 1, 4]]], denum-engine [9, [7, [3, 2, 1, 4]]], denum-engine [10, gd]]",
|
|
3180
|
+
"# [$!!.invalid-denum, $!.denum-not-view, $!!.invalid-denum, $!.denum-not-view, $!.denum-not-view]",
|
|
3181
|
+
"```",
|
|
3182
|
+
"A real view derived by `.cd ()` carries the capability, and a Denum state does not",
|
|
3183
|
+
"turn into a view without the request: the `view` operation on a view, or on the",
|
|
3184
|
+
"state of a view, is the same refusal",
|
|
3185
|
+
"```",
|
|
3186
|
+
"; [denum-engine [9, (dc .state)], denum-engine [9, (gd .state)], denum-engine [14, (dc .state)], denum-engine [9, (denum-engine [14, (gd .state)])]]",
|
|
3187
|
+
"# [“CD[2]”, $!.denum-not-view, $!!.invalid-denum, “CD[2]”]",
|
|
2887
3188
|
"```",
|
|
2888
3189
|
"## Signatures",
|
|
2889
3190
|
"",
|
|
2890
3191
|
"The native spelling has no sign bit: the direction is a bitstring of rank − 1",
|
|
2891
3192
|
"bits, and a minus names the opposite signature. Rank 0 has only `e_ε`",
|
|
2892
3193
|
"```",
|
|
2893
|
-
"; [(
|
|
3194
|
+
"; [(V [0, [0]]).signatures (), (V [0, [0, 0]]).signatures (), (V [0, [0, 0, 0, 0]]).signatures ()]",
|
|
2894
3195
|
"# [[“e_ε”], [“e_ε”, “-e_ε”], [“e_0”, “e_1”, “-e_0”, “-e_1”]]",
|
|
2895
|
-
"; (
|
|
3196
|
+
"; (V [0, [0, 0, 0, 0, 0, 0, 0, 0]]).signatures ()",
|
|
2896
3197
|
"# [“e_00”, “e_01”, “e_10”, “e_11”, “-e_00”, “-e_01”, “-e_10”, “-e_11”]",
|
|
2897
|
-
"; (
|
|
3198
|
+
"; (V [0, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]).signatures () .# ",
|
|
2898
3199
|
"# 16",
|
|
2899
|
-
"; ((
|
|
3200
|
+
"; ((V [0, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]).signatures ()) .# ",
|
|
2900
3201
|
"# 32",
|
|
2901
3202
|
"```",
|
|
2902
3203
|
"## Rank 0 and rank 1: Size and signed integers",
|
|
@@ -2905,87 +3206,88 @@ export const HC_SOURCES = new Map([
|
|
|
2905
3206
|
"has the two signatures `e_ε` and `-e_ε`, and the product of two minus signatures",
|
|
2906
3207
|
"is the plus signature, `(-e_ε)(-e_ε) = e_ε`, while every load stays a Count",
|
|
2907
3208
|
"```",
|
|
2908
|
-
"; .a (
|
|
3209
|
+
"; .a (V [2, [3]]); .b (V [5, [4]]);",
|
|
2909
3210
|
"; [(a + b).loads, (a + b).count, (a * b).loads, (a * b).count]",
|
|
2910
3211
|
"# [[7], 7, [12], 10]",
|
|
2911
|
-
"; .p (
|
|
3212
|
+
"; .p (V [1, [1, 0]]); .m (V [1, [0, 1]]);",
|
|
2912
3213
|
"; [(m * m).loads, (m * p).loads, (p * m).loads, (p * p).loads]",
|
|
2913
3214
|
"# [[1, 0], [0, 1], [0, 1], [1, 0]]",
|
|
2914
|
-
"; [((
|
|
3215
|
+
"; [((V [1, [0, 2]]) * (V [1, [0, 3]])).loads, ((V [1, [0, 2]]) * (V [1, [0, 3]])).coordinates ()]",
|
|
2915
3216
|
"# [[6, 0], [6]]",
|
|
2916
3217
|
"```",
|
|
2917
3218
|
"Opposite swaps the two channels and subtraction adds the opposite. The balanced",
|
|
2918
3219
|
"result observes as zero yet is a present, nonempty Denum with both loads",
|
|
2919
3220
|
"```",
|
|
2920
|
-
"; .x (
|
|
2921
|
-
"; [x.
|
|
3221
|
+
"; .x (V [1, [5, 2]]); .y (V [1, [3, 0]]);",
|
|
3222
|
+
"; [x.coordinates (), (x.opp ()).loads, (x - y).loads, (x - y).coordinates (), (x - y).count]",
|
|
2922
3223
|
"# [[3], [2, 5], [5, 5], [0], 2]",
|
|
2923
|
-
"; .s (
|
|
2924
|
-
"; [s.
|
|
3224
|
+
"; .s (V [1, [4, 4]]);",
|
|
3225
|
+
"; [s.coordinates (), s.loads, s.#, s.##, s.###]",
|
|
2925
3226
|
"# [[0], [4, 4], 1, 8, 0]",
|
|
2926
3227
|
"```",
|
|
2927
3228
|
"A D0 has no negative signature, so its opposite is promoted to D1 first",
|
|
2928
3229
|
"```",
|
|
2929
|
-
"; ((
|
|
3230
|
+
"; ((V [3, [4]]).opp ()).loads",
|
|
2930
3231
|
"# [0, 4]",
|
|
2931
|
-
"; ((
|
|
3232
|
+
"; ((V [3, [4]]).opp ()).schema ()",
|
|
2932
3233
|
"# “CD[1]”",
|
|
2933
3234
|
"```",
|
|
2934
|
-
"## Operands are
|
|
3235
|
+
"## Operands are views only",
|
|
2935
3236
|
"",
|
|
2936
|
-
"`+`, `-` and `*` refuse a right operand that is not a
|
|
2937
|
-
"the same `
|
|
3237
|
+
"A view's `+`, `-` and `*` refuse a right operand that is not a view, even when",
|
|
3238
|
+
"it carries the same `count` and `loads` fields, as `x.#n` refuses a forged source.",
|
|
3239
|
+
"A Denum with those fields is `$!.denum-mixed`, shown above",
|
|
2938
3240
|
"```",
|
|
2939
|
-
"; .dp (
|
|
3241
|
+
"; .dp (V [1, [1, 0]]); .lookalike [.count 1; .loads [1, 0]];",
|
|
2940
3242
|
"; [dp + lookalike, dp - lookalike, dp * lookalike, dp + [1, 1, [1, 0]], dp * 2]",
|
|
2941
3243
|
"# [$!!.invalid-denum, $!!.invalid-denum, $!!.invalid-denum, $!!.invalid-denum, $!!.invalid-denum]",
|
|
2942
|
-
"; [(dp + dp).loads, (dp * (dp + dp)).loads, (dp + (dp.opp ())).loads]",
|
|
2943
|
-
"# [[2, 0], [2, 0], [1, 1]]",
|
|
3244
|
+
"; [(dp + dp).loads, (dp * (dp + dp)).loads, (dp + (dp.opp ())).loads, “” (dp + dp)]",
|
|
3245
|
+
"# [[2, 0], [2, 0], [1, 1], “CD[1](C=2, W=[2, 0])”]",
|
|
2944
3246
|
"```",
|
|
2945
3247
|
"## Rank 2: J² = −1 and the four-step cycle",
|
|
2946
3248
|
"",
|
|
2947
3249
|
"`e_1` is the direction bit of J. Its square is the opposite scalar `-e_0`, and",
|
|
2948
3250
|
"the fourth power is back at `e_0`, observed",
|
|
2949
3251
|
"```",
|
|
2950
|
-
"; .j (
|
|
2951
|
-
"; [(j * j).loads, (j * j).
|
|
3252
|
+
"; .j (V [1, [0, 1, 0, 0]]);",
|
|
3253
|
+
"; [(j * j).loads, (j * j).coordinates (), ((j * j) * (j * j)).loads, ((j * j) * (j * j)).coordinates ()]",
|
|
2952
3254
|
"# [[0, 0, 1, 0], [-1, 0], [1, 0, 0, 0], [1, 0]]",
|
|
2953
3255
|
"```",
|
|
2954
3256
|
"## Rank 3: order matters",
|
|
2955
3257
|
"",
|
|
2956
3258
|
"With J = `e_01`, I = `e_10` and K = `e_11`, J·I = K and I·J = −K",
|
|
2957
3259
|
"```",
|
|
2958
|
-
"; .J (
|
|
3260
|
+
"; .J (V [1, [0, 1, 0, 0, 0, 0, 0, 0]]); .I (V [1, [0, 0, 1, 0, 0, 0, 0, 0]]);",
|
|
2959
3261
|
"; [(J * I).loads, (I * J).loads]",
|
|
2960
3262
|
"# [[0, 0, 0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 1]]",
|
|
2961
3263
|
"```",
|
|
2962
3264
|
"## Rank 4: the octonion associator",
|
|
2963
3265
|
"",
|
|
2964
3266
|
"`(e_001 e_010) e_100` is `+e_111` and `e_001 (e_010 e_100)` is `-e_111`. The",
|
|
2965
|
-
"
|
|
3267
|
+
"view keeps the parentheses, so the two groupings differ",
|
|
2966
3268
|
"```",
|
|
2967
|
-
"; .o1 (
|
|
3269
|
+
"; .o1 (V [1, [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]); .o2 (V [1, [0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]); .o4 (V [1, [0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]);",
|
|
2968
3270
|
"; [((o1 * o2) * o4).loads, (o1 * (o2 * o4)).loads]",
|
|
2969
3271
|
"# [[0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]]",
|
|
2970
|
-
"; [((o1 * o2) * o4).
|
|
3272
|
+
"; [((o1 * o2) * o4).coordinates () = (o1 * (o2 * o4)).coordinates ()]",
|
|
2971
3273
|
"# [()]",
|
|
2972
3274
|
"```",
|
|
2973
3275
|
"Through rank 3 the product is associative, so the same three directions in the",
|
|
2974
3276
|
"quaternions agree",
|
|
2975
3277
|
"```",
|
|
2976
|
-
"; [(J * I) * J = (J * (I * J)), ((J * I) * J).
|
|
3278
|
+
"; [(J * I) * J = (J * (I * J)), ((J * I) * J).coordinates ()]",
|
|
2977
3279
|
"# [<>, [0, 0, 1, 0]]",
|
|
2978
3280
|
"```",
|
|
2979
3281
|
"## Rank 5: sedenion zero divisors",
|
|
2980
3282
|
"",
|
|
2981
3283
|
"`(e_0001 + e_1010)(e_0100 − e_1111)` observes as zero though neither factor does.",
|
|
2982
|
-
"The product is not an empty
|
|
3284
|
+
"The product is not an empty view: it holds four loads, in cancelling pairs",
|
|
2983
3285
|
"```",
|
|
2984
|
-
"; .u (
|
|
2985
|
-
"; [u.
|
|
3286
|
+
"; .u (V [1, [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]); .v (V [1, [0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]]);",
|
|
3287
|
+
"; [u.coordinates (), v.coordinates ()]",
|
|
2986
3288
|
"# [[0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1]]",
|
|
2987
3289
|
"; .w (u * v);",
|
|
2988
|
-
"; [w.
|
|
3290
|
+
"; [w.coordinates (), w.count, w.##, w.###, w.loads]",
|
|
2989
3291
|
"# [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 1, 4, 0, [0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0]]",
|
|
2990
3292
|
"```",
|
|
2991
3293
|
"## Promotion across the ladder",
|
|
@@ -2995,28 +3297,28 @@ export const HC_SOURCES = new Map([
|
|
|
2995
3297
|
"at zero. D0 goes to the positive scalar, so the new minus channel is empty, and",
|
|
2996
3298
|
"the map is path independent",
|
|
2997
3299
|
"```",
|
|
2998
|
-
"; .t (
|
|
3300
|
+
"; .t (V [4, [6]]);",
|
|
2999
3301
|
"; [(t.promote 1).loads, (t.promote 2).loads, ((t.promote 1).promote 2).loads = (t.promote 2).loads, (t.promote 3).count]",
|
|
3000
3302
|
"# [[6, 0], [6, 0, 0, 0], <>, 4]",
|
|
3001
|
-
"; .k (
|
|
3002
|
-
"; [(k.promote 2).loads, (k.promote 3).loads, ((k.promote 2).promote 3).loads = (k.promote 3).loads, k.loads, k.rank]",
|
|
3303
|
+
"; .k (V [3, [2, 5]]);",
|
|
3304
|
+
"; [(k.promote 2).loads, (k.promote 3).loads, ((k.promote 2).promote 3).loads = (k.promote 3).loads, k.loads, k.rank ()]",
|
|
3003
3305
|
"# [[2, 0, 5, 0], [2, 0, 0, 0, 5, 0, 0, 0], <>, [2, 5], 1]",
|
|
3004
|
-
"; [((
|
|
3306
|
+
"; [((V [1, [0, 1, 0, 0]]).promote 3).loads, ((V [1, [0, 0, 0, 1]]).promote 3).loads]",
|
|
3005
3307
|
"# [[0, 1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0, 0]]",
|
|
3006
3308
|
"```",
|
|
3007
3309
|
"A lower rank is refused, and so is a rank above 5 or something that is not a",
|
|
3008
3310
|
"Count. The source is never changed",
|
|
3009
3311
|
"```",
|
|
3010
|
-
"; [(
|
|
3312
|
+
"; [(V [1, [0, 0, 0, 0, 0, 0, 0, 0]]).promote 2, k.promote 6, k.promote (0 - 1), k.promote “x”]",
|
|
3011
3313
|
"# [$!.denum-demotion, $!.denum-rank, $!.denum-rank, $!.denum-rank]",
|
|
3012
3314
|
"```",
|
|
3013
3315
|
"Mixed ranks promote to the larger one before the operation, and the product keeps",
|
|
3014
|
-
"its operand order. A rank 2 and a rank 3
|
|
3316
|
+
"its operand order. A rank 2 and a rank 3 view multiply as two rank 3 views",
|
|
3015
3317
|
"```",
|
|
3016
|
-
"; .c2 (
|
|
3017
|
-
"; [(c2 * c3).schema, (c2 * c3).loads, (c3 * c2).loads, (c2 * c3).loads = ((c2.promote 3) * c3).loads, (c2 + c3).schema, (c2 + c3).count]",
|
|
3318
|
+
"; .c2 (V [2, [0, 1, 0, 0]]); .c3 (V [3, [0, 0, 1, 0, 0, 0, 0, 0]]);",
|
|
3319
|
+
"; [(c2 * c3).schema (), (c2 * c3).loads, (c3 * c2).loads, (c2 * c3).loads = ((c2.promote 3) * c3).loads, (c2 + c3).schema (), (c2 + c3).count]",
|
|
3018
3320
|
"# [“CD[3]”, [0, 0, 0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 1], <>, “CD[3]”, 5]",
|
|
3019
|
-
"; [((c3.promote 5) * (
|
|
3321
|
+
"; [((c3.promote 5) * (V [1, [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]])).loads = ((c3 * (V [1, [0, 1, 0, 0, 0, 0, 0, 0]])).promote 5).loads]",
|
|
3020
3322
|
"# [<>]",
|
|
3021
3323
|
"```",
|
|
3022
3324
|
"## Conjugation",
|
|
@@ -3025,43 +3327,167 @@ export const HC_SOURCES = new Map([
|
|
|
3025
3327
|
"other direction. It keeps the Count and the loads. A product conjugates in",
|
|
3026
3328
|
"reverse order, observed",
|
|
3027
3329
|
"```",
|
|
3028
|
-
"; .g (
|
|
3029
|
-
"; [(g.conj ()).loads, (g.conj ()).count, (g.conj ()).
|
|
3330
|
+
"; .g (V [4, [1, 2, 3, 4]]);",
|
|
3331
|
+
"; [(g.conj ()).loads, (g.conj ()).count, (g.conj ()).coordinates (), g.coordinates ()]",
|
|
3030
3332
|
"# [[1, 4, 3, 2], 4, [-2, 2], [-2, -2]]",
|
|
3031
|
-
"; [(((J * I).conj ()).
|
|
3333
|
+
"; [(((J * I).conj ()).coordinates ()) = (((I.conj ()) * (J.conj ())).coordinates ()), ((V [1, [4]]).conj ()).loads]",
|
|
3032
3334
|
"# [<>, [4]]",
|
|
3033
3335
|
"```",
|
|
3034
3336
|
"## Count",
|
|
3035
3337
|
"",
|
|
3036
|
-
"Count is carried and never derived from the loads. For these
|
|
3338
|
+
"Count is carried and never derived from the loads. For these view operations",
|
|
3037
3339
|
"it adds under `+`, multiplies under `*`, and survives the opposite, conjugation",
|
|
3038
3340
|
"and promotion. A Count of zero may hold nonzero loads",
|
|
3039
3341
|
"```",
|
|
3040
|
-
"; .e (
|
|
3342
|
+
"; .e (V [3, [1, 0, 0, 2]]); .f (V [4, [0, 5, 1, 0]]);",
|
|
3041
3343
|
"; [(e + f).count, (e * f).count, (e.opp ()).count, (e.conj ()).count, (e.promote 4).count, (e - f).count]",
|
|
3042
3344
|
"# [7, 12, 3, 3, 3, 7]",
|
|
3043
|
-
"; .odd (
|
|
3345
|
+
"; .odd (V [0, [3, 0, 0, 0]]);",
|
|
3044
3346
|
"; [odd.count, odd.##, (odd * f).count, (odd * f).loads, (odd + f).count]",
|
|
3045
3347
|
"# [0, 3, 0, [0, 15, 3, 0], 4]",
|
|
3046
3348
|
"```",
|
|
3047
|
-
"##
|
|
3349
|
+
"## Coordinates: signed and unsigned",
|
|
3350
|
+
"",
|
|
3351
|
+
"One method reads the preserved view two ways. `d.coordinates ()` is the signed",
|
|
3352
|
+
"coordinate `S_b = W₊,b − W₋,b` and `d.coordinates <>` is the unsigned",
|
|
3353
|
+
"coordinate `U_b = W₊,b + W₋,b`, one integer per direction in the order of the",
|
|
3354
|
+
"channels. They are observations: they never change the view, and the Count is",
|
|
3355
|
+
"neither used nor returned. `U` is not `|S|`: opposing loads 3 and 1 give",
|
|
3356
|
+
"`S = 2` and `U = 4`, and the Count 1 below is not a coordinate",
|
|
3357
|
+
"```",
|
|
3358
|
+
"; .q (V [1, [3, 2, 1, 4]]);",
|
|
3359
|
+
"; [q.coordinates (), q.coordinates <>, q.observe (), q.count, q.loads]",
|
|
3360
|
+
"# [[2, -2], [4, 6], [2, -2], 1, [3, 2, 1, 4]]",
|
|
3361
|
+
"```",
|
|
3362
|
+
"The Count is independent: the same loads at another Count, even zero, give the",
|
|
3363
|
+
"same coordinates, and a positive Count over zero loads gives zero coordinates",
|
|
3364
|
+
"```",
|
|
3365
|
+
"; .q9 (V [9, [3, 2, 1, 4]]); .q0 (V [0, [3, 2, 1, 4]]); .qz (V [5, [0, 0, 0, 0]]);",
|
|
3366
|
+
"; [q9.coordinates (), q9.coordinates <>, q0.coordinates <>, qz.coordinates (), qz.coordinates <>, qz.count]",
|
|
3367
|
+
"# [[2, -2], [4, 6], [4, 6], [0, 0], [0, 0], 5]",
|
|
3368
|
+
"```",
|
|
3369
|
+
"Rank 0 has one unsigned channel, so both readings are its one load. Higher ranks",
|
|
3370
|
+
"have width 2ⁿ⁻¹",
|
|
3371
|
+
"```",
|
|
3372
|
+
"; .r0 (V [2, [3]]); .r1 (V [2, [4, 2]]); .r3 (V [0, [1, 2, 3, 4, 0, 0, 0, 0]]);",
|
|
3373
|
+
"; [r0.coordinates (), r0.coordinates <>, r1.coordinates (), r1.coordinates <>, r3.coordinates (), r3.coordinates <>]",
|
|
3374
|
+
"# [[3], [3], [2], [6], [1, 2, 3, 4], [1, 2, 3, 4]]",
|
|
3375
|
+
"```",
|
|
3376
|
+
"Balanced opposing loads observe as zero in `S` and not in `U`, and the present",
|
|
3377
|
+
"view is still distinct from the missing host",
|
|
3378
|
+
"```",
|
|
3379
|
+
"; .bal (V [1, [4, 4]]);",
|
|
3380
|
+
"; [bal.coordinates (), bal.coordinates <>, (V [0, [0]]).coordinates <>, [].#0]",
|
|
3381
|
+
"# [[0], [8], [0], ()]",
|
|
3382
|
+
"```",
|
|
3383
|
+
"Only nil and true are arguments. A Count, text, a list, a block or a truthy",
|
|
3384
|
+
"Frame is refused by name, not coerced, and `observe` accepts only nil",
|
|
3385
|
+
"```",
|
|
3386
|
+
"; [q.coordinates 1, q.coordinates 0, q.coordinates “x”, q.coordinates [1], q.coordinates [], q.coordinates {1}, q.observe <>, q.observe 1]",
|
|
3387
|
+
"# [$!!.unary-observation, $!!.unary-observation, $!!.unary-observation, $!!.unary-observation, $!!.unary-observation, $!!.unary-observation, $!!.unary-observation, $!!.unary-observation]",
|
|
3388
|
+
"```",
|
|
3389
|
+
"Rank 4 has eight directions and rank 5 sixteen, each in channel order. Here",
|
|
3390
|
+
"positive loads 1 to 8 (or 1 to 16) sit over negative loads 10 times as large",
|
|
3391
|
+
"```",
|
|
3392
|
+
"; .q4 (V [0, [1, 2, 3, 4, 5, 6, 7, 8, 10, 20, 30, 40, 50, 60, 70, 80]]);",
|
|
3393
|
+
"; [q4.coordinates (), q4.coordinates <>]",
|
|
3394
|
+
"# [[-9, -18, -27, -36, -45, -54, -63, -72], [11, 22, 33, 44, 55, 66, 77, 88]]",
|
|
3395
|
+
"; .q5 (V [0, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160]]);",
|
|
3396
|
+
"; [q5.coordinates () .#, q5.coordinates <> .#, (q5.coordinates <>).0, (q5.coordinates <>).15, (q5.coordinates ()).15]",
|
|
3397
|
+
"# [16, 16, 11, 176, -144]",
|
|
3398
|
+
"```",
|
|
3399
|
+
"The seven nonzero directions of rank 4 are the prospective Fano points, and a",
|
|
3400
|
+
"line is the unsigned direction of the product of two of them. Nothing here is a",
|
|
3401
|
+
"table: each direction below is read from the shipped product. The signs of",
|
|
3402
|
+
"`e_001 e_010` and `e_010 e_001` differ and the direction `011` does not",
|
|
3403
|
+
"```",
|
|
3404
|
+
"; .p1 (V [1, [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]); .p2 (V [1, [0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]); .p4 (V [1, [0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]);",
|
|
3405
|
+
"; [(p1 * p2).coordinates <>, (p2 * p1).coordinates <>, (p1 * p2).coordinates (), (p2 * p1).coordinates ()]",
|
|
3406
|
+
"# [[0, 0, 0, 1, 0, 0, 0, 0], [0, 0, 0, 1, 0, 0, 0, 0], [0, 0, 0, 1, 0, 0, 0, 0], [0, 0, 0, -1, 0, 0, 0, 0]]",
|
|
3407
|
+
"; [(p1 * p4).coordinates <>, (p2 * p4).coordinates <>]",
|
|
3408
|
+
"# [[0, 0, 0, 0, 0, 1, 0, 0], [0, 0, 0, 0, 0, 0, 1, 0]]",
|
|
3409
|
+
"```",
|
|
3410
|
+
"Through the same projection the unsigned coordinate of a product is the XOR",
|
|
3411
|
+
"convolution of the unsigned coordinates, and the signed associator at rank 4",
|
|
3412
|
+
"collapses to one direction (`111`) under `<>`",
|
|
3413
|
+
"```",
|
|
3414
|
+
"; [(((o1 * o2) * o4).coordinates <>) = ((o1 * (o2 * o4)).coordinates <>), (((o1 * o2) * o4).coordinates ()) = ((o1 * (o2 * o4)).coordinates ()), ((o1 * o2) * o4).coordinates <>]",
|
|
3415
|
+
"# [<>, (), [0, 0, 0, 0, 0, 0, 0, 1]]",
|
|
3416
|
+
"```",
|
|
3417
|
+
"## Coordinates and the native observers",
|
|
3418
|
+
"",
|
|
3419
|
+
"The two coordinate readings are projections of the same loads that `d.##` and",
|
|
3420
|
+
"`d.###` already report, so the observers cannot drift apart. For every rank the",
|
|
3421
|
+
"unsigned coordinates total the Size, `Σ U_b = d.## = Σ W`. For rank 1 and above",
|
|
3422
|
+
"the signed coordinates total the residual, `Σ S_b = d.###`. At rank 0 the one",
|
|
3423
|
+
"coordinate is `W_ε` in both readings, but the declared residual is 0 by design,",
|
|
3424
|
+
"so `Σ S = W_ε` and `d.### = 0` differ there. The Count is none of these",
|
|
3425
|
+
"```",
|
|
3426
|
+
"; .c0 (V [4, [3]]); .c1 (V [0, [4, 1]]); .c2 (V [1, [3, 2, 1, 4]]);",
|
|
3427
|
+
"; .c0s (c0.coordinates ()); .c1s (c1.coordinates ()); .c2s (c2.coordinates ());",
|
|
3428
|
+
"; .tc0 (c0s.0); .tc1 (c1s.0); .tc2 ((c2s.0) + (c2s.1));",
|
|
3429
|
+
"; [(c0.coordinates <>).##, c0.##, tc0, c0.###, c0.#]",
|
|
3430
|
+
"# [3, 3, 3, 0, 4]",
|
|
3431
|
+
"; [(c1.coordinates <>).##, c1.##, tc1, c1.###, c1.#]",
|
|
3432
|
+
"# [5, 5, 3, 3, 0]",
|
|
3433
|
+
"; [(c2.coordinates <>).##, c2.##, tc2, c2.###, c2.#]",
|
|
3434
|
+
"# [10, 10, 0, 0, 1]",
|
|
3435
|
+
"```",
|
|
3436
|
+
"The same holds when the residual is negative, when loads are empty or balanced,",
|
|
3437
|
+
"and at every higher rank, whatever the Count. Each row is the unsigned total, the",
|
|
3438
|
+
"Size, the signed total, the residual and the Count",
|
|
3439
|
+
"```",
|
|
3440
|
+
"; .n2 (V [0, [0, 1, 5, 3]]); .e2 (V [7, [0, 0, 0, 0]]); .b3 (V [2, [2, 0, 5, 0, 2, 0, 5, 0]]);",
|
|
3441
|
+
"; .n4 (V [0, [1, 2, 3, 4, 5, 6, 7, 8, 10, 20, 30, 40, 50, 60, 70, 80]]);",
|
|
3442
|
+
"; .n5 (V [3, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160]]);",
|
|
3443
|
+
"; .n2s (n2.coordinates ()); .tn2 ((n2s.0) + (n2s.1));",
|
|
3444
|
+
"; .n4s (n4.coordinates ()); .tn4 ((n4s.0) + (n4s.1) + (n4s.2) + (n4s.3) + (n4s.4) + (n4s.5) + (n4s.6) + (n4s.7));",
|
|
3445
|
+
"; .n5s (n5.coordinates ()); .tn5 ((n5s.0) + (n5s.1) + (n5s.2) + (n5s.3) + (n5s.4) + (n5s.5) + (n5s.6) + (n5s.7) + (n5s.8) + (n5s.9) + (n5s.10) + (n5s.11) + (n5s.12) + (n5s.13) + (n5s.14) + (n5s.15));",
|
|
3446
|
+
"; [(n2.coordinates <>).##, n2.##, tn2, n2.###, n2.#]",
|
|
3447
|
+
"# [9, 9, -7, -7, 0]",
|
|
3448
|
+
"; [(e2.coordinates <>).##, e2.##, (e2.coordinates ()).###, e2.###, e2.#]",
|
|
3449
|
+
"# [0, 0, 0, 0, 7]",
|
|
3450
|
+
"; [(b3.coordinates <>).##, b3.##, (b3.coordinates ()).###, b3.###, b3.#]",
|
|
3451
|
+
"# [14, 14, 0, 0, 2]",
|
|
3452
|
+
"; [(n4.coordinates <>).##, n4.##, tn4, n4.###, n4.#]",
|
|
3453
|
+
"# [396, 396, -324, -324, 0]",
|
|
3454
|
+
"; [(n5.coordinates <>).##, n5.##, tn5, n5.###, n5.#]",
|
|
3455
|
+
"# [1496, 1496, -1224, -1224, 3]",
|
|
3456
|
+
"```",
|
|
3457
|
+
"D0 is the only exception, and it is by design. Its residual is 0 though its one",
|
|
3458
|
+
"coordinate is the load, so no rank-0 row may be fixed by changing the residual",
|
|
3459
|
+
"```",
|
|
3460
|
+
"; .z0 (V [0, [0]]); .p0 (V [0, [9]]);",
|
|
3461
|
+
"; [z0.coordinates (), z0.coordinates <>, z0.##, z0.###, p0.coordinates (), p0.coordinates <>, p0.##, p0.###]",
|
|
3462
|
+
"# [[0], [0], 0, 0, [9], [9], 9, 0]",
|
|
3463
|
+
"```",
|
|
3048
3464
|
"",
|
|
3049
3465
|
"`x.#n` is the Denum of rung n for n from 0 to 5, and bare `x.#` is still the",
|
|
3050
|
-
"Count. A host answers its Count C, Size s and residual
|
|
3051
|
-
"C = 3, s = 6 and r = 2. Rank 0 keeps the one load s, rank 1
|
|
3052
|
-
"
|
|
3053
|
-
"higher rank puts the same two on
|
|
3466
|
+
"Count. It never answers a view. A host answers its Count C, Size s and residual",
|
|
3467
|
+
"r, so `[1, 2, 3]` has C = 3, s = 6 and r = 2. Rank 0 keeps the one load s, rank 1",
|
|
3468
|
+
"puts (s+r)/2 on the first channel and (s−r)/2 on the second, which are the Demi's",
|
|
3469
|
+
"left and right loads, and a higher rank puts the same two on the first channel of",
|
|
3470
|
+
"each half. The answer has no CD multiplication: it is an ordinary Denum, and",
|
|
3471
|
+
"`.cd ()` is the only request for the interpretation",
|
|
3054
3472
|
"```",
|
|
3055
3473
|
"; .xs [1, 2, 3];",
|
|
3056
3474
|
"; [xs.#, xs.##, xs.###, “” (xs.####)]",
|
|
3057
3475
|
"# [3, 6, 2, “Demi(3,4,2)”]",
|
|
3058
3476
|
"; [“” (xs.#0), “” (xs.#1), “” (xs.#2)]",
|
|
3059
|
-
"# [“Denum(
|
|
3060
|
-
"; [(xs.#3).loads, (xs.#4).##, (xs.#5).schema, (xs.#5).loads .#, (xs.#5).
|
|
3061
|
-
"# [[4, 0, 0, 0, 2, 0, 0, 0], 6, “
|
|
3477
|
+
"# [“Denum(Arity[1], C=3, W=[6])”, “Denum(Arity[2], C=3, W=[4, 2])”, “Denum(Arity[4], C=3, W=[4, 0, 2, 0])”]",
|
|
3478
|
+
"; [(xs.#3).loads, (xs.#4).##, (xs.#5).schema (), (xs.#5).loads .#, (xs.#5).rank ()]",
|
|
3479
|
+
"# [[4, 0, 0, 0, 2, 0, 0, 0], 6, “Arity[32]”, 32, 5]",
|
|
3062
3480
|
"; [xs.#1.loads = xs.####.loads, xs.#1.count = xs.####.count]",
|
|
3063
3481
|
"# [<>, <>]",
|
|
3064
3482
|
"```",
|
|
3483
|
+
"The answer is a Denum with no CD capability. It has no coordinates or product,",
|
|
3484
|
+
"and a view is the explicit, separate request on it",
|
|
3485
|
+
"```",
|
|
3486
|
+
"; [xs.#2.coordinates (), xs.#2 * xs.#2, xs.#2.opp (), xs.#2.signatures ()]",
|
|
3487
|
+
"# [$!.denum-not-cd, $!.denum-not-cd, $!.denum-not-cd, $!.denum-not-cd]",
|
|
3488
|
+
"; [“” (xs.#2.cd ()), (xs.#2.cd ()).coordinates (), (xs.#2 + xs.#2).loads, ((xs.#2).cd ()) = ((xs.#2).cd ())]",
|
|
3489
|
+
"# [“CD[2](C=3, W=[4, 0, 2, 0])”, [2, 0], [8, 0, 4, 0], <>]",
|
|
3490
|
+
"```",
|
|
3065
3491
|
"A router of more than two channels keeps its channel Demi under `.####`, and",
|
|
3066
3492
|
"`.#1` is the binary projection of the same three observers, which is what the",
|
|
3067
3493
|
"fourth hash derives for a binary router. Both answers are pinned",
|
|
@@ -3070,9 +3496,9 @@ export const HC_SOURCES = new Map([
|
|
|
3070
3496
|
"; .RotorRouter Routers.RotorRouter;",
|
|
3071
3497
|
"; .r3 (RotorRouter [[5, 8], [6], [7]]); .r2 (RotorRouter [[5], [6]]);",
|
|
3072
3498
|
"; [r3.#, r3.##, r3.###, “” r3.####, “” r3.#1, “” r3.#2, (r3.#1).count = r3.####.count]",
|
|
3073
|
-
"# [4, 26, 14, “Demi(4,[13, 6, 7])”, “Denum(
|
|
3499
|
+
"# [4, 26, 14, “Demi(4,[13, 6, 7])”, “Denum(Arity[2], C=4, W=[20, 6])”, “Denum(Arity[4], C=4, W=[20, 0, 6, 0])”, <>]",
|
|
3074
3500
|
"; [“” r2.####, “” r2.#1, (r2.#1).loads = [(r2.####).left, (r2.####).right]]",
|
|
3075
|
-
"# [“Demi(2,5,6)”, “Denum(
|
|
3501
|
+
"# [“Demi(2,5,6)”, “Denum(Arity[2], C=2, W=[5, 6])”, <>]",
|
|
3076
3502
|
"```",
|
|
3077
3503
|
"It is construction, not promotion. Promotion of an existing Demi-shaped host",
|
|
3078
3504
|
"adds nothing, because a host's applications carry no higher signature. Each",
|
|
@@ -3082,38 +3508,70 @@ export const HC_SOURCES = new Map([
|
|
|
3082
3508
|
"; [[].#0, [].#1, [].#5, ().#2, 0.#3]",
|
|
3083
3509
|
"# [(), (), (), (), ()]",
|
|
3084
3510
|
"; [“”.#1, “” (“a”.#0), ({5 + 3}.#1).loads = ({5 + 3}.####).loads, ({5 + 3}.#1).count]",
|
|
3085
|
-
"# [(), “Denum(
|
|
3511
|
+
"# [(), “Denum(Arity[1], C=1, W=[1])”, <>, 3]",
|
|
3086
3512
|
"```",
|
|
3087
3513
|
"Application to a zero Size still counts, so a Denum of zero loads can have a",
|
|
3088
3514
|
"positive Count, and it is present. It is not the missing host",
|
|
3089
3515
|
"```",
|
|
3090
3516
|
"; .zs [0, 0];",
|
|
3091
|
-
"; [“” (zs.#0), “” (zs.#1), zs.#0 = (), (Denum [0,
|
|
3092
|
-
"# [“Denum(
|
|
3093
|
-
"```",
|
|
3094
|
-
"A Denum answers the ranked hash by
|
|
3095
|
-
"
|
|
3096
|
-
"
|
|
3097
|
-
"
|
|
3098
|
-
"
|
|
3099
|
-
"
|
|
3517
|
+
"; [“” (zs.#0), “” (zs.#1), zs.#0 = (), (Denum [0, [0]]) = ()]",
|
|
3518
|
+
"# [“Denum(Arity[1], C=2, W=[0])”, “Denum(Arity[2], C=2, W=[0, 0])”, (), ()]",
|
|
3519
|
+
"```",
|
|
3520
|
+
"A Denum of a shipped binary arity answers the ranked hash by the structural",
|
|
3521
|
+
"embedding of its own state, at every Count including zero, and",
|
|
3522
|
+
"`$!.denum-demotion` below its rank. It keeps Count and loads, starts the new",
|
|
3523
|
+
"channels at zero and answers a Denum. This is the embedding that `v.promote`",
|
|
3524
|
+
"applies, without the CD interpretation. Nothing the source declares can steer",
|
|
3525
|
+
"it: a lookalike aggregate with the same fields is an ordinary host and is",
|
|
3526
|
+
"measured like any other",
|
|
3527
|
+
"```",
|
|
3528
|
+
"; .dn (Denum [0, [3, 1]]);",
|
|
3100
3529
|
"; [“” (dn.#1), “” (dn.#3), (dn.#2).loads, (dn.#5).count, dn.#0]",
|
|
3101
|
-
"# [“Denum(
|
|
3102
|
-
"; .fake [.
|
|
3530
|
+
"# [“Denum(Arity[2], C=0, W=[3, 1])”, “Denum(Arity[8], C=0, W=[3, 0, 0, 0, 1, 0, 0, 0])”, [3, 0, 1, 0], 0, $!.denum-demotion]",
|
|
3531
|
+
"; .fake [.count 9; .loads [3, 1]; .# {99}; .## {99}; .### {99}];",
|
|
3103
3532
|
"; [“” (fake.#1), “” (fake.#0), fake.#]",
|
|
3104
|
-
"# [“Denum(
|
|
3533
|
+
"# [“Denum(Arity[2], C=99, W=[99, 0])”, “Denum(Arity[1], C=99, W=[99])”, 99]",
|
|
3105
3534
|
"; [xs.#6, xs.#7, xs.#99]",
|
|
3106
3535
|
"# [$!.denum-rank, $!.denum-rank, $!.denum-rank]",
|
|
3107
3536
|
"```",
|
|
3108
|
-
"The
|
|
3109
|
-
"
|
|
3110
|
-
"
|
|
3537
|
+
"The promotion is the same at A = 1, 2, 4, 8, 16 and 32, and equal to the",
|
|
3538
|
+
"embedding the view applies. It is a Denum at every rung, never a view",
|
|
3539
|
+
"```",
|
|
3540
|
+
"; .gh (Denum [7, [3, 2, 1, 4]]); .gh1 (Denum [4, [5]]);",
|
|
3541
|
+
"; [“” (gh.#2), “” (gh.#3), (gh.#5).schema (), (gh.#5).loads.#, gh.#1, “” (gh1.#0), (gh1.#1).loads, (gh1.#2).schema ()]",
|
|
3542
|
+
"# [“Denum(Arity[4], C=7, W=[3, 2, 1, 4])”, “Denum(Arity[8], C=7, W=[3, 2, 0, 0, 1, 4, 0, 0])”, “Arity[32]”, 32, $!.denum-demotion, “Denum(Arity[1], C=4, W=[5])”, [5, 0], “Arity[4]”]",
|
|
3543
|
+
"; [(gh.#3).loads = ((gh.cd ()).promote 3).loads, (gh.#3).cd () = ((gh.cd ()).promote 3), gh.#3 = ((gh.cd ()).promote 3)]",
|
|
3544
|
+
"# [<>, <>, ()]",
|
|
3545
|
+
"```",
|
|
3546
|
+
"A Denum of another arity has no ranked embedding. It is not padded, truncated or",
|
|
3547
|
+
"read as `2^rank`, and it is not measured as a host from its Count and Size. The",
|
|
3548
|
+
"answer is `$!.denum-unsupported-arity` at every rung, and the Denum is unchanged.",
|
|
3549
|
+
"The rank check comes first, so a rank above 5 is `$!.denum-rank`",
|
|
3550
|
+
"```",
|
|
3551
|
+
"; .gh3 (Denum [2, [1, 2, 3]]); .gh5 (Denum [1, [1, 2, 3, 4, 5]]);",
|
|
3552
|
+
"; [gh3.#0, gh3.#1, gh3.#2, gh3.#5, gh5.#3, t64.#2, t33.#4]",
|
|
3553
|
+
"# [$!.denum-unsupported-arity, $!.denum-unsupported-arity, $!.denum-unsupported-arity, $!.denum-unsupported-arity, $!.denum-unsupported-arity, $!.denum-unsupported-arity, $!.denum-unsupported-arity]",
|
|
3554
|
+
"; [gh3.#6, gh.#6, gh3.count, gh3.loads, gh3.schema (), gh3.rank ()]",
|
|
3555
|
+
"# [$!.denum-rank, $!.denum-rank, 2, [1, 2, 3], “Arity[3]”, 1]",
|
|
3556
|
+
"```",
|
|
3557
|
+
"A view is never a source of the ranked hash. It is not promoted, not measured as",
|
|
3558
|
+
"a host from its Count and Size, and not rebuilt into a Denum behind the caller's",
|
|
3559
|
+
"back. The answer is the named refusal `$!.denum-view-source`, at every rung, and",
|
|
3560
|
+
"the view is unchanged. Ask the Denum it views, `v.denum ()`, for the embedding",
|
|
3561
|
+
"```",
|
|
3562
|
+
"; .vh (gh.cd ());",
|
|
3563
|
+
"; [vh.#0, vh.#2, vh.#5, vh.#6, (vh.denum ()).#3 .loads, vh.count, vh.loads, vh.schema ()]",
|
|
3564
|
+
"# [$!.denum-view-source, $!.denum-view-source, $!.denum-view-source, $!.denum-rank, [3, 2, 0, 0, 1, 4, 0, 0], 7, [3, 2, 1, 4], “CD[2]”]",
|
|
3565
|
+
"```",
|
|
3566
|
+
"The derived hash of a view is the ordinary derived Demi of its three",
|
|
3567
|
+
"observers, which is binary and forgets directions. `x.#n` is the Denum, and the",
|
|
3568
|
+
"algebraic value is an observation of a view, never the return of `#n`",
|
|
3111
3569
|
"```",
|
|
3112
|
-
"; [dn.####, “” ((
|
|
3570
|
+
"; [dn.####, “” ((V [5, [1, 2, 3, 4]]).####)]",
|
|
3113
3571
|
"# [(), “Demi(5,3,7)”]",
|
|
3114
3572
|
"```",
|
|
3115
|
-
"`Demi` keeps its own contracts. Its `+`, `-`, `*` and `./` are not Denum",
|
|
3116
|
-
"arithmetic, and a
|
|
3573
|
+
"`Demi` keeps its own contracts. Its `+`, `-`, `*` and `./` are not Denum or view",
|
|
3574
|
+
"arithmetic, and a view is not a Demi",
|
|
3117
3575
|
"```",
|
|
3118
3576
|
"; .d (xs.####);",
|
|
3119
3577
|
"; [“” (d + 5), “” (d * 2), “” (d ./ 3), xs.#1 + 5]",
|