@kanonak-protocol/expression 1.0.0 → 1.2.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.
@@ -0,0 +1,519 @@
1
+ {
2
+ "expressionRuntimeVersion": "2",
3
+ "description": "The public surface every port exposes beside evaluate (runtime 1.1.0). `evaluates` pins evaluates(typeUri): true exactly for the node classes the kernel folds itself (operators and literals); false for a binding (VarRef), a graph read (PropertyRead), a domain leaf, and an expression class only a host engine implements - a host checks an authored tree against it instead of probing evaluate. `matches` pins matches(input, pattern): the pinned RE2-compatible XSD-regex subset under fn:matches semantics, exactly as tx.Matches evaluates it (the cases are the v2 Matches vectors with a literal source); expectError marks a pattern outside the subset, which is a loud error.",
4
+ "evaluates": [
5
+ {
6
+ "id": "evaluates-tx-IntegerLiteral",
7
+ "type": "kanonak.org/transformations/IntegerLiteral",
8
+ "expected": true
9
+ },
10
+ {
11
+ "id": "evaluates-tx-DecimalLiteral",
12
+ "type": "kanonak.org/transformations/DecimalLiteral",
13
+ "expected": true
14
+ },
15
+ {
16
+ "id": "evaluates-tx-BooleanLiteral",
17
+ "type": "kanonak.org/transformations/BooleanLiteral",
18
+ "expected": true
19
+ },
20
+ {
21
+ "id": "evaluates-tx-StringLiteral",
22
+ "type": "kanonak.org/transformations/StringLiteral",
23
+ "expected": true
24
+ },
25
+ {
26
+ "id": "evaluates-tx-UriLiteral",
27
+ "type": "kanonak.org/transformations/UriLiteral",
28
+ "expected": true
29
+ },
30
+ {
31
+ "id": "evaluates-tx-Add",
32
+ "type": "kanonak.org/transformations/Add",
33
+ "expected": true
34
+ },
35
+ {
36
+ "id": "evaluates-tx-Subtract",
37
+ "type": "kanonak.org/transformations/Subtract",
38
+ "expected": true
39
+ },
40
+ {
41
+ "id": "evaluates-tx-Multiply",
42
+ "type": "kanonak.org/transformations/Multiply",
43
+ "expected": true
44
+ },
45
+ {
46
+ "id": "evaluates-tx-Divide",
47
+ "type": "kanonak.org/transformations/Divide",
48
+ "expected": true
49
+ },
50
+ {
51
+ "id": "evaluates-tx-Abs",
52
+ "type": "kanonak.org/transformations/Abs",
53
+ "expected": true
54
+ },
55
+ {
56
+ "id": "evaluates-tx-Negate",
57
+ "type": "kanonak.org/transformations/Negate",
58
+ "expected": true
59
+ },
60
+ {
61
+ "id": "evaluates-tx-Equals",
62
+ "type": "kanonak.org/transformations/Equals",
63
+ "expected": true
64
+ },
65
+ {
66
+ "id": "evaluates-tx-GreaterThan",
67
+ "type": "kanonak.org/transformations/GreaterThan",
68
+ "expected": true
69
+ },
70
+ {
71
+ "id": "evaluates-tx-LessThan",
72
+ "type": "kanonak.org/transformations/LessThan",
73
+ "expected": true
74
+ },
75
+ {
76
+ "id": "evaluates-tx-GreaterThanOrEqual",
77
+ "type": "kanonak.org/transformations/GreaterThanOrEqual",
78
+ "expected": true
79
+ },
80
+ {
81
+ "id": "evaluates-tx-LessThanOrEqual",
82
+ "type": "kanonak.org/transformations/LessThanOrEqual",
83
+ "expected": true
84
+ },
85
+ {
86
+ "id": "evaluates-tx-IsAtLeast",
87
+ "type": "kanonak.org/transformations/IsAtLeast",
88
+ "expected": true
89
+ },
90
+ {
91
+ "id": "evaluates-tx-Dominates",
92
+ "type": "kanonak.org/transformations/Dominates",
93
+ "expected": true
94
+ },
95
+ {
96
+ "id": "evaluates-tx-And",
97
+ "type": "kanonak.org/transformations/And",
98
+ "expected": true
99
+ },
100
+ {
101
+ "id": "evaluates-tx-Or",
102
+ "type": "kanonak.org/transformations/Or",
103
+ "expected": true
104
+ },
105
+ {
106
+ "id": "evaluates-tx-Not",
107
+ "type": "kanonak.org/transformations/Not",
108
+ "expected": true
109
+ },
110
+ {
111
+ "id": "evaluates-tx-Count",
112
+ "type": "kanonak.org/transformations/Count",
113
+ "expected": true
114
+ },
115
+ {
116
+ "id": "evaluates-tx-Sum",
117
+ "type": "kanonak.org/transformations/Sum",
118
+ "expected": true
119
+ },
120
+ {
121
+ "id": "evaluates-tx-Min",
122
+ "type": "kanonak.org/transformations/Min",
123
+ "expected": true
124
+ },
125
+ {
126
+ "id": "evaluates-tx-Max",
127
+ "type": "kanonak.org/transformations/Max",
128
+ "expected": true
129
+ },
130
+ {
131
+ "id": "evaluates-tx-Average",
132
+ "type": "kanonak.org/transformations/Average",
133
+ "expected": true
134
+ },
135
+ {
136
+ "id": "evaluates-tx-Join",
137
+ "type": "kanonak.org/transformations/Join",
138
+ "expected": true
139
+ },
140
+ {
141
+ "id": "evaluates-tx-Reverse",
142
+ "type": "kanonak.org/transformations/Reverse",
143
+ "expected": true
144
+ },
145
+ {
146
+ "id": "evaluates-tx-ListItemAt",
147
+ "type": "kanonak.org/transformations/ListItemAt",
148
+ "expected": true
149
+ },
150
+ {
151
+ "id": "evaluates-tx-ForEach",
152
+ "type": "kanonak.org/transformations/ForEach",
153
+ "expected": true
154
+ },
155
+ {
156
+ "id": "evaluates-tx-ListMap",
157
+ "type": "kanonak.org/transformations/ListMap",
158
+ "expected": true
159
+ },
160
+ {
161
+ "id": "evaluates-tx-Filter",
162
+ "type": "kanonak.org/transformations/Filter",
163
+ "expected": true
164
+ },
165
+ {
166
+ "id": "evaluates-tx-Contains",
167
+ "type": "kanonak.org/transformations/Contains",
168
+ "expected": true
169
+ },
170
+ {
171
+ "id": "evaluates-tx-IsSet",
172
+ "type": "kanonak.org/transformations/IsSet",
173
+ "expected": true
174
+ },
175
+ {
176
+ "id": "evaluates-tx-IsString",
177
+ "type": "kanonak.org/transformations/IsString",
178
+ "expected": true
179
+ },
180
+ {
181
+ "id": "evaluates-tx-IsNumber",
182
+ "type": "kanonak.org/transformations/IsNumber",
183
+ "expected": true
184
+ },
185
+ {
186
+ "id": "evaluates-tx-IsReference",
187
+ "type": "kanonak.org/transformations/IsReference",
188
+ "expected": true
189
+ },
190
+ {
191
+ "id": "evaluates-tx-IsList",
192
+ "type": "kanonak.org/transformations/IsList",
193
+ "expected": true
194
+ },
195
+ {
196
+ "id": "evaluates-tx-Matches",
197
+ "type": "kanonak.org/transformations/Matches",
198
+ "expected": true
199
+ },
200
+ {
201
+ "id": "evaluates-tx-NameBasedUuid",
202
+ "type": "kanonak.org/transformations/NameBasedUuid",
203
+ "expected": true
204
+ },
205
+ {
206
+ "id": "evaluates-math-Power",
207
+ "type": "kanonak.org/math/Power",
208
+ "expected": true
209
+ },
210
+ {
211
+ "id": "evaluates-math-Modulo",
212
+ "type": "kanonak.org/math/Modulo",
213
+ "expected": true
214
+ },
215
+ {
216
+ "id": "evaluates-math-Minimum",
217
+ "type": "kanonak.org/math/Minimum",
218
+ "expected": true
219
+ },
220
+ {
221
+ "id": "evaluates-math-Maximum",
222
+ "type": "kanonak.org/math/Maximum",
223
+ "expected": true
224
+ },
225
+ {
226
+ "id": "evaluates-math-Exp",
227
+ "type": "kanonak.org/math/Exp",
228
+ "expected": true
229
+ },
230
+ {
231
+ "id": "evaluates-math-Ln",
232
+ "type": "kanonak.org/math/Ln",
233
+ "expected": true
234
+ },
235
+ {
236
+ "id": "evaluates-math-Log10",
237
+ "type": "kanonak.org/math/Log10",
238
+ "expected": true
239
+ },
240
+ {
241
+ "id": "evaluates-math-Sqrt",
242
+ "type": "kanonak.org/math/Sqrt",
243
+ "expected": true
244
+ },
245
+ {
246
+ "id": "evaluates-math-Floor",
247
+ "type": "kanonak.org/math/Floor",
248
+ "expected": true
249
+ },
250
+ {
251
+ "id": "evaluates-math-Ceil",
252
+ "type": "kanonak.org/math/Ceil",
253
+ "expected": true
254
+ },
255
+ {
256
+ "id": "evaluates-math-Round",
257
+ "type": "kanonak.org/math/Round",
258
+ "expected": true
259
+ },
260
+ {
261
+ "id": "evaluates-math-Sign",
262
+ "type": "kanonak.org/math/Sign",
263
+ "expected": true
264
+ },
265
+ {
266
+ "id": "evaluates-math-Clip",
267
+ "type": "kanonak.org/math/Clip",
268
+ "expected": true
269
+ },
270
+ {
271
+ "id": "evaluates-not-VarRef",
272
+ "type": "kanonak.org/transformations/VarRef",
273
+ "expected": false,
274
+ "description": "a binding: the kernel binds only its own iterators' loop variables; any other VarRef is the caller's"
275
+ },
276
+ {
277
+ "id": "evaluates-not-PropertyRead",
278
+ "type": "kanonak.org/transformations/PropertyRead",
279
+ "expected": false,
280
+ "description": "a graph read: the caller's leaf"
281
+ },
282
+ {
283
+ "id": "evaluates-not-IsBoolean",
284
+ "type": "kanonak.org/transformations/IsBoolean",
285
+ "expected": false,
286
+ "description": "a host kind: booleans are 1/0 numbers in the kernel"
287
+ },
288
+ {
289
+ "id": "evaluates-not-IsEmbedded",
290
+ "type": "kanonak.org/transformations/IsEmbedded",
291
+ "expected": false,
292
+ "description": "a host kind: embedded nodes never enter the kernel"
293
+ },
294
+ {
295
+ "id": "evaluates-not-Let",
296
+ "type": "kanonak.org/transformations/Let",
297
+ "expected": false,
298
+ "description": "not a kernel operator"
299
+ },
300
+ {
301
+ "id": "evaluates-not-When",
302
+ "type": "kanonak.org/transformations/When",
303
+ "expected": false,
304
+ "description": "not a kernel operator"
305
+ },
306
+ {
307
+ "id": "evaluates-not-Concat",
308
+ "type": "kanonak.org/transformations/Concat",
309
+ "expected": false,
310
+ "description": "not a kernel operator"
311
+ },
312
+ {
313
+ "id": "evaluates-not-Fallback",
314
+ "type": "kanonak.org/transformations/Fallback",
315
+ "expected": false,
316
+ "description": "not a kernel operator"
317
+ },
318
+ {
319
+ "id": "evaluates-not-Traverse",
320
+ "type": "kanonak.org/transformations/Traverse",
321
+ "expected": false,
322
+ "description": "not a kernel operator"
323
+ },
324
+ {
325
+ "id": "evaluates-not-DistinctBy",
326
+ "type": "kanonak.org/transformations/DistinctBy",
327
+ "expected": false,
328
+ "description": "not a kernel operator"
329
+ },
330
+ {
331
+ "id": "evaluates-not-PartitionBy",
332
+ "type": "kanonak.org/transformations/PartitionBy",
333
+ "expected": false,
334
+ "description": "not a kernel operator"
335
+ },
336
+ {
337
+ "id": "evaluates-not-Expression",
338
+ "type": "kanonak.org/transformations/Expression",
339
+ "expected": false,
340
+ "description": "abstract"
341
+ },
342
+ {
343
+ "id": "evaluates-not-BinaryArithmetic",
344
+ "type": "kanonak.org/transformations/BinaryArithmetic",
345
+ "expected": false,
346
+ "description": "abstract"
347
+ },
348
+ {
349
+ "id": "evaluates-not-Step",
350
+ "type": "example.org/sim/Step",
351
+ "expected": false,
352
+ "description": "a domain leaf: the caller's"
353
+ }
354
+ ],
355
+ "matches": [
356
+ {
357
+ "id": "matches-matches-anchored-hit",
358
+ "input": "E-1002",
359
+ "pattern": "^E-\\d+$",
360
+ "expected": true
361
+ },
362
+ {
363
+ "id": "matches-matches-unanchored-substring",
364
+ "input": "abc123def",
365
+ "pattern": "\\d+",
366
+ "expected": true
367
+ },
368
+ {
369
+ "id": "matches-matches-miss",
370
+ "input": "hello",
371
+ "pattern": "^\\d+$",
372
+ "expected": false
373
+ },
374
+ {
375
+ "id": "matches-matches-prefix-case-fold",
376
+ "input": "ABC",
377
+ "pattern": "(?i)abc",
378
+ "expected": true
379
+ },
380
+ {
381
+ "id": "matches-matches-prefix-multiple-distinct-flags",
382
+ "input": "ABC",
383
+ "pattern": "(?ims)^abc$",
384
+ "expected": true
385
+ },
386
+ {
387
+ "id": "matches-matches-repeated-flag-in-prefix-outside-subset",
388
+ "input": "abc",
389
+ "pattern": "(?ii)abc",
390
+ "expectError": true
391
+ },
392
+ {
393
+ "id": "matches-matches-second-flag-prefix-outside-subset",
394
+ "input": "abc",
395
+ "pattern": "(?i)(?s)abc",
396
+ "expectError": true
397
+ },
398
+ {
399
+ "id": "matches-matches-mid-pattern-flag-group-outside-subset",
400
+ "input": "ABC",
401
+ "pattern": "x(?i:abc)",
402
+ "expectError": true
403
+ },
404
+ {
405
+ "id": "matches-matches-class-range-and-quantifier",
406
+ "input": "kanonak-2",
407
+ "pattern": "^[a-z][a-z0-9-]{2,15}$",
408
+ "expected": true
409
+ },
410
+ {
411
+ "id": "matches-matches-lookahead-outside-subset",
412
+ "input": "abc",
413
+ "pattern": "a(?=b)",
414
+ "expectError": true
415
+ },
416
+ {
417
+ "id": "matches-matches-backreference-outside-subset",
418
+ "input": "abab",
419
+ "pattern": "(ab)\\1",
420
+ "expectError": true
421
+ },
422
+ {
423
+ "id": "matches-matches-unicode-property-outside-subset",
424
+ "input": "a",
425
+ "pattern": "\\p{L}",
426
+ "expectError": true
427
+ },
428
+ {
429
+ "id": "matches-matches-posix-class-outside-subset",
430
+ "input": "a",
431
+ "pattern": "[[:alpha:]]",
432
+ "expectError": true
433
+ },
434
+ {
435
+ "id": "matches-matches-lookbehind-outside-subset",
436
+ "input": "ab",
437
+ "pattern": "(?<=a)b",
438
+ "expectError": true
439
+ },
440
+ {
441
+ "id": "matches-matches-astral-length-counts-code-points",
442
+ "input": "a🧬b",
443
+ "pattern": "(?s)^.{3}$",
444
+ "expected": true
445
+ },
446
+ {
447
+ "id": "matches-matches-astral-single-dot",
448
+ "input": "🧬",
449
+ "pattern": "^.$",
450
+ "expected": true
451
+ },
452
+ {
453
+ "id": "matches-matches-astral-min-length-lowering",
454
+ "input": "a🧬b",
455
+ "pattern": "(?s)^.{4,}$",
456
+ "expected": false
457
+ },
458
+ {
459
+ "id": "matches-matches-bare-literal-brace-outside-subset",
460
+ "input": "a{b",
461
+ "pattern": "a{b",
462
+ "expectError": true
463
+ },
464
+ {
465
+ "id": "matches-matches-digit-shorthand-is-ascii",
466
+ "input": "١٢٣",
467
+ "pattern": "^\\d+$",
468
+ "expected": false
469
+ },
470
+ {
471
+ "id": "matches-matches-space-shorthand-is-ascii",
472
+ "input": " ",
473
+ "pattern": "^\\s$",
474
+ "expected": false
475
+ },
476
+ {
477
+ "id": "matches-matches-word-boundary-is-ascii",
478
+ "input": "a é b",
479
+ "pattern": "\\bé",
480
+ "expected": false
481
+ },
482
+ {
483
+ "id": "matches-matches-shorthand-in-class-expands",
484
+ "input": "12-34",
485
+ "pattern": "^[\\d-]+$",
486
+ "expected": true
487
+ },
488
+ {
489
+ "id": "matches-matches-negated-shorthand-in-class-outside-subset",
490
+ "input": "a",
491
+ "pattern": "[\\D]",
492
+ "expectError": true
493
+ },
494
+ {
495
+ "id": "matches-matches-class-b-escape-outside-subset",
496
+ "input": "a",
497
+ "pattern": "[\\b]",
498
+ "expectError": true
499
+ },
500
+ {
501
+ "id": "matches-matches-dot-matches-carriage-return",
502
+ "input": "\r",
503
+ "pattern": "^.$",
504
+ "expected": true
505
+ },
506
+ {
507
+ "id": "matches-matches-vertical-tab-escape",
508
+ "input": "\u000b",
509
+ "pattern": "^\\v$",
510
+ "expected": true
511
+ },
512
+ {
513
+ "id": "matches-matches-case-fold-is-unicode",
514
+ "input": "É",
515
+ "pattern": "(?i)é",
516
+ "expected": true
517
+ }
518
+ ]
519
+ }