
(PUT '|LIST;nil;$;1| '|SPADreplace| '(XLAM NIL NIL)) 

(SDEFUN |LIST;nil;$;1| (($ $)) NIL) 

(PUT '|LIST;null;$B;2| '|SPADreplace| 'NULL) 

(SDEFUN |LIST;null;$B;2| ((|l| $) ($ |Boolean|)) (NULL |l|)) 

(PUT '|LIST;cons;S2$;3| '|SPADreplace| 'CONS) 

(SDEFUN |LIST;cons;S2$;3| ((|s| S) (|l| $) ($ $)) (CONS |s| |l|)) 

(PUT '|LIST;append;3$;4| '|SPADreplace| 'APPEND) 

(SDEFUN |LIST;append;3$;4| ((|l| $) (|t| $) ($ $)) (APPEND |l| |t|)) 

(SDEFUN |LIST;writeOMList| ((|dev| |OpenMathDevice|) (|x| $) ($ |Void|))
        (SEQ (SPADCALL |dev| (QREFELT $ 14))
             (SPADCALL |dev| "list1" "list" (QREFELT $ 16))
             (SEQ G190
                  (COND ((NULL (COND ((NULL |x|) 'NIL) ('T 'T))) (GO G191)))
                  (SEQ (SPADCALL |dev| (|SPADfirst| |x|) 'NIL (QREFELT $ 17))
                       (EXIT (LETT |x| (CDR |x|) |LIST;writeOMList|)))
                  NIL (GO G190) G191 (EXIT NIL))
             (EXIT (SPADCALL |dev| (QREFELT $ 18))))) 

(SDEFUN |LIST;OMwrite;Omd$BV;6|
        ((|dev| |OpenMathDevice|) (|x| $) (|wholeObj| |Boolean|) ($ |Void|))
        (SEQ (COND (|wholeObj| (SPADCALL |dev| (QREFELT $ 19))))
             (|LIST;writeOMList| |dev| |x| $)
             (EXIT (COND (|wholeObj| (SPADCALL |dev| (QREFELT $ 20))))))) 

(SDEFUN |LIST;setUnion;3$;7| ((|l1| $) (|l2| $) ($ $))
        (SPADCALL (SPADCALL |l1| |l2| (QREFELT $ 22)) (QREFELT $ 23))) 

(SDEFUN |LIST;setIntersection;3$;8| ((|l1| $) (|l2| $) ($ $))
        (SPROG ((|u| ($)))
               (SEQ (LETT |u| NIL . #1=(|LIST;setIntersection;3$;8|))
                    (LETT |l1| (SPADCALL |l1| (QREFELT $ 23)) . #1#)
                    (SEQ G190
                         (COND
                          ((NULL (COND ((NULL |l1|) 'NIL) ('T 'T))) (GO G191)))
                         (SEQ
                          (COND
                           ((SPADCALL (|SPADfirst| |l1|) |l2| (QREFELT $ 25))
                            (LETT |u| (CONS (|SPADfirst| |l1|) |u|) . #1#)))
                          (EXIT (LETT |l1| (CDR |l1|) . #1#)))
                         NIL (GO G190) G191 (EXIT NIL))
                    (EXIT |u|)))) 

(SDEFUN |LIST;setDifference;3$;9| ((|l1| $) (|l2| $) ($ $))
        (SPROG ((|lu| ($)) (|l11| (S)))
               (SEQ
                (LETT |l1| (SPADCALL |l1| (QREFELT $ 23))
                      . #1=(|LIST;setDifference;3$;9|))
                (LETT |lu| NIL . #1#)
                (SEQ G190
                     (COND
                      ((NULL (COND ((NULL |l1|) 'NIL) ('T 'T))) (GO G191)))
                     (SEQ (LETT |l11| (SPADCALL |l1| 1 (QREFELT $ 28)) . #1#)
                          (COND
                           ((NULL (SPADCALL |l11| |l2| (QREFELT $ 25)))
                            (LETT |lu| (CONS |l11| |lu|) . #1#)))
                          (EXIT (LETT |l1| (CDR |l1|) . #1#)))
                     NIL (GO G190) G191 (EXIT NIL))
                (EXIT |lu|)))) 

(SDEFUN |LIST;convert;$If;10| ((|x| $) ($ |InputForm|))
        (SPROG ((#1=#:G2121 NIL) (|a| NIL) (#2=#:G2120 NIL))
               (SEQ
                (SPADCALL
                 (CONS (SPADCALL '|construct| (QREFELT $ 32))
                       (PROGN
                        (LETT #2# NIL . #3=(|LIST;convert;$If;10|))
                        (SEQ (LETT |a| NIL . #3#) (LETT #1# |x| . #3#) G190
                             (COND
                              ((OR (ATOM #1#)
                                   (PROGN (LETT |a| (CAR #1#) . #3#) NIL))
                               (GO G191)))
                             (SEQ
                              (EXIT
                               (LETT #2#
                                     (CONS (SPADCALL |a| (QREFELT $ 33)) #2#)
                                     . #3#)))
                             (LETT #1# (CDR #1#) . #3#) (GO G190) G191
                             (EXIT (NREVERSE #2#)))))
                 (QREFELT $ 35))))) 

(DECLAIM (NOTINLINE |List;|)) 

(DEFUN |List| (#1=#:G2134)
  (SPROG NIL
         (PROG (#2=#:G2135)
           (RETURN
            (COND
             ((LETT #2#
                    (|lassocShiftWithFunction| (LIST (|devaluate| #1#))
                                               (HGET |$ConstructorCache|
                                                     '|List|)
                                               '|domainEqualList|)
                    . #3=(|List|))
              (|CDRwithIncrement| #2#))
             ('T
              (UNWIND-PROTECT (PROG1 (|List;| #1#) (LETT #2# T . #3#))
                (COND ((NOT #2#) (HREM |$ConstructorCache| '|List|)))))))))) 

(DEFUN |List;| (|#1|)
  (SPROG
   ((#1=#:G2132 NIL) (#2=#:G2133 NIL) (|pv$| NIL) (#3=#:G2129 NIL)
    (#4=#:G2130 NIL) ($ NIL) (|dv$| NIL) (DV$1 NIL))
   (PROGN
    (LETT DV$1 (|devaluate| |#1|) . #5=(|List|))
    (LETT |dv$| (LIST '|List| DV$1) . #5#)
    (LETT $ (GETREFV 55) . #5#)
    (QSETREFV $ 0 |dv$|)
    (QSETREFV $ 3
              (LETT |pv$|
                    (|buildPredVector| 0 0
                                       (LIST
                                        (|HasCategory| |#1|
                                                       '(|ConvertibleTo|
                                                         (|InputForm|)))
                                        (|HasCategory| |#1| '(|OrderedSet|))
                                        (|HasCategory| |#1| '(|OpenMath|))
                                        (|HasCategory| |#1| '(|BasicType|))
                                        (LETT #4#
                                              (|HasCategory| |#1|
                                                             '(|SetCategory|))
                                              . #5#)
                                        (OR (|HasCategory| |#1| '(|BasicType|))
                                            (|HasCategory| |#1|
                                                           '(|OrderedSet|))
                                            #4#)
                                        (OR
                                         (|HasCategory| |#1| '(|OrderedSet|))
                                         #4#)
                                        (AND
                                         (|HasCategory| |#1|
                                                        (LIST '|Evalable|
                                                              (|devaluate|
                                                               |#1|)))
                                         #4#)
                                        (OR
                                         (AND
                                          (|HasCategory| |#1|
                                                         (LIST '|Evalable|
                                                               (|devaluate|
                                                                |#1|)))
                                          (|HasCategory| |#1| '(|OrderedSet|)))
                                         (AND
                                          (|HasCategory| |#1|
                                                         (LIST '|Evalable|
                                                               (|devaluate|
                                                                |#1|)))
                                          #4#))
                                        (LETT #3#
                                              (|HasCategory| |#1|
                                                             '(|CoercibleTo|
                                                               (|OutputForm|)))
                                              . #5#)
                                        (OR #3#
                                            (AND
                                             (|HasCategory| |#1|
                                                            (LIST '|Evalable|
                                                                  (|devaluate|
                                                                   |#1|)))
                                             #4#))
                                        (|HasCategory| (|Integer|)
                                                       '(|OrderedSet|))))
                    . #5#))
    (|haddProp| |$ConstructorCache| '|List| (LIST DV$1) (CONS 1 $))
    (|stuffDomainSlots| $)
    (QSETREFV $ 6 |#1|)
    (AND (|HasCategory| $ '(|finiteAggregate|)) (|augmentPredVector| $ 4096))
    (AND
     (LETT #2#
           (AND (|HasCategory| |#1| '(|BasicType|))
                (|HasCategory| $ '(|finiteAggregate|)))
           . #5#)
     (|augmentPredVector| $ 8192))
    (AND (OR #2# #4#) (|augmentPredVector| $ 16384))
    (AND #4# (|HasCategory| $ '(|finiteAggregate|))
         (|augmentPredVector| $ 32768))
    (AND (LETT #1# (|HasCategory| $ '(|shallowlyMutable|)) . #5#)
         (|augmentPredVector| $ 65536))
    (AND (|HasCategory| |#1| '(|OrderedSet|)) #1#
         (|augmentPredVector| $ 131072))
    (SETF |pv$| (QREFELT $ 3))
    (COND
     ((|testBitVector| |pv$| 3)
      (PROGN
       (QSETREFV $ 21 (CONS (|dispatchFunction| |LIST;OMwrite;Omd$BV;6|) $)))))
    (COND
     ((|testBitVector| |pv$| 4)
      (PROGN
       (QSETREFV $ 24 (CONS (|dispatchFunction| |LIST;setUnion;3$;7|) $))
       (QSETREFV $ 26
                 (CONS (|dispatchFunction| |LIST;setIntersection;3$;8|) $))
       (QSETREFV $ 29
                 (CONS (|dispatchFunction| |LIST;setDifference;3$;9|) $)))))
    (COND
     ((|testBitVector| |pv$| 1)
      (QSETREFV $ 36 (CONS (|dispatchFunction| |LIST;convert;$If;10|) $))))
    $))) 

(MAKEPROP '|List| '|infovec|
          (LIST
           '#(NIL NIL NIL NIL NIL (|IndexedList| 6 (NRTEVAL 1)) (|local| |#1|)
              |LIST;nil;$;1| (|Boolean|) |LIST;null;$B;2| |LIST;cons;S2$;3|
              |LIST;append;3$;4| (|Void|) (|OpenMathDevice|) (0 . |OMputApp|)
              (|String|) (5 . |OMputSymbol|) (12 . |OMwrite|)
              (19 . |OMputEndApp|) (24 . |OMputObject|) (29 . |OMputEndObject|)
              (34 . |OMwrite|) (41 . |concat|) (47 . |removeDuplicates|)
              (52 . |setUnion|) (58 . |member?|) (64 . |setIntersection|)
              (|Integer|) (70 . |elt|) (76 . |setDifference|) (|Symbol|)
              (|InputForm|) (82 . |convert|) (87 . |convert|) (|List| $)
              (92 . |convert|) (97 . |convert|) (|Mapping| 6 6 6)
              (|NonNegativeInteger|) (|List| 6) (|Equation| 6) (|List| 40)
              (|Mapping| 8 6) (|Mapping| 8 6 6) (|UniversalSegment| 27) '"last"
              '"rest" '"first" '"value" (|Mapping| 6 6) (|OutputForm|)
              (|SingleInteger|) (|HashState|) (|List| 27)
              (|Union| 6 '"failed"))
           '#(|setUnion| 102 |setIntersection| 108 |setDifference| 114
              |removeDuplicates| 120 |null| 125 |nil| 130 |member?| 134 |elt|
              140 |convert| 146 |cons| 151 |concat| 157 |append| 163 |OMwrite|
              169)
           'NIL
           (CONS
            (|makeByteWordVec2| 11
                                '(0 0 0 0 0 0 0 0 0 2 0 2 0 0 9 7 0 0 0 0 9 11
                                  1 6 2 3))
            (CONS
             '#(|ListAggregate&| |StreamAggregate&|
                |ExtensibleLinearAggregate&| |FiniteLinearAggregate&|
                |UnaryRecursiveAggregate&| |LinearAggregate&|
                |RecursiveAggregate&| |IndexedAggregate&| |Collection&|
                |OrderedSet&| |HomogeneousAggregate&| NIL |Aggregate&|
                |EltableAggregate&| |Evalable&| |SetCategory&| NIL NIL NIL NIL
                |InnerEvalable&| NIL NIL |BasicType&| |PartialOrder&|
                |OpenMath&|)
             (CONS
              '#((|ListAggregate| 6) (|StreamAggregate| 6)
                 (|ExtensibleLinearAggregate| 6) (|FiniteLinearAggregate| 6)
                 (|UnaryRecursiveAggregate| 6) (|LinearAggregate| 6)
                 (|RecursiveAggregate| 6) (|IndexedAggregate| 27 6)
                 (|Collection| 6) (|OrderedSet|) (|HomogeneousAggregate| 6)
                 (|Comparable|) (|Aggregate|) (|EltableAggregate| 27 6)
                 (|Evalable| 6) (|SetCategory|) (|shallowlyMutable|)
                 (|finiteAggregate|) (|Type|) (|Eltable| 27 6)
                 (|InnerEvalable| 6 6) (|CoercibleTo| 50) (|ConvertibleTo| 31)
                 (|BasicType|) (|PartialOrder|) (|OpenMath|))
              (|makeByteWordVec2| 36
                                  '(1 13 12 0 14 3 13 12 0 15 15 16 3 6 12 13 0
                                    8 17 1 13 12 0 18 1 13 12 0 19 1 13 12 0 20
                                    3 0 12 13 0 8 21 2 0 0 0 0 22 1 0 0 0 23 2
                                    0 0 0 0 24 2 0 8 6 0 25 2 0 0 0 0 26 2 0 6
                                    0 27 28 2 0 0 0 0 29 1 31 0 30 32 1 6 31 0
                                    33 1 31 0 34 35 1 0 31 0 36 2 4 0 0 0 24 2
                                    4 0 0 0 26 2 4 0 0 0 29 1 14 0 0 23 1 0 8 0
                                    9 0 0 0 7 2 14 8 6 0 25 2 0 6 0 27 28 1 1
                                    31 0 36 2 0 0 6 0 10 2 0 0 0 0 22 2 0 0 0 0
                                    11 3 3 12 13 0 8 21)))))
           '|lookupIncomplete|)) 
