aboutsummaryrefslogtreecommitdiff
path: root/src/algebra/strap/URAGG-.lsp
blob: 66fba802fd6eeee5b9f4823dbc877813babc4016 (plain)
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
(/VERSIONCHECK 2) 

(DEFUN |URAGG-;elt;AfirstS;1| (|x| T0 $)
  (SPADCALL |x| (|getShellEntry| $ 8))) 

(DEFUN |URAGG-;elt;AlastS;2| (|x| T1 $)
  (SPADCALL |x| (|getShellEntry| $ 11))) 

(DEFUN |URAGG-;elt;ArestA;3| (|x| T2 $)
  (SPADCALL |x| (|getShellEntry| $ 14))) 

(DEFUN |URAGG-;second;AS;4| (|x| $)
  (SPADCALL (SPADCALL |x| (|getShellEntry| $ 14))
      (|getShellEntry| $ 8))) 

(DEFUN |URAGG-;third;AS;5| (|x| $)
  (SPADCALL
      (SPADCALL (SPADCALL |x| (|getShellEntry| $ 14))
                (|getShellEntry| $ 14))
      (|getShellEntry| $ 8))) 

(DEFUN |URAGG-;cyclic?;AB;6| (|x| $)
  (COND
    ((SPADCALL |x| (|getShellEntry| $ 20)) 'NIL)
    ('T
     (SPADCALL
         (SPADCALL (|URAGG-;findCycle| |x| $) (|getShellEntry| $ 20))
         (|getShellEntry| $ 21))))) 

(DEFUN |URAGG-;last;AS;7| (|x| $)
  (SPADCALL (SPADCALL |x| (|getShellEntry| $ 23))
      (|getShellEntry| $ 8))) 

(DEFUN |URAGG-;nodes;AL;8| (|x| $)
  (PROG (|l|)
    (RETURN
      (SEQ (LETT |l| NIL |URAGG-;nodes;AL;8|)
           (SEQ G190
                (COND
                  ((NULL (SPADCALL
                             (SPADCALL |x| (|getShellEntry| $ 20))
                             (|getShellEntry| $ 21)))
                   (GO G191)))
                (SEQ (LETT |l| (CONS |x| |l|) |URAGG-;nodes;AL;8|)
                     (EXIT (LETT |x|
                                 (SPADCALL |x| (|getShellEntry| $ 14))
                                 |URAGG-;nodes;AL;8|)))
                NIL (GO G190) G191 (EXIT NIL))
           (EXIT (NREVERSE |l|)))))) 

(DEFUN |URAGG-;children;AL;9| (|x| $)
  (PROG (|l|)
    (RETURN
      (SEQ (LETT |l| NIL |URAGG-;children;AL;9|)
           (EXIT (COND
                   ((SPADCALL |x| (|getShellEntry| $ 20)) |l|)
                   ('T
                    (CONS (SPADCALL |x| (|getShellEntry| $ 14)) |l|)))))))) 

(DEFUN |URAGG-;leaf?;AB;10| (|x| $)
  (SPADCALL |x| (|getShellEntry| $ 20))) 

(DEFUN |URAGG-;value;AS;11| (|x| $)
  (COND
    ((SPADCALL |x| (|getShellEntry| $ 20))
     (|error| "value of empty object"))
    ('T (SPADCALL |x| (|getShellEntry| $ 8))))) 

(DEFUN |URAGG-;less?;ANniB;12| (|l| |n| $)
  (PROG (|i|)
    (RETURN
      (SEQ (LETT |i| |n| |URAGG-;less?;ANniB;12|)
           (SEQ G190
                (COND
                  ((NULL (COND
                           ((< 0 |i|)
                            (SPADCALL
                                (SPADCALL |l| (|getShellEntry| $ 20))
                                (|getShellEntry| $ 21)))
                           ('T 'NIL)))
                   (GO G191)))
                (SEQ (LETT |l| (SPADCALL |l| (|getShellEntry| $ 14))
                           |URAGG-;less?;ANniB;12|)
                     (EXIT (LETT |i| (- |i| 1) |URAGG-;less?;ANniB;12|)))
                NIL (GO G190) G191 (EXIT NIL))
           (EXIT (< 0 |i|)))))) 

(DEFUN |URAGG-;more?;ANniB;13| (|l| |n| $)
  (PROG (|i|)
    (RETURN
      (SEQ (LETT |i| |n| |URAGG-;more?;ANniB;13|)
           (SEQ G190
                (COND
                  ((NULL (COND
                           ((< 0 |i|)
                            (SPADCALL
                                (SPADCALL |l| (|getShellEntry| $ 20))
                                (|getShellEntry| $ 21)))
                           ('T 'NIL)))
                   (GO G191)))
                (SEQ (LETT |l| (SPADCALL |l| (|getShellEntry| $ 14))
                           |URAGG-;more?;ANniB;13|)
                     (EXIT (LETT |i| (- |i| 1) |URAGG-;more?;ANniB;13|)))
                NIL (GO G190) G191 (EXIT NIL))
           (EXIT (COND
                   ((ZEROP |i|)
                    (SPADCALL (SPADCALL |l| (|getShellEntry| $ 20))
                        (|getShellEntry| $ 21)))
                   ('T 'NIL))))))) 

(DEFUN |URAGG-;size?;ANniB;14| (|l| |n| $)
  (PROG (|i|)
    (RETURN
      (SEQ (LETT |i| |n| |URAGG-;size?;ANniB;14|)
           (SEQ G190
                (COND
                  ((NULL (COND
                           ((SPADCALL |l| (|getShellEntry| $ 20)) 'NIL)
                           ('T (< 0 |i|))))
                   (GO G191)))
                (SEQ (LETT |l| (SPADCALL |l| (|getShellEntry| $ 14))
                           |URAGG-;size?;ANniB;14|)
                     (EXIT (LETT |i| (- |i| 1) |URAGG-;size?;ANniB;14|)))
                NIL (GO G190) G191 (EXIT NIL))
           (EXIT (COND
                   ((SPADCALL |l| (|getShellEntry| $ 20)) (ZEROP |i|))
                   ('T 'NIL))))))) 

(DEFUN |URAGG-;#;ANni;15| (|x| $)
  (PROG (|k|)
    (RETURN
      (SEQ (SEQ (LETT |k| 0 |URAGG-;#;ANni;15|) G190
                (COND
                  ((NULL (SPADCALL
                             (SPADCALL |x| (|getShellEntry| $ 20))
                             (|getShellEntry| $ 21)))
                   (GO G191)))
                (SEQ (COND
                       ((EQL |k| 1000)
                        (COND
                          ((SPADCALL |x| (|getShellEntry| $ 34))
                           (EXIT (|error| "cyclic list"))))))
                     (EXIT (LETT |x|
                                 (SPADCALL |x| (|getShellEntry| $ 14))
                                 |URAGG-;#;ANni;15|)))
                (LETT |k| (QSADD1 |k|) |URAGG-;#;ANni;15|) (GO G190)
                G191 (EXIT NIL))
           (EXIT |k|))))) 

(DEFUN |URAGG-;tail;2A;16| (|x| $)
  (PROG (|k| |y|)
    (RETURN
      (SEQ (COND
             ((SPADCALL |x| (|getShellEntry| $ 20))
              (|error| "empty list"))
             ('T
              (SEQ (LETT |y| (SPADCALL |x| (|getShellEntry| $ 14))
                         |URAGG-;tail;2A;16|)
                   (SEQ (LETT |k| 0 |URAGG-;tail;2A;16|) G190
                        (COND
                          ((NULL (SPADCALL
                                     (SPADCALL |y|
                                      (|getShellEntry| $ 20))
                                     (|getShellEntry| $ 21)))
                           (GO G191)))
                        (SEQ (COND
                               ((EQL |k| 1000)
                                (COND
                                  ((SPADCALL |x|
                                    (|getShellEntry| $ 34))
                                   (EXIT (|error| "cyclic list"))))))
                             (EXIT (LETT |y|
                                    (SPADCALL
                                     (LETT |x| |y| |URAGG-;tail;2A;16|)
                                     (|getShellEntry| $ 14))
                                    |URAGG-;tail;2A;16|)))
                        (LETT |k| (QSADD1 |k|) |URAGG-;tail;2A;16|)
                        (GO G190) G191 (EXIT NIL))
                   (EXIT |x|)))))))) 

(DEFUN |URAGG-;findCycle| (|x| $)
  (PROG (#0=#:G1472 |y|)
    (RETURN
      (SEQ (EXIT (SEQ (LETT |y| (SPADCALL |x| (|getShellEntry| $ 14))
                            |URAGG-;findCycle|)
                      (SEQ G190
                           (COND
                             ((NULL (SPADCALL
                                     (SPADCALL |y|
                                      (|getShellEntry| $ 20))
                                     (|getShellEntry| $ 21)))
                              (GO G191)))
                           (SEQ (COND
                                  ((SPADCALL |x| |y|
                                    (|getShellEntry| $ 37))
                                   (PROGN
                                     (LETT #0# |x| |URAGG-;findCycle|)
                                     (GO #0#))))
                                (LETT |x|
                                      (SPADCALL |x|
                                       (|getShellEntry| $ 14))
                                      |URAGG-;findCycle|)
                                (LETT |y|
                                      (SPADCALL |y|
                                       (|getShellEntry| $ 14))
                                      |URAGG-;findCycle|)
                                (COND
                                  ((SPADCALL |y|
                                    (|getShellEntry| $ 20))
                                   (PROGN
                                     (LETT #0# |y| |URAGG-;findCycle|)
                                     (GO #0#))))
                                (COND
                                  ((SPADCALL |x| |y|
                                    (|getShellEntry| $ 37))
                                   (PROGN
                                     (LETT #0# |y| |URAGG-;findCycle|)
                                     (GO #0#))))
                                (EXIT (LETT |y|
                                       (SPADCALL |y|
                                        (|getShellEntry| $ 14))
                                       |URAGG-;findCycle|)))
                           NIL (GO G190) G191 (EXIT NIL))
                      (EXIT |y|)))
           #0# (EXIT #0#))))) 

(DEFUN |URAGG-;cycleTail;2A;18| (|x| $)
  (PROG (|y| |z|)
    (RETURN
      (SEQ (COND
             ((SPADCALL
                  (LETT |y|
                        (LETT |x| (SPADCALL |x| (|getShellEntry| $ 38))
                              |URAGG-;cycleTail;2A;18|)
                        |URAGG-;cycleTail;2A;18|)
                  (|getShellEntry| $ 20))
              |x|)
             ('T
              (SEQ (LETT |z| (SPADCALL |x| (|getShellEntry| $ 14))
                         |URAGG-;cycleTail;2A;18|)
                   (SEQ G190
                        (COND
                          ((NULL (SPADCALL
                                     (SPADCALL |x| |z|
                                      (|getShellEntry| $ 37))
                                     (|getShellEntry| $ 21)))
                           (GO G191)))
                        (SEQ (LETT |y| |z| |URAGG-;cycleTail;2A;18|)
                             (EXIT (LETT |z|
                                    (SPADCALL |z|
                                     (|getShellEntry| $ 14))
                                    |URAGG-;cycleTail;2A;18|)))
                        NIL (GO G190) G191 (EXIT NIL))
                   (EXIT |y|)))))))) 

(DEFUN |URAGG-;cycleEntry;2A;19| (|x| $)
  (PROG (|l| |z| |k| |y|)
    (RETURN
      (SEQ (COND
             ((SPADCALL |x| (|getShellEntry| $ 20)) |x|)
             ((SPADCALL
                  (LETT |y| (|URAGG-;findCycle| |x| $)
                        |URAGG-;cycleEntry;2A;19|)
                  (|getShellEntry| $ 20))
              |y|)
             ('T
              (SEQ (LETT |z| (SPADCALL |y| (|getShellEntry| $ 14))
                         |URAGG-;cycleEntry;2A;19|)
                   (SEQ (LETT |l| 1 |URAGG-;cycleEntry;2A;19|) G190
                        (COND
                          ((NULL (SPADCALL
                                     (SPADCALL |y| |z|
                                      (|getShellEntry| $ 37))
                                     (|getShellEntry| $ 21)))
                           (GO G191)))
                        (SEQ (EXIT (LETT |z|
                                    (SPADCALL |z|
                                     (|getShellEntry| $ 14))
                                    |URAGG-;cycleEntry;2A;19|)))
                        (LETT |l| (QSADD1 |l|)
                              |URAGG-;cycleEntry;2A;19|)
                        (GO G190) G191 (EXIT NIL))
                   (LETT |y| |x| |URAGG-;cycleEntry;2A;19|)
                   (SEQ (LETT |k| 1 |URAGG-;cycleEntry;2A;19|) G190
                        (COND ((QSGREATERP |k| |l|) (GO G191)))
                        (SEQ (EXIT (LETT |y|
                                    (SPADCALL |y|
                                     (|getShellEntry| $ 14))
                                    |URAGG-;cycleEntry;2A;19|)))
                        (LETT |k| (QSADD1 |k|)
                              |URAGG-;cycleEntry;2A;19|)
                        (GO G190) G191 (EXIT NIL))
                   (SEQ G190
                        (COND
                          ((NULL (SPADCALL
                                     (SPADCALL |x| |y|
                                      (|getShellEntry| $ 37))
                                     (|getShellEntry| $ 21)))
                           (GO G191)))
                        (SEQ (LETT |x|
                                   (SPADCALL |x|
                                    (|getShellEntry| $ 14))
                                   |URAGG-;cycleEntry;2A;19|)
                             (EXIT (LETT |y|
                                    (SPADCALL |y|
                                     (|getShellEntry| $ 14))
                                    |URAGG-;cycleEntry;2A;19|)))
                        NIL (GO G190) G191 (EXIT NIL))
                   (EXIT |x|)))))))) 

(DEFUN |URAGG-;cycleLength;ANni;20| (|x| $)
  (PROG (|k| |y|)
    (RETURN
      (SEQ (COND
             ((OR (SPADCALL |x| (|getShellEntry| $ 20))
                  (SPADCALL
                      (LETT |x| (|URAGG-;findCycle| |x| $)
                            |URAGG-;cycleLength;ANni;20|)
                      (|getShellEntry| $ 20)))
              0)
             ('T
              (SEQ (LETT |y| (SPADCALL |x| (|getShellEntry| $ 14))
                         |URAGG-;cycleLength;ANni;20|)
                   (SEQ (LETT |k| 1 |URAGG-;cycleLength;ANni;20|) G190
                        (COND
                          ((NULL (SPADCALL
                                     (SPADCALL |x| |y|
                                      (|getShellEntry| $ 37))
                                     (|getShellEntry| $ 21)))
                           (GO G191)))
                        (SEQ (EXIT (LETT |y|
                                    (SPADCALL |y|
                                     (|getShellEntry| $ 14))
                                    |URAGG-;cycleLength;ANni;20|)))
                        (LETT |k| (QSADD1 |k|)
                              |URAGG-;cycleLength;ANni;20|)
                        (GO G190) G191 (EXIT NIL))
                   (EXIT |k|)))))))) 

(DEFUN |URAGG-;rest;ANniA;21| (|x| |n| $)
  (PROG (|i|)
    (RETURN
      (SEQ (SEQ (LETT |i| 1 |URAGG-;rest;ANniA;21|) G190
                (COND ((QSGREATERP |i| |n|) (GO G191)))
                (SEQ (EXIT (COND
                             ((SPADCALL |x| (|getShellEntry| $ 20))
                              (|error| "Index out of range"))
                             ('T
                              (LETT |x|
                                    (SPADCALL |x|
                                     (|getShellEntry| $ 14))
                                    |URAGG-;rest;ANniA;21|)))))
                (LETT |i| (QSADD1 |i|) |URAGG-;rest;ANniA;21|)
                (GO G190) G191 (EXIT NIL))
           (EXIT |x|))))) 

(DEFUN |URAGG-;last;ANniA;22| (|x| |n| $)
  (PROG (|m| #0=#:G1495)
    (RETURN
      (SEQ (LETT |m| (SPADCALL |x| (|getShellEntry| $ 43))
                 |URAGG-;last;ANniA;22|)
           (EXIT (COND
                   ((< |m| |n|) (|error| "index out of range"))
                   ('T
                    (SPADCALL
                        (SPADCALL |x|
                            (PROG1 (LETT #0# (- |m| |n|)
                                    |URAGG-;last;ANniA;22|)
                              (|check-subtype| (>= #0# 0)
                                  '(|NonNegativeInteger|) #0#))
                            (|getShellEntry| $ 44))
                        (|getShellEntry| $ 45))))))))) 

(DEFUN |URAGG-;=;2AB;23| (|x| |y| $)
  (PROG (|k| #0=#:G1505)
    (RETURN
      (SEQ (EXIT (COND
                   ((SPADCALL |x| |y| (|getShellEntry| $ 37)) 'T)
                   ('T
                    (SEQ (SEQ (LETT |k| 0 |URAGG-;=;2AB;23|) G190
                              (COND
                                ((NULL (COND
                                         ((SPADCALL |x|
                                           (|getShellEntry| $ 20))
                                          'NIL)
                                         ('T
                                          (SPADCALL
                                           (SPADCALL |y|
                                            (|getShellEntry| $ 20))
                                           (|getShellEntry| $ 21)))))
                                 (GO G191)))
                              (SEQ (COND
                                     ((EQL |k| 1000)
                                      (COND
                                        ((SPADCALL |x|
                                          (|getShellEntry| $ 34))
                                         (EXIT (|error| "cyclic list"))))))
                                   (EXIT
                                    (COND
                                      ((SPADCALL
                                        (SPADCALL |x|
                                         (|getShellEntry| $ 8))
                                        (SPADCALL |y|
                                         (|getShellEntry| $ 8))
                                        (|getShellEntry| $ 47))
                                       (PROGN
                                         (LETT #0# 'NIL
                                          |URAGG-;=;2AB;23|)
                                         (GO #0#)))
                                      ('T
                                       (SEQ
                                        (LETT |x|
                                         (SPADCALL |x|
                                          (|getShellEntry| $ 14))
                                         |URAGG-;=;2AB;23|)
                                        (EXIT
                                         (LETT |y|
                                          (SPADCALL |y|
                                           (|getShellEntry| $ 14))
                                          |URAGG-;=;2AB;23|)))))))
                              (LETT |k| (QSADD1 |k|) |URAGG-;=;2AB;23|)
                              (GO G190) G191 (EXIT NIL))
                         (EXIT (COND
                                 ((SPADCALL |x| (|getShellEntry| $ 20))
                                  (SPADCALL |y| (|getShellEntry| $ 20)))
                                 ('T 'NIL)))))))
           #0# (EXIT #0#))))) 

(DEFUN |URAGG-;node?;2AB;24| (|u| |v| $)
  (PROG (|k| #0=#:G1510)
    (RETURN
      (SEQ (EXIT (SEQ (SEQ (LETT |k| 0 |URAGG-;node?;2AB;24|) G190
                           (COND
                             ((NULL (SPADCALL
                                     (SPADCALL |v|
                                      (|getShellEntry| $ 20))
                                     (|getShellEntry| $ 21)))
                              (GO G191)))
                           (SEQ (EXIT (COND
                                        ((SPADCALL |u| |v|
                                          (|getShellEntry| $ 49))
                                         (PROGN
                                           (LETT #0# 'T
                                            |URAGG-;node?;2AB;24|)
                                           (GO #0#)))
                                        ('T
                                         (SEQ
                                          (COND
                                            ((EQL |k| 1000)
                                             (COND
                                               ((SPADCALL |v|
                                                 (|getShellEntry| $ 34))
                                                (EXIT
                                                 (|error|
                                                  "cyclic list"))))))
                                          (EXIT
                                           (LETT |v|
                                            (SPADCALL |v|
                                             (|getShellEntry| $ 14))
                                            |URAGG-;node?;2AB;24|)))))))
                           (LETT |k| (QSADD1 |k|)
                                 |URAGG-;node?;2AB;24|)
                           (GO G190) G191 (EXIT NIL))
                      (EXIT (SPADCALL |u| |v| (|getShellEntry| $ 49)))))
           #0# (EXIT #0#))))) 

(DEFUN |URAGG-;setelt;Afirst2S;25| (|x| T3 |a| $)
  (SPADCALL |x| |a| (|getShellEntry| $ 51))) 

(DEFUN |URAGG-;setelt;Alast2S;26| (|x| T4 |a| $)
  (SPADCALL |x| |a| (|getShellEntry| $ 53))) 

(DEFUN |URAGG-;setelt;Arest2A;27| (|x| T5 |a| $)
  (SPADCALL |x| |a| (|getShellEntry| $ 55))) 

(DEFUN |URAGG-;concat;3A;28| (|x| |y| $)
  (SPADCALL (SPADCALL |x| (|getShellEntry| $ 45)) |y|
      (|getShellEntry| $ 57))) 

(DEFUN |URAGG-;setlast!;A2S;29| (|x| |s| $)
  (SEQ (COND
         ((SPADCALL |x| (|getShellEntry| $ 20))
          (|error| "setlast: empty list"))
         ('T
          (SEQ (SPADCALL (SPADCALL |x| (|getShellEntry| $ 23)) |s|
                   (|getShellEntry| $ 51))
               (EXIT |s|)))))) 

(DEFUN |URAGG-;setchildren!;ALA;30| (|u| |lv| $)
  (COND
    ((EQL (LENGTH |lv|) 1)
     (SPADCALL |u| (|SPADfirst| |lv|) (|getShellEntry| $ 55)))
    ('T (|error| "wrong number of children specified")))) 

(DEFUN |URAGG-;setvalue!;A2S;31| (|u| |s| $)
  (SPADCALL |u| |s| (|getShellEntry| $ 51))) 

(DEFUN |URAGG-;split!;AIA;32| (|p| |n| $)
  (PROG (#0=#:G1521 |q|)
    (RETURN
      (SEQ (COND
             ((< |n| 1) (|error| "index out of range"))
             ('T
              (SEQ (LETT |p|
                         (SPADCALL |p|
                             (PROG1 (LETT #0# (- |n| 1)
                                     |URAGG-;split!;AIA;32|)
                               (|check-subtype| (>= #0# 0)
                                   '(|NonNegativeInteger|) #0#))
                             (|getShellEntry| $ 44))
                         |URAGG-;split!;AIA;32|)
                   (LETT |q| (SPADCALL |p| (|getShellEntry| $ 14))
                         |URAGG-;split!;AIA;32|)
                   (SPADCALL |p| (SPADCALL (|getShellEntry| $ 62))
                       (|getShellEntry| $ 55))
                   (EXIT |q|)))))))) 

(DEFUN |URAGG-;cycleSplit!;2A;33| (|x| $)
  (PROG (|y| |z|)
    (RETURN
      (SEQ (COND
             ((OR (SPADCALL
                      (LETT |y| (SPADCALL |x| (|getShellEntry| $ 38))
                            |URAGG-;cycleSplit!;2A;33|)
                      (|getShellEntry| $ 20))
                  (SPADCALL |x| |y| (|getShellEntry| $ 37)))
              |y|)
             ('T
              (SEQ (LETT |z| (SPADCALL |x| (|getShellEntry| $ 14))
                         |URAGG-;cycleSplit!;2A;33|)
                   (SEQ G190
                        (COND
                          ((NULL (SPADCALL
                                     (SPADCALL |z| |y|
                                      (|getShellEntry| $ 37))
                                     (|getShellEntry| $ 21)))
                           (GO G191)))
                        (SEQ (LETT |x| |z| |URAGG-;cycleSplit!;2A;33|)
                             (EXIT (LETT |z|
                                    (SPADCALL |z|
                                     (|getShellEntry| $ 14))
                                    |URAGG-;cycleSplit!;2A;33|)))
                        NIL (GO G190) G191 (EXIT NIL))
                   (SPADCALL |x| (SPADCALL (|getShellEntry| $ 62))
                       (|getShellEntry| $ 55))
                   (EXIT |y|)))))))) 

(DEFUN |UnaryRecursiveAggregate&| (|#1| |#2|)
  (PROG (|dv$1| |dv$2| |dv$| $ |pv$|)
    (RETURN
      (PROGN
        (LETT |dv$1| (|devaluate| |#1|)
              . #0=(|UnaryRecursiveAggregate&|))
        (LETT |dv$2| (|devaluate| |#2|) . #0#)
        (LETT |dv$|
              (LIST '|UnaryRecursiveAggregate&| |dv$1| |dv$2|) . #0#)
        (LETT $ (|newShell| 67) . #0#)
        (|setShellEntry| $ 0 |dv$|)
        (|setShellEntry| $ 3
            (LETT |pv$|
                  (|buildPredVector| 0 0
                      (LIST (|HasAttribute| |#1| '|shallowlyMutable|))) . #0#))
        (|stuffDomainSlots| $)
        (|setShellEntry| $ 6 |#1|)
        (|setShellEntry| $ 7 |#2|)
        (COND
          ((|HasAttribute| |#1| '|finiteAggregate|)
           (|setShellEntry| $ 46
               (CONS (|dispatchFunction| |URAGG-;last;ANniA;22|) $))))
        (COND
          ((|HasCategory| |#2| '(|SetCategory|))
           (PROGN
             (|setShellEntry| $ 48
                 (CONS (|dispatchFunction| |URAGG-;=;2AB;23|) $))
             (|setShellEntry| $ 50
                 (CONS (|dispatchFunction| |URAGG-;node?;2AB;24|) $)))))
        (COND
          ((|testBitVector| |pv$| 1)
           (PROGN
             (|setShellEntry| $ 52
                 (CONS (|dispatchFunction| |URAGG-;setelt;Afirst2S;25|)
                       $))
             (|setShellEntry| $ 54
                 (CONS (|dispatchFunction| |URAGG-;setelt;Alast2S;26|)
                       $))
             (|setShellEntry| $ 56
                 (CONS (|dispatchFunction| |URAGG-;setelt;Arest2A;27|)
                       $))
             (|setShellEntry| $ 58
                 (CONS (|dispatchFunction| |URAGG-;concat;3A;28|) $))
             (|setShellEntry| $ 59
                 (CONS (|dispatchFunction| |URAGG-;setlast!;A2S;29|) $))
             (|setShellEntry| $ 60
                 (CONS (|dispatchFunction|
                           |URAGG-;setchildren!;ALA;30|)
                       $))
             (|setShellEntry| $ 61
                 (CONS (|dispatchFunction| |URAGG-;setvalue!;A2S;31|)
                       $))
             (|setShellEntry| $ 64
                 (CONS (|dispatchFunction| |URAGG-;split!;AIA;32|) $))
             (|setShellEntry| $ 65
                 (CONS (|dispatchFunction| |URAGG-;cycleSplit!;2A;33|)
                       $)))))
        $)))) 

(MAKEPROP '|UnaryRecursiveAggregate&| '|infovec|
    (LIST '#(NIL NIL NIL NIL NIL NIL (|local| |#1|) (|local| |#2|)
             (0 . |first|) '"first" |URAGG-;elt;AfirstS;1| (5 . |last|)
             '"last" |URAGG-;elt;AlastS;2| (10 . |rest|) '"rest"
             |URAGG-;elt;ArestA;3| |URAGG-;second;AS;4|
             |URAGG-;third;AS;5| (|Boolean|) (15 . |empty?|)
             (20 . |not|) |URAGG-;cyclic?;AB;6| (25 . |tail|)
             |URAGG-;last;AS;7| (|List| $) |URAGG-;nodes;AL;8|
             |URAGG-;children;AL;9| |URAGG-;leaf?;AB;10|
             |URAGG-;value;AS;11| (|NonNegativeInteger|)
             |URAGG-;less?;ANniB;12| |URAGG-;more?;ANniB;13|
             |URAGG-;size?;ANniB;14| (30 . |cyclic?|)
             |URAGG-;#;ANni;15| |URAGG-;tail;2A;16| (35 . |eq?|)
             (41 . |cycleEntry|) |URAGG-;cycleTail;2A;18|
             |URAGG-;cycleEntry;2A;19| |URAGG-;cycleLength;ANni;20|
             |URAGG-;rest;ANniA;21| (46 . |#|) (51 . |rest|)
             (57 . |copy|) (62 . |last|) (68 . ~=) (74 . =) (80 . =)
             (86 . |node?|) (92 . |setfirst!|) (98 . |setelt|)
             (105 . |setlast!|) (111 . |setelt|) (118 . |setrest!|)
             (124 . |setelt|) (131 . |concat!|) (137 . |concat|)
             (143 . |setlast!|) (149 . |setchildren!|)
             (155 . |setvalue!|) (161 . |empty|) (|Integer|)
             (165 . |split!|) (171 . |cycleSplit!|) '"value")
          '#(|value| 176 |third| 181 |tail| 186 |split!| 191 |size?|
             197 |setvalue!| 203 |setlast!| 209 |setelt| 215
             |setchildren!| 236 |second| 242 |rest| 247 |nodes| 253
             |node?| 258 |more?| 264 |less?| 270 |leaf?| 276 |last| 281
             |elt| 292 |cyclic?| 310 |cycleTail| 315 |cycleSplit!| 320
             |cycleLength| 325 |cycleEntry| 330 |concat| 335 |children|
             341 = 346 |#| 352)
          'NIL
          (CONS (|makeByteWordVec2| 1 'NIL)
                (CONS '#()
                      (CONS '#()
                            (|makeByteWordVec2| 65
                                '(1 6 7 0 8 1 6 7 0 11 1 6 0 0 14 1 6
                                  19 0 20 1 19 0 0 21 1 6 0 0 23 1 6 19
                                  0 34 2 6 19 0 0 37 1 6 0 0 38 1 6 30
                                  0 43 2 6 0 0 30 44 1 6 0 0 45 2 0 0 0
                                  30 46 2 7 19 0 0 47 2 0 19 0 0 48 2 6
                                  19 0 0 49 2 0 19 0 0 50 2 6 7 0 7 51
                                  3 0 7 0 9 7 52 2 6 7 0 7 53 3 0 7 0
                                  12 7 54 2 6 0 0 0 55 3 0 0 0 15 0 56
                                  2 6 0 0 0 57 2 0 0 0 0 58 2 0 7 0 7
                                  59 2 0 0 0 25 60 2 0 7 0 7 61 0 6 0
                                  62 2 0 0 0 63 64 1 0 0 0 65 1 0 7 0
                                  29 1 0 7 0 18 1 0 0 0 36 2 0 0 0 63
                                  64 2 0 19 0 30 33 2 0 7 0 7 61 2 0 7
                                  0 7 59 3 0 7 0 12 7 54 3 0 0 0 15 0
                                  56 3 0 7 0 9 7 52 2 0 0 0 25 60 1 0 7
                                  0 17 2 0 0 0 30 42 1 0 25 0 26 2 0 19
                                  0 0 50 2 0 19 0 30 32 2 0 19 0 30 31
                                  1 0 19 0 28 2 0 0 0 30 46 1 0 7 0 24
                                  2 0 7 0 12 13 2 0 0 0 15 16 2 0 7 0 9
                                  10 1 0 19 0 22 1 0 0 0 39 1 0 0 0 65
                                  1 0 30 0 41 1 0 0 0 40 2 0 0 0 0 58 1
                                  0 25 0 27 2 0 19 0 0 48 1 0 30 0 35)))))
          '|lookupComplete|)) 

(SETQ |$CategoryFrame|
      (|put| '|UnaryRecursiveAggregate&| '|isFunctor|
             '(((|split!| ($ $ (|Integer|))) T (ELT $ 64))
               ((|setelt| (|#2| $ "last" |#2|)) T (ELT $ 54))
               ((|setlast!| (|#2| $ |#2|)) T (ELT $ 59))
               ((|setelt| ($ $ "rest" $)) T (ELT $ 56))
               ((|setelt| (|#2| $ "first" |#2|)) T (ELT $ 52))
               ((|cycleSplit!| ($ $)) T (ELT $ 65))
               ((|cycleTail| ($ $)) T (ELT $ 39))
               ((|cycleLength| ((|NonNegativeInteger|) $)) T
                (ELT $ 41))
               ((|cycleEntry| ($ $)) T (ELT $ 40))
               ((|third| (|#2| $)) T (ELT $ 18))
               ((|second| (|#2| $)) T (ELT $ 17))
               ((|tail| ($ $)) T (ELT $ 36))
               ((|last| ($ $ (|NonNegativeInteger|))) T (ELT $ 46))
               ((|elt| (|#2| $ "last")) T (ELT $ 13))
               ((|last| (|#2| $)) T (ELT $ 24))
               ((|rest| ($ $ (|NonNegativeInteger|))) T (ELT $ 42))
               ((|elt| ($ $ "rest")) T (ELT $ 16))
               ((|rest| ($ $)) T (ELT $ NIL))
               ((|elt| (|#2| $ "first")) T (ELT $ 10))
               ((|concat| ($ |#2| $)) T (ELT $ NIL))
               ((|concat| ($ $ $)) T (ELT $ 58))
               ((|setvalue!| (|#2| $ |#2|)) T (ELT $ 61))
               ((|setelt| (|#2| $ "value" |#2|)) T (ELT $ NIL))
               ((|setchildren!| ($ $ (|List| $))) T (ELT $ 60))
               ((|node?| ((|Boolean|) $ $)) T (ELT $ 50))
               ((|cyclic?| ((|Boolean|) $)) T (ELT $ 22))
               ((|elt| (|#2| $ "value")) T (ELT $ NIL))
               ((|value| (|#2| $)) T (ELT $ 29))
               ((|leaf?| ((|Boolean|) $)) T (ELT $ 28))
               ((|nodes| ((|List| $) $)) T (ELT $ 26))
               ((|children| ((|List| $) $)) T (ELT $ 27))
               ((= ((|Boolean|) $ $)) T (ELT $ 48))
               ((|#| ((|NonNegativeInteger|) $)) T (ELT $ 35))
               ((|size?| ((|Boolean|) $ (|NonNegativeInteger|))) T
                (ELT $ 33))
               ((|more?| ((|Boolean|) $ (|NonNegativeInteger|))) T
                (ELT $ 32))
               ((|less?| ((|Boolean|) $ (|NonNegativeInteger|))) T
                (ELT $ 31)))
             (|addModemap| '|UnaryRecursiveAggregate&|
                 '(|UnaryRecursiveAggregate&| |#1| |#2|)
                 '((CATEGORY |domain|
                       (SIGNATURE |split!| (|#1| |#1| (|Integer|)))
                       (SIGNATURE |setelt| (|#2| |#1| "last" |#2|))
                       (SIGNATURE |setlast!| (|#2| |#1| |#2|))
                       (SIGNATURE |setelt| (|#1| |#1| "rest" |#1|))
                       (SIGNATURE |setelt| (|#2| |#1| "first" |#2|))
                       (SIGNATURE |cycleSplit!| (|#1| |#1|))
                       (SIGNATURE |cycleTail| (|#1| |#1|))
                       (SIGNATURE |cycleLength|
                           ((|NonNegativeInteger|) |#1|))
                       (SIGNATURE |cycleEntry| (|#1| |#1|))
                       (SIGNATURE |third| (|#2| |#1|))
                       (SIGNATURE |second| (|#2| |#1|))
                       (SIGNATURE |tail| (|#1| |#1|))
                       (SIGNATURE |last|
                           (|#1| |#1| (|NonNegativeInteger|)))
                       (SIGNATURE |elt| (|#2| |#1| "last"))
                       (SIGNATURE |last| (|#2| |#1|))
                       (SIGNATURE |rest|
                           (|#1| |#1| (|NonNegativeInteger|)))
                       (SIGNATURE |elt| (|#1| |#1| "rest"))
                       (SIGNATURE |rest| (|#1| |#1|))
                       (SIGNATURE |elt| (|#2| |#1| "first"))
                       (SIGNATURE |concat| (|#1| |#2| |#1|))
                       (SIGNATURE |concat| (|#1| |#1| |#1|))
                       (SIGNATURE |setvalue!| (|#2| |#1| |#2|))
                       (SIGNATURE |setelt| (|#2| |#1| "value" |#2|))
                       (SIGNATURE |setchildren!|
                           (|#1| |#1| (|List| |#1|)))
                       (SIGNATURE |node?| ((|Boolean|) |#1| |#1|))
                       (SIGNATURE |cyclic?| ((|Boolean|) |#1|))
                       (SIGNATURE |elt| (|#2| |#1| "value"))
                       (SIGNATURE |value| (|#2| |#1|))
                       (SIGNATURE |leaf?| ((|Boolean|) |#1|))
                       (SIGNATURE |nodes| ((|List| |#1|) |#1|))
                       (SIGNATURE |children| ((|List| |#1|) |#1|))
                       (SIGNATURE = ((|Boolean|) |#1| |#1|))
                       (SIGNATURE |#| ((|NonNegativeInteger|) |#1|))
                       (SIGNATURE |size?|
                           ((|Boolean|) |#1| (|NonNegativeInteger|)))
                       (SIGNATURE |more?|
                           ((|Boolean|) |#1| (|NonNegativeInteger|)))
                       (SIGNATURE |less?|
                           ((|Boolean|) |#1| (|NonNegativeInteger|))))
                   (|UnaryRecursiveAggregate| |#2|) (|Type|))
                 T '|UnaryRecursiveAggregate&|
                 (|put| '|UnaryRecursiveAggregate&| '|mode|
                        '(|Mapping| (CATEGORY |domain|
                                     (SIGNATURE |split!|
                                      (|#1| |#1| (|Integer|)))
                                     (SIGNATURE |setelt|
                                      (|#2| |#1| "last" |#2|))
                                     (SIGNATURE |setlast!|
                                      (|#2| |#1| |#2|))
                                     (SIGNATURE |setelt|
                                      (|#1| |#1| "rest" |#1|))
                                     (SIGNATURE |setelt|
                                      (|#2| |#1| "first" |#2|))
                                     (SIGNATURE |cycleSplit!|
                                      (|#1| |#1|))
                                     (SIGNATURE |cycleTail|
                                      (|#1| |#1|))
                                     (SIGNATURE |cycleLength|
                                      ((|NonNegativeInteger|) |#1|))
                                     (SIGNATURE |cycleEntry|
                                      (|#1| |#1|))
                                     (SIGNATURE |third| (|#2| |#1|))
                                     (SIGNATURE |second| (|#2| |#1|))
                                     (SIGNATURE |tail| (|#1| |#1|))
                                     (SIGNATURE |last|
                                      (|#1| |#1|
                                       (|NonNegativeInteger|)))
                                     (SIGNATURE |elt|
                                      (|#2| |#1| "last"))
                                     (SIGNATURE |last| (|#2| |#1|))
                                     (SIGNATURE |rest|
                                      (|#1| |#1|
                                       (|NonNegativeInteger|)))
                                     (SIGNATURE |elt|
                                      (|#1| |#1| "rest"))
                                     (SIGNATURE |rest| (|#1| |#1|))
                                     (SIGNATURE |elt|
                                      (|#2| |#1| "first"))
                                     (SIGNATURE |concat|
                                      (|#1| |#2| |#1|))
                                     (SIGNATURE |concat|
                                      (|#1| |#1| |#1|))
                                     (SIGNATURE |setvalue!|
                                      (|#2| |#1| |#2|))
                                     (SIGNATURE |setelt|
                                      (|#2| |#1| "value" |#2|))
                                     (SIGNATURE |setchildren!|
                                      (|#1| |#1| (|List| |#1|)))
                                     (SIGNATURE |node?|
                                      ((|Boolean|) |#1| |#1|))
                                     (SIGNATURE |cyclic?|
                                      ((|Boolean|) |#1|))
                                     (SIGNATURE |elt|
                                      (|#2| |#1| "value"))
                                     (SIGNATURE |value| (|#2| |#1|))
                                     (SIGNATURE |leaf?|
                                      ((|Boolean|) |#1|))
                                     (SIGNATURE |nodes|
                                      ((|List| |#1|) |#1|))
                                     (SIGNATURE |children|
                                      ((|List| |#1|) |#1|))
                                     (SIGNATURE =
                                      ((|Boolean|) |#1| |#1|))
                                     (SIGNATURE |#|
                                      ((|NonNegativeInteger|) |#1|))
                                     (SIGNATURE |size?|
                                      ((|Boolean|) |#1|
                                       (|NonNegativeInteger|)))
                                     (SIGNATURE |more?|
                                      ((|Boolean|) |#1|
                                       (|NonNegativeInteger|)))
                                     (SIGNATURE |less?|
                                      ((|Boolean|) |#1|
                                       (|NonNegativeInteger|))))
                                    (|UnaryRecursiveAggregate| |#2|)
                                    (|Type|))
                        |$CategoryFrame|))))