aboutsummaryrefslogtreecommitdiff
path: root/src/algebra/strap/EUCDOM.lsp
blob: 2597fe0be4156254bed7747df26aa0d19a764350 (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
(/VERSIONCHECK 2) 

(DEFPARAMETER |EuclideanDomain;AL| 'NIL) 

(DEFUN |EuclideanDomain| ()
  (LET (#:G1411)
    (COND
      (|EuclideanDomain;AL|)
      (T (SETQ |EuclideanDomain;AL| (|EuclideanDomain;|)))))) 

(DEFUN |EuclideanDomain;| ()
  (PROG (#0=#:G1409)
    (RETURN
      (PROG1 (LETT #0#
                   (|Join| (|PrincipalIdealDomain|)
                           (|mkCategory| '|domain|
                               '(((|sizeLess?| ((|Boolean|) $ $)) T)
                                 ((|euclideanSize|
                                      ((|NonNegativeInteger|) $))
                                  T)
                                 ((|divide|
                                      ((|Record| (|:| |quotient| $)
                                        (|:| |remainder| $))
                                       $ $))
                                  T)
                                 ((|quo| ($ $ $)) T)
                                 ((|rem| ($ $ $)) T)
                                 ((|extendedEuclidean|
                                      ((|Record| (|:| |coef1| $)
                                        (|:| |coef2| $)
                                        (|:| |generator| $))
                                       $ $))
                                  T)
                                 ((|extendedEuclidean|
                                      ((|Union|
                                        (|Record| (|:| |coef1| $)
                                         (|:| |coef2| $))
                                        "failed")
                                       $ $ $))
                                  T)
                                 ((|multiEuclidean|
                                      ((|Union| (|List| $) "failed")
                                       (|List| $) $))
                                  T))
                               NIL
                               '((|List| $) (|NonNegativeInteger|)
                                 (|Boolean|))
                               NIL))
                   |EuclideanDomain|)
        (SETELT #0# 0 '(|EuclideanDomain|)))))) 

(SETQ |$CategoryFrame|
      (|put| '|EuclideanDomain| '|isCategory| T
             (|addModemap| '|EuclideanDomain| '(|EuclideanDomain|)
                 '((|Category|)) T '|EuclideanDomain| |$CategoryFrame|))) 

(MAKEPROP '|EuclideanDomain| 'NILADIC T)