aboutsummaryrefslogtreecommitdiff
path: root/src/algebra/strap/POLYCAT.lsp
blob: c511ad1476256ff44c4c0581b675f4560a792367 (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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
(/VERSIONCHECK 2) 

(DEFPARAMETER |PolynomialCategory;CAT| 'NIL) 

(DEFPARAMETER |PolynomialCategory;AL| 'NIL) 

(DEFUN |PolynomialCategory;| (|t#1| |t#2| |t#3|)
  (LET ((#0=#:G1416
            (|sublisV|
                (PAIR '(|t#1| |t#2| |t#3|)
                      (LIST (|devaluate| |t#1|) (|devaluate| |t#2|)
                            (|devaluate| |t#3|)))
                (COND
                  (|PolynomialCategory;CAT|)
                  (T (SETQ |PolynomialCategory;CAT|
                           (|Join| (|PartialDifferentialRing| '|t#3|)
                                   (|FiniteAbelianMonoidRing| '|t#1|
                                    '|t#2|)
                                   (|Evalable| '$)
                                   (|InnerEvalable| '|t#3| '|t#1|)
                                   (|InnerEvalable| '|t#3| '$)
                                   (|RetractableTo| '|t#3|)
                                   (|FullyLinearlyExplicitRingOver|
                                    '|t#1|)
                                   (|mkCategory| '|domain|
                                    '(((|degree|
                                        ((|NonNegativeInteger|) $
                                         |t#3|))
                                       T)
                                      ((|degree|
                                        ((|List|
                                          (|NonNegativeInteger|))
                                         $ (|List| |t#3|)))
                                       T)
                                      ((|coefficient|
                                        ($ $ |t#3|
                                         (|NonNegativeInteger|)))
                                       T)
                                      ((|coefficient|
                                        ($ $ (|List| |t#3|)
                                         (|List|
                                          (|NonNegativeInteger|))))
                                       T)
                                      ((|monomials| ((|List| $) $)) T)
                                      ((|univariate|
                                        ((|SparseUnivariatePolynomial|
                                          $)
                                         $ |t#3|))
                                       T)
                                      ((|univariate|
                                        ((|SparseUnivariatePolynomial|
                                          |t#1|)
                                         $))
                                       T)
                                      ((|mainVariable|
                                        ((|Union| |t#3| "failed") $))
                                       T)
                                      ((|minimumDegree|
                                        ((|NonNegativeInteger|) $
                                         |t#3|))
                                       T)
                                      ((|minimumDegree|
                                        ((|List|
                                          (|NonNegativeInteger|))
                                         $ (|List| |t#3|)))
                                       T)
                                      ((|monicDivide|
                                        ((|Record| (|:| |quotient| $)
                                          (|:| |remainder| $))
                                         $ $ |t#3|))
                                       T)
                                      ((|monomial|
                                        ($ $ |t#3|
                                         (|NonNegativeInteger|)))
                                       T)
                                      ((|monomial|
                                        ($ $ (|List| |t#3|)
                                         (|List|
                                          (|NonNegativeInteger|))))
                                       T)
                                      ((|multivariate|
                                        ($
                                         (|SparseUnivariatePolynomial|
                                          |t#1|)
                                         |t#3|))
                                       T)
                                      ((|multivariate|
                                        ($
                                         (|SparseUnivariatePolynomial|
                                          $)
                                         |t#3|))
                                       T)
                                      ((|isPlus|
                                        ((|Union| (|List| $) "failed")
                                         $))
                                       T)
                                      ((|isTimes|
                                        ((|Union| (|List| $) "failed")
                                         $))
                                       T)
                                      ((|isExpt|
                                        ((|Union|
                                          (|Record| (|:| |var| |t#3|)
                                           (|:| |exponent|
                                            (|NonNegativeInteger|)))
                                          "failed")
                                         $))
                                       T)
                                      ((|totalDegree|
                                        ((|NonNegativeInteger|) $))
                                       T)
                                      ((|totalDegree|
                                        ((|NonNegativeInteger|) $
                                         (|List| |t#3|)))
                                       T)
                                      ((|variables| ((|List| |t#3|) $))
                                       T)
                                      ((|primitiveMonomials|
                                        ((|List| $) $))
                                       T)
                                      ((|resultant| ($ $ $ |t#3|))
                                       (|has| |t#1|
                                        (|CommutativeRing|)))
                                      ((|discriminant| ($ $ |t#3|))
                                       (|has| |t#1|
                                        (|CommutativeRing|)))
                                      ((|content| ($ $ |t#3|))
                                       (|has| |t#1| (|GcdDomain|)))
                                      ((|primitivePart| ($ $))
                                       (|has| |t#1| (|GcdDomain|)))
                                      ((|primitivePart| ($ $ |t#3|))
                                       (|has| |t#1| (|GcdDomain|)))
                                      ((|squareFree|
                                        ((|Factored| $) $))
                                       (|has| |t#1| (|GcdDomain|)))
                                      ((|squareFreePart| ($ $))
                                       (|has| |t#1| (|GcdDomain|))))
                                    '(((|ConvertibleTo| (|InputForm|))
                                       (AND
                                        (|has| |t#3|
                                         (|ConvertibleTo|
                                          (|InputForm|)))
                                        (|has| |t#1|
                                         (|ConvertibleTo|
                                          (|InputForm|)))))
                                      ((|ConvertibleTo|
                                        (|Pattern| (|Integer|)))
                                       (AND
                                        (|has| |t#3|
                                         (|ConvertibleTo|
                                          (|Pattern| (|Integer|))))
                                        (|has| |t#1|
                                         (|ConvertibleTo|
                                          (|Pattern| (|Integer|))))))
                                      ((|ConvertibleTo|
                                        (|Pattern| (|Float|)))
                                       (AND
                                        (|has| |t#3|
                                         (|ConvertibleTo|
                                          (|Pattern| (|Float|))))
                                        (|has| |t#1|
                                         (|ConvertibleTo|
                                          (|Pattern| (|Float|))))))
                                      ((|PatternMatchable| (|Integer|))
                                       (AND
                                        (|has| |t#3|
                                         (|PatternMatchable|
                                          (|Integer|)))
                                        (|has| |t#1|
                                         (|PatternMatchable|
                                          (|Integer|)))))
                                      ((|PatternMatchable| (|Float|))
                                       (AND
                                        (|has| |t#3|
                                         (|PatternMatchable| (|Float|)))
                                        (|has| |t#1|
                                         (|PatternMatchable| (|Float|)))))
                                      ((|GcdDomain|)
                                       (|has| |t#1| (|GcdDomain|)))
                                      (|canonicalUnitNormal|
                                       (|has| |t#1|
                                        (ATTRIBUTE
                                         |canonicalUnitNormal|)))
                                      ((|PolynomialFactorizationExplicit|)
                                       (|has| |t#1|
                                        (|PolynomialFactorizationExplicit|))))
                                    '((|Factored| $) (|List| $)
                                      (|List| |t#3|)
                                      (|NonNegativeInteger|)
                                      (|SparseUnivariatePolynomial| $)
                                      (|SparseUnivariatePolynomial|
                                       |t#1|)
                                      (|List| (|NonNegativeInteger|)))
                                    NIL))))))))
    (|setShellEntry| #0# 0
        (LIST '|PolynomialCategory| (|devaluate| |t#1|)
              (|devaluate| |t#2|) (|devaluate| |t#3|)))
    #0#)) 

(DEFUN |PolynomialCategory| (&REST #0=#:G1419 &AUX #1=#:G1417)
  (DSETQ #1# #0#)
  (LET ((#2=#:G1418
            (|assoc| (|devaluateList| #1#) |PolynomialCategory;AL|)))
    (COND
      (#2# (CDR #2#))
      (T (PROGN
           (SETQ #2# (APPLY #'|PolynomialCategory;| #1#))
           (SETQ |PolynomialCategory;AL|
                 (|cons5| (CONS (|devaluateList| #1#) #2#)
                          |PolynomialCategory;AL|))
           #2#)))))