From c0e46794454133d4a42587f059779a3fe361c576 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Sun, 30 May 2010 02:56:28 +0000 Subject: * algebra/boolean.spad.pamphlet (Boolean): Remove reference to Lisp. Use builtin functions. --- src/algebra/boolean.spad.pamphlet | 50 ++++++++++++++++++++------------------- src/algebra/strap/BOOLEAN.lsp | 22 ++++++++--------- src/algebra/strap/DFLOAT.lsp | 2 +- src/algebra/strap/INT.lsp | 2 +- src/algebra/strap/SINT.lsp | 2 +- 5 files changed, 40 insertions(+), 38 deletions(-) (limited to 'src/algebra') 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|)) -- cgit v1.2.3