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

(DEFPARAMETER |EuclideanDomain;AL| 'NIL) 

(DEFUN |EuclideanDomain;| ()
  (LET ((#0=#:G1414
            (|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))))
    (|setShellEntry| #0# 0 '(|EuclideanDomain|))
    #0#)) 

(DEFUN |EuclideanDomain| ()
  (COND
    (|EuclideanDomain;AL|)
    (T (SETQ |EuclideanDomain;AL| (|EuclideanDomain;|))))) 

(MAKEPROP '|EuclideanDomain| 'NILADIC T)