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

Edit detail for SandboxFreeAndLocal revision 1 of 2

1 2
Editor: hemmecke
Time: 2008/05/13 15:48:37 GMT-7
Note:

changed:
-
\begin{spad}
)abbrev domain AAA Aaa
Aaa: with
    foo: Integer -> Integer
  == add
    z: Integer := 0
    zzz: () -> Integer
    foo(n: Integer): Integer == 
        z := 1
        n + 2*zzz()
    zzz(): Integer == z
\end{spad}

The following seems to be wrong since z should be implicitly local according to Section 6.16 of the 
"Axiom Book":http://axiom-wiki.newsynthesis.org/public/book2.pdf .

\begin{axiom}
foo(0)
\end{axiom}

\begin{spad}
)abbrev domain AAAL AaaLocal
AaaLocal: with
    fool: Integer -> Integer
  == add
    z: Integer := 0
    zzzl: () -> Integer
    fool(n: Integer): Integer == 
        local z: Integer
        z := 1
        n + 2*zzzl()
    zzzl(): Integer == z
\end{spad}
\begin{axiom}
fool(0)
\end{axiom}

An output of 2 seems wrong again here. I would have expected 0.

\begin{spad}
)abbrev domain AAAF AaaFree
AaaFree: with
    foof: Integer -> Integer
  == add
    z: Integer := 0
    zzzf: () -> Integer
    foof(n: Integer): Integer == 
        free z: Integer
        z := 1
        n + 2*zzzf()
    zzzf(): Integer == z
\end{spad}

The following output of 2 should be fine.
\begin{axiom}
foof(0)
\end{axiom}

spad
)abbrev domain AAA Aaa Aaa: with foo: Integer -> Integer == add z: Integer := 0 zzz: () -> Integer foo(n: Integer): Integer == z := 1 n + 2*zzz() zzz(): Integer == z
spad
   Compiling FriCAS source code from file 
      /var/zope2/var/LatexWiki/8846046079375810821-25px001.spad using 
      old system compiler.
   AAA abbreviates domain Aaa 
------------------------------------------------------------------------
   initializing NRLIB AAA for Aaa 
   compiling into NRLIB AAA 
   compiling exported foo : Integer -> Integer
Time: 0.06 SEC.
   compiling local zzz : () -> Integer
Time: 0 SEC.
(time taken in buildFunctor:  0)
;;;     ***       |Aaa| REDEFINED
;;;     ***       |Aaa| REDEFINED
Time: 0 SEC.
   Cumulative Statistics for Constructor Aaa
      Time: 0.06 seconds
   finalizing NRLIB AAA 
   Processing Aaa for Browser database:
--->-->Aaa((foo ((Integer) (Integer)))): Not documented!!!!
--->-->Aaa(constructor): Not documented!!!!
--->-->Aaa(): Missing Description
------------------------------------------------------------------------
   Aaa is now explicitly exposed in frame initial 
   Aaa will be automatically loaded when needed from 
      /var/zope2/var/LatexWiki/AAA.NRLIB/code

The following seems to be wrong since z should be implicitly local according to Section 6.16 of the Axiom Book .

axiom
foo(0)
LatexWiki Image(1)
Type: PositiveInteger?

spad
)abbrev domain AAAL AaaLocal AaaLocal: with fool: Integer -> Integer == add z: Integer := 0 zzzl: () -> Integer fool(n: Integer): Integer == local z: Integer z := 1 n + 2*zzzl() zzzl(): Integer == z
spad
   Compiling FriCAS source code from file 
      /var/zope2/var/LatexWiki/7742866875728626797-25px003.spad using 
      old system compiler.
   AAAL abbreviates domain AaaLocal 
------------------------------------------------------------------------
   initializing NRLIB AAAL for AaaLocal 
   compiling into NRLIB AAAL 
   compiling exported fool : Integer -> Integer
Time: 0 SEC.
   compiling local zzzl : () -> Integer
Time: 0 SEC.
(time taken in buildFunctor:  0)
;;;     ***       |AaaLocal| REDEFINED
;;;     ***       |AaaLocal| REDEFINED
Time: 0 SEC.
   Cumulative Statistics for Constructor AaaLocal
      Time: 0 seconds
   finalizing NRLIB AAAL 
   Processing AaaLocal for Browser database:
--->-->AaaLocal((fool ((Integer) (Integer)))): Not documented!!!!
--->-->AaaLocal(constructor): Not documented!!!!
--->-->AaaLocal(): Missing Description
------------------------------------------------------------------------
   AaaLocal is now explicitly exposed in frame initial 
   AaaLocal will be automatically loaded when needed from 
      /var/zope2/var/LatexWiki/AAAL.NRLIB/code

axiom
fool(0)
LatexWiki Image(2)
Type: PositiveInteger?

An output of 2 seems wrong again here. I would have expected 0.

spad
)abbrev domain AAAF AaaFree AaaFree: with foof: Integer -> Integer == add z: Integer := 0 zzzf: () -> Integer foof(n: Integer): Integer == free z: Integer z := 1 n + 2*zzzf() zzzf(): Integer == z
spad
   Compiling FriCAS source code from file 
      /var/zope2/var/LatexWiki/2076018909214082053-25px005.spad using 
      old system compiler.
   AAAF abbreviates domain AaaFree 
------------------------------------------------------------------------
   initializing NRLIB AAAF for AaaFree 
   compiling into NRLIB AAAF 
   compiling exported foof : Integer -> Integer
Time: 0.01 SEC.
   compiling local zzzf : () -> Integer
Time: 0 SEC.
(time taken in buildFunctor:  0)
;;;     ***       |AaaFree| REDEFINED
;;;     ***       |AaaFree| REDEFINED
Time: 0 SEC.
   Cumulative Statistics for Constructor AaaFree
      Time: 0.01 seconds
   finalizing NRLIB AAAF 
   Processing AaaFree for Browser database:
--->-->AaaFree((foof ((Integer) (Integer)))): Not documented!!!!
--->-->AaaFree(constructor): Not documented!!!!
--->-->AaaFree(): Missing Description
------------------------------------------------------------------------
   AaaFree is now explicitly exposed in frame initial 
   AaaFree will be automatically loaded when needed from 
      /var/zope2/var/LatexWiki/AAAF.NRLIB/code

The following output of 2 should be fine.

axiom
foof(0)
LatexWiki Image(3)
Type: PositiveInteger?