diff options
Diffstat (limited to 'src/algebra/si.spad.pamphlet')
-rw-r--r-- | src/algebra/si.spad.pamphlet | 788 |
1 files changed, 346 insertions, 442 deletions
diff --git a/src/algebra/si.spad.pamphlet b/src/algebra/si.spad.pamphlet index b7be18aa..657586f6 100644 --- a/src/algebra/si.spad.pamphlet +++ b/src/algebra/si.spad.pamphlet @@ -172,78 +172,78 @@ This is eventually forcibly replaced by a recompiled version. (/VERSIONCHECK 2) -(SETQ |IntegerNumberSystem;AL| (QUOTE NIL)) +(DEFPARAMETER |IntegerNumberSystem;AL| 'NIL) -(DEFUN |IntegerNumberSystem| NIL - (LET (#:G1068) - (COND +(DEFUN |IntegerNumberSystem| () + (LET (#:G1403) + (COND (|IntegerNumberSystem;AL|) (T (SETQ |IntegerNumberSystem;AL| (|IntegerNumberSystem;|)))))) -(DEFUN |IntegerNumberSystem;| NIL (PROG (#0=#:G1066) - (RETURN - (PROG1 - (LETT #0# - (|sublisV| - (PAIR - (QUOTE (#1=#:G1060 #2=#:G1061 #3=#:G1062 - #4=#:G1063 #5=#:G1064 #6=#:G1065)) - (LIST - (QUOTE (|Integer|)) - (QUOTE (|Integer|)) - (QUOTE (|Integer|)) - (QUOTE (|InputForm|)) - (QUOTE (|Pattern| (|Integer|))) - (QUOTE (|Integer|)))) - (|Join| - (|UniqueFactorizationDomain|) - (|EuclideanDomain|) - (|OrderedIntegralDomain|) - (|DifferentialRing|) - (|ConvertibleTo| (QUOTE #1#)) - (|RetractableTo| (QUOTE #2#)) - (|LinearlyExplicitRingOver| (QUOTE #3#)) - (|ConvertibleTo| (QUOTE #4#)) - (|ConvertibleTo| (QUOTE #5#)) - (|PatternMatchable| (QUOTE #6#)) - (|CombinatorialFunctionCategory|) - (|RealConstant|) - (|CharacteristicZero|) - (|StepThrough|) - (|mkCategory| - (QUOTE |domain|) - (QUOTE ( - ((|odd?| ((|Boolean|) $)) T) - ((|even?| ((|Boolean|) $)) T) - ((|base| ($)) T) - ((|length| ($ $)) T) - ((|shift| ($ $ $)) T) - ((|bit?| ((|Boolean|) $ $)) T) - ((|positiveRemainder| ($ $ $)) T) - ((|symmetricRemainder| ($ $ $)) T) - ((|rational?| ((|Boolean|) $)) T) - ((|rational| ((|Fraction| (|Integer|)) $)) T) - ((|rationalIfCan| - ((|Union| (|Fraction| (|Integer|)) "failed") $)) T) - ((|random| ($)) T) - ((|random| ($ $)) T) - ((|hash| ($ $)) T) - ((|copy| ($ $)) T) - ((|inc| ($ $)) T) - ((|dec| ($ $)) T) - ((|mask| ($ $)) T) - ((|addmod| ($ $ $ $)) T) - ((|submod| ($ $ $ $)) T) - ((|mulmod| ($ $ $ $)) T) - ((|powmod| ($ $ $ $)) T) - ((|invmod| ($ $ $)) T))) - (QUOTE ((|multiplicativeValuation| T) (|canonicalUnitNormal| T))) - (QUOTE ((|Fraction| (|Integer|)) (|Boolean|))) NIL))) - |IntegerNumberSystem|) - (SETELT #0# 0 (QUOTE (|IntegerNumberSystem|))))))) - -(MAKEPROP (QUOTE |IntegerNumberSystem|) (QUOTE NILADIC) T) - +(DEFUN |IntegerNumberSystem;| () + (PROG (#0=#:G1401) + (RETURN + (PROG1 (LETT #0# + (|sublisV| + (PAIR '(#1=#:G1395 #2=#:G1396 #3=#:G1397 + #4=#:G1398 #5=#:G1399 #6=#:G1400) + (LIST '(|Integer|) '(|Integer|) + '(|Integer|) '(|InputForm|) + '(|Pattern| (|Integer|)) + '(|Integer|))) + (|Join| (|UniqueFactorizationDomain|) + (|EuclideanDomain|) + (|OrderedIntegralDomain|) + (|DifferentialRing|) + (|ConvertibleTo| '#1#) + (|RetractableTo| '#2#) + (|LinearlyExplicitRingOver| '#3#) + (|ConvertibleTo| '#4#) + (|ConvertibleTo| '#5#) + (|PatternMatchable| '#6#) + (|CombinatorialFunctionCategory|) + (|RealConstant|) (|CharacteristicZero|) + (|StepThrough|) + (|mkCategory| '|domain| + '(((|odd?| ((|Boolean|) $)) T) + ((|even?| ((|Boolean|) $)) T) + ((|base| ($)) T) + ((|length| ($ $)) T) + ((|shift| ($ $ $)) T) + ((|bit?| ((|Boolean|) $ $)) T) + ((|positiveRemainder| ($ $ $)) T) + ((|symmetricRemainder| ($ $ $)) T) + ((|rational?| ((|Boolean|) $)) T) + ((|rational| + ((|Fraction| (|Integer|)) $)) + T) + ((|rationalIfCan| + ((|Union| + (|Fraction| (|Integer|)) + "failed") + $)) + T) + ((|random| ($)) T) + ((|random| ($ $)) T) + ((|hash| ($ $)) T) + ((|copy| ($ $)) T) + ((|inc| ($ $)) T) + ((|dec| ($ $)) T) + ((|mask| ($ $)) T) + ((|addmod| ($ $ $ $)) T) + ((|submod| ($ $ $ $)) T) + ((|mulmod| ($ $ $ $)) T) + ((|powmod| ($ $ $ $)) T) + ((|invmod| ($ $ $)) T)) + '((|multiplicativeValuation| T) + (|canonicalUnitNormal| T)) + '((|Fraction| (|Integer|)) + (|Boolean|)) + NIL))) + |IntegerNumberSystem|) + (SETELT #0# 0 '(|IntegerNumberSystem|)))))) + +(MAKEPROP '|IntegerNumberSystem| 'NILADIC T) @ \section{INS-.lsp BOOTSTRAP} {\bf INS-} depends on {\bf INS}. We need to break this cycle to build @@ -255,271 +255,225 @@ This is eventually forcibly replaced by a recompiled version. (/VERSIONCHECK 2) -(PUT - (QUOTE |INS-;characteristic;Nni;1|) - (QUOTE |SPADreplace|) - (QUOTE (XLAM NIL 0))) +(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-;differentiate;2S;2| (|x| $) (|spadConstant| $ 9)) -(DEFUN |INS-;even?;SB;3| (|x| $) - (COND - ((SPADCALL |x| (QREFELT $ 12)) (QUOTE NIL)) - ((QUOTE T) (QUOTE T)))) +(DEFUN |INS-;even?;SB;3| (|x| $) + (SPADCALL (SPADCALL |x| (QREFELT $ 12)) (QREFELT $ 13))) -(DEFUN |INS-;positive?;SB;4| (|x| $) - (SPADCALL (|spadConstant| $ 9) |x| (QREFELT $ 14))) +(DEFUN |INS-;positive?;SB;4| (|x| $) + (SPADCALL (|spadConstant| $ 9) |x| (QREFELT $ 15))) -(PUT - (QUOTE |INS-;copy;2S;5|) - (QUOTE |SPADreplace|) - (QUOTE (XLAM (|x|) |x|))) +(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| (QREFELT $ 17)) - (QREFELT $ 18)) - (QREFELT $ 12))) - -(DEFUN |INS-;mask;2S;7| (|n| $) - (SPADCALL - (SPADCALL (|spadConstant| $ 20) |n| (QREFELT $ 18)) - (QREFELT $ 21))) - -(PUT - (QUOTE |INS-;rational?;SB;8|) - (QUOTE |SPADreplace|) - (QUOTE (XLAM (|x|) (QUOTE T)))) - -(DEFUN |INS-;rational?;SB;8| (|x| $) - (QUOTE T)) - -(DEFUN |INS-;euclideanSize;SNni;9| (|x| $) - (PROG (#0=#:G1078 #1=#:G1079) - (RETURN - (COND - ((SPADCALL |x| (|spadConstant| $ 9) (QREFELT $ 24)) - (|error| "euclideanSize called on zero")) - ((SPADCALL |x| (|spadConstant| $ 9) (QREFELT $ 14)) - (PROG1 - (LETT #0# - (- (SPADCALL |x| (QREFELT $ 26))) - |INS-;euclideanSize;SNni;9|) - (|check-subtype| - (>= #0# 0) - (QUOTE (|NonNegativeInteger|)) - #0#))) - ((QUOTE T) - (PROG1 - (LETT #1# - (SPADCALL |x| (QREFELT $ 26)) - |INS-;euclideanSize;SNni;9|) - (|check-subtype| - (>= #1# 0) - (QUOTE (|NonNegativeInteger|)) - #1#))))))) - -(DEFUN |INS-;convert;SF;10| (|x| $) - (SPADCALL (SPADCALL |x| (QREFELT $ 26)) (QREFELT $ 29))) - -(DEFUN |INS-;convert;SDf;11| (|x| $) - (FLOAT (SPADCALL |x| (QREFELT $ 26)) MOST-POSITIVE-LONG-FLOAT)) - -(DEFUN |INS-;convert;SIf;12| (|x| $) - (SPADCALL (SPADCALL |x| (QREFELT $ 26)) (QREFELT $ 34))) - -(DEFUN |INS-;retract;SI;13| (|x| $) - (SPADCALL |x| (QREFELT $ 26))) - -(DEFUN |INS-;convert;SP;14| (|x| $) - (SPADCALL (SPADCALL |x| (QREFELT $ 26)) (QREFELT $ 38))) - -(DEFUN |INS-;factor;SF;15| (|x| $) - (SPADCALL |x| (QREFELT $ 42))) - -(DEFUN |INS-;squareFree;SF;16| (|x| $) - (SPADCALL |x| (QREFELT $ 45))) - -(DEFUN |INS-;prime?;SB;17| (|x| $) - (SPADCALL |x| (QREFELT $ 48))) - -(DEFUN |INS-;factorial;2S;18| (|x| $) - (SPADCALL |x| (QREFELT $ 51))) - -(DEFUN |INS-;binomial;3S;19| (|n| |m| $) - (SPADCALL |n| |m| (QREFELT $ 53))) - -(DEFUN |INS-;permutation;3S;20| (|n| |m| $) - (SPADCALL |n| |m| (QREFELT $ 55))) - -(DEFUN |INS-;retractIfCan;SU;21| (|x| $) - (CONS 0 (SPADCALL |x| (QREFELT $ 26)))) - -(DEFUN |INS-;init;S;22| ($) - (|spadConstant| $ 9)) - -(DEFUN |INS-;nextItem;SU;23| (|n| $) - (COND - ((SPADCALL |n| (QREFELT $ 60)) - (CONS 0 (|spadConstant| $ 20))) - ((SPADCALL (|spadConstant| $ 9) |n| (QREFELT $ 14)) - (CONS 0 (SPADCALL |n| (QREFELT $ 17)))) - ((QUOTE T) - (CONS 0 (SPADCALL (|spadConstant| $ 20) |n| (QREFELT $ 61)))))) - -(DEFUN |INS-;patternMatch;SP2Pmr;24| (|x| |p| |l| $) - (SPADCALL |x| |p| |l| (QREFELT $ 66))) - -(DEFUN |INS-;rational;SF;25| (|x| $) - (SPADCALL (SPADCALL |x| (QREFELT $ 26)) (QREFELT $ 70))) - -(DEFUN |INS-;rationalIfCan;SU;26| (|x| $) - (CONS 0 (SPADCALL (SPADCALL |x| (QREFELT $ 26)) (QREFELT $ 70)))) - -(DEFUN |INS-;symmetricRemainder;3S;27| (|x| |n| $) - (PROG (|r|) - (RETURN - (SEQ - (LETT |r| - (SPADCALL |x| |n| (QREFELT $ 74)) - |INS-;symmetricRemainder;3S;27|) - (EXIT - (COND - ((SPADCALL |r| (|spadConstant| $ 9) (QREFELT $ 24)) |r|) - ((QUOTE T) - (SEQ - (COND - ((SPADCALL |n| (|spadConstant| $ 9) (QREFELT $ 14)) - (LETT |n| - (SPADCALL |n| (QREFELT $ 17)) - |INS-;symmetricRemainder;3S;27|))) - (EXIT - (COND - ((SPADCALL (|spadConstant| $ 9) |r| (QREFELT $ 14)) - (COND - ((SPADCALL |n| - (SPADCALL 2 |r| (QREFELT $ 76)) - (QREFELT $ 14)) - (SPADCALL |r| |n| (QREFELT $ 61))) - ((QUOTE T) |r|))) - ((NULL - (SPADCALL - (|spadConstant| $ 9) - (SPADCALL - (SPADCALL 2 |r| (QREFELT $ 76)) - |n| - (QREFELT $ 77)) - (QREFELT $ 14))) - (SPADCALL |r| |n| (QREFELT $ 77))) - ((QUOTE T) |r|))))))))))) - -(DEFUN |INS-;invmod;3S;28| (|a| |b| $) - (PROG (|q| |r| |r1| |c| |c1| |d| |d1|) - (RETURN - (SEQ - (COND - ((SPADCALL |a| (QREFELT $ 79)) - (LETT |a| (SPADCALL |a| |b| (QREFELT $ 80)) |INS-;invmod;3S;28|))) - (LETT |c| |a| |INS-;invmod;3S;28|) - (LETT |c1| (|spadConstant| $ 20) |INS-;invmod;3S;28|) - (LETT |d| |b| |INS-;invmod;3S;28|) - (LETT |d1| (|spadConstant| $ 9) |INS-;invmod;3S;28|) - (SEQ G190 - (COND - ((NULL - (COND - ((SPADCALL |d| (QREFELT $ 60)) (QUOTE NIL)) - ((QUOTE T) (QUOTE T)))) - (GO G191))) - (SEQ - (LETT |q| (SPADCALL |c| |d| (QREFELT $ 81)) |INS-;invmod;3S;28|) - (LETT |r| - (SPADCALL |c| (SPADCALL |q| |d| (QREFELT $ 82)) (QREFELT $ 61)) - |INS-;invmod;3S;28|) - (LETT |r1| - (SPADCALL |c1| (SPADCALL |q| |d1| (QREFELT $ 82)) (QREFELT $ 61)) - |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)) - (COND - ((NULL (SPADCALL |c| (QREFELT $ 83))) - (EXIT (|error| "inverse does not exist")))) - (EXIT - (COND - ((SPADCALL |c1| (QREFELT $ 79)) (SPADCALL |c1| |b| (QREFELT $ 77))) - ((QUOTE T) |c1|))))))) - -(DEFUN |INS-;powmod;4S;29| (|x| |n| |p| $) - (PROG (|y| #0=#:G1137 |z|) - (RETURN - (SEQ - (EXIT - (SEQ - (COND - ((SPADCALL |x| (QREFELT $ 79)) - (LETT |x| - (SPADCALL |x| |p| (QREFELT $ 80)) - |INS-;powmod;4S;29|))) - (EXIT - (COND - ((SPADCALL |x| (QREFELT $ 60)) (|spadConstant| $ 9)) - ((SPADCALL |n| (QREFELT $ 60)) (|spadConstant| $ 20)) - ((QUOTE T) - (SEQ - (LETT |y| (|spadConstant| $ 20) |INS-;powmod;4S;29|) - (LETT |z| |x| |INS-;powmod;4S;29|) - (EXIT - (SEQ G190 - NIL - (SEQ - (COND - ((SPADCALL |n| (QREFELT $ 12)) - (LETT |y| - (SPADCALL |y| |z| |p| (QREFELT $ 85)) +(DEFUN |INS-;bit?;2SB;6| (|x| |i| $) + (SPADCALL (SPADCALL |x| (SPADCALL |i| (QREFELT $ 18)) (QREFELT $ 19)) + (QREFELT $ 12))) + +(DEFUN |INS-;mask;2S;7| (|n| $) + (SPADCALL (SPADCALL (|spadConstant| $ 21) |n| (QREFELT $ 19)) + (QREFELT $ 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=#:G1412 #1=#:G1413) + (RETURN + (COND + ((SPADCALL |x| (|spadConstant| $ 9) (QREFELT $ 25)) + (|error| "euclideanSize called on zero")) + ((SPADCALL |x| (|spadConstant| $ 9) (QREFELT $ 15)) + (PROG1 (LETT #0# (- (SPADCALL |x| (QREFELT $ 27))) + |INS-;euclideanSize;SNni;9|) + (|check-subtype| (>= #0# 0) '(|NonNegativeInteger|) #0#))) + ('T + (PROG1 (LETT #1# (SPADCALL |x| (QREFELT $ 27)) + |INS-;euclideanSize;SNni;9|) + (|check-subtype| (>= #1# 0) '(|NonNegativeInteger|) #1#))))))) + +(DEFUN |INS-;convert;SF;10| (|x| $) + (SPADCALL (SPADCALL |x| (QREFELT $ 27)) (QREFELT $ 30))) + +(DEFUN |INS-;convert;SDf;11| (|x| $) + (FLOAT (SPADCALL |x| (QREFELT $ 27)) MOST-POSITIVE-LONG-FLOAT)) + +(DEFUN |INS-;convert;SIf;12| (|x| $) + (SPADCALL (SPADCALL |x| (QREFELT $ 27)) (QREFELT $ 35))) + +(DEFUN |INS-;retract;SI;13| (|x| $) (SPADCALL |x| (QREFELT $ 27))) + +(DEFUN |INS-;convert;SP;14| (|x| $) + (SPADCALL (SPADCALL |x| (QREFELT $ 27)) (QREFELT $ 39))) + +(DEFUN |INS-;factor;SF;15| (|x| $) (SPADCALL |x| (QREFELT $ 43))) + +(DEFUN |INS-;squareFree;SF;16| (|x| $) (SPADCALL |x| (QREFELT $ 46))) + +(DEFUN |INS-;prime?;SB;17| (|x| $) (SPADCALL |x| (QREFELT $ 49))) + +(DEFUN |INS-;factorial;2S;18| (|x| $) (SPADCALL |x| (QREFELT $ 52))) + +(DEFUN |INS-;binomial;3S;19| (|n| |m| $) + (SPADCALL |n| |m| (QREFELT $ 54))) + +(DEFUN |INS-;permutation;3S;20| (|n| |m| $) + (SPADCALL |n| |m| (QREFELT $ 56))) + +(DEFUN |INS-;retractIfCan;SU;21| (|x| $) + (CONS 0 (SPADCALL |x| (QREFELT $ 27)))) + +(DEFUN |INS-;init;S;22| ($) (|spadConstant| $ 9)) + +(DEFUN |INS-;nextItem;SU;23| (|n| $) + (COND + ((SPADCALL |n| (QREFELT $ 61)) (CONS 0 (|spadConstant| $ 21))) + ((SPADCALL (|spadConstant| $ 9) |n| (QREFELT $ 15)) + (CONS 0 (SPADCALL |n| (QREFELT $ 18)))) + ('T (CONS 0 (SPADCALL (|spadConstant| $ 21) |n| (QREFELT $ 62)))))) + +(DEFUN |INS-;patternMatch;SP2Pmr;24| (|x| |p| |l| $) + (SPADCALL |x| |p| |l| (QREFELT $ 67))) + +(DEFUN |INS-;rational;SF;25| (|x| $) + (SPADCALL (SPADCALL |x| (QREFELT $ 27)) (QREFELT $ 71))) + +(DEFUN |INS-;rationalIfCan;SU;26| (|x| $) + (CONS 0 (SPADCALL (SPADCALL |x| (QREFELT $ 27)) (QREFELT $ 71)))) + +(DEFUN |INS-;symmetricRemainder;3S;27| (|x| |n| $) + (PROG (|r|) + (RETURN + (SEQ (LETT |r| (SPADCALL |x| |n| (QREFELT $ 75)) + |INS-;symmetricRemainder;3S;27|) + (EXIT (COND + ((SPADCALL |r| (|spadConstant| $ 9) (QREFELT $ 25)) + |r|) + ('T + (SEQ (COND + ((SPADCALL |n| (|spadConstant| $ 9) + (QREFELT $ 15)) + (LETT |n| (SPADCALL |n| (QREFELT $ 18)) + |INS-;symmetricRemainder;3S;27|))) + (EXIT (COND + ((SPADCALL (|spadConstant| $ 9) |r| + (QREFELT $ 15)) + (COND + ((SPADCALL |n| + (SPADCALL 2 |r| (QREFELT $ 77)) + (QREFELT $ 15)) + (SPADCALL |r| |n| (QREFELT $ 62))) + ('T |r|))) + ((NULL (SPADCALL (|spadConstant| $ 9) + (SPADCALL + (SPADCALL 2 |r| + (QREFELT $ 77)) + |n| (QREFELT $ 78)) + (QREFELT $ 15))) + (SPADCALL |r| |n| (QREFELT $ 78))) + ('T |r|))))))))))) + +(DEFUN |INS-;invmod;3S;28| (|a| |b| $) + (PROG (|q| |r| |r1| |c| |c1| |d| |d1|) + (RETURN + (SEQ (COND + ((SPADCALL |a| (QREFELT $ 80)) + (LETT |a| (SPADCALL |a| |b| (QREFELT $ 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| (QREFELT $ 61)) + (QREFELT $ 13))) + (GO G191))) + (SEQ (LETT |q| (SPADCALL |c| |d| (QREFELT $ 82)) + |INS-;invmod;3S;28|) + (LETT |r| + (SPADCALL |c| + (SPADCALL |q| |d| (QREFELT $ 83)) + (QREFELT $ 62)) + |INS-;invmod;3S;28|) + (LETT |r1| + (SPADCALL |c1| + (SPADCALL |q| |d1| (QREFELT $ 83)) + (QREFELT $ 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) (QREFELT $ 25)) + (COND + ((SPADCALL |c1| (QREFELT $ 80)) + (SPADCALL |c1| |b| (QREFELT $ 78))) + ('T |c1|))) + ('T (|error| "inverse does not exist")))))))) + +(DEFUN |INS-;powmod;4S;29| (|x| |n| |p| $) + (PROG (|y| #0=#:G1470 |z|) + (RETURN + (SEQ (EXIT (SEQ (COND + ((SPADCALL |x| (QREFELT $ 80)) + (LETT |x| (SPADCALL |x| |p| (QREFELT $ 81)) |INS-;powmod;4S;29|))) - (EXIT - (COND - ((SPADCALL - (LETT |n| - (SPADCALL |n| - (SPADCALL - (|spadConstant| $ 20) - (QREFELT $ 17)) - (QREFELT $ 18)) - |INS-;powmod;4S;29|) - (QREFELT $ 60)) - (PROGN - (LETT #0# |y| |INS-;powmod;4S;29|) - (GO #0#))) - ((QUOTE T) - (LETT |z| - (SPADCALL |z| |z| |p| (QREFELT $ 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 (QUOTE |IntegerNumberSystem&|) DV$1) . #0#) + (EXIT (COND + ((SPADCALL |x| (QREFELT $ 61)) + (|spadConstant| $ 9)) + ((SPADCALL |n| (QREFELT $ 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| (QREFELT $ 12)) + (LETT |y| + (SPADCALL |y| |z| |p| + (QREFELT $ 85)) + |INS-;powmod;4S;29|))) + (EXIT + (COND + ((SPADCALL + (LETT |n| + (SPADCALL |n| + (SPADCALL + (|spadConstant| $ 21) + (QREFELT $ 18)) + (QREFELT $ 19)) + |INS-;powmod;4S;29|) + (QREFELT $ 61)) + (PROGN + (LETT #0# |y| + |INS-;powmod;4S;29|) + (GO #0#))) + ('T + (LETT |z| + (SPADCALL |z| |z| |p| + (QREFELT $ 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 $ (GETREFV 87) . #0#) (QSETREFV $ 0 |dv$|) (QSETREFV $ 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #0#)) @@ -527,125 +481,75 @@ This is eventually forcibly replaced by a recompiled version. (QSETREFV $ 6 |#1|) $)))) -(MAKEPROP - (QUOTE |IntegerNumberSystem&|) - (QUOTE |infovec|) - (LIST - (QUOTE - #(NIL NIL NIL NIL NIL NIL - (|local| |#1|) - (|NonNegativeInteger|) - |INS-;characteristic;Nni;1| - (0 . |Zero|) - |INS-;differentiate;2S;2| - (|Boolean|) - (4 . |odd?|) - |INS-;even?;SB;3| - (9 . <) - |INS-;positive?;SB;4| - |INS-;copy;2S;5| - (15 . -) - (20 . |shift|) - |INS-;bit?;2SB;6| - (26 . |One|) - (30 . |dec|) - |INS-;mask;2S;7| - |INS-;rational?;SB;8| - (35 . =) - (|Integer|) - (41 . |convert|) - |INS-;euclideanSize;SNni;9| - (|Float|) - (46 . |coerce|) - |INS-;convert;SF;10| - (|DoubleFloat|) - |INS-;convert;SDf;11| - (|InputForm|) - (51 . |convert|) - |INS-;convert;SIf;12| - |INS-;retract;SI;13| - (|Pattern| 25) - (56 . |coerce|) - |INS-;convert;SP;14| - (|Factored| 6) - (|IntegerFactorizationPackage| 6) - (61 . |factor|) - (|Factored| $) - |INS-;factor;SF;15| - (66 . |squareFree|) - |INS-;squareFree;SF;16| - (|IntegerPrimesPackage| 6) - (71 . |prime?|) - |INS-;prime?;SB;17| - (|IntegerCombinatoricFunctions| 6) - (76 . |factorial|) - |INS-;factorial;2S;18| - (81 . |binomial|) - |INS-;binomial;3S;19| - (87 . |permutation|) - |INS-;permutation;3S;20| - (|Union| 25 (QUOTE "failed")) - |INS-;retractIfCan;SU;21| - |INS-;init;S;22| - (93 . |zero?|) - (98 . -) - (|Union| $ (QUOTE "failed")) - |INS-;nextItem;SU;23| - (|PatternMatchResult| 25 6) - (|PatternMatchIntegerNumberSystem| 6) - (104 . |patternMatch|) - (|PatternMatchResult| 25 $) - |INS-;patternMatch;SP2Pmr;24| - (|Fraction| 25) - (111 . |coerce|) - |INS-;rational;SF;25| - (|Union| 69 (QUOTE "failed")) - |INS-;rationalIfCan;SU;26| - (116 . |rem|) - (|PositiveInteger|) - (122 . *) - (128 . +) - |INS-;symmetricRemainder;3S;27| - (134 . |negative?|) - (139 . |positiveRemainder|) - (145 . |quo|) - (151 . *) - (157 . |one?|) - |INS-;invmod;3S;28| - (162 . |mulmod|) - |INS-;powmod;4S;29|)) - (QUOTE - #(|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)) - (QUOTE NIL) - (CONS - (|makeByteWordVec2| 1 (QUOTE NIL)) - (CONS - (QUOTE #()) - (CONS - (QUOTE #()) - (|makeByteWordVec2| 86 - (QUOTE - (0 6 0 9 1 6 11 0 12 2 6 11 0 0 14 1 6 0 0 17 2 6 0 0 0 18 0 6 - 0 20 1 6 0 0 21 2 6 11 0 0 24 1 6 25 0 26 1 28 0 25 29 1 33 0 - 25 34 1 37 0 25 38 1 41 40 6 42 1 41 40 6 45 1 47 11 6 48 1 50 - 6 6 51 2 50 6 6 6 53 2 50 6 6 6 55 1 6 11 0 60 2 6 0 0 0 61 3 - 65 64 6 37 64 66 1 69 0 25 70 2 6 0 0 0 74 2 6 0 75 0 76 2 6 0 - 0 0 77 1 6 11 0 79 2 6 0 0 0 80 2 6 0 0 0 81 2 6 0 0 0 82 1 6 - 11 0 83 3 6 0 0 0 0 85 2 0 0 0 0 78 1 0 43 0 46 1 0 57 0 58 1 - 0 25 0 36 1 0 72 0 73 1 0 11 0 23 1 0 69 0 71 1 0 11 0 49 3 0 - 0 0 0 0 86 1 0 11 0 15 2 0 0 0 0 56 3 0 67 0 37 67 68 1 0 62 - 0 63 1 0 0 0 22 2 0 0 0 0 84 0 0 0 59 1 0 0 0 52 1 0 43 0 44 - 1 0 11 0 13 1 0 7 0 27 1 0 0 0 10 1 0 0 0 16 1 0 31 0 32 1 0 - 28 0 30 1 0 37 0 39 1 0 33 0 35 0 0 7 8 2 0 11 0 0 19 2 0 0 - 0 0 54)))))) - (QUOTE |lookupComplete|))) - +(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|)) @ \section{domain SINT SingleInteger} The definition of {\bf one?} has been rewritten |