axiom-developer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Axiom-developer] 20080216.02.tpd.patch (add function examples)


From: daly
Subject: [Axiom-developer] 20080216.02.tpd.patch (add function examples)
Date: Sun, 17 Feb 2008 02:22:58 -0600

This patch begins the process of adding examples for functions.
There are roughly 3000 function names representing some 10000 functions
which need examples and unit tests.

All cases of these functions are done:

 )d op absolutelyIrreducible?
 )d op alphabetic?
 )d op branchPointAtInfinity?
 )d op char
 )d op digit?
 )d op escape
 )d op genus
 )d op hexDigit?
 )d op inverseIntegralMatrix
 )d op inverseIntegralMatrixAtInfinity
 )d op integralBasisAtInfinity
 )d op integralMatrix
 )d op integralMatrixAtInfinity
 )d op lowerCase?
 )d op ord
 )d op rationalPoint?
 )d op upperCase?

Some cases of these functions are done:

 )d op integralBasis
 )d op numberOfComponents
 )d op quote
 )d op space
 )d op upperCase

Tim

=====================================================================
diff --git a/changelog b/changelog
index 0a7fe92..dd95712 100644
--- a/changelog
+++ b/changelog
@@ -1,7 +1,9 @@
-20082016 wxh src/interp/i-intern.boot use hashtable to speedup compiles
-20082016 wxh src/interp/g-util.boot use hashtable to speedup compiles
-20082016 wxh src/interp/compiler.boot use hashtable to speedup compiles
-20082016 wxh src/interp/category.boot use hashtable to speedup compiles
+20080217 tpd src/algebra/string.spad add function examples
+20080217 tpd src/algebra/curve.spad add function examples
+20080216 wxh src/interp/i-intern.boot use hashtable to speedup compiles
+20080216 wxh src/interp/g-util.boot use hashtable to speedup compiles
+20080216 wxh src/interp/compiler.boot use hashtable to speedup compiles
+20080216 wxh src/interp/category.boot use hashtable to speedup compiles
 20080215 tpd src/interp/format.boot add )d op documentation
 20080215 tpd src/algebra/plot add comment documentation
 20080210 tpd src/algebra/Makefile add plot help and input files for plot
diff --git a/src/algebra/curve.spad.pamphlet b/src/algebra/curve.spad.pamphlet
index 5ca9495..6128b6b 100644
--- a/src/algebra/curve.spad.pamphlet
+++ b/src/algebra/curve.spad.pamphlet
@@ -36,14 +36,43 @@ FunctionFieldCategory(F, UP, UPUP): Category == Definition 
where
     numberOfComponents     : () -> NonNegativeInteger
       ++ numberOfComponents() returns the number of absolutely irreducible
       ++ components.
+      ++
+      ++E P0 := UnivariatePolynomial(x, Integer)
+      ++E P1 := UnivariatePolynomial(y, Fraction P0)
+      ++E R := RadicalFunctionField(INT, P0, P1, 1 - x**20, 20)
+      ++E numberOfComponents()$R
     genus                  : () -> NonNegativeInteger
       ++ genus() returns the genus of one absolutely irreducible component
+      ++
+      ++E P0 := UnivariatePolynomial(x, Integer)
+      ++E P1 := UnivariatePolynomial(y, Fraction P0)
+      ++E R := RadicalFunctionField(INT, P0, P1, 1 - x**20, 20)
+      ++E genus()$R
     absolutelyIrreducible? : () -> Boolean
       ++ absolutelyIrreducible?() tests if the curve absolutely irreducible?
+      ++
+      ++E P0 := UnivariatePolynomial(x, Integer)
+      ++E P1 := UnivariatePolynomial(y, Fraction P0)
+      ++E R2 := RadicalFunctionField(INT, P0, P1, 2 * x**2, 4)
+      ++E absolutelyIrreducible?()$R2
     rationalPoint?         : (F, F) -> Boolean
       ++ rationalPoint?(a, b) tests if \spad{(x=a,y=b)} is on the curve.
+      ++
+      ++E P0 := UnivariatePolynomial(x, Integer)
+      ++E P1 := UnivariatePolynomial(y, Fraction P0)
+      ++E R := RadicalFunctionField(INT, P0, P1, 1 - x**20, 20)
+      ++E rationalPoint?(0,0)$R
+      ++E R2 := RadicalFunctionField(INT, P0, P1, 2 * x**2, 4)
+      ++E rationalPoint?(0,0)$R2
     branchPointAtInfinity? : () -> Boolean
       ++ branchPointAtInfinity?() tests if there is a branch point at infinity.
+      ++
+      ++E P0 := UnivariatePolynomial(x, Integer)
+      ++E P1 := UnivariatePolynomial(y, Fraction P0)
+      ++E R := RadicalFunctionField(INT, P0, P1, 1 - x**20, 20)
+      ++E branchPointAtInfinity?()$R
+      ++E R2 := RadicalFunctionField(INT, P0, P1, 2 * x**2, 4)
+      ++E branchPointAtInfinity?()$R
     branchPoint?           : F -> Boolean
       ++ branchPoint?(a) tests whether \spad{x = a} is a branch point.
     branchPoint?           : UP -> Boolean
