
(/VERSIONCHECK 2) 

(DEFUN |BSTREE;binarySearchTree;L$;1| (|u| $)
  (PROG (|tree| |x| #0=#:G1823)
    (RETURN
      (SEQ (COND
             ((NULL |u|) (SPADCALL (QREFELT $ 8)))
             ('T
              (SEQ (LETT |tree|
                         (SPADCALL (|SPADfirst| |u|) (QREFELT $ 9))
                         . #1=(|BSTREE;binarySearchTree;L$;1|))
                   (SEQ (LETT |x| NIL . #1#) (LETT #0# (CDR |u|) . #1#)
                        G190
                        (COND
                          ((OR (ATOM #0#)
                               (PROGN (LETT |x| (CAR #0#) . #1#) NIL))
                           (GO G191)))
                        (SEQ (EXIT (SPADCALL |x| |tree| (QREFELT $ 10))))
                        (LETT #0# (CDR #0#) . #1#) (GO G190) G191
                        (EXIT NIL))
                   (EXIT |tree|)))))))) 

(DEFUN |BSTREE;insert!;S2$;2| (|x| |t| $)
  (SEQ (COND
         ((SPADCALL |t| (QREFELT $ 14)) (SPADCALL |x| (QREFELT $ 9)))
         ((NULL (SPADCALL |x| (SPADCALL |t| (QREFELT $ 15))
                    (QREFELT $ 16)))
          (SEQ (SPADCALL |t|
                   (SPADCALL |x| (SPADCALL |t| (QREFELT $ 17))
                       (QREFELT $ 10))
                   (QREFELT $ 18))
               (EXIT |t|)))
         ('T
          (SEQ (SPADCALL |t|
                   (SPADCALL |x| (SPADCALL |t| (QREFELT $ 19))
                       (QREFELT $ 10))
                   (QREFELT $ 20))
               (EXIT |t|)))))) 

(DEFUN |BSTREE;split;S$R;3| (|x| |t| $)
  (PROG (|a|)
    (RETURN
      (SEQ (COND
             ((SPADCALL |t| (QREFELT $ 14))
              (CONS (SPADCALL (QREFELT $ 8)) (SPADCALL (QREFELT $ 8))))
             ((SPADCALL (SPADCALL |t| (QREFELT $ 15)) |x|
                  (QREFELT $ 16))
              (SEQ (LETT |a|
                         (SPADCALL |x| (SPADCALL |t| (QREFELT $ 17))
                             (QREFELT $ 22))
                         . #0=(|BSTREE;split;S$R;3|))
                   (EXIT (CONS (SPADCALL (SPADCALL |t| (QREFELT $ 19))
                                   (SPADCALL |t| (QREFELT $ 15))
                                   (QCAR |a|) (QREFELT $ 23))
                               (QCDR |a|)))))
             ('T
              (SEQ (LETT |a|
                         (SPADCALL |x| (SPADCALL |t| (QREFELT $ 19))
                             (QREFELT $ 22)) . #0#)
                   (EXIT (CONS (QCAR |a|)
                               (SPADCALL (QCDR |a|)
                                   (SPADCALL |t| (QREFELT $ 15))
                                   (SPADCALL |t| (QREFELT $ 17))
                                   (QREFELT $ 23))))))))))) 

(DEFUN |BSTREE;insertRoot!;S2$;4| (|x| |t| $)
  (PROG (|a|)
    (RETURN
      (SEQ (LETT |a| (SPADCALL |x| |t| (QREFELT $ 22))
                 |BSTREE;insertRoot!;S2$;4|)
           (EXIT (SPADCALL (QCAR |a|) |x| (QCDR |a|) (QREFELT $ 23))))))) 

(DEFUN |BinarySearchTree| (#0=#:G1842)
  (PROG ()
    (RETURN
      (PROG (#1=#:G1843)
        (RETURN
          (COND
            ((LETT #1#
                   (|lassocShiftWithFunction| (LIST (|devaluate| #0#))
                       (HGET |$ConstructorCache| '|BinarySearchTree|)
                       '|domainEqualList|)
                   . #2=(|BinarySearchTree|))
             (|CDRwithIncrement| #1#))
            ('T
             (UNWIND-PROTECT
               (PROG1 (|BinarySearchTree;| #0#) (LETT #1# T . #2#))
               (COND
                 ((NOT #1#)
                  (HREM |$ConstructorCache| '|BinarySearchTree|))))))))))) 

(DEFUN |BinarySearchTree;| (|#1|)
  (PROG (DV$1 |dv$| $ #0=#:G1841 |pv$|)
    (RETURN
      (PROGN
        (LETT DV$1 (|devaluate| |#1|) . #1=(|BinarySearchTree|))
        (LETT |dv$| (LIST '|BinarySearchTree| DV$1) . #1#)
        (LETT $ (GETREFV 38) . #1#)
        (QSETREFV $ 0 |dv$|)
        (QSETREFV $ 3
            (LETT |pv$|
                  (|buildPredVector| 0 0
                      (LIST (LETT #0#
                                  (|HasCategory| |#1| '(|SetCategory|)) . #1#)
                            (AND #0#
                                 (|HasCategory| |#1|
                                     (LIST '|Evalable|
                                      (|devaluate| |#1|)))))) . #1#))
        (|haddProp| |$ConstructorCache| '|BinarySearchTree| (LIST DV$1)
            (CONS 1 $))
        (|stuffDomainSlots| $)
        (QSETREFV $ 6 |#1|)
        (AND (|HasCategory| $ '(|finiteAggregate|))
             (|augmentPredVector| $ 4))
        (AND (|HasCategory| $ '(|finiteAggregate|)) #0#
             (|augmentPredVector| $ 8))
        (AND (|HasCategory| $ '(|shallowlyMutable|))
             (|augmentPredVector| $ 16))
        (QSETREFV $ 7 (|BinaryTree| |#1|))
        $)))) 

(MAKEPROP '|BinarySearchTree| '|infovec|
    (LIST '#(NIL NIL NIL NIL NIL (|BinaryTree| 6) (|local| |#1|) '|Rep|
             (0 . |empty|) (4 . |binaryTree|) |BSTREE;insert!;S2$;2|
             (|List| 6) |BSTREE;binarySearchTree;L$;1| (|Boolean|)
             (9 . |empty?|) (14 . |value|) (19 . <) (25 . |right|)
             (30 . |setright!|) (36 . |left|) (41 . |setleft!|)
             (|Record| (|:| |less| $) (|:| |greater| $))
             |BSTREE;split;S$R;3| (47 . |node|)
             |BSTREE;insertRoot!;S2$;4| (|NonNegativeInteger|)
             (|List| 27) (|Equation| 6) (|Mapping| 13 6) '"right"
             '"left" (|List| $) '"value" (|Mapping| 6 6) (|OutputForm|)
             (|SingleInteger|) (|String|) (|Integer|))
          '#(~= 54 |value| 60 |split| 65 |size?| 71 |setvalue!| 77
             |setright!| 83 |setleft!| 89 |setelt| 95 |setchildren!|
             116 |sample| 122 |right| 126 |parts| 131 |nodes| 136
             |node?| 141 |node| 147 |more?| 154 |members| 160 |member?|
             165 |map!| 171 |map| 177 |less?| 183 |left| 189 |leaves|
             194 |leaf?| 199 |latex| 204 |insertRoot!| 209 |insert!|
             215 |hash| 221 |every?| 226 |eval| 232 |eq?| 258 |empty?|
             264 |empty| 269 |elt| 273 |distance| 291 |cyclic?| 297
             |count| 302 |copy| 314 |coerce| 319 |children| 324
             |child?| 329 |binarySearchTree| 335 |any?| 340 = 346 |#|
             352)
          'NIL
          (CONS (|makeByteWordVec2| 2 '(0 0 0 0 0 2 1 0 0 0 2 1 1))
                (CONS '#(|BinaryTreeCategory&|
                         |BinaryRecursiveAggregate&|
                         |RecursiveAggregate&| |HomogeneousAggregate&|
                         |Aggregate&| |Evalable&| |SetCategory&| NIL
                         NIL NIL |InnerEvalable&| |BasicType&| NIL)
                      (CONS '#((|BinaryTreeCategory| 6)
                               (|BinaryRecursiveAggregate| 6)
                               (|RecursiveAggregate| 6)
                               (|HomogeneousAggregate| 6) (|Aggregate|)
                               (|Evalable| 6) (|SetCategory|) (|Type|)
                               (|finiteAggregate|) (|shallowlyMutable|)
                               (|InnerEvalable| 6 6) (|BasicType|)
                               (|CoercibleTo| 34))
                            (|makeByteWordVec2| 37
                                '(0 0 0 8 1 7 0 6 9 1 0 13 0 14 1 0 6 0
                                  15 2 6 13 0 0 16 1 0 0 0 17 2 0 0 0 0
                                  18 1 0 0 0 19 2 0 0 0 0 20 3 0 0 0 6
                                  0 23 2 1 13 0 0 1 1 0 6 0 15 2 0 21 6
                                  0 22 2 0 13 0 25 1 2 5 6 0 6 1 2 5 0
                                  0 0 18 2 5 0 0 0 20 3 5 0 0 29 0 1 3
                                  5 0 0 30 0 1 3 5 6 0 32 6 1 2 5 0 0
                                  31 1 0 0 0 1 1 0 0 0 17 1 3 11 0 1 1
                                  0 31 0 1 2 1 13 0 0 1 3 0 0 0 6 0 23
                                  2 0 13 0 25 1 1 3 11 0 1 2 4 13 6 0 1
                                  2 5 0 33 0 1 2 0 0 33 0 1 2 0 13 0 25
                                  1 1 0 0 0 19 1 0 11 0 1 1 0 13 0 1 1
                                  1 36 0 1 2 0 0 6 0 24 2 0 0 6 0 10 1
                                  1 35 0 1 2 3 13 28 0 1 3 2 0 0 11 11
                                  1 3 2 0 0 6 6 1 2 2 0 0 26 1 2 2 0 0
                                  27 1 2 0 13 0 0 1 1 0 13 0 14 0 0 0 8
                                  2 0 0 0 29 1 2 0 0 0 30 1 2 0 6 0 32
                                  1 2 0 37 0 0 1 1 0 13 0 1 2 4 25 6 0
                                  1 2 3 25 28 0 1 1 0 0 0 1 1 1 34 0 1
                                  1 0 31 0 1 2 1 13 0 0 1 1 0 0 11 12 2
                                  3 13 28 0 1 2 1 13 0 0 1 1 3 25 0 1)))))
          '|lookupComplete|)) 
