hclang 0.45.0 → 0.46.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.
@@ -2745,7 +2745,7 @@ export const HC_SOURCES = new Map([
2745
2745
  "A Denum is a constructed state of the binary Cayley–Dickson step ladder: a",
2746
2746
  "schema `CD[n]`, a retained application Count, and a nonnegative integer load on",
2747
2747
  "every signature channel. It is not a conventional number. Its conventional",
2748
- "algebraic value is an observation, `d.observe ()`, and opposite channels stay",
2748
+ "algebraic value is an observation, `d.coordinates ()`, and opposite channels stay",
2749
2749
  "separately counted after every operation, so `X + Opp X` is a present, nonempty",
2750
2750
  "Denum that merely observes as zero.",
2751
2751
  "",
@@ -2799,9 +2799,18 @@ export const HC_SOURCES = new Map([
2799
2799
  "- `d.promote k` embeds into rank k by the old-summand map, `±e_b ↦ ±e_(0b)`,",
2800
2800
  " keeping Count and loads and starting new channels at zero. A lower k is",
2801
2801
  " `$!.denum-demotion`.",
2802
- "- `d.observe ()` is the algebraic observation: the signed coordinate of each",
2803
- " direction, positive load minus negative load. It is a list of integers, and",
2804
- " not the Denum.",
2802
+ "- `d.coordinates ()` is the algebraic observation: the signed coordinate of each",
2803
+ " direction, positive load minus negative load, `S_b = W₊,b − W₋,b`.",
2804
+ " `d.coordinates <>` is the directional observation: the unsigned coordinate,",
2805
+ " positive load plus negative load, `U_b = W₊,b + W₋,b`, which forgets the",
2806
+ " signature and keeps all load. Each is an ordered list of integers, width 1 at",
2807
+ " rank 0 and 2ⁿ⁻¹ at rank n, and not the Denum; neither changes the Denum or",
2808
+ " returns its Count. At rank 0 both are `[W_ε]`. The only arguments are nil",
2809
+ " `()` and true `<>`; any other argument (a Count, text, a list) is",
2810
+ " `$!!.unary-observation`, never coerced by truthiness.",
2811
+ "- `d.observe ()` is the deprecated v0.45.0 spelling of `d.coordinates ()`,",
2812
+ " kept only as a compatibility alias with exactly the signed result. It takes",
2813
+ " no unsigned argument; use `d.coordinates`.",
2805
2814
  "",
2806
2815
  "**Count.** The candidate laws of 007.32 section 6 hold for these new operations",
2807
2816
  "only: `C(a+b) = C(a)+C(b)`, `C(a*b) = C(a)·C(b)` and `C(Opp a) = C(a)`, and",
@@ -2855,8 +2864,10 @@ export const HC_SOURCES = new Map([
2855
2864
  " (u = 1) ? {(f (denum-engine [4, (me .rank), (me .count), (me .loads)]))} : {$!!.unary-observation}};",
2856
2865
  " .conj {.u ((_ = ()) ? {1} : {0}); .me _^; .f (_^^ .finish);",
2857
2866
  " (u = 1) ? {(f (denum-engine [5, (me .rank), (me .count), (me .loads)]))} : {$!!.unary-observation}};",
2867
+ " .coordinates {.s ((_ = ()) ? {1} : {0}); .t ((_ = <>) ? {1} : {0}); .me _^;",
2868
+ " ((s + t) = 1) ? {denum-engine [7, (me .rank), (me .count), (me .loads), t]} : {$!!.unary-observation}};",
2858
2869
  " .observe {.u ((_ = ()) ? {1} : {0}); .me _^;",
2859
- " (u = 1) ? {denum-engine [7, (me .rank), (me .count), (me .loads)]} : {$!!.unary-observation}};",
2870
+ " (u = 1) ? {denum-engine [7, (me .rank), (me .count), (me .loads), 0]} : {$!!.unary-observation}};",
2860
2871
  " .signatures {.u ((_ = ()) ? {1} : {0}); .me _^;",
2861
2872
  " (u = 1) ? {denum-engine [8, (me .rank), (me .count), (me .loads)]} : {$!!.unary-observation}};",
2862
2873
  " .toText {“Denum(” (_^ .schema) “, C=” (_^ .count) “, W=” (_^ .loads) “)”}",
@@ -2911,17 +2922,17 @@ export const HC_SOURCES = new Map([
2911
2922
  "; .p (Denum [1, 1, [1, 0]]); .m (Denum [1, 1, [0, 1]]);",
2912
2923
  "; [(m * m).loads, (m * p).loads, (p * m).loads, (p * p).loads]",
2913
2924
  "# [[1, 0], [0, 1], [0, 1], [1, 0]]",
2914
- "; [((Denum [1, 1, [0, 2]]) * (Denum [1, 1, [0, 3]])).loads, ((Denum [1, 1, [0, 2]]) * (Denum [1, 1, [0, 3]])).observe ()]",
2925
+ "; [((Denum [1, 1, [0, 2]]) * (Denum [1, 1, [0, 3]])).loads, ((Denum [1, 1, [0, 2]]) * (Denum [1, 1, [0, 3]])).coordinates ()]",
2915
2926
  "# [[6, 0], [6]]",
2916
2927
  "```",
2917
2928
  "Opposite swaps the two channels and subtraction adds the opposite. The balanced",
2918
2929
  "result observes as zero yet is a present, nonempty Denum with both loads",
2919
2930
  "```",
2920
2931
  "; .x (Denum [1, 1, [5, 2]]); .y (Denum [1, 1, [3, 0]]);",
2921
- "; [x.observe (), (x.opp ()).loads, (x - y).loads, (x - y).observe (), (x - y).count]",
2932
+ "; [x.coordinates (), (x.opp ()).loads, (x - y).loads, (x - y).coordinates (), (x - y).count]",
2922
2933
  "# [[3], [2, 5], [5, 5], [0], 2]",
2923
2934
  "; .s (Denum [1, 1, [4, 4]]);",
2924
- "; [s.observe (), s.loads, s.#, s.##, s.###]",
2935
+ "; [s.coordinates (), s.loads, s.#, s.##, s.###]",
2925
2936
  "# [[0], [4, 4], 1, 8, 0]",
2926
2937
  "```",
2927
2938
  "A D0 has no negative signature, so its opposite is promoted to D1 first",
@@ -2948,7 +2959,7 @@ export const HC_SOURCES = new Map([
2948
2959
  "the fourth power is back at `e_0`, observed",
2949
2960
  "```",
2950
2961
  "; .j (Denum [2, 1, [0, 1, 0, 0]]);",
2951
- "; [(j * j).loads, (j * j).observe (), ((j * j) * (j * j)).loads, ((j * j) * (j * j)).observe ()]",
2962
+ "; [(j * j).loads, (j * j).coordinates (), ((j * j) * (j * j)).loads, ((j * j) * (j * j)).coordinates ()]",
2952
2963
  "# [[0, 0, 1, 0], [-1, 0], [1, 0, 0, 0], [1, 0]]",
2953
2964
  "```",
2954
2965
  "## Rank 3: order matters",
@@ -2967,13 +2978,13 @@ export const HC_SOURCES = new Map([
2967
2978
  "; .o1 (Denum [4, 1, [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]); .o2 (Denum [4, 1, [0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]); .o4 (Denum [4, 1, [0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]);",
2968
2979
  "; [((o1 * o2) * o4).loads, (o1 * (o2 * o4)).loads]",
2969
2980
  "# [[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).observe () = (o1 * (o2 * o4)).observe ()]",
2981
+ "; [((o1 * o2) * o4).coordinates () = (o1 * (o2 * o4)).coordinates ()]",
2971
2982
  "# [()]",
2972
2983
  "```",
2973
2984
  "Through rank 3 the product is associative, so the same three directions in the",
2974
2985
  "quaternions agree",
2975
2986
  "```",
2976
- "; [(J * I) * J = (J * (I * J)), ((J * I) * J).observe ()]",
2987
+ "; [(J * I) * J = (J * (I * J)), ((J * I) * J).coordinates ()]",
2977
2988
  "# [<>, [0, 0, 1, 0]]",
2978
2989
  "```",
2979
2990
  "## Rank 5: sedenion zero divisors",
@@ -2982,10 +2993,10 @@ export const HC_SOURCES = new Map([
2982
2993
  "The product is not an empty Denum: it holds four loads, in cancelling pairs",
2983
2994
  "```",
2984
2995
  "; .u (Denum [5, 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 (Denum [5, 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]]);",
2985
- "; [u.observe (), v.observe ()]",
2996
+ "; [u.coordinates (), v.coordinates ()]",
2986
2997
  "# [[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
2998
  "; .w (u * v);",
2988
- "; [w.observe (), w.count, w.##, w.###, w.loads]",
2999
+ "; [w.coordinates (), w.count, w.##, w.###, w.loads]",
2989
3000
  "# [[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
3001
  "```",
2991
3002
  "## Promotion across the ladder",
@@ -3026,9 +3037,9 @@ export const HC_SOURCES = new Map([
3026
3037
  "reverse order, observed",
3027
3038
  "```",
3028
3039
  "; .g (Denum [2, 4, [1, 2, 3, 4]]);",
3029
- "; [(g.conj ()).loads, (g.conj ()).count, (g.conj ()).observe (), g.observe ()]",
3040
+ "; [(g.conj ()).loads, (g.conj ()).count, (g.conj ()).coordinates (), g.coordinates ()]",
3030
3041
  "# [[1, 4, 3, 2], 4, [-2, 2], [-2, -2]]",
3031
- "; [(((J * I).conj ()).observe ()) = (((I.conj ()) * (J.conj ())).observe ()), ((Denum [0, 1, [4]]).conj ()).loads]",
3042
+ "; [(((J * I).conj ()).coordinates ()) = (((I.conj ()) * (J.conj ())).coordinates ()), ((Denum [0, 1, [4]]).conj ()).loads]",
3032
3043
  "# [<>, [4]]",
3033
3044
  "```",
3034
3045
  "## Count",
@@ -3044,7 +3055,121 @@ export const HC_SOURCES = new Map([
3044
3055
  "; [odd.count, odd.##, (odd * f).count, (odd * f).loads, (odd + f).count]",
3045
3056
  "# [0, 3, 0, [0, 15, 3, 0], 4]",
3046
3057
  "```",
3047
- "## The ranked hash",
3058
+ "## Coordinates: signed and unsigned",
3059
+ "",
3060
+ "One method reads the preserved Denum two ways. `d.coordinates ()` is the signed",
3061
+ "coordinate `S_b = W₊,b − W₋,b` and `d.coordinates <>` is the unsigned",
3062
+ "coordinate `U_b = W₊,b + W₋,b`, one integer per direction in the order of the",
3063
+ "channels. They are observations: they never change the Denum, and the Count is",
3064
+ "neither used nor returned. `U` is not `|S|`: opposing loads 3 and 1 give",
3065
+ "`S = 2` and `U = 4`, and the Count 1 below is not a coordinate",
3066
+ "```",
3067
+ "; .q (Denum [2, 1, [3, 2, 1, 4]]);",
3068
+ "; [q.coordinates (), q.coordinates <>, q.observe (), q.count, q.loads]",
3069
+ "# [[2, -2], [4, 6], [2, -2], 1, [3, 2, 1, 4]]",
3070
+ "```",
3071
+ "The Count is independent: the same loads at another Count, even zero, give the",
3072
+ "same coordinates, and a positive Count over zero loads gives zero coordinates",
3073
+ "```",
3074
+ "; .q9 (Denum [2, 9, [3, 2, 1, 4]]); .q0 (Denum [2, 0, [3, 2, 1, 4]]); .qz (Denum [2, 5, [0, 0, 0, 0]]);",
3075
+ "; [q9.coordinates (), q9.coordinates <>, q0.coordinates <>, qz.coordinates (), qz.coordinates <>, qz.count]",
3076
+ "# [[2, -2], [4, 6], [4, 6], [0, 0], [0, 0], 5]",
3077
+ "```",
3078
+ "Rank 0 has one unsigned channel, so both readings are its one load. Higher ranks",
3079
+ "have width 2ⁿ⁻¹",
3080
+ "```",
3081
+ "; .r0 (Denum [0, 2, [3]]); .r1 (Denum [1, 2, [4, 2]]); .r3 (Denum [3, 0, [1, 2, 3, 4, 0, 0, 0, 0]]);",
3082
+ "; [r0.coordinates (), r0.coordinates <>, r1.coordinates (), r1.coordinates <>, r3.coordinates (), r3.coordinates <>]",
3083
+ "# [[3], [3], [2], [6], [1, 2, 3, 4], [1, 2, 3, 4]]",
3084
+ "```",
3085
+ "Balanced opposing loads observe as zero in `S` and not in `U`, and the present",
3086
+ "Denum is still distinct from the missing host",
3087
+ "```",
3088
+ "; .bal (Denum [1, 1, [4, 4]]);",
3089
+ "; [bal.coordinates (), bal.coordinates <>, (Denum [0, 0, [0]]).coordinates <>, [].#0]",
3090
+ "# [[0], [8], [0], ()]",
3091
+ "```",
3092
+ "Only nil and true are arguments. A Count, text, a list, a block or a truthy",
3093
+ "Frame is refused by name, not coerced, and `observe` accepts only nil",
3094
+ "```",
3095
+ "; [q.coordinates 1, q.coordinates 0, q.coordinates “x”, q.coordinates [1], q.coordinates [], q.coordinates {1}, q.observe <>, q.observe 1]",
3096
+ "# [$!!.unary-observation, $!!.unary-observation, $!!.unary-observation, $!!.unary-observation, $!!.unary-observation, $!!.unary-observation, $!!.unary-observation, $!!.unary-observation]",
3097
+ "```",
3098
+ "Rank 4 has eight directions and rank 5 sixteen, each in channel order. Here",
3099
+ "positive loads 1 to 8 (or 1 to 16) sit over negative loads 10 times as large",
3100
+ "```",
3101
+ "; .q4 (Denum [4, 0, [1, 2, 3, 4, 5, 6, 7, 8, 10, 20, 30, 40, 50, 60, 70, 80]]);",
3102
+ "; [q4.coordinates (), q4.coordinates <>]",
3103
+ "# [[-9, -18, -27, -36, -45, -54, -63, -72], [11, 22, 33, 44, 55, 66, 77, 88]]",
3104
+ "; .q5 (Denum [5, 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]]);",
3105
+ "; [q5.coordinates () .#, q5.coordinates <> .#, (q5.coordinates <>).0, (q5.coordinates <>).15, (q5.coordinates ()).15]",
3106
+ "# [16, 16, 11, 176, -144]",
3107
+ "```",
3108
+ "The seven nonzero directions of rank 4 are the prospective Fano points, and a",
3109
+ "line is the unsigned direction of the product of two of them. Nothing here is a",
3110
+ "table: each direction below is read from the shipped product. The signs of",
3111
+ "`e_001 e_010` and `e_010 e_001` differ and the direction `011` does not",
3112
+ "```",
3113
+ "; .p1 (Denum [4, 1, [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]); .p2 (Denum [4, 1, [0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]); .p4 (Denum [4, 1, [0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]);",
3114
+ "; [(p1 * p2).coordinates <>, (p2 * p1).coordinates <>, (p1 * p2).coordinates (), (p2 * p1).coordinates ()]",
3115
+ "# [[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]]",
3116
+ "; [(p1 * p4).coordinates <>, (p2 * p4).coordinates <>]",
3117
+ "# [[0, 0, 0, 0, 0, 1, 0, 0], [0, 0, 0, 0, 0, 0, 1, 0]]",
3118
+ "```",
3119
+ "Through the same projection the unsigned coordinate of a product is the XOR",
3120
+ "convolution of the unsigned coordinates, and the signed associator at rank 4",
3121
+ "collapses to one direction (`111`) under `<>`",
3122
+ "```",
3123
+ "; [(((o1 * o2) * o4).coordinates <>) = ((o1 * (o2 * o4)).coordinates <>), (((o1 * o2) * o4).coordinates ()) = ((o1 * (o2 * o4)).coordinates ()), ((o1 * o2) * o4).coordinates <>]",
3124
+ "# [<>, (), [0, 0, 0, 0, 0, 0, 0, 1]]",
3125
+ "```",
3126
+ "## Coordinates and the native observers",
3127
+ "",
3128
+ "The two coordinate readings are projections of the same loads that `d.##` and",
3129
+ "`d.###` already report, so the observers cannot drift apart. For every rank the",
3130
+ "unsigned coordinates total the Size, `Σ U_b = d.## = Σ W`. For rank 1 and above",
3131
+ "the signed coordinates total the residual, `Σ S_b = d.###`. At rank 0 the one",
3132
+ "coordinate is `W_ε` in both readings, but the declared residual is 0 by design,",
3133
+ "so `Σ S = W_ε` and `d.### = 0` differ there. The Count is none of these",
3134
+ "```",
3135
+ "; .c0 (Denum [0, 4, [3]]); .c1 (Denum [1, 0, [4, 1]]); .c2 (Denum [2, 1, [3, 2, 1, 4]]);",
3136
+ "; .c0s (c0.coordinates ()); .c1s (c1.coordinates ()); .c2s (c2.coordinates ());",
3137
+ "; .tc0 (c0s.0); .tc1 (c1s.0); .tc2 ((c2s.0) + (c2s.1));",
3138
+ "; [(c0.coordinates <>).##, c0.##, tc0, c0.###, c0.#]",
3139
+ "# [3, 3, 3, 0, 4]",
3140
+ "; [(c1.coordinates <>).##, c1.##, tc1, c1.###, c1.#]",
3141
+ "# [5, 5, 3, 3, 0]",
3142
+ "; [(c2.coordinates <>).##, c2.##, tc2, c2.###, c2.#]",
3143
+ "# [10, 10, 0, 0, 1]",
3144
+ "```",
3145
+ "The same holds when the residual is negative, when loads are empty or balanced,",
3146
+ "and at every higher rank, whatever the Count. Each row is the unsigned total, the",
3147
+ "Size, the signed total, the residual and the Count",
3148
+ "```",
3149
+ "; .n2 (Denum [2, 0, [0, 1, 5, 3]]); .e2 (Denum [2, 7, [0, 0, 0, 0]]); .b3 (Denum [3, 2, [2, 0, 5, 0, 2, 0, 5, 0]]);",
3150
+ "; .n4 (Denum [4, 0, [1, 2, 3, 4, 5, 6, 7, 8, 10, 20, 30, 40, 50, 60, 70, 80]]);",
3151
+ "; .n5 (Denum [5, 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]]);",
3152
+ "; .n2s (n2.coordinates ()); .tn2 ((n2s.0) + (n2s.1));",
3153
+ "; .n4s (n4.coordinates ()); .tn4 ((n4s.0) + (n4s.1) + (n4s.2) + (n4s.3) + (n4s.4) + (n4s.5) + (n4s.6) + (n4s.7));",
3154
+ "; .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));",
3155
+ "; [(n2.coordinates <>).##, n2.##, tn2, n2.###, n2.#]",
3156
+ "# [9, 9, -7, -7, 0]",
3157
+ "; [(e2.coordinates <>).##, e2.##, (e2.coordinates ()).###, e2.###, e2.#]",
3158
+ "# [0, 0, 0, 0, 7]",
3159
+ "; [(b3.coordinates <>).##, b3.##, (b3.coordinates ()).###, b3.###, b3.#]",
3160
+ "# [14, 14, 0, 0, 2]",
3161
+ "; [(n4.coordinates <>).##, n4.##, tn4, n4.###, n4.#]",
3162
+ "# [396, 396, -324, -324, 0]",
3163
+ "; [(n5.coordinates <>).##, n5.##, tn5, n5.###, n5.#]",
3164
+ "# [1496, 1496, -1224, -1224, 3]",
3165
+ "```",
3166
+ "D0 is the only exception, and it is by design. Its residual is 0 though its one",
3167
+ "coordinate is the load, so no rank-0 row may be fixed by changing the residual",
3168
+ "```",
3169
+ "; .z0 (Denum [0, 0, [0]]); .p0 (Denum [0, 0, [9]]);",
3170
+ "; [z0.coordinates (), z0.coordinates <>, z0.##, z0.###, p0.coordinates (), p0.coordinates <>, p0.##, p0.###]",
3171
+ "# [[0], [0], 0, 0, [9], [9], 9, 0]",
3172
+ "```",
3048
3173
  "",
3049
3174
  "`x.#n` is the Denum of rung n for n from 0 to 5, and bare `x.#` is still the",
3050
3175
  "Count. A host answers its Count C, Size s and residual r, so `[1, 2, 3]` has",
@@ -3057,7 +3182,7 @@ export const HC_SOURCES = new Map([
3057
3182
  "# [3, 6, 2, “Demi(3,4,2)”]",
3058
3183
  "; [“” (xs.#0), “” (xs.#1), “” (xs.#2)]",
3059
3184
  "# [“Denum(CD[0], C=3, W=[6])”, “Denum(CD[1], C=3, W=[4, 2])”, “Denum(CD[2], C=3, W=[4, 0, 2, 0])”]",
3060
- "; [(xs.#3).loads, (xs.#4).##, (xs.#5).schema, (xs.#5).loads .#, (xs.#5).observe ()]",
3185
+ "; [(xs.#3).loads, (xs.#4).##, (xs.#5).schema, (xs.#5).loads .#, (xs.#5).coordinates ()]",
3061
3186
  "# [[4, 0, 0, 0, 2, 0, 0, 0], 6, “CD[5]”, 32, [2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]",
3062
3187
  "; [xs.#1.loads = xs.####.loads, xs.#1.count = xs.####.count]",
3063
3188
  "# [<>, <>]",
@@ -88,7 +88,7 @@ function intrinsicDenum(source) {
88
88
  /**
89
89
  * The ranked hash, `.#n` (occurrence/figure 007.32, 007.32b): the Denum of
90
90
  * rung n, n from 0 to 5. There is no `#n=`, and a Denum is not a scalar
91
- * observation; the algebraic value is `d.observe ()`.
91
+ * observation; the algebraic value is `d.coordinates ()`.
92
92
  *
93
93
  * Two different operations answer it, and they are not the same:
94
94
  *
@@ -14,7 +14,7 @@
14
14
  * for every direction `b` of `n − 1` bits. Channels are ordered positives
15
15
  * first, then negatives, each by direction value: channel `b` is `+e_b` and
16
16
  * channel `2ⁿ⁻¹ + b` is `−e_b`. A minus names a *signature*; a load is never
17
- * negative. The algebraic value is the observation {@link observe}, not the
17
+ * negative. The algebraic value is the signed observation {@link coordinates}, not the
18
18
  * Denum.
19
19
  *
20
20
  * The product of two signed signatures is
@@ -299,14 +299,36 @@ export function multiply(left, right) {
299
299
  return { rank, count: x.count * y.count, loads };
300
300
  }
301
301
  /**
302
- * The algebraic observation Φ: the signed integer coordinate of each
303
- * direction, `W₍₊,b₎ − W₍₋,b₎`, in direction order. At D0 it is the one Size.
302
+ * The Denum coordinates (occurrence/figure 007.32j, 007.33): an ordered list of
303
+ * integers, one per direction `b`, read from the preserved state without
304
+ * changing it. The one projection behind both HC spellings:
305
+ *
306
+ * - signed (`d.coordinates ()`): `S_b = W₍₊,b₎ − W₍₋,b₎`, the algebraic value;
307
+ * - unsigned (`d.coordinates <>`): `U_b = W₍₊,b₎ + W₍₋,b₎`, the direction load
308
+ * with the ± signature forgotten (so `U ≠ |S|`).
309
+ *
310
+ * Width is 1 at D0 and `2ⁿ⁻¹` at Dn, n ≥ 1, in the direction order of
311
+ * {@link signatureOf}. D0 has one unsigned channel `e_ε`, so both modes answer
312
+ * `[W_ε]`. Count is neither used nor returned. Given the rank, the pair (S, U)
313
+ * recovers the loads, `W₊ = (U+S)/2` and `W₋ = (U−S)/2`; Count, history and
314
+ * the Denum itself are not recovered. Always a fresh array.
304
315
  */
305
- export function observe(source) {
316
+ export function coordinates(source, unsigned = false) {
306
317
  if (source.rank === 0)
307
318
  return [source.loads[0]];
308
319
  const half = source.loads.length / 2;
309
- return Array.from({ length: half }, (_, b) => source.loads[b] - source.loads[half + b]);
320
+ return Array.from({ length: half }, (_, b) => unsigned
321
+ ? source.loads[b] + source.loads[half + b]
322
+ : source.loads[b] - source.loads[half + b]);
323
+ }
324
+ /**
325
+ * The signed coordinates of v0.45.0.
326
+ *
327
+ * @deprecated Legacy compatibility alias of `coordinates(source)`, the signed
328
+ * mode; `d.observe ()` in HC is its deprecated spelling. Use {@link coordinates}.
329
+ */
330
+ export function observe(source) {
331
+ return coordinates(source);
310
332
  }
311
333
  /**
312
334
  * The declared residual of a Denum, the signed total `Σ W₊ − Σ W₋`. It is the
@@ -315,11 +337,13 @@ export function observe(source) {
315
337
  * the directions; it is an observer of the state, not the state.
316
338
  */
317
339
  export function residual(source) {
318
- return source.rank === 0 ? 0n : observe(source).reduce((a, b) => a + b, 0n);
340
+ return source.rank === 0
341
+ ? 0n
342
+ : coordinates(source).reduce((a, b) => a + b, 0n);
319
343
  }
320
344
  /** True when every observed coordinate is zero. */
321
345
  export function observesZero(source) {
322
- return observe(source).every((coordinate) => coordinate === 0n);
346
+ return coordinates(source).every((coordinate) => coordinate === 0n);
323
347
  }
324
348
  /** True when no channel carries a load. */
325
349
  export function isEmpty(source) {
@@ -3,7 +3,7 @@ import { Frame } from "../frames/frame.js";
3
3
  import { FrameArray } from "../frames/frame-array.js";
4
4
  import { FrameCount } from "../frames/frame-count.js";
5
5
  import { FrameString } from "../frames/frame-string.js";
6
- import { add, arity, conjugate, denum, DenumError, multiply, observe, opposite, promote, residual, schemaName, signatureName, subtract, } from "../frames/denum.js";
6
+ import { add, arity, conjugate, coordinates, denum, DenumError, multiply, opposite, promote, residual, schemaName, signatureName, subtract, } from "../frames/denum.js";
7
7
  /**
8
8
  * The operations `denum-engine` performs, selected by the first element of its
9
9
  * argument. The argument is `[op, rank, count, loads, rank, count, loads]`: the
@@ -19,7 +19,12 @@ export const DENUM_OPERATIONS = {
19
19
  conjugate: 5,
20
20
  /** Promote the left state to the rank of the right state's first slot. */
21
21
  promote: 6,
22
- /** The signed integer coordinate of each direction, an observation. */
22
+ /**
23
+ * The integer coordinate of each direction, an observation. The fifth slot
24
+ * is the mode: 0 signed `W₊ − W₋`, 1 unsigned `W₊ + W₋`.
25
+ */
26
+ coordinates: 7,
27
+ /** Legacy name of {@link DENUM_OPERATIONS.coordinates} (the signed mode). */
23
28
  observe: 7,
24
29
  /** The native signature names of the left state's channels, as text. */
25
30
  names: 8,
@@ -82,8 +87,14 @@ export const DenumEngine = (_source, block) => {
82
87
  return stateFrame(opposite(left));
83
88
  case DENUM_OPERATIONS.conjugate:
84
89
  return stateFrame(conjugate(left));
85
- case DENUM_OPERATIONS.observe:
86
- return new FrameArray(observe(left).map((c) => Frame.signed(c)));
90
+ case DENUM_OPERATIONS.coordinates: {
91
+ // Absent (the v0.45.0 call shape) is signed; otherwise exactly 0 or 1.
92
+ const mode = args[4] === undefined ? 0n : counts(args[4]);
93
+ if (mode !== 0n && mode !== 1n) {
94
+ return Frame.error("$!!.invalid-denum");
95
+ }
96
+ return new FrameArray(coordinates(left, mode === 1n).map((c) => Frame.signed(c)));
97
+ }
87
98
  case DENUM_OPERATIONS.names:
88
99
  return new FrameArray(Array.from({ length: arity(left.rank) }, (_, channel) => new FrameString(signatureName(left.rank, channel))));
89
100
  case DENUM_OPERATIONS.residual:
@@ -1 +1 @@
1
- export const VERSION = "0.45.0";
1
+ export const VERSION = "0.46.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hclang",
3
- "version": "0.45.0",
3
+ "version": "0.46.0",
4
4
  "description": "Homoiconic C command-line interpreter and REPL",
5
5
  "keywords": [
6
6
  "language",