aboutsummaryrefslogtreecommitdiff
path: root/src/algebra/strap/INS-.lsp
blob: 1d3cdcca189c8de1fe1d745b0bd7f1946ff714d9 (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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
(/VERSIONCHECK 2) 

(PUT '|INS-;characteristic;Nni;1| '|SPADreplace| '(XLAM NIL 0)) 

(DEFUN |INS-;characteristic;Nni;1| ($) 0) 

(DEFUN |INS-;differentiate;2S;2| (|x| $) (|spadConstant| $ 9)) 

(DEFUN |INS-;even?;SB;3| (|x| $)
  (SPADCALL (SPADCALL |x| (|getShellEntry| $ 12))
      (|getShellEntry| $ 13))) 

(DEFUN |INS-;positive?;SB;4| (|x| $)
  (SPADCALL (|spadConstant| $ 9) |x| (|getShellEntry| $ 15))) 

(PUT '|INS-;copy;2S;5| '|SPADreplace| '(XLAM (|x|) |x|)) 

(DEFUN |INS-;copy;2S;5| (|x| $) |x|) 

(DEFUN |INS-;bit?;2SB;6| (|x| |i| $)
  (SPADCALL
      (SPADCALL |x| (SPADCALL |i| (|getShellEntry| $ 18))
          (|getShellEntry| $ 19))
      (|getShellEntry| $ 12))) 

(DEFUN |INS-;mask;2S;7| (|n| $)
  (SPADCALL (SPADCALL (|spadConstant| $ 21) |n| (|getShellEntry| $ 19))
      (|getShellEntry| $ 22))) 

(PUT '|INS-;rational?;SB;8| '|SPADreplace| '(XLAM (|x|) 'T)) 

(DEFUN |INS-;rational?;SB;8| (|x| $) 'T) 

(DEFUN |INS-;euclideanSize;SNni;9| (|x| $)
  (PROG (#0=#:G1421 #1=#:G1422)
    (RETURN
      (COND
        ((SPADCALL |x| (|spadConstant| $ 9) (|getShellEntry| $ 25))
         (|error| "euclideanSize called on zero"))
        ((SPADCALL |x| (|spadConstant| $ 9) (|getShellEntry| $ 15))
         (PROG1 (LETT #0# (- (SPADCALL |x| (|getShellEntry| $ 27)))
                      |INS-;euclideanSize;SNni;9|)
           (|check-subtype| (>= #0# 0) '(|NonNegativeInteger|) #0#)))
        ('T
         (PROG1 (LETT #1# (SPADCALL |x| (|getShellEntry| $ 27))
                      |INS-;euclideanSize;SNni;9|)
           (|check-subtype| (>= #1# 0) '(|NonNegativeInteger|) #1#))))))) 

(DEFUN |INS-;convert;SF;10| (|x| $)
  (SPADCALL (SPADCALL |x| (|getShellEntry| $ 27))
      (|getShellEntry| $ 30))) 

(DEFUN |INS-;convert;SDf;11| (|x| $)
  (FLOAT (SPADCALL |x| (|getShellEntry| $ 27)) |$DoubleFloatMaximum|)) 

(DEFUN |INS-;convert;SIf;12| (|x| $)
  (SPADCALL (SPADCALL |x| (|getShellEntry| $ 27))
      (|getShellEntry| $ 35))) 

(DEFUN |INS-;retract;SI;13| (|x| $)
  (SPADCALL |x| (|getShellEntry| $ 27))) 

(DEFUN |INS-;convert;SP;14| (|x| $)
  (SPADCALL (SPADCALL |x| (|getShellEntry| $ 27))
      (|getShellEntry| $ 39))) 

(DEFUN |INS-;factor;SF;15| (|x| $)
  (SPADCALL |x| (|getShellEntry| $ 43))) 

(DEFUN |INS-;squareFree;SF;16| (|x| $)
  (SPADCALL |x| (|getShellEntry| $ 46))) 

(DEFUN |INS-;prime?;SB;17| (|x| $)
  (SPADCALL |x| (|getShellEntry| $ 49))) 

(DEFUN |INS-;factorial;2S;18| (|x| $)
  (SPADCALL |x| (|getShellEntry| $ 52))) 

(DEFUN |INS-;binomial;3S;19| (|n| |m| $)
  (SPADCALL |n| |m| (|getShellEntry| $ 54))) 

(DEFUN |INS-;permutation;3S;20| (|n| |m| $)
  (SPADCALL |n| |m| (|getShellEntry| $ 56))) 

(DEFUN |INS-;retractIfCan;SU;21| (|x| $)
  (CONS 0 (SPADCALL |x| (|getShellEntry| $ 27)))) 

(DEFUN |INS-;init;S;22| ($) (|spadConstant| $ 9)) 

(DEFUN |INS-;nextItem;SU;23| (|n| $)
  (COND
    ((SPADCALL |n| (|getShellEntry| $ 61))
     (CONS 0 (|spadConstant| $ 21)))
    ((SPADCALL (|spadConstant| $ 9) |n| (|getShellEntry| $ 15))
     (CONS 0 (SPADCALL |n| (|getShellEntry| $ 18))))
    ('T
     (CONS 0
           (SPADCALL (|spadConstant| $ 21) |n| (|getShellEntry| $ 62)))))) 

(DEFUN |INS-;patternMatch;SP2Pmr;24| (|x| |p| |l| $)
  (SPADCALL |x| |p| |l| (|getShellEntry| $ 67))) 

(DEFUN |INS-;rational;SF;25| (|x| $)
  (SPADCALL (SPADCALL |x| (|getShellEntry| $ 27))
      (|getShellEntry| $ 71))) 

(DEFUN |INS-;rationalIfCan;SU;26| (|x| $)
  (CONS 0
        (SPADCALL (SPADCALL |x| (|getShellEntry| $ 27))
            (|getShellEntry| $ 71)))) 

(DEFUN |INS-;symmetricRemainder;3S;27| (|x| |n| $)
  (PROG (|r|)
    (RETURN
      (SEQ (LETT |r| (SPADCALL |x| |n| (|getShellEntry| $ 75))
                 |INS-;symmetricRemainder;3S;27|)
           (EXIT (COND
                   ((SPADCALL |r| (|spadConstant| $ 9)
                        (|getShellEntry| $ 25))
                    |r|)
                   ('T
                    (SEQ (COND
                           ((SPADCALL |n| (|spadConstant| $ 9)
                                (|getShellEntry| $ 15))
                            (LETT |n|
                                  (SPADCALL |n| (|getShellEntry| $ 18))
                                  |INS-;symmetricRemainder;3S;27|)))
                         (EXIT (COND
                                 ((SPADCALL (|spadConstant| $ 9) |r|
                                      (|getShellEntry| $ 15))
                                  (COND
                                    ((SPADCALL |n|
                                      (SPADCALL 2 |r|
                                       (|getShellEntry| $ 77))
                                      (|getShellEntry| $ 15))
                                     (SPADCALL |r| |n|
                                      (|getShellEntry| $ 62)))
                                    ('T |r|)))
                                 ((NULL (SPADCALL (|spadConstant| $ 9)
                                         (SPADCALL
                                          (SPADCALL 2 |r|
                                           (|getShellEntry| $ 77))
                                          |n| (|getShellEntry| $ 78))
                                         (|getShellEntry| $ 15)))
                                  (SPADCALL |r| |n|
                                      (|getShellEntry| $ 78)))
                                 ('T |r|))))))))))) 

(DEFUN |INS-;invmod;3S;28| (|a| |b| $)
  (PROG (|q| |r| |r1| |c| |c1| |d| |d1|)
    (RETURN
      (SEQ (COND
             ((SPADCALL |a| (|getShellEntry| $ 80))
              (LETT |a| (SPADCALL |a| |b| (|getShellEntry| $ 81))
                    |INS-;invmod;3S;28|)))
           (LETT |c| |a| |INS-;invmod;3S;28|)
           (LETT |c1| (|spadConstant| $ 21) |INS-;invmod;3S;28|)
           (LETT |d| |b| |INS-;invmod;3S;28|)
           (LETT |d1| (|spadConstant| $ 9) |INS-;invmod;3S;28|)
           (SEQ G190
                (COND
                  ((NULL (SPADCALL
                             (SPADCALL |d| (|getShellEntry| $ 61))
                             (|getShellEntry| $ 13)))
                   (GO G191)))
                (SEQ (LETT |q|
                           (SPADCALL |c| |d| (|getShellEntry| $ 82))
                           |INS-;invmod;3S;28|)
                     (LETT |r|
                           (SPADCALL |c|
                               (SPADCALL |q| |d|
                                   (|getShellEntry| $ 83))
                               (|getShellEntry| $ 62))
                           |INS-;invmod;3S;28|)
                     (LETT |r1|
                           (SPADCALL |c1|
                               (SPADCALL |q| |d1|
                                   (|getShellEntry| $ 83))
                               (|getShellEntry| $ 62))
                           |INS-;invmod;3S;28|)
                     (LETT |c| |d| |INS-;invmod;3S;28|)
                     (LETT |c1| |d1| |INS-;invmod;3S;28|)
                     (LETT |d| |r| |INS-;invmod;3S;28|)
                     (EXIT (LETT |d1| |r1| |INS-;invmod;3S;28|)))
                NIL (GO G190) G191 (EXIT NIL))
           (EXIT (COND
                   ((SPADCALL |c| (|spadConstant| $ 21)
                        (|getShellEntry| $ 25))
                    (COND
                      ((SPADCALL |c1| (|getShellEntry| $ 80))
                       (SPADCALL |c1| |b| (|getShellEntry| $ 78)))
                      ('T |c1|)))
                   ('T (|error| "inverse does not exist")))))))) 

(DEFUN |INS-;powmod;4S;29| (|x| |n| |p| $)
  (PROG (|y| #0=#:G1479 |z|)
    (RETURN
      (SEQ (EXIT (SEQ (COND
                        ((SPADCALL |x| (|getShellEntry| $ 80))
                         (LETT |x|
                               (SPADCALL |x| |p|
                                   (|getShellEntry| $ 81))
                               |INS-;powmod;4S;29|)))
                      (EXIT (COND
                              ((SPADCALL |x| (|getShellEntry| $ 61))
                               (|spadConstant| $ 9))
                              ((SPADCALL |n| (|getShellEntry| $ 61))
                               (|spadConstant| $ 21))
                              ('T
                               (SEQ (LETT |y| (|spadConstant| $ 21)
                                     |INS-;powmod;4S;29|)
                                    (LETT |z| |x| |INS-;powmod;4S;29|)
                                    (EXIT
                                     (SEQ G190 NIL
                                      (SEQ
                                       (COND
                                         ((SPADCALL |n|
                                           (|getShellEntry| $ 12))
                                          (LETT |y|
                                           (SPADCALL |y| |z| |p|
                                            (|getShellEntry| $ 85))
                                           |INS-;powmod;4S;29|)))
                                       (EXIT
                                        (COND
                                          ((SPADCALL
                                            (LETT |n|
                                             (SPADCALL |n|
                                              (SPADCALL
                                               (|spadConstant| $ 21)
                                               (|getShellEntry| $ 18))
                                              (|getShellEntry| $ 19))
                                             |INS-;powmod;4S;29|)
                                            (|getShellEntry| $ 61))
                                           (PROGN
                                             (LETT #0# |y|
                                              |INS-;powmod;4S;29|)
                                             (GO #0#)))
                                          ('T
                                           (LETT |z|
                                            (SPADCALL |z| |z| |p|
                                             (|getShellEntry| $ 85))
                                            |INS-;powmod;4S;29|)))))
                                      NIL (GO G190) G191 (EXIT NIL)))))))))
           #0# (EXIT #0#))))) 

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

(MAKEPROP '|IntegerNumberSystem&| '|infovec|
    (LIST '#(NIL NIL NIL NIL NIL NIL (|local| |#1|)
             (|NonNegativeInteger|) |INS-;characteristic;Nni;1|
             (0 . |Zero|) |INS-;differentiate;2S;2| (|Boolean|)
             (4 . |odd?|) (9 . |not|) |INS-;even?;SB;3| (14 . <)
             |INS-;positive?;SB;4| |INS-;copy;2S;5| (20 . -)
             (25 . |shift|) |INS-;bit?;2SB;6| (31 . |One|) (35 . |dec|)
             |INS-;mask;2S;7| |INS-;rational?;SB;8| (40 . =)
             (|Integer|) (46 . |convert|) |INS-;euclideanSize;SNni;9|
             (|Float|) (51 . |coerce|) |INS-;convert;SF;10|
             (|DoubleFloat|) |INS-;convert;SDf;11| (|InputForm|)
             (56 . |convert|) |INS-;convert;SIf;12|
             |INS-;retract;SI;13| (|Pattern| 26) (61 . |coerce|)
             |INS-;convert;SP;14| (|Factored| 6)
             (|IntegerFactorizationPackage| 6) (66 . |factor|)
             (|Factored| $) |INS-;factor;SF;15| (71 . |squareFree|)
             |INS-;squareFree;SF;16| (|IntegerPrimesPackage| 6)
             (76 . |prime?|) |INS-;prime?;SB;17|
             (|IntegerCombinatoricFunctions| 6) (81 . |factorial|)
             |INS-;factorial;2S;18| (86 . |binomial|)
             |INS-;binomial;3S;19| (92 . |permutation|)
             |INS-;permutation;3S;20| (|Union| 26 '"failed")
             |INS-;retractIfCan;SU;21| |INS-;init;S;22| (98 . |zero?|)
             (103 . -) (|Union| $ '"failed") |INS-;nextItem;SU;23|
             (|PatternMatchResult| 26 6)
             (|PatternMatchIntegerNumberSystem| 6)
             (109 . |patternMatch|) (|PatternMatchResult| 26 $)
             |INS-;patternMatch;SP2Pmr;24| (|Fraction| 26)
             (116 . |coerce|) |INS-;rational;SF;25|
             (|Union| 70 '"failed") |INS-;rationalIfCan;SU;26|
             (121 . |rem|) (|PositiveInteger|) (127 . *) (133 . +)
             |INS-;symmetricRemainder;3S;27| (139 . |negative?|)
             (144 . |positiveRemainder|) (150 . |quo|) (156 . *)
             |INS-;invmod;3S;28| (162 . |mulmod|) |INS-;powmod;4S;29|)
          '#(|symmetricRemainder| 169 |squareFree| 175 |retractIfCan|
             180 |retract| 185 |rationalIfCan| 190 |rational?| 195
             |rational| 200 |prime?| 205 |powmod| 210 |positive?| 217
             |permutation| 222 |patternMatch| 228 |nextItem| 235 |mask|
             240 |invmod| 245 |init| 251 |factorial| 255 |factor| 260
             |even?| 265 |euclideanSize| 270 |differentiate| 275 |copy|
             280 |convert| 285 |characteristic| 305 |bit?| 309
             |binomial| 315)
          'NIL
          (CONS (|makeByteWordVec2| 1 'NIL)
                (CONS '#()
                      (CONS '#()
                            (|makeByteWordVec2| 86
                                '(0 6 0 9 1 6 11 0 12 1 11 0 0 13 2 6
                                  11 0 0 15 1 6 0 0 18 2 6 0 0 0 19 0 6
                                  0 21 1 6 0 0 22 2 6 11 0 0 25 1 6 26
                                  0 27 1 29 0 26 30 1 34 0 26 35 1 38 0
                                  26 39 1 42 41 6 43 1 42 41 6 46 1 48
                                  11 6 49 1 51 6 6 52 2 51 6 6 6 54 2
                                  51 6 6 6 56 1 6 11 0 61 2 6 0 0 0 62
                                  3 66 65 6 38 65 67 1 70 0 26 71 2 6 0
                                  0 0 75 2 6 0 76 0 77 2 6 0 0 0 78 1 6
                                  11 0 80 2 6 0 0 0 81 2 6 0 0 0 82 2 6
                                  0 0 0 83 3 6 0 0 0 0 85 2 0 0 0 0 79
                                  1 0 44 0 47 1 0 58 0 59 1 0 26 0 37 1
                                  0 73 0 74 1 0 11 0 24 1 0 70 0 72 1 0
                                  11 0 50 3 0 0 0 0 0 86 1 0 11 0 16 2
                                  0 0 0 0 57 3 0 68 0 38 68 69 1 0 63 0
                                  64 1 0 0 0 23 2 0 0 0 0 84 0 0 0 60 1
                                  0 0 0 53 1 0 44 0 45 1 0 11 0 14 1 0
                                  7 0 28 1 0 0 0 10 1 0 0 0 17 1 0 32 0
                                  33 1 0 29 0 31 1 0 38 0 40 1 0 34 0
                                  36 0 0 7 8 2 0 11 0 0 20 2 0 0 0 0
                                  55)))))
          '|lookupComplete|)) 

(SETQ |$CategoryFrame|
      (|put| '|IntegerNumberSystem&| '|isFunctor|
             '(((|invmod| ($ $ $)) T (ELT $ 84))
               ((|powmod| ($ $ $ $)) T (ELT $ 86))
               ((|mask| ($ $)) T (ELT $ 23))
               ((|copy| ($ $)) T (ELT $ 17))
               ((|rationalIfCan|
                    ((|Union| (|Fraction| (|Integer|)) "failed") $))
                T (ELT $ 74))
               ((|rational| ((|Fraction| (|Integer|)) $)) T (ELT $ 72))
               ((|rational?| ((|Boolean|) $)) T (ELT $ 24))
               ((|symmetricRemainder| ($ $ $)) T (ELT $ 79))
               ((|bit?| ((|Boolean|) $ $)) T (ELT $ 20))
               ((|even?| ((|Boolean|) $)) T (ELT $ 14))
               ((|init| ($)) T (ELT $ 60))
               ((|nextItem| ((|Union| $ "failed") $)) T (ELT $ 64))
               ((|convert| ((|DoubleFloat|) $)) T (ELT $ 33))
               ((|convert| ((|Float|) $)) T (ELT $ 31))
               ((|permutation| ($ $ $)) T (ELT $ 57))
               ((|factorial| ($ $)) T (ELT $ 53))
               ((|binomial| ($ $ $)) T (ELT $ 55))
               ((|patternMatch|
                    ((|PatternMatchResult| (|Integer|) $) $
                     (|Pattern| (|Integer|))
                     (|PatternMatchResult| (|Integer|) $)))
                T (ELT $ 69))
               ((|convert| ((|Pattern| (|Integer|)) $)) T (ELT $ 40))
               ((|convert| ((|InputForm|) $)) T (ELT $ 36))
               ((|retract| ((|Integer|) $)) T (ELT $ 37))
               ((|retractIfCan| ((|Union| (|Integer|) "failed") $)) T
                (ELT $ 59))
               ((|convert| ((|Integer|) $)) T (ELT $ NIL))
               ((|differentiate| ($ $)) T (ELT $ 10))
               ((|differentiate| ($ $ (|NonNegativeInteger|))) T
                (ELT $ NIL))
               ((|positive?| ((|Boolean|) $)) T (ELT $ 16))
               ((|euclideanSize| ((|NonNegativeInteger|) $)) T
                (ELT $ 28))
               ((|factor| ((|Factored| $) $)) T (ELT $ 45))
               ((|squareFree| ((|Factored| $) $)) T (ELT $ 47))
               ((|prime?| ((|Boolean|) $)) T (ELT $ 50))
               ((|characteristic| ((|NonNegativeInteger|))) T
                (ELT $ 8)))
             (|addModemap| '|IntegerNumberSystem&|
                 '(|IntegerNumberSystem&| |#1|)
                 '((CATEGORY |domain|
                       (SIGNATURE |invmod| (|#1| |#1| |#1|))
                       (SIGNATURE |powmod| (|#1| |#1| |#1| |#1|))
                       (SIGNATURE |mask| (|#1| |#1|))
                       (SIGNATURE |copy| (|#1| |#1|))
                       (SIGNATURE |rationalIfCan|
                           ((|Union| (|Fraction| (|Integer|)) "failed")
                            |#1|))
                       (SIGNATURE |rational|
                           ((|Fraction| (|Integer|)) |#1|))
                       (SIGNATURE |rational?| ((|Boolean|) |#1|))
                       (SIGNATURE |symmetricRemainder|
                           (|#1| |#1| |#1|))
                       (SIGNATURE |bit?| ((|Boolean|) |#1| |#1|))
                       (SIGNATURE |even?| ((|Boolean|) |#1|))
                       (SIGNATURE |init| (|#1|))
                       (SIGNATURE |nextItem|
                           ((|Union| |#1| "failed") |#1|))
                       (SIGNATURE |convert| ((|DoubleFloat|) |#1|))
                       (SIGNATURE |convert| ((|Float|) |#1|))
                       (SIGNATURE |permutation| (|#1| |#1| |#1|))
                       (SIGNATURE |factorial| (|#1| |#1|))
                       (SIGNATURE |binomial| (|#1| |#1| |#1|))
                       (SIGNATURE |patternMatch|
                           ((|PatternMatchResult| (|Integer|) |#1|)
                            |#1| (|Pattern| (|Integer|))
                            (|PatternMatchResult| (|Integer|) |#1|)))
                       (SIGNATURE |convert|
                           ((|Pattern| (|Integer|)) |#1|))
                       (SIGNATURE |convert| ((|InputForm|) |#1|))
                       (SIGNATURE |retract| ((|Integer|) |#1|))
                       (SIGNATURE |retractIfCan|
                           ((|Union| (|Integer|) "failed") |#1|))
                       (SIGNATURE |convert| ((|Integer|) |#1|))
                       (SIGNATURE |differentiate| (|#1| |#1|))
                       (SIGNATURE |differentiate|
                           (|#1| |#1| (|NonNegativeInteger|)))
                       (SIGNATURE |positive?| ((|Boolean|) |#1|))
                       (SIGNATURE |euclideanSize|
                           ((|NonNegativeInteger|) |#1|))
                       (SIGNATURE |factor| ((|Factored| |#1|) |#1|))
                       (SIGNATURE |squareFree|
                           ((|Factored| |#1|) |#1|))
                       (SIGNATURE |prime?| ((|Boolean|) |#1|))
                       (SIGNATURE |characteristic|
                           ((|NonNegativeInteger|))))
                   (|IntegerNumberSystem|))
                 T '|IntegerNumberSystem&|
                 (|put| '|IntegerNumberSystem&| '|mode|
                        '(|Mapping|
                             (CATEGORY |domain|
                                 (SIGNATURE |invmod| (|#1| |#1| |#1|))
                                 (SIGNATURE |powmod|
                                     (|#1| |#1| |#1| |#1|))
                                 (SIGNATURE |mask| (|#1| |#1|))
                                 (SIGNATURE |copy| (|#1| |#1|))
                                 (SIGNATURE |rationalIfCan|
                                     ((|Union| (|Fraction| (|Integer|))
                                       "failed")
                                      |#1|))
                                 (SIGNATURE |rational|
                                     ((|Fraction| (|Integer|)) |#1|))
                                 (SIGNATURE |rational?|
                                     ((|Boolean|) |#1|))
                                 (SIGNATURE |symmetricRemainder|
                                     (|#1| |#1| |#1|))
                                 (SIGNATURE |bit?|
                                     ((|Boolean|) |#1| |#1|))
                                 (SIGNATURE |even?| ((|Boolean|) |#1|))
                                 (SIGNATURE |init| (|#1|))
                                 (SIGNATURE |nextItem|
                                     ((|Union| |#1| "failed") |#1|))
                                 (SIGNATURE |convert|
                                     ((|DoubleFloat|) |#1|))
                                 (SIGNATURE |convert| ((|Float|) |#1|))
                                 (SIGNATURE |permutation|
                                     (|#1| |#1| |#1|))
                                 (SIGNATURE |factorial| (|#1| |#1|))
                                 (SIGNATURE |binomial|
                                     (|#1| |#1| |#1|))
                                 (SIGNATURE |patternMatch|
                                     ((|PatternMatchResult| (|Integer|)
                                       |#1|)
                                      |#1| (|Pattern| (|Integer|))
                                      (|PatternMatchResult| (|Integer|)
                                       |#1|)))
                                 (SIGNATURE |convert|
                                     ((|Pattern| (|Integer|)) |#1|))
                                 (SIGNATURE |convert|
                                     ((|InputForm|) |#1|))
                                 (SIGNATURE |retract|
                                     ((|Integer|) |#1|))
                                 (SIGNATURE |retractIfCan|
                                     ((|Union| (|Integer|) "failed")
                                      |#1|))
                                 (SIGNATURE |convert|
                                     ((|Integer|) |#1|))
                                 (SIGNATURE |differentiate|
                                     (|#1| |#1|))
                                 (SIGNATURE |differentiate|
                                     (|#1| |#1| (|NonNegativeInteger|)))
                                 (SIGNATURE |positive?|
                                     ((|Boolean|) |#1|))
                                 (SIGNATURE |euclideanSize|
                                     ((|NonNegativeInteger|) |#1|))
                                 (SIGNATURE |factor|
                                     ((|Factored| |#1|) |#1|))
                                 (SIGNATURE |squareFree|
                                     ((|Factored| |#1|) |#1|))
                                 (SIGNATURE |prime?|
                                     ((|Boolean|) |#1|))
                                 (SIGNATURE |characteristic|
                                     ((|NonNegativeInteger|))))
                             (|IntegerNumberSystem|))
                        |$CategoryFrame|))))