@@ -62,8 +91,18 @@ FunctionFieldCategory(F, UP, UPUP): Category == Definition 
where
       ++ ramified?(p) tests whether \spad{p(x) = 0} is ramified.
     integralBasis          : () -> Vector $
       ++ integralBasis() returns the integral basis for the curve.
+      ++
+      ++E P0 := UnivariatePolynomial(x, Integer)
+      ++E P1 := UnivariatePolynomial(y, Fraction P0)
+      ++E R := RadicalFunctionField(INT, P0, P1, 1 - x**20, 20)
+      ++E integralBasis()$R
     integralBasisAtInfinity: () -> Vector $
-      ++ integralBasisAtInfinity() returns the local integral basis at 
infinity.
+      ++ integralBasisAtInfinity() returns the local integral basis at infinity
+      ++
+      ++E P0 := UnivariatePolynomial(x, Integer)
+      ++E P1 := UnivariatePolynomial(y, Fraction P0)
+      ++E R := RadicalFunctionField(INT, P0, P1, 1 - x**20, 20)
+      ++E integralBasisAtInfinity()$R
     integralAtInfinity?    : $  -> Boolean
       ++ integralAtInfinity?() tests if f is locally integral at infinity.
     integral?              : $  -> Boolean
@@ -81,21 +120,41 @@ FunctionFieldCategory(F, UP, UPUP): Category == Definition 
where
       ++ \spad{(w1,...,wn) = M (1, y, ..., y**(n-1))},
       ++ where \spad{(w1,...,wn)} is the integral basis of
       ++ \spadfunFrom{integralBasis}{FunctionFieldCategory}.
+      ++
+      ++E P0 := UnivariatePolynomial(x, Integer)
+      ++E P1 := UnivariatePolynomial(y, Fraction P0)
+      ++E R := RadicalFunctionField(INT, P0, P1, 1 - x**20, 20)
+      ++E integralMatrix()$R
     inverseIntegralMatrix  : () -> Matrix RF
       ++ inverseIntegralMatrix() returns M such that
       ++ \spad{M (w1,...,wn) = (1, y, ..., y**(n-1))}
       ++ where \spad{(w1,...,wn)} is the integral basis of
       ++ \spadfunFrom{integralBasis}{FunctionFieldCategory}.
+      ++
+      ++E P0 := UnivariatePolynomial(x, Integer)
+      ++E P1 := UnivariatePolynomial(y, Fraction P0)
+      ++E R := RadicalFunctionField(INT, P0, P1, 1 - x**20, 20)
+      ++E inverseIntegralMatrix()$R
     integralMatrixAtInfinity       : () -> Matrix RF
       ++ integralMatrixAtInfinity() returns M such that
       ++ \spad{(v1,...,vn) = M (1, y, ..., y**(n-1))}
       ++ where \spad{(v1,...,vn)} is the local integral basis at infinity
       ++ returned by \spad{infIntBasis()}.
+      ++
+      ++E P0 := UnivariatePolynomial(x, Integer)
+      ++E P1 := UnivariatePolynomial(y, Fraction P0)
+      ++E R := RadicalFunctionField(INT, P0, P1, 1 - x**20, 20)
+      ++E integralMatrixAtInfinity()$R
     inverseIntegralMatrixAtInfinity: () -> Matrix RF
       ++ inverseIntegralMatrixAtInfinity() returns M such
       ++ that \spad{M (v1,...,vn) = (1, y, ..., y**(n-1))}
       ++ where \spad{(v1,...,vn)} is the local integral basis at infinity
       ++ returned by \spad{infIntBasis()}.
+      ++
+      ++E P0 := UnivariatePolynomial(x, Integer)
+      ++E P1 := UnivariatePolynomial(y, Fraction P0)
+      ++E R := RadicalFunctionField(INT, P0, P1, 1 - x**20, 20)
+      ++E inverseIntegralMatrixAtInfinity()$R
     yCoordinates           : $ -> Record(num:Vector(UP), den:UP)
       ++ yCoordinates(f) returns \spad{[[A1,...,An], D]} such that
       ++ \spad{f = (A1 + A2 y +...+ An y**(n-1)) / D}.
@@ -120,7 +179,7 @@ FunctionFieldCategory(F, UP, UPUP): Category == Definition 
where
     integral?              : ($,  F) -> Boolean
       ++ integral?(f, a) tests whether f is locally integral at \spad{x = a}.
     integral?              : ($, UP) -> Boolean
-      ++ integral?(f, p) tests whether f is locally integral at \spad{p(x) = 
0}.
+      ++ integral?(f, p) tests whether f is locally integral at \spad{p(x) = 0}
     differentiate          : ($, UP -> UP) -> $
       ++ differentiate(x, d) extends the derivation d from UP to $ and
       ++ applies it to x.
@@ -131,7 +190,8 @@ FunctionFieldCategory(F, UP, UPUP): Category == Definition 
where
       ++ primitivePart(f) removes the content of the denominator and
       ++ the common content of the numerator of f.
     elt                    : ($, F, F) -> F
