aboutsummaryrefslogtreecommitdiff
path: root/src/algebra/strap/PI.lsp
blob: 063678d68ed87ea7d322f0f0befcf9f1e705fccb (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
(/VERSIONCHECK 2) 

(SETQ |$CategoryFrame|
      (|put| #0='|PositiveInteger| '|SuperDomain|
             #1='(|NonNegativeInteger|)
             (|put| #1# '|SubDomain|
                    (CONS '(|PositiveInteger| < 0 |#1|)
                          (DELASC #0#
                                  (|get| #1# '|SubDomain|
                                         |$CategoryFrame|)))
                    |$CategoryFrame|))) 

(DEFUN |PositiveInteger| ()
  (PROG ()
    (RETURN
      (PROG (#0=#:G1398)
        (RETURN
          (COND
            ((LETT #0# (HGET |$ConstructorCache| '|PositiveInteger|)
                   |PositiveInteger|)
             (|CDRwithIncrement| (CDAR #0#)))
            ('T
             (UNWIND-PROTECT
               (PROG1 (CDDAR (HPUT |$ConstructorCache|
                                   '|PositiveInteger|
                                   (LIST
                                    (CONS NIL
                                     (CONS 1 (|PositiveInteger;|))))))
                 (LETT #0# T |PositiveInteger|))
               (COND
                 ((NOT #0#)
                  (HREM |$ConstructorCache| '|PositiveInteger|))))))))))) 

(DEFUN |PositiveInteger;| ()
  (PROG (|dv$| $ |pv$|)
    (RETURN
      (PROGN
        (LETT |dv$| '(|PositiveInteger|) . #0=(|PositiveInteger|))
        (LETT $ (|newShell| 12) . #0#)
        (|setShellEntry| $ 0 |dv$|)
        (|setShellEntry| $ 3
            (LETT |pv$| (|buildPredVector| 0 0 NIL) . #0#))
        (|haddProp| |$ConstructorCache| '|PositiveInteger| NIL
            (CONS 1 $))
        (|stuffDomainSlots| $)
        $)))) 

(MAKEPROP '|PositiveInteger| '|infovec|
    (LIST '#(NIL NIL NIL NIL NIL (|NonNegativeInteger|)
             (|PositiveInteger|) (|Boolean|) (|Union| $ '"failed")
             (|SingleInteger|) (|String|) (|OutputForm|))
          '#(~= 0 |sample| 6 |recip| 10 |one?| 15 |min| 20 |max| 26
             |latex| 32 |hash| 37 |gcd| 42 |coerce| 48 ^ 53 |One| 65 >=
             69 > 75 = 81 <= 87 < 93 + 99 ** 105 * 117)
          '(((|commutative| "*") . 0))
          (CONS (|makeByteWordVec2| 1 '(0 0 0 0 0 0 0 0))
                (CONS '#(NIL |Monoid&| |OrderedSet&| |SemiGroup&|
                         |AbelianSemiGroup&| |SetCategory&|
                         |BasicType&| NIL)
                      (CONS '#((|OrderedAbelianSemiGroup|) (|Monoid|)
                               (|OrderedSet|) (|SemiGroup|)
                               (|AbelianSemiGroup|) (|SetCategory|)
                               (|BasicType|) (|CoercibleTo| 11))
                            (|makeByteWordVec2| 11
                                '(2 0 7 0 0 1 0 0 0 1 1 0 8 0 1 1 0 7 0
                                  1 2 0 0 0 0 1 2 0 0 0 0 1 1 0 10 0 1
                                  1 0 9 0 1 2 0 0 0 0 1 1 0 11 0 1 2 0
                                  0 0 6 1 2 0 0 0 5 1 0 0 0 1 2 0 7 0 0
                                  1 2 0 7 0 0 1 2 0 7 0 0 1 2 0 7 0 0 1
                                  2 0 7 0 0 1 2 0 0 0 0 1 2 0 0 0 6 1 2
                                  0 0 0 5 1 2 0 0 0 0 1 2 0 0 6 0 1)))))
          '|lookupComplete|)) 

(SETQ |$CategoryFrame|
      (|put| '|PositiveInteger| '|isFunctor|
             '(((|gcd| ($ $ $)) T (ELT $ NIL))
               ((* ($ $ $)) T (ELT $ NIL))
               ((** ($ $ (|PositiveInteger|))) T (ELT $ NIL))
               ((^ ($ $ (|PositiveInteger|))) T (ELT $ NIL))
               ((|One| ($)) T (CONST $ NIL))
               ((|sample| ($)) T (CONST $ NIL))
               ((|one?| ((|Boolean|) $)) T (ELT $ NIL))
               ((** ($ $ (|NonNegativeInteger|))) T (ELT $ NIL))
               ((^ ($ $ (|NonNegativeInteger|))) T (ELT $ NIL))
               ((|recip| ((|Union| $ "failed") $)) T (ELT $ NIL))
               ((+ ($ $ $)) T (ELT $ NIL))
               ((* ($ (|PositiveInteger|) $)) T (ELT $ NIL))
               ((|min| ($ $ $)) T (ELT $ NIL))
               ((|max| ($ $ $)) T (ELT $ NIL))
               ((<= ((|Boolean|) $ $)) T (ELT $ NIL))
               ((>= ((|Boolean|) $ $)) T (ELT $ NIL))
               ((> ((|Boolean|) $ $)) T (ELT $ NIL))
               ((< ((|Boolean|) $ $)) T (ELT $ NIL))
               ((|latex| ((|String|) $)) T (ELT $ NIL))
               ((|hash| ((|SingleInteger|) $)) T (ELT $ NIL))
               ((|coerce| ((|OutputForm|) $)) T (ELT $ NIL))
               ((= ((|Boolean|) $ $)) T (ELT $ NIL))
               ((~= ((|Boolean|) $ $)) T (ELT $ NIL)))
             (|addModemap| '|PositiveInteger| '(|PositiveInteger|)
                 '((|Join| (|OrderedAbelianSemiGroup|) (|Monoid|)
                           (CATEGORY |domain| (SIGNATURE |gcd| ($ $ $))
                               (ATTRIBUTE (|commutative| "*")))))
                 T '|PositiveInteger|
                 (|put| '|PositiveInteger| '|mode|
                        '(|Mapping|
                             (|Join| (|OrderedAbelianSemiGroup|)
                                     (|Monoid|)
                                     (CATEGORY |domain|
                                      (SIGNATURE |gcd| ($ $ $))
                                      (ATTRIBUTE (|commutative| "*")))))
                        |$CategoryFrame|)))) 

(MAKEPROP '|PositiveInteger| 'NILADIC T)