Re: [Axiom-developer] aldor/axiom interoperability

View: New views
12 Messages — Rating Filter:   Alert me  

Parent Message unknown Re: [Axiom-developer] aldor/axiom interoperability

by Gregory Vanuxem-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dear Peter, *

I was waiting for your small Aldor patch and never see it. Did you send
it somewhere ? The main concern of this mail is if you are able to
compile ecfact.as (attached) and _execute_ the
LenstraEllipticMethod(Integer) function. On my system it fails, a bug
somewhere. Am I alone with this issue ?  Martin ? I'm still using the
old build process and want to switch to the new one but this stops me. I
do not want to take your time but maybe you have an idea of what's going
on with this issue.

The output is :

Looking in OutputPackage() for ??349042727  with code 483270060
and an error message : "export not found"

Greg

PS : I precise that I applied one of your patchs, sorry I don't remember
which one, to be able to use recent versions of Aldor. The problem
mentioned here still remains on my machine.

Le jeudi 17 janvier 2008 à 09:32 +0000, Peter Broadbery a écrit :

> Finally got round to looking at this.
> The code attached can be used to build the axiom/aldor interopability
> library (libaxiom.al).
>
> New features:
> Less abuse of make features (though I've only used a recent version of
> make, and have used some newer features)
> Dependency on java removed.
> Cleaner build process - all the dependency analysis is done in the
> aldor code.  It should be more data driven, but it isn't.
>
> There's a small aldor patch that I'll send along this evening.
>
> Peter
> _______________________________________________
> Axiom-developer mailing list
> Axiom-developer@...
> http://lists.nongnu.org/mailman/listinfo/axiom-developer

[ecfact.as]

-- Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd.
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
-- modification, are permitted provided that the following conditions are
-- met:
--
--     - Redistributions of source code must retain the above copyright
--       notice, this list of conditions and the following disclaimer.
--
--     - Redistributions in binary form must reproduce the above copyright
--       notice, this list of conditions and the following disclaimer in
--       the documentation and/or other materials provided with the
--       distribution.
--
--     - Neither the name of The Numerical ALgorithms Group Ltd. nor the
--       names of its contributors may be used to endorse or promote products
--       derived from this software without specific prior written permission.
--
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
-- IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
-- TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
-- OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#include "axiom.as"
#pile

--% Elliptic curve method for integer factorization
--  This file implements Lenstra's algorithm for integer factorization.
--  A divisor of N is found by computing a large multiple of a rational
--  point on a randomly generated elliptic curve in P2 Z/NZ.
--  The Hessian model is used for the curve (1) to simplify the selection
--  of the initial point on the random curve and (2) to minimize the
--  cost of adding points.
--  Ref:  IBM RC 11262, DV Chudnovsky & GV Chudnovsky
--  SMW Sept 86.

--% EllipticCurveRationalPoints
--)abbrev domain ECPTS EllipticCurveRationalPoints

EllipticCurveRationalPoints(x0:Integer, y0:Integer, z0:Integer, n:Integer): ECcat == ECdef where
    Point   ==> Record(x: Integer, y: Integer, z: Integer)

    ECcat ==> AbelianGroup with
        double: %  -> %
        p0:     %
        HessianCoordinates: % -> Point

    ECdef ==> add
        Rep == Point
        import from Rep
        import from List Integer

        Ex == OutputForm

        default u, v:  %

        apply(u:%,x:'x'):Integer == rep(u).x
        apply(u:%,y:'y'):Integer == rep(u).y
        apply(u:%,z:'z'):Integer == rep(u).z
        import from 'x'
        import from 'y'
        import from 'z'

        coerce(u:%): Ex        == [u.x, u.y, u.z]$List(Integer) :: Ex
        p0:%                   == per [x0 rem n, y0 rem n, z0 rem n]
        HessianCoordinates(u:%):Point  == rep u

        0:%   ==
            per [1, (-1) rem n, 0]
        -(u:%):%  ==
            per [u.y, u.x, u.z]
        (u:%) = (v:%):Boolean ==
            XuZv := u.x * v.z
            XvZu := v.x * u.z
            YuZv := u.y * v.z
            YvZu := v.y * u.z
            (XuZv-XvZu) rem n = 0 and (YuZv-YvZu) rem n = 0
        (u:%) + (v:%): % ==
            XuZv := u.x * v.z
            XvZu := v.x * u.z
            YuZv := u.y * v.z
            YvZu := v.y * u.z
            (XuZv-XvZu) rem n = 0 and (YuZv-YvZu) rem n = 0 => double u
            XuYv := u.x * v.y
            XvYu := v.x * u.y
            Xw := XuZv*XuYv - XvZu*XvYu
            Yw := YuZv*XvYu - YvZu*XuYv
            Zw := XvZu*YvZu - XuZv*YuZv
            per [Yw rem n, Xw rem n, Zw rem n]
        double(u:%): % ==
            import from PositiveInteger
            X3 := u.x**(3@PositiveInteger)
            Y3 := u.y**(3@PositiveInteger)
            Z3 := u.z**(3@PositiveInteger)
            Xw := u.x*(Y3 - Z3)
            Yw := u.y*(Z3 - X3)
            Zw := u.z*(X3 - Y3)
            per [Yw rem n, Xw rem n, Zw rem n]
        (n:Integer)*(u:%): % ==
            n < 0 => (-n)*(-u)
            v := 0
            import from UniversalSegment Integer
            for i in 0..length n - 1 repeat
                if bit?(n,i) then v := u + v
                u := double u
            v