-      ++ elt(f,a,b) or f(a, b) returns the value of f at the point \spad{(x = 
a, y = b)}
+      ++ elt(f,a,b) or f(a, b) returns the value of f 
+      ++ at the point \spad{(x = a, y = b)}
       ++ if it is not singular.
     elliptic               : () -> Union(UP, "failed")
       ++ elliptic() returns \spad{p(x)} if the curve is the elliptic
diff --git a/src/algebra/string.spad.pamphlet b/src/algebra/string.spad.pamphlet
index a7af939..9cae78b 100644
--- a/src/algebra/string.spad.pamphlet
+++ b/src/algebra/string.spad.pamphlet
@@ -228,98 +228,130 @@ o $AXIOM/doc/src/algebra/string.spad.dvi
 ++   This domain provides the basic character data type.
 
 Character: OrderedFinite() with
-       ord: % -> Integer
-           ++ ord(c) provides an integral code corresponding to the
-           ++ character c.  It is always true that \spad{char ord c = c}.
-       char: Integer  -> %
-           ++ char(i) provides a character corresponding to the integer
-           ++ code i.  It is always true that \spad{ord char i = i}.
-       char: String   -> %
-           ++ char(s) provides a character from a string s of length one.
-       space:  () -> %
-           ++ space() provides the blank character.
-       quote:  () -> %
-           ++ quote() provides the string quote character, \spad{"}.
-       escape: () -> %
-           ++ escape() provides the escape character, \spad{_}, which
-           ++ is used to allow quotes and other characters {\em within}
-           ++ strings.
-       upperCase: % -> %
-           ++ upperCase(c) converts a lower case letter to the corresponding
-           ++ upper case letter.  If c is not a lower case letter, then
-           ++ it is returned unchanged.
-       lowerCase: % -> %
-           ++ lowerCase(c) converts an upper case letter to the corresponding
-           ++ lower case letter.  If c is not an upper case letter, then
-           ++ it is returned unchanged.
-       digit?: % -> Boolean
-           ++ digit?(c) tests if c is a digit character,
-           ++ i.e. one of 0..9.
-       hexDigit?: % -> Boolean
-           ++ hexDigit?(c) tests if c is a hexadecimal numeral,
-           ++ i.e. one of 0..9, a..f or A..F.
-       alphabetic?: % -> Boolean
-           ++ alphabetic?(c) tests if c is a letter,
-           ++ i.e. one of a..z or A..Z.
-       upperCase?: % -> Boolean
-           ++ upperCase?(c) tests if c is an upper case letter,
-           ++ i.e. one of A..Z.
-       lowerCase?: % -> Boolean
-           ++ lowerCase?(c) tests if c is an lower case letter,
-           ++ i.e. one of a..z.
-       alphanumeric?: % -> Boolean
-           ++ alphanumeric?(c) tests if c is either a letter or number,
-           ++ i.e. one of 0..9, a..z or A..Z.
-
-    == add
-       Rep := SingleInteger      -- 0..255
-
-       CC ==> CharacterClass()
-       import CC
-
-       --cl: Record(dig:CC,hex:CC,upp:CC,low:CC,alpha:CC,alnum:CC) :=
-       --    [ digit(), hexDigit(),
-       --      upperCase(), lowerCase(), alphabetic(), alphanumeric() ]
-
-       OutChars:PrimitiveArray(OutputForm) :=
-          construct [NUM2CHAR(i)$Lisp for i in 0..255]
-
-       minChar := minIndex OutChars
-
-       a = b                  == a =$Rep b
-       a < b                  == a <$Rep b
-       size()                 == 256
-       index n                == char((n - 1)::Integer)
-       lookup c               == (1 + ord c)::PositiveInteger
-       char(n:Integer)        == n::%
-       ord c                  == convert(c)$Rep
-       random()               == char(random()$Integer rem size())
-       space                  == QENUM("   ", 0$Lisp)$Lisp
-       quote                  == QENUM("_" ", 0$Lisp)$Lisp
-       escape                 == QENUM("__ ", 0$Lisp)$Lisp
-       coerce(c:%):OutputForm == OutChars(minChar + ord c)
-       digit? c               == member?(c pretend Character, digit())
-       hexDigit? c            == member?(c pretend Character, hexDigit())
-       upperCase? c           == member?(c pretend Character, upperCase())
-       lowerCase? c           == member?(c pretend Character, lowerCase())
-       alphabetic? c          == member?(c pretend Character, alphabetic())
-       alphanumeric? c        == member?(c pretend Character, alphanumeric())
-
-       latex c ==
-           concat("\mbox{`", concat(new(1,c pretend Character)$String, 
"'}")$String)$String
-
-       char(s:String) ==
---       one?(#s) => s(minIndex s) pretend %
-         (#s) = 1 => s(minIndex s) pretend %
-         error "String is not a single character"
-
-       upperCase c ==
-         QENUM(PNAME(UPCASE(NUM2CHAR(ord c)$Lisp)$Lisp)$Lisp,
-               0$Lisp)$Lisp
-
-       lowerCase c ==
-         QENUM(PNAME(DOWNCASE(NUM2CHAR(ord c)$Lisp)$Lisp)$Lisp,
-               0$Lisp)$Lisp
+  ord: % -> Integer
+    ++ ord(c) provides an integral code corresponding to the
+    ++ character c.  It is always true that \spad{char ord c = c}.
+    ++
+    ++E chars := [char "a", char "A", char "X", char "8", char "+"]
+    ++E [ord c for c in chars]
+  char: Integer  -> %
+    ++ char(i) provides a character corresponding to the integer
+    ++ code i. It is always true that \spad{ord char i = i}.
+    ++
+    ++E [char c for c in [97,65,88,56,43]]
+  char: String   -> %
+    ++ char(s) provides a character from a string s of length one.
+    ++
+    ++E [char c for c in ["a","A","X","8","+"]]
+  space: () -> %
+    ++ space() provides the blank character.
+    ++
+    ++E space()
+  quote: () -> %
+    ++ quote() provides the string quote character, \spad{"}.
+    ++
+    ++E quote()
+  escape: () -> %
+    ++ escape() provides the escape character, \spad{_}, which
+    ++ is used to allow quotes and other characters {\em within}
+    ++ strings.
+    ++
+    ++E escape()
+  upperCase: % -> %
+    ++ upperCase(c) converts a lower case letter to the corresponding
+    ++ upper case letter.  If c is not a lower case letter, then
+    ++ it is returned unchanged.
+    ++
+    ++E chars := [char "a", char "A", char "X", char "8", char "+"]
+    ++E [upperCase c for c in chars]
+  lowerCase: % -> %
+    ++ lowerCase(c) converts an upper case letter to the corresponding
+    ++ lower case letter.  If c is not an upper case letter, then
+    ++ it is returned unchanged.
+    ++
+    ++E chars := [char "a", char "A", char "X", char "8", char "+"]
+    ++E [lowerCase c for c in chars]
+  digit?: % -> Boolean
+    ++ digit?(c) tests if c is a digit character,
+    ++ i.e. one of 0..9.
+    ++
+    ++E chars := [char "a", char "A", char "X", char "8", char "+"]
+    ++E [digit? c for c in chars]
+  hexDigit?: % -> Boolean
+    ++ hexDigit?(c) tests if c is a hexadecimal numeral,
+    ++ i.e. one of 0..9, a..f or A..F.
+    ++
+    ++E chars := [char "a", char "A", char "X", char "8", char "+"]
+    ++E [hexDigit? c for c in chars]
+  alphabetic?: % -> Boolean
+    ++ alphabetic?(c) tests if c is a letter,
+    ++ i.e. one of a..z or A..Z.
+    ++
+    ++E chars := [char "a", char "A", char "X", char "8", char "+"]
+    ++E [alphabetic? c for c in chars]
+  upperCase?: % -> Boolean
+    ++ upperCase?(c) tests if c is an upper case letter,
+    ++ i.e. one of A..Z.
+    ++
+    ++E chars := [char "a", char "A", char "X", char "8", char "+"]
+    ++E [upperCase? c for c in chars]
+  lowerCase?: % -> Boolean
+    ++ lowerCase?(c) tests if c is an lower case letter,
+    ++ i.e. one of a..z.
+    ++
+    ++E chars := [char "a", char "A", char "X", char "8", char "+"]
+    ++E [lowerCase? c for c in chars]
+  alphanumeric?: % -> Boolean
+    ++ alphanumeric?(c) tests if c is either a letter or number,
+    ++ i.e. one of 0..9, a..z or A..Z.
+    ++
+    ++E chars := [char "a", char "A", char "X", char "8", char "+"]
+    ++E [alphanumeric? c for c in chars]
+
+ == add
+
+  Rep := SingleInteger  -- 0..255
+
+  CC ==> CharacterClass()
+  import CC
+
+  OutChars:PrimitiveArray(OutputForm) :=
+   construct [NUM2CHAR(i)$Lisp for i in 0..255]
+
+  minChar := minIndex OutChars
+
+  a = b                  == a =$Rep b
+  a < b                         == a <$Rep b
+  size()                 == 256
+  index n                == char((n - 1)::Integer)
+  lookup c               == (1 + ord c)::PositiveInteger
+  char(n:Integer)        == n::%
+  ord c                  == convert(c)$Rep
+  random()               == char(random()$Integer rem size())
+  space                  == QENUM("   ", 0$Lisp)$Lisp
+  quote                  == QENUM("_" ", 0$Lisp)$Lisp
+  escape                 == QENUM("__ ", 0$Lisp)$Lisp
+  coerce(c:%):OutputForm == OutChars(minChar + ord c)
+  digit? c               == member?(c pretend Character, digit())
+  hexDigit? c            == member?(c pretend Character, hexDigit())
+  upperCase? c           == member?(c pretend Character, upperCase())
+  lowerCase? c           == member?(c pretend Character, lowerCase())
+  alphabetic? c          == member?(c pretend Character, alphabetic())
+  alphanumeric? c        == member?(c pretend Character, alphanumeric())
+
+  latex c ==
+    concat("\mbox{`", concat(new(1,c pretend Character)$String, "'}")_
+       $String)$String
+
+  char(s:String) ==
+   (#s) = 1 => s(minIndex s) pretend %
+   error "String is not a single character"
+
+  upperCase c ==
+    QENUM(PNAME(UPCASE(NUM2CHAR(ord c)$Lisp)$Lisp)$Lisp,0$Lisp)$Lisp
+
+  lowerCase c ==
+    QENUM(PNAME(DOWNCASE(NUM2CHAR(ord c)$Lisp)$Lisp)$Lisp,0$Lisp)$Lisp
 
 @
 \section{CHAR.lsp BOOTSTRAP} 
@@ -351,7 +383,12 @@ Note that this code is not included in the generated 
catdef.spad file.
 
 (DEFUN |CHAR;index;Pi$;4| (|n| |$|) (SPADCALL (|-| |n| 1) (QREFELT |$| 18))) 
 
-(DEFUN |CHAR;lookup;$Pi;5| (|c| |$|) (PROG (#1=#:G90919) (RETURN (PROG1 (LETT 
#1# (|+| 1 (SPADCALL |c| (QREFELT |$| 21))) |CHAR;lookup;$Pi;5|) 
(|check-subtype| (|>| #1# 0) (QUOTE (|PositiveInteger|)) #1#))))) 
+(DEFUN |CHAR;lookup;$Pi;5| (|c| |$|)
+ (PROG (#1=#:G90919)
+  (RETURN
+   (PROG1
+    (LETT #1# (|+| 1 (SPADCALL |c| (QREFELT |$| 21))) |CHAR;lookup;$Pi;5|)
+    (|check-subtype| (|>| #1# 0) (QUOTE (|PositiveInteger|)) #1#))))) 
 
 (DEFUN |CHAR;char;I$;6| (|n| |$|) (SPADCALL |n| (QREFELT |$| 23))) 
 
@@ -359,47 +396,146 @@ Note that this code is not included in the generated 
catdef.spad file.
 
 (DEFUN |CHAR;ord;$I;7| (|c| |$|) |c|) 
 
-(DEFUN |CHAR;random;$;8| (|$|) (SPADCALL (REMAINDER2 (|random|) (SPADCALL 
(QREFELT |$| 16))) (QREFELT |$| 18))) 
+(DEFUN |CHAR;random;$;8| (|$|)
+ (SPADCALL (REMAINDER2 (|random|) (SPADCALL (QREFELT |$| 16)))
+           (QREFELT |$| 18))) 
 
-(PUT (QUOTE |CHAR;space;$;9|) (QUOTE |SPADreplace|) (QUOTE (XLAM NIL (QENUM "  
 " 0)))) 
+(PUT (QUOTE |CHAR;space;$;9|)
+ (QUOTE |SPADreplace|) (QUOTE (XLAM NIL (QENUM "   " 0)))) 
 
 (DEFUN |CHAR;space;$;9| (|$|) (QENUM "   " 0)) 
 
-(PUT (QUOTE |CHAR;quote;$;10|) (QUOTE |SPADreplace|) (QUOTE (XLAM NIL (QENUM 
"\" " 0)))) 
+(PUT (QUOTE |CHAR;quote;$;10|)
+ (QUOTE |SPADreplace|) (QUOTE (XLAM NIL (QENUM "\" " 0)))) 
 
 (DEFUN |CHAR;quote;$;10| (|$|) (QENUM "\" " 0)) 
 
-(PUT (QUOTE |CHAR;escape;$;11|) (QUOTE |SPADreplace|) (QUOTE (XLAM NIL (QENUM 
"_ " 0)))) 
+(PUT (QUOTE |CHAR;escape;$;11|)
+ (QUOTE |SPADreplace|) (QUOTE (XLAM NIL (QENUM "_ " 0)))) 
 
 (DEFUN |CHAR;escape;$;11| (|$|) (QENUM "_ " 0)) 
 
-(DEFUN |CHAR;coerce;$Of;12| (|c| |$|) (ELT (QREFELT |$| 10) (|+| (QREFELT |$| 
11) (SPADCALL |c| (QREFELT |$| 21))))) 
-
-(DEFUN |CHAR;digit?;$B;13| (|c| |$|) (SPADCALL |c| (|spadConstant| |$| 31) 
(QREFELT |$| 33))) 
-
-(DEFUN |CHAR;hexDigit?;$B;14| (|c| |$|) (SPADCALL |c| (|spadConstant| |$| 35) 
(QREFELT |$| 33))) 
-
-(DEFUN |CHAR;upperCase?;$B;15| (|c| |$|) (SPADCALL |c| (|spadConstant| |$| 37) 
(QREFELT |$| 33))) 
-
-(DEFUN |CHAR;lowerCase?;$B;16| (|c| |$|) (SPADCALL |c| (|spadConstant| |$| 39) 
(QREFELT |$| 33))) 
-
-(DEFUN |CHAR;alphabetic?;$B;17| (|c| |$|) (SPADCALL |c| (|spadConstant| |$| 
41) (QREFELT |$| 33))) 
-
-(DEFUN |CHAR;alphanumeric?;$B;18| (|c| |$|) (SPADCALL |c| (|spadConstant| |$| 
43) (QREFELT |$| 33))) 
-
-(DEFUN |CHAR;latex;$S;19| (|c| |$|) (STRCONC "\\mbox{`" (STRCONC 
(|MAKE-FULL-CVEC| 1 |c|) "'}"))) 
-
-(DEFUN |CHAR;char;S$;20| (|s| |$|) (COND ((EQL (QCSIZE |s|) 1) (SPADCALL |s| 
(SPADCALL |s| (QREFELT |$| 47)) (QREFELT |$| 48))) ((QUOTE T) (|error| "String 
is not a single character")))) 
-
-(DEFUN |CHAR;upperCase;2$;21| (|c| |$|) (QENUM (PNAME (UPCASE (NUM2CHAR 
(SPADCALL |c| (QREFELT |$| 21))))) 0)) 
-
-(DEFUN |CHAR;lowerCase;2$;22| (|c| |$|) (QENUM (PNAME (DOWNCASE (NUM2CHAR 
(SPADCALL |c| (QREFELT |$| 21))))) 0)) 
-
-(DEFUN |Character| NIL (PROG NIL (RETURN (PROG (#1=#:G90941) (RETURN (COND 
((LETT #1# (HGET |$ConstructorCache| (QUOTE |Character|)) |Character|) 
(|CDRwithIncrement| (CDAR #1#))) ((QUOTE T) (|UNWIND-PROTECT| (PROG1 (CDDAR 
(HPUT |$ConstructorCache| (QUOTE |Character|) (LIST (CONS NIL (CONS 1 
(|Character;|)))))) (LETT #1# T |Character|)) (COND ((NOT #1#) (HREM 
|$ConstructorCache| (QUOTE |Character|)))))))))))) 
-
-(DEFUN |Character;| NIL (PROG (|dv$| |$| |pv$| #1=#:G90939 |i|) (RETURN (SEQ 
(PROGN (LETT |dv$| (QUOTE (|Character|)) . #2=(|Character|)) (LETT |$| (GETREFV 
53) . #2#) (QSETREFV |$| 0 |dv$|) (QSETREFV |$| 3 (LETT |pv$| 
(|buildPredVector| 0 0 NIL) . #2#)) (|haddProp| |$ConstructorCache| (QUOTE 
|Character|) NIL (CONS 1 |$|)) (|stuffDomainSlots| |$|) (QSETREFV |$| 6 
(|SingleInteger|)) (QSETREFV |$| 10 (SPADCALL (PROGN (LETT #1# NIL . #2#) (SEQ 
(LETT |i| 0 . #2#) G190 (COND ((QSGREATERP |i| 255) (GO G191))) (SEQ (EXIT 
(LETT #1# (CONS (NUM2CHAR |i|) #1#) . #2#))) (LETT |i| (QSADD1 |i|) . #2#) (GO 
G190) G191 (EXIT (NREVERSE0 #1#)))) (QREFELT |$| 9))) (QSETREFV |$| 11 0) 
|$|))))) 
-
-(MAKEPROP (QUOTE |Character|) (QUOTE |infovec|) (LIST (QUOTE #(NIL NIL NIL NIL 
NIL NIL (QUOTE |Rep|) (|List| 28) (|PrimitiveArray| 28) (0 . |construct|) 
(QUOTE |OutChars|) (QUOTE |minChar|) (|Boolean|) |CHAR;=;2$B;1| |CHAR;<;2$B;2| 
(|NonNegativeInteger|) |CHAR;size;Nni;3| (|Integer|) |CHAR;char;I$;6| 
(|PositiveInteger|) |CHAR;index;Pi$;4| |CHAR;ord;$I;7| |CHAR;lookup;$Pi;5| (5 . 
|coerce|) |CHAR;random;$;8| |CHAR;space;$;9| |CHAR;quote;$;10| 
|CHAR;escape;$;11| (|OutputForm|) |CHAR;coerce;$Of;12| (|CharacterClass|) (10 . 
|digit|) (|Character|) (14 . |member?|) |CHAR;digit?;$B;13| (20 . |hexDigit|) 
|CHAR;hexDigit?;$B;14| (24 . |upperCase|) |CHAR;upperCase?;$B;15| (28 . 
|lowerCase|) |CHAR;lowerCase?;$B;16| (32 . |alphabetic|) 
|CHAR;alphabetic?;$B;17| (36 . |alphanumeric|) |CHAR;alphanumeric?;$B;18| 
(|String|) |CHAR;latex;$S;19| (40 . |minIndex|) (45 . |elt|) |CHAR;char;S$;20| 
|CHAR;upperCase;2$;21| |CHAR;lowerCase;2$;22| (|SingleInteger|))) (QUOTE #(|~=| 
51 |upperCase?| 57 |upp!
erCase| 62 |space| 67 |size| 71 |random| 75 |quote| 79 |ord| 83 |min| 88 |max| 
94 |lowerCase?| 100 |lowerCase| 105 |lookup| 110 |latex| 115 |index| 120 
|hexDigit?| 125 |hash| 130 |escape| 135 |digit?| 139 |coerce| 144 |char| 149 
|alphanumeric?| 159 |alphabetic?| 164 |>=| 169 |>| 175 |=| 181 |<=| 187 |<| 
193)) (QUOTE NIL) (CONS (|makeByteWordVec2| 1 (QUOTE (0 0 0 0 0 0))) (CONS 
(QUOTE #(NIL |OrderedSet&| NIL |SetCategory&| |BasicType&| NIL)) (CONS (QUOTE 
#((|OrderedFinite|) (|OrderedSet|) (|Finite|) (|SetCategory|) (|BasicType|) 
(|CoercibleTo| 28))) (|makeByteWordVec2| 52 (QUOTE (1 8 0 7 9 1 6 0 17 23 0 30 
0 31 2 30 12 32 0 33 0 30 0 35 0 30 0 37 0 30 0 39 0 30 0 41 0 30 0 43 1 45 17 
0 47 2 45 32 0 17 48 2 0 12 0 0 1 1 0 12 0 38 1 0 0 0 50 0 0 0 25 0 0 15 16 0 0 
0 24 0 0 0 26 1 0 17 0 21 2 0 0 0 0 1 2 0 0 0 0 1 1 0 12 0 40 1 0 0 0 51 1 0 19 
0 22 1 0 45 0 46 1 0 0 19 20 1 0 12 0 36 1 0 52 0 1 0 0 0 27 1 0 12 0 34 1 0 28 
0 29 1 0 0 45 49 1 0 0 17 18 1 0 12 0 44 1 0 12 0 42 2 0 !
12 0 0 1 2 0 12 0 0 1 2 0 12 0 0 13 2 0 12 0 0 1 2 0 12 0 0 1!
4)))))) (QUOTE |lookupComplete|))) 
+(DEFUN |CHAR;coerce;$Of;12| (|c| |$|)
+ (ELT (QREFELT |$| 10)
+      (|+| (QREFELT |$| 11) (SPADCALL |c| (QREFELT |$| 21))))) 
+
+(DEFUN |CHAR;digit?;$B;13| (|c| |$|)
+ (SPADCALL |c| (|spadConstant| |$| 31) (QREFELT |$| 33))) 
+
+(DEFUN |CHAR;hexDigit?;$B;14| (|c| |$|)
+ (SPADCALL |c| (|spadConstant| |$| 35) (QREFELT |$| 33))) 
+
+(DEFUN |CHAR;upperCase?;$B;15| (|c| |$|)
+ (SPADCALL |c| (|spadConstant| |$| 37) (QREFELT |$| 33))) 
+
+(DEFUN |CHAR;lowerCase?;$B;16| (|c| |$|)
+ (SPADCALL |c| (|spadConstant| |$| 39) (QREFELT |$| 33))) 
+
+(DEFUN |CHAR;alphabetic?;$B;17| (|c| |$|)
+ (SPADCALL |c| (|spadConstant| |$| 41) (QREFELT |$| 33))) 
+
+(DEFUN |CHAR;alphanumeric?;$B;18| (|c| |$|)
+ (SPADCALL |c| (|spadConstant| |$| 43) (QREFELT |$| 33))) 
+
+(DEFUN |CHAR;latex;$S;19| (|c| |$|)
+ (STRCONC "\\mbox{`" (STRCONC (|MAKE-FULL-CVEC| 1 |c|) "'}"))) 
+
+(DEFUN |CHAR;char;S$;20| (|s| |$|)
+ (COND
+  ((EQL (QCSIZE |s|) 1)
+    (SPADCALL |s| (SPADCALL |s| (QREFELT |$| 47)) (QREFELT |$| 48)))
+  ((QUOTE T) (|error| "String is not a single character")))) 
+
+(DEFUN |CHAR;upperCase;2$;21| (|c| |$|)
+ (QENUM (PNAME (UPCASE (NUM2CHAR (SPADCALL |c| (QREFELT |$| 21))))) 0)) 
+
+(DEFUN |CHAR;lowerCase;2$;22| (|c| |$|)
+ (QENUM (PNAME (DOWNCASE (NUM2CHAR (SPADCALL |c| (QREFELT |$| 21))))) 0)) 
+
+(DEFUN |Character| NIL
+ (PROG NIL
+  (RETURN
+   (PROG (#1=#:G90941)
+    (RETURN
+     (COND
+      ((LETT #1# (HGET |$ConstructorCache| (QUOTE |Character|)) |Character|)
+        (|CDRwithIncrement| (CDAR #1#)))
+      ((QUOTE T)
+        (|UNWIND-PROTECT|
+         (PROG1
+          (CDDAR 
+           (HPUT |$ConstructorCache| (QUOTE |Character|)
+            (LIST (CONS NIL (CONS 1 (|Character;|))))))
+          (LETT #1# T |Character|))
+         (COND
+          ((NOT #1#) (HREM |$ConstructorCache| (QUOTE |Character|)))))))))))) 
+
+(DEFUN |Character;| NIL
+ (PROG (|dv$| |$| |pv$| #1=#:G90939 |i|)
+  (RETURN
+   (SEQ
+    (PROGN
+     (LETT |dv$| (QUOTE (|Character|)) . #2=(|Character|))
+     (LETT |$| (GETREFV 53) . #2#)
+     (QSETREFV |$| 0 |dv$|)
+     (QSETREFV |$| 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #2#))
+     (|haddProp| |$ConstructorCache| (QUOTE |Character|) NIL (CONS 1 |$|))
+     (|stuffDomainSlots| |$|)
+     (QSETREFV |$| 6 (|SingleInteger|))
+     (QSETREFV |$| 10 
+      (SPADCALL
+       (PROGN
+        (LETT #1# NIL . #2#)
+        (SEQ
+         (LETT |i| 0 . #2#)
+         G190
+         (COND ((QSGREATERP |i| 255) (GO G191)))
+         (SEQ (EXIT (LETT #1# (CONS (NUM2CHAR |i|) #1#) . #2#)))
+         (LETT |i| (QSADD1 |i|) . #2#)
+         (GO G190)
+         G191
+         (EXIT (NREVERSE0 #1#))))
+       (QREFELT |$| 9)))
+     (QSETREFV |$| 11 0) |$|))))) 
+
+(MAKEPROP (QUOTE |Character|) (QUOTE |infovec|)
+ (LIST (QUOTE 
+  #(NIL NIL NIL NIL NIL NIL (QUOTE |Rep|) (|List| 28) (|PrimitiveArray| 28)
+   (0 . |construct|) (QUOTE |OutChars|) (QUOTE |minChar|) (|Boolean|)
+   |CHAR;=;2$B;1| |CHAR;<;2$B;2| (|NonNegativeInteger|) |CHAR;size;Nni;3|
+   (|Integer|) |CHAR;char;I$;6| (|PositiveInteger|) |CHAR;index;Pi$;4|
+   |CHAR;ord;$I;7| |CHAR;lookup;$Pi;5| (5 . |coerce|) |CHAR;random;$;8|
+   |CHAR;space;$;9| |CHAR;quote;$;10| |CHAR;escape;$;11| (|OutputForm|)
+   |CHAR;coerce;$Of;12| (|CharacterClass|) (10 . |digit|) (|Character|)
+   (14 . |member?|) |CHAR;digit?;$B;13| (20 . |hexDigit|)
+   |CHAR;hexDigit?;$B;14| (24 . |upperCase|) |CHAR;upperCase?;$B;15|
+   (28 . |lowerCase|) |CHAR;lowerCase?;$B;16| (32 . |alphabetic|)
+   |CHAR;alphabetic?;$B;17| (36 . |alphanumeric|) |CHAR;alphanumeric?;$B;18|
+   (|String|) |CHAR;latex;$S;19| (40 . |minIndex|) (45 . |elt|)
+   |CHAR;char;S$;20| |CHAR;upperCase;2$;21| |CHAR;lowerCase;2$;22|
+   (|SingleInteger|))) (QUOTE #(|~=| 51 |upperCase?| 57 |upperCase| 62
+   |space| 67 |size| 71 |random| 75 |quote| 79 |ord| 83 |min| 88 |max| 94
+   |lowerCase?| 100 |lowerCase| 105 |lookup| 110 |latex| 115 |index| 120
+   |hexDigit?| 125 |hash| 130 |escape| 135 |digit?| 139 |coerce| 144 |char|
+   149 |alphanumeric?| 159 |alphabetic?| 164 |>=| 169 |>| 175 |=| 181 |<=|
+   187 |<| 193)) (QUOTE NIL) 
+   (CONS
+    (|makeByteWordVec2| 1 (QUOTE (0 0 0 0 0 0)))
+    (CONS 
+     (QUOTE #(NIL |OrderedSet&| NIL |SetCategory&| |BasicType&| NIL))
+     (CONS
+      (QUOTE #((|OrderedFinite|) (|OrderedSet|) (|Finite|) (|SetCategory|)
+               (|BasicType|) (|CoercibleTo| 28)))
+       (|makeByteWordVec2| 52
+        (QUOTE (1 8 0 7 9 1 6 0 17 23 0 30 0 31 2 30 12 32 0 33 0 30 0 35 
+                0 30 0 37 0 30 0 39 0 30 0 41 0 30 0 43 1 45 17 0 47 2 45
+                32 0 17 48 2 0 12 0 0 1 1 0 12 0 38 1 0 0 0 50 0 0 0 25 0
+                0 15 16 0 0 0 24 0 0 0 26 1 0 17 0 21 2 0 0 0 0 1 2 0 0 0
+                0 1 1 0 12 0 40 1 0 0 0 51 1 0 19 0 22 1 0 45 0 46 1 0 0 19
+                20 1 0 12 0 36 1 0 52 0 1 0 0 0 27 1 0 12 0 34 1 0 28 0 29
+                1 0 0 45 49 1 0 0 17 18 1 0 12 0 44 1 0 12 0 42 2 0 12 0 0
+                1 2 0 12 0 0 1 2 0 12 0 0 13 2 0 12 0 0 1 2 0 12 0 0 14))))))
+  (QUOTE |lookupComplete|))) 
 
 (MAKEPROP (QUOTE |Character|) (QUOTE NILADIC) T) 
 @
@@ -1614,7 +1750,8 @@ String(): StringCategory == IndexedString(MINSTRINGINDEX) 
add
 ++ Description:
 ++ A category for string-like objects
 
-StringCategory():Category == Join(StringAggregate(), SetCategory, OpenMath) 
with
+StringCategory():Category == _
+     Join(StringAggregate(), SetCategory, OpenMath) with
   string: Integer -> %
     ++ string(i) returns the decimal representation of i in a string
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]