aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2010-05-30 02:56:28 +0000
committerdos-reis <gdr@axiomatics.org>2010-05-30 02:56:28 +0000
commitc0e46794454133d4a42587f059779a3fe361c576 (patch)
tree209685df5b44e975e7d662445873acccb06564e9
parenta31ebb2c1b71c66ac34ffb0c27e6d7188ffb0906 (diff)
downloadopen-axiom-c0e46794454133d4a42587f059779a3fe361c576.tar.gz
* algebra/boolean.spad.pamphlet (Boolean): Remove reference to
Lisp. Use builtin functions.
-rw-r--r--src/ChangeLog5
-rw-r--r--src/algebra/boolean.spad.pamphlet50
-rw-r--r--src/algebra/strap/BOOLEAN.lsp22
-rw-r--r--src/algebra/strap/DFLOAT.lsp2
-rw-r--r--src/algebra/strap/INT.lsp2
-rw-r--r--src/algebra/strap/SINT.lsp2
-rw-r--r--src/interp/g-opt.boot4
7 files changed, 48 insertions, 39 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index b9850970..24c146c2 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,10 @@
2010-05-29 Gabriel Dos Reis <gdr@cs.tamu.edu>
+ * algebra/boolean.spad.pamphlet (Boolean): Remove reference to
+ Lisp. Use builtin functions.
+
+2010-05-29 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
* interp/compiler.boot (getExternalSymbolMode): Allow Lisp as
foreign language.
(checkExternalEntity): Likewise.
diff --git a/src/algebra/boolean.spad.pamphlet b/src/algebra/boolean.spad.pamphlet
index a87b4c9b..6bf5188e 100644
--- a/src/algebra/boolean.spad.pamphlet
+++ b/src/algebra/boolean.spad.pamphlet
@@ -472,40 +472,42 @@ Boolean(): Join(OrderedFinite, Logic, PropositionalLogic, ConvertibleTo InputFor
test: % -> %
++ test(b) returns b and is provided for compatibility with the new compiler.
== add
- import EQ: (%,%) -> Boolean from Foreign Builtin
- import AND: (%,%) -> % from Foreign Builtin
- import OR: (%,%) -> % from Foreign Builtin
- import NOT: % -> % from Foreign Builtin
+ import %false: % from Foreign Builtin
+ import %true: % from Foreign Builtin
+ import %eq: (%,%) -> Boolean from Foreign Builtin
+ import %and: (%,%) -> % from Foreign Builtin
+ import %or: (%,%) -> % from Foreign Builtin
+ import %not: % -> % from Foreign Builtin
test a == a
- true == 'T pretend %
- false == NIL$Foreign(Builtin)
- sample() == true
- not b == NOT b
- ~ b == NOT b
- a and b == AND(a,b)
- a /\ b == AND(a,b)
- a or b == OR(a,b)
- a \/ b == OR(a,b)
- xor(a, b) == (a => NOT b; b)
- nor(a, b) == (a => false; NOT b)
- nand(a, b) == (a => NOT b; true)
- a = b == EQ(a, b)
- implies(a, b) == (a => b; true)
- equiv(a,b) == EQ(a, b)
- a < b == (b => NOT a; false)
+ true == %true
+ false == %false
+ sample() == %true
+ not b == %not b
+ ~b == %not b
+ a and b == %and(a,b)
+ a /\ b == %and(a,b)
+ a or b == %or(a,b)
+ a \/ b == %or(a,b)
+ xor(a, b) == (a => %not b; b)
+ nor(a, b) == (a => %false; %not b)
+ nand(a, b) == (a => %not b; %true)
+ a = b == %eq(a,b)
+ implies(a, b) == (a => b; %true)
+ equiv(a,b) == %eq(a, b)
+ a < b == (b => %not a; %false)
size() == 2
index i ==
- even?(i::Integer) => false
- true
+ even?(i::Integer) => %false
+ %true
lookup a ==
a => 1
2
random() ==
- even?(random()$Integer) => false
- true
+ even?(random()$Integer) => %false
+ %true
convert(x:%):InputForm ==
x => 'true
diff --git a/src/algebra/strap/BOOLEAN.lsp b/src/algebra/strap/BOOLEAN.lsp
index b6a99dfe..2910174e 100644
--- a/src/algebra/strap/BOOLEAN.lsp
+++ b/src/algebra/strap/BOOLEAN.lsp
@@ -8,41 +8,41 @@
(DECLAIM (FTYPE (FUNCTION (|%Shell|) |%Boolean|) |BOOLEAN;true;$;2|))
-(PUT '|BOOLEAN;true;$;2| '|SPADreplace| '(XLAM NIL 'T))
+(PUT '|BOOLEAN;true;$;2| '|SPADreplace| '(XLAM NIL |%true|))
(DECLAIM (FTYPE (FUNCTION (|%Shell|) |%Boolean|) |BOOLEAN;false;$;3|))
-(PUT '|BOOLEAN;false;$;3| '|SPADreplace| '(XLAM NIL NIL))
+(PUT '|BOOLEAN;false;$;3| '|SPADreplace| '(XLAM NIL |%false|))
(DECLAIM (FTYPE (FUNCTION (|%Boolean| |%Shell|) |%Boolean|)
|BOOLEAN;not;2$;4|))
-(PUT '|BOOLEAN;not;2$;4| '|SPADreplace| 'NOT)
+(PUT '|BOOLEAN;not;2$;4| '|SPADreplace| '|%not|)
(DECLAIM (FTYPE (FUNCTION (|%Boolean| |%Shell|) |%Boolean|)
|BOOLEAN;~;2$;5|))
-(PUT '|BOOLEAN;~;2$;5| '|SPADreplace| 'NOT)
+(PUT '|BOOLEAN;~;2$;5| '|SPADreplace| '|%not|)
(DECLAIM (FTYPE (FUNCTION (|%Boolean| |%Boolean| |%Shell|) |%Boolean|)
|BOOLEAN;and;3$;6|))
-(PUT '|BOOLEAN;and;3$;6| '|SPADreplace| 'AND)
+(PUT '|BOOLEAN;and;3$;6| '|SPADreplace| '|%and|)
(DECLAIM (FTYPE (FUNCTION (|%Boolean| |%Boolean| |%Shell|) |%Boolean|)
|BOOLEAN;/\\;3$;7|))
-(PUT '|BOOLEAN;/\\;3$;7| '|SPADreplace| 'AND)
+(PUT '|BOOLEAN;/\\;3$;7| '|SPADreplace| '|%and|)
(DECLAIM (FTYPE (FUNCTION (|%Boolean| |%Boolean| |%Shell|) |%Boolean|)
|BOOLEAN;or;3$;8|))
-(PUT '|BOOLEAN;or;3$;8| '|SPADreplace| 'OR)
+(PUT '|BOOLEAN;or;3$;8| '|SPADreplace| '|%or|)
(DECLAIM (FTYPE (FUNCTION (|%Boolean| |%Boolean| |%Shell|) |%Boolean|)
|BOOLEAN;\\/;3$;9|))
-(PUT '|BOOLEAN;\\/;3$;9| '|SPADreplace| 'OR)
+(PUT '|BOOLEAN;\\/;3$;9| '|SPADreplace| '|%or|)
(DECLAIM (FTYPE (FUNCTION (|%Boolean| |%Boolean| |%Shell|) |%Boolean|)
|BOOLEAN;xor;3$;10|))
@@ -56,7 +56,7 @@
(DECLAIM (FTYPE (FUNCTION (|%Boolean| |%Boolean| |%Shell|) |%Boolean|)
|BOOLEAN;=;3$;13|))
-(PUT '|BOOLEAN;=;3$;13| '|SPADreplace| 'EQ)
+(PUT '|BOOLEAN;=;3$;13| '|SPADreplace| '|%eq|)
(DECLAIM (FTYPE (FUNCTION (|%Boolean| |%Boolean| |%Shell|) |%Boolean|)
|BOOLEAN;implies;3$;14|))
@@ -64,7 +64,7 @@
(DECLAIM (FTYPE (FUNCTION (|%Boolean| |%Boolean| |%Shell|) |%Boolean|)
|BOOLEAN;equiv;3$;15|))
-(PUT '|BOOLEAN;equiv;3$;15| '|SPADreplace| 'EQ)
+(PUT '|BOOLEAN;equiv;3$;15| '|SPADreplace| '|%eq|)
(DECLAIM (FTYPE (FUNCTION (|%Boolean| |%Boolean| |%Shell|) |%Boolean|)
|BOOLEAN;<;3$;16|))
@@ -90,7 +90,7 @@
(DEFUN |BOOLEAN;test;2$;1| (|a| $) (DECLARE (IGNORE $)) |a|)
-(DEFUN |BOOLEAN;true;$;2| ($) (DECLARE (IGNORE $)) 'T)
+(DEFUN |BOOLEAN;true;$;2| ($) (DECLARE (IGNORE $)) T)
(DEFUN |BOOLEAN;false;$;3| ($) (DECLARE (IGNORE $)) NIL)
diff --git a/src/algebra/strap/DFLOAT.lsp b/src/algebra/strap/DFLOAT.lsp
index 776ae048..6f405951 100644
--- a/src/algebra/strap/DFLOAT.lsp
+++ b/src/algebra/strap/DFLOAT.lsp
@@ -94,7 +94,7 @@
|DFLOAT;<=;2$B;22|))
(PUT '|DFLOAT;<=;2$B;22| '|SPADreplace|
- '(XLAM (|x| |y|) (NOT (> |x| |y|))))
+ '(XLAM (|x| |y|) (|%not| (> |x| |y|))))
(DECLAIM (FTYPE (FUNCTION (|%DoubleFloat| |%DoubleFloat| |%Shell|)
|%Boolean|)
diff --git a/src/algebra/strap/INT.lsp b/src/algebra/strap/INT.lsp
index 363727ff..ec1689fe 100644
--- a/src/algebra/strap/INT.lsp
+++ b/src/algebra/strap/INT.lsp
@@ -161,7 +161,7 @@
|INT;<=;2$B;37|))
(PUT '|INT;<=;2$B;37| '|SPADreplace|
- '(XLAM (|x| |y|) (NOT (> |x| |y|))))
+ '(XLAM (|x| |y|) (|%not| (> |x| |y|))))
(DECLAIM (FTYPE (FUNCTION (|%Integer| |%Integer| |%Shell|) |%Boolean|)
|INT;>=;2$B;38|))
diff --git a/src/algebra/strap/SINT.lsp b/src/algebra/strap/SINT.lsp
index 6129e571..ef4e34c4 100644
--- a/src/algebra/strap/SINT.lsp
+++ b/src/algebra/strap/SINT.lsp
@@ -123,7 +123,7 @@
|SINT;<=;2$B;28|))
(PUT '|SINT;<=;2$B;28| '|SPADreplace|
- '(XLAM (|x| |y|) (NOT (> |x| |y|))))
+ '(XLAM (|x| |y|) (|%not| (> |x| |y|))))
(DECLAIM (FTYPE (FUNCTION (|%Short| |%Short| |%Shell|) |%Boolean|)
|SINT;>=;2$B;29|))
diff --git a/src/interp/g-opt.boot b/src/interp/g-opt.boot
index edcdb00e..827aecd4 100644
--- a/src/interp/g-opt.boot
+++ b/src/interp/g-opt.boot
@@ -402,7 +402,9 @@ $VMsideEffectFreeOperators ==
SPADfirst QVELT _+ _- _* _< _= _<_= _> _>_= ASH INTEGER_-LENGTH
QEQCAR QCDR QCAR INTEGERP FLOATP STRINGP IDENTP SYMBOLP
MINUSP GREATERP ZEROP ODDP FLOAT_-RADIX FLOAT FLOAT_-SIGN FLOAT_-DIGITS
- CGREATERP GGREATERP CHAR BOOLE GET BVEC_-GREATER FUNCALL)
+ CGREATERP GGREATERP CHAR BOOLE GET BVEC_-GREATER FUNCALL
+ %and %or %not %eq %ieq %equal %lt %le %gt %ge %head %tail
+ %imul %iadd %isub %igcd)
++ List of simple VM operators
$simpleVMoperators ==