--% EllipticCurveFactorization
--)abbrev package ECFACT EllipticCurveFactorization

EllipticCurveFactorization: with
        LenstraEllipticMethod: (Integer)                   -> Integer
        LenstraEllipticMethod: (Integer, Float)         -> Integer
        LenstraEllipticMethod: (Integer, Integer, Integer) -> Integer
        LenstraEllipticMethod: (Integer, Integer)          -> Integer

        lcmLimit: Integer -> Integer
        lcmLimit: Float-> Integer

        solveBound: Float -> Float
        bfloor:     Float -> Integer
        primesTo:   Integer -> List Integer
        lcmTo:      Integer -> Integer
    == add
        import from List Integer
        Ex == OutputForm
        import from Ex
        import from String
        import from Float

        NNI==> NonNegativeInteger
        import from OutputPackage
        import from Integer, NonNegativeInteger
        import from UniversalSegment Integer

        blather:Boolean := true

        --% Finding the multiplier
        flabs (f: Float): Float == abs f
        flsqrt(f: Float): Float == sqrt f
        nthroot(f:Float,n:Integer):Float == exp(log f/n::Float)

        bfloor(f: Float): Integer == wholePart floor f

        lcmLimit(n: Integer):Integer ==
            lcmLimit nthroot(n::Float, 3)
        lcmLimit(divisorBound: Float):Integer ==
            y := solveBound divisorBound
            lcmLim := bfloor exp(log divisorBound/y)
            if blather then
                output("The divisor bound is", divisorBound::Ex)
                output("The lcm Limit is", lcmLim::Ex)
            lcmLim

        -- Solve the bound equation using a Newton iteration.
        --
        -- f = y**2 - log(B)/log(y+1)
        --
        -- f/f' = fdf =
        --    2                 2
        --   y (y + 1)log(y + 1)  - (y + 1)log(y + 1) logB
        --   ---------------------------------------------
        --                                 2
        --              2y(y + 1)log(y + 1)  + logB
        --
        fdf(y: Float, logB: Float): Float ==
            logy  := log(y + 1)
            ylogy := (y + 1)*logy
            ylogy2:= y*logy*ylogy
            (y*ylogy2 - logB*ylogy)/((2@Integer)*ylogy2 + logB)
        solveBound(divisorBound:Float):Float ==
            -- solve               y**2 = log(B)/log(y + 1)
            -- although it may be  y**2 = log(B)/(log(y)+1)
            relerr := (10::Float)**(-5)
            logB := log divisorBound
            y0   := flsqrt log10 divisorBound
            y1   := y0 - fdf(y0, logB)
            while flabs((y1 - y0)/y0) > relerr repeat
                y0 := y1
                y1 := y0 - fdf(y0, logB)
            y1

        -- maxpin(p, n, logn) is max d s.t. p**d <= n
        maxpin(p:Integer,n:Integer,logn:Float): NonNegativeInteger ==
            d: Integer := bfloor(logn/log(p::Float))
            if d < 0 then d := 0
            d::NonNegativeInteger

        multiple?(i: Integer, plist: List Integer): Boolean ==
            for p in plist repeat if i rem p = 0 then return true
            false

        primesTo(n:Integer):List Integer ==
            n < 2 => []
            n = 2 => [2]
            plist := [3, 2]
            i:Integer := 5
            while i <= n repeat
                if not multiple?(i, plist) then plist := cons(i, plist)
                i := i + 2
                if not multiple?(i, plist) then plist := cons(i, plist)
                i := i + 4
            plist
        lcmTo(n:Integer):Integer ==
            plist := primesTo n
            m: Integer := 1
            logn := log(n::Float)
            for p in plist repeat m := m * p**maxpin(p,n,logn)
            if blather then
                output("The lcm of 1..", n::Ex)
                output("            is", m::Ex)
            m
        LenstraEllipticMethod(n: Integer):Integer ==
            LenstraEllipticMethod(n, flsqrt(n::Float))
        LenstraEllipticMethod(n: Integer, divisorBound: Float):Integer ==
            lcmLim0 := lcmLimit divisorBound
            multer0 := lcmTo lcmLim0
            LenstraEllipticMethod(n, lcmLim0, multer0)
        InnerLenstraEllipticMethod(n:Integer, multer:Integer,
                             X0:Integer, Y0:Integer, Z0:Integer):Integer ==
            import from EllipticCurveRationalPoints(X0,Y0,Z0,n)
            import from Record(x: Integer, y: Integer, z: Integer)
            p  := p0
            pn := multer * p
            Zn := HessianCoordinates.pn.z
            gcd(n, Zn)

        LenstraEllipticMethod(n: Integer, multer: Integer):Integer ==
            X0:Integer := random()
            Y0:Integer := random()
            Z0:Integer := random()
            InnerLenstraEllipticMethod(n, multer, X0, Y0, Z0)

        LenstraEllipticMethod(n:Integer, lcmLim0:Integer, multer0:Integer):Integer ==
            nfact: Integer := 1
            for i:Integer in 1.. while nfact = 1 repeat
                output("Trying elliptic curve number", i::Ex)
                X0:Integer := random()
                Y0:Integer := random()
                Z0:Integer := random()
                nfact := InnerLenstraEllipticMethod(n, multer0, X0, Y0, Z0)
                if nfact = n then
                    lcmLim := lcmLim0
                    while nfact = n repeat
                        output("Too many iterations... backing off")
                        lcmLim := bfloor(lcmLim * 0.6)
                        multer := lcmTo lcmLim
                        nfact := InnerLenstraEllipticMethod(n, multer0, X0, Y0, Z0)
            nfact




