Repository navigation
Expand file tree
/
Copy pathkernel
More file actions
2476 lines (2476 loc) · 466 KB
/
Copy pathkernel
File metadata and controls
2476 lines (2476 loc) · 466 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
(
"THE AREST MICROKERNEL. A Backus AST store from the paper, small enough to read whole. D is a sequence of cells; one, FILE, holds the population P, keyed by fact type (AREST.tex:59-62), and one, TYPES, names for each fact type the object its facts resolve through. A fact <f, v1..vn> applied to y resolves through its type: (rho <f, ..>):y = (rho f):<<f, ..>, y> (eq:metacomp), with rho f fetched from D, not from a host map. Every name here is k:, so the kernel loads beside today`s lambda; written only in the combining forms over Backus`s primitives.",
"List helpers. k:all <booleans> is their conjunction; k:flat <lists> their concatenation; k:has <x, list> whether x is an element; k:assoc <key, pairs> the second of the first pair whose first is key, <> where none is; k:iota n is <1..n>.",
DEF("k:all",
S3(A("COMP"), S2(A("INSERT"), A("and")), S3(A("COMP"), A("apndr"), S3(A("CONS"), A("id"), K(A("T")))))),
DEF("k:flat",
S3(A("COMP"), S2(A("INSERT"), A("cat")), S3(A("COMP"), A("apndr"), S3(A("CONS"), A("id"), K(PHI()))))),
"A LOOKUP BY BISECTION. <key, table> to its value, nothing where none: a table is <key, value> pairs sorted by key with no key twice, so a run of many reads over a table bound once costs the logarithm of it, not its length.",
DEF("k:bs",
S4(A("COND"), S3(A("COMP"), A("null"), N(2)), K(PHI()), S3(A("COMP"), A("k:bs2"), S3(A("COMP"), S3(A("WHILE"), S3(A("COMP"), A("lt"), S3(A("CONS"), N(1), N(2))), A("k:bs_step")), S5(A("CONS"), K(N(1)), S3(A("COMP"), A("length"), N(2)), N(1), N(2)))))),
DEF("k:bs_step",
S3(A("COMP"), A("k:bs_s2"), S3(A("CONS"), S3(A("COMP"), A("/"), S3(A("CONS"), S3(A("COMP"), A("+"), S3(A("CONS"), N(1), N(2))), K(N(2)))), A("id")))),
DEF("k:bs_s2",
S4(A("COND"), S3(A("COMP"), A("k:lt2"), S3(A("CONS"), S3(A("COMP"), N(1), S3(A("COMP"), A("apply"), S3(A("CONS"), N(1), S3(A("COMP"), N(4), N(2))))), S3(A("COMP"), N(3), N(2)))), S5(A("CONS"), S3(A("COMP"), A("+"), S3(A("CONS"), N(1), K(N(1)))), S3(A("COMP"), N(2), N(2)), S3(A("COMP"), N(3), N(2)), S3(A("COMP"), N(4), N(2))), S5(A("CONS"), S3(A("COMP"), N(1), N(2)), N(1), S3(A("COMP"), N(3), N(2)), S3(A("COMP"), N(4), N(2))))),
DEF("k:bs2",
S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(1), S3(A("COMP"), A("apply"), S3(A("CONS"), N(1), N(4)))), N(3))), S3(A("COMP"), N(2), S3(A("COMP"), A("apply"), S3(A("CONS"), N(1), N(4)))), K(PHI()))),
"<<key, value>..> to the table <key, its values> over them.",
DEF("k:by_key",
S3(A("COMP"), A("k:uc_groups"), S3(A("COMP"), A("k:msort"), S2(A("ALPHA"), S4(A("CONS"), N(1), K(N(0)), N(2)))))),
"<values> to the table a membership asks: one test of a long list, many times over, costs its logarithm.",
DEF("k:set_tab",
S3(A("COMP"), S2(A("ALPHA"), S3(A("CONS"), A("id"), K(A("T")))), A("k:dedup"))),
"<x, table> to whether x is in it.",
DEF("k:in_t",
S3(A("COMP"), A("eq"), S3(A("CONS"), A("k:bs"), K(A("T"))))),
DEF("k:has",
S5(A("COMP"), A("not"), A("null"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), S4(A("COND"), A("eq"), K(S1(A("T"))), K(PHI()))), A("distl")))),
DEF("k:assoc",
S3(A("COMP"), S4(A("COND"), A("null"), K(PHI()), S3(A("COMP"), N(2), N(1))), S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), N(1), S3(A("COMP"), N(1), N(2)))), S2(A("CONS"), N(2)), K(PHI()))), A("distl"))))),
DEF("k:iota",
S3(A("COMP"), N(1), S3(A("COMP"), S3(A("WHILE"), S3(A("COMP"), A("lt"), S3(A("CONS"), S3(A("COMP"), A("length"), N(1)), N(2))), S3(A("CONS"), S3(A("COMP"), A("apndr"), S3(A("CONS"), N(1), S3(A("COMP"), A("+"), S3(A("CONS"), S3(A("COMP"), A("length"), N(1)), K(N(1)))))), N(2))), S3(A("CONS"), K(PHI()), A("id"))))),
"Cells. k:cell <name, cells> is the body of the first cell <CELL, name, body>, # where none is: Backus`s fetch.",
DEF("k:cell",
S3(A("COMP"), S4(A("COND"), A("null"), K(A("#")), N(1)), S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), N(1), S3(A("COMP"), N(2), N(2)))), S2(A("CONS"), S3(A("COMP"), N(3), N(2))), K(PHI()))), A("distl"))))),
"The carriers a compile of the metamodel wrote (tools/carriers/base): state:fts holds the fact types as descriptors <name, players, uniquenesses, mandatories, rows>, and state:declared the pairs <fact type, players>, each nested in chunks, and a descriptor`s rows nested in chunks too. k:descs and k:decls unfold a tree to its descriptors or pairs; k:rows unfolds rows until every element is a row, a sequence of atoms that is not empty, since a fact has a role.",
DEF("k:is_desc",
S4(A("COND"), A("atom"), K(A("F")), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), A("length"), K(N(5)))), S3(A("COMP"), A("and"), S3(A("CONS"), S3(A("COMP"), A("atom"), N(1)), S3(A("COMP"), A("not"), S3(A("COMP"), A("atom"), N(2))))), K(A("F"))))),
DEF("k:descs",
S4(A("COND"), A("k:is_desc"), S2(A("CONS"), A("id")), S4(A("COND"), A("atom"), K(PHI()), S3(A("COMP"), A("k:flat"), S2(A("ALPHA"), A("k:descs")))))),
DEF("k:is_decl",
S4(A("COND"), A("atom"), K(A("F")), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), A("length"), K(N(2)))), S3(A("COMP"), A("and"), S3(A("CONS"), S3(A("COMP"), A("atom"), N(1)), S3(A("COMP"), A("not"), S3(A("COMP"), A("atom"), N(2))))), K(A("F"))))),
DEF("k:decls",
S4(A("COND"), A("k:is_decl"), S2(A("CONS"), A("id")), S4(A("COND"), A("atom"), K(PHI()), S3(A("COMP"), A("k:flat"), S2(A("ALPHA"), A("k:decls")))))),
DEF("k:is_row",
S4(A("COND"), A("atom"), K(A("F")), S4(A("COND"), A("null"), K(A("F")), S3(A("COMP"), A("k:all"), S2(A("ALPHA"), A("atom")))))),
DEF("k:rows",
S4(A("COND"), S3(A("COMP"), A("k:all"), S2(A("ALPHA"), A("k:is_row"))), A("id"), S3(A("COMP"), A("k:rows"), A("k:flat")))),
"The schema as the metamodel`s own facts. A fact type`s roles are <fact type>.<n> for n from 1 to its arity, the ids the reflection mints (reflect:span_rid), so Fact Type has Role and Object Type plays Role are read off the declared pairs: <fact type, players> to its <fact type, role> rows and its <player, role> rows.",
DEF("k:decl_roles",
S3(A("COMP"), S2(A("ALPHA"), S3(A("CONS"), N(1), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A(".")), A("id"))))), S3(A("COMP"), A("distl"), S3(A("CONS"), N(1), S3(A("COMP"), A("k:iota"), S3(A("COMP"), A("length"), N(2))))))),
DEF("k:decl_plays",
S3(A("COMP"), S2(A("ALPHA"), S3(A("CONS"), S3(A("COMP"), N(1), N(2)), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A(".")), S3(A("CONS"), N(1), S3(A("COMP"), N(2), N(2))))))), S3(A("COMP"), A("distl"), S3(A("CONS"), N(1), S3(A("COMP"), A("trans"), S3(A("CONS"), N(2), S3(A("COMP"), A("k:iota"), S3(A("COMP"), A("length"), N(2))))))))),
"THE BOOT. <cells> to D: FILE holds P, the rows of each descriptor in state:fts with Fact Type has Role and Object Type plays Role read off state:declared before them; TYPES gives every fact type of P its object, k:ft; ROLES holds each role <role, fact type, n, player>; CONSTRAINTS holds the constraint objects (k:cons).",
DEF("k:boot",
S3(A("COMP"), S3(A("COMP"), A("k:boot_c"), S7(A("CONS"), S3(A("COMP"), A("k:descs"), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("state:fts")), A("id")))), A("k:alldecls"), A("k:cons"), A("k:links"), S3(A("COMP"), A("cat"), S3(A("CONS"), A("k:link_facts"), A("k:domain_facts"))), A("k:rule_tab"))), S3(A("COMP"), A("k:bd_based"), A("k:based")))),
"THE BASE IS READ FROM ITS STORE. A compile of the metamodel writes the base as a store and nothing beside it: its schema cells in _defs, each body the DEF that names it, and the facts its readings assert in _readings, each row its JSON text. Where the cells name the base`s database (state:base_db), k:based puts the base`s schema cells after them, read out of the _defs bodies (carrier:cells), and gives each descriptor of state:fts the store keeps without rows the rows _readings holds of its fact type, one column per player (row ->> i, up to sixteen), a value of a whole-number type held as a number, as canon`s value:as_kind holds it. A descriptor that keeps its rows keeps them.",
"AND THE DECLARED FACT TYPES. A store kept without state:declared has them in its rows: k:dc_fill <cells> adds the cell, each fact type with a Declaration Order in that order with the players Object Type plays Role names in role order.",
DEF("k:unstored",
S3(A("COMP"), A("k:flat"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("k:has"), S3(A("CONS"), N(2), K(S2(A("fully-derived"), A("derived-and-stored"))))), S2(A("CONS"), N(1)), K(PHI()))))),
DEF("k:decl_orders",
S5(A("COMP"), A("k:flat"), S2(A("ALPHA"), S4(A("COND"), S4(A("COMP"), A("not"), A("k:has"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), N(2))), S2(A("CONS"), N(1)), K(PHI()))), A("distr"), S3(A("CONS"), N(1), S3(A("COMP"), A("k:unstored"), N(2))))),
"<cells over their base> to <fact type, its players in role order> for each fact type in declaration order. The roles are grouped by fact type once (k:by_key) and each fact type`s read by bisection: each fact type scanned every role, MEASURED 6% of the boot of support`s store on a host that keeps no memo.",
DEF("k:dc_rows",
S4(A("COMP"), S2(A("ALPHA"), S3(A("CONS"), N(1), S3(A("COMP"), S2(A("ALPHA"), N(2)), S3(A("COMP"), A("k:bs"), S3(A("CONS"), N(1), N(2)))))), A("distr"), S3(A("CONS"), S5(A("COMP"), S2(A("ALPHA"), N(2)), A("k:msort"), S2(A("ALPHA"), S3(A("CONS"), S3(A("COMP"), S4(A("COND"), A("k:isnum"), A("id"), S4(A("COND"), A("k:isint"), A("k:atoi"), A("id"))), N(2)), N(1))), S3(A("COMP"), A("k:decl_orders"), S3(A("CONS"), S3(A("COMP"), A("k:desc_rows"), S3(A("CONS"), K(A("FactTypeHasDeclarationOrder")), A("id"))), S3(A("COMP"), A("k:desc_rows"), S3(A("CONS"), K(A("FactTypeHasDerivationMode")), A("id")))))), S3(A("COMP"), A("k:by_key"), S3(A("COMP"), S2(A("ALPHA"), S3(A("CONS"), S4(A("COMP"), N(1), A("k:role_pos"), N(2)), S3(A("CONS"), S4(A("COMP"), N(2), A("k:role_pos"), N(2)), N(1)))), S3(A("COMP"), A("k:desc_rows"), S3(A("CONS"), K(A("ObjectTypePlaysRole")), A("id")))))))),
DEF("k:dc_fill",
S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("state:declared")), A("id"))), K(A("#")))), S3(A("COMP"), A("apndr"), S3(A("CONS"), A("id"), S4(A("CONS"), K(A("CELL")), K(A("state:declared")), A("k:dc_rows")))), A("id"))),
DEF("k:dv_rows",
S3(A("COMP"), S4(A("COMP"), A("k:msort"), A("cat"), S3(A("CONS"), S3(A("COMP"), S2(A("ALPHA"), S3(A("CONS"), N(1), S3(A("COMP"), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), A("id"), K(A("fully-derived")))), K(A("full")), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), A("id"), K(A("semi-derived")))), K(A("semi")), A("id"))), N(2)))), N(1)), S5(A("COMP"), A("k:flat"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("null"), S3(A("COMP"), A("k:assoc"), S3(A("CONS"), S3(A("COMP"), N(2), N(1)), N(2)))), K(PHI()), S2(A("CONS"), S3(A("CONS"), S3(A("COMP"), A("k:assoc"), S3(A("CONS"), S3(A("COMP"), N(2), N(1)), N(2))), K(A("subtype")))))), A("distr"), S3(A("CONS"), N(2), S3(A("COMP"), S2(A("ALPHA"), S3(A("CONS"), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S4(A("CONS"), S3(A("COMP"), A("k:pascal"), N(1)), K(A("IsASubtypeOf")), S3(A("COMP"), A("k:pascal"), N(2))))), N(1))), N(3)))))), S4(A("CONS"), S3(A("COMP"), A("k:desc_rows"), S3(A("CONS"), K(A("FactTypeHasDerivationMode")), A("id"))), S3(A("COMP"), A("k:desc_rows"), S3(A("CONS"), K(A("DerivationRuleProducesFactType")), A("id"))), S3(A("COMP"), A("k:desc_rows"), S3(A("CONS"), K(A("ObjectTypeIsSubtypeOfObjectType")), A("id")))))),
DEF("k:dv_fill",
S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("state:derived")), A("id"))), K(A("#")))), S3(A("COMP"), A("apndr"), S3(A("CONS"), A("id"), S4(A("CONS"), K(A("CELL")), K(A("state:derived")), A("k:dv_rows")))), A("id"))),
"<cells over their base> to those cells with each declaration, read once for a boot.",
DEF("k:bd_based",
S3(A("COMP"), A("k:bd2"), S3(A("COMP"), A("apndl"), S3(A("CONS"), S4(A("CONS"), K(A("CELL")), K(A("FDECL")), A("k:fact_decls0")), A("id"))))),
DEF("k:bd2",
S3(A("COMP"), A("apndl"), S3(A("CONS"), S4(A("CONS"), K(A("CELL")), K(A("LDECL")), A("k:link_decls0")), S3(A("COMP"), A("apndl"), S3(A("CONS"), S4(A("CONS"), K(A("CELL")), K(A("ALLD")), A("k:alldecls0")), A("id")))))),
DEF("k:based",
S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("state:base_db")), A("id"))), K(A("#")))), A("id"), S3(A("COMP"), A("cat"), S3(A("CONS"), A("id"), S5(A("COMP"), A("k:dv_fill"), A("k:dc_fill"), A("k:base_cells"), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("state:base_db")), A("id")))))))),
"THE RULES ARE READ FROM THE FACTS. The base keeps no state:rpaths cell: <database, cells> to the cells with the one the heads` Implementations give, as lambda`s system:rp_heads reads them (k:rp_value), where they hold none.",
DEF("k:with_rp",
S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("state:rpaths")), N(2))), K(A("#")))), S3(A("COMP"), A("apndr"), S3(A("CONS"), N(2), S4(A("CONS"), K(A("CELL")), K(A("state:rpaths")), S3(A("COMP"), A("k:rp_value"), N(1))))), N(2))),
DEF("k:rp_value",
S4(A("COMP"), A("k:rp_cells"), A("sqlite:query"), S4(A("CONS"), A("id"), A("k:rp_stmt"), K(PHI())))),
"The statement of a store`s Implementations. One not written as a DEF names no rule of a fact type: a store may hold a function`s implementation in another notation, which stays a fact and takes no part in the boot.",
DEF("k:rp_stmt",
K(A("select r.\"row\" ->> 0, r.\"row\" ->> 1 from \"_readings\" r where r.\"ft\" = 'FunctionHasImplementation' and r.\"row\" ->> 1 like 'DEF%' order by coalesce((select cast(o.\"row\" ->> 1 as integer) from \"_readings\" o where o.\"ft\" = 'FactTypeHasDeclarationOrder' and o.\"row\" ->> 0 = r.\"row\" ->> 0), 1000000), r.\"row\" ->> 0"))),
DEF("k:rp_cells",
S4(A("COND"), A("null"), K(PHI()), S4(A("COMP"), S2(A("ALPHA"), S3(A("CONS"), N(2), N(3))), A("carrier:cells"), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S4(A("CONS"), K(A("(\n")), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A(",\n")), S2(A("ALPHA"), N(2)))), K(A("\n)\n")))))))),
"THE FACT TYPES ARE READ FROM THE FACTS. The base keeps no state:fts cell: <database, cells> to the cells with the one the filed facts give, as lambda`s system:fts_value reads it (k:fts_value), where they hold none.",
DEF("k:with_fts",
S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("state:fts")), N(2))), K(A("#")))), S3(A("COMP"), A("apndr"), S3(A("CONS"), N(2), S4(A("CONS"), K(A("CELL")), K(A("state:fts")), S3(A("COMP"), A("k:fts_value"), N(1))))), N(2))),
DEF("k:fts_value",
S3(A("COMP"), A("k:fts_of"), S6(A("CONS"), S3(A("COMP"), A("sqlite:query"), S4(A("CONS"), A("id"), K(A("select \"row\" ->> 0 from \"_readings\" where \"ft\" = 'FactTypeHasDeclarationOrder' order by cast(\"row\" ->> 1 as integer)")), K(PHI()))), S3(A("COMP"), A("sqlite:query"), S4(A("CONS"), A("id"), K(A("with recursive r as materialized (select \"row\" ->> 0 ft, \"row\" ->> 1 role, cast(substr(\"row\" ->> 1, length(\"row\" ->> 0) + 2) as integer) pos from \"_readings\" where \"ft\" = 'FactTypeHasRole'), p as materialized (select \"row\" ->> 0 o, \"row\" ->> 1 role from \"_readings\" where \"ft\" = 'ObjectTypePlaysRole'), sub as materialized (select \"row\" ->> 0 a, \"row\" ->> 1 b from \"_readings\" where \"ft\" = 'ObjectTypeIsSubtypeOfObjectType'), tab as materialized (select \"row\" ->> 1 o from \"_derived\" where \"ft\" = 'TableIsPrimarilyForObjectType' union select \"row\" ->> 1 from \"_readings\" where \"ft\" = 'TableIsPrimarilyForObjectType'), up(o, a, d) as (select distinct o, o, 0 from p union select up.o, sub.b, up.d + 1 from up join sub on sub.a = up.a where up.d < 64), top as materialized (select o, a from (select o, a, row_number() over (partition by o order by d desc) n from up where a in tab) where n = 1) select r.ft, coalesce(top.a, p.o) from p join r on r.role = p.role left join top on top.o = p.o order by r.ft, r.pos")), K(PHI()))), S3(A("COMP"), A("sqlite:query"), S4(A("CONS"), A("id"), K(A("with r as materialized (select \"row\" ->> 0 ft, \"row\" ->> 1 role, cast(substr(\"row\" ->> 1, length(\"row\" ->> 0) + 2) as integer) pos from \"_readings\" where \"ft\" = 'FactTypeHasRole'), s as materialized (select \"row\" ->> 0 c, \"row\" ->> 1 role from \"_readings\" where \"ft\" = 'ConstraintSpan'), ku as materialized (select \"row\" ->> 0 c from \"_readings\" where \"ft\" = 'ConstraintIsOfConstraintType' and \"row\" ->> 1 = 'UC' intersect select \"row\" ->> 0 from \"_readings\" where \"ft\" = 'ConstraintHasModalityOfModalityType' and \"row\" ->> 1 = 'Alethic'), sr as materialized (select s.c, r.ft, r.pos from s join r on r.role = s.role where s.c in ku), one as materialized (select c, min(ft) ft, group_concat(printf('%04d', pos), '' order by pos) k from sr group by c having count(distinct ft) = 1) select one.ft, sr.c, sr.pos from one join sr on sr.c = one.c order by one.ft, one.k, sr.c, sr.pos")), K(PHI()))), S3(A("COMP"), A("sqlite:query"), S4(A("CONS"), A("id"), K(A("with r as materialized (select \"row\" ->> 0 ft, \"row\" ->> 1 role, cast(substr(\"row\" ->> 1, length(\"row\" ->> 0) + 2) as integer) pos from \"_readings\" where \"ft\" = 'FactTypeHasRole'), s as materialized (select \"row\" ->> 0 c, \"row\" ->> 1 role from \"_readings\" where \"ft\" = 'ConstraintSpan'), km as materialized (select \"row\" ->> 0 c from \"_readings\" where \"ft\" = 'ConstraintIsOfConstraintType' and \"row\" ->> 1 = 'MC' intersect select \"row\" ->> 0 from \"_readings\" where \"ft\" = 'ConstraintHasModalityOfModalityType' and \"row\" ->> 1 = 'Alethic'), sm as materialized (select c from s group by c having count(*) = 1), im as materialized (select \"row\" ->> 1 c from \"_readings\" where \"ft\" = 'ObjectTypeImpliesMandatoryConstraint') select distinct r.ft, r.pos from s join r on r.role = s.role where s.c in km and s.c in sm and s.c not in im order by r.ft, r.pos")), K(PHI()))), S3(A("COMP"), A("sqlite:query"), S4(A("CONS"), A("id"), K(A("select \"row\" ->> 0, \"row\" ->> 1 from \"_readings\" where \"ft\" = 'ObjectTypeHasConceptualDataType'")), K(PHI())))))),
"<rows> to the table <first of a row, the rows it is first of, in the order they came>: asked by k:bs for each fact type, where a scan of every row for each was the square of a large schema.",
DEF("k:gtab",
S4(A("COND"), A("null"), K(PHI()), S5(A("COMP"), A("k:uc_groups"), A("k:msort"), S2(A("ALPHA"), S4(A("CONS"), S3(A("COMP"), N(1), N(1)), N(2), N(1))), S3(A("COMP"), A("trans"), S3(A("CONS"), A("id"), S3(A("COMP"), A("k:iota"), A("length"))))))),
DEF("k:fts_of",
S4(A("COMP"), S2(A("ALPHA"), A("k:fts_desc")), A("distr"), S3(A("CONS"), S3(A("COMP"), S2(A("ALPHA"), N(1)), N(1)), S6(A("CONS"), N(1), S3(A("COMP"), A("k:gtab"), N(2)), S3(A("COMP"), A("k:gtab"), N(3)), S3(A("COMP"), A("k:gtab"), N(4)), N(5))))),
DEF("k:fts_desc",
S6(A("CONS"), N(1), S3(A("COMP"), S2(A("ALPHA"), N(2)), S3(A("COMP"), A("k:bs"), S3(A("CONS"), N(1), S3(A("COMP"), N(2), N(2))))), S3(A("COMP"), A("k:fts_ucs"), S3(A("COMP"), A("k:bs"), S3(A("CONS"), N(1), S3(A("COMP"), N(3), N(2))))), S3(A("COMP"), S2(A("ALPHA"), S3(A("COMP"), A("k:atoi"), N(2))), S3(A("COMP"), A("k:bs"), S3(A("CONS"), N(1), S3(A("COMP"), N(4), N(2))))), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), N(1), K(A("ObjectTypeHasConceptualDataType")))), S3(A("COMP"), N(5), N(2)), K(PHI())))),
DEF("k:fts_ucs",
S4(A("COMP"), S2(A("ALPHA"), S3(A("COMP"), S2(A("ALPHA"), S3(A("COMP"), A("k:atoi"), N(3))), A("k:sel2"))), A("distr"), S3(A("CONS"), S3(A("COMP"), A("k:dedup"), S2(A("ALPHA"), N(2))), A("id")))),
DEF("k:sel",
S4(A("COMP"), A("k:flat"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(1), N(2)), N(1))), S2(A("CONS"), N(2)), K(PHI()))), A("distl"))),
DEF("k:sel2",
S4(A("COMP"), A("k:flat"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(2), N(2)), N(1))), S2(A("CONS"), N(2)), K(PHI()))), A("distl"))),
DEF("k:base_cells",
S3(A("COMP"), A("k:fill"), S3(A("CONS"), A("id"), S3(A("COMP"), A("k:with_rp"), S3(A("CONS"), A("id"), S3(A("COMP"), A("k:with_fts"), S3(A("CONS"), A("id"), S5(A("COMP"), A("carrier:cells"), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S4(A("CONS"), K(A("(\n")), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A(",\n")), S2(A("ALPHA"), N(1)))), K(A("\n)\n"))))), A("sqlite:query"), S4(A("CONS"), A("id"), K(A("select body from _defs where name like 'state:%' order by i")), K(PHI())))))))))),
DEF("k:fill",
S3(A("COMP"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(2), N(2)), K(A("state:fts")))), S4(A("CONS"), K(A("CELL")), K(A("state:fts")), S3(A("COMP"), A("k:fill_descs"), S3(A("CONS"), N(1), S3(A("COMP"), N(3), N(2))))), N(2))), A("distl"))),
DEF("k:fill_descs",
S3(A("COMP"), A("k:fd2"), S4(A("CONS"), N(1), S3(A("COMP"), A("k:ints"), N(2)), S3(A("COMP"), A("k:descs"), N(2))))),
DEF("k:ints",
S6(A("COMP"), S2(A("ALPHA"), N(1)), A("k:flat"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("k:has"), S3(A("CONS"), N(2), K(S8(A("smallInteger"), A("integer"), A("largeInteger"), A("unsignedTiny"), A("unsignedSmall"), A("unsigned"), A("unsignedLarge"), A("autoCounter"))))), S2(A("CONS"), A("id")), K(PHI()))), S4(A("COND"), A("null"), K(PHI()), S4(A("COMP"), A("k:rows"), N(5), N(1))), S4(A("COMP"), A("k:flat"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), N(1), K(A("ObjectTypeHasConceptualDataType")))), S2(A("CONS"), A("id")), K(PHI()))), A("k:descs")))),
"<integer roles, descriptor> to the step that reads its rows from _readings, one that reads nothing where it holds them.",
DEF("k:fd_step",
S4(A("COND"), S5(A("COMP"), A("not"), A("null"), N(5), N(2)), K(S3(A("rows"), A("select 1 where 0"), PHI())), S4(A("CONS"), K(A("rows")), S3(A("COMP"), A("k:rsql"), S3(A("CONS"), S3(A("COMP"), N(2), N(2)), N(1))), S2(A("CONS"), S3(A("COMP"), N(1), N(2)))))),
"<integer roles, descriptor, its rows as read> to the descriptor with them, typed.",
DEF("k:fd_put",
S4(A("COND"), S5(A("COMP"), A("not"), A("null"), N(5), N(2)), N(2), S6(A("CONS"), S3(A("COMP"), N(1), N(2)), S3(A("COMP"), N(2), N(2)), S3(A("COMP"), N(3), N(2)), S3(A("COMP"), N(4), N(2)), S4(A("COMP"), S2(A("ALPHA"), A("k:typed_row")), A("distr"), S3(A("CONS"), N(3), S4(A("COMP"), S2(A("ALPHA"), S3(A("COMP"), A("k:has"), A("id"))), A("distr"), S3(A("CONS"), S3(A("COMP"), N(2), N(2)), N(1)))))))),
DEF("k:fd_one",
S3(A("COMP"), A("k:fd_put"), S4(A("CONS"), N(1), S3(A("COMP"), N(1), N(2)), S3(A("COMP"), N(2), N(2))))),
"<db, integer roles, descriptors> to them with their rows: one program, so one connection, since opening one reads the whole schema again.",
DEF("k:fd2",
S4(A("COND"), S3(A("COMP"), A("null"), N(3)), K(PHI()), S4(A("COMP"), S2(A("ALPHA"), A("k:fd_one")), A("distl"), S3(A("CONS"), N(2), S3(A("COMP"), A("trans"), S3(A("CONS"), N(3), S4(A("COMP"), N(2), A("sqlite:program"), S3(A("CONS"), N(1), S4(A("COMP"), S2(A("ALPHA"), A("k:fd_step")), A("distl"), S3(A("CONS"), N(2), N(3))))))))))),
DEF("k:typed_row",
S3(A("COMP"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), N(2), K(A("T")))), S4(A("COND"), S3(A("COMP"), A("k:isint"), N(1)), S3(A("COMP"), A("k:atoi"), N(1)), N(1)), N(1))), A("trans"))),
DEF("k:dval",
S6(A("COMP"), S4(A("COND"), A("null"), K(A("#")), N(1)), A("k:flat"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), N(1), S3(A("COMP"), N(1), N(2)))), S2(A("CONS"), S3(A("COMP"), N(2), N(2))), K(PHI()))), A("distl"), S3(A("CONS"), A("id"), K(S(S2(A("0"), N(0)), S2(A("1"), N(1)), S2(A("2"), N(2)), S2(A("3"), N(3)), S2(A("4"), N(4)), S2(A("5"), N(5)), S2(A("6"), N(6)), S2(A("7"), N(7)), S2(A("8"), N(8)), S2(A("9"), N(9))))))),
DEF("k:isint",
S4(A("COND"), A("atom"), S3(A("COMP"), S4(A("COND"), A("null"), K(A("F")), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), N(1), K(A("-")))), S3(A("COMP"), S4(A("COND"), A("null"), K(A("F")), S3(A("COMP"), A("k:all"), S2(A("ALPHA"), S3(A("COMP"), A("k:has"), S3(A("CONS"), A("id"), K(S(A("0"), A("1"), A("2"), A("3"), A("4"), A("5"), A("6"), A("7"), A("8"), A("9")))))))), A("tl")), S3(A("COMP"), A("k:all"), S2(A("ALPHA"), S3(A("COMP"), A("k:has"), S3(A("CONS"), A("id"), K(S(A("0"), A("1"), A("2"), A("3"), A("4"), A("5"), A("6"), A("7"), A("8"), A("9"))))))))), A("chars")), K(A("F")))),
DEF("k:atoi",
S3(A("COMP"), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), N(1), K(A("-")))), S3(A("COMP"), A("-"), S3(A("CONS"), K(N(0)), S3(A("COMP"), S4(A("COMP"), N(1), S3(A("WHILE"), S4(A("COMP"), A("not"), A("null"), N(2)), S3(A("CONS"), S3(A("COMP"), A("+"), S3(A("CONS"), S3(A("COMP"), A("*"), S3(A("CONS"), N(1), K(N(10)))), S4(A("COMP"), A("k:dval"), N(1), N(2)))), S3(A("COMP"), A("tl"), N(2)))), S3(A("CONS"), K(N(0)), A("id"))), A("tl")))), S4(A("COMP"), N(1), S3(A("WHILE"), S4(A("COMP"), A("not"), A("null"), N(2)), S3(A("CONS"), S3(A("COMP"), A("+"), S3(A("CONS"), S3(A("COMP"), A("*"), S3(A("CONS"), N(1), K(N(10)))), S4(A("COMP"), A("k:dval"), N(1), N(2)))), S3(A("COMP"), A("tl"), N(2)))), S3(A("CONS"), K(N(0)), A("id")))), A("chars"))),
DEF("k:rsql",
S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S4(A("CONS"), K(A("select ")), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A(", ")), S5(A("COMP"), S2(A("ALPHA"), S3(A("COMP"), A("k:nth"), S3(A("CONS"), A("id"), K(S(A("\"row\" ->> 0"), A("\"row\" ->> 1"), A("\"row\" ->> 2"), A("\"row\" ->> 3"), A("\"row\" ->> 4"), A("\"row\" ->> 5"), A("\"row\" ->> 6"), A("\"row\" ->> 7"), A("\"row\" ->> 8"), A("\"row\" ->> 9"), A("\"row\" ->> 10"), A("\"row\" ->> 11"), A("\"row\" ->> 12"), A("\"row\" ->> 13"), A("\"row\" ->> 14"), A("\"row\" ->> 15")))))), A("k:iota"), A("length"), N(1)))), K(A(" from \"_readings\" where \"ft\" = ? order by \"row\"")))))),
"The declared fact types: state:declared`s pairs; each subtype fact type k:subtypefacts names, <id, <subtype, supertype>, readings>; and each fact type of state:mapinputs neither names (the reference modes and the involvement links), its players the first field of each role fact between its name and its flags, an empty role fact standing for none, its name put through the subtype alias table.",
DEF("k:alldecls0",
S3(A("COMP"), A("k:with_mi"), S3(A("CONS"), S3(A("COMP"), A("cat"), S3(A("CONS"), S3(A("COMP"), A("k:decls"), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("state:declared")), A("id")))), S3(A("COMP"), S2(A("ALPHA"), S3(A("CONS"), N(1), N(2))), A("k:subtypefacts")))), A("id")))),
DEF("k:alldecls",
S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("ALLD")), A("id"))), K(A("#")))), A("k:alldecls0"), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("ALLD")), A("id"))))),
"A STORE WITH NO MAP INPUTS DECLARES ITS FACT TYPES BY ITS FACTS. The fact types state:mapinputs alone named (the reference modes and the involvement links) are filed with their roles and players like every other, so where the store keeps no map inputs the kernel declares each fact type the store files roles for, its players the object types that play its roles in Position order (k:fact_decls); k:with_mi keeps those no other declaration names, as it kept the map inputs.",
DEF("k:fact_decl",
S3(A("CONS"), N(1), S3(A("COMP"), S2(A("ALPHA"), S3(A("COMP"), A("k:as_bs"), S3(A("CONS"), N(1), N(2)))), S3(A("COMP"), A("distr"), S3(A("CONS"), S3(A("COMP"), S3(A("COMP"), S2(A("ALPHA"), N(2)), S3(A("COMP"), A("k:msort"), S2(A("ALPHA"), S3(A("CONS"), S3(A("COMP"), N(2), A("k:role_pos")), A("id"))))), S3(A("COMP"), A("k:bs"), S3(A("CONS"), N(1), S3(A("COMP"), N(1), N(2))))), S3(A("COMP"), N(2), N(2))))))),
DEF("k:fact_decls0",
S5(A("COMP"), S2(A("ALPHA"), A("k:fact_decl")), A("distr"), S3(A("CONS"), S4(A("COMP"), A("k:dedup"), S2(A("ALPHA"), N(1)), N(1)), S3(A("CONS"), S3(A("COMP"), A("k:by_key"), N(1)), S3(A("COMP"), A("k:by_key"), N(2)))), S3(A("CONS"), S3(A("COMP"), A("k:desc_rows"), S3(A("CONS"), K(A("FactTypeHasRole")), A("id"))), S3(A("COMP"), S2(A("ALPHA"), S3(A("CONS"), N(2), N(1))), S3(A("COMP"), A("k:desc_rows"), S3(A("CONS"), K(A("ObjectTypePlaysRole")), A("id"))))))),
DEF("k:fact_decls",
S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("FDECL")), A("id"))), K(A("#")))), A("k:fact_decls0"), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("FDECL")), A("id"))))),
DEF("k:with_mi",
S3(A("COMP"), A("cat"), S3(A("CONS"), N(1), S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("k:in_t"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), N(2))), K(PHI()), S2(A("CONS"), N(1)))), S3(A("COMP"), A("distr"), S3(A("CONS"), S3(A("COMP"), S2(A("ALPHA"), S3(A("CONS"), S3(A("COMP"), A("k:alias_of"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), N(2))), S3(A("COMP"), N(2), N(1)))), S3(A("COMP"), A("distr"), S3(A("CONS"), S4(A("COND"), S3(A("COMP"), A("null"), S3(A("COMP"), A("k:recs"), S3(A("CONS"), K(A("state:mapinputs")), N(2)))), S3(A("COMP"), A("k:fact_decls"), N(2)), S3(A("COMP"), S2(A("ALPHA"), A("k:mi_decl")), S3(A("COMP"), A("k:recs"), S3(A("CONS"), K(A("state:mapinputs")), N(2))))), S3(A("COMP"), A("k:aliases"), N(2))))), S3(A("COMP"), A("k:set_tab"), S3(A("COMP"), S2(A("ALPHA"), N(1)), N(1)))))))))),
DEF("k:mi_decl",
S3(A("CONS"), N(1), S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), S4(A("COND"), A("null"), K(PHI()), S2(A("CONS"), N(1)))), S3(A("COMP"), A("tl"), S3(A("COMP"), A("reverse"), S3(A("COMP"), A("tl"), S3(A("COMP"), A("reverse"), A("id"))))))))),
"P is what the carriers assert, each reflected population united with what was asserted of it: the reflection adds facts and never hides one.",
DEF("k:boot_c",
S3(A("COMP"), A("k:boot_d"), S6(A("CONS"), S3(A("COMP"), A("k:p_with"), S3(A("CONS"), S3(A("COMP"), A("cat"), S3(A("CONS"), S3(A("COMP"), A("k:con_facts"), N(3)), S3(A("COMP"), A("cat"), S3(A("CONS"), S3(A("COMP"), A("k:decl_facts"), N(2)), S3(A("COMP"), A("cat"), S3(A("CONS"), S3(A("COMP"), A("k:rf_of"), N(2)), N(5))))))), S3(A("COMP"), A("k:asserted"), N(1)))), N(2), N(3), N(4), N(6)))),
"THE READINGS. Each declared fact type <fact type, players> has its primary reading r<fact type> (Fact Type has Reading, Reading is primary), and each of its roles is used in that reading (Role is used in Reading), as today`s reflection names them.",
"A reading the kernel mints carries what the metamodel makes mandatory for it: Each Reading has exactly one Text and is used by exactly one Predicate (core.md:570-574). The readings with a template in state:readings (where the store files its reading facts, the fact types with a Declaration Order or a Derivation Mode), k:schemereadings or k:subtypefacts have their Text and Predicate asserted; an involvement link, a fact type state:mapinputs alone names and no template covers, is an objectification`s implied link fact type, whose reading NORMA gives as {0} is involved in {1}, and its Predicate p<fact type>, as today`s predicates are named. Today`s reflection mints these readings without either.",
DEF("k:templated",
S3(A("COMP"), A("cat"), S3(A("CONS"), S4(A("COND"), A("k:cons_facts"), S4(A("COMP"), A("k:dedup"), A("cat"), S3(A("CONS"), S3(A("COMP"), S2(A("ALPHA"), N(1)), S3(A("COMP"), A("k:desc_rows"), S3(A("CONS"), K(A("FactTypeHasDeclarationOrder")), A("id")))), S3(A("COMP"), S2(A("ALPHA"), N(1)), S3(A("COMP"), A("k:desc_rows"), S3(A("CONS"), K(A("FactTypeHasDerivationMode")), A("id")))))), S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), S3(A("COMP"), S2(A("ALPHA"), N(1)), A("k:recs"))), S3(A("COMP"), A("distr"), S3(A("CONS"), K(S1(A("state:readings"))), A("id")))))), S3(A("COMP"), A("cat"), S3(A("CONS"), S3(A("COMP"), S2(A("ALPHA"), N(1)), A("k:schemereadings")), S3(A("COMP"), S2(A("ALPHA"), N(1)), A("k:subtypefacts"))))))),
DEF("k:link_fts",
S3(A("COMP"), A("k:minus"), S3(A("CONS"), S3(A("COMP"), S2(A("ALPHA"), N(1)), S3(A("COMP"), A("k:with_mi"), S3(A("CONS"), K(PHI()), A("id")))), S3(A("COMP"), A("cat"), S3(A("CONS"), A("k:templated"), S3(A("COMP"), S2(A("ALPHA"), N(1)), S3(A("COMP"), A("k:decls"), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("state:declared")), A("id")))))))))),
DEF("k:pid",
S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S3(A("CONS"), K(A("p")), N(1))))),
DEF("k:link_facts",
S3(A("COMP"), S3(A("CONS"), S3(A("CONS"), K(A("ReadingHasText")), S2(A("ALPHA"), S3(A("CONS"), A("k:rid"), K(A("{0} is involved in {1}"))))), S3(A("CONS"), K(A("ReadingIsUsedByPredicate")), S2(A("ALPHA"), S3(A("CONS"), A("k:rid"), A("k:pid"))))), S3(A("COMP"), S2(A("ALPHA"), S2(A("CONS"), A("id"))), A("k:link_fts")))),
"THE DOMAINS (core.md:784-833). Function is declared in Domain holds one row per Domain that declares a name, reflected from the reader`s record state:localnames <name, Domain, kind, path>, and a declared name is its Function`s Local Name there. Function belongs to Domain is held as the store holds it: the compile files each Function under the first Domain that declares it, as core.md`s Domain deontic says the reflection keeps the first, each fact type under its players` and each role under its fact type`s, and a store booted from its database holds those rows while the reader`s record of each element`s Domain is no longer there to derive them again; so the kernel reads them as P holds the instance reflection. MEASURED on the base: the 1,376 rows today`s boot holds, the same list.",
DEF("k:domain_facts",
S3(A("COMP"), A("cat"), S3(A("CONS"), S3(A("COMP"), A("k:df_of"), S3(A("COMP"), A("k:recs"), S3(A("CONS"), K(A("state:localnames")), A("id")))), S2(A("CONS"), S3(A("CONS"), K(A("FunctionBelongsToDomain")), S3(A("COMP"), A("k:recs"), S3(A("CONS"), K(A("FunctionBelongsToDomain")), A("id")))))))),
DEF("k:df_of",
S3(A("CONS"), S3(A("CONS"), K(A("FunctionIsDeclaredInDomain")), S3(A("COMP"), A("k:dedup"), S2(A("ALPHA"), S3(A("CONS"), N(1), N(2))))), S3(A("CONS"), K(A("FunctionHasLocalName")), S3(A("COMP"), A("k:dedup"), S2(A("ALPHA"), S3(A("CONS"), N(1), N(1))))))),
"THE RULES READ ON READ. A subtype fact type <subtype> is a subtype of <supertype> is, in one id space, <x, x> for each instance x of its subtype; a popular reference mode, an entity type`s own mode whose kind Reference Mode is of Reference Mode Type gives as popular, is <x, x> for each instance of its entity type, the id being the instance itself. An instance of a type is a value in a role the type or one of its subtypes plays, walking down the subtype edges from the type asked, the roles of the fact types whose rule walks instances left out. <cells> to the RULES cell <<fact type, <rule, argument>>..>.",
DEF("k:rule_tab",
S3(A("COMP"), A("cat"), S3(A("CONS"), A("k:inst_rule"), S3(A("COMP"), A("cat"), S3(A("CONS"), A("k:link_rules"), S3(A("COMP"), A("cat"), S3(A("CONS"), A("k:rp_rules"), S3(A("COMP"), A("cat"), S3(A("CONS"), S3(A("COMP"), S2(A("ALPHA"), S3(A("CONS"), N(1), S3(A("CONS"), K(A("k:rule_xx")), S3(A("COMP"), N(1), N(2))))), A("k:subtypefacts")), S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("k:has"), S3(A("CONS"), S3(A("CONS"), S3(A("COMP"), N(1), S3(A("COMP"), N(2), N(1))), S3(A("COMP"), N(2), S3(A("COMP"), N(2), N(1)))), N(2))), S2(A("CONS"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), S3(A("CONS"), K(A("k:rule_xx")), S3(A("COMP"), N(1), S3(A("COMP"), N(2), N(1)))))), K(PHI()))), S3(A("COMP"), A("distr"), S3(A("CONS"), A("k:schemereadings"), A("k:popular_modes")))))))))))))),
"THE RULES AS RECIPES (def:derive; Codd`s theta_1: projection, restriction, natural join, with constants as literal relations). state:rpaths <head, recipes> gives each derived head its role paths as recipes; a head`s population is the union of its recipes, and a head its own recipes read (head#base, or the head itself) is their least fixed point, iterated from nothing (lem:finite), with the rows P asserts added for a semi-derived head (state:derived semi). The forms: an atom is a fact type`s population; <proj, r, cols> the rows` values at cols; <sel, r, n, v> the rows whose n-th value is v; <cmp, r, a, b> those whose a-th value is less than the b-th; <minus, r, s> r`s rows not in s; <joinon, r, s, pairs, cols> each row of r beside each of s that agrees at every pair <i, j> (r`s i-th, s`s j-th), at cols of the two side by side; <pairwith, r, v> each row with v after it; <calc, r, f, a, b> each row with f of its a-th and b-th after it, f one of + - * /. A head whose recipes use any other form or function is not read (k:rp_unread) and its population is what P holds. A head on a dependency cycle with a head that introduces values (pairwith, calc) is refused (k:rp_refused, lem:finite), and P`s rows stand. A derived subtype (state:derived subtype) is read through its subtype fact type <head>IsASubtypeOf<supertype>, <x, x> for each x its recipes give.",
DEF("k:rp_all",
S3(A("COMP"), S2(A("ALPHA"), S3(A("CONS"), N(1), S3(A("COMP"), A("k:rp_unbase"), S3(A("CONS"), S3(A("CONS"), N(1), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S3(A("CONS"), N(1), K(A("#base")))))), N(2))))), S3(A("COMP"), A("k:recs"), S3(A("CONS"), K(A("state:rpaths")), A("id"))))),
DEF("k:rp_unbase",
S4(A("COND"), S3(A("COMP"), A("atom"), N(2)), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), N(2), S3(A("COMP"), N(2), N(1)))), S3(A("COMP"), N(1), N(1)), N(2)), S3(A("COMP"), S2(A("ALPHA"), A("k:rp_unbase")), S3(A("COMP"), A("distl"), S3(A("CONS"), N(1), N(2)))))),
DEF("k:rp_src",
S4(A("COND"), A("atom"), K(PHI()), S4(A("COND"), S3(A("COMP"), A("k:has"), S3(A("CONS"), N(1), K(S2(A("minus"), A("joinon"))))), S3(A("CONS"), N(2), N(3)), S2(A("CONS"), N(2))))),
DEF("k:rp_deps",
S4(A("COND"), A("atom"), S2(A("CONS"), A("id")), S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), A("k:rp_deps")), A("k:rp_src"))))),
DEF("k:rp_vi",
S4(A("COND"), A("atom"), K(A("F")), S4(A("COND"), S3(A("COMP"), A("k:has"), S3(A("CONS"), N(1), K(S2(A("pairwith"), A("calc"))))), K(A("T")), S3(A("COMP"), A("k:has"), S3(A("CONS"), K(A("T")), S3(A("COMP"), S2(A("ALPHA"), A("k:rp_vi")), A("k:rp_src"))))))),
DEF("k:rp_ok",
S4(A("COND"), A("atom"), K(A("T")), S4(A("COND"), S3(A("COMP"), A("k:has"), S3(A("CONS"), N(1), K(S7(A("proj"), A("sel"), A("cmp"), A("minus"), A("joinon"), A("pairwith"), A("calc"))))), S3(A("COMP"), A("k:all"), S3(A("CONS"), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), N(1), K(A("calc")))), S3(A("COMP"), A("k:has"), S3(A("CONS"), N(3), K(S5(A("+"), A("-"), A("*"), A("/"), A("^"))))), K(A("T"))), S3(A("COMP"), A("k:all"), S3(A("COMP"), S2(A("ALPHA"), A("k:rp_ok")), A("k:rp_src"))))), K(A("F"))))),
DEF("k:rp_heads",
S2(A("ALPHA"), N(1))),
DEF("k:rp_edges",
S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), S4(A("COND"), S4(A("COMP"), A("not"), A("null"), S3(A("COMP"), A("k:bs"), S3(A("CONS"), N(1), S3(A("COMP"), N(2), N(2))))), S2(A("CONS"), S3(A("CONS"), S3(A("COMP"), N(1), N(2)), N(1))), K(PHI()))), S3(A("COMP"), A("distr"), S3(A("CONS"), S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), A("k:rp_deps")), S3(A("COMP"), N(2), N(1)))), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), N(2))))))), S3(A("COMP"), A("distr"), S3(A("CONS"), A("id"), S3(A("COMP"), A("k:rc_tab"), A("k:rp_heads"))))))),
DEF("k:rp_vih",
S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("k:has"), S3(A("CONS"), K(A("T")), S3(A("COMP"), S2(A("ALPHA"), A("k:rp_vi")), N(2)))), S2(A("CONS"), N(1)), K(PHI()))), A("id")))),
DEF("k:rp_refused",
S3(A("COMP"), A("k:rp_ref_all"), A("k:rp_all"))),
"<the rules> to the heads refused. Only a head on a cycle can be, so only those are asked.",
DEF("k:rp_ref_all",
S3(A("COMP"), A("k:rp_ref2"), S3(A("COMP"), S4(A("CONS"), S4(A("COMP"), A("k:dedup"), S2(A("ALPHA"), N(1)), N(1)), N(1), N(2)), S3(A("CONS"), S3(A("COMP"), A("k:r_cc"), A("k:rp_edges")), A("k:rp_vih"))))),
DEF("k:rp_ref2",
S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("k:has"), S3(A("CONS"), K(A("T")), S3(A("COMP"), S2(A("ALPHA"), A("k:rp_cyc")), S3(A("COMP"), A("distr"), S3(A("CONS"), S3(A("COMP"), N(1), N(2)), A("id")))))), S2(A("CONS"), N(1)), K(PHI()))), S3(A("COMP"), A("distr"), S3(A("CONS"), N(1), A("id")))))),
DEF("k:rp_cyc",
S3(A("COMP"), A("k:all"), S4(A("CONS"), S3(A("COMP"), A("k:has"), S3(A("CONS"), S3(A("CONS"), S3(A("COMP"), N(1), N(2)), N(1)), S3(A("COMP"), N(2), S3(A("COMP"), N(2), N(2))))), S3(A("COMP"), A("k:has"), S3(A("CONS"), S3(A("CONS"), N(1), S3(A("COMP"), N(1), N(2))), S3(A("COMP"), N(2), S3(A("COMP"), N(2), N(2))))), S3(A("COMP"), A("k:has"), S3(A("CONS"), N(1), S3(A("COMP"), N(3), S3(A("COMP"), N(2), N(2)))))))),
DEF("k:rp_unread",
S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("k:all"), S3(A("COMP"), S2(A("ALPHA"), A("k:rp_ok")), N(2))), K(PHI()), S2(A("CONS"), N(1)))), A("id")))),
"A FACT TYPE THE STEP MAINTAINS IS READ WHERE IT IS STORED. A machine stands where the step put it (instances.md): its rule seeds a machine no Event moved, and what is read is the stored row, so the stream need not be replayed. The rule is no head of a read.",
DEF("k:step_heads",
K(S1(A("StateMachineIsCurrentlyInStatus")))),
DEF("k:rp_rules",
S4(A("COMP"), A("k:rp_rules2"), S5(A("CONS"), N(1), S3(A("COMP"), A("cat"), S3(A("CONS"), S3(A("COMP"), A("k:step_heads"), N(2)), S3(A("COMP"), A("cat"), S3(A("CONS"), S3(A("COMP"), A("k:rp_ref_all"), N(1)), S3(A("COMP"), A("k:rp_unread"), N(1)))))), S3(A("COMP"), A("k:recs"), S3(A("CONS"), K(A("state:derived")), N(2))), N(2)), S3(A("CONS"), A("k:rp_all"), A("id")))),
DEF("k:rp_rules2",
S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), A("k:rp_rule1")), S3(A("COMP"), A("distr"), S3(A("CONS"), N(1), A("id")))))),
"A RULE OF RECIPES CARRIES WHETHER ITS HEAD IS SEMI-DERIVED, AND A HEAD THAT IS SEMI-DERIVED AND STORED IS. <rule, <rules, the heads read another way, the derivation mode of each fact type, D>> to the rule RULES holds for its head, none for a head read another way: <head, <k:rule_rp, <head, recipes, semi>>>, or for a derived subtype its subtyping`s (k:rule_rpsub). semi says facts are entered into the head beside what the rule gives, so the head is read as both (k:sq_semi), a row entered is the store`s to take out (k:rule_alone, k:eg_semi), and a constraint over it is checked. A fact type marked semi-derived holds what was entered; one marked semi-derived and stored holds that and may keep what its rule gives, which changes nothing of what was entered, so both are semi. Read as fully derived, a row entered into such a head stood in its table where no statement could take it out, an entity taken out left it behind, and the head was read by its rule alone.",
DEF("k:rp_rule1",
S4(A("COND"), S3(A("COMP"), A("k:has"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), S3(A("COMP"), N(2), N(2)))), K(PHI()), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), A("k:assoc"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), S3(A("COMP"), N(3), N(2)))), K(A("subtype")))), S3(A("COMP"), S2(A("ALPHA"), S3(A("CONS"), N(1), S3(A("CONS"), K(A("k:rule_rpsub")), N(2)))), S3(A("COMP"), A("distr"), S3(A("CONS"), S3(A("COMP"), A("k:rp_subft"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), S3(A("COMP"), N(4), N(2)))), S4(A("CONS"), S3(A("COMP"), N(1), N(1)), S3(A("COMP"), N(2), N(1)), K(A("F")))))), S2(A("CONS"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), S3(A("CONS"), K(A("k:rule_rp")), S4(A("CONS"), S3(A("COMP"), N(1), N(1)), S3(A("COMP"), N(2), N(1)), S3(A("COMP"), A("k:has"), S3(A("CONS"), S3(A("COMP"), A("k:assoc"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), S3(A("COMP"), N(3), N(2)))), K(S2(A("semi"), A("semi-derived-and-stored")))))))))))),
DEF("k:rp_subft",
S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(1), S3(A("COMP"), N(2), N(1))), N(2))), S2(A("CONS"), S3(A("COMP"), N(1), N(1))), K(PHI()))), S3(A("COMP"), A("distr"), S3(A("CONS"), S3(A("COMP"), A("k:subtypefacts"), N(2)), N(1)))))),
DEF("k:rule_rp",
S4(A("COND"), S3(A("COMP"), A("k:bound"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), N(2))), S3(A("COMP"), A("k:assoc"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("RULEROWS")), N(2))))), S3(A("COMP"), A("k:rp_fix"), S4(A("CONS"), N(1), K(PHI()), N(2))))),
DEF("k:bound",
S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("RULEROWS")), N(2))), K(A("#")))), K(A("F")), S3(A("COMP"), A("k:has"), S3(A("CONS"), N(1), S3(A("COMP"), S2(A("ALPHA"), N(1)), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("RULEROWS")), N(2)))))))),
DEF("k:rule_rpsub",
S3(A("COMP"), S2(A("ALPHA"), S3(A("CONS"), N(1), N(1))), S3(A("COMP"), A("k:rule_rp"), A("id")))),
DEF("k:rp_base",
S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(3), N(1)), K(A("T")))), S3(A("COMP"), A("k:assoc"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("FILE")), N(3))))), K(PHI()))),
DEF("k:rp_one",
S3(A("COMP"), A("k:dedup"), S3(A("COMP"), A("cat"), S3(A("CONS"), N(1), S3(A("COMP"), A("cat"), S3(A("CONS"), S3(A("COMP"), A("k:rp_base"), S4(A("CONS"), N(2), N(3), N(4))), S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), A("k:rp_eval")), S3(A("COMP"), A("distr"), S3(A("CONS"), S3(A("COMP"), N(2), N(2)), S3(A("CONS"), S3(A("COMP"), A("apndl"), S3(A("CONS"), S3(A("CONS"), S3(A("COMP"), N(1), N(2)), N(1)), N(3))), N(4)))))))))))),
DEF("k:rp_fix",
S4(A("COND"), S3(A("COMP"), A("k:has"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), A("k:rp_deps")), S3(A("COMP"), N(2), N(1)))))), S3(A("COMP"), N(1), S3(A("COMP"), S3(A("WHILE"), S3(A("COMP"), A("lt"), S3(A("CONS"), N(2), S3(A("COMP"), A("length"), N(1)))), S6(A("CONS"), S3(A("COMP"), A("k:rp_one"), S5(A("CONS"), N(1), N(3), N(4), N(5))), S3(A("COMP"), A("length"), N(1)), N(3), N(4), N(5))), S6(A("CONS"), S3(A("COMP"), A("k:rp_one"), S5(A("CONS"), K(PHI()), N(1), N(2), N(3))), K(N(0)), N(1), N(2), N(3)))), S3(A("COMP"), A("k:rp_one"), S5(A("CONS"), K(PHI()), N(1), N(2), N(3))))),
DEF("k:rp_read",
S4(A("COND"), S3(A("COMP"), A("k:has"), S3(A("CONS"), N(1), S3(A("COMP"), S2(A("ALPHA"), N(1)), N(2)))), S3(A("COMP"), A("k:assoc"), S3(A("CONS"), N(1), N(2))), S3(A("COMP"), A("k:rp_read2"), S3(A("CONS"), A("id"), S3(A("COMP"), A("k:assoc"), S3(A("CONS"), N(1), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("RULES")), N(3))))))))),
DEF("k:rp_read2",
S4(A("COND"), S3(A("COMP"), A("null"), N(2)), S3(A("COMP"), A("k:pop"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), S3(A("COMP"), N(3), N(1)))), S4(A("COND"), S3(A("COMP"), A("k:bound"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), S3(A("COMP"), N(3), N(1)))), S3(A("COMP"), A("k:assoc"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("RULEROWS")), S3(A("COMP"), N(3), N(1)))))), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(1), N(2)), K(A("k:rule_rp")))), S3(A("COMP"), A("k:rp_fix"), S4(A("CONS"), S3(A("COMP"), N(2), N(2)), S3(A("COMP"), N(2), N(1)), S3(A("COMP"), N(3), N(1)))), S3(A("COMP"), A("k:pop"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), S3(A("COMP"), N(3), N(1)))))))),
DEF("k:rp_eval",
S4(A("COND"), S3(A("COMP"), A("atom"), N(1)), S3(A("COMP"), A("k:rp_read"), S4(A("CONS"), N(1), S3(A("COMP"), N(1), N(2)), S3(A("COMP"), N(2), N(2)))), S3(A("COMP"), A("apply"), S3(A("CONS"), S3(A("COMP"), A("k:assoc"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), K(S7(S2(A("proj"), A("k:rp_proj")), S2(A("sel"), A("k:rp_sel")), S2(A("cmp"), A("k:rp_cmp")), S2(A("minus"), A("k:rp_minus")), S2(A("joinon"), A("k:rp_joinon")), S2(A("pairwith"), A("k:rp_pairwith")), S2(A("calc"), A("k:rp_calc")))))), A("id"))))),
DEF("k:rp_s2",
S3(A("COMP"), A("k:rp_eval"), S3(A("CONS"), S3(A("COMP"), N(2), N(1)), N(2)))),
DEF("k:rp_s3",
S3(A("COMP"), A("k:rp_eval"), S3(A("CONS"), S3(A("COMP"), N(3), N(1)), N(2)))),
DEF("k:rp_at",
S3(A("COMP"), S2(A("ALPHA"), A("apply")), S3(A("COMP"), A("distr"), S3(A("CONS"), N(2), N(1))))),
DEF("k:rp_proj",
S3(A("COMP"), A("k:dedup"), S3(A("COMP"), S2(A("ALPHA"), A("k:rp_at")), S3(A("COMP"), A("distr"), S3(A("CONS"), A("k:rp_s2"), S3(A("COMP"), N(3), N(1))))))),
DEF("k:rp_sel",
S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), A("apply"), S3(A("CONS"), S3(A("COMP"), N(1), N(2)), N(1))), S3(A("COMP"), N(2), N(2)))), S2(A("CONS"), N(1)), K(PHI()))), S3(A("COMP"), A("distr"), S3(A("CONS"), A("k:rp_s2"), S3(A("CONS"), S3(A("COMP"), N(3), N(1)), S3(A("COMP"), N(4), N(1)))))))),
DEF("k:rp_cmp",
S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("lt"), S3(A("CONS"), S3(A("COMP"), A("apply"), S3(A("CONS"), S3(A("COMP"), N(1), N(2)), N(1))), S3(A("COMP"), A("apply"), S3(A("CONS"), S3(A("COMP"), N(2), N(2)), N(1))))), S2(A("CONS"), N(1)), K(PHI()))), S3(A("COMP"), A("distr"), S3(A("CONS"), A("k:rp_s2"), S3(A("CONS"), S3(A("COMP"), N(3), N(1)), S3(A("COMP"), N(4), N(1)))))))),
DEF("k:rp_minus",
S3(A("COMP"), A("k:minus"), S3(A("CONS"), A("k:rp_s2"), A("k:rp_s3")))),
DEF("k:rp_joinon",
S3(A("COMP"), A("k:rp_jo2"), S5(A("CONS"), A("k:rp_s2"), A("k:rp_s3"), S3(A("COMP"), N(4), N(1)), S3(A("COMP"), N(5), N(1))))),
DEF("k:rp_jo2",
S3(A("COMP"), A("k:dedup"), S3(A("COMP"), S2(A("ALPHA"), S3(A("COMP"), A("k:rp_at"), S3(A("CONS"), S3(A("COMP"), A("cat"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), S3(A("COMP"), N(2), N(1)))), N(2)))), S3(A("COMP"), A("distr"), S3(A("CONS"), S3(A("COMP"), A("k:smj"), S3(A("CONS"), S3(A("COMP"), A("k:tag"), S3(A("CONS"), N(1), S3(A("COMP"), S2(A("ALPHA"), N(1)), N(3)))), S3(A("COMP"), A("k:tag"), S3(A("CONS"), N(2), S3(A("COMP"), S2(A("ALPHA"), N(2)), N(3)))))), N(4)))))),
DEF("k:rp_pairwith",
S3(A("COMP"), S2(A("ALPHA"), A("apndr")), S3(A("COMP"), A("distr"), S3(A("CONS"), A("k:rp_s2"), S3(A("COMP"), N(3), N(1)))))),
"A POWER IS A PRODUCT REPEATED (Backus 1978, 11.2.4: insert over a construction). A calculated column applies the operation its recipe names to two values (k:rp_calc), and +, -, * and / are the host`s; ^ is composed here of what the kernel has: <base, exponent> to the base once for each of the exponent`s count (k:iota), one after them, and * inserted, the exponent a whole number and none below zero. Any base to the exponent zero is one.",
DEF("^",
S4(A("COMP"), S2(A("INSERT"), A("*")), A("apndr"), S3(A("CONS"), S4(A("COMP"), S2(A("ALPHA"), N(1)), A("distl"), S3(A("CONS"), N(1), S3(A("COMP"), A("k:iota"), N(2)))), K(N(1))))),
"THE KERNEL HOLDS A DECIMAL AS THE TEXT IT IS AND CALCULATES WITH IT AS LAMBDA DOES. k:rp_calc applied the primitive named, over integers: 150 / 250 was 0 and a product of two decimals no number at all, where the database the kernel judges against says 0.6 and the product (k:rq_calc). k:d_val <op, a, b> is lambda`s arithmetic over typed values (value:op_of): + - * of two integers on the primitive, and a quotient whatever its operands, or + - * with an operand no integer, exactly as decimals, written as the text a decimal is (dec:text) because the kernel holds a decimal as its text, the value the database`s row answers for it; ^ on the primitive. The decimals are lambda`s, ported whole: k:d_ten_pow to k:d_div are dec:ten_pow to dec:div and k:d_int read:kind_int, their names renamed into the kernel`s and lambda`s helpers given here (k:d_idx a value`s first place in a list, 0 where none; k:d_firstn and k:d_dropn a list`s first n and all but its first n; k:d_numtext a number`s text; k:d_isint whether a value is an integer; k:d_of a value as a decimal). A quotient is defined only where its divisor is not zero (k:d_defined, k:d_on, k:d_zero), as derive:form_calc and k:rq_calc keep it.",
DEF("k:rp_calc",
S4(A("COMP"), S2(A("ALPHA"), S3(A("COMP"), A("apndr"), S3(A("CONS"), N(1), S3(A("COMP"), A("k:d_val"), S4(A("CONS"), S3(A("COMP"), N(1), N(2)), S3(A("COMP"), A("apply"), S3(A("CONS"), S3(A("COMP"), N(2), N(2)), N(1))), S3(A("COMP"), A("apply"), S3(A("CONS"), S3(A("COMP"), N(3), N(2)), N(1)))))))), A("k:d_defined"), S3(A("COMP"), A("distr"), S3(A("CONS"), A("k:rp_s2"), S4(A("CONS"), S3(A("COMP"), N(3), N(1)), S3(A("COMP"), N(4), N(1)), S3(A("COMP"), N(5), N(1))))))),
DEF("k:d_val",
S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), N(1), K(A("/")))), S4(A("COMP"), A("k:d_text"), A("k:d_div"), S3(A("CONS"), N(2), N(3))), S4(A("COND"), S3(A("COMP"), A("and"), S3(A("CONS"), S3(A("COMP"), A("k:d_isint"), N(2)), S3(A("COMP"), A("k:d_isint"), N(3)))), S3(A("COMP"), A("apply"), S3(A("CONS"), N(1), S3(A("CONS"), N(2), N(3)))), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), N(1), K(A("+")))), S4(A("COMP"), A("k:d_text"), A("k:d_add"), S3(A("CONS"), N(2), N(3))), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), N(1), K(A("-")))), S4(A("COMP"), A("k:d_text"), A("k:d_sub"), S3(A("CONS"), N(2), N(3))), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), N(1), K(A("*")))), S4(A("COMP"), A("k:d_text"), A("k:d_mul"), S3(A("CONS"), N(2), N(3))), S3(A("COMP"), A("apply"), S3(A("CONS"), N(1), S3(A("CONS"), N(2), N(3)))))))))),
DEF("k:d_defined",
S3(A("COMP"), A("k:flat"), S2(A("ALPHA"), S4(A("COND"), A("k:d_on"), S2(A("CONS"), A("id")), K(PHI()))))),
DEF("k:d_on",
S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(1), N(2)), K(A("/")))), S3(A("COMP"), A("not"), S3(A("COMP"), A("k:d_zero"), S3(A("COMP"), A("apply"), S3(A("CONS"), S3(A("COMP"), N(3), N(2)), N(1))))), K(A("T")))),
DEF("k:d_zero",
S3(A("COMP"), S4(A("COND"), A("k:d_is"), S3(A("COMP"), A("eq"), S3(A("CONS"), N(2), K(N(0)))), K(A("F"))), A("k:d_of"))),
DEF("k:d_idx",
S6(A("COMP"), S4(A("COND"), A("null"), K(N(0)), N(1)), A("k:flat"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), N(1), S3(A("COMP"), N(1), N(2)))), S2(A("CONS"), S3(A("COMP"), N(2), N(2))), K(PHI()))), A("distl"), S3(A("CONS"), N(1), S3(A("COMP"), A("trans"), S3(A("CONS"), N(2), S3(A("COMP"), A("k:iota"), S3(A("COMP"), A("length"), N(2)))))))),
DEF("k:d_firstn",
S3(A("COMP"), A("k:take_h"), S3(A("CONS"), N(2), S3(A("COMP"), A("+"), S3(A("CONS"), N(1), K(N(1))))))),
DEF("k:d_dropn",
S3(A("COMP"), A("k:drop_h"), S3(A("CONS"), N(2), S3(A("COMP"), A("+"), S3(A("CONS"), N(1), K(N(1))))))),
DEF("k:d_numtext",
S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S2(A("CONS"), A("id"))))),
DEF("k:d_isint",
S4(A("COND"), A("atom"), A("k:isnum"), K(A("F")))),
DEF("k:d_of",
S4(A("COND"), A("k:d_is"), A("id"), S3(A("COMP"), A("k:d_parse"), S4(A("COND"), A("k:isnum"), A("k:d_numtext"), A("id"))))),
DEF("k:d_ten_pow",
S4(A("COMP"), N(1), S3(A("WHILE"), S3(A("COMP"), A("gt"), S3(A("CONS"), N(2), K(N(0)))), S3(A("CONS"), S3(A("COMP"), A("*"), S3(A("CONS"), N(1), K(N(10)))), S3(A("COMP"), A("-"), S3(A("CONS"), N(2), K(N(1)))))), S3(A("CONS"), K(N(1)), A("id")))),
DEF("k:d_mod10",
S3(A("COMP"), A("-"), S3(A("CONS"), A("id"), S3(A("COMP"), A("*"), S3(A("CONS"), S3(A("COMP"), A("/"), S3(A("CONS"), A("id"), K(N(10)))), K(N(10))))))),
DEF("k:d_abs",
S4(A("COND"), S3(A("COMP"), A("lt"), S3(A("CONS"), A("id"), K(N(0)))), S3(A("COMP"), A("-"), S3(A("CONS"), K(N(0)), A("id"))), A("id"))),
DEF("k:d_mk",
S3(A("COMP"), A("apndl"), S3(A("CONS"), K(A("decimal")), S3(A("WHILE"), S3(A("COMP"), A("and"), S3(A("CONS"), S3(A("COMP"), A("gt"), S3(A("CONS"), N(2), K(N(0)))), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), A("k:d_mod10"), N(1)), K(N(0)))))), S3(A("CONS"), S3(A("COMP"), A("/"), S3(A("CONS"), N(1), K(N(10)))), S3(A("COMP"), A("-"), S3(A("CONS"), N(2), K(N(1))))))))),
DEF("k:d_is",
S4(A("COND"), A("atom"), K(A("F")), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), A("length"), K(N(3)))), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), N(1), K(A("decimal")))), S4(A("COND"), S3(A("COMP"), A("k:d_isint"), N(2)), S3(A("COMP"), A("k:d_isint"), N(3)), K(A("F"))), K(A("F"))), K(A("F"))))),
DEF("k:d_int",
S4(A("COMP"), N(1), S3(A("WHILE"), S3(A("COMP"), A("not"), S3(A("COMP"), A("null"), N(2))), S3(A("CONS"), S3(A("COMP"), A("+"), S3(A("CONS"), S3(A("COMP"), A("*"), S3(A("CONS"), N(1), K(N(10)))), S3(A("COMP"), A("k:dval"), S3(A("COMP"), N(1), N(2))))), S3(A("COMP"), A("tl"), N(2)))), S3(A("CONS"), K(N(0)), A("id")))),
DEF("k:d_ms_of",
S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), A("k:d_idx"), S3(A("CONS"), K(A(".")), A("chars"))), K(N(0)))), S3(A("CONS"), S3(A("COMP"), A("k:d_int"), A("chars")), K(N(0))), S3(A("CONS"), S4(A("COMP"), A("k:d_int"), A("cat"), S3(A("CONS"), S3(A("COMP"), A("k:d_firstn"), S3(A("CONS"), S3(A("COMP"), A("-"), S3(A("CONS"), S3(A("COMP"), A("k:d_idx"), S3(A("CONS"), K(A(".")), A("chars"))), K(N(1)))), A("chars"))), S3(A("COMP"), A("k:d_dropn"), S3(A("CONS"), S3(A("COMP"), A("k:d_idx"), S3(A("CONS"), K(A(".")), A("chars"))), A("chars"))))), S4(A("COMP"), A("length"), A("k:d_dropn"), S3(A("CONS"), S3(A("COMP"), A("k:d_idx"), S3(A("CONS"), K(A(".")), A("chars"))), A("chars")))))),
DEF("k:d_neg_ms",
S3(A("CONS"), S3(A("COMP"), A("-"), S3(A("CONS"), K(N(0)), N(1))), N(2))),
DEF("k:d_parse",
S3(A("COMP"), A("k:d_mk"), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(1), A("chars")), K(A("-")))), S5(A("COMP"), A("k:d_neg_ms"), A("k:d_ms_of"), A("implode"), S3(A("CONS"), K(A("")), S3(A("COMP"), A("tl"), A("chars")))), A("k:d_ms_of")))),
DEF("k:d_pad",
S3(A("WHILE"), S3(A("COMP"), A("le"), S3(A("CONS"), S3(A("COMP"), A("length"), N(1)), N(2))), S3(A("CONS"), S3(A("COMP"), A("apndl"), S3(A("CONS"), K(A("0")), N(1))), N(2)))),
DEF("k:d_utext_frac",
S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S3(A("COMP"), A("cat"), S3(A("CONS"), S3(A("COMP"), A("k:d_firstn"), S3(A("CONS"), S3(A("COMP"), A("-"), S3(A("CONS"), S3(A("COMP"), A("length"), N(1)), N(2))), N(1))), S3(A("COMP"), A("apndl"), S3(A("CONS"), K(A(".")), S3(A("COMP"), A("k:d_dropn"), S3(A("CONS"), S3(A("COMP"), A("-"), S3(A("CONS"), S3(A("COMP"), A("length"), N(1)), N(2))), N(1)))))))))),
DEF("k:d_utext",
S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), N(2), K(N(0)))), S3(A("COMP"), A("k:d_numtext"), N(1)), S4(A("COMP"), A("k:d_utext_frac"), A("k:d_pad"), S3(A("CONS"), S4(A("COMP"), A("chars"), A("k:d_numtext"), N(1)), N(2))))),
DEF("k:d_text",
S4(A("COND"), S3(A("COMP"), A("lt"), S3(A("CONS"), N(2), K(N(0)))), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S3(A("CONS"), K(A("-")), S3(A("COMP"), A("k:d_utext"), S3(A("CONS"), S3(A("COMP"), A("k:d_abs"), N(2)), N(3)))))), S3(A("COMP"), A("k:d_utext"), S3(A("CONS"), N(2), N(3))))),
DEF("k:d_align",
S4(A("CONS"), S3(A("COMP"), A("*"), S3(A("CONS"), S3(A("COMP"), N(2), N(1)), S3(A("COMP"), A("k:d_ten_pow"), S3(A("COMP"), A("-"), S3(A("CONS"), S4(A("COND"), S3(A("COMP"), A("lt"), S3(A("CONS"), S3(A("COMP"), N(3), N(1)), S3(A("COMP"), N(3), N(2)))), S3(A("COMP"), N(3), N(2)), S3(A("COMP"), N(3), N(1))), S3(A("COMP"), N(3), N(1))))))), S3(A("COMP"), A("*"), S3(A("CONS"), S3(A("COMP"), N(2), N(2)), S3(A("COMP"), A("k:d_ten_pow"), S3(A("COMP"), A("-"), S3(A("CONS"), S4(A("COND"), S3(A("COMP"), A("lt"), S3(A("CONS"), S3(A("COMP"), N(3), N(1)), S3(A("COMP"), N(3), N(2)))), S3(A("COMP"), N(3), N(2)), S3(A("COMP"), N(3), N(1))), S3(A("COMP"), N(3), N(2))))))), S4(A("COND"), S3(A("COMP"), A("lt"), S3(A("CONS"), S3(A("COMP"), N(3), N(1)), S3(A("COMP"), N(3), N(2)))), S3(A("COMP"), N(3), N(2)), S3(A("COMP"), N(3), N(1))))),
DEF("k:d_add",
S5(A("COMP"), A("k:d_mk"), S3(A("CONS"), S3(A("COMP"), A("+"), S3(A("CONS"), N(1), N(2))), N(3)), A("k:d_align"), S3(A("CONS"), S3(A("COMP"), A("k:d_of"), N(1)), S3(A("COMP"), A("k:d_of"), N(2))))),
DEF("k:d_sub",
S5(A("COMP"), A("k:d_mk"), S3(A("CONS"), S3(A("COMP"), A("-"), S3(A("CONS"), N(1), N(2))), N(3)), A("k:d_align"), S3(A("CONS"), S3(A("COMP"), A("k:d_of"), N(1)), S3(A("COMP"), A("k:d_of"), N(2))))),
DEF("k:d_mul",
S4(A("COMP"), A("k:d_mk"), S3(A("CONS"), S3(A("COMP"), A("*"), S3(A("CONS"), S3(A("COMP"), N(2), N(1)), S3(A("COMP"), N(2), N(2)))), S3(A("COMP"), A("+"), S3(A("CONS"), S3(A("COMP"), N(3), N(1)), S3(A("COMP"), N(3), N(2))))), S3(A("CONS"), S3(A("COMP"), A("k:d_of"), N(1)), S3(A("COMP"), A("k:d_of"), N(2))))),
DEF("k:d_fdigits",
S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), A("id"), K(N(0)))), K(N(14)), S4(A("COND"), S3(A("COMP"), A("lt"), S3(A("CONS"), S4(A("COMP"), A("length"), A("chars"), A("k:d_numtext")), K(N(14)))), S3(A("COMP"), A("-"), S3(A("CONS"), K(N(14)), S4(A("COMP"), A("length"), A("chars"), A("k:d_numtext")))), K(N(0))))),
DEF("k:d_div_start",
S7(A("CONS"), S3(A("COMP"), A("/"), S3(A("CONS"), S3(A("COMP"), A("k:d_abs"), N(1)), S3(A("COMP"), A("k:d_abs"), N(2)))), S3(A("COMP"), A("-"), S3(A("CONS"), S3(A("COMP"), A("k:d_abs"), N(1)), S3(A("COMP"), A("*"), S3(A("CONS"), S3(A("COMP"), A("/"), S3(A("CONS"), S3(A("COMP"), A("k:d_abs"), N(1)), S3(A("COMP"), A("k:d_abs"), N(2)))), S3(A("COMP"), A("k:d_abs"), N(2)))))), S3(A("COMP"), A("k:d_abs"), N(2)), S3(A("COMP"), A("+"), S3(A("CONS"), S3(A("COMP"), A("k:d_fdigits"), S3(A("COMP"), A("/"), S3(A("CONS"), S3(A("COMP"), A("k:d_abs"), N(1)), S3(A("COMP"), A("k:d_abs"), N(2))))), K(N(1)))), S3(A("COMP"), A("not"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), A("lt"), S3(A("CONS"), N(1), K(N(0)))), S3(A("COMP"), A("lt"), S3(A("CONS"), N(2), K(N(0))))))), S3(A("COMP"), A("k:d_fdigits"), S3(A("COMP"), A("/"), S3(A("CONS"), S3(A("COMP"), A("k:d_abs"), N(1)), S3(A("COMP"), A("k:d_abs"), N(2))))))),
DEF("k:d_div_loop",
S3(A("WHILE"), S3(A("COMP"), A("gt"), S3(A("CONS"), N(4), K(N(0)))), S7(A("CONS"), S3(A("COMP"), A("+"), S3(A("CONS"), S3(A("COMP"), A("*"), S3(A("CONS"), N(1), K(N(10)))), S3(A("COMP"), A("/"), S3(A("CONS"), S3(A("COMP"), A("*"), S3(A("CONS"), N(2), K(N(10)))), N(3))))), S3(A("COMP"), A("-"), S3(A("CONS"), S3(A("COMP"), A("*"), S3(A("CONS"), N(2), K(N(10)))), S3(A("COMP"), A("*"), S3(A("CONS"), S3(A("COMP"), A("/"), S3(A("CONS"), S3(A("COMP"), A("*"), S3(A("CONS"), N(2), K(N(10)))), N(3))), N(3))))), N(3), S3(A("COMP"), A("-"), S3(A("CONS"), N(4), K(N(1)))), N(5), N(6)))),
DEF("k:d_div_round",
S4(A("CONS"), S3(A("COMP"), A("+"), S3(A("CONS"), S3(A("COMP"), A("/"), S3(A("CONS"), N(1), K(N(10)))), S4(A("COND"), S3(A("COMP"), A("ge"), S3(A("CONS"), S3(A("COMP"), A("k:d_mod10"), N(1)), K(N(5)))), K(N(1)), K(N(0))))), N(6), N(5))),
DEF("k:d_div_sign",
S3(A("CONS"), S4(A("COND"), N(3), S3(A("COMP"), A("-"), S3(A("CONS"), K(N(0)), N(1))), N(1)), N(2))),
DEF("k:d_div",
S8(A("COMP"), A("k:d_mk"), A("k:d_div_sign"), A("k:d_div_round"), A("k:d_div_loop"), A("k:d_div_start"), A("k:d_align"), S3(A("CONS"), S3(A("COMP"), A("k:d_of"), N(1)), S3(A("COMP"), A("k:d_of"), N(2))))),
"<a link`s declaration> to what its rank is among: its player and the fact type it objectifies.",
DEF("k:lr_key",
S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("|")), S3(A("COMP"), S3(A("CONS"), N(1), N(2)), N(2))))),
"<declarations> to the table of each player`s links into each fact type, their names: a rank asks its peers, not every link.",
DEF("k:lr_tab",
S3(A("COMP"), A("k:by_key"), S2(A("ALPHA"), S3(A("CONS"), A("k:lr_key"), N(1))))),
"An involvement link <player>IsInvolvedIn<objectified>, a fact type state:mapinputs alone names whose second player is a fact type k:nestings objectifies, is, for each row r of the objectified fact type, <r at the player`s role, r`s instance id>, the id being the row`s values joined by a period, as a Constraint Span`s is. The player`s role is its first role in the objectified fact type; a link for a player in two roles (First, Second) takes the player`s k-th role, k its rank by name among that player`s links into that fact type, First before Second.",
DEF("k:link_decls0",
S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("k:all"), S3(A("CONS"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), A("length"), S3(A("COMP"), N(2), N(1))), K(N(2)))), S3(A("COMP"), A("k:in_t"), S3(A("CONS"), S3(A("COMP"), N(2), S3(A("COMP"), N(2), N(1))), N(2))))), S2(A("CONS"), N(1)), K(PHI()))), S3(A("COMP"), A("distr"), S3(A("CONS"), S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("k:in_t"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), N(2))), S2(A("CONS"), N(1)), K(PHI()))), S3(A("COMP"), A("distr"), S3(A("CONS"), S3(A("COMP"), A("k:with_mi"), S3(A("CONS"), K(PHI()), A("id"))), S3(A("COMP"), A("k:set_tab"), A("k:link_fts")))))), S3(A("COMP"), A("k:set_tab"), S3(A("COMP"), S2(A("ALPHA"), N(1)), A("k:nestings")))))))),
DEF("k:link_decls",
S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("LDECL")), A("id"))), K(A("#")))), A("k:link_decls0"), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("LDECL")), A("id"))))),
DEF("k:link_rules",
S3(A("COMP"), S2(A("ALPHA"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), S3(A("CONS"), K(A("k:rule_link")), S4(A("CONS"), S3(A("COMP"), N(1), S3(A("COMP"), N(2), N(1))), S3(A("COMP"), N(2), S3(A("COMP"), N(2), N(1))), A("k:link_rank"))))), S3(A("COMP"), A("distr"), S3(A("CONS"), A("k:link_decls"), S3(A("COMP"), A("k:lr_tab"), A("k:link_decls")))))),
DEF("k:link_rank",
S3(A("COMP"), A("+"), S3(A("CONS"), K(N(1)), S3(A("COMP"), A("length"), S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("lt"), S3(A("CONS"), N(1), N(2))), K(S1(A("T"))), K(PHI()))), S3(A("COMP"), A("distr"), S3(A("CONS"), S3(A("COMP"), A("k:bs"), S3(A("CONS"), S3(A("COMP"), A("k:lr_key"), N(1)), N(2))), S3(A("COMP"), N(1), N(1)))))))))),
DEF("k:rule_link",
S3(A("COMP"), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), N(2), K(A("#")))), K(PHI()), A("k:rl2")), S3(A("CONS"), A("id"), A("k:role_n")))),
DEF("k:role_n",
S3(A("COMP"), A("k:nth"), S3(A("CONS"), S3(A("COMP"), N(3), N(1)), S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(4), N(1)), S3(A("COMP"), N(1), S3(A("COMP"), N(1), N(2))))), S2(A("CONS"), S3(A("COMP"), N(3), N(1))), K(PHI()))), S3(A("COMP"), A("distr"), S3(A("CONS"), S3(A("COMP"), A("k:rb"), S3(A("CONS"), S3(A("COMP"), N(2), N(1)), N(2))), A("id")))))))),
DEF("k:nth",
S4(A("COND"), S3(A("COMP"), A("lt"), S3(A("CONS"), S3(A("COMP"), A("length"), N(2)), N(1))), S4(A("COND"), S3(A("COMP"), A("null"), N(2)), K(A("#")), S3(A("COMP"), N(1), N(2))), S3(A("COMP"), A("apply"), S3(A("CONS"), N(1), N(2))))),
"A link`s rows are a set: two rows of the fact type can give it one row, a value held as a number and as text giving one instance id.",
DEF("k:rl2",
S3(A("COMP"), A("k:dedup"), S3(A("COMP"), S2(A("ALPHA"), S3(A("CONS"), S3(A("COMP"), A("apply"), S3(A("CONS"), N(1), N(2))), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A(".")), N(2))))), S3(A("COMP"), A("distl"), S3(A("CONS"), N(2), S3(A("COMP"), A("k:pop"), S3(A("CONS"), S3(A("COMP"), N(2), S3(A("COMP"), N(1), N(1))), S3(A("COMP"), N(2), N(1))))))))),
DEF("k:popular_modes",
S4(A("COMP"), A("k:flat"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), A("k:sr_kind"), K(A("popular")))), S2(A("CONS"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), S3(A("COMP"), A("k:sr_vt"), S4(A("CONS"), S3(A("COMP"), N(1), N(1)), S3(A("COMP"), N(2), N(1)), A("k:sr_kind"))))), K(PHI()))), S3(A("COMP"), A("distr"), S3(A("CONS"), S3(A("COMP"), A("k:desc_rows"), S3(A("CONS"), K(A("EntityTypeHasReferenceMode")), A("id"))), S3(A("COMP"), A("k:desc_rows"), S3(A("CONS"), K(A("ReferenceModeIsOfReferenceModeType")), A("id"))))))),
DEF("k:rule_xx",
S3(A("COMP"), S2(A("ALPHA"), S3(A("CONS"), A("id"), A("id"))), A("k:inst_of"))),
DEF("k:ruled0",
S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("k:has"), S3(A("CONS"), S3(A("COMP"), N(1), N(2)), K(S4(A("k:rule_xx"), A("k:rule_rp"), A("k:rule_rpsub"), A("k:rule_inst"))))), S2(A("CONS"), N(1)), K(PHI()))), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("RULES")), A("id")))))),
DEF("k:ruled",
S3(A("COMP"), A("k:ruled2"), S3(A("CONS"), A("k:ruled0"), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("RULES")), A("id")))))),
DEF("k:ruled2",
S3(A("COMP"), A("cat"), S3(A("CONS"), N(1), S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(1), S3(A("COMP"), N(2), N(1))), K(A("k:rule_link")))), S4(A("COND"), S3(A("COMP"), A("k:has"), S3(A("CONS"), S3(A("COMP"), N(2), S3(A("COMP"), N(2), S3(A("COMP"), N(2), N(1)))), N(2))), S2(A("CONS"), S3(A("COMP"), N(1), N(1))), K(PHI())), K(PHI()))), S3(A("COMP"), A("distr"), S3(A("CONS"), N(2), N(1)))))))),
"THE INSTANCES OF A TYPE, ONCE. inst_of <T, D> is, deduplicated, the own values of T and of each type below it (k:desc, down the subtype edges), and the instances of each type a fact type read by its rule hands one of those types through a role that type plays (k:jumps): the popular mode`s value type takes its entity type`s instances. A type`s own values are the values in the roles it plays outside the rule_xx fact types. Within one V they, each type`s instances, and each rule-read head`s rows, are bound once, as the cells OWN, JUMPS, INST and RULEROWS beside D (k:with_tabs), never filed in P; read anywhere else they are computed where asked. As a set, inst_of(P) is what reading every role P plays answers (k:instances_of, test:k_insteq).",
DEF("k:inst_of",
S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("INST")), N(2))), K(A("#")))), A("k:inst_calc"), S3(A("COMP"), A("k:assoc"), S3(A("CONS"), N(1), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("INST")), N(2))))))),
DEF("k:inst_calc",
S3(A("COMP"), A("k:dedup"), S3(A("COMP"), A("cat"), S3(A("CONS"), S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), A("k:own_of")), S3(A("COMP"), A("distr"), S3(A("CONS"), A("k:desc"), N(2))))), S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), A("k:inst_of")), S3(A("COMP"), A("distr"), S3(A("CONS"), S3(A("COMP"), A("k:jumps"), S3(A("CONS"), A("k:desc"), N(2))), N(2))))))))),
DEF("k:desc",
S3(A("COMP"), A("k:dedup"), S3(A("COMP"), A("apndl"), S3(A("CONS"), N(1), S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), A("k:desc")), S3(A("COMP"), A("distr"), S3(A("CONS"), A("k:subs_of"), N(2))))))))),
DEF("k:jumps",
S3(A("COMP"), A("k:dedup"), S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("k:all"), S3(A("CONS"), S3(A("COMP"), A("k:has"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), N(2))), S3(A("COMP"), A("not"), S3(A("COMP"), A("k:has"), S3(A("CONS"), S3(A("COMP"), N(2), N(1)), N(2)))))), S2(A("CONS"), S3(A("COMP"), N(2), N(1))), K(PHI()))), S3(A("COMP"), A("distr"), S3(A("CONS"), S3(A("COMP"), A("k:tab"), S4(A("CONS"), K(A("JUMPS")), K(A("k:jump_tab")), N(2))), N(1))))))),
DEF("k:tab",
S3(A("COMP"), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), A("k:cell"), S3(A("CONS"), N(1), N(3))), K(A("#")))), S3(A("COMP"), A("apply"), S3(A("CONS"), N(2), N(3))), S3(A("COMP"), A("k:cell"), S3(A("CONS"), N(1), N(3)))), A("id"))),
DEF("k:own_of",
S3(A("COMP"), A("cat"), S3(A("CONS"), S3(A("COMP"), A("k:assoc"), S3(A("CONS"), N(1), S3(A("COMP"), A("k:tab"), S4(A("CONS"), K(A("OWN")), K(A("k:own_tab")), N(2))))), S3(A("COMP"), A("cat"), S3(A("CONS"), A("k:dsub_vals"), A("k:asserted_of")))))),
DEF("k:dsub_vals",
S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(1), S3(A("COMP"), N(2), N(1))), K(A("k:rule_rpsub")))), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(1), S3(A("COMP"), N(2), S3(A("COMP"), N(2), N(1)))), S3(A("COMP"), N(1), N(2)))), S3(A("COMP"), S2(A("ALPHA"), N(1)), S3(A("COMP"), A("k:rp_fix"), S4(A("CONS"), S3(A("COMP"), N(2), S3(A("COMP"), N(2), N(1))), K(PHI()), S3(A("COMP"), N(2), N(2))))), K(PHI())), K(PHI()))), S3(A("COMP"), A("distr"), S3(A("CONS"), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("RULES")), N(2))), A("id")))))),
DEF("k:nonruled",
S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("k:in_t"), S3(A("CONS"), S3(A("COMP"), N(2), N(1)), N(2))), K(PHI()), S2(A("CONS"), N(1)))), S3(A("COMP"), A("distr"), S3(A("CONS"), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("ROLES")), A("id"))), S3(A("COMP"), A("k:set_tab"), A("k:ruled"))))))),
DEF("k:own_tab",
S3(A("COMP"), S2(A("ALPHA"), S3(A("CONS"), N(1), A("k:own_vals"))), S3(A("COMP"), A("distr"), S3(A("CONS"), S3(A("COMP"), A("k:dedup"), S3(A("COMP"), S2(A("ALPHA"), N(4)), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("ROLES")), A("id"))))), S3(A("CONS"), A("k:nonruled"), A("id")))))),
DEF("k:own_vals",
S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), A("k:col")), S3(A("COMP"), A("distr"), S3(A("CONS"), S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(4), N(1)), N(2))), S2(A("CONS"), S3(A("CONS"), S3(A("COMP"), N(2), N(1)), S3(A("COMP"), N(3), N(1)))), K(PHI()))), S3(A("COMP"), A("distr"), S3(A("CONS"), S3(A("COMP"), N(1), N(2)), N(1))))), S3(A("COMP"), N(2), N(2))))))),
DEF("k:jump_tab",
S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("k:all"), S3(A("CONS"), S3(A("COMP"), A("not"), S3(A("COMP"), A("null"), N(2))), S3(A("COMP"), A("not"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(4), N(1)), N(2)))))), S2(A("CONS"), S3(A("CONS"), S3(A("COMP"), N(4), N(1)), N(2))), K(PHI()))), S3(A("COMP"), S2(A("ALPHA"), S3(A("CONS"), N(1), S3(A("COMP"), A("k:assoc"), N(2)))), S3(A("COMP"), S2(A("ALPHA"), S3(A("CONS"), N(1), S3(A("CONS"), S3(A("COMP"), N(2), N(1)), N(2)))), S3(A("COMP"), A("distr"), S3(A("CONS"), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("ROLES")), A("id"))), A("k:xx_args")))))))),
DEF("k:xx_args",
S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(1), N(2)), K(A("k:rule_xx")))), S2(A("CONS"), S3(A("CONS"), N(1), S3(A("COMP"), N(2), N(2)))), K(PHI()))), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("RULES")), A("id")))))),
"INSTANCE-OF IS READ AS ITS RULE (instances.md:171-173). Object Type Instance is instance of Object Type is, for each type T, <x, T> for each x in inst_of T: membership is transitive, so x is filed under its type and every type above it. A row P asserts stands, as the type`s own value. Within one V the rows are bound once, as the cell INSTOF. Its roles, and those of a link over a fact type read by such a rule, are not walked for instances: a derived fact type is projective (def:derive), so its objectification mints no fresh entity, and a minted instance-of id filed as an instance would need instance-of rows of its own without end.",
DEF("k:inst_rule",
S4(A("COND"), S3(A("COMP"), A("k:has"), S3(A("CONS"), K(A("ObjectTypeInstanceIsInstanceOfObjectType")), S3(A("COMP"), S2(A("ALPHA"), N(1)), A("k:alldecls")))), K(S1(S2(A("ObjectTypeInstanceIsInstanceOfObjectType"), S2(A("k:rule_inst"), PHI())))), K(PHI()))),
DEF("k:rule_inst",
S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("INSTOF")), N(2))), K(A("#")))), S3(A("COMP"), A("k:instof_rows"), N(2)), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("INSTOF")), N(2))))),
DEF("k:instof_rows",
S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), S3(A("COMP"), A("distr"), S3(A("CONS"), A("k:inst_of"), N(1)))), S3(A("COMP"), A("distr"), S3(A("CONS"), A("k:otypes"), A("id")))))),
DEF("k:asserted_of",
S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(2), N(1)), N(2))), S2(A("CONS"), S3(A("COMP"), N(1), N(1))), K(PHI()))), S3(A("COMP"), A("distr"), S3(A("CONS"), S3(A("COMP"), A("k:assoc"), S3(A("CONS"), K(A("ObjectTypeInstanceIsInstanceOfObjectType")), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("FILE")), N(2))))), N(1)))))),
DEF("k:with_tabs",
S3(A("COMP"), A("k:with_rulerows"), S3(A("COMP"), A("k:with_instof"), S3(A("COMP"), A("k:with_inst_tab"), S3(A("COMP"), A("cat"), S3(A("CONS"), A("id"), S3(A("CONS"), S4(A("CONS"), K(A("CELL")), K(A("OWN")), A("k:own_tab")), S4(A("CONS"), K(A("CELL")), K(A("JUMPS")), A("k:jump_tab"))))))))),
DEF("k:with_instof",
S3(A("COMP"), A("apndr"), S3(A("CONS"), A("id"), S4(A("CONS"), K(A("CELL")), K(A("INSTOF")), A("k:instof_rows"))))),
DEF("k:with_rulerows",
S3(A("COMP"), A("apndr"), S3(A("CONS"), A("id"), S4(A("CONS"), K(A("CELL")), K(A("RULEROWS")), S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(1), S3(A("COMP"), N(2), N(1))), K(A("k:rule_rp")))), S2(A("CONS"), S3(A("CONS"), S3(A("COMP"), N(1), S3(A("COMP"), N(2), S3(A("COMP"), N(2), N(1)))), S3(A("COMP"), A("k:rp_fix"), S4(A("CONS"), S3(A("COMP"), N(2), S3(A("COMP"), N(2), N(1))), K(PHI()), N(2))))), K(PHI()))), S3(A("COMP"), A("distr"), S3(A("CONS"), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("RULES")), A("id"))), A("id"))))))))),
DEF("k:with_inst_tab",
S3(A("COMP"), A("apndr"), S3(A("CONS"), A("id"), S4(A("CONS"), K(A("CELL")), K(A("INST")), S3(A("COMP"), S2(A("ALPHA"), S3(A("CONS"), N(1), A("k:inst_calc"))), S3(A("COMP"), A("distr"), S3(A("CONS"), A("k:otypes"), A("id")))))))),
DEF("k:own_inst",
S3(A("COMP"), A("k:dedup"), S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), A("k:col")), S3(A("COMP"), A("distr"), S3(A("CONS"), S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("k:all"), S3(A("CONS"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(4), N(1)), S3(A("COMP"), N(1), N(2)))), S3(A("COMP"), A("not"), S3(A("COMP"), A("k:has"), S3(A("CONS"), S3(A("COMP"), N(2), N(1)), S3(A("COMP"), N(2), N(2))))))), S2(A("CONS"), S3(A("CONS"), S3(A("COMP"), N(2), N(1)), S3(A("COMP"), N(3), N(1)))), K(PHI()))), S3(A("COMP"), A("distr"), S3(A("CONS"), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("ROLES")), N(2))), S3(A("CONS"), N(1), S3(A("COMP"), A("k:ruled"), N(2))))))), N(2))))))),
DEF("k:rid",
S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S3(A("CONS"), K(A("r")), N(1))))),
DEF("k:rf_of",
S4(A("CONS"), S3(A("CONS"), K(A("FactTypeHasReading")), S2(A("ALPHA"), S3(A("CONS"), N(1), A("k:rid")))), S3(A("CONS"), K(A("ReadingIsPrimary")), S2(A("ALPHA"), S2(A("CONS"), A("k:rid")))), S3(A("CONS"), K(A("RoleHasPositionInReading")), S3(A("COMP"), A("k:flat"), S2(A("ALPHA"), S3(A("COMP"), S2(A("ALPHA"), S4(A("CONS"), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A(".")), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), N(2)))), N(2), S3(A("COMP"), A("k:rid"), N(1)))), S3(A("COMP"), A("distl"), S3(A("CONS"), A("id"), S3(A("COMP"), A("k:iota"), S3(A("COMP"), A("length"), N(2))))))))))),
DEF("k:asserted",
S2(A("ALPHA"), S3(A("CONS"), N(1), S3(A("COMP"), A("k:rows"), N(5))))),
DEF("k:decl_facts",
S3(A("CONS"), S3(A("CONS"), K(A("FactTypeHasRole")), S3(A("COMP"), A("k:flat"), S2(A("ALPHA"), A("k:decl_roles")))), S3(A("CONS"), K(A("ObjectTypePlaysRole")), S3(A("COMP"), A("k:flat"), S2(A("ALPHA"), A("k:decl_plays")))))),
DEF("k:p_with",
S3(A("COMP"), A("cat"), S3(A("CONS"), S3(A("COMP"), S2(A("ALPHA"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), S3(A("COMP"), A("k:union"), S3(A("CONS"), S3(A("COMP"), N(2), N(1)), S3(A("COMP"), A("k:assoc"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), N(2))))))), A("distr")), N(2)))),
DEF("k:boot_d",
S7(A("CONS"), S4(A("CONS"), K(A("CELL")), K(A("FILE")), N(1)), S4(A("CONS"), K(A("CELL")), K(A("TYPES")), S3(A("COMP"), S2(A("ALPHA"), S3(A("CONS"), N(1), K(A("k:ft")))), S3(A("COMP"), A("cat"), S3(A("CONS"), N(1), N(5))))), S4(A("CONS"), K(A("CELL")), K(A("ROLES")), S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), A("k:decl_slots")), N(2)))), S4(A("CONS"), K(A("CELL")), K(A("CONSTRAINTS")), N(3)), S4(A("CONS"), K(A("CELL")), K(A("SUBTYPES")), N(4)), S4(A("CONS"), K(A("CELL")), K(A("RULES")), N(5)))),
"THE INSTANCE REFLECTION (instances.md:171-199, :497-499). An Object Type Instance is an instance of each Object Type whose role it fills, and of every supertype, since subtyping is population inclusion; it is properly of a type when it is an instance of a direct subtype of it, and most specifically of the types it is an instance of and not properly of. <D> to D with those three populations put before what P holds of them, each with its type object. The subtype links are k:subtypefacts`s pairs. NOT YET BOOTED: MEASURED on Java over the base, the direct table is 8,678 pairs over 185 types in 6.3 s, and the closure, whose unions of sets as lists cost each the product of their sizes (Function gathers Constraint 1,226, ConstraintSpan 1,464, Role 1,139 and the rest), brings the boot to 184 s. Forming a set needs an order or an index the primitives do not give.",
DEF("k:with_inst",
S3(A("COMP"), A("k:with_inst2"), S3(A("CONS"), A("id"), A("k:inst_rows")))),
DEF("k:with_inst2",
S7(A("CONS"), S4(A("CONS"), K(A("CELL")), K(A("FILE")), S3(A("COMP"), A("cat"), S3(A("CONS"), N(2), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("FILE")), N(1)))))), S4(A("CONS"), K(A("CELL")), K(A("TYPES")), S3(A("COMP"), A("cat"), S3(A("CONS"), S3(A("COMP"), S2(A("ALPHA"), S3(A("CONS"), N(1), K(A("k:ft")))), N(2)), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("TYPES")), N(1)))))), S3(A("COMP"), N(3), N(1)), S3(A("COMP"), N(4), N(1)), S3(A("COMP"), N(5), N(1)), S3(A("COMP"), N(6), N(1)))),
"THE SUBTYPE FACTS ARE THE SUBTYPINGS THE STORE FILES. The store keeps no cell of them: each subtyping is a row of Object Type is subtype of Object Type in state:fts, and k:subtypefacts reads each as <subtype fact type, <subtype, supertype>, its reading>, the fact type named <subtype>IsASubtypeOf<supertype> in Pascal case (k:pascal) as canon names it (system:subtypefacts). <store>.",
DEF("k:subtypefacts",
S3(A("COMP"), S2(A("ALPHA"), S4(A("CONS"), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S4(A("CONS"), S3(A("COMP"), A("k:pascal"), N(1)), K(A("IsASubtypeOf")), S3(A("COMP"), A("k:pascal"), N(2))))), A("id"), K(S1(S6(A("{0}"), A("is"), A("a"), A("subtype"), A("of"), A("{1}")))))), A("k:sf_pairs"))),
DEF("k:sf_pairs",
S3(A("COMP"), A("k:desc_rows"), S3(A("CONS"), K(A("ObjectTypeIsSubtypeOfObjectType")), A("id")))),
DEF("k:pascal",
S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S4(A("COMP"), N(1), S3(A("WHILE"), S4(A("COMP"), A("not"), A("null"), N(3)), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(1), N(3)), K(A(" ")))), S4(A("CONS"), N(1), K(A("T")), S3(A("COMP"), A("tl"), N(3))), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(1), N(3)), K(A("-")))), S4(A("CONS"), N(1), N(2), S3(A("COMP"), A("tl"), N(3))), S4(A("CONS"), S3(A("COMP"), A("apndr"), S3(A("CONS"), N(1), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), N(2), K(A("T")))), S4(A("COMP"), A("k:charup"), N(1), N(3)), S3(A("COMP"), N(1), N(3))))), K(A("F")), S3(A("COMP"), A("tl"), N(3)))))), S4(A("CONS"), K(PHI()), K(A("T")), A("chars")))))),
"A character raised, by the literal relation of the two alphabets: k:charup <c> is the capital of a lower-case letter c and c itself otherwise, k:upper the table <<a, A>, ..., <z, Z>>, since lambda has no character arithmetic. <character>.",
DEF("k:charup",
S3(A("COMP"), S4(A("COND"), S3(A("COMP"), A("null"), N(2)), N(1), N(2)), S3(A("CONS"), A("id"), S3(A("COMP"), A("k:assoc"), S3(A("CONS"), A("id"), A("k:upper")))))),
DEF("k:upper",
S3(A("COMP"), A("trans"), S3(A("CONS"), S3(A("COMP"), A("chars"), K(A("abcdefghijklmnopqrstuvwxyz"))), S3(A("COMP"), A("chars"), K(A("ABCDEFGHIJKLMNOPQRSTUVWXYZ")))))),
"A fact type`s rows as the carriers give them: k:desc_rows <name, cells> the rows of the descriptor in state:fts named name, <> where none is; the objectifications (k:nestings) are the rows of Object Type objectifies Fact Type, each nest paired with itself. <cells>.",
DEF("k:desc_rows",
S4(A("COMP"), S4(A("COND"), A("null"), K(PHI()), S4(A("COMP"), A("k:rows"), N(5), N(1))), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), N(2))), S2(A("CONS"), N(1)), K(PHI()))), S3(A("COMP"), A("distr"), S3(A("CONS"), S4(A("COMP"), A("k:descs"), A("k:cell"), S3(A("CONS"), K(A("state:fts")), N(2))), N(1)))))),
DEF("k:nestings",
S3(A("COMP"), A("k:desc_rows"), S3(A("CONS"), K(A("ObjectTypeObjectifiesFactType")), A("id")))),
"The implied reference fact types: each entity type`s own reference mode (Entity Type has Reference Mode) with its mode`s kind (Reference Mode is of Reference Mode Type) gives <<entity type>Has<value type>, <entity type, value type>, its reading>, the value type named by the kind as NORMA names it (popular <entity>_<mode>, unit-based <mode>Value, general the mode), a scheme state:declared declares not among them, as canon reads them (system:schemereadings). <cells>.",
DEF("k:schemereadings",
S5(A("COMP"), A("k:flat"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("k:has"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), N(2))), K(PHI()), S2(A("CONS"), N(1)))), A("distr"), S3(A("CONS"), S4(A("COMP"), S2(A("ALPHA"), S3(A("COMP"), A("k:sr_row"), S4(A("CONS"), S3(A("COMP"), N(1), N(1)), S3(A("COMP"), N(2), N(1)), A("k:sr_kind")))), A("distr"), S3(A("CONS"), S3(A("COMP"), A("k:desc_rows"), S3(A("CONS"), K(A("EntityTypeHasReferenceMode")), A("id"))), S3(A("COMP"), A("k:desc_rows"), S3(A("CONS"), K(A("ReferenceModeIsOfReferenceModeType")), A("id"))))), S5(A("COMP"), S2(A("ALPHA"), N(1)), A("k:decls"), A("k:cell"), S3(A("CONS"), K(A("state:declared")), A("id")))))),
DEF("k:sr_kind",
S6(A("COMP"), S4(A("COND"), A("null"), K(A("general")), S3(A("COMP"), N(2), N(1))), A("k:flat"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), N(2))), S2(A("CONS"), N(1)), K(PHI()))), A("distr"), S3(A("CONS"), N(2), S3(A("COMP"), N(2), N(1))))),
DEF("k:sr_row",
S4(A("CONS"), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S4(A("CONS"), S3(A("COMP"), A("k:pascal"), N(1)), K(A("Has")), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), N(3), K(A("popular")))), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S3(A("CONS"), S3(A("COMP"), A("k:pascal"), N(1)), S3(A("COMP"), A("k:pascal"), N(2))))), S3(A("COMP"), A("k:pascal"), A("k:sr_vt")))))), S3(A("CONS"), N(1), A("k:sr_vt")), K(S1(S3(A("{0}"), A("has"), A("{1}")))))),
DEF("k:sr_vt",
S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), N(3), K(A("popular")))), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S4(A("CONS"), N(1), K(A("_")), N(2)))), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), N(3), K(A("unit-based")))), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S3(A("CONS"), N(2), K(A("Value"))))), N(2)))),
DEF("k:links",
S3(A("COMP"), S2(A("ALPHA"), N(2)), A("k:subtypefacts"))),
DEF("k:otypes",
S3(A("COMP"), A("k:dedup"), S3(A("COMP"), A("cat"), S3(A("CONS"), S3(A("COMP"), S2(A("ALPHA"), N(4)), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("ROLES")), A("id")))), S3(A("COMP"), A("cat"), S3(A("CONS"), S3(A("COMP"), S2(A("ALPHA"), N(1)), A("k:links_d")), S3(A("COMP"), S2(A("ALPHA"), N(2)), A("k:links_d")))))))),
DEF("k:links_d",
S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("SUBTYPES")), A("id")))),
DEF("k:subs_of",
S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(2), N(1)), N(2))), S2(A("CONS"), S3(A("COMP"), N(1), N(1))), K(PHI()))), S3(A("COMP"), A("distr"), S3(A("CONS"), S3(A("COMP"), A("k:links_d"), N(2)), N(1)))))),
"The membership by the least fixed point (lem:finite): from each type`s own instances, a step gives each type the instances of its direct subtypes, until no set grows; properly-of is then read off the closed table, the union of the direct subtypes` sets.",
DEF("k:direct_tab",
S3(A("COMP"), S2(A("ALPHA"), S3(A("CONS"), N(1), A("k:instances_of"))), S3(A("COMP"), A("distr"), S3(A("CONS"), A("k:otypes"), A("id"))))),
DEF("k:subs_in",
S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(2), N(1)), N(2))), S2(A("CONS"), S3(A("COMP"), N(1), N(1))), K(PHI()))), S3(A("COMP"), A("distr"), S3(A("CONS"), N(2), N(1)))))),
DEF("k:from_subs",
S3(A("COMP"), S2(A("ALPHA"), A("k:assoc")), S3(A("COMP"), A("distr"), S3(A("CONS"), S3(A("COMP"), A("k:subs_in"), S3(A("CONS"), N(1), N(3))), N(2))))),
DEF("k:step_one",
S3(A("CONS"), S3(A("COMP"), N(1), N(1)), S3(A("COMP"), S2(A("INSERT"), A("k:union")), S3(A("COMP"), A("apndl"), S3(A("CONS"), S3(A("COMP"), N(2), N(1)), S3(A("COMP"), A("k:from_subs"), S4(A("CONS"), S3(A("COMP"), N(1), N(1)), N(2), N(3)))))))),
DEF("k:step_e",
S3(A("COMP"), A("k:step_one"), S4(A("CONS"), N(1), S3(A("COMP"), N(1), N(2)), S3(A("COMP"), N(2), N(2))))),
DEF("k:size",
S3(A("COMP"), S2(A("INSERT"), A("+")), S3(A("COMP"), A("apndr"), S3(A("CONS"), S3(A("COMP"), S2(A("ALPHA"), S3(A("COMP"), A("length"), N(2))), N(1)), K(N(0)))))),
DEF("k:closed",
S3(A("COMP"), N(1), S3(A("COMP"), S3(A("WHILE"), S3(A("COMP"), A("lt"), S3(A("CONS"), A("k:size"), S3(A("COMP"), A("k:size"), A("k:stepd")))), A("k:stepd")), S3(A("CONS"), A("k:direct_tab"), S3(A("COMP"), A("k:links_d"), A("id")))))),
DEF("k:stepd",
S3(A("CONS"), S3(A("COMP"), S2(A("ALPHA"), A("k:step_e")), S3(A("COMP"), A("distr"), S3(A("CONS"), N(1), S3(A("CONS"), N(1), N(2))))), N(2))),
DEF("k:proper_of",
S3(A("COMP"), S2(A("INSERT"), A("k:union")), S3(A("COMP"), A("apndr"), S3(A("CONS"), S3(A("COMP"), A("k:from_subs"), A("id")), K(PHI()))))),
DEF("k:inst_rows",
S3(A("COMP"), A("k:inst_cells"), S3(A("COMP"), A("k:inst_rows2"), S3(A("CONS"), A("k:closed"), S3(A("COMP"), A("k:links_d"), A("id")))))),
DEF("k:inst_rows2",
S3(A("COMP"), S2(A("ALPHA"), S4(A("CONS"), S3(A("COMP"), N(1), N(1)), S3(A("COMP"), N(2), N(1)), S3(A("COMP"), A("k:proper_of"), S4(A("CONS"), S3(A("COMP"), N(1), N(1)), S3(A("COMP"), N(1), N(2)), S3(A("COMP"), N(2), N(2)))))), S3(A("COMP"), A("distr"), S3(A("CONS"), N(1), A("id"))))),
DEF("k:inst_cells",
S4(A("CONS"), S3(A("CONS"), K(A("ObjectTypeInstanceIsInstanceOfObjectType")), S3(A("COMP"), A("k:flat"), S2(A("ALPHA"), S3(A("COMP"), S2(A("ALPHA"), S3(A("CONS"), N(2), N(1))), S3(A("COMP"), A("distl"), S3(A("CONS"), N(1), N(2))))))), S3(A("CONS"), K(A("ObjectTypeInstanceIsProperlyOfObjectType")), S3(A("COMP"), A("k:flat"), S2(A("ALPHA"), S3(A("COMP"), S2(A("ALPHA"), S3(A("CONS"), N(2), N(1))), S3(A("COMP"), A("distl"), S3(A("CONS"), N(1), N(3))))))), S3(A("CONS"), K(A("ObjectTypeInstanceIsMostSpecificallyOfObjectType")), S3(A("COMP"), A("k:flat"), S2(A("ALPHA"), S3(A("COMP"), S2(A("ALPHA"), S3(A("CONS"), N(2), N(1))), S3(A("COMP"), A("distl"), S3(A("CONS"), N(1), S3(A("COMP"), A("k:minus"), S3(A("CONS"), N(2), N(3))))))))))),
"THE CONSTRAINTS AS THE METAMODEL`S FACTS (core.md:621-651). <constraint objects> to the populations of Constraint is of Constraint Type, Constraint has modality of Modality Type, Constraint spans Role (objectified as Constraint Span), and the span`s Sequence Number and Position, the span`s id being <constraint>.<role> as the reflection mints it.",
DEF("k:con_facts",
S6(A("CONS"), S3(A("CONS"), K(A("ConstraintIsOfConstraintType")), S2(A("ALPHA"), S3(A("CONS"), N(1), N(2)))), S3(A("CONS"), K(A("ConstraintHasModalityOfModalityType")), S2(A("ALPHA"), S3(A("CONS"), N(1), N(3)))), S3(A("CONS"), K(A("ConstraintSpan")), S3(A("COMP"), S2(A("ALPHA"), S3(A("CONS"), N(1), N(2))), A("k:spans"))), S3(A("CONS"), K(A("ConstraintSpanHasSequenceNumber")), S3(A("COMP"), S2(A("ALPHA"), S3(A("CONS"), N(5), N(3))), A("k:spans"))), S3(A("CONS"), K(A("ConstraintSpanHasPosition")), S3(A("COMP"), S2(A("ALPHA"), S3(A("CONS"), N(5), N(4))), A("k:spans"))))),
"<constraint objects> to their spans <constraint, role, sequence number, position, span id>.",
DEF("k:spans",
S3(A("COMP"), A("k:flat"), S2(A("ALPHA"), S3(A("COMP"), A("cat"), S3(A("CONS"), S3(A("COMP"), A("k:span_seq"), S4(A("CONS"), N(1), K(N(1)), N(4))), S3(A("COMP"), A("k:span_seq"), S4(A("CONS"), N(1), K(N(2)), N(5)))))))),
DEF("k:span_seq",
S3(A("COMP"), S2(A("ALPHA"), A("k:span1")), S3(A("COMP"), A("distl"), S3(A("CONS"), S3(A("CONS"), N(1), N(2)), S3(A("COMP"), A("trans"), S3(A("CONS"), N(3), S3(A("COMP"), A("k:iota"), S3(A("COMP"), A("length"), N(3))))))))),
DEF("k:span1",
S3(A("COMP"), S6(A("CONS"), N(1), N(2), N(3), N(4), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A(".")), S3(A("CONS"), N(1), N(2))))), S5(A("CONS"), S3(A("COMP"), N(1), N(1)), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A(".")), S3(A("CONS"), S3(A("COMP"), N(1), S3(A("COMP"), N(1), N(2))), S3(A("COMP"), N(2), S3(A("COMP"), N(1), N(2)))))), S3(A("COMP"), N(2), N(1)), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), A("length"), S3(A("COMP"), N(1), N(2))), K(N(3)))), S3(A("COMP"), N(3), S3(A("COMP"), N(1), N(2))), S3(A("COMP"), N(2), N(2)))))),
DEF("k:decl_slots",
S3(A("COMP"), S2(A("ALPHA"), S5(A("CONS"), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A(".")), S3(A("CONS"), N(1), S3(A("COMP"), N(2), N(2))))), N(1), S3(A("COMP"), N(2), N(2)), S3(A("COMP"), N(1), N(2)))), S3(A("COMP"), A("distl"), S3(A("CONS"), N(1), S3(A("COMP"), A("trans"), S3(A("CONS"), N(2), S3(A("COMP"), A("k:iota"), S3(A("COMP"), A("length"), N(2))))))))),
"THE FACT-TYPE OBJECT. <<f, v1..vn>, <operation, D>>: member answers whether <v1..vn> is in f`s population, membership being application (AREST.tex:53, :145); rows answers the population; get and post are SYSTEM`s, each answering <output, the next D>: get <the population, D> for <f> and <whether the fact is in it, D> for a fact; post the command below; any other operation #.",
"A DERIVED FACT TYPE IS READ AS ITS RULE (never pre-calculated). k:pop <fact type, D> is the rule D`s RULES cell names for the fact type, applied to <its argument, D>, and the population FILE holds otherwise, or its SELECT over a D that names a database (k:with_db).",
DEF("k:pop",
S3(A("COMP"), A("k:pop2"), S3(A("CONS"), A("id"), S3(A("COMP"), A("k:assoc"), S3(A("CONS"), N(1), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("RULES")), N(2)))))))),
DEF("k:pop2",
S4(A("COND"), S3(A("COMP"), A("null"), N(2)), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("DB")), S3(A("COMP"), N(2), N(1)))), K(A("#")))), S3(A("COMP"), A("k:assoc"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("FILE")), S3(A("COMP"), N(2), N(1)))))), S3(A("COMP"), A("k:sql_pop"), N(1))), S3(A("COMP"), A("apply"), S3(A("CONS"), S3(A("COMP"), N(1), N(2)), S3(A("CONS"), S3(A("COMP"), N(2), N(2)), S3(A("COMP"), N(2), N(1))))))),
DEF("k:ft",
S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(1), N(2)), K(A("member")))), S3(A("COMP"), A("k:has"), S3(A("CONS"), S3(A("COMP"), A("tl"), N(1)), S3(A("COMP"), A("k:pop"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), S3(A("COMP"), N(2), N(2)))))), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(1), N(2)), K(A("rows")))), S3(A("COMP"), A("k:pop"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), S3(A("COMP"), N(2), N(2)))), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(1), N(2)), K(A("get")))), A("k:ft_get"), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(1), N(2)), K(A("post")))), A("k:post"), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(1), N(2)), K(A("put")))), A("k:put"), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(1), N(2)), K(A("delete")))), A("k:del"), K(A("#"))))))))),
"METACOMPOSITION THROUGH D. <x, <operation, D>> to (rho (up f:D)):<x, y>: the object TYPES names for x`s head, applied to <x, y>; # where D has no type of that name.",
DEF("k:rho",
S4(A("COND"), S3(A("COMP"), A("null"), S3(A("COMP"), A("k:assoc"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("TYPES")), S3(A("COMP"), N(2), N(2))))))), K(A("#")), S3(A("COMP"), A("apply"), S3(A("CONS"), S3(A("COMP"), A("k:assoc"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("TYPES")), S3(A("COMP"), N(2), N(2)))))), A("id"))))),
"A READ OVER THE BOUND TABLES. A head a rule reads, over the bare boot, computes a type`s instances again for each read; over k:with_tabs of D, the D V checks, each is bound once. So an entity`s get reads over it, and a fact type`s get reads a head RULES names over it and a stored one over D, which it does not need. MEASURED over the base: a get on an entity did not finish in 900 s over the bare boot. <<f, ..>, <operation, D>>.",
DEF("k:ft_pop",
S3(A("COMP"), A("k:pop"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), S4(A("COND"), S3(A("COMP"), A("k:has"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), S3(A("COMP"), S2(A("ALPHA"), N(1)), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("RULES")), S3(A("COMP"), N(2), N(2))))))), S3(A("COMP"), A("k:with_tabs"), S3(A("COMP"), N(2), N(2))), S3(A("COMP"), N(2), N(2)))))),
DEF("k:ft_get",
S3(A("CONS"), S4(A("COND"), S3(A("COMP"), A("null"), S3(A("COMP"), A("tl"), N(1))), A("k:ft_pop"), S3(A("COMP"), A("k:has"), S3(A("CONS"), S3(A("COMP"), A("tl"), N(1)), A("k:ft_pop")))), S3(A("COMP"), N(2), N(2)))),
"A STORED FACT TYPE`S SELECT. A place is <table, columns, flag>: a column is a name, or the names that identify one instance together, their values joined by a period as the instance is named; flag is # or the column whose T holds a unary. k:select <place> is the SELECT of the facts stored there: the columns in role order, named c1 and on, the rows that hold all of them, and the flag`s T. k:qi quotes a name.",
DEF("k:qi",
S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S4(A("CONS"), K(A("\"")), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S3(A("COMP"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), A("id"), K(A("\"")))), K(A("\"\"")), A("id"))), A("chars")))), K(A("\"")))))),
DEF("k:qcol",
S4(A("COND"), A("atom"), A("k:qi"), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A(" || '.' || ")), S2(A("ALPHA"), A("k:qi")))))),
DEF("k:nn",
S4(A("COND"), A("atom"), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S3(A("CONS"), A("k:qi"), K(A(" IS NOT NULL"))))), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A(" AND ")), S2(A("ALPHA"), A("k:nn")))))),
DEF("k:select",
S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S8(A("CONS"), K(A("SELECT ")), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A(", ")), S3(A("COMP"), S2(A("ALPHA"), A("k:as_c")), S3(A("COMP"), A("k:idx"), N(2))))), K(A(" FROM ")), S3(A("COMP"), A("k:qi"), N(1)), K(A(" WHERE ")), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A(" AND ")), S3(A("COMP"), S2(A("ALPHA"), A("k:nn")), N(2)))), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), N(3), K(A("#")))), K(A("")), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S4(A("CONS"), K(A(" AND ")), S3(A("COMP"), A("k:qi"), N(3)), K(A(" = 'T'")))))))))),
"THE RELATIONAL MAP IS READ AS THE STORE`S FACTS (csdp.md: Column is for Role, Column belongs to Table, Table has primary Table Key). The metamodel`s own map places those fact types, so these two statements are the one literal knowledge of a place the kernel holds, and the agreement law ka:map_self holds them to what the map they read says of itself. k:map_sql answers <role, column, table, position, the fact type the table is primarily for, the column`s kind>, k:pk_sql <table, column, position, kind> for each table`s primary key.",
DEF("k:map_sql",
K(A("SELECT r.roleId, c.columnName, t.tableName, c.columnPosition, t.tableFactTypeId, c.columnConceptualDataTypeId FROM ColumnIsForRole r JOIN Function c ON c.functionId = r.columnId JOIN Function t ON t.functionId = c.columnTableId"))),
DEF("k:pk_sql",
K(A("SELECT t.tableName, c.columnName, c.columnPosition, c.columnConceptualDataTypeId FROM Function k JOIN TableKeySpansColumn s ON s.tableKeyId = k.functionId JOIN Function c ON c.functionId = s.columnId JOIN Function t ON t.functionId = k.tableKeyTableId"))),
"<database> to <its map rows, its primary key rows>.",
DEF("k:map_of",
S3(A("CONS"), S3(A("COMP"), A("sqlite:query"), S4(A("CONS"), A("id"), A("k:map_sql"), K(PHI()))), S3(A("COMP"), A("sqlite:query"), S4(A("CONS"), A("id"), A("k:pk_sql"), K(PHI()))))),
"<<position, <column, kind>>..> to the <column, kind> in position order.",
DEF("k:by_pos",
S3(A("COMP"), S2(A("ALPHA"), N(2)), A("k:msort"))),
"A list of one to its element, else itself: a column of one name, or several together.",
DEF("k:one",
S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), A("length"), K(N(1)))), N(1), A("id"))),
"<role, map rows> to the rows for that role.",
DEF("k:role_rows",
S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(1), N(2)), N(1))), S2(A("CONS"), N(2)), K(PHI()))), A("distl")))),
"<role, map rows> to its <column, kind> in position order.",
DEF("k:role_cols",
S3(A("COMP"), A("k:by_pos"), S3(A("COMP"), S2(A("ALPHA"), S3(A("CONS"), N(4), S3(A("CONS"), N(2), N(6)))), A("k:role_rows")))),
"<table, primary key rows> to its key`s <column, kind> in position order.",
DEF("k:pk_cols",
S3(A("COMP"), A("k:by_pos"), S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(1), N(2)), N(1))), S2(A("CONS"), S3(A("CONS"), S3(A("COMP"), N(3), N(2)), S3(A("CONS"), S3(A("COMP"), N(2), N(2)), S3(A("COMP"), N(4), N(2))))), K(PHI()))), A("distl"))))),
"<f, arity> to its role names, f.1 and on, as the map names them.",
DEF("k:f_roles",
S3(A("COMP"), S2(A("ALPHA"), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A(".")), S3(A("CONS"), N(1), N(2))))), S3(A("COMP"), A("distl"), S3(A("CONS"), N(1), S3(A("COMP"), A("k:iota"), N(2)))))),
"<f, arity, map rows, primary key rows> to f`s place <table, columns, flag, kinds>, # where the map places none of its roles. A role with no column of its own is the table`s key, the fact being absorbed there; a unary in a table not primarily for it is a flag on that key. A kind is the kind of a column of one name, # for several together.",
DEF("k:place",
S3(A("COMP"), A("k:place2"), S6(A("CONS"), N(1), N(2), N(3), N(4), S3(A("COMP"), A("k:place_tab"), S4(A("CONS"), N(1), S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), A("k:role_rows")), S3(A("COMP"), A("distr"), S3(A("CONS"), S3(A("COMP"), A("k:f_roles"), S3(A("CONS"), N(1), N(2))), N(3))))), N(4)))))),
DEF("k:place2",
S4(A("COND"), S3(A("COMP"), A("null"), N(5)), K(A("#")), A("k:place3"))),
DEF("k:place_pk",
S3(A("COMP"), A("k:pk_cols"), S3(A("CONS"), S4(A("COMP"), N(3), N(1), N(5)), N(4)))),
DEF("k:place3",
S4(A("COND"), S3(A("COMP"), A("k:all"), S3(A("CONS"), S3(A("COMP"), A("eq"), S3(A("CONS"), N(2), K(N(1)))), S3(A("COMP"), A("not"), S3(A("COMP"), A("eq"), S3(A("CONS"), S4(A("COMP"), N(5), N(1), N(5)), N(1)))))), S5(A("CONS"), S4(A("COMP"), N(3), N(1), N(5)), S2(A("CONS"), S3(A("COMP"), A("k:cols1"), A("k:place_pk"))), S4(A("COMP"), N(2), N(1), N(5)), S2(A("CONS"), S3(A("COMP"), A("k:kind1"), A("k:place_pk")))), S3(A("COMP"), A("k:place4"), S3(A("CONS"), S4(A("COMP"), N(3), N(1), N(5)), S3(A("COMP"), S2(A("ALPHA"), A("k:role_or_key")), S3(A("COMP"), A("distr"), S3(A("CONS"), S3(A("COMP"), A("k:f_roles"), S3(A("CONS"), N(1), N(2))), S3(A("CONS"), N(5), A("k:place_pk"))))))))),
DEF("k:place4",
S5(A("CONS"), N(1), S3(A("COMP"), S2(A("ALPHA"), A("k:cols1")), N(2)), K(A("#")), S3(A("COMP"), S2(A("ALPHA"), A("k:kind1")), N(2)))),
DEF("k:cols1",
S3(A("COMP"), A("k:one"), S2(A("ALPHA"), N(1)))),
DEF("k:kind1",
S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), A("length"), K(N(1)))), S3(A("COMP"), N(2), N(1)), K(A("#")))),
"<role, <map rows, the table`s key>> to the role`s <column, kind>, or the key`s where it has none.",
DEF("k:role_or_key",
S3(A("COMP"), S4(A("COND"), S3(A("COMP"), A("null"), N(1)), N(2), N(1)), S3(A("CONS"), S3(A("COMP"), A("k:role_cols"), S3(A("CONS"), N(1), S3(A("COMP"), N(1), N(2)))), S3(A("COMP"), N(2), N(2))))),
"<database, D> to D over that database, its map read once into the cell MAP. Over such a D a stored fact type`s rows are read by its SELECT (k:pop).",
DEF("k:with_db",
S3(A("COMP"), A("apndl"), S3(A("CONS"), S4(A("CONS"), K(A("CELL")), K(A("DB")), N(1)), S3(A("COMP"), A("apndl"), S3(A("CONS"), S4(A("CONS"), K(A("CELL")), K(A("VIEWS")), S3(A("COMP"), A("k:view_names"), N(1))), S3(A("COMP"), A("k:with_sqlmap"), S3(A("CONS"), S3(A("COMP"), A("k:map_of"), N(1)), N(2)))))))),
"<f, D> to the map rows it reads: those of its own roles where they are bound by role.",
DEF("k:map_rows",
S4(A("COND"), S3(A("COMP"), A("not"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("MAPBY")), N(2))), K(A("#"))))), S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), A("k:bs")), S3(A("COMP"), A("distr"), S3(A("CONS"), S3(A("COMP"), A("k:f_roles"), S3(A("CONS"), N(1), A("k:arity"))), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("MAPBY")), N(2))))))), S3(A("COMP"), N(1), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("MAP")), N(2)))))),
"<f, D> to f`s place by D`s map, its arity D`s roles give.",
DEF("k:d_place0",
S3(A("COMP"), A("k:pl_order"), S3(A("CONS"), S3(A("COMP"), A("k:place"), S5(A("CONS"), N(1), A("k:arity"), A("k:map_rows"), S3(A("COMP"), N(2), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("MAP")), N(2)))))), A("id")))),
"<f, D> over a D that names a database to f`s rows by its SELECT, each value in its column`s kind, with what FILE holds of f beside them: the rows the kernel mints, which no table holds. A fact type the map places nowhere is what FILE holds.",
DEF("k:sql_pop",
S3(A("COMP"), A("k:sql_pop2"), S4(A("CONS"), N(2), A("k:d_place"), S3(A("COMP"), A("k:assoc"), S3(A("CONS"), N(1), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("FILE")), N(2)))))))),
DEF("k:sql_pop2",
S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), N(2), K(A("#")))), N(3), S4(A("COND"), S3(A("COMP"), A("null"), N(3)), A("k:sql_rows"), S3(A("COMP"), A("k:union"), S3(A("CONS"), A("k:sql_rows"), N(3)))))),
"<D, place, ..> to the rows at the place, typed.",
DEF("k:sql_rows",
S3(A("COMP"), A("k:typed"), S3(A("CONS"), S3(A("COMP"), A("sqlite:query"), S4(A("CONS"), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("DB")), N(1))), S3(A("COMP"), A("k:select"), N(2)), K(PHI()))), S3(A("COMP"), N(4), N(2))))),
"<rows, kinds> to each row`s values in the kinds: sqlite:query answers each value as its text, and a column of an integer kind holds an integer (k:typed_row, as the boot reads the ledger).",
DEF("k:typed",
S3(A("COMP"), A("k:typed2"), S3(A("CONS"), N(1), S3(A("COMP"), S2(A("ALPHA"), S3(A("COMP"), A("k:has"), S3(A("CONS"), A("id"), K(S8(A("smallInteger"), A("integer"), A("largeInteger"), A("unsignedTiny"), A("unsignedSmall"), A("unsigned"), A("unsignedLarge"), A("autoCounter")))))), N(2))))),
DEF("k:typed2",
S4(A("COND"), S3(A("COMP"), A("k:has"), S3(A("CONS"), K(A("T")), N(2))), S3(A("COMP"), S2(A("ALPHA"), A("k:typed_row")), A("distr")), N(1))),
"A list to its elements each beside its position.",
DEF("k:idx",
S3(A("COMP"), A("trans"), S3(A("CONS"), A("id"), S3(A("COMP"), A("k:iota"), A("length"))))),
DEF("k:as_c",
S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S4(A("CONS"), S3(A("COMP"), A("k:qcol"), N(1)), K(A(" AS c")), N(2))))),
"EVERY FACT TYPE`S SELECT. k:fsql <f, D> answers a SELECT of f`s rows with columns c1 to cn: a stored fact type`s from its place, and a head read by a rule by that rule, as a statement over the SELECTs of what the rule reads. k:lit1 is a value as a literal.",
DEF("k:lit1",
S4(A("COND"), A("k:isnum"), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S2(A("CONS"), A("id")))), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S4(A("CONS"), K(A("'")), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S3(A("COMP"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), A("id"), K(A("'")))), K(A("''")), A("id"))), A("chars")))), K(A("'"))))))),
"<n> to a SELECT of no rows and n columns.",
DEF("k:none",
S3(A("COMP"), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S4(A("CONS"), K(A("SELECT ")), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A(", ")), S3(A("COMP"), S2(A("ALPHA"), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S3(A("CONS"), K(A("NULL AS c")), A("id"))))), A("k:iota")))), K(A(" WHERE 0"))))), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), A("id"), K(N(0)))), K(N(1)), A("id")))),
"<expressions> to them named c1 and on.",
DEF("k:cols_as",
S3(A("COMP"), A("implode"), S3(A("CONS"), K(A(", ")), S3(A("COMP"), S2(A("ALPHA"), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S4(A("CONS"), N(1), K(A(" AS c")), N(2))))), A("k:idx"))))),
"<n> to the n-th column of the row source t.",
DEF("k:tc",
S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S3(A("CONS"), K(A("t.c")), A("id"))))),
DEF("k:wrap",
S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S4(A("CONS"), K(A("SELECT * FROM (")), A("id"), K(A(")")))))),
"<list, h> to its elements before position h.",
DEF("k:take_h",
S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("lt"), S3(A("CONS"), S3(A("COMP"), N(2), N(1)), N(2))), S2(A("CONS"), S3(A("COMP"), N(1), N(1))), K(PHI()))), S3(A("COMP"), A("distr"), S3(A("CONS"), S3(A("COMP"), A("k:idx"), N(1)), N(2)))))),
"<list, h> to its elements from position h.",
DEF("k:drop_h",
S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("lt"), S3(A("CONS"), S3(A("COMP"), N(2), N(1)), N(2))), K(PHI()), S2(A("CONS"), S3(A("COMP"), N(1), N(1))))), S3(A("COMP"), A("distr"), S3(A("CONS"), S3(A("COMP"), A("k:idx"), N(1)), N(2)))))),
"<terms, each a SELECT of the same columns> to their union. SQLite holds a compound statement to 500 terms, so a longer one is the union of its two halves.",
DEF("k:union_sql",
S4(A("COND"), A("null"), S3(A("COMP"), A("k:none"), K(N(1))), S4(A("COND"), S3(A("COMP"), A("lt"), S3(A("CONS"), A("length"), K(N(400)))), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A(" UNION ")), S2(A("ALPHA"), A("k:wrap")))), A("k:union_big")))),
DEF("k:union_big",
S3(A("COMP"), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S6(A("CONS"), K(A("SELECT * FROM (")), S3(A("COMP"), A("k:union_sql"), S3(A("COMP"), A("k:take_h"), S3(A("CONS"), N(1), N(2)))), K(A(") UNION SELECT * FROM (")), S3(A("COMP"), A("k:union_sql"), S3(A("COMP"), A("k:drop_h"), S3(A("CONS"), N(1), N(2)))), K(A(")"))))), S3(A("CONS"), A("id"), S3(A("COMP"), A("+"), S3(A("CONS"), K(N(1)), S3(A("COMP"), A("/"), S3(A("CONS"), A("length"), K(N(2))))))))),
DEF("k:fsql",
S3(A("COMP"), A("k:fsql2"), S4(A("CONS"), N(1), N(2), A("k:rule_of")))),
DEF("k:fsql2",
S4(A("COND"), S3(A("COMP"), A("null"), N(3)), S3(A("COMP"), A("k:fsql_s"), S3(A("CONS"), N(1), N(2))), S3(A("COMP"), A("apply"), S3(A("CONS"), S3(A("COMP"), A("k:assoc"), S3(A("CONS"), S3(A("COMP"), N(1), N(3)), A("k:sq_tab"))), S3(A("CONS"), S3(A("COMP"), N(2), N(3)), N(2)))))),
"Each kind of rule to the DEF that writes its statement, <the rule`s argument, D> to a SELECT.",
DEF("k:sq_tab",
K(S5(S2(A("k:rule_xx"), A("k:sq_xx")), S2(A("k:rule_rp"), A("k:sq_rp")), S2(A("k:rule_rpsub"), A("k:sq_rpsub")), S2(A("k:rule_link"), A("k:sq_link")), S2(A("k:rule_inst"), A("k:sq_inst"))))),
"<f, D> to the SELECT at f`s place, none where the map places it nowhere: the rows a database holds.",
DEF("k:fsql_s",
S3(A("COMP"), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), N(2), K(A("#")))), S3(A("COMP"), A("k:none"), N(3)), S3(A("COMP"), A("k:select"), N(2))), S4(A("CONS"), N(1), A("k:d_place"), A("k:arity")))),
"<T, D> to a SELECT of T`s instances, column c1: as k:inst_of has them, the values in the roles T and the types below it play outside the fact types read by rule, what a derived subtype`s recipes give, the instances filed under them, and those of each type a reference hands them.",
DEF("k:inst_sql0",
S3(A("COMP"), A("k:union_sql"), A("k:inst_terms"))),
DEF("k:inst_terms",
S3(A("COMP"), A("k:dedup"), S3(A("COMP"), A("cat"), S3(A("CONS"), S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), A("k:own_terms")), S3(A("COMP"), A("distr"), S3(A("CONS"), A("k:desc"), N(2))))), S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), A("k:inst_terms")), S3(A("COMP"), A("distr"), S3(A("CONS"), S3(A("COMP"), A("k:jumps"), S3(A("CONS"), A("k:desc"), N(2))), N(2))))))))),
DEF("k:own_terms",
S3(A("COMP"), A("cat"), S3(A("CONS"), A("k:role_terms"), S3(A("COMP"), A("cat"), S3(A("CONS"), A("k:dsub_terms"), A("k:asserted_term")))))),
DEF("k:role_terms",
S4(A("COND"), S3(A("COMP"), A("not"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("NRBY")), N(2))), K(A("#"))))), S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), S3(A("COMP"), A("k:own_term"), S4(A("CONS"), S3(A("COMP"), N(2), N(1)), S3(A("COMP"), N(3), N(1)), S3(A("COMP"), N(2), N(2))))), S3(A("COMP"), A("distr"), S3(A("CONS"), S3(A("COMP"), A("k:bs"), S3(A("CONS"), N(1), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("NRBY")), N(2))))), A("id"))))), A("k:role_terms0"))),
DEF("k:role_terms0",
S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(4), N(1)), S3(A("COMP"), N(1), N(2)))), S3(A("COMP"), A("k:own_term"), S4(A("CONS"), S3(A("COMP"), N(2), N(1)), S3(A("COMP"), N(3), N(1)), S3(A("COMP"), N(2), N(2)))), K(PHI()))), S3(A("COMP"), A("distr"), S3(A("CONS"), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("NONRULED")), N(2))), A("id")))))),
"<f, D> to the rule RULES gives f, nothing where none: by bisection of RULES keyed by fact type where a run bound it (k:with_sqlmap), since a type`s instances ask it of every role below the type and a check of every role it spans.",
DEF("k:rule_of",
S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("RULESBY")), N(2))), K(A("#")))), S3(A("COMP"), A("k:assoc"), S3(A("CONS"), N(1), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("RULES")), N(2))))),
S3(A("COMP"), S4(A("COND"), A("null"), K(PHI()), N(1)), S3(A("COMP"), A("k:bs"), S3(A("CONS"), N(1), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("RULESBY")), N(2)))))))),
"<f, n, D> to whether a rule reads f.",
DEF("k:ruled_p",
S3(A("COMP"), A("not"), S3(A("COMP"), A("null"), S3(A("COMP"), A("k:rule_of"), S3(A("CONS"), N(1), N(3)))))),
"<f, n, D> to the term of the values in f`s n-th role: a stored fact type`s column read from its table, none where the map places it nowhere; one read by a rule, that column of its SELECT.",
DEF("k:own_term",
S4(A("COND"), S3(A("COMP"), A("not"), A("k:ruled_p")), S3(A("COMP"), A("k:own_st"), S4(A("CONS"), N(2), S3(A("COMP"), A("k:d_place"), S3(A("CONS"), N(1), N(3))), N(3))), S2(A("CONS"), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S7(A("CONS"), K(A("SELECT c")), N(2), K(A(" AS c1 FROM (")), S3(A("COMP"), A("k:fsql"), S3(A("CONS"), N(1), N(3))), K(A(")")), S3(A("COMP"), A("k:at_wn"), S3(A("CONS"), N(2), N(3))))))))),
DEF("k:own_st",
S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), N(2), K(A("#")))), K(PHI()), S2(A("CONS"), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S9(A("CONS"), K(A("SELECT ")), S3(A("COMP"), A("k:qcol"), S3(A("COMP"), A("apply"), S3(A("CONS"), N(1), S3(A("COMP"), N(2), N(2))))), K(A(" AS c1 FROM ")), S3(A("COMP"), A("k:qi"), S3(A("COMP"), N(1), N(2))), K(A(" WHERE ")), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A(" AND ")), S3(A("COMP"), S2(A("ALPHA"), A("k:nn")), S3(A("COMP"), N(2), N(2))))), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(3), N(2)), K(A("#")))), K(A("")), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S4(A("CONS"), K(A(" AND ")), S3(A("COMP"), A("k:qi"), S3(A("COMP"), N(3), N(2))), K(A(" = 'T'")))))), S4(A("COND"), S3(A("COMP"), A("k:atv"), N(3)), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S4(A("CONS"), K(A(" AND ")), S3(A("COMP"), A("k:qcol"), S3(A("COMP"), A("apply"), S3(A("CONS"), N(1), S3(A("COMP"), N(2), N(2))))), K(A(" IN k_v"))))), K(A(""))))))))),
DEF("k:dsub_terms",
S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S4(A("COMP"), N(1), N(2), N(1)), K(A("k:rule_rpsub")))), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S5(A("COMP"), N(1), N(2), N(2), N(1)), S3(A("COMP"), N(1), N(2)))), S2(A("CONS"), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S5(A("CONS"), K(A("SELECT c1 AS c1 FROM (")), S3(A("COMP"), A("k:sq_rp"), S3(A("CONS"), S4(A("COMP"), N(2), N(2), N(1)), S3(A("COMP"), N(2), N(2)))), K(A(")")), S3(A("COMP"), A("k:at_where"), S3(A("COMP"), N(2), N(2))))))), K(PHI())), K(PHI()))), S3(A("COMP"), A("distr"), S3(A("CONS"), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("RULES")), N(2))), A("id")))))),
"<T, D> to the term of the instances filed under T, where the map places the fact type that files them.",
DEF("k:asserted_term",
S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), A("k:d_place"), S3(A("CONS"), K(A("ObjectTypeInstanceIsInstanceOfObjectType")), N(2))), K(A("#")))), K(PHI()), S2(A("CONS"), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S6(A("CONS"), K(A("SELECT c1 AS c1 FROM (")), S3(A("COMP"), A("k:fsql_s"), S3(A("CONS"), K(A("ObjectTypeInstanceIsInstanceOfObjectType")), N(2))), K(A(") WHERE c2 = ")), S3(A("COMP"), A("k:lit1"), N(1)), S3(A("COMP"), A("k:at_and"), N(2)))))))),
"Object Type Instance is instance of Object Type is read by name: its statement is long, and heads read it more than once, so a statement that reads it declares it once (k:stmt).",
DEF("k:sq_inst",
K(A("SELECT c1, c2 FROM k_iof"))),
"<D> to <x, T> for each type T and each instance x of it.",
DEF("k:iof_sql",
S3(A("COMP"), A("k:union_sql"), A("k:iof_terms"))),
DEF("k:iof_terms",
S3(A("COMP"), S2(A("ALPHA"), A("k:iof_term")), S3(A("COMP"), A("distr"), S3(A("CONS"), A("k:otypes"), A("id"))))),
"READ AT THE WRITE`S OWN VALUES. A write names few values, and what it can newly break names one of them (k:a_dirty). Those values are the table k_v for its program, and over a D that says so (k:at_d) each term of a statement asks that table in its own WHERE, so the statement reads the store`s indexes rather than a union of whole columns. <D> to whether it says so.",
DEF("k:atv",
S3(A("COMP"), A("not"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("ATV")), A("id"))), K(A("#")))))),
DEF("k:at_d",
S3(A("COMP"), A("apndl"), S3(A("CONS"), S4(A("CONS"), K(A("CELL")), K(A("ATV")), K(A("T"))), A("id")))),
DEF("k:at_where",
S4(A("COND"), A("k:atv"), K(A(" WHERE c1 IN k_v")), K(A("")))),
DEF("k:at_and",
S4(A("COND"), A("k:atv"), K(A(" AND c1 IN k_v")), K(A("")))),
"<n, D> to the WHERE that reads column n at the values.",
DEF("k:at_wn",
S4(A("COND"), S3(A("COMP"), A("k:atv"), N(2)), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S4(A("CONS"), K(A(" WHERE c")), N(1), K(A(" IN k_v"))))), K(A("")))),
"<a statement, whether it reads instance-of, D> to it, with instance-of declared where it does. k:with_iof <D> binds that statement once, for a run of many.",
DEF("k:stmt",
S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), N(2), K(A("T")))), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S6(A("CONS"), K(A("WITH k_iof(c1, c2) AS MATERIALIZED (")), S3(A("COMP"), A("k:iof_text"), N(3)), K(A(") SELECT * FROM (")), N(1), K(A(")"))))), N(1))),
"<D> to D bound for a run of single writes and reads: each is written at its own values, so the statement of each type`s instances, whole, is not made until a statement that reads it whole asks.",
DEF("k:with_run",
S3(A("COMP"), A("k:with_places"), S3(A("COMP"), A("k:with_enums"), A("k:with_nav")))),
DEF("k:with_iof",
S3(A("COMP"), A("k:with_iof3"), S3(A("COMP"), S3(A("CONS"), A("k:iof_terms"), A("id")), S3(A("COMP"), A("k:with_insts"), S3(A("COMP"), A("k:with_places"), A("k:with_nav")))))),
"<f, D> to whether f`s SELECT reads instance-of, by what its rule reads.",
DEF("k:uses",
S3(A("COMP"), A("k:uses2"), S4(A("CONS"), N(1), N(2), S3(A("COMP"), A("k:assoc"), S3(A("CONS"), N(1), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("RULES")), N(2)))))))),
DEF("k:uses2",
S4(A("COND"), S3(A("COMP"), A("null"), N(3)), K(A("F")), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(1), N(3)), K(A("k:rule_inst")))), K(A("T")), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(1), N(3)), K(A("k:rule_link")))), S3(A("COMP"), A("k:uses"), S3(A("CONS"), S4(A("COMP"), N(2), N(2), N(3)), N(2))), S4(A("COND"), S3(A("COMP"), A("k:has"), S3(A("CONS"), S3(A("COMP"), N(1), N(3)), K(S2(A("k:rule_rp"), A("k:rule_rpsub"))))), S4(A("COND"), S3(A("COMP"), A("k:has"), S3(A("CONS"), S4(A("COMP"), N(1), N(2), N(3)), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("CYC")), N(2))))), K(A("F")), S3(A("COMP"), A("k:has"), S3(A("CONS"), K(A("T")), S3(A("COMP"), S2(A("ALPHA"), A("k:rq_uses")), S3(A("COMP"), A("distr"), S3(A("CONS"), S4(A("COMP"), N(2), N(2), N(3)), N(2))))))), K(A("F"))))))),
"<recipe, D> to whether its SELECT reads instance-of; selecting one type from it reads that type`s instances.",
DEF("k:rq_uses",
S4(A("COND"), S3(A("COMP"), A("atom"), N(1)), S3(A("COMP"), A("k:uses"), S3(A("CONS"), N(1), N(2))), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), K(A("sel")))), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(2), N(1)), K(A("ObjectTypeInstanceIsInstanceOfObjectType")))), K(A("F")), S3(A("COMP"), A("k:rq_uses"), S3(A("CONS"), S3(A("COMP"), N(2), N(1)), N(2)))), S3(A("COMP"), A("k:has"), S3(A("CONS"), K(A("T")), S3(A("COMP"), S2(A("ALPHA"), A("k:rq_uses")), S3(A("COMP"), A("distr"), S3(A("CONS"), S3(A("COMP"), A("k:rp_src"), N(1)), N(2))))))))),
"<statement, D> to its rows on D`s database, or on the script in the cell SCRATCH, a database with no file, for a law. Each value comes back as its text.",
DEF("k:q",
S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("SCRATCH")), N(2))), K(A("#")))), S3(A("COMP"), A("sqlite:query"), S4(A("CONS"), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("DB")), N(2))), N(1), K(PHI()))), S3(A("COMP"), A("sqlite:scratch"), S4(A("CONS"), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("SCRATCH")), N(2))), N(1), K(PHI()))))),
"<f, D> to f`s rows by its SELECT.",
DEF("k:fq",
S3(A("COMP"), A("k:q"), S3(A("CONS"), S3(A("COMP"), A("k:stmt"), S4(A("CONS"), A("k:fsql"), A("k:uses"), N(2))), N(2)))),
"<T, D> to <x, x> for each instance x of T: a subtyping or a popular reference.",
DEF("k:sq_xx",
S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S4(A("CONS"), K(A("SELECT c1 AS c1, c1 AS c2 FROM (")), A("k:inst_sql"), K(A(")")))))),
"<<player, fact type, rank>, D> to <the row at the player`s role, the row`s instance id> for each row of the fact type.",
DEF("k:sq_link",
S3(A("COMP"), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), N(2), K(A("#")))), S3(A("COMP"), A("k:none"), K(N(2))), A("k:sq_link2")), S3(A("CONS"), A("id"), A("k:role_n")))),
DEF("k:sq_link2",
S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S8(A("CONS"), K(A("SELECT t.c")), N(2), K(A(" AS c1, ")), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A(" || '.' || ")), S3(A("COMP"), S2(A("ALPHA"), A("k:tc")), S3(A("COMP"), A("k:iota"), S3(A("COMP"), A("k:arity"), S3(A("CONS"), S4(A("COMP"), N(2), N(1), N(1)), S3(A("COMP"), N(2), N(1)))))))), K(A(" AS c2 FROM (")), S3(A("COMP"), A("k:fsql"), S3(A("CONS"), S4(A("COMP"), N(2), N(1), N(1)), S3(A("COMP"), N(2), N(1)))), K(A(") t")))))),
"<<head, recipes, semi>, D> to <x, x> for each row x its recipes give: a derived subtype`s subtyping.",
DEF("k:sq_rpsub",
S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S4(A("CONS"), K(A("SELECT c1 AS c1, c1 AS c2 FROM (")), A("k:sq_rp"), K(A(")")))))),
"<<head, recipes, semi>, D> to the union of what its recipes read, with what is stored of a semi-derived head. A head on a cycle of heads, its rows being a least fixed point, is its rows as computed.",
DEF("k:sq_rp",
S4(A("COND"), S3(A("COMP"), A("k:has"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("CYC")), N(2))))), A("k:sq_cyc"), S3(A("COMP"), A("k:union_sql"), S3(A("COMP"), A("cat"), S3(A("CONS"), S3(A("COMP"), S2(A("ALPHA"), A("k:rq")), S3(A("COMP"), A("distr"), S3(A("CONS"), S3(A("COMP"), N(2), N(1)), N(2)))), A("k:sq_semi")))))),
DEF("k:sq_semi",
S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(3), N(1)), K(A("T")))), S2(A("CONS"), S3(A("COMP"), A("k:fsql_s"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), N(2)))), K(PHI()))),
DEF("k:sq_cyc",
S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), A("k:cyc_view"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), N(2))), K(A("#")))),
S3(A("COMP"), A("k:values"), S3(A("CONS"), S3(A("COMP"), A("k:pop"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), N(2))), S3(A("COMP"), A("k:arity"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), N(2))))),
S3(A("COMP"), A("k:cv_sql"), S3(A("CONS"), S3(A("COMP"), A("k:cyc_view"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), N(2))), S3(A("COMP"), A("k:arity"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), N(2))))))),
"A HEAD ON A CYCLE IS READ WHERE THE STORE SAYS IT. Its rows are a least fixed point, which the store lays as a view over WITH RECURSIVE; computing it here and spelling its rows into a statement is every population it reads, in the kernel, for each statement: on support one fact POST ran past 45 minutes, and the statement read the rows from before the write. <head, D> to the view the database holds of it, the one with what was entered where it keeps both, # where it holds none.",
DEF("k:cyc_view",
S4(A("COND"), S3(A("COMP"), A("atom"), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("VIEWS")), N(2)))), K(A("#")),
S4(A("COND"), S3(A("COMP"), A("k:has"), S3(A("CONS"), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S3(A("CONS"), N(1), K(A("+"))))), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("VIEWS")), N(2))))), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S3(A("CONS"), N(1), K(A("+"))))),
S4(A("COND"), S3(A("COMP"), A("k:has"), S3(A("CONS"), N(1), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("VIEWS")), N(2))))), N(1), K(A("#")))))),
"<view, n> to a SELECT of its rows, columns c1 to cn.",
DEF("k:cv_sql",
S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S8(A("CONS"), K(A("WITH _v(")), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A(", ")), S3(A("COMP"), S2(A("ALPHA"), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S3(A("CONS"), K(A("c")), A("id"))))), S3(A("COMP"), A("k:iota"), N(2))))), K(A(") AS (SELECT * FROM ")), S3(A("COMP"), A("k:qi"), N(1)), K(A(" AS ")), S3(A("COMP"), A("k:qi"), S3(A("COMP"), A("k:sn_tok"), N(1))), K(A(") SELECT * FROM _v")))))),
"<database> to the names of the views it holds.",
DEF("k:view_names",
S3(A("COMP"), S2(A("ALPHA"), N(1)), S3(A("COMP"), A("sqlite:query"), S4(A("CONS"), A("id"), K(A("select name from sqlite_master where type = 'view'")), K(PHI()))))),
"<rows, n> to a SELECT of those rows, n columns.",
DEF("k:values",
S4(A("COND"), S3(A("COMP"), A("null"), N(1)), S3(A("COMP"), A("k:none"), N(2)), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S6(A("CONS"), K(A("SELECT ")), S3(A("COMP"), A("k:cols_as"), S3(A("COMP"), S2(A("ALPHA"), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S3(A("CONS"), K(A("column")), A("id"))))), S3(A("COMP"), A("k:iota"), N(2)))), K(A(" FROM (VALUES ")), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A(", ")), S3(A("COMP"), S2(A("ALPHA"), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S4(A("CONS"), K(A("(")), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A(", ")), S2(A("ALPHA"), A("k:lit1")))), K(A(")")))))), N(1)))), K(A(")"))))))),
"<recipe, D> to its SELECT, as k:rp_eval reads it (the forms of THE RULES AS RECIPES): an atom is a fact type`s SELECT, each other form a statement over its sources`.",
DEF("k:rq",
S4(A("COND"), S3(A("COMP"), A("atom"), N(1)), S4(A("COND"), A("k:rq_viewed"), S3(A("COMP"), A("k:cv_sql"), S3(A("CONS"), A("k:cyc_view"), A("k:arity"))), S3(A("COMP"), A("k:fsql"), S3(A("CONS"), N(1), N(2)))), S3(A("COMP"), A("apply"), S3(A("CONS"), S3(A("COMP"), A("k:assoc"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), A("k:rq_tab"))), A("id"))))),
"AND A HEAD ANOTHER RULE READS IS READ WHERE THE STORE SAYS IT TOO. A recipe`s atom is a fact type`s SELECT, and where that fact type is itself a head read by a rule, its SELECT was its rule written out in each place a rule reads it: a head read by a head read by a head is written out at every use, the lengths multiply, and on a large app`s store the statement that judges one uniqueness after a create was refused by SQLite as too big. The store lays each derived fact type as a view (k:cyc_view finds it, the one with what was entered where it keeps both), so an atom that is a derived fact type the database holds a view of is read from that view, and a statement holds one rule`s text and no more. The head a statement is about is still written from its own recipes, at the write`s values. Over a D with no database, and for a head the database holds no view of, the rule is written out as before. k:rq_viewed <f, D> says whether f is such an atom: a rule of the kind k:rule_rp reads it and k:cyc_view answers a view.",
DEF("k:rq_viewed",
S4(A("COND"), S3(A("COMP"), A("null"), A("k:rule_of")), K(A("F")),
S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(1), A("k:rule_of")), K(A("k:rule_rp")))),
S4(A("COMP"), A("not"), A("eq"), S3(A("CONS"), A("k:cyc_view"), K(A("#")))),
K(A("F"))))),
DEF("k:rq_tab",
K(S7(S2(A("proj"), A("k:rq_proj")), S2(A("sel"), A("k:rq_sel")), S2(A("cmp"), A("k:rq_cmp")), S2(A("minus"), A("k:rq_minus")), S2(A("joinon"), A("k:rq_join")), S2(A("pairwith"), A("k:rq_pair")), S2(A("calc"), A("k:rq_calc"))))),
DEF("k:rq_proj",
S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S6(A("CONS"), K(A("SELECT DISTINCT ")), S3(A("COMP"), A("k:cols_as"), S3(A("COMP"), S2(A("ALPHA"), A("k:tc")), S3(A("COMP"), N(3), N(1)))), K(A(" FROM (")), S3(A("COMP"), A("k:rq"), S3(A("CONS"), S3(A("COMP"), N(2), N(1)), N(2))), K(A(") t")))))),
"Selecting the instances of one type from instance-of is that type`s instances.",
DEF("k:rq_sel",
S4(A("COND"), S3(A("COMP"), A("k:all"), S3(A("CONS"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(2), N(1)), K(A("ObjectTypeInstanceIsInstanceOfObjectType")))), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(3), N(1)), K(N(2)))))), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S6(A("CONS"), K(A("SELECT c1 AS c1, ")), S3(A("COMP"), A("k:lit1"), S3(A("COMP"), N(4), N(1))), K(A(" AS c2 FROM (")), S3(A("COMP"), A("k:inst_sql"), S3(A("CONS"), S3(A("COMP"), N(4), N(1)), N(2))), K(A(")"))))), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S7(A("CONS"), K(A("SELECT t.* FROM (")), S3(A("COMP"), A("k:rq"), S3(A("CONS"), S3(A("COMP"), N(2), N(1)), N(2))), K(A(") t WHERE t.c")), S3(A("COMP"), N(3), N(1)), K(A(" = ")), S3(A("COMP"), A("k:lit1"), S3(A("COMP"), N(4), N(1)))))))),
DEF("k:rq_cmp",
S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S7(A("CONS"), K(A("SELECT t.* FROM (")), S3(A("COMP"), A("k:rq"), S3(A("CONS"), S3(A("COMP"), N(2), N(1)), N(2))), K(A(") t WHERE t.c")), S3(A("COMP"), N(3), N(1)), K(A(" < t.c")), S3(A("COMP"), N(4), N(1)))))),
DEF("k:rq_minus",
S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S6(A("CONS"), K(A("SELECT * FROM (")), S3(A("COMP"), A("k:rq"), S3(A("CONS"), S3(A("COMP"), N(2), N(1)), N(2))), K(A(") EXCEPT SELECT * FROM (")), S3(A("COMP"), A("k:rq"), S3(A("CONS"), S3(A("COMP"), N(3), N(1)), N(2))), K(A(")")))))),
"Each side of a join is materialized: SQLite flattens a subquery into its join, and a key that is then an expression cannot be indexed, so the join reads every pair.",
DEF("k:rq_join",
S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S9(A("CONS"), K(A("WITH x AS MATERIALIZED (")), S3(A("COMP"), A("k:rq"), S3(A("CONS"), S3(A("COMP"), N(2), N(1)), N(2))), K(A("), y AS MATERIALIZED (")), S3(A("COMP"), A("k:rq"), S3(A("CONS"), S3(A("COMP"), N(3), N(1)), N(2))), K(A(") SELECT DISTINCT ")), S3(A("COMP"), A("k:cols_as"), S3(A("COMP"), S2(A("ALPHA"), A("k:rq_jc")), S3(A("COMP"), A("distr"), S3(A("CONS"), S3(A("COMP"), N(5), N(1)), S3(A("COMP"), A("k:rq_ar"), S3(A("CONS"), S3(A("COMP"), N(2), N(1)), N(2))))))), K(A(" FROM x JOIN y ON 1")), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S3(A("COMP"), S2(A("ALPHA"), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S5(A("CONS"), K(A(" AND x.c")), N(1), K(A(" = y.c")), N(2))))), S3(A("COMP"), N(4), N(1))))))))),
"<k, the arity of the first source> to the k-th column of the two side by side.",
DEF("k:rq_jc",
S4(A("COND"), S3(A("COMP"), A("lt"), S3(A("CONS"), N(2), N(1))), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S3(A("CONS"), K(A("y.c")), S3(A("COMP"), A("-"), S3(A("CONS"), N(1), N(2)))))), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S3(A("CONS"), K(A("x.c")), N(1)))))),
DEF("k:rq_pair",
S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S8(A("CONS"), K(A("SELECT t.*, ")), S3(A("COMP"), A("k:lit1"), S3(A("COMP"), N(3), N(1))), K(A(" AS c")), S3(A("COMP"), A("+"), S3(A("CONS"), S3(A("COMP"), A("k:rq_ar"), S3(A("CONS"), S3(A("COMP"), N(2), N(1)), N(2))), K(N(1)))), K(A(" FROM (")), S3(A("COMP"), A("k:rq"), S3(A("CONS"), S3(A("COMP"), N(2), N(1)), N(2))), K(A(") t")))))),
"AND A CALCULATION IS SAID AS LAMBDA`S VIEW SAYS IT (sqlite:rs_calc2). +, -, * and / are exact (k:dec_sql): each value read as the decimal its text spells, and their sum, difference, product, or quotient by long division to fourteen significant digits rounded half away from zero, written as its digits and cast to NUMERIC, so a whole result is the integer it is and 150 / 250 is 0.6, not the 0 of SQLite`s integer division; a quotient is read over the rows whose divisor is not zero. ^ is no operator of SQL, so it is power of the two, rounded to twelve places to shed what a REAL adds and cast to NUMERIC through its text, so a whole result is the integer a decimal column would hold. The kernel`s own reading of a recipe in memory (k:rp_calc) computes the same values (k:d_val).",
DEF("k:rq_calc",
S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(3), N(1)), K(A("^")))),
S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S(A("CONS"), K(A("SELECT t.*, CAST(CAST(ROUND(power(t.c")), S3(A("COMP"), N(4), N(1)), K(A(", t.c")), S3(A("COMP"), N(5), N(1)), K(A("), 12) AS TEXT) AS NUMERIC) AS c")), S3(A("COMP"), A("+"), S3(A("CONS"), S3(A("COMP"), A("k:rq_ar"), S3(A("CONS"), S3(A("COMP"), N(2), N(1)), N(2))), K(N(1)))), K(A(" FROM (")), S3(A("COMP"), A("k:rq"), S3(A("CONS"), S3(A("COMP"), N(2), N(1)), N(2))), K(A(") t"))))),
S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S9(A("CONS"), K(A("SELECT t.*, ")), S3(A("COMP"), A("k:dec_sql"), S4(A("CONS"), S3(A("COMP"), N(3), N(1)), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S3(A("CONS"), K(A("t.c")), S3(A("COMP"), N(4), N(1))))), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S3(A("CONS"), K(A("t.c")), S3(A("COMP"), N(5), N(1))))))), K(A(" AS c")), S3(A("COMP"), A("+"), S3(A("CONS"), S3(A("COMP"), A("k:rq_ar"), S3(A("CONS"), S3(A("COMP"), N(2), N(1)), N(2))), K(N(1)))), K(A(" FROM (")), S3(A("COMP"), A("k:rq"), S3(A("CONS"), S3(A("COMP"), N(2), N(1)), N(2))), K(A(") t")), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(3), N(1)), K(A("/")))), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S4(A("CONS"), K(A(" WHERE CAST(t.c")), S3(A("COMP"), N(5), N(1)), K(A(" AS NUMERIC) <> 0"))))), K(A("")))))))),
"THE EXACT ARITHMETIC OF A CALCULATED COLUMN, SAID IN SQL AS LAMBDA COMPUTES IT (lambda`s view: sqlite:dec_sql). <op, SQL of a, SQL of b> to the SQL of a scalar subquery whose value is a + b, a - b, a * b or a / b, op one of + - * /. Each operand is read as the decimal its text spells (k:dec_ms): a number as the text SQLite prints it, a stored text as the number it spells, a whole mantissa and a scale apiece, brought to one scale. The sum and the difference are those of the aligned mantissas, the product that of the mantissas at the sum of the scales, and the quotient long division over the aligned mantissas, digit by digit (k:dec_op): fourteen significant digits, fourteen fraction digits under 1, rounded half away from zero on the digit after them, as dec:div keeps them. The result is written as its digits and point with the trailing zeros off, so a whole value is the integer it is (2988 / 12 is 249, 2.5 times 0.4 is 1), and cast to NUMERIC through that text (k:dec_txt). Every step is an integer, so nothing is rounded that lambda does not round: in a double 1000000.1 minus 1000000 is 0.0999999999767169 and 26154 / 9339 rounds to 2.8005139736589, where both are 0.1 and 2.8005139736588. A REAL column holds fifteen significant digits, so a value of more is not held exactly in or out of one.",
DEF("k:dec_sql",
S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S9(A("CONS"), K(A("(WITH RECURSIVE dv(i, tx) AS (SELECT 1, CAST(CAST(")), N(2), K(A(" AS NUMERIC) AS TEXT) UNION ALL SELECT 2, CAST(CAST(")), N(3), K(A(" AS NUMERIC) AS TEXT)), ")), A("k:dec_ms"), S3(A("COMP"), A("k:dec_op"), N(1)), A("k:dec_txt"))))),
"The two operands, dv`s rows 1 and 2, as decimals: a text in exponent notation cut at its e (dw), its digits read as one integer m and its scale s the count after the point less the exponent (du), a negative scale multiplied into the mantissa (dm: ma, sa and mb, sb), and the two at the greater scale (da: a, b, s). Ten to a power is the integer of a one and that many zeros.",
DEF("k:dec_ms",
K(A("dw(i, mt, ex) AS (SELECT i, CASE instr(tx, 'e') WHEN 0 THEN tx ELSE substr(tx, 1, instr(tx, 'e') - 1) END, CASE instr(tx, 'e') WHEN 0 THEN 0 ELSE CAST(substr(tx, instr(tx, 'e') + 1) AS INTEGER) END FROM dv), du(i, m, s) AS (SELECT i, CAST(replace(mt, '.', '') AS INTEGER), CASE instr(mt, '.') WHEN 0 THEN 0 ELSE length(mt) - instr(mt, '.') END - ex FROM dw), dm(ma, sa, mb, sb) AS (SELECT sum(CASE i WHEN 1 THEN m * CAST(substr('1000000000000000000', 1, 1 + max(0, -s)) AS INTEGER) END), sum(CASE i WHEN 1 THEN max(0, s) END), sum(CASE i WHEN 2 THEN m * CAST(substr('1000000000000000000', 1, 1 + max(0, -s)) AS INTEGER) END), sum(CASE i WHEN 2 THEN max(0, s) END) FROM du), da(a, b, s) AS (SELECT ma * CAST(substr('1000000000000000000', 1, 1 + max(sa, sb) - sa) AS INTEGER), mb * CAST(substr('1000000000000000000', 1, 1 + max(sa, sb) - sb) AS INTEGER), max(sa, sb) FROM dm)"))),
"An operation to the step that computes it as <n, s>, the value n over ten to the s: a + b and a - b at the aligned scale; ma * mb at sa + sb; and a quotient by long division (dz: the whole quotient q of |a| by |b|, its remainder r, how many fraction digits f it keeps, whether the signs differ; dd: one digit per step, f + 1 of them; dn: the last digit rounding the others half away from zero, the sign put back).",
DEF("k:dec_op",
S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), A("id"), K(A("+")))), K(A(", dn(n, s) AS (SELECT a + b, s FROM da) ")), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), A("id"), K(A("-")))), K(A(", dn(n, s) AS (SELECT a - b, s FROM da) ")), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), A("id"), K(A("*")))), K(A(", dn(n, s) AS (SELECT ma * mb, sa + sb FROM dm) ")), K(A(", dz(q, r, b, f, ng) AS (SELECT abs(a) / abs(b), abs(a) % abs(b), abs(b), CASE WHEN abs(a) / abs(b) = 0 THEN 14 WHEN length(abs(a) / abs(b)) < 14 THEN 14 - length(abs(a) / abs(b)) ELSE 0 END, (a < 0) <> (b < 0) FROM da), dd(k, q, r) AS (SELECT 0, q, r FROM dz UNION ALL SELECT dd.k + 1, dd.q * 10 + dd.r * 10 / dz.b, dd.r * 10 % dz.b FROM dd, dz WHERE dd.k <= dz.f), dn(n, s) AS (SELECT CASE WHEN dz.ng THEN -1 ELSE 1 END * (dd.q / 10 + CASE WHEN dd.q % 10 >= 5 THEN 1 ELSE 0 END), dz.f FROM dd, dz WHERE dd.k = dz.f + 1) ")))))),
"<n, s> as the number it is: its sign, the digits before the point and, where s is not 0, the point and s digits with the trailing zeros and a bare point off, as dec:text writes a decimal; then NUMERIC, so a whole value is an INTEGER and any other a REAL that prints as that text.",
DEF("k:dec_txt",
K(A("SELECT CAST(CASE WHEN n < 0 THEN '-' ELSE '' END || (abs(n) / CAST(substr('1000000000000000000', 1, 1 + s) AS INTEGER)) || CASE WHEN s > 0 THEN rtrim(rtrim('.' || printf('%0*d', s, abs(n) % CAST(substr('1000000000000000000', 1, 1 + s) AS INTEGER)), '0'), '.') ELSE '' END AS NUMERIC) FROM dn)"))),
"<recipe, D> to the number of its columns.",
DEF("k:rq_ar",
S4(A("COND"), S3(A("COMP"), A("atom"), N(1)), S3(A("COMP"), A("k:arity"), S3(A("CONS"), N(1), N(2))), S4(A("COND"), S3(A("COMP"), A("k:has"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), K(S1(A("proj"))))), S3(A("COMP"), A("length"), S3(A("COMP"), N(3), N(1))), S4(A("COND"), S3(A("COMP"), A("k:has"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), K(S1(A("joinon"))))), S3(A("COMP"), A("length"), S3(A("COMP"), N(5), N(1))), S4(A("COND"), S3(A("COMP"), A("k:has"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), K(S2(A("pairwith"), A("calc"))))), S3(A("COMP"), A("+"), S3(A("CONS"), S3(A("COMP"), A("k:rq_ar"), S3(A("CONS"), S3(A("COMP"), N(2), N(1)), N(2))), K(N(1)))), S3(A("COMP"), A("k:rq_ar"), S3(A("CONS"), S3(A("COMP"), N(2), N(1)), N(2)))))))),
"<map, D> to D with what a statement is written from, bound once: its map, the heads on a cycle of heads, the roles outside the fact types read by rule, and the types a reference hands instances to.",
DEF("k:with_sqlmap",
S3(A("COMP"), S3(A("COMP"), A("cat"), S3(A("CONS"), N(2), S8(A("CONS"), S4(A("CONS"), K(A("CELL")), K(A("RULESBY")), S3(A("COMP"), A("k:by_key"), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("RULES")), N(2))))), S4(A("CONS"), K(A("CELL")), K(A("MAP")), N(1)), S4(A("CONS"), K(A("CELL")), K(A("CYC")), S3(A("COMP"), A("k:rp_cycle"), N(2))), S4(A("CONS"), K(A("CELL")), K(A("NONRULED")), S3(A("COMP"), A("k:nonruled"), N(2))), S4(A("CONS"), K(A("CELL")), K(A("JUMPS")), S3(A("COMP"), A("k:jump_tab"), N(2))), S4(A("CONS"), K(A("CELL")), K(A("MAPBY")), S3(A("COMP"), A("k:by_key"), S3(A("COMP"), S2(A("ALPHA"), S3(A("CONS"), N(1), A("id"))), S3(A("COMP"), N(1), N(1))))), S4(A("CONS"), K(A("CELL")), K(A("NRBY")), S3(A("COMP"), A("k:by_key"), S3(A("COMP"), S2(A("ALPHA"), S3(A("CONS"), N(4), A("id"))), S3(A("COMP"), A("k:nonruled"), N(2)))))))), S3(A("CONS"), N(1), A("k:with_scatter")))),
"<D> to the heads a head its recipes read reaches back to, each by the closure of what reads what.",
DEF("k:rp_cycle",
S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), N(1), N(2))), S2(A("CONS"), N(1)), K(PHI()))), S3(A("COMP"), A("k:r_cc"), A("k:rq_edges"))))),
DEF("k:rq_edges",
S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), S3(A("COMP"), A("distl"), S3(A("CONS"), N(1), S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), A("k:rp_deps")), S4(A("COMP"), N(2), N(2), N(2))))))), S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(1), N(2)), K(A("k:rule_rp")))), S2(A("CONS"), A("id")), K(PHI()))), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("RULES")), A("id")))))))),
"A RUN OF MANY STATEMENTS WRITES FROM TABLES BOUND ONCE, as V reads over its own (k:with_tabs): each fact type`s place, each type`s instances, and instance-of (k:with_iof). A single statement over a D without them computes what it needs. <f, D> to f`s place, # for a fact type the bound places do not hold, which D does not declare.",
DEF("k:d_place",
S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("PLACES")), N(2))), K(A("#")))), A("k:d_place0"), S3(A("COMP"), S4(A("COND"), A("null"), K(A("#")), A("id")), S3(A("COMP"), A("k:bs"), S3(A("CONS"), N(1), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("PLACES")), N(2)))))))),
DEF("k:inst_sql",
S4(A("COND"), S3(A("COMP"), A("k:atv"), N(2)), A("k:inst_sql0"), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("INSTS")), N(2))), K(A("#")))), A("k:inst_sql0"), S3(A("COMP"), A("k:assoc"), S3(A("CONS"), N(1), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("INSTS")), N(2)))))))),
DEF("k:with_places",
S3(A("COMP"), A("apndl"), S3(A("CONS"), S4(A("CONS"), K(A("CELL")), K(A("PLACES")), S3(A("COMP"), A("k:msort"), S3(A("COMP"), S2(A("ALPHA"), S3(A("CONS"), N(1), A("k:d_place0"))), S3(A("COMP"), A("distr"), S3(A("CONS"), S3(A("COMP"), A("k:dedup"), S3(A("COMP"), S2(A("ALPHA"), N(2)), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("ROLES")), A("id"))))), A("id")))))), A("id")))),
DEF("k:with_insts",
S3(A("COMP"), A("apndl"), S3(A("CONS"), S4(A("CONS"), K(A("CELL")), K(A("INSTS")), S3(A("COMP"), S2(A("ALPHA"), S3(A("CONS"), N(1), A("k:inst_sql0"))), S3(A("COMP"), A("distr"), S3(A("CONS"), A("k:otypes"), A("id"))))), A("id")))),
"V AS SQL. k:vsql <constraint, D> writes the statement whose rows are the bindings that offend the constraint, as the families have them (THE FAMILIES), over the SELECTs of k:fsql, # where no family takes it; k:Vs <D> answers <constraint, modality, binding> for each, as k:V does, each value as its text. The database is P: the rows the kernel mints and no table holds are not in it. k:v_uses <c, D> says whether a statement reads instance-of, by the fact types its constraint spans.",
DEF("k:v_uses",
S3(A("COMP"), A("k:has"), S3(A("CONS"), K(A("T")), S3(A("COMP"), S2(A("ALPHA"), A("k:uses")), S3(A("COMP"), A("distr"), S3(A("CONS"), S3(A("COMP"), A("k:dedup"), A("k:c_fts")), N(2))))))),
DEF("k:vs_tab",
K(S(S2(A("UC"), A("k:vs_uc")), S2(A("MC"), A("k:vs_mc")), S2(A("IR"), A("k:vs_ring")), S2(A("AS"), A("k:vs_ring")), S2(A("AT"), A("k:vs_ring")), S2(A("SY"), A("k:vs_ring")), S2(A("IT"), A("k:vs_ring")), S2(A("AC"), A("k:vs_ring")), S2(A("TR"), A("k:vs_ring")), S2(A("RF"), A("k:vs_ring")), S2(A("SS"), A("k:vs_sc")), S2(A("EQ"), A("k:vs_sc")), S2(A("XC"), A("k:vs_sc")), S2(A("FC"), A("k:vs_fc")), S2(A("VC"), A("k:vs_vc")), S2(A("DF_pop"), A("k:vs_dp"))))),
DEF("k:vsql",
S3(A("COMP"), S4(A("COND"), S3(A("COMP"), A("null"), N(2)), K(A("#")), S3(A("COMP"), A("apply"), S3(A("CONS"), N(2), N(1)))), S3(A("CONS"), A("id"), S3(A("COMP"), A("k:assoc"), S3(A("CONS"), S3(A("COMP"), N(2), N(1)), A("k:vs_tab")))))),
DEF("k:Vs",
S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), A("k:vs1")), S3(A("COMP"), A("distr"), S3(A("CONS"), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("CONSTRAINTS")), A("id"))), A("k:with_iof")))))),
DEF("k:vs1",
S3(A("COMP"), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), N(2), K(A("#")))), K(PHI()), S3(A("COMP"), S2(A("ALPHA"), S4(A("CONS"), S3(A("COMP"), N(1), N(1)), S3(A("COMP"), N(3), N(1)), N(2))), S3(A("COMP"), A("distl"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), S3(A("COMP"), A("k:q"), S3(A("CONS"), S3(A("COMP"), A("k:stmt"), S4(A("CONS"), N(2), S3(A("COMP"), A("k:v_uses"), N(1)), S3(A("COMP"), N(2), N(1)))), S3(A("COMP"), N(2), N(1)))))))), S3(A("CONS"), A("id"), A("k:vsql")))),
"<key columns, a SELECT, its number of columns> to the rows whose key some other row shares.",
DEF("k:vs_uniq",
S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S(A("CONS"), K(A("SELECT ")), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A(", ")), S3(A("COMP"), S2(A("ALPHA"), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S3(A("CONS"), K(A("c")), A("id"))))), S3(A("COMP"), A("k:iota"), N(3))))), K(A(" FROM (SELECT *, count(*) OVER (PARTITION BY ")), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A(", ")), S3(A("COMP"), S2(A("ALPHA"), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S3(A("CONS"), K(A("c")), A("id"))))), N(1)))), K(A(") AS k_n FROM (SELECT DISTINCT * FROM (")), N(2), K(A(")")), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), N(4), K(A("#")))), K(A("")), S4(A("COND"), S3(A("COMP"), A("k:atv"), N(4)), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S4(A("CONS"), K(A(" WHERE c")), S3(A("COMP"), N(1), N(1)), K(A(" IN k_v"))))), K(A("")))), K(A(")) WHERE k_n > 1")))))),
DEF("k:vs_uc",
S4(A("COND"), S3(A("COMP"), A("k:ft1"), N(1)), S3(A("COMP"), A("k:vs_uniq"), S5(A("CONS"), S3(A("COMP"), S2(A("ALPHA"), N(2)), S3(A("COMP"), N(4), N(1))), S3(A("COMP"), A("k:fsql"), S3(A("CONS"), S5(A("COMP"), N(1), N(1), N(4), N(1)), N(2))), S3(A("COMP"), A("k:arity"), S3(A("CONS"), S5(A("COMP"), N(1), N(1), N(4), N(1)), N(2))), N(2))), S4(A("COND"), S3(A("COMP"), A("k:all"), S3(A("COMP"), S2(A("ALPHA"), A("k:binary")), S3(A("COMP"), A("distr"), S3(A("CONS"), S3(A("COMP"), N(4), N(1)), N(2))))), A("k:vs_ucx"), K(A("#"))))),
"An external uniqueness: the binary fact types joined on the role each does not span, <entity, values..>, whose values must not repeat.",
DEF("k:vs_ucx",
S3(A("COMP"), A("k:vs_uniq"), S5(A("CONS"), S3(A("COMP"), A("k:iota1"), S3(A("COMP"), A("length"), S3(A("COMP"), N(4), N(1)))), A("k:vs_join"), S3(A("COMP"), A("+"), S3(A("CONS"), S3(A("COMP"), A("length"), S3(A("COMP"), N(4), N(1))), K(N(1)))), K(A("#"))))),
"<<f, n>, D> to <the role n does not span, the role it spans>.",
DEF("k:vs_ev",
S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S8(A("CONS"), K(A("SELECT c")), S3(A("COMP"), A("-"), S3(A("CONS"), K(N(3)), S3(A("COMP"), N(2), N(1)))), K(A(" AS c1, c")), S3(A("COMP"), N(2), N(1)), K(A(" AS c2 FROM (")), S3(A("COMP"), A("k:fsql"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), N(2))), K(A(")")))))),
"Each side is materialized: SQLite flattens a subquery into its join, and a key that is then an expression cannot be indexed, so the join reads every pair. MEASURED: the external uniqueness over instance-of`s links read 31,000 by 31,000 rows and did not finish in 15 s.",
DEF("k:vs_join",
S3(A("COMP"), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S7(A("CONS"), K(A("WITH ")), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A(", ")), S3(A("COMP"), S2(A("ALPHA"), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S6(A("CONS"), K(A("a")), N(2), K(A(" AS MATERIALIZED (")), N(1), K(A(")")))))), N(1)))), K(A(" SELECT a1.c1 AS c1, ")), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A(", ")), S3(A("COMP"), S2(A("ALPHA"), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S5(A("CONS"), K(A("a")), N(2), K(A(".c2 AS c")), S3(A("COMP"), A("+"), S3(A("CONS"), N(2), K(N(1)))))))), N(1)))), K(A(" FROM ")), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A(" JOIN ")), S3(A("COMP"), S2(A("ALPHA"), A("k:vs_jt")), N(1))))))), S2(A("CONS"), S3(A("COMP"), A("k:idx"), S3(A("COMP"), S2(A("ALPHA"), A("k:vs_ev")), S3(A("COMP"), A("distr"), S3(A("CONS"), S3(A("COMP"), N(4), N(1)), N(2)))))))),
"<a SELECT, its position> to a source of the join.",
DEF("k:vs_jt",
S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), N(2), K(N(1)))), K(A("a1")), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S6(A("CONS"), K(A("a")), N(2), K(A(" ON a")), N(2), K(A(".c1 = a1.c1"))))))),
"THE MANDATORY A VALUE TYPE IMPLIES HAS NO OFFENDER. A value has no identity: it is an instance of its value type while some role holds it and no longer one after its last use (k:vd_sql), so that each instance of a value type plays a role is how its instances are counted, and no write can break it. Halpin says it of every implied mandatory: each primitive object must play some role, and the constraint is enforced by the population being what plays one, so it has no implementation of its own (Information Modeling and Relational Databases, 5.2). The constraint the reader implies for the type spans less than that count reads: it leaves out the roles of a fact type marked fully derived or derived and stored, and a Function`s cache is marked so. A value a Source gives and no other fact holds -- a subject, a sender`s address -- was therefore answered as an instance that fills none of the spanned roles, and the write that brought it was refused, though the fact it came in holds it. So both judges of a mandatory, k:f_mc in memory and k:vs_mc in SQL, answer no offender for a mandatory that a value type implies; one a modeler declares over a value type`s role, and one an entity type implies, are judged as before, since an entity may stand by its reference alone and play no role. k:mc_ofvalue <constraint, D> says whether some Object Type that implies the constraint (Object Type implies mandatory Constraint) is a value type (k:vd_is); a D that holds no such fact answers F.",
DEF("k:mc_ofvalue",
S3(A("COMP"), A("k:has"), S3(A("CONS"), K(A("T")),
S4(A("COMP"), S2(A("ALPHA"), S3(A("COMP"), A("k:vd_is"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), N(2)))), A("distr"),
S3(A("CONS"), S3(A("COMP"), A("k:p_rows_at"), S5(A("CONS"), K(A("ObjectTypeImpliesMandatoryConstraint")), K(N(2)), S3(A("COMP"), N(1), N(1)), N(2))), N(2)))))),
DEF("k:vs_mc",
S4(A("COND"), A("k:mc_ofvalue"), K(A("SELECT NULL AS c1 WHERE 0")), A("k:vs_mc1"))),
DEF("k:vs_mc1",
S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S6(A("CONS"), K(A("SELECT c1 FROM (")), S3(A("COMP"), A("k:inst_sql"), S3(A("CONS"), S3(A("COMP"), A("k:player"), S3(A("CONS"), S4(A("COMP"), N(1), N(4), N(1)), N(2))), N(2))), K(A(") EXCEPT SELECT c1 FROM (")), S3(A("COMP"), A("k:union_sql"), S3(A("COMP"), S2(A("ALPHA"), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S6(A("CONS"), K(A("SELECT c")), S3(A("COMP"), N(2), N(1)), K(A(" AS c1 FROM (")), S3(A("COMP"), A("k:fsql"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), N(2))), K(A(")")))))), S3(A("COMP"), A("distr"), S3(A("CONS"), S3(A("COMP"), N(4), N(1)), N(2))))), K(A(")")))))),
DEF("k:vs_ring",
S4(A("COND"), S3(A("COMP"), A("k:all"), S3(A("CONS"), S3(A("COMP"), A("k:ft1"), N(1)), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), A("length"), S3(A("COMP"), N(4), N(1))), K(N(2)))))), S3(A("COMP"), A("apply"), S3(A("CONS"), S3(A("COMP"), A("k:assoc"), S3(A("CONS"), S3(A("COMP"), N(2), N(1)), A("k:vs_rtab"))), S3(A("COMP"), A("k:fsql"), S3(A("CONS"), S5(A("COMP"), N(1), N(1), N(4), N(1)), N(2))))), K(A("#")))),
DEF("k:vs_rtab",
K(S8(S2(A("IR"), A("k:vr_ir")), S2(A("AS"), A("k:vr_as")), S2(A("AT"), A("k:vr_at")), S2(A("SY"), A("k:vr_sy")), S2(A("IT"), A("k:vr_it")), S2(A("AC"), A("k:vr_ac")), S2(A("TR"), A("k:vr_tr")), S2(A("RF"), A("k:vr_rf"))))),
DEF("k:vr_ir",
S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S4(A("CONS"), K(A("SELECT DISTINCT c1, c2 FROM (")), A("id"), K(A(") WHERE c1 = c2")))))),
DEF("k:vr_as",
S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S6(A("CONS"), K(A("SELECT DISTINCT t.c1, t.c2 FROM (")), A("id"), K(A(") t JOIN (")), A("id"), K(A(") u ON u.c1 = t.c2 AND u.c2 = t.c1")))))),
DEF("k:vr_at",
S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S3(A("CONS"), A("k:vr_as"), K(A(" WHERE t.c1 <> t.c2")))))),
DEF("k:vr_sy",
S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S6(A("CONS"), K(A("SELECT c1, c2 FROM (")), A("id"), K(A(") EXCEPT SELECT c2, c1 FROM (")), A("id"), K(A(")")))))),
DEF("k:vr_it",
S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S8(A("CONS"), K(A("SELECT c1, c2 FROM (")), A("id"), K(A(") INTERSECT SELECT x.c1, y.c2 FROM (")), A("id"), K(A(") x JOIN (")), A("id"), K(A(") y ON x.c2 = y.c1")))))),
DEF("k:vr_ac",
S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S6(A("CONS"), K(A("WITH RECURSIVE r(a, b) AS (SELECT c1, c2 FROM (")), A("id"), K(A(") UNION SELECT r.a, s.c2 FROM r JOIN (")), A("id"), K(A(") s ON r.b = s.c1) SELECT a AS c1, b AS c2 FROM r WHERE a = b")))))),
"A TRANSITIVE RING IS BROKEN BY A PAIR THAT IS MISSING, AND A REFLEXIVE ONE TOO. The other rings forbid rows, and what offends one is a row that is there. A transitive ring asks for a row: where x R y and y R z, x R z, so its offenders are the pairs the fact type composed with itself gives that it does not hold. A reflexive ring asks that what plays its first role is related to itself, so its offenders are x, x for each x that is first in some row and in none with itself. <the fact type`s SELECT> to the SELECT of the missing pairs.",
DEF("k:vr_tr",
S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S8(A("CONS"), K(A("SELECT x.c1 AS c1, y.c2 AS c2 FROM (")), A("id"), K(A(") x JOIN (")), A("id"), K(A(") y ON x.c2 = y.c1 EXCEPT SELECT c1, c2 FROM (")), A("id"), K(A(")")))))),
DEF("k:vr_rf",
S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S6(A("CONS"), K(A("SELECT DISTINCT c1, c1 AS c2 FROM (")), A("id"), K(A(") EXCEPT SELECT c1, c2 FROM (")), A("id"), K(A(")")))))),
"<a sequence of <f, n>, D> to the SELECT of those columns of one fact type, # across several.",
DEF("k:vs_side",
S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), A("length"), S3(A("COMP"), A("k:dedup"), S3(A("COMP"), S2(A("ALPHA"), N(1)), N(1)))), K(N(1)))), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S6(A("CONS"), K(A("SELECT DISTINCT ")), S3(A("COMP"), A("k:cols_as"), S3(A("COMP"), S2(A("ALPHA"), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S3(A("CONS"), K(A("c")), N(2))))), N(1))), K(A(" FROM (")), S3(A("COMP"), A("k:fsql"), S3(A("CONS"), S4(A("COMP"), N(1), N(1), N(1)), N(2))), K(A(")"))))), K(A("#")))),
DEF("k:vs_sc",
S4(A("COND"), S3(A("COMP"), A("null"), S3(A("COMP"), N(6), N(1))), S3(A("COMP"), A("k:vs_sc2"), S4(A("CONS"), S3(A("COMP"), N(2), N(1)), S3(A("COMP"), A("k:vs_side"), S3(A("CONS"), S3(A("COMP"), N(4), N(1)), N(2))), S3(A("COMP"), A("k:vs_side"), S3(A("CONS"), S3(A("COMP"), N(5), N(1)), N(2))))), S4(A("COND"), A("k:sc_can"), S3(A("COMP"), A("k:vs_sc2"), S4(A("CONS"), S3(A("COMP"), N(2), N(1)), S3(A("COMP"), A("k:rq"), S3(A("CONS"), S3(A("COMP"), N(1), A("k:dp_rs")), N(2))), S3(A("COMP"), A("k:rq"), S3(A("CONS"), S3(A("COMP"), N(2), A("k:dp_rs")), N(2))))), K(A("#"))))),
"<constraint> to whether its sixth field is two recipes, one for each argument of a set comparison (k:sc_rs): the family compares the rows they read, each restriction said at its source (k:dp_rs), the constraint is reached through what they read and not through the roles it spans (k:c_fts), and it reads whole where one of them joins (k:sc_joins).",
DEF("k:sc_two",
S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), A("length"), N(6)), K(N(2)))), S3(A("COMP"), A("k:all"), S3(A("COMP"), S2(A("ALPHA"), A("k:rec1")), N(6))), K(A("F")))),
"A SET COMPARISON IS SAID IN SQL ONLY OVER WHAT THE DATABASE READS, AND ONLY WHERE ITS SPANS SAY ITS JOINS. A fact type the map places nowhere and no rule of RULES reads is one the store computes on read by a form the kernel does not read, a comparison or an arithmetic, and its SELECT here is of no rows (k:fsql_s): as the second argument of a subset it would answer every row of the first as a violation. And a constraint filed at the compared roles alone, its join path not spanned, reads back to a join on nothing, or to one whose columns are not its sources`: MEASURED on a copy of an app`s store, one deontic subset over two link roles read back to the product of two fact types, each taken at its first columns. <constraint, D> to whether it is a set comparison with two recipes that read only fact types with a place or a rule, one type`s instances read as that type`s (k:rq_sel), and whose every join joins on some pair and keeps as many columns as its two sources have; k:rq_can <recipe, D> one recipe. Where it is not, the statement is #, and the constraint stays unjudged, as lambda`s boot leaves a check SQL cannot say (delta:bt_one).",
DEF("k:sc_can",
S4(A("COND"), S3(A("COMP"), A("k:sc_two"), N(1)), S3(A("COMP"), A("k:all"), S3(A("COMP"), S2(A("ALPHA"), A("k:rq_can")), S3(A("COMP"), A("distr"), S3(A("CONS"), A("k:dp_rs"), N(2))))), K(A("F")))),
DEF("k:rq_can",
S4(A("COND"), S3(A("COMP"), A("atom"), N(1)), S4(A("COND"), S3(A("COMP"), A("k:rec1"), S3(A("COMP"), A("k:d_place"), S3(A("CONS"), N(1), N(2)))), K(A("T")), S3(A("COMP"), A("not"), S3(A("COMP"), A("null"), S3(A("COMP"), A("k:rule_of"), S3(A("CONS"), N(1), N(2)))))), S4(A("COND"), S3(A("COMP"), A("k:all"), S4(A("CONS"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), K(A("sel")))), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(2), N(1)), K(A("ObjectTypeInstanceIsInstanceOfObjectType")))), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(3), N(1)), K(N(2)))))), K(A("T")), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), K(A("joinon")))), S3(A("COMP"), A("k:all"), S5(A("CONS"), S3(A("COMP"), A("not"), S3(A("COMP"), A("null"), S3(A("COMP"), N(4), N(1)))), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), A("length"), S3(A("COMP"), N(5), N(1))), S3(A("COMP"), A("+"), S3(A("CONS"), S3(A("COMP"), A("k:rq_ar"), S3(A("CONS"), S3(A("COMP"), N(2), N(1)), N(2))), S3(A("COMP"), A("k:rq_ar"), S3(A("CONS"), S3(A("COMP"), N(3), N(1)), N(2))))))), S3(A("COMP"), A("k:rq_can"), S3(A("CONS"), S3(A("COMP"), N(2), N(1)), N(2))), S3(A("COMP"), A("k:rq_can"), S3(A("CONS"), S3(A("COMP"), N(3), N(1)), N(2))))), S3(A("COMP"), A("k:all"), S3(A("COMP"), S2(A("ALPHA"), A("k:rq_can")), S3(A("COMP"), A("distr"), S3(A("CONS"), S3(A("COMP"), A("k:rp_src"), N(1)), N(2))))))))),
DEF("k:vs_sc2",
S4(A("COND"), S3(A("COMP"), A("not"), S3(A("COMP"), A("k:all"), S3(A("CONS"), S3(A("COMP"), A("not"), S3(A("COMP"), A("eq"), S3(A("CONS"), N(2), K(A("#"))))), S3(A("COMP"), A("not"), S3(A("COMP"), A("eq"), S3(A("CONS"), N(3), K(A("#")))))))), K(A("#")), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), N(1), K(A("SS")))), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S4(A("CONS"), N(2), K(A(" EXCEPT ")), N(3)))), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), N(1), K(A("EQ")))), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S(A("CONS"), K(A("SELECT * FROM (")), N(2), K(A(" EXCEPT ")), N(3), K(A(") UNION ALL SELECT * FROM (")), N(3), K(A(" EXCEPT ")), N(2), K(A(")"))))), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S4(A("CONS"), N(2), K(A(" INTERSECT ")), N(3)))))))),
"A PROHIBITION IS JUDGED BY THE POPULATION IT FORBIDS. A prohibition (DF_pop) spans no role: the compile gives the population it forbids as recipes (k:dp_facts), and no family took it, so SYSTEM, which answers every write a host serves, never asked one, and a write that broke a prohibition answered committed with no violation. Its bindings are the rows of that population: k:vs_dp <constraint, D> writes their statement, the union of its recipes` SELECTs (k:rq), # where it has none, and k:f_dp answers them over a D with no database. A write reaches it through what its recipes read (k:dp_reads, in k:cby_keys and k:c_reach), and it reads whole (k:c_dirty): a recipe may join, so a row it adds need not name a value of the write.",
DEF("k:vs_dp",
S4(A("COND"), S3(A("COMP"), A("null"), S3(A("COMP"), N(6), N(1))), K(A("#")), S3(A("COMP"), A("k:union_sql"), S3(A("COMP"), S2(A("ALPHA"), A("k:rq")), S3(A("COMP"), A("distr"), S3(A("CONS"), A("k:dp_rs"), N(2))))))),
"<constraint, D> to what its recipes read (k:rq_atoms), for a prohibition and for a set comparison with two recipes; nothing for any other constraint.",
DEF("k:dp_reads",
S4(A("COND"), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(2), N(1)), K(A("DF_pop")))), K(A("T")), S3(A("COMP"), A("k:sc_two"), N(1))), S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), A("k:rq_atoms")), A("k:dp_rs"))), K(PHI()))),
"<constraint, D> to what it is read through: the fact types it spans and what a prohibition`s recipes read, and for a set comparison with two recipes what they read alone, since a role it spans may be one of instance-of, which every write reaches, where its recipe reads one type`s instances.",
DEF("k:c_fts",
S4(A("COND"), S3(A("COMP"), A("k:sc_two"), N(1)), A("k:dp_reads"), S3(A("COMP"), A("cat"), S3(A("CONS"), S3(A("COMP"), S2(A("ALPHA"), N(1)), S3(A("COMP"), A("cat"), S3(A("CONS"), S3(A("COMP"), N(4), N(1)), S3(A("COMP"), N(5), N(1))))), A("k:dp_reads"))))),
"A RESTRICTION OF A JOIN IS SAID AT THE SOURCE ITS COLUMN COMES FROM. The compile restricts a role to a subtype by joining instance-of and selecting the type from the joined rows, so the recipe as it stands reads instance-of whole: every write reaches it, since any fact may file an instance, and its program keeps every type`s instances, twice. MEASURED on a store of 283 object types, two such prohibitions in it: a write of any fact type, 17 to 21 s where it took 2 to 3. The restriction of a join at a column is the join of that source restricted there, and instance-of restricted to one type is that type`s instances (k:rq_sel, k:rq_atoms), read at no table. <constraint, D> to its recipes so said; k:rq_dn <recipe, D> one recipe.",
DEF("k:dp_rs",
S3(A("COMP"), S2(A("ALPHA"), A("k:rq_dn")), S3(A("COMP"), A("distr"), S3(A("CONS"), S3(A("COMP"), N(6), N(1)), N(2))))),
DEF("k:rq_dn",
S4(A("COND"), S3(A("COMP"), A("atom"), N(1)), N(1), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), K(A("sel")))), S3(A("COMP"), A("k:rq_ds"), S5(A("CONS"), S3(A("COMP"), A("k:rq_dn"), S3(A("CONS"), S3(A("COMP"), N(2), N(1)), N(2))), S3(A("COMP"), N(3), N(1)), S3(A("COMP"), N(4), N(1)), N(2))), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), K(A("proj")))), S4(A("CONS"), K(A("proj")), S3(A("COMP"), A("k:rq_dn"), S3(A("CONS"), S3(A("COMP"), N(2), N(1)), N(2))), S3(A("COMP"), N(3), N(1))), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), K(A("joinon")))), S6(A("CONS"), K(A("joinon")), S3(A("COMP"), A("k:rq_dn"), S3(A("CONS"), S3(A("COMP"), N(2), N(1)), N(2))), S3(A("COMP"), A("k:rq_dn"), S3(A("CONS"), S3(A("COMP"), N(3), N(1)), N(2))), S3(A("COMP"), N(4), N(1)), S3(A("COMP"), N(5), N(1))), N(1)))))),
"<source, n, v, D> to the source restricted at its n-th column to v: a join`s at the side that column comes from.",
DEF("k:rq_ds",
S4(A("COND"), S3(A("COMP"), A("atom"), N(1)), S5(A("CONS"), K(A("sel")), N(1), N(2), N(3)), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), K(A("joinon")))), S3(A("COMP"), A("k:rq_dj"), S6(A("CONS"), N(1), S3(A("COMP"), A("apply"), S3(A("CONS"), N(2), S3(A("COMP"), N(5), N(1)))), S3(A("COMP"), A("k:rq_ar"), S3(A("CONS"), S3(A("COMP"), N(2), N(1)), N(4))), N(3), N(4))), S5(A("CONS"), K(A("sel")), N(1), N(2), N(3))))),
"<join, the column among the two sides` together, the arity of the first, v, D>.",
DEF("k:rq_dj",
S4(A("COND"), S3(A("COMP"), A("lt"), S3(A("CONS"), N(3), N(2))), S6(A("CONS"), K(A("joinon")), S3(A("COMP"), N(2), N(1)), S3(A("COMP"), A("k:rq_ds"), S5(A("CONS"), S3(A("COMP"), N(3), N(1)), S3(A("COMP"), A("-"), S3(A("CONS"), N(2), N(3))), N(4), N(5))), S3(A("COMP"), N(4), N(1)), S3(A("COMP"), N(5), N(1))), S6(A("CONS"), K(A("joinon")), S3(A("COMP"), A("k:rq_ds"), S5(A("CONS"), S3(A("COMP"), N(2), N(1)), N(2), N(4), N(5))), S3(A("COMP"), N(3), N(1)), S3(A("COMP"), N(4), N(1)), S3(A("COMP"), N(5), N(1))))),
"WHAT A WRITE CAN REACH. A row of f can add an instance to each type playing a role of f, and so to each type those instances belong to, up the subtypes and through the references (k:grow). It can change each fact type read through f or through those types, by the rules that read them (k:reach_heads). So it can newly break a constraint spanning one of those, or a mandatory on one of those types, and no other (k:reach). k:closure <start, edges> is the start and all that the <from, to> edges reach from it.",
DEF("k:closure",
S3(A("COMP"), N(1), S3(A("COMP"), S3(A("WHILE"), S3(A("COMP"), A("lt"), S3(A("CONS"), S3(A("COMP"), A("length"), N(1)), S3(A("COMP"), A("length"), S3(A("COMP"), N(1), A("k:cl_step"))))), A("k:cl_step")), S3(A("CONS"), S3(A("COMP"), A("k:dedup"), N(1)), N(2))))),
DEF("k:cl_step",
S3(A("CONS"), S3(A("COMP"), A("k:union"), S3(A("CONS"), N(1), S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("k:has"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), N(2))), S2(A("CONS"), S3(A("COMP"), N(2), N(1))), K(PHI()))), S3(A("COMP"), A("distr"), S3(A("CONS"), N(2), N(1))))))), N(2))),
"<f, D> to the types whose instances a row of f can add to.",
DEF("k:grow",
S3(A("COMP"), A("k:grow_from"), S3(A("CONS"), S3(A("COMP"), S2(A("ALPHA"), N(4)), S3(A("COMP"), A("k:rb"), S3(A("CONS"), N(1), N(2)))), N(2)))),
DEF("k:grow_from",
S3(A("COMP"), A("k:closure"), S3(A("CONS"), N(1), S3(A("COMP"), A("cat"), S3(A("CONS"), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("SUBTYPES")), N(2))), S3(A("COMP"), S2(A("ALPHA"), S3(A("CONS"), N(2), N(1))), S3(A("COMP"), A("k:tab"), S4(A("CONS"), K(A("JUMPS")), K(A("k:jump_tab")), N(2))))))))),
"A type as a node among the fact types a rule reads.",
DEF("k:ty",
S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S3(A("CONS"), K(A("type:")), A("id"))))),
"<recipe> to what it reads; selecting one type from instance-of reads that type.",
DEF("k:rq_atoms",
S4(A("COND"), A("atom"), S2(A("CONS"), A("id")), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), N(1), K(A("sel")))), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), N(2), K(A("ObjectTypeInstanceIsInstanceOfObjectType")))), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), N(3), K(N(2)))), S2(A("CONS"), S3(A("COMP"), A("k:ty"), N(4))), S2(A("CONS"), N(2))), S3(A("COMP"), A("k:rq_atoms"), N(2))), S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), A("k:rq_atoms")), A("k:rp_src")))))),
"<head, rule> to <what it reads, head> for each thing the rule reads.",
DEF("k:r_edge",
S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(1), N(2)), K(A("k:rule_link")))), S2(A("CONS"), S3(A("CONS"), S4(A("COMP"), N(2), N(2), N(2)), N(1))), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(1), N(2)), K(A("k:rule_xx")))), S2(A("CONS"), S3(A("CONS"), S3(A("COMP"), A("k:ty"), S3(A("COMP"), N(2), N(2))), N(1))), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(1), N(2)), K(A("k:rule_inst")))), K(PHI()), S3(A("COMP"), S2(A("ALPHA"), S3(A("CONS"), N(1), N(2))), S3(A("COMP"), A("distr"), S3(A("CONS"), S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), A("k:rq_atoms")), S4(A("COMP"), N(2), N(2), N(2)))), N(1)))))))),
"<f, D, the types it grows> to the fact types read through them, f and instance-of among them.",
DEF("k:reach_heads",
S3(A("COMP"), A("k:closure"), S3(A("CONS"), S3(A("COMP"), A("apndl"), S3(A("CONS"), N(1), S3(A("COMP"), A("apndl"), S3(A("CONS"), K(A("ObjectTypeInstanceIsInstanceOfObjectType")), S3(A("COMP"), S2(A("ALPHA"), A("k:ty")), N(3)))))), S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), A("k:r_edge")), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("RULES")), N(2)))))))),
"<constraint, <heads, types, D>> to whether a write that changes those can newly break it.",
DEF("k:c_reach",
S4(A("COND"), S3(A("COMP"), A("k:has"), S3(A("CONS"), K(A("T")), S3(A("COMP"), S2(A("ALPHA"), S3(A("COMP"), A("k:has"), S3(A("CONS"), N(1), S3(A("COMP"), N(1), N(2))))), S3(A("COMP"), A("distr"), S3(A("CONS"), S3(A("COMP"), A("k:c_fts"), S3(A("CONS"), N(1), S3(A("COMP"), N(3), N(2)))), N(2)))))), K(A("T")), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(2), N(1)), K(A("MC")))), S3(A("COMP"), A("k:has"), S3(A("CONS"), S3(A("COMP"), A("k:player"), S3(A("CONS"), S4(A("COMP"), N(1), N(4), N(1)), S3(A("COMP"), N(3), N(2)))), S3(A("COMP"), N(2), N(2)))), K(A("F"))))),
"<f, D, the types it grows> to the constraints it can reach.",
"<constraint, D> to what can reach it: each fact type it spans, for a mandatory the type that plays its first role, and for a prohibition what its recipes read (k:dp_reads).",
DEF("k:cby_keys",
S3(A("COMP"), A("cat"), S3(A("CONS"), S3(A("COMP"), A("k:dedup"), A("k:c_fts")), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(2), N(1)), K(A("MC")))), S2(A("CONS"), S3(A("COMP"), A("k:ty"), S3(A("COMP"), A("k:player"), S3(A("CONS"), S3(A("COMP"), N(1), S3(A("COMP"), N(4), N(1))), N(2))))), K(PHI()))))),
"<D> to the table <what can reach them, the constraints>.",
DEF("k:cby_make",
S3(A("COMP"), A("k:by_key"), S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), A("k:cby1")), S3(A("COMP"), A("distr"), S3(A("CONS"), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("CONSTRAINTS")), A("id"))), A("id"))))))),
DEF("k:cby1",
S3(A("COMP"), S2(A("ALPHA"), S3(A("CONS"), N(1), S3(A("COMP"), N(1), N(2)))), S3(A("COMP"), A("distr"), S3(A("CONS"), A("k:cby_keys"), A("id"))))),
DEF("k:reach1",
S4(A("COND"), S3(A("COMP"), A("not"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("CBY")), N(2))), K(A("#"))))), S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), A("k:bs")), S3(A("COMP"), A("distr"), S3(A("CONS"), S3(A("COMP"), A("k:reach_heads"), S4(A("CONS"), N(1), N(2), N(3))), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("CBY")), N(2))))))), A("k:reach0"))),
DEF("k:reach0",
S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), S4(A("COND"), A("k:c_reach"), S2(A("CONS"), N(1)), K(PHI()))), S3(A("COMP"), A("distr"), S3(A("CONS"), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("CONSTRAINTS")), N(2))), S4(A("CONS"), S3(A("COMP"), A("k:reach_heads"), S4(A("CONS"), N(1), N(2), N(3))), N(3), N(2))))))),
"<f, D> to the constraints a row of f can reach.",
DEF("k:reach",
S3(A("COMP"), A("k:reach1"), S4(A("CONS"), N(1), N(2), A("k:grow")))),
"<table, D> to its key`s columns.",
DEF("k:w_pk",
S3(A("COMP"), S2(A("ALPHA"), N(1)), S3(A("COMP"), A("k:pk_cols"), S3(A("CONS"), N(1), S3(A("COMP"), N(2), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("MAP")), N(2)))))))),
"A FACT OF AN INSTANCE IDENTIFIED BY SEVERAL VALUES IS WRITTEN BY THE ID THAT NAMES IT. A type that objectifies a fact type is identified by that fact`s roles (Halpin: an objectified fact type is an entity type whose reference scheme is its roles), so a role it plays is stored as several columns, and an instance is named by their values joined by a period, as k:qcol reads them: the Enrollment of s2 in c1 is s2.c1. A write of `Enrollment resulted in Grade` named s2.c1 and was refused as compound, since no write split the id back into its columns. k:split_dot <text> is the text`s parts between its periods; k:split_id <value, column names> those parts where there are as many as names, # where there are not or the value is no text; k:w_expand <pairs> each <columns, value> pair of a role of several columns as the pairs of its columns and parts. A value that does not split so, as one of whose values holds a period itself, is still refused as compound.",
DEF("k:split_dot",
S4(A("COMP"), S3(A("COMP"), A("apndr"), S3(A("CONS"), N(1), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), N(2))))), S3(A("WHILE"), S4(A("COMP"), A("not"), A("null"), N(3)), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(1), N(3)), K(A(".")))), S4(A("CONS"), S3(A("COMP"), A("apndr"), S3(A("CONS"), N(1), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), N(2))))), K(PHI()), S3(A("COMP"), A("tl"), N(3))), S4(A("CONS"), N(1), S3(A("COMP"), A("apndr"), S3(A("CONS"), N(2), S3(A("COMP"), N(1), N(3)))), S3(A("COMP"), A("tl"), N(3))))), S4(A("CONS"), K(PHI()), K(PHI()), A("chars")))),
DEF("k:split_id",
S4(A("COND"), S3(A("COMP"), A("atom"), N(2)), K(A("#")), S4(A("COND"), S3(A("COMP"), A("k:isnum"), N(1)), K(A("#")), S3(A("COMP"), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), A("length"), N(1)), N(2))), N(1), K(A("#"))), S3(A("CONS"), S3(A("COMP"), A("k:split_dot"), N(1)), S3(A("COMP"), A("length"), N(2))))))),
DEF("k:w_expand",
S3(A("COMP"), A("k:flat"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("atom"), N(1)), S2(A("CONS"), A("id")), S3(A("COMP"), A("trans"), S3(A("CONS"), N(1), S3(A("COMP"), A("k:split_id"), S3(A("CONS"), N(2), N(1))))))))),
DEF("k:splits_ok",
S3(A("COMP"), A("k:all"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("atom"), N(1)), K(A("T")), S4(A("COMP"), A("not"), A("eq"), S3(A("CONS"), S3(A("COMP"), A("k:split_id"), S3(A("CONS"), N(2), N(1))), K(A("#")))))))),
"AND AN INSTANCE OF AN OBJECTIFICATION OVER AN OBJECTIFIED TYPE IS ITS FACT AS ITS FACT TYPE HOLDS IT. Year Make Model objectifies Make Model is of Year, and Make Model is itself objectified, so a role Year Make Model plays is three columns and its instance m1.mk1.2020 splits into three parts, where Year Make Model`s fact holds two values, the Make Model m1.mk1 and the year. So the parts are regrouped by the objectified fact type`s own place: each of its columns takes as many parts as it has, a role of several joined by a period. k:regroup <parts, place or #> to the values, the parts as they are where there is no place or its columns are not as many as the parts; k:leaves <column or columns> to every column name in it, at any depth.",
DEF("k:regroup",
S4(A("COND"), S3(A("COMP"), A("atom"), N(2)), N(1), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), A("length"), N(1)), S5(A("COMP"), A("length"), A("k:leaves"), N(2), N(2)))), S4(A("COMP"), N(1), S3(A("WHILE"), S4(A("COMP"), A("not"), A("null"), N(3)), S3(A("COMP"), S4(A("CONS"), S3(A("COMP"), A("apndr"), S3(A("CONS"), N(1), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A(".")), S3(A("COMP"), A("k:take_h"), S3(A("CONS"), N(2), N(4))))))), S3(A("COMP"), A("k:drop_h"), S3(A("CONS"), N(2), N(4))), S3(A("COMP"), A("tl"), N(3))), S5(A("CONS"), N(1), N(2), N(3), S3(A("COMP"), A("+"), S3(A("CONS"), S3(A("COMP"), S3(A("COMP"), A("length"), A("k:leaves")), S3(A("COMP"), N(1), N(3))), K(N(1))))))), S4(A("CONS"), K(PHI()), N(1), S3(A("COMP"), N(2), N(2)))), N(1)))),
DEF("k:leaves",
S4(A("COND"), A("atom"), S2(A("CONS"), A("id")), S3(A("COMP"), A("k:flat"), S2(A("ALPHA"), A("k:leaves"))))),
"AND IT NAMES AN INSTANCE THAT IS THERE. An objectified fact type`s instances are its facts (Halpin: the objectification`s population is the fact type`s), so a fact of the Enrollment s9.c1 says something of the fact that s9 enrolled in c1, and where no such fact is there the write named nothing: absorbed beside that fact`s key, it made the row, which put s9 in c1 unasked and judged no constraint of a Student s9 it never named as a value. k:a_obj <fact, <the facts the change adds, D>> to <absent, its fact type, the value> for each role of several columns whose value names an instance neither held by the store nor added by the change: the instance is the role`s player, the type the objectified fact type is filed under, with the value`s parts (k:split_id). k:a_obj2 <fact type, values, added, D, place, roles>, k:a_obj3 <<columns, value, player>, <fact type, added, D>> and k:a_obj4 that with the parts are its steps.",
DEF("k:a_obj",
S3(A("COMP"), A("k:a_obj2"), S7(A("CONS"), S3(A("COMP"), N(1), N(1)), S3(A("COMP"), A("tl"), N(1)), S3(A("COMP"), N(1), N(2)), S3(A("COMP"), N(2), N(2)), S3(A("COMP"), A("k:d_place"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), S3(A("COMP"), N(2), N(2)))), S3(A("COMP"), A("k:rb"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), S3(A("COMP"), N(2), N(2))))))),
DEF("k:a_obj2",
S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), N(5), K(A("#")))), K(PHI()), S4(A("COND"), S4(A("COMP"), A("not"), A("k:has"), S3(A("CONS"), K(A("F")), S3(A("COMP"), S2(A("ALPHA"), A("atom")), S3(A("COMP"), N(2), N(5))))), K(PHI()), S4(A("COND"), S4(A("COMP"), A("not"), A("and"), S3(A("CONS"), S3(A("COMP"), A("eq"), S3(A("CONS"), S4(A("COMP"), A("length"), N(2), N(5)), S3(A("COMP"), A("length"), N(2)))), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), A("length"), N(6)), S3(A("COMP"), A("length"), N(2)))))), K(PHI()), S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), A("k:a_obj3")), S3(A("COMP"), A("distr"), S3(A("CONS"), S3(A("COMP"), A("trans"), S4(A("CONS"), S3(A("COMP"), N(2), N(5)), N(2), S3(A("COMP"), S2(A("ALPHA"), N(4)), N(6)))), S4(A("CONS"), N(1), N(3), N(4)))))))))),
DEF("k:a_obj3",
S4(A("COND"), S3(A("COMP"), A("atom"), S3(A("COMP"), N(1), N(1))), K(PHI()), S3(A("COMP"), A("k:a_obj4"), S4(A("CONS"), N(1), N(2), S3(A("COMP"), A("k:split_id"), S3(A("CONS"), S3(A("COMP"), N(2), N(1)), S3(A("COMP"), N(1), N(1)))))))),
DEF("k:a_obj4",
S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), N(3), K(A("#")))), K(PHI()), S4(A("COND"), S3(A("COMP"), A("k:has"), S3(A("CONS"), S3(A("COMP"), A("apndl"), S3(A("CONS"), S3(A("COMP"), N(3), N(1)), S3(A("COMP"), A("k:regroup"), S3(A("CONS"), N(3), S3(A("COMP"), A("k:d_place"), S3(A("CONS"), S3(A("COMP"), N(3), N(1)), S3(A("COMP"), N(3), N(2)))))))), S3(A("COMP"), N(2), N(2)))), K(PHI()), S4(A("COND"), S3(A("COMP"), A("k:held"), S3(A("CONS"), S3(A("COMP"), A("apndl"), S3(A("CONS"), S3(A("COMP"), N(3), N(1)), S3(A("COMP"), A("k:regroup"), S3(A("CONS"), N(3), S3(A("COMP"), A("k:d_place"), S3(A("CONS"), S3(A("COMP"), N(3), N(1)), S3(A("COMP"), N(3), N(2)))))))), S3(A("COMP"), N(3), N(2)))), K(PHI()), S2(A("CONS"), S4(A("CONS"), K(A("absent")), S3(A("COMP"), N(1), N(2)), S3(A("COMP"), N(2), N(1)))))))),
"AND A ROLE OF SEVERAL COLUMNS LISTS THEM IN THE ORDER OF THE ROLES THEY STAND FOR. An objectified instance is named by its fact`s values joined by a period in the fact type`s role order (k:link_decls0: the Enrollment of s2 in c1 is s2.c1), and a role it plays was given its columns in their table`s order, which is their names` (courseCode before studentName): a read joined them c1.s2, and a write split s2.c1 into the wrong columns, s2 a course and c1 a student. Each such column stands for a role of the objectified fact type as well (the map`s Column is for Role: courseCode for Enrollment.2), so a role`s columns are ordered by that role`s position. k:pl_order <place, <f, D>> is the place so ordered, as it was where it has no role of several columns or its columns are not one for each role; k:pl_role <<columns, player>, <table, map rows, D>> one role`s, in its player`s place`s order where that place holds every one of its columns, at any depth (k:pl_nest: an objectification over an objectified type, whose role is the columns of the inner one`s roles and its own, m1.mk1.2020 into modelName, makeName, year), else by k:pl_role0`s key; k:pl_sort <columns, <table, player, map rows>> the columns by their key, as they were where any has none; k:pl_key <column, <table, player, map rows>> the position of the player`s role the column stands for in that table, # where it stands for none.",
DEF("k:pl_order",
S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), N(1), K(A("#")))), K(A("#")), S4(A("COND"), S4(A("COMP"), A("not"), A("k:has"), S3(A("CONS"), K(A("F")), S3(A("COMP"), S2(A("ALPHA"), A("atom")), S3(A("COMP"), N(2), N(1))))), N(1), S4(A("COND"), S4(A("COMP"), A("not"), A("eq"), S3(A("CONS"), S4(A("COMP"), A("length"), N(2), N(1)), S3(A("COMP"), A("length"), S3(A("COMP"), S2(A("ALPHA"), N(4)), S3(A("COMP"), S2(A("ALPHA"), N(2)), S3(A("COMP"), A("k:msort"), S3(A("COMP"), S2(A("ALPHA"), S3(A("CONS"), N(3), A("id"))), S3(A("COMP"), A("k:rb"), S3(A("CONS"), S3(A("COMP"), N(1), N(2)), S3(A("COMP"), N(2), N(2))))))))))), N(1), S5(A("CONS"), S3(A("COMP"), N(1), N(1)), S3(A("COMP"), S2(A("ALPHA"), A("k:pl_role")), S3(A("COMP"), A("distr"), S3(A("CONS"), S3(A("COMP"), A("trans"), S3(A("CONS"), S3(A("COMP"), N(2), N(1)), S3(A("COMP"), S2(A("ALPHA"), N(4)), S3(A("COMP"), S2(A("ALPHA"), N(2)), S3(A("COMP"), A("k:msort"), S3(A("COMP"), S2(A("ALPHA"), S3(A("CONS"), N(3), A("id"))), S3(A("COMP"), A("k:rb"), S3(A("CONS"), S3(A("COMP"), N(1), N(2)), S3(A("COMP"), N(2), N(2)))))))))), S4(A("CONS"), S3(A("COMP"), N(1), N(1)), S4(A("COMP"), N(1), A("k:cell"), S3(A("CONS"), K(A("MAP")), S3(A("COMP"), N(2), N(2)))), S3(A("COMP"), N(2), N(2)))))), S3(A("COMP"), N(3), N(1)), S3(A("COMP"), N(4), N(1))))))),
DEF("k:pl_role",
S4(A("COND"), S4(A("COMP"), A("atom"), N(1), N(1)), S3(A("COMP"), N(1), N(1)), S3(A("COMP"), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), N(1), K(A("#")))), S3(A("COMP"), A("k:pl_role0"), N(2)), N(1)), S3(A("CONS"), A("k:pl_nest"), A("id"))))),
DEF("k:pl_role0",
S4(A("COND"), S3(A("COMP"), A("atom"), S3(A("COMP"), N(1), N(1))), S3(A("COMP"), N(1), N(1)), S3(A("COMP"), A("k:pl_sort"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), S4(A("CONS"), S3(A("COMP"), N(1), N(2)), S3(A("COMP"), N(2), N(1)), S3(A("COMP"), N(2), N(2))))))),
DEF("k:pl_nest",
S3(A("COMP"), S4(A("COND"), S3(A("COMP"), A("atom"), N(2)), K(A("#")), S3(A("COMP"), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), A("length"), N(1)), S3(A("COMP"), A("length"), N(2)))), N(1), K(A("#"))), S3(A("CONS"), S5(A("COMP"), A("k:flat"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("k:has"), S3(A("CONS"), N(1), N(2))), S2(A("CONS"), N(1)), K(PHI()))), A("distr"), S3(A("CONS"), N(2), N(1))), N(1)))), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), A("k:d_place"), S3(A("CONS"), S3(A("COMP"), N(2), N(1)), S3(A("COMP"), N(3), N(2)))), K(A("#")))), K(A("#")), S5(A("COMP"), A("k:leaves"), N(2), A("k:d_place"), S3(A("CONS"), S3(A("COMP"), N(2), N(1)), S3(A("COMP"), N(3), N(2)))))))),
DEF("k:pl_sort",
S3(A("COMP"), S4(A("COND"), S3(A("COMP"), A("k:has"), S3(A("CONS"), K(A("#")), S3(A("COMP"), S2(A("ALPHA"), N(1)), N(1)))), N(2), S3(A("COMP"), S2(A("ALPHA"), N(2)), S3(A("COMP"), A("k:msort"), N(1)))), S3(A("CONS"), S3(A("COMP"), S2(A("ALPHA"), S3(A("CONS"), A("k:pl_key"), N(1))), A("distr")), N(1)))),
DEF("k:pl_key",
S3(A("COMP"), S4(A("COND"), A("null"), K(A("#")), N(1)), S4(A("COMP"), A("k:flat"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("k:all"), S4(A("CONS"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(2), N(1)), S3(A("COMP"), N(1), N(2)))), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(3), N(1)), S3(A("COMP"), N(2), N(2)))), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(1), S3(A("COMP"), A("k:split_dot"), S3(A("COMP"), N(1), N(1)))), S3(A("COMP"), N(3), N(2)))))), S2(A("CONS"), S3(A("COMP"), A("1r"), S3(A("COMP"), A("k:split_dot"), S3(A("COMP"), N(1), N(1))))), K(PHI()))), S3(A("COMP"), A("distr"), S3(A("CONS"), S3(A("COMP"), N(3), N(2)), S4(A("CONS"), N(1), S3(A("COMP"), N(1), N(2)), S3(A("COMP"), N(2), N(2)))))))),
"A FACT`S WRITE. <place, row> to <column, value> for each column the fact fills, a flag its T, a reference that reads the key twice filling it once. A fact absorbed into a table fills its row by the key, the row made where none is: no table holds a required column beside its key, a mandatory being V`s to answer.",
DEF("k:w_pairs",
S3(A("COMP"), A("k:dedup"), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(3), N(1)), K(A("#")))), S4(A("COMP"), A("k:w_expand"), A("trans"), S3(A("CONS"), S3(A("COMP"), N(2), N(1)), N(2))), S3(A("COMP"), A("apndr"), S3(A("CONS"), S4(A("COMP"), A("k:w_expand"), A("trans"), S3(A("CONS"), S3(A("COMP"), N(2), N(1)), N(2))), S3(A("CONS"), S3(A("COMP"), N(3), N(1)), K(A("T")))))))),
"<pairs, columns> to the pairs in those columns.",
DEF("k:w_in",
S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("k:has"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), N(2))), S2(A("CONS"), N(1)), K(PHI()))), A("distr")))),
"<pairs, columns> to the pairs not in them.",
DEF("k:w_out",
S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("k:has"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), N(2))), K(PHI()), S2(A("CONS"), N(1)))), A("distr")))),
"<pairs> to their columns quoted.",
DEF("k:qs",
S3(A("COMP"), S2(A("ALPHA"), S3(A("COMP"), A("k:qi"), N(1))), A("id"))),
"<table, pairs, the key`s pairs, the others> to the statement that writes them, each value bound.",
DEF("k:w_ins",
S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S9(A("CONS"), K(A("INSERT INTO ")), S3(A("COMP"), A("k:qi"), N(1)), K(A(" (")), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A(", ")), S3(A("COMP"), A("k:qs"), N(2)))), K(A(") VALUES (")), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A(", ")), S3(A("COMP"), S2(A("ALPHA"), K(A("?"))), N(2)))), K(A(")")), S4(A("COND"), S3(A("COMP"), A("null"), N(3)), K(A("")), S4(A("COND"), S3(A("COMP"), A("null"), N(4)), K(A(" ON CONFLICT DO NOTHING")), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S5(A("CONS"), K(A(" ON CONFLICT (")), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A(", ")), S3(A("COMP"), A("k:qs"), N(3)))), K(A(") DO UPDATE SET ")), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A(", ")), S3(A("COMP"), S2(A("ALPHA"), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S4(A("CONS"), S3(A("COMP"), A("k:qi"), N(1)), K(A(" = excluded.")), S3(A("COMP"), A("k:qi"), N(1)))))), N(4))))))))))))),
"<table, the key`s pairs, the others> to a refuse step for each column that already holds another value: one column holds one value, so the uniqueness a second would break is refused here, not overwritten.",
DEF("k:w_occ",
S3(A("COMP"), S2(A("ALPHA"), S4(A("CONS"), K(A("refuse")), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S(A("CONS"), K(A("SELECT ")), S3(A("COMP"), A("k:qi"), S3(A("COMP"), N(1), N(1))), K(A(" FROM ")), S3(A("COMP"), A("k:qi"), S3(A("COMP"), N(1), N(2))), K(A(" WHERE ")), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A(" AND ")), S3(A("COMP"), S2(A("ALPHA"), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S3(A("CONS"), S3(A("COMP"), A("k:qi"), N(1)), K(A(" = ?")))))), S3(A("COMP"), N(2), N(2))))), K(A(" AND ")), S3(A("COMP"), A("k:qi"), S3(A("COMP"), N(1), N(1))), K(A(" IS NOT NULL AND ")), S3(A("COMP"), A("k:qi"), S3(A("COMP"), N(1), N(1))), K(A(" <> ?"))))), S3(A("COMP"), A("apndr"), S3(A("CONS"), S3(A("COMP"), S2(A("ALPHA"), N(2)), S3(A("COMP"), N(2), N(2))), S3(A("COMP"), N(2), N(1)))))), S3(A("COMP"), A("distr"), S3(A("CONS"), N(3), S3(A("CONS"), N(1), N(2)))))),
DEF("k:w_steps2",
S3(A("COMP"), A("cat"), S3(A("CONS"), S4(A("COND"), S3(A("COMP"), A("null"), N(3)), K(PHI()), S3(A("COMP"), A("k:w_occ"), S4(A("CONS"), N(1), N(3), N(4)))), S2(A("CONS"), S4(A("CONS"), K(A("exec")), A("k:w_ins"), S3(A("COMP"), S2(A("ALPHA"), N(2)), N(2))))))),
"<place, row, D> to the steps that write a fact there.",
DEF("k:w_steps",
S3(A("COMP"), A("k:w_steps2"), S3(A("COMP"), S5(A("CONS"), N(1), N(2), S3(A("COMP"), A("k:w_in"), S3(A("CONS"), N(2), N(3))), S3(A("COMP"), A("k:w_out"), S3(A("CONS"), N(2), N(3)))), S4(A("CONS"), S3(A("COMP"), N(1), N(1)), S3(A("COMP"), A("k:w_pairs"), S3(A("CONS"), N(1), N(2))), S3(A("COMP"), A("k:w_pk"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), N(3))))))),
"<fact, D> to its steps.",
DEF("k:w_fact",
S3(A("COMP"), A("k:w_steps"), S4(A("CONS"), S3(A("COMP"), A("k:d_place"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), N(2))), S3(A("COMP"), A("tl"), N(1)), N(2)))),
"WHAT THE STORE HELD IS ASKED ONLY OF A FACT THAT FITS ITS FACT TYPE. A write asks whether the database holds a fact by a SELECT over the fact type`s place with a column for each value: a fact of a fact type D does not declare has no place to select, and one with more values than its fact type has roles names a column that is not there, so an assert of either answered a selector`s fault or the database`s error, naming nothing, where the change refuses the one as unplaced and the other by its arity (k:ar_bad). k:ar_fit <fact, D> is whether the fact has one value for each role of a fact type D declares; a fact that does not fit is not held.",
DEF("k:ar_fit",
S4(A("COND"), S3(A("COMP"), A("atom"), N(1)), K(A("F")), S4(A("COND"), S3(A("COMP"), A("null"), N(1)), K(A("F")), S4(A("COND"), S3(A("COMP"), A("null"), S3(A("COMP"), A("k:rb"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), N(2)))), K(A("F")), S3(A("COMP"), A("eq"), S3(A("CONS"), S4(A("COMP"), A("length"), A("tl"), N(1)), S3(A("COMP"), A("length"), S3(A("COMP"), A("k:rb"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), N(2)))))))))),
"<fact, D> to whether the database holds it.",
DEF("k:held",
S4(A("COND"), A("k:ar_fit"), S3(A("COMP"), A("not"), S3(A("COMP"), A("null"), S3(A("COMP"), A("k:q"), S3(A("CONS"), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S6(A("CONS"), K(A("SELECT 1 FROM (")), S3(A("COMP"), A("k:fsql_s"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), N(2))), K(A(") WHERE ")), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A(" AND ")), S3(A("COMP"), S2(A("ALPHA"), S3(A("COMP"), A("implode"), S3(A("CONS"), K(A("")), S5(A("CONS"), K(A("c")), N(2), K(A(" = ")), S3(A("COMP"), A("k:lit1"), N(1)))))), S3(A("COMP"), A("k:idx"), S3(A("COMP"), A("tl"), N(1)))))), K(A(" LIMIT 1"))))), N(2))))), K(A("F")))),
"<f, D> to the fact types read through f by a rule that joins. A new instance alone adds no row to such a rule that does not name it: a join finds it only in a row that names it, and the store holds none but what the write itself adds, which feeds the rule through f.",
DEF("k:a_rp0",
S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("null"), N(2)), K(PHI()), S4(A("COND"), S3(A("COMP"), A("k:has"), S3(A("CONS"), S3(A("COMP"), N(1), N(2)), K(S2(A("k:rule_rp"), A("k:rule_rpsub"))))), S2(A("CONS"), N(1)), K(PHI())))), S3(A("COMP"), S2(A("ALPHA"), S3(A("CONS"), N(1), A("k:assoc"))), S3(A("COMP"), A("distr"), S3(A("CONS"), S3(A("COMP"), A("k:rp_cl"), S3(A("CONS"), N(1), S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), A("k:r_edge")), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("RULES")), N(2))))))), S3(A("COMP"), A("k:cell"), S3(A("CONS"), K(A("RULES")), N(2))))))))),
"<f, edges> to what the edges reach from f, beyond f: a rule that derives f does not read it, so a row written of f adds nothing to that rule; f is among them only where a rule reads it through itself.",
DEF("k:rp_cl",
S3(A("COMP"), A("k:closure"), S3(A("CONS"), S3(A("COMP"), A("k:flat"), S3(A("COMP"), S2(A("ALPHA"), S4(A("COND"), S3(A("COMP"), A("eq"), S3(A("CONS"), S3(A("COMP"), N(1), N(1)), N(2))), S2(A("CONS"), S3(A("COMP"), N(2), N(1))), K(PHI()))), S3(A("COMP"), A("distr"), S3(A("CONS"), N(2), N(1))))), N(2)))),