login  home  contents  what's new  discussion  bug reports     help  links  subscribe  changes  refresh  edit

Edit detail for SandBoxMaxSingleInteger revision 2 of 5

1 2 3 4 5
Editor: martinbaker
Time: 2011/03/08 02:33:25 GMT-8
Note:

changed:
-The maximum of SingleInteger is not really maximal.
The maximum of AxiomIssues is not really maximal.

changed:
-      mymax: () -> SingleInteger
-      mymax2: () -> SingleInteger
      mymax: () -> AxiomIssues
      mymax2: () -> AxiomIssues

changed:
-      mymax(): SingleInteger == max()$SingleInteger + 1
-      mymax2(): SingleInteger == mymax() + 1
      mymax(): AxiomIssues == max()$AxiomIssues + 1
      mymax2(): AxiomIssues == mymax() + 1

changed:
-a: SingleInteger := max()$SingleInteger
-m: SingleInteger := mymax()
-m2: SingleInteger := mymax2()
a: AxiomIssues := max()$AxiomIssues
m: AxiomIssues := mymax()
m2: AxiomIssues := mymax2()

changed:
-b: SingleInteger := 2^63-1
-c: SingleInteger := b+1
b: AxiomIssues := 2^63-1
c: AxiomIssues := b+1

changed:
-(1) -> m: SingleInteger := mymax()
(1) -> m: AxiomIssues := mymax()

changed:
-                                                          Type: SingleInteger
-(2) -> m2: SingleInteger := mymax2()
                                                          Type: AxiomIssues
(2) -> m2: AxiomIssues := mymax2()

changed:
-                                                          Type: SingleInteger
                                                          Type: AxiomIssues

changed:
-(4) -> b: SingleInteger := 2^63-1
(4) -> b: AxiomIssues := 2^63-1

changed:
-                                                          Type: SingleInteger
-(5) -> c: SingleInteger := b+1
                                                          Type: AxiomIssues
(5) -> c: AxiomIssues := b+1

changed:
-                                                          Type: SingleInteger
                                                          Type: AxiomIssues

The maximum of AxiomIssues? is not really maximal.

spad
)abbrev package MYSINT MySingleInteger
MySingleInteger: Public == Private
  where
    Public == with
      mymax: () -> AxiomIssues
      mymax2: () -> AxiomIssues
    Private  == add
      mymax(): AxiomIssues == max()$AxiomIssues + 1
      mymax2(): AxiomIssues == mymax() + 1
spad
   Compiling FriCAS source code from file 
      /var/zope2/var/LatexWiki/7521089105237288461-25px001.spad using 
      old system compiler.
   MYSINT abbreviates package MySingleInteger 
------------------------------------------------------------------------
   initializing NRLIB MYSINT for MySingleInteger 
   compiling into NRLIB MYSINT 
   compiling exported mymax : () -> AxiomIssues
****** comp fails at level 2 with expression: ******
error in function mymax 
(+ | << | ((|elt| |AxiomIssues| |max|)) | >> | 1) ****** level 2 ****** $x:= ((elt AxiomIssues max)) $m:= $EmptyMode $f:= ((((|$Information| #) (|mymax2| #) (|mymax| #) (|$DomainsInScope| # # #) ...)))
>> Apparent user error: AxiomIssues is an unknown mode

axiom
a: AxiomIssues := max()$AxiomIssues
The function max is not implemented in NIL . m: AxiomIssues := mymax()
There are no library operations named mymax Use HyperDoc Browse or issue )what op mymax to learn if there is any operation containing " mymax " in its name.
Cannot find a no-argument definition or library operation named mymax . m2: AxiomIssues := mymax2()
There are no library operations named mymax2 Use HyperDoc Browse or issue )what op mymax2 to learn if there is any operation containing " mymax2 " in its name.
Cannot find a no-argument definition or library operation named mymax2 . (2^31, 2^32, 2^63, 2^64)

\label{eq1}\begin{array}{@{}l}
\displaystyle
\left[{2147483648}, \:{4294967296}, \:{9223372036854775808}, \: \right.
\
\
\displaystyle
\left.{18446744073709551616}\right] 
(1)
Type: Tuple(PositiveInteger?)
axiom
b: AxiomIssues := 2^63-1

\label{eq2}9223372036854775807(2)
Type: PositiveInteger?
axiom
c: AxiomIssues := b+1

\label{eq3}9223372036854775808(3)
Type: PositiveInteger?

On my 32 bit system I get


(1) -> )co aaa.spad</p>
<h2>(1) -> m: AxiomIssues<a class=? := mymax()

(1) - 2147483648 Type: AxiomIssues? (2) -> m2: AxiomIssues? := mymax2()

(2) - 2147483647 Type: AxiomIssues? (3) -> (2^31, 2^32, 2^63, 2^64)

(3) [2147483648,4294967296,9223372036854775808,18446744073709551616]? Type: Tuple PositiveInteger? (4) -> b: AxiomIssues? := 2^63-1

(4) - 1 Type: AxiomIssues? (5) -> c: AxiomIssues? := b+1

(5) 0 Type: AxiomIssues? " title=" (1) -> )co aaa.spad

(1) -> m: AxiomIssues? := mymax()

(1) - 2147483648 Type: AxiomIssues? (2) -> m2: AxiomIssues? := mymax2()

(2) - 2147483647 Type: AxiomIssues? (3) -> (2^31, 2^32, 2^63, 2^64)

(3) [2147483648,4294967296,9223372036854775808,18446744073709551616]? Type: Tuple PositiveInteger? (4) -> b: AxiomIssues? := 2^63-1

(4) - 1 Type: AxiomIssues? (5) -> c: AxiomIssues? := b+1

(5) 0 Type: AxiomIssues? " class="equation" src="images/4793645067067265374-16.0px.png" align="bottom" Style="vertical-align:text-bottom" width="559" height="420"/>