aboutsummaryrefslogtreecommitdiff
path: root/src/algebra/strap/RCAGG.lsp
blob: 9981da2766b0a3394cbef5fb2186f428d4e7b3fc (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
(/VERSIONCHECK 2) 

(DEFPARAMETER |RecursiveAggregate;CAT| 'NIL) 

(DEFPARAMETER |RecursiveAggregate;AL| 'NIL) 

(DEFUN |RecursiveAggregate| (#0=#:G1398)
  (LET (#1=#:G1399)
    (COND
      ((SETQ #1# (|assoc| (|devaluate| #0#) |RecursiveAggregate;AL|))
       (CDR #1#))
      (T (SETQ |RecursiveAggregate;AL|
               (|cons5| (CONS (|devaluate| #0#)
                              (SETQ #1# (|RecursiveAggregate;| #0#)))
                        |RecursiveAggregate;AL|))
         #1#)))) 

(DEFUN |RecursiveAggregate;| (|t#1|)
  (PROG (#0=#:G1397)
    (RETURN
      (PROG1 (LETT #0#
                   (|sublisV|
                       (PAIR '(|t#1|) (LIST (|devaluate| |t#1|)))
                       (COND
                         (|RecursiveAggregate;CAT|)
                         ('T
                          (LETT |RecursiveAggregate;CAT|
                                (|Join| (|HomogeneousAggregate| '|t#1|)
                                        (|mkCategory| '|domain|
                                         '(((|children| ((|List| $) $))
                                            T)
                                           ((|nodes| ((|List| $) $)) T)
                                           ((|leaf?| ((|Boolean|) $))
                                            T)
                                           ((|value| (|t#1| $)) T)
                                           ((|elt| (|t#1| $ "value"))
                                            T)
                                           ((|cyclic?| ((|Boolean|) $))
                                            T)
                                           ((|leaves|
                                             ((|List| |t#1|) $))
                                            T)
                                           ((|distance|
                                             ((|Integer|) $ $))
                                            T)
                                           ((|child?|
                                             ((|Boolean|) $ $))
                                            (|has| |t#1|
                                             (|SetCategory|)))
                                           ((|node?| ((|Boolean|) $ $))
                                            (|has| |t#1|
                                             (|SetCategory|)))
                                           ((|setchildren!|
                                             ($ $ (|List| $)))
                                            (|has| $
                                             (ATTRIBUTE
                                              |shallowlyMutable|)))
                                           ((|setelt|
                                             (|t#1| $ "value" |t#1|))
                                            (|has| $
                                             (ATTRIBUTE
                                              |shallowlyMutable|)))
                                           ((|setvalue!|
                                             (|t#1| $ |t#1|))
                                            (|has| $
                                             (ATTRIBUTE
                                              |shallowlyMutable|))))
                                         NIL
                                         '((|List| $) (|Boolean|)
                                           (|Integer|) (|List| |t#1|))
                                         NIL))
                                . #1=(|RecursiveAggregate|))))) . #1#)
        (SETELT #0# 0 (LIST '|RecursiveAggregate| (|devaluate| |t#1|)))))))