_______________________________________________
Aldor-l mailing list
Aldor-l@...
http://aldor.org/mailman/listinfo/aldor-l_aldor.org

Re: [Axiom-developer] aldor/axiom interoperability

by Bill Page-7 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 3/13/08, Gregory Vanuxem <g.vanuxem@...> wrote:
> Dear Peter, *
>
>  I was waiting for your small Aldor patch and never see it. Did you send
>  it somewhere ?

From: Martin Rubey <martin.rubey@...>
Date: 17 Jan 2008 09:21:22 +0100
Message-ID: <9qodbk981p.fsf@...>
Sender: fricas-devel@...
List-Unsubscribe: <http://googlegroups.com/group/fricas-devel/subscribe>,
        <mailto:fricas-devel-unsubscribe@...>


Dear Franz,

MANY MANY thanks for your instructions!  They just worked! (except that I don't
have lndir, but I did for f in ../../src/algebra/*; do ln -s $f; done; instead)

They should definitively replace the old instructions on the wiki. In fact, I
think that both src_aldor2.tgz and your script should go into the fricas
contrib directory, say, contrib/aldor.  Maybe you could polish your script so
that it doesn't use lndir, detects ARCH automatically and does not depend on
the fricas source directory any longer.

ARCH is detected also in contrib/debian/mk_deb, you could steal it from there

The fricas source directory is used only to get axiom.sty, I think?  Maybe you
could just pack it into contrib too?

lehner@... writes:

> Bill Page wrote:
> > After a little more fighting with the src_aldor2.tgz makefile, I have
> > finally managed to build the Aldor interface in FriCAS. As Peter said,
> > a patch to Axiom's 'hashType' was necessary to make this work.

> Is this patch publicly available anywhere?

Here it is:

Index: src/interp/hashcode.boot
===================================================================
--- src/interp/hashcode.boot (Revision 183)
+++ src/interp/hashcode.boot (Arbeitskopie)
@@ -55,7 +55,7 @@
                         hash := hashCombine(hashType(arg, percentHash), hash)
                 retCode := hashType(retType, percentHash)
                 EQL(retCode, $VoidHash) => hash
-                hashCombine(retCode, hash)
+                hashCombine(retCode, hashCombine(32236, hash))
         op = 'Enumeration =>
                 for arg in args repeat
                         hash := hashCombine(hashString(STRING arg), hash)

Don't ask me what it does, however :-)



Many thanks again,


Martin


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "FriCAS - computer algebra system" group.
To post to this group, send email to fricas-devel@...
To unsubscribe from this group, send email to
fricas-devel-unsubscribe@...
For more options, visit this group at
http://groups.google.com/group/fricas-devel?hl=en
-~----------~----~----~----~------~----~------~--~---

_______________________________________________
Aldor-l mailing list
Aldor-l@...
http://aldor.org/mailman/listinfo/aldor-l_aldor.org

Re: [Axiom-developer] aldor/axiom interoperability

by Martin Rubey :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dear all,

unfortunately, I'm also having (severe) problems.

My setup is as follows:

fricas rev 258

rubey@aquin:/local/scratch/fricas$ svn diff
Index: src/interp/hashcode.boot
===================================================================
--- src/interp/hashcode.boot    (Revision 258)
+++ src/interp/hashcode.boot    (Arbeitskopie)
@@ -55,7 +55,7 @@
                         hash := hashCombine(hashType(arg, percentHash), hash)
                 retCode := hashType(retType, percentHash)
                 EQL(retCode, $VoidHash) => hash
-                hashCombine(retCode, hash)
+                hashCombine(retCode, hashCombine(32236, hash))
         op = 'Enumeration =>
                 for arg in args repeat
                         hash := hashCombine(hashString(STRING arg), hash)

-------------------------------------------------------------------------------

rubey@aquin:/local/scratch/fricas/contrib$ aldor -gloop
     AA  L      DDDD      OOO    RRRR
    A A  L      D   D    O   O   R   R
   A  A  L      D    D  O     O  R   R
  AAAAA  L      D    D  O     O  RRRR
 A    A  L      D   D    O   O   R  R
A     A  LLLLL  DDDD      OOO    R   R

(c) Numerical Algorithms Group Ltd 1995-2001
Release: Aldor(C) version 1.0.3 for LINUX(glibc2.3)
Type "#int help" for more details.

-------------------------------------------------------------------------------

I compiled FriCAS with gcl, then I followed the instructions given by Franz,
i.e., using the old makefiles from Peter.(!!!!)

But it doesn't seem to work:

--fact.as----------------------------------------------------------------------
#include "axiom"

fact(n: PositiveInteger): PositiveInteger == {
    n <= 1 => 1;
    res: PositiveInteger := 1;
    while n > 1 repeat {
        res := res * n;
        n := n-1;
    }
    res
 }
--fact.as----------------------------------------------------------------------



(1) -> )co fact.as
   Compiling FriCAS source code from file
      /users/rubey/martin/Axiom/fact.as using AXIOM-XL compiler and
      options
-O -Fasy -Fao -Flsp -laxiom -Mno-AXL_W_WillObsolete -DAxiom -Y $AXIOM/algebra
      Use the system command )set compiler args to change these
      options.
#1 (Warning) Deprecated message prefix: use `ALDOR_' instead of `_AXL'
   Compiling Lisp source code from file ./fact.lsp
   Issuing )library command for fact
   Reading /users/rubey/martin/Axiom/fact.asy
(1) -> fact 4
 
   >> System error:
   FUNCALL [or a callee] requires more than one argument.

--acint.as---------------------------------------------------------------------

#include "axiom"

ACInteger: with {
        coerce: Integer -> %;
        foo: % -> Integer;
} == Integer add {
        Rep == Integer; import from Rep;
        foo(x: %): Integer == {
                output((rep x)::OutputForm)$OutputPackage;
                rep x;
        }
        coerce(x: Integer): % == per x;
}
-------------------------------------------------------------------------------

(1) -> )co acint.as
   Compiling FriCAS source code from file
      /users/rubey/aldor-test/acint.as using AXIOM-XL compiler and
      options
-O -Fasy -Fao -Flsp -laxiom -Mno-AXL_W_WillObsolete -DAxiom -Y $AXIOM/algebra
      Use the system command )set compiler args to change these
      options.
#1 (Warning) Deprecated message prefix: use `ALDOR_' instead of `_AXL'
   Compiling Lisp source code from file ./acint.lsp
   Issuing )library command for acint
   Reading /users/rubey/aldor-test/acint.asy
   ACInteger is now explicitly exposed in frame frame0
   ACInteger will be automatically loaded when needed from
      /users/rubey/aldor-test/acint
(1) -> foo(2::ACINT)
   Internal Error
   The function foo with signature hashcode is missing from domain
      UNPRINTABLE

-------------------------------------------------------------------------------

Help would be GREATLY appreciated!  Could it make a difference if I used
src_aldor3.tgz instead?  Would this work with fricas, too?


Finally, I just noticed something very odd:


--fact2.as----------------------------------------------------------------------
#include "axiom"

fact(n: Integer): Integer == {
    n <= 1 => 1;
    res: Integer := 1;
    while n > 1 repeat {
        res := res * n;
        n := n-1;
    }
    res
 }
--fact.as----------------------------------------------------------------------

works well.



Martin


_______________________________________________
Aldor-l mailing list
Aldor-l@...
http://aldor.org/mailman/listinfo/aldor-l_aldor.org

Re: [Axiom-developer] aldor/axiom interoperability

by Bill Page-7 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 3/13/08, Gregory Vanuxem wrote:
> ...The main concern of this mail is if you are able to
> compile ecfact.as (attached) and _execute_ the
> LenstraEllipticMethod(Integer) function. On my system
> it fails, a bug somewhere. Am I alone with this issue ?
>  Martin ? I'm still using the old build process

Greg, you are referring to src_aldor2.tgz that relies on Java, as the
"old build process", right?

> and want to switch to the new one but this stops me.

By you "new one" you mean the new build system recently posted by
Peter in the file "src_aldor3.tgz", right? (This one no longer
requires Java.) So you are saying that you are trying to use the new
build but that there is the regression error that you are now
reporting.

Is it only the build process that has changed? What other things might
be different between the version that you now works and this new one?
Are you using the same version of Axiom? What version of Aldor?

> I  do not want to take your time but maybe you have an idea
> of what's going on with this issue.
>
>  The output is :
>
>  Looking in OutputPackage() for ??349042727  with code 483270060
>  and an error message : "export not found"
>

On show at

http://axiom-wiki.newsynthesis.org/SandBoxEcfact

using the FriCAS version of Axiom with Peter's hashcode patch and the
current open source version of Aldor, I get the following similar (but
different) error:

(1) -> )co ecfact.as
(1) -> LenstraEllipticMethod(99)

Looking in OutputPackage() for ??349042727  with code 483270060
   >> System error:
   FOAM-USER::|fiRaiseException| is invalid as a function.

Regards,
Bill Page.

_______________________________________________
Aldor-l mailing list
Aldor-l@...
http://aldor.org/mailman/listinfo/aldor-l_aldor.org

Re: [Axiom-developer] aldor/axiom interoperability

by Bill Page-7 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 3/14/08, Bill Page wrote:
> On 3/13/08, Gregory Vanuxem wrote:
>  > ...
>  >  The output is :
>  >
>  >  Looking in OutputPackage() for ??349042727  with code 483270060
>  >  and an error message : "export not found"
>  >
>
>

As shown at

  http://axiom-wiki.newsynthesis.org/SandBoxEcfact

This problem seems to be related only the use of 'output' from inside
an Aldor function:

-------- file: testoutput.as ------
#include "axiom.as"
#pile
TestOutput: with
        testOutput: (Integer)                   -> Integer
    == add
        import from String
        import from OutputPackage
        testOutput(x:Integer):Integer ==
          output("help!")
          x
---------

(1) -> )co testoutput.as

   Compiling FriCAS source code from file
      /var/zope2/var/LatexWiki/7970768026816943239-25px003.as using
      AXIOM-XL compiler and options
-O -Fasy -Fao -Flsp -laxiom -Mno-AXL_W_WillObsolete -DAxiom -Y $AXIOM/algebra
      Use the system command )set compiler args to change these
      options.
#1 (Warning) Deprecated message prefix: use `ALDOR_' instead of `_AXL'
   Compiling Lisp source code from file
      ./7970768026816943239-25px003.lsp
   Issuing )library command for 7970768026816943239-25px003
   Reading /var/zope2/var/LatexWiki/7970768026816943239-25px003.asy
   TestOutput is now explicitly exposed in frame initial
   TestOutput will be automatically loaded when needed from
      /var/zope2/var/LatexWiki/7970768026816943239-25px003

(1) -> testOutput(1)
Looking in OutputPackage() for ??349042727  with code 320506156
   >> System error:
   FOAM-USER::|fiRaiseException| is invalid as a function.

Regards,
Bill Page.

_______________________________________________
Aldor-l mailing list
Aldor-l@...
http://aldor.org/mailman/listinfo/aldor-l_aldor.org

Re: [Axiom-developer] aldor/axiom interoperability

by Bill Page-7 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Greg,

On 3/14/08, I wrote:

>
> This problem seems to be related only the use of 'output' from inside
>  an Aldor function:
>
>  -------- file: testoutput.as ------
>  #include "axiom.as"
>  #pile
>  TestOutput: with
>         testOutput: (Integer)                   -> Integer
>     == add
>         import from String
>         import from OutputPackage
>         testOutput(x:Integer):Integer ==
>           output("help!")
>           x
>  ---------
>
>  (1) -> )co testoutput.as
> ...
>  (1) -> testOutput(1)
>  Looking in OutputPackage() for ??349042727  with code 320506156
>
>    >> System error:
>    FOAM-USER::|fiRaiseException| is invalid as a function.
>

At the end of the page:

  http://axiom-wiki.newsynthesis.org/SandBoxEcfact

I have included the following simple Aldor functions to replace
Axiom's 'output' operation with a direct call to Lisp format:

-- implement output for Aldor
output(x:String):Void == {
import { FORMAT: (Boolean,String,String) -> Void } from Foreign Lisp;
FORMAT(true,"~a~%",x);
}
output(x:String,y:OutputForm):Void == {
import { FORMAT: (Boolean,String,String,String) -> Void } from Foreign Lisp;
FORMAT(true,"~a ~a~%",x,unparse(convert(y)$InputForm)$InputForm);
}

This allows the LenstraEllipticMethod to produce some useful output.

I hope this helps, but of course I still consider it a bug that it
seems impossible to call Axiom's output operations from within Aldor.

 Regards,
 Bill Page.

_______________________________________________
Aldor-l mailing list
Aldor-l@...
http://aldor.org/mailman/listinfo/aldor-l_aldor.org

Re: [Axiom-developer] aldor/axiom interoperability

by Martin Rubey :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

"Bill Page" <bill.page@...> writes:

> On 3/14/08, Bill Page wrote:
> > On 3/13/08, Gregory Vanuxem wrote:
> >  > ...
> >  >  The output is :
> >  >
> >  >  Looking in OutputPackage() for ??349042727  with code 483270060
> >  >  and an error message : "export not found"
> >  >
> >
> >
>
> As shown at
>
>   http://axiom-wiki.newsynthesis.org/SandBoxEcfact
>
> This problem seems to be related only the use of 'output' from inside
> an Aldor function:

But I used that extensively in axiom-combinat!  How come it is broken now?  And
how come I cannot get any aldor to work together with my fricas currently?  I'm
a little desperate.

Martin


_______________________________________________
Aldor-l mailing list
Aldor-l@...
http://aldor.org/mailman/listinfo/aldor-l_aldor.org

Parent Message unknown Re: [Axiom-developer] aldor/axiom interoperability

by Gregory Vanuxem-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Le vendredi 14 mars 2008 à 08:03 +0000, Peter Broadbery a écrit :

> On Thu, Mar 13, 2008 at 9:21 PM, Gregory Vanuxem <g.vanuxem@...> wrote:
> > Dear Peter, *
> >
> >  I was waiting for your small Aldor patch and never see it. Did you send
> >  it somewhere ? The main concern of this mail is if you are able to
> >  compile ecfact.as (attached) and _execute_ the
> >  LenstraEllipticMethod(Integer) function. On my system it fails, a bug
> >  somewhere. Am I alone with this issue ?  Martin ? I'm still using the
> >  old build process and want to switch to the new one but this stops me. I
> >  do not want to take your time but maybe you have an idea of what's going
> >  on with this issue.
> >
> ....
> apologies for the, um, delay..
> The following patch affects the build of libaxiom.al - if a given file
> compiles, then it will work or fail independently of this (it fixes
> the compilation of FRMOD amongst others).

Ok, it will not fix the bug previously mentioned but will allow to
switch and test the new build procedure, many thanks for your work !!!

> The hashcode fix _should_ help with runtime bugs.  It tracks the
> change to hashcodes marked 1_1_13_18 in gf_add.c
>
> Index: src/sefo.c
> ===================================================================
> --- src/sefo.c (revision 23)
> +++ src/sefo.c (working copy)
> @@ -1361,7 +1361,9 @@
>   Bool eq;
>
>   sstNext("symeEqual", syme1, syme2);
> +
>   eq = symeEqual0(NULL, syme1, syme2);
> +
>   sstDoneSyme(syme1);
>
>   return eq;
> @@ -1847,6 +1849,9 @@
>   if (tfIsDefine(tf1) || tfIsDefine(tf2))
>   return true;
>
> + if (tfIsThird(tf1) || tfIsThird(tf2))
> + return true;
> +
>   if (tfTag(tf1) != tfTag(tf2))
>   return false;
>   if (tfArgc(tf1) != tfArgc(tf2))
>

Applied, thanks. I'll let you know if I encounter any issues during the
switch. Hoping that it will be applied directly to the Aldor svn trunk.

Regards

Greg



_______________________________________________
Aldor-l mailing list
Aldor-l@...
http://aldor.org/mailman/listinfo/aldor-l_aldor.org

Re: [Axiom-developer] aldor/axiom interoperability

by Gregory Vanuxem-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Le vendredi 14 mars 2008 à 23:14 -0400, Bill Page a écrit :

> Greg,
>
> On 3/14/08, I wrote:
> >
> > This problem seems to be related only the use of 'output' from inside
> >  an Aldor function:
> >
> >  -------- file: testoutput.as ------
> >  #include "axiom.as"
> >  #pile
> >  TestOutput: with
> >         testOutput: (Integer)                   -> Integer
> >     == add
> >         import from String
> >         import from OutputPackage
> >         testOutput(x:Integer):Integer ==
> >           output("help!")
> >           x
> >  ---------
> >
> >  (1) -> )co testoutput.as
> > ...
> >  (1) -> testOutput(1)
> >  Looking in OutputPackage() for ??349042727  with code 320506156
> >
> >    >> System error:
> >    FOAM-USER::|fiRaiseException| is invalid as a function.
> >
>
> At the end of the page:
>
>   http://axiom-wiki.newsynthesis.org/SandBoxEcfact
>
> I have included the following simple Aldor functions to replace
> Axiom's 'output' operation with a direct call to Lisp format:
>
> -- implement output for Aldor
> output(x:String):Void == {
> import { FORMAT: (Boolean,String,String) -> Void } from Foreign Lisp;
> FORMAT(true,"~a~%",x);
> }
> output(x:String,y:OutputForm):Void == {
> import { FORMAT: (Boolean,String,String,String) -> Void } from Foreign Lisp;
> FORMAT(true,"~a ~a~%",x,unparse(convert(y)$InputForm)$InputForm);
> }
>
> This allows the LenstraEllipticMethod to produce some useful output.
>
> I hope this helps, but of course I still consider it a bug that it
> seems impossible to call Axiom's output operations from within Aldor.

Many thanks for tracking this down, that works for me using this
workaround. We know where to investigate now :-) The mail of Martin that
you posted on this mailing list contained the patch that I mentioned
previously.

I'll try the new build process of Peter and hopefully produce a patch
for other Axiom flavours.

Regards

Greg



_______________________________________________
Aldor-l mailing list
Aldor-l@...
http://aldor.org/mailman/listinfo/aldor-l_aldor.org

Re: [Axiom-developer] aldor/axiom interoperability

by Gregory Vanuxem-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Le vendredi 14 mars 2008 à 09:02 +0100, Martin Rubey a écrit :
> Dear all,
>
> unfortunately, I'm also having (severe) problems.
>
> My setup is as follows:
>
> fricas rev 258
>

[...]

> -------------------------------------------------------------------------------
>
> I compiled FriCAS with gcl, then I followed the instructions given by Franz,
> i.e., using the old makefiles from Peter.(!!!!)
>
> But it doesn't seem to work:
>
> --fact.as----------------------------------------------------------------------
> #include "axiom"
>
> fact(n: PositiveInteger): PositiveInteger == {
>     n <= 1 => 1;
>     res: PositiveInteger := 1;
>     while n > 1 repeat {
>         res := res * n;
>         n := n-1;
>     }
>     res
>  }
> --fact.as----------------------------------------------------------------------


> (1) -> )co fact.as
>    Compiling FriCAS source code from file
>       /users/rubey/martin/Axiom/fact.as using AXIOM-XL compiler and
>       options
> -O -Fasy -Fao -Flsp -laxiom -Mno-AXL_W_WillObsolete -DAxiom -Y $AXIOM/algebra
>       Use the system command )set compiler args to change these
>       options.
> #1 (Warning) Deprecated message prefix: use `ALDOR_' instead of `_AXL'
>    Compiling Lisp source code from file ./fact.lsp
>    Issuing )library command for fact
>    Reading /users/rubey/martin/Axiom/fact.asy
> (1) -> fact 4
>  
>    >> System error:
>    FUNCALL [or a callee] requires more than one argument.


That is strange I can not reproduce it on a mix of
Axiom/FriCAS/OpenAxiom. Something is wrong on your side.


> --acint.as---------------------------------------------------------------------
>
> #include "axiom"
>
> ACInteger: with {
> coerce: Integer -> %;
> foo: % -> Integer;
> } == Integer add {
>         Rep == Integer; import from Rep;
>         foo(x: %): Integer == {
>                 output((rep x)::OutputForm)$OutputPackage;
> rep x;
> }
>         coerce(x: Integer): % == per x;
> }
> -------------------------------------------------------------------------------
>
> (1) -> )co acint.as
>    Compiling FriCAS source code from file
>       /users/rubey/aldor-test/acint.as using AXIOM-XL compiler and
>       options
> -O -Fasy -Fao -Flsp -laxiom -Mno-AXL_W_WillObsolete -DAxiom -Y $AXIOM/algebra
>       Use the system command )set compiler args to change these
>       options.
> #1 (Warning) Deprecated message prefix: use `ALDOR_' instead of `_AXL'
>    Compiling Lisp source code from file ./acint.lsp
>    Issuing )library command for acint
>    Reading /users/rubey/aldor-test/acint.asy
>    ACInteger is now explicitly exposed in frame frame0
>    ACInteger will be automatically loaded when needed from
>       /users/rubey/aldor-test/acint
> (1) -> foo(2::ACINT)
>    Internal Error
>    The function foo with signature hashcode is missing from domain
>       UNPRINTABLE

The output bug tracked down by Bill.

Can not help more :-(

Greg



_______________________________________________
Aldor-l mailing list
Aldor-l@...
http://aldor.org/mailman/listinfo/aldor-l_aldor.org

Re: [Axiom-developer] aldor/axiom interoperability

by Bill Page-7 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 15 Mar 2008 08:22:15 +0100, Martin Rubey wrote:

> "Bill Page"  writes:
>
>  > On 3/14/08, Bill Page wrote:
>  > > On 3/13/08, Gregory Vanuxem wrote:
>  > >  > ...
>  > >  >  The output is :
>  > >  >
>  > >  >  Looking in OutputPackage() for ??349042727  with code 483270060
>  > >  >  and an error message : "export not found"
>  > >  >
>  >
>  > As shown at
>  >
>  >   http://axiom-wiki.newsynthesis.org/SandBoxEcfact
>  >
>  > This problem seems to be related only the use of 'output' from
>  > inside an Aldor function:
>
>
> But I used that extensively in axiom-combinat!  How come it is
> broken now?

Perhaps because Aldor is not integrated with any of the Axiom versions
nor Axiom with any Aldor version... and of course there is no
regression testing. Has anyone been using axiom-combinat? I think it
would be great to have a platform where work will that would be easily
available to others.

Maybe the problem with 'output' is a bug introduced by using FriCAS as
the version of Axiom. But I do not recall specifically if Greg ever
said exactly what version of Axiom he was using.

> And how come I cannot get any aldor to work together with
> my fricas currently?  I'm a little desperate.
>

I don't know. Perhaps you can report what problems you find so that
other people can try to help.

Regards,
Bill Page.

_______________________________________________
Aldor-l mailing list
Aldor-l@...
http://aldor.org/mailman/listinfo/aldor-l_aldor.org

Re: [Axiom-developer] aldor/axiom interoperability

by Martin Rubey :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

"Bill Page" <bill.page@...> writes:

> > And how come I cannot get any aldor to work together with
> > my fricas currently?  I'm a little desperate.
> >
>
> I don't know. Perhaps you can report what problems you find so that
> other people can try to help.

I reported them just a few mails ago:

http://groups.google.at/group/fricas-devel/msg/83992b708f7e549e

I'd be grateful if somebody could post an *exact* setup that works - especially
with friCAS, i.e.:

  FriCAS rev XXX
  Aldor version 1.0.2/1.0.3/1.1.0/rev xxx
  aldor_src2.tgz / aldor_src3.tgz

so I can try to reproduce it on my system, and see what broke it.  I'd prefer
one of the binary release version of Aldor, in fact.

many thanks,

Martin


_______________________________________________
Aldor-l mailing list
Aldor-l@...
http://aldor.org/mailman/listinfo/aldor-l_aldor.org