aboutsummaryrefslogtreecommitdiff
path: root/src/algebra/strap/DIVRING-.lsp
blob: 21f2fc948921ad7e37cd3df49e02c858fb5834d2 (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
(/VERSIONCHECK 2) 

(DEFUN |DIVRING-;**;SIS;1| (|x| |n| $)
  (COND
    ((ZEROP |n|) (|spadConstant| $ 7))
    ((SPADCALL |x| (|getShellEntry| $ 9))
     (COND ((< |n| 0) (|error| "division by zero")) ('T |x|)))
    ((< |n| 0)
     (SPADCALL (SPADCALL |x| (|getShellEntry| $ 11)) (- |n|)
         (|getShellEntry| $ 14)))
    ('T (SPADCALL |x| |n| (|getShellEntry| $ 14))))) 

(DEFUN |DIVRING-;*;F2S;2| (|q| |x| $)
  (SPADCALL
      (SPADCALL (SPADCALL |q| (|getShellEntry| $ 18))
          (SPADCALL
              (SPADCALL (SPADCALL |q| (|getShellEntry| $ 19))
                  (|getShellEntry| $ 20))
              (|getShellEntry| $ 11))
          (|getShellEntry| $ 21))
      |x| (|getShellEntry| $ 22))) 

(DEFUN |DivisionRing&| (|#1|)
  (PROG (|dv$1| |dv$| $ |pv$|)
    (RETURN
      (PROGN
        (LETT |dv$1| (|devaluate| |#1|) . #0=(|DivisionRing&|))
        (LETT |dv$| (LIST '|DivisionRing&| |dv$1|) . #0#)
        (LETT $ (|newShell| 25) . #0#)
        (|setShellEntry| $ 0 |dv$|)
        (|setShellEntry| $ 3
            (LETT |pv$| (|buildPredVector| 0 0 NIL) . #0#))
        (|stuffDomainSlots| $)
        (|setShellEntry| $ 6 |#1|)
        $)))) 

(MAKEPROP '|DivisionRing&| '|infovec|
    (LIST '#(NIL NIL NIL NIL NIL NIL (|local| |#1|) (0 . |One|)
             (|Boolean|) (4 . |zero?|) (9 . |Zero|) (13 . |inv|)
             (|PositiveInteger|) (|RepeatedSquaring| 6) (18 . |expt|)
             (|Integer|) |DIVRING-;**;SIS;1| (|Fraction| 15)
             (24 . |numer|) (29 . |denom|) (34 . |coerce|) (39 . *)
             (45 . *) |DIVRING-;*;F2S;2| (|NonNegativeInteger|))
          '#(** 51 * 57) 'NIL
          (CONS (|makeByteWordVec2| 1 'NIL)
                (CONS '#()
                      (CONS '#()
                            (|makeByteWordVec2| 23
                                '(0 6 0 7 1 6 8 0 9 0 6 0 10 1 6 0 0 11
                                  2 13 6 6 12 14 1 17 15 0 18 1 17 15 0
                                  19 1 6 0 15 20 2 6 0 15 0 21 2 6 0 0
                                  0 22 2 0 0 0 15 16 2 0 0 17 0 23)))))
          '|lookupComplete|)) 

(SETQ |$CategoryFrame|
      (|put| '|DivisionRing&| '|isFunctor|
             '(((** ($ $ (|Integer|))) T (ELT $ 16))
               ((* ($ $ (|Fraction| (|Integer|)))) T (ELT $ NIL))
               ((* ($ (|Fraction| (|Integer|)) $)) T (ELT $ 23))
               ((** ($ $ (|NonNegativeInteger|))) T (ELT $ NIL))
               ((* ($ $ $)) T (ELT $ NIL))
               ((** ($ $ (|PositiveInteger|))) T (ELT $ NIL))
               ((* ($ (|Integer|) $)) T (ELT $ NIL))
               ((* ($ (|NonNegativeInteger|) $)) T (ELT $ NIL))
               ((* ($ (|PositiveInteger|) $)) T (ELT $ NIL)))
             (|addModemap| '|DivisionRing&| '(|DivisionRing&| |#1|)
                 '((CATEGORY |domain|
                       (SIGNATURE ** (|#1| |#1| (|Integer|)))
                       (SIGNATURE *
                           (|#1| |#1| (|Fraction| (|Integer|))))
                       (SIGNATURE *
                           (|#1| (|Fraction| (|Integer|)) |#1|))
                       (SIGNATURE **
                           (|#1| |#1| (|NonNegativeInteger|)))
                       (SIGNATURE * (|#1| |#1| |#1|))
                       (SIGNATURE ** (|#1| |#1| (|PositiveInteger|)))
                       (SIGNATURE * (|#1| (|Integer|) |#1|))
                       (SIGNATURE * (|#1| (|NonNegativeInteger|) |#1|))
                       (SIGNATURE * (|#1| (|PositiveInteger|) |#1|)))
                   (|DivisionRing|))
                 T '|DivisionRing&|
                 (|put| '|DivisionRing&| '|mode|
                        '(|Mapping|
                             (CATEGORY |domain|
                                 (SIGNATURE ** (|#1| |#1| (|Integer|)))
                                 (SIGNATURE *
                                     (|#1| |#1|
                                      (|Fraction| (|Integer|))))
                                 (SIGNATURE *
                                     (|#1| (|Fraction| (|Integer|))
                                      |#1|))
                                 (SIGNATURE **
                                     (|#1| |#1| (|NonNegativeInteger|)))
                                 (SIGNATURE * (|#1| |#1| |#1|))
                                 (SIGNATURE **
                                     (|#1| |#1| (|PositiveInteger|)))
                                 (SIGNATURE * (|#1| (|Integer|) |#1|))
                                 (SIGNATURE *
                                     (|#1| (|NonNegativeInteger|) |#1|))
                                 (SIGNATURE *
                                     (|#1| (|PositiveInteger|) |#1|)))
                             (|DivisionRing|))
                        |$CategoryFrame|))))