aboutsummaryrefslogtreecommitdiff
path: root/src/algebra
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2011-02-04 23:34:39 +0000
committerdos-reis <gdr@axiomatics.org>2011-02-04 23:34:39 +0000
commitdd16b47e4904b1839b2918cf5b38c352979a6141 (patch)
tree11760b4462d02b64729ed30b0d0bb2150d4c59f3 /src/algebra
parent03ab6db167d40e2448dee7de702dc77a62e57617 (diff)
downloadopen-axiom-dd16b47e4904b1839b2918cf5b38c352979a6141.tar.gz
* interp/g-opt.boot ($VMsideEffectFreeOperators): Remove more Lisp
level operators. Include %property and %bitveclt. * interp/lisp-backend.boot: Expand them. * algebra/si.spad.pamphlet (SingleInteger): Tidy. Use %ismall?. * algebra/domain.spad.pamphlet (DomainConstructo): Use %property. * algebra/outform.spad.pamphlet (OutputForm): Likewise. * algebra/boolean.spad.pamphlet (IndexedBits): Use %bitveclt.
Diffstat (limited to 'src/algebra')
-rw-r--r--src/algebra/boolean.spad.pamphlet3
-rw-r--r--src/algebra/domain.spad.pamphlet2
-rw-r--r--src/algebra/outform.spad.pamphlet2
-rw-r--r--src/algebra/si.spad.pamphlet9
-rw-r--r--src/algebra/strap/SINT.lsp170
5 files changed, 94 insertions, 92 deletions
diff --git a/src/algebra/boolean.spad.pamphlet b/src/algebra/boolean.spad.pamphlet
index 9a14a146..0b338604 100644
--- a/src/algebra/boolean.spad.pamphlet
+++ b/src/algebra/boolean.spad.pamphlet
@@ -553,6 +553,7 @@ IndexedBits(mn:Integer): BitAggregate() with
import %bitvecref: (%,Integer) -> NonNegativeInteger
from Foreign Builtin
import %bitveceq: (%,%) -> Boolean from Foreign Builtin
+ import %bitveclt: (%,%) -> Boolean from Foreign Builtin
import %bitvecnot: % -> % from Foreign Builtin
import %bitvecand: (%,%) -> % from Foreign Builtin
import %bitvecor: (%,%) -> % from Foreign Builtin
@@ -580,7 +581,7 @@ IndexedBits(mn:Integer): BitAggregate() with
copy v == %bitveccopy v
#v == %bitveclength v
v = u == %bitveceq(v,u)
- v < u == BVEC_-GREATER(u, v)$Lisp
+ v < u == %bitveclt(v,u)
u and v == (#v=#u => %bitvecand(v,u); map("and",v,u))
u or v == (#v=#u => %bitvecor(v,u); map("or", v,u))
xor(v,u) == (#v=#u => %bitvecxor(v,u); map("xor",v,u))
diff --git a/src/algebra/domain.spad.pamphlet b/src/algebra/domain.spad.pamphlet
index 0351c3f3..597d936d 100644
--- a/src/algebra/domain.spad.pamphlet
+++ b/src/algebra/domain.spad.pamphlet
@@ -281,7 +281,7 @@ DomainConstructor(): Public == Private where
++ \spad{functorData x} returns the functor data associated
++ with the domain constructor \spad{x}.
Private == Constructor add
- functorData x == GET(x,'infovec)$Foreign(Builtin)
+ functorData x == %property(x,'infovec)$Foreign(Builtin)
coerce(x: %): Constructor == rep x
@
diff --git a/src/algebra/outform.spad.pamphlet b/src/algebra/outform.spad.pamphlet
index 15f3c259..185d00dd 100644
--- a/src/algebra/outform.spad.pamphlet
+++ b/src/algebra/outform.spad.pamphlet
@@ -622,7 +622,7 @@ OutputForm(): SetCategory with
IDENTP$Lisp a => a
STRINGP$Lisp a => INTERN$Lisp a
return false
- if GET(e,QUOTE(INFIXOP$Lisp)$Lisp)$Lisp then true else false
+ if %property(e,'INFIXOP)$Foreign(Builtin) then true else false
elt(a, l) ==
cons(a, l)
diff --git a/src/algebra/si.spad.pamphlet b/src/algebra/si.spad.pamphlet
index 494f306c..dffa5e46 100644
--- a/src/algebra/si.spad.pamphlet
+++ b/src/algebra/si.spad.pamphlet
@@ -208,7 +208,7 @@ SingleInteger(): Join(IntegerNumberSystem,OrderedFinite,BooleanLogic,Logic,OpenM
++ Or(n,m) returns the bit-by-bit logical {\em or} of
++ the single integers n and m.
- == SubDomain(Integer, SMINTP(#1)$Lisp) add
+ == SubDomain(Integer, %ismall?(#1)$Foreign(Builtin)) add
import %icst0: % from Foreign Builtin
import %icst1: % from Foreign Builtin
@@ -334,10 +334,11 @@ SingleInteger(): Join(IntegerNumberSystem,OrderedFinite,BooleanLogic,Logic,OpenM
addmod(a,b,p) == QSADDMOD(a,b,p)$Lisp
submod(a,b,p) == QSDIFMOD(a,b,p)$Lisp
negative?(x) == %ilt(x,%icst0)
- size() == (MAXINT -$Lisp MININT +$Lisp %icst1) pretend NonNegativeInteger
- index i == per(i + MININT - 1$Lisp)
+ size() ==
+ (MAXINT - MININT + 1) pretend NonNegativeInteger
+ index i == per(i + MININT - 1)
lookup x ==
- (x -$Lisp MININT +$Lisp %icst1) pretend PositiveInteger
+ (x - MININT + 1) pretend PositiveInteger
reducedSystem(m: Matrix %, v: Vector %) ==
diff --git a/src/algebra/strap/SINT.lsp b/src/algebra/strap/SINT.lsp
index 1aa715eb..4632edb4 100644
--- a/src/algebra/strap/SINT.lsp
+++ b/src/algebra/strap/SINT.lsp
@@ -1,7 +1,7 @@
(/VERSIONCHECK 2)
-(|noteSubDomainInfo| '|SingleInteger| '(|Integer|) '(SMINTP |#1|))
+(|noteSubDomainInfo| '|SingleInteger| '(|Integer|) '(|%ismall?| |#1|))
(DECLAIM (FTYPE (FUNCTION (|%Thing| |%Short| |%Shell|) |%Void|)
|SINT;writeOMSingleInt|))
@@ -253,18 +253,12 @@
(DECLAIM (FTYPE (FUNCTION (|%Shell|) (|%IntegerSection| 0))
|SINT;size;Nni;54|))
-(PUT '|SINT;size;Nni;54| '|SPADreplace|
- '(XLAM NIL (+ (- |$ShortMaximum| |$ShortMinimum|) 1)))
-
(DECLAIM (FTYPE (FUNCTION ((|%IntegerSection| 1) |%Shell|) |%Short|)
|SINT;index;Pi$;55|))
(DECLAIM (FTYPE (FUNCTION (|%Short| |%Shell|) (|%IntegerSection| 1))
|SINT;lookup;$Pi;56|))
-(PUT '|SINT;lookup;$Pi;56| '|SPADreplace|
- '(XLAM (|x|) (+ (- |x| |$ShortMinimum|) 1)))
-
(DECLAIM (FTYPE (FUNCTION (|%Thing| (|%Vector| *) |%Shell|) |%Pair|)
|SINT;reducedSystem;MVR;57|))
@@ -290,6 +284,12 @@
(PUT '|SINT;or;3$;24| '|SPADreplace| 'LOGIOR)
+(PUT '|SINT;size;Nni;54| '|SPADreplace|
+ '(XLAM NIL (|%iadd| (|%isub| |$ShortMaximum| |$ShortMinimum|) 1)))
+
+(PUT '|SINT;lookup;$Pi;56| '|SPADreplace|
+ '(XLAM (|x|) (|%iadd| (|%isub| |x| |$ShortMinimum|) 1)))
+
(DEFUN |SINT;writeOMSingleInt| (|dev| |x| $)
(SEQ (COND
((MINUSP |x|)
@@ -524,7 +524,7 @@
(DEFUN |SingleInteger;| ()
(DECLARE (SPECIAL |$ConstructorCache|))
- (LET ((|dv$| '(|SingleInteger|)) ($ (|newShell| 114))
+ (LET ((|dv$| '(|SingleInteger|)) ($ (|newShell| 115))
(|pv$| (|buildPredVector| 0 0 NIL)))
(|setShellEntry| $ 0 |dv$|)
(|setShellEntry| $ 3 |pv$|)
@@ -570,47 +570,47 @@
|SINT;hash;2$;47| |SINT;length;2$;48| |SINT;shift;3$;49|
|SINT;mulmod;4$;50| |SINT;addmod;4$;51|
|SINT;submod;4$;52| |SINT;size;Nni;54| (|PositiveInteger|)
- (58 . +) (64 . -) |SINT;index;Pi$;55| |SINT;lookup;$Pi;56|
- (|Vector| 5) (|Record| (|:| |mat| 28) (|:| |vec| 87))
- (|Vector| $) |SINT;reducedSystem;MVR;57|
- |SINT;positiveRemainder;3$;58| |SINT;coerce;I$;59|
- |SINT;random;$;60| |SINT;random;2$;61|
+ (58 . +) (64 . |One|) (68 . -) |SINT;index;Pi$;55|
+ |SINT;lookup;$Pi;56| (|Vector| 5)
+ (|Record| (|:| |mat| 28) (|:| |vec| 88)) (|Vector| $)
+ |SINT;reducedSystem;MVR;57| |SINT;positiveRemainder;3$;58|
+ |SINT;coerce;I$;59| |SINT;random;$;60| |SINT;random;2$;61|
(|Record| (|:| |unit| $) (|:| |canonical| $)
(|:| |associate| $))
|SINT;unitNormal;$R;62| (|Fraction| 5)
- (|Union| 97 '"failed") (|Union| $ '"failed") (|Float|)
+ (|Union| 98 '"failed") (|Union| $ '"failed") (|Float|)
(|DoubleFloat|) (|PatternMatchResult| 5 $) (|Pattern| 5)
(|InputForm|) (|Union| 5 '"failed") (|List| $)
- (|Union| 106 '"failed")
- (|Record| (|:| |coef| 106) (|:| |generator| $))
+ (|Union| 107 '"failed")
+ (|Record| (|:| |coef| 107) (|:| |generator| $))
(|Record| (|:| |coef1| $) (|:| |coef2| $)
(|:| |generator| $))
(|Record| (|:| |coef1| $) (|:| |coef2| $))
- (|Union| 110 '"failed") (|Factored| $)
+ (|Union| 111 '"failed") (|Factored| $)
(|SparseUnivariatePolynomial| $))
- '#(~= 70 ~ 76 |zero?| 81 |xor| 86 |unitNormal| 92
- |unitCanonical| 97 |unit?| 102 |symmetricRemainder| 107
- |subtractIfCan| 113 |submod| 119 |squareFreePart| 126
- |squareFree| 131 |sizeLess?| 136 |size| 142 |sign| 146
- |shift| 151 |sample| 157 |retractIfCan| 161 |retract| 166
- |rem| 171 |reducedSystem| 177 |recip| 188 |rationalIfCan|
- 193 |rational?| 198 |rational| 203 |random| 208 |quo| 217
- |principalIdeal| 223 |prime?| 228 |powmod| 233
- |positiveRemainder| 240 |positive?| 246 |permutation| 251
- |patternMatch| 257 |or| 264 |one?| 270 |odd?| 275 |not|
- 280 |nextItem| 285 |negative?| 290 |multiEuclidean| 295
- |mulmod| 301 |min| 308 |max| 318 |mask| 328 |lookup| 333
- |length| 338 |leftReducedSystem| 343 |lcm| 354 |latex| 365
- |invmod| 370 |init| 376 |index| 380 |inc| 385 |hash| 390
- |gcdPolynomial| 395 |gcd| 401 |factorial| 412 |factor| 417
- |extendedEuclidean| 422 |exquo| 435 |expressIdealMember|
- 441 |even?| 447 |euclideanSize| 452 |divide| 457
- |differentiate| 463 |dec| 474 |copy| 479 |convert| 484
- |coerce| 509 |characteristic| 529 |bit?| 533 |binomial|
- 539 |before?| 545 |base| 551 |associates?| 555 |and| 561
- |addmod| 567 |abs| 574 |\\/| 579 |Zero| 585 |Or| 589 |One|
- 595 |OMwrite| 599 |Not| 623 D 628 |And| 639 >= 645 > 651 =
- 657 <= 663 < 669 |/\\| 675 - 681 + 692 ** 698 * 710)
+ '#(~= 74 ~ 80 |zero?| 85 |xor| 90 |unitNormal| 96
+ |unitCanonical| 101 |unit?| 106 |symmetricRemainder| 111
+ |subtractIfCan| 117 |submod| 123 |squareFreePart| 130
+ |squareFree| 135 |sizeLess?| 140 |size| 146 |sign| 150
+ |shift| 155 |sample| 161 |retractIfCan| 165 |retract| 170
+ |rem| 175 |reducedSystem| 181 |recip| 192 |rationalIfCan|
+ 197 |rational?| 202 |rational| 207 |random| 212 |quo| 221
+ |principalIdeal| 227 |prime?| 232 |powmod| 237
+ |positiveRemainder| 244 |positive?| 250 |permutation| 255
+ |patternMatch| 261 |or| 268 |one?| 274 |odd?| 279 |not|
+ 284 |nextItem| 289 |negative?| 294 |multiEuclidean| 299
+ |mulmod| 305 |min| 312 |max| 322 |mask| 332 |lookup| 337
+ |length| 342 |leftReducedSystem| 347 |lcm| 358 |latex| 369
+ |invmod| 374 |init| 380 |index| 384 |inc| 389 |hash| 394
+ |gcdPolynomial| 399 |gcd| 405 |factorial| 416 |factor| 421
+ |extendedEuclidean| 426 |exquo| 439 |expressIdealMember|
+ 445 |even?| 451 |euclideanSize| 456 |divide| 461
+ |differentiate| 467 |dec| 478 |copy| 483 |convert| 488
+ |coerce| 513 |characteristic| 533 |bit?| 537 |binomial|
+ 543 |before?| 549 |base| 555 |associates?| 559 |and| 565
+ |addmod| 571 |abs| 578 |\\/| 583 |Zero| 589 |Or| 593 |One|
+ 599 |OMwrite| 603 |Not| 627 D 632 |And| 643 >= 649 > 655 =
+ 661 <= 667 < 673 |/\\| 679 - 685 + 696 ** 702 * 714)
'((|noetherian| . 0) (|canonicalsClosed| . 0)
(|canonical| . 0) (|canonicalUnitNormal| . 0)
(|multiplicativeValuation| . 0) (|noZeroDivisors| . 0)
@@ -665,60 +665,60 @@
(|SetCategory|) (|Logic|)
(|RealConstant|) (|RetractableTo| 5)
(|DifferentialDomain| $$) (|BasicType|)
- (|OpenMath|) (|ConvertibleTo| 100)
- (|ConvertibleTo| 101)
+ (|OpenMath|) (|ConvertibleTo| 101)
+ (|ConvertibleTo| 102)
(|CombinatorialFunctionCategory|)
- (|ConvertibleTo| 103)
(|ConvertibleTo| 104)
+ (|ConvertibleTo| 105)
(|ConvertibleTo| 5) (|CoercibleFrom| $$)
(|CoercibleFrom| 5) (|Type|)
(|CoercibleTo| 31))
- (|makeByteWordVec2| 113
+ (|makeByteWordVec2| 114
'(1 10 9 0 11 3 10 9 0 12 12 13 2 10 9
0 5 16 1 10 9 0 17 0 18 0 19 2 10 0
12 18 20 1 10 9 0 21 1 10 9 0 22 1 10
9 0 23 1 5 31 0 32 1 0 0 5 34 2 82 0
- 0 0 83 2 5 0 0 0 84 2 0 7 0 0 1 1 0 0
- 0 42 1 0 7 0 70 2 0 0 0 0 51 1 0 95 0
- 96 1 0 0 0 1 1 0 7 0 1 2 0 0 0 0 1 2
- 0 99 0 0 1 3 0 0 0 0 0 80 1 0 0 0 1 1
- 0 112 0 1 2 0 7 0 0 1 0 0 61 81 1 0 5
- 0 1 2 0 0 0 0 77 0 0 0 1 1 0 105 0 1
- 1 0 5 0 1 2 0 0 0 0 64 1 0 28 29 30 2
- 0 88 29 89 90 1 0 99 0 1 1 0 98 0 1 1
- 0 7 0 1 1 0 97 0 1 0 0 0 93 1 0 0 0
- 94 2 0 0 0 0 63 1 0 108 106 1 1 0 7 0
- 1 3 0 0 0 0 0 1 2 0 0 0 0 91 1 0 7 0
- 1 2 0 0 0 0 1 3 0 102 0 103 102 1 2 0
- 0 0 0 50 1 0 7 0 71 1 0 7 0 69 1 0 0
- 0 43 1 0 99 0 1 1 0 7 0 8 2 0 107 106
- 0 1 3 0 0 0 0 0 78 0 0 0 40 2 0 0 0 0
- 73 0 0 0 39 2 0 0 0 0 72 1 0 0 0 1 1
- 0 82 0 86 1 0 0 0 76 1 0 28 89 1 2 0
- 88 89 0 1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