
(/VERSIONCHECK 2) 

(PUT '|ONECOMP;coerce;R$;1| '|SPADreplace| '(XLAM (|r|) (CONS 0 |r|))) 

(DEFUN |ONECOMP;coerce;R$;1| (|r| $) (CONS 0 |r|)) 

(DEFUN |ONECOMP;retract;$R;2| (|x| $)
  (COND ((QEQCAR |x| 0) (QCDR |x|)) ('T (|error| "Not finite")))) 

(PUT '|ONECOMP;finite?;$B;3| '|SPADreplace| '(XLAM (|x|) (QEQCAR |x| 0))) 

(DEFUN |ONECOMP;finite?;$B;3| (|x| $) (QEQCAR |x| 0)) 

(PUT '|ONECOMP;infinite?;$B;4| '|SPADreplace| '(XLAM (|x|) (QEQCAR |x| 1))) 

(DEFUN |ONECOMP;infinite?;$B;4| (|x| $) (QEQCAR |x| 1)) 

(PUT '|ONECOMP;infinity;$;5| '|SPADreplace| '(XLAM NIL (CONS 1 "infinity"))) 

(DEFUN |ONECOMP;infinity;$;5| ($) (CONS 1 "infinity")) 

(DEFUN |ONECOMP;retractIfCan;$U;6| (|x| $)
  (COND ((QEQCAR |x| 0) (CONS 0 (QCDR |x|))) ('T (CONS 1 "failed")))) 

(DEFUN |ONECOMP;coerce;$Of;7| (|x| $)
  (COND ((QEQCAR |x| 1) "infinity") ('T (SPADCALL (QCDR |x|) (QREFELT $ 17))))) 

(DEFUN |ONECOMP;=;2$B;8| (|x| |y| $)
  (COND ((QEQCAR |x| 1) (QEQCAR |y| 1)) ((QEQCAR |y| 1) 'NIL)
        ('T (SPADCALL (QCDR |x|) (QCDR |y|) (QREFELT $ 19))))) 

(DEFUN |ONECOMP;Zero;$;9| ($) (CONS 0 (|spadConstant| $ 21))) 

(DEFUN |ONECOMP;*;I2$;10| (|n| |x| $)
  (COND
   ((QEQCAR |x| 1)
    (COND ((ZEROP |n|) (|error| "Undefined product"))
          (#1='T (SPADCALL (QREFELT $ 13)))))
   (#1# (CONS 0 (SPADCALL |n| (QCDR |x|) (QREFELT $ 24)))))) 

(DEFUN |ONECOMP;-;2$;11| (|x| $)
  (COND ((QEQCAR |x| 1) (|error| "Undefined inverse"))
        ('T (CONS 0 (SPADCALL (QCDR |x|) (QREFELT $ 26)))))) 

(DEFUN |ONECOMP;+;3$;12| (|x| |y| $)
  (COND ((QEQCAR |x| 1) |x|) ((QEQCAR |y| 1) |y|)
        ('T (CONS 0 (SPADCALL (QCDR |x|) (QCDR |y|) (QREFELT $ 28)))))) 

(DEFUN |ONECOMP;One;$;13| ($) (CONS 0 (|spadConstant| $ 30))) 

(DEFUN |ONECOMP;characteristic;Nni;14| ($) (SPADCALL (QREFELT $ 33))) 

(DEFUN |ONECOMP;fininf| (|r| $)
  (COND ((SPADCALL |r| (QREFELT $ 35)) (|error| "Undefined product"))
        ('T (SPADCALL (QREFELT $ 13))))) 

(DEFUN |ONECOMP;*;3$;16| (|x| |y| $)
  (COND
   ((QEQCAR |x| 1)
    (COND ((QEQCAR |y| 1) |y|) (#1='T (|ONECOMP;fininf| (QCDR |y|) $))))
   ((QEQCAR |y| 1) (|ONECOMP;fininf| (QCDR |x|) $))
   (#1# (CONS 0 (SPADCALL (QCDR |x|) (QCDR |y|) (QREFELT $ 36)))))) 

(DEFUN |ONECOMP;recip;$U;17| (|x| $)
  (PROG (|u|)
    (RETURN
     (SEQ
      (COND ((QEQCAR |x| 1) (CONS 0 (|spadConstant| $ 22)))
            ((SPADCALL (QCDR |x|) (QREFELT $ 35))
             (CONS 0 (SPADCALL (QREFELT $ 13))))
            (#1='T
             (SEQ
              (LETT |u| (SPADCALL (QCDR |x|) (QREFELT $ 39))
                    |ONECOMP;recip;$U;17|)
              (EXIT
               (COND ((QEQCAR |u| 1) (CONS 1 "failed"))
                     (#1# (CONS 0 (CONS 0 (QCDR |u|))))))))))))) 

(DEFUN |ONECOMP;<;2$B;18| (|x| |y| $)
  (COND ((QEQCAR |x| 1) 'NIL) ((QEQCAR |y| 1) 'T)
        ('T (SPADCALL (QCDR |x|) (QCDR |y|) (QREFELT $ 41))))) 

(DEFUN |ONECOMP;rational?;$B;19| (|x| $) (SPADCALL |x| (QREFELT $ 11))) 

(DEFUN |ONECOMP;rational;$F;20| (|x| $)
  (SPADCALL (CONS 0 (SPADCALL |x| (QREFELT $ 9))) (QREFELT $ 45))) 

(DEFUN |ONECOMP;rationalIfCan;$U;21| (|x| $)
  (PROG (|r|)
    (RETURN
     (SEQ
      (LETT |r| (SPADCALL |x| (QREFELT $ 15)) |ONECOMP;rationalIfCan;$U;21|)
      (EXIT
       (COND ((QEQCAR |r| 1) (CONS 1 "failed"))
             ('T (CONS 0 (SPADCALL (QCDR |r|) (QREFELT $ 46)))))))))) 

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

(DEFUN |OnePointCompletion;| (|#1|)
  (PROG (|pv$| #1=#:G1863 $ |dv$| DV$1)
    (RETURN
     (PROGN
      (LETT DV$1 (|devaluate| |#1|) . #2=(|OnePointCompletion|))
      (LETT |dv$| (LIST '|OnePointCompletion| DV$1) . #2#)
      (LETT $ (GETREFV 53) . #2#)
      (QSETREFV $ 0 |dv$|)
      (QSETREFV $ 3
                (LETT |pv$|
                      (|buildPredVector| 0 0
                                         (LIST
                                          (|HasCategory| |#1| '(|OrderedRing|))
                                          (|HasCategory| |#1|
                                                         '(|RetractableTo|
                                                           (|Fraction|
                                                            (|Integer|))))
                                          (|HasCategory| |#1|
                                                         '(|RetractableTo|
                                                           (|Integer|)))
                                          (|HasCategory| |#1|
                                                         '(|IntegerNumberSystem|))
                                          (OR
                                           (|HasCategory| |#1|
                                                          '(|RetractableTo|
                                                            (|Integer|)))
                                           (|HasCategory| |#1|
                                                          '(|OrderedRing|)))
                                          (LETT #1#
                                                (|HasCategory| |#1|
                                                               '(|AbelianGroup|))
                                                . #2#)
                                          (OR #1#
                                              (|HasCategory| |#1|
                                                             '(|OrderedRing|)))))
                      . #2#))
      (|haddProp| |$ConstructorCache| '|OnePointCompletion| (LIST DV$1)
                  (CONS 1 $))
      (|stuffDomainSlots| $)
      (QSETREFV $ 6 |#1|)
      (QSETREFV $ 7 (|Union| |#1| "infinity"))
      (COND
       ((|testBitVector| |pv$| 6)
        (PROGN
         (QSETREFV $ 22
                   (CONS IDENTITY
                         (FUNCALL (|dispatchFunction| |ONECOMP;Zero;$;9|) $)))
         (QSETREFV $ 25 (CONS (|dispatchFunction| |ONECOMP;*;I2$;10|) $))
         (QSETREFV $ 27 (CONS (|dispatchFunction| |ONECOMP;-;2$;11|) $))
         (QSETREFV $ 29 (CONS (|dispatchFunction| |ONECOMP;+;3$;12|) $)))))
      (COND
       ((|testBitVector| |pv$| 1)
        (PROGN
         (QSETREFV $ 31
                   (CONS IDENTITY
                         (FUNCALL (|dispatchFunction| |ONECOMP;One;$;13|) $)))
         (QSETREFV $ 34
                   (CONS (|dispatchFunction| |ONECOMP;characteristic;Nni;14|)
                         $))
         (QSETREFV $ 37 (CONS (|dispatchFunction| |ONECOMP;*;3$;16|) $))
         (QSETREFV $ 40 (CONS (|dispatchFunction| |ONECOMP;recip;$U;17|) $))
         (QSETREFV $ 42 (CONS (|dispatchFunction| |ONECOMP;<;2$B;18|) $)))))
      (COND
       ((|testBitVector| |pv$| 4)
        (PROGN
         (QSETREFV $ 43
                   (CONS (|dispatchFunction| |ONECOMP;rational?;$B;19|) $))
         (QSETREFV $ 45 (CONS (|dispatchFunction| |ONECOMP;rational;$F;20|) $))
         (QSETREFV $ 48
                   (CONS (|dispatchFunction| |ONECOMP;rationalIfCan;$U;21|)
                         $)))))
      $)))) 

(MAKEPROP '|OnePointCompletion| '|infovec|
          (LIST
           '#(NIL NIL NIL NIL NIL NIL (|local| |#1|) '|Rep|
              |ONECOMP;coerce;R$;1| |ONECOMP;retract;$R;2| (|Boolean|)
              |ONECOMP;finite?;$B;3| |ONECOMP;infinite?;$B;4|
              |ONECOMP;infinity;$;5| (|Union| 6 '"failed")
              |ONECOMP;retractIfCan;$U;6| (|OutputForm|) (0 . |coerce|)
              |ONECOMP;coerce;$Of;7| (5 . =) |ONECOMP;=;2$B;8| (11 . |Zero|)
              (15 . |Zero|) (|Integer|) (19 . *) (25 . *) (31 . -) (36 . -)
              (41 . +) (47 . +) (53 . |One|) (57 . |One|)
              (|NonNegativeInteger|) (61 . |characteristic|)
              (65 . |characteristic|) (69 . |zero?|) (74 . *) (80 . *)
              (|Union| $ '"failed") (86 . |recip|) (91 . |recip|) (96 . <)
              (102 . <) (108 . |rational?|) (|Fraction| 23) (113 . |rational|)
              (118 . |rational|) (|Union| 44 '"failed") (123 . |rationalIfCan|)
              (|PositiveInteger|) (|Union| 23 '"failed") (|SingleInteger|)
              (|String|))
           '#(~= 128 |zero?| 134 |subtractIfCan| 139 |smaller?| 145 |sign| 151
              |sample| 156 |retractIfCan| 160 |retract| 175 |recip| 190
              |rationalIfCan| 195 |rational?| 200 |rational| 205 |positive?|
              210 |one?| 215 |negative?| 220 |min| 225 |max| 231 |latex| 237
              |infinity| 242 |infinite?| 246 |hash| 251 |finite?| 256 |coerce|
              261 |characteristic| 281 |abs| 285 ^ 290 |Zero| 302 |One| 306 >=
              310 > 316 = 322 <= 328 < 334 - 340 + 351 * 357)
           'NIL
           (CONS
            (|makeByteWordVec2| 7
                                '(1 1 1 1 1 1 1 7 1 1 7 1 1 1 7 1 1 7 0 0 0 0 0
                                  1 2 3))
            (CONS
             '#(|OrderedRing&| NIL |Ring&| NIL NIL NIL NIL |AbelianGroup&| NIL
                NIL NIL |OrderedSet&| NIL |Monoid&| |AbelianMonoid&| NIL
                |SemiGroup&| |AbelianSemiGroup&| |SetCategory&|
                |FullyRetractableTo&| |BasicType&| |RetractableTo&| NIL NIL
                |RetractableTo&| |RetractableTo&|)
             (CONS
              '#((|OrderedRing|) (|OrderedAbelianGroup|) (|Ring|)
                 (|OrderedCancellationAbelianMonoid|) (|Rng|) (|LeftModule| $$)
                 (|OrderedAbelianMonoid|) (|AbelianGroup|)
                 (|OrderedAbelianSemiGroup|) (|SemiRing|)
                 (|CancellationAbelianMonoid|) (|OrderedSet|) (|SemiRng|)
                 (|Monoid|) (|AbelianMonoid|) (|Comparable|) (|SemiGroup|)
                 (|AbelianSemiGroup|) (|SetCategory|) (|FullyRetractableTo| 6)
                 (|BasicType|) (|RetractableTo| 6) (|CoercibleTo| 16)
                 (|unitsKnown|) (|RetractableTo| 44) (|RetractableTo| 23))
              (|makeByteWordVec2| 52
                                  '(1 6 16 0 17 2 6 10 0 0 19 0 6 0 21 0 0 0 22
                                    2 6 0 23 0 24 2 0 0 23 0 25 1 6 0 0 26 1 0
                                    0 0 27 2 6 0 0 0 28 2 0 0 0 0 29 0 6 0 30 0
                                    0 0 31 0 6 32 33 0 0 32 34 1 6 10 0 35 2 6
                                    0 0 0 36 2 0 0 0 0 37 1 6 38 0 39 1 0 38 0
                                    40 2 6 10 0 0 41 2 0 10 0 0 42 1 0 10 0 43
                                    1 0 44 0 45 1 6 44 0 46 1 0 47 0 48 2 0 10
                                    0 0 1 1 6 10 0 1 2 6 38 0 0 1 2 1 10 0 0 1
                                    1 1 23 0 1 0 6 0 1 1 2 47 0 1 1 3 50 0 1 1
                                    0 14 0 15 1 2 44 0 1 1 3 23 0 1 1 0 6 0 9 1
                                    1 38 0 40 1 4 47 0 48 1 4 10 0 43 1 4 44 0
                                    45 1 1 10 0 1 1 1 10 0 1 1 1 10 0 1 2 1 0 0
                                    0 1 2 1 0 0 0 1 1 0 52 0 1 0 0 0 13 1 0 10
                                    0 12 1 0 51 0 1 1 0 10 0 11 1 5 0 23 1 1 2
                                    0 44 1 1 0 0 6 8 1 0 16 0 18 0 1 32 34 1 1
                                    0 0 1 2 1 0 0 32 1 2 1 0 0 49 1 0 6 0 22 0
                                    1 0 31 2 1 10 0 0 1 2 1 10 0 0 1 2 0 10 0 0
                                    20 2 1 10 0 0 1 2 1 10 0 0 42 1 6 0 0 27 2
                                    6 0 0 0 1 2 6 0 0 0 29 2 6 0 49 0 1 2 6 0
                                    32 0 1 2 6 0 23 0 25 2 1 0 0 0 37)))))
           '|lookupComplete|)) 
