From martin.rubey at univie.ac.at  Sun Mar  5 08:32:01 2006
From: martin.rubey at univie.ac.at (Martin Rubey)
Date: 05 Mar 2006 14:32:01 +0100
Subject: [Aldor-l] [ANN] Axiom Workshop 2006
Message-ID: <85wtf9yq3y.fsf@localhost.localdomain>

                                    _
                                   (_)
                          __ ___  ___  ___  _ __ ___
                         / _` \ \/ / |/ _ \| '_ ` _ \
                        | (_| |>  <| | (_) | | | | | |
                         \__,_/_/\_\_|\___/|_| |_| |_|
                                    _
                                   (_)

         __          ______  _____  _  __ _____ _    _  ____  _____
         \ \        / / __ \|  __ \| |/ // ____| |  | |/ __ \|  __ \
          \ \  /\  / / |  | | |__) | ' /| (___ | |__| | |  | | |__) |
           \ \/  \/ /| |  | |  _  /|  <  \___ \|  __  | |  | |  ___/
            \  /\  / | |__| | | \ \| . \ ____) | |  | | |__| | |
             \/  \/   \____/|_|  \_\_|\_\_____/|_|  |_|\____/|_|

                            ___   ___   ___    __
                           |__ \ / _ \ / _ \  / /
                              ) | | | | | | |/ /_
                             / /| | | | | | | '_ \
                            / /_| |_| | |_| | (_) |
                           |____|\___/ \___/ \___/



                Domain Specific Packages and their Mathematics


with a special focus on


                             Discrete Mathematics


will take place at the Research Institute for Symbolic Computation

  http://www.risc.uni-linz.ac.at

in Hagenberg, Austria

  http://www.risc.uni-linz.ac.at/about/map

from Thursday, April 27, 10 am, to Saturday, April 29, noon.

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

Axiom is a Computer Algebra System with a long tradition.  It recently became
free software. See http://www.axiom-developer.org for more details


The workshop aims at a cooperation of Axiom developers with developers of
packages written for other Computer Algebra Systems or developers of
stand-alone packages.  Furthermore, the workshop wants to make the potential of
Axiom and Aldor more widely known in order to attract new users and new
developers.


If you would like to attend the workshop, please let us know until Friday,
March 31 at the very latest.


There will be time for a limited number of contributed talks. If you would like
to give a talk, please send us title and a short abstract as soon as possible.


There is no conference fee, but it is expected that participants pay
accommodation and meals themselves.  There is a limited number of rooms
available in Hagenberg for approximately 26 EUR/night.  Contact
axiomize at yahoo.de for details.

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


Apart from a crash-course in Axiom/Aldor, the following talks are planned:


Petr Hiliny:       MACEK - real structural computations with matroids

Martin Rubey:      Guessing formulas for sequences

Carsten Schneider: Sigma - A package for multi-summation

Nicolas M. Thiery: Implementing Algebraic Combinatorics -
                   some experiences with MuPAD-Combinat

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


Organisers: Ralf Hemmecke
            Martin Rubey


Email: axiomize at yahoo.de

Homepage: http://wiki.axiom-developer.org/AxiomWorkShopRISC2006



From ralf at hemmecke.de  Wed Mar 15 05:13:19 2006
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Wed, 15 Mar 2006 11:13:19 +0100
Subject: [Aldor-l] Re: Aldor %% bindings
In-Reply-To: <CAE9B164E720CE4D8727792DF8F28AE345652D@corporateex02.Corporate.drdc-rddc.gc.ca>
References: <CAE9B164E720CE4D8727792DF8F28AE345652D@corporateex02.Corporate.drdc-rddc.gc.ca>
Message-ID: <4417E8BF.8070105@hemmecke.de>

On 03/14/2006 09:56 AM, Page, Bill wrote:
> Ralf, and other Aldor experts;
> 
> Section "7.5 Subtypes" of the Aldor Users Guide says:
> 
>   Note that Aldor is constructed so that a domain is only a
>   member of a named category if it explicitly inherits from
>   the category -- not if it merely exports the same collection
>   of (explicit) declarations\1.

> Footnote \1 says:
> 
>   In the current implementation, each named category C
>   implicitly exports a symbol named \%%" with type C (see
>   Section 8.12), whose presence is tested for in checking
>   category membership.
> 
> Note: 8.12 is a typo. It should say 8.11.
> 
> Section "8.11 With" says::
> 
>   A 'with' expression also defines a constant named "%%" for
>   each category from which the 'with' expression inherits.
>   The type of %% is the inherited category, and the value
>   is the domain viewed as a member of that category...
>   The %% bindings are generally most useful for checking
>   conditions.
> 
> -------
> 
> Can anyone explain the usage of %% and give some examples
> where it is used to "check conditions"?

For example "has" constructs, but I don't know if there is anything else.

#include "aldor"
define CatDummy: Category == PrimitiveType with {foo: () -> ()}

If you compile this with via "aldor -fasy aaa.as" then you get
something like that ...

((|Declare|
     |CatDummy|
     (|Define|
       (|Declare| (|Label| |CatDummy| ()) |Category|)
       (|With|
         |PrimitiveType|
         (|Declare|
           |foo|
           (|Apply| -> (|Comma|) (|Comma|))))))
     ((|catExports|
         (|Declare|
           =
           (|Apply| -> (|Comma| % %) |Boolean|))
         (|Declare|
           ~=
           (|Apply| -> (|Comma| % %) |Boolean|)
           ((|default| . 1))
         (|Declare|
           %%
           |PrimitiveType|)
         (|Declare|
           |foo|
           (|Apply| -> (|Comma|) (|Comma|)))
         (|Declare|
           %%
           |CatDummy|)))))

To make it shorter here, I have removed some
((|symeNameCode| . 243941740) (|symeTypeCode| . 83337439)) stuff.

What you see is that the Category CatDummy, not only exports %% for 
PrimitiveType but also %% for CatDummy.

As I understand this... apart from encoding the category hierarchy in 
that way it also could make the evaluation of "DOM has CatDummy" faster 
since the need only be a lookup whether there is some %% for CatDummy. 
No check for all the corresponding exported functions is necessary. (Am 
I wrong?)

> What does it mean to be a "domain viewed as a member of
> a specific category"?

I have only seen %% in places as above. So I have no idea what that 
could mean. Maybe it is used in conditional exports, I haven't checked that.

> Apparently %% can have multiple bindings. About the
> example in section 8.11 we read that:
> 
>   In the example, %% bindings are in scope for the
>   following categories:
>   BinaryAggregate, BooleanArithmeticType,
>   BoundedFiniteLinearStructureType Boolean,
>   BoundedFiniteDataStructureType Boolean,
>   FiniteLinearStructureType Boolean, PrimitiveType,
>   and so on.
> 
> How can I access the value (associated domain?) of a
> particular binding?
> 
> Any hints about how to understand this would be greatly
> appreciated.

Maybe Stephen Watt or Peter Broadbery could help.

Ralf


From wn at cs.bath.ac.uk  Thu Mar 23 07:13:34 2006
From: wn at cs.bath.ac.uk (W Naylor)
Date: Thu, 23 Mar 2006 12:13:34 +0000 (GMT)
Subject: [Aldor-l] Problem with extending SparseUnivariatePolynomial0
Message-ID: <Pine.LNX.4.61.0603231155000.18914@ralph.cs.bath.ac.uk>

Hi,

I find that I have problems with extending the domains 
SparseUnivariatePolynomial0 and UnivariateMonomial.
If I compile a file tst.as containing:

--------------------------------------
#include "algebra"

extend SparseUnivariatePolynomial0(R:Join(ArithmeticType, ExpressionType),
        var:Symbol == new()):with {
  foo : String -> String
} == add {
  foo(s:String):String == s
}
---------------------------------------

with: 

aldor -Fo -Fao tst.as

(the function foo is just dummy, in fact I get the same behaviour if I 
leave it out -- effectively doing a null extension!)

now I try to create a SparseUnivariatePolynomial0 object, first compile 
the file use.as:

--------------------------------------
#include "algebra"
#include "aldorio"
#library SUP "tst.ao"
import from SUP;
import from Symbol,Integer;
macro x== -"x";
import from SparseUnivariatePolynomial0(Integer,x);
stdout<<" blah"<<newline;
monomial 2
--------------------------------------

with:

aldor -Fao -Fo use.as
aldor -Fx -lalgebra -laldor use.o tst.o

now I go:

>./use
> blah
>Segmentation fault

can any-one explain what is happening?

cheers,

Bill


-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
-
-                  Dr. W.A. Naylor
-
-                  http://www.cs.bath.ac.uk/~wn
-                  http://orcca.on.ca/~bill
-
-                  work tel: +44 1225 386183
-
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*



From ralf at hemmecke.de  Thu Mar 23 08:30:57 2006
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Thu, 23 Mar 2006 14:30:57 +0100
Subject: [Aldor-l] Problem with extending SparseUnivariatePolynomial0
In-Reply-To: <Pine.LNX.4.61.0603231155000.18914@ralph.cs.bath.ac.uk>
References: <Pine.LNX.4.61.0603231155000.18914@ralph.cs.bath.ac.uk>
Message-ID: <4422A311.7010100@hemmecke.de>

Hmm, the only difference is in the arguments. In the ALGEBRA sources it 
is "avar" instead of "var". But a modification does not help.

I've also tried with "-q1 -DDEBUG -lalgebrad -laldord", because 
sometimes this works while the usual compile fails (compiler bug).

Your case is even worse. I cannot find an error in your source so it 
looks like a compiler bug to me. Please report it at aldor.org.

Ralf

On 03/23/2006 01:13 PM, W Naylor wrote:
> Hi,
> 
> I find that I have problems with extending the domains 
> SparseUnivariatePolynomial0 and UnivariateMonomial.
> If I compile a file tst.as containing:
> 
> --------------------------------------
> #include "algebra"
> 
> extend SparseUnivariatePolynomial0(R:Join(ArithmeticType, ExpressionType),
>         var:Symbol == new()):with {
>   foo : String -> String
> } == add {
>   foo(s:String):String == s
> }


From tmgisi at gmx.at  Fri Mar 24 03:08:55 2006
From: tmgisi at gmx.at (Christian Aistleitner)
Date: Fri, 24 Mar 2006 09:08:55 +0100
Subject: [Aldor-l] Problem with extending SparseUnivariatePolynomial0
In-Reply-To: <Pine.LNX.4.61.0603231155000.18914@ralph.cs.bath.ac.uk>
References: <Pine.LNX.4.61.0603231155000.18914@ralph.cs.bath.ac.uk>
Message-ID: <op.s6wrk5nwu6j4vy@spencer.aistleitner.info>

Hello,

> I find that I have problems with extending the domains
> SparseUnivariatePolynomial0 and UnivariateMonomial.

I tried to play around with your code, and the segfault comes from the line

l0->X20_dom = fiCCall2(FiWord, l0-> X5_SparseUnivariatePolynomial0,  
l0->X4_AldorInteger, T6);

in the C code (of course the number of the X's an T's may be different at  
your place). None of

l0
l0-> X5_SparseUnivariatePolynomial0
l0->X4_AldorInteger
T6

is NULL. But this observation probably helps you just as much as it help  
me ... namely not at all. However, it might be usefull for the people  
debugging the compiler (if there is anybody doing this).

Nevertheless, I have some more usefull comment to make as well:
If you put your code into one file, everything compiles ond works properly.
I do not know, if this is possible for you or not ... but this may be a  
workaround.

Kind regards,
Christian


From ralf at hemmecke.de  Fri Mar 24 05:17:39 2006
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Fri, 24 Mar 2006 11:17:39 +0100
Subject: [Aldor-l] Problem with extending SparseUnivariatePolynomial0
In-Reply-To: <op.s6wrk5nwu6j4vy@spencer.aistleitner.info>
References: <Pine.LNX.4.61.0603231155000.18914@ralph.cs.bath.ac.uk> <op.s6wrk5nwu6j4vy@spencer.aistleitner.info>
Message-ID: <4423C743.9080203@hemmecke.de>

Hello,

On 03/24/2006 09:08 AM, Christian Aistleitner wrote:
> Nevertheless, I have some more usefull comment to make as well:
> If you put your code into one file, everything compiles ond works properly.
> I do not know, if this is possible for you or not ... but this may be a 
> workaround.

I could not believe what Christian was writing, but it is true also on 
my machine the following happens with the files below...

aldor -lalgebra -laldor -fx -DONE use.as
use
blah
x^2
foo('bar') = bar
baz

aldor -fo -fao tst.as
aldor -lalgebra -laldor -fx use.as tst.o
use
blah
Segmentation fault

The strange thing is that I was once told that the use of an "extend"ed 
domain has to be in another file.

Ralf

--tst.as
#include "algebra"
extend SparseUnivariatePolynomial0(R:Join(ArithmeticType, ExpressionType),
     avar:Symbol == new()):with {
	foo : String -> String
} == add {
	foo(s:String):String == s
}
--end tst.as

--use.as
#if ONE
#include "tst.as"
#else
#include "algebra"
#library SUP "tst.ao"
import from SUP;
#endif

#include "aldorio"
main(): () == {
	import from Symbol, Integer;
	import from SparseUnivariatePolynomial0(Integer, -"x");
	stdout << "blah" << newline;
	stdout << monomial 2 << newline;
	stdout << "foo('bar') = " << foo("bar") << newline;
	stdout << "baz" << newline;
}
main();
--end use.as



From wn at cs.bath.ac.uk  Thu Mar 30 11:33:21 2006
From: wn at cs.bath.ac.uk (W Naylor)
Date: Thu, 30 Mar 2006 17:33:21 +0100 (BST)
Subject: [Aldor-l] Exceptions in aldor
Message-ID: <Pine.LNX.4.61.0603301726430.22756@ralph.cs.bath.ac.uk>

Hi,

I'm trying to do some expception handling in my aldor code. I find that 
the documentation on aldor exceptions is pretty limited. All I can find 
about this is chapter 11 in the aldor user guide. Which is fine for 
telling you how to catch throw and create them, however it would be nice 
to find a list of the ones that already exist in the library. 
The very well documented libalgebra just adds ReducibleModulusExtension, I 
wondered if any one knows of any documentation for the libaldor ones?

cheers,

Bill

-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
-
-                  Dr. W.A. Naylor
-
-                  http://www.cs.bath.ac.uk/~wn
-                  http://orcca.on.ca/~bill
-
-                  work tel: +44 1225 386183
-
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*



From ralf at hemmecke.de  Thu Mar 30 12:40:56 2006
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Thu, 30 Mar 2006 19:40:56 +0200
Subject: [Aldor-l] Exceptions in aldor
In-Reply-To: <Pine.LNX.4.61.0603301726430.22756@ralph.cs.bath.ac.uk>
References: <Pine.LNX.4.61.0603301726430.22756@ralph.cs.bath.ac.uk>
Message-ID: <442C1828.1000008@hemmecke.de>

Since you have Aldor, you have the libaldor sources. You simply grep for 
"Exception" and you find the following:

cd src
grep -R -l Exception

arith/sal_complex.as
arith/sal_fltcat.as
arith/sal_itools.as
arith/sal_pointer.as
arith/sal_segment.as
base/sal_gener.as
base/sal_partial.as
base/sal_syntax.as
datastruc/sal_array.as
datastruc/sal_ckarray.as
datastruc/sal_cklist.as
datastruc/sal_ckmembk.as
datastruc/sal_hash.as
datastruc/sal_list.as
datastruc/sal_parray.as
datastruc/sal_pkarray.as
datastruc/sal_set.as
datastruc/sal_table.as
gmp/sal_fltgmp.as
util/rtexns.as
util/sal_file.as

There are

SyntaxException
GeneratorException
ArrayException
ListException
TableException
FileException

Look at the Libaldor Documentation

http://www-sop.inria.fr/cafe/Manuel.Bronstein/libaldor/html/node13.html

Whould that be enough?

Ralf


On 03/30/2006 06:33 PM, W Naylor wrote:
> Hi,
> 
> I'm trying to do some expception handling in my aldor code. I find that 
> the documentation on aldor exceptions is pretty limited. All I can find 
> about this is chapter 11 in the aldor user guide. Which is fine for 
> telling you how to catch throw and create them, however it would be nice 
> to find a list of the ones that already exist in the library. 
> The very well documented libalgebra just adds ReducibleModulusExtension, I 
> wondered if any one knows of any documentation for the libaldor ones?


From tmgisi at gmx.at  Fri Mar 31 00:37:04 2006
From: tmgisi at gmx.at (Christian Aistleitner)
Date: Fri, 31 Mar 2006 07:37:04 +0200
Subject: [Aldor-l] Exceptions in aldor
In-Reply-To: <442C1828.1000008@hemmecke.de>
References: <Pine.LNX.4.61.0603301726430.22756@ralph.cs.bath.ac.uk> <442C1828.1000008@hemmecke.de>
Message-ID: <op.s69i72tau6j4vy@spencer.aistleitner.info>

Hello,

> Since you have Aldor, you have the libaldor sources. You simply grep for  
> "Exception" and you find the following:

if every exception contains "Exception" in its name, this approach should  
be fair enough.
However, this need not be the case.
There is for example the exception RuntimeError :)
RuntimeError is actually thrown, so I consider it an exception.
It is however of type RuntimeException (sadly enough a category of the  
aldor library NOT ending in Type), so even the grepping for Exception  
would give some hint to it.


> There are
>
> SyntaxException
> GeneratorException
> ArrayException
> ListException
> TableException
> FileException

and
RuntimeError(...);

Kind regards,
Christian


From ralf at hemmecke.de  Fri Mar 31 05:02:57 2006
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Fri, 31 Mar 2006 12:02:57 +0200
Subject: [Aldor-l] Exceptions in aldor
In-Reply-To: <op.s69i72tau6j4vy@spencer.aistleitner.info>
References: <Pine.LNX.4.61.0603301726430.22756@ralph.cs.bath.ac.uk> <442C1828.1000008@hemmecke.de> <op.s69i72tau6j4vy@spencer.aistleitner.info>
Message-ID: <442CFE51.6050000@hemmecke.de>

On 03/31/2006 07:37 AM, Christian Aistleitner wrote:
> Hello,
> 
>> Since you have Aldor, you have the libaldor sources. You simply grep 
>> for "Exception" and you find the following:
> 
> if every exception contains "Exception" in its name, this approach 
> should be fair enough.
> However, this need not be the case.
> There is for example the exception RuntimeError :)
> RuntimeError is actually thrown, so I consider it an exception.
> It is however of type RuntimeException (sadly enough a category of the 
> aldor library NOT ending in Type), so even the grepping for Exception 
> would give some hint to it.


Yes, Christian is right. But on the other hand RuntimeError only appears 
in /src/util/rtexns.as and additionally, it doesn't look like it should 
be called from Aldor code (though it could).

-- s is a C-string, which is not the same as a salli debug String
RuntimeError(s: Pointer): RuntimeException == add {
	name(): String == string s;
	printError(o: TextWriter): () == { import from String; o << name(); }
}

One cannot simply say

   throw RuntimeError("Message");

but has to say more unnaturally...

   throw RuntimeError pointer "Message";

I don't think that RuntimeError should be used.

Anyway, there is some work to be done to somehow bring some order in all 
the exception stuff. For example there is no common ExceptionType that 
all other exceptions inherit from.

Ralf


From wn at cs.bath.ac.uk  Fri Mar 31 05:49:00 2006
From: wn at cs.bath.ac.uk (W Naylor)
Date: Fri, 31 Mar 2006 11:49:00 +0100 (BST)
Subject: [Aldor-l] Exceptions in aldor
In-Reply-To: <442CFE51.6050000@hemmecke.de>
References: <Pine.LNX.4.61.0603301726430.22756@ralph.cs.bath.ac.uk>
 <442C1828.1000008@hemmecke.de> <op.s69i72tau6j4vy@spencer.aistleitner.info>
 <442CFE51.6050000@hemmecke.de>
Message-ID: <Pine.LNX.4.61.0603311132130.22756@ralph.cs.bath.ac.uk>

> 
> One cannot simply say
> 
>   throw RuntimeError("Message");
> 
> but has to say more unnaturally...
> 
>   throw RuntimeError pointer "Message";
> 
> I don't think that RuntimeError should be used.
> 
> Anyway, there is some work to be done to somehow bring some order in all the
> exception stuff. For example there is no common ExceptionType that all other
> exceptions inherit from.
> 
> Ralf

In particular, I notice the last example in chapter 11 of the aldor user 
guide defines a couple of Categorys extending 'Exception'. As far as I can 
make out the Category Exception does not exist

Bill

-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
-
-                  Dr. W.A. Naylor
-
-                  http://www.cs.bath.ac.uk/~wn
-                  http://orcca.on.ca/~bill
-
-                  work tel: +44 1225 386183
-
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*



From ralf at hemmecke.de  Fri Mar 31 06:10:33 2006
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Fri, 31 Mar 2006 13:10:33 +0200
Subject: [Aldor-l] Exceptions in aldor
In-Reply-To: <Pine.LNX.4.61.0603311132130.22756@ralph.cs.bath.ac.uk>
References: <Pine.LNX.4.61.0603301726430.22756@ralph.cs.bath.ac.uk> <442C1828.1000008@hemmecke.de> <op.s69i72tau6j4vy@spencer.aistleitner.info> <442CFE51.6050000@hemmecke.de> <Pine.LNX.4.61.0603311132130.22756@ralph.cs.bath.ac.uk>
Message-ID: <442D0E29.9090107@hemmecke.de>

On 03/31/2006 12:49 PM, W Naylor wrote:
> In particular, I notice the last example in chapter 11 of the aldor user 
> guide defines a couple of Categorys extending 'Exception'. As far as I can 
> make out the Category Exception does not exist

That is right. All the Exceptions in libaldor are just of type
Category if they end in "ExceptionType" (some kind of convention) and 
ordinary domains if you see

   SOMEException: SOMEExceptionType == add {...}

(Of course you can have paremeters and everything.)

So exceptions are domains and their types are categories. There is 
actually no language defined type "Exception".

I haven't tried, but I belief, it would be perfectly possible to say 
something like

try {
    throw Integer;
} catch E in {
   E has Monoid => foo();
}

Maybe one of the Aldor developers could say more.

Ralf


From tmgisi at gmx.at  Fri Mar 31 13:21:17 2006
From: tmgisi at gmx.at (Christian Aistleitner)
Date: Fri, 31 Mar 2006 20:21:17 +0200
Subject: [Aldor-l] Exceptions in aldor
In-Reply-To: <442CFE51.6050000@hemmecke.de>
References: <Pine.LNX.4.61.0603301726430.22756@ralph.cs.bath.ac.uk> <442C1828.1000008@hemmecke.de> <op.s69i72tau6j4vy@spencer.aistleitner.info> <442CFE51.6050000@hemmecke.de>
Message-ID: <op.s7ailrezu6j4vy@spencer.aistleitner.info>

Hello,

> I don't think that RuntimeError should be used.

the whole runtime thing is a bit scary to me anyways, so I guess you are  
right. But I wanted to mention it for the sake of completeness -- and for  
the fact that I stumbled across it while implementing AldorUnit.

> Anyway, there is some work to be done to somehow bring some order in all  
> the exception stuff. For example there is no common ExceptionType that  
> all other exceptions inherit from.

<advertisement product="ExtIO library">
At last! :))
Look at my ExtIO Library.
http://www.risc.uni-linz.ac.at/software/aldor/project.php?id=ExtIO
According to the ChangeLog of ExtIO, ExceptionType exists in ExtIO at  
least since about a year ago. And (you can probably guess it)  
ExceptionType serves excatly the purpose of a common category for  
exceptions. However, extending the categories of LibAldor and LibAlgebra  
to this ExceptionType is rather frustrating, as the extension does not  
work as expected: LibAldor's and LibAlgebra's functions still throw the  
Exception _without_ the extension (Such much for post-facto extensions).
Therefore I did not bother to search for all exceptions in LibAldor and  
LibAlgebra to extend them. It was sufficient for me to use ExceptionType  
for my exceptions.
However, since we now have a (hopefully) complete list of exceptions I  
added the necessary code to extend all exceptions to ExceptionType in  
ExtIO. I will release the new version within the next few days.

But again, be aware, that such an extension does _not_ affect those  
exceptions thrown from LibAldor or LibAlgebra. It only affects those  
exceptions you throw in _your_ code.
So if you throw a SyntaxException in your code, it will have  
ExceptionType. The InputType functions of LibAldor's List will still throw  
SyntaxExceptions _not_ having ExceptionType.
</advertisement>

Kind regards,
Christian


From ralf at hemmecke.de  Fri Mar 31 16:46:00 2006
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Fri, 31 Mar 2006 23:46:00 +0200
Subject: [Aldor-l] Exceptions in aldor
In-Reply-To: <op.s7ailrezu6j4vy@spencer.aistleitner.info>
References: <Pine.LNX.4.61.0603301726430.22756@ralph.cs.bath.ac.uk> <442C1828.1000008@hemmecke.de> <op.s69i72tau6j4vy@spencer.aistleitner.info> <442CFE51.6050000@hemmecke.de> <op.s7ailrezu6j4vy@spencer.aistleitner.info>
Message-ID: <442DA318.1050309@hemmecke.de>

On 03/31/2006 08:21 PM, Christian Aistleitner wrote:

> ExceptionType serves excatly the purpose of a common category for 
> exceptions. However, extending the categories of LibAldor and LibAlgebra 
> to this ExceptionType is rather frustrating, as the extension does not 
> work as expected: LibAldor's and LibAlgebra's functions still throw the 
> Exception _without_ the extension (Such much for post-facto extensions).

Well, I somehow would have expected that. But on the other hand I 
somehow think that this is a bug.

I guess that problem would be the same for any function in library A 
that returns the domain Integer where Integer is extended in another 
library B. Now having two Integer available of different categories 
doesn't sound OK to me.

Christian, could you provide the code that demonstrates that behaviour. 
Maybe you send it to aldor-l and file it as a bug.

Ralf



From martin.rubey at univie.ac.at  Sun Mar  5 08:32:01 2006
From: martin.rubey at univie.ac.at (Martin Rubey)
Date: 05 Mar 2006 14:32:01 +0100
Subject: [Aldor-l] [ANN] Axiom Workshop 2006
Message-ID: <85wtf9yq3y.fsf@localhost.localdomain>

                                    _
                                   (_)
                          __ ___  ___  ___  _ __ ___
                         / _` \ \/ / |/ _ \| '_ ` _ \
                        | (_| |>  <| | (_) | | | | | |
                         \__,_/_/\_\_|\___/|_| |_| |_|
                                    _
                                   (_)

         __          ______  _____  _  __ _____ _    _  ____  _____
         \ \        / / __ \|  __ \| |/ // ____| |  | |/ __ \|  __ \
          \ \  /\  / / |  | | |__) | ' /| (___ | |__| | |  | | |__) |
           \ \/  \/ /| |  | |  _  /|  <  \___ \|  __  | |  | |  ___/
            \  /\  / | |__| | | \ \| . \ ____) | |  | | |__| | |
             \/  \/   \____/|_|  \_\_|\_\_____/|_|  |_|\____/|_|

                            ___   ___   ___    __
                           |__ \ / _ \ / _ \  / /
                              ) | | | | | | |/ /_
                             / /| | | | | | | '_ \
                            / /_| |_| | |_| | (_) |
                           |____|\___/ \___/ \___/



                Domain Specific Packages and their Mathematics


with a special focus on


                             Discrete Mathematics


will take place at the Research Institute for Symbolic Computation

  http://www.risc.uni-linz.ac.at

in Hagenberg, Austria

  http://www.risc.uni-linz.ac.at/about/map

from Thursday, April 27, 10 am, to Saturday, April 29, noon.

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

Axiom is a Computer Algebra System with a long tradition.  It recently became
free software. See http://www.axiom-developer.org for more details


The workshop aims at a cooperation of Axiom developers with developers of
packages written for other Computer Algebra Systems or developers of
stand-alone packages.  Furthermore, the workshop wants to make the potential of
Axiom and Aldor more widely known in order to attract new users and new
developers.


If you would like to attend the workshop, please let us know until Friday,
March 31 at the very latest.


There will be time for a limited number of contributed talks. If you would like
to give a talk, please send us title and a short abstract as soon as possible.


There is no conference fee, but it is expected that participants pay
accommodation and meals themselves.  There is a limited number of rooms
available in Hagenberg for approximately 26 EUR/night.  Contact
axiomize at yahoo.de for details.

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


Apart from a crash-course in Axiom/Aldor, the following talks are planned:


Petr Hiliny:       MACEK - real structural computations with matroids

Martin Rubey:      Guessing formulas for sequences

Carsten Schneider: Sigma - A package for multi-summation

Nicolas M. Thiery: Implementing Algebraic Combinatorics -
                   some experiences with MuPAD-Combinat

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


Organisers: Ralf Hemmecke
            Martin Rubey


Email: axiomize at yahoo.de

Homepage: http://wiki.axiom-developer.org/AxiomWorkShopRISC2006



From ralf at hemmecke.de  Wed Mar 15 05:13:19 2006
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Wed, 15 Mar 2006 11:13:19 +0100
Subject: [Aldor-l] Re: Aldor %% bindings
In-Reply-To: <CAE9B164E720CE4D8727792DF8F28AE345652D@corporateex02.Corporate.drdc-rddc.gc.ca>
References: <CAE9B164E720CE4D8727792DF8F28AE345652D@corporateex02.Corporate.drdc-rddc.gc.ca>
Message-ID: <4417E8BF.8070105@hemmecke.de>

On 03/14/2006 09:56 AM, Page, Bill wrote:
> Ralf, and other Aldor experts;
> 
> Section "7.5 Subtypes" of the Aldor Users Guide says:
> 
>   Note that Aldor is constructed so that a domain is only a
>   member of a named category if it explicitly inherits from
>   the category -- not if it merely exports the same collection
>   of (explicit) declarations\1.

> Footnote \1 says:
> 
>   In the current implementation, each named category C
>   implicitly exports a symbol named \%%" with type C (see
>   Section 8.12), whose presence is tested for in checking
>   category membership.
> 
> Note: 8.12 is a typo. It should say 8.11.
> 
> Section "8.11 With" says::
> 
>   A 'with' expression also defines a constant named "%%" for
>   each category from which the 'with' expression inherits.
>   The type of %% is the inherited category, and the value
>   is the domain viewed as a member of that category...
>   The %% bindings are generally most useful for checking
>   conditions.
> 
> -------
> 
> Can anyone explain the usage of %% and give some examples
> where it is used to "check conditions"?

For example "has" constructs, but I don't know if there is anything else.

#include "aldor"
define CatDummy: Category == PrimitiveType with {foo: () -> ()}

If you compile this with via "aldor -fasy aaa.as" then you get
something like that ...

((|Declare|
     |CatDummy|
     (|Define|
       (|Declare| (|Label| |CatDummy| ()) |Category|)
       (|With|
         |PrimitiveType|
         (|Declare|
           |foo|
           (|Apply| -> (|Comma|) (|Comma|))))))
     ((|catExports|
         (|Declare|
           =
           (|Apply| -> (|Comma| % %) |Boolean|))
         (|Declare|
           ~=
           (|Apply| -> (|Comma| % %) |Boolean|)
           ((|default| . 1))
         (|Declare|
           %%
           |PrimitiveType|)
         (|Declare|
           |foo|
           (|Apply| -> (|Comma|) (|Comma|)))
         (|Declare|
           %%
           |CatDummy|)))))

To make it shorter here, I have removed some
((|symeNameCode| . 243941740) (|symeTypeCode| . 83337439)) stuff.

What you see is that the Category CatDummy, not only exports %% for 
PrimitiveType but also %% for CatDummy.

As I understand this... apart from encoding the category hierarchy in 
that way it also could make the evaluation of "DOM has CatDummy" faster 
since the need only be a lookup whether there is some %% for CatDummy. 
No check for all the corresponding exported functions is necessary. (Am 
I wrong?)

> What does it mean to be a "domain viewed as a member of
> a specific category"?

I have only seen %% in places as above. So I have no idea what that 
could mean. Maybe it is used in conditional exports, I haven't checked that.

> Apparently %% can have multiple bindings. About the
> example in section 8.11 we read that:
> 
>   In the example, %% bindings are in scope for the
>   following categories:
>   BinaryAggregate, BooleanArithmeticType,
>   BoundedFiniteLinearStructureType Boolean,
>   BoundedFiniteDataStructureType Boolean,
>   FiniteLinearStructureType Boolean, PrimitiveType,
>   and so on.
> 
> How can I access the value (associated domain?) of a
> particular binding?
> 
> Any hints about how to understand this would be greatly
> appreciated.

Maybe Stephen Watt or Peter Broadbery could help.

Ralf


From wn at cs.bath.ac.uk  Thu Mar 23 07:13:34 2006
From: wn at cs.bath.ac.uk (W Naylor)
Date: Thu, 23 Mar 2006 12:13:34 +0000 (GMT)
Subject: [Aldor-l] Problem with extending SparseUnivariatePolynomial0
Message-ID: <Pine.LNX.4.61.0603231155000.18914@ralph.cs.bath.ac.uk>

Hi,

I find that I have problems with extending the domains 
SparseUnivariatePolynomial0 and UnivariateMonomial.
If I compile a file tst.as containing:

--------------------------------------
#include "algebra"

extend SparseUnivariatePolynomial0(R:Join(ArithmeticType, ExpressionType),
        var:Symbol == new()):with {
  foo : String -> String
} == add {
  foo(s:String):String == s
}
---------------------------------------

with: 

aldor -Fo -Fao tst.as

(the function foo is just dummy, in fact I get the same behaviour if I 
leave it out -- effectively doing a null extension!)

now I try to create a SparseUnivariatePolynomial0 object, first compile 
the file use.as:

--------------------------------------
#include "algebra"
#include "aldorio"
#library SUP "tst.ao"
import from SUP;
import from Symbol,Integer;
macro x== -"x";
import from SparseUnivariatePolynomial0(Integer,x);
stdout<<" blah"<<newline;
monomial 2
--------------------------------------

with:

aldor -Fao -Fo use.as
aldor -Fx -lalgebra -laldor use.o tst.o

now I go:

>./use
> blah
>Segmentation fault

can any-one explain what is happening?

cheers,

Bill


-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
-
-                  Dr. W.A. Naylor
-
-                  http://www.cs.bath.ac.uk/~wn
-                  http://orcca.on.ca/~bill
-
-                  work tel: +44 1225 386183
-
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*



From ralf at hemmecke.de  Thu Mar 23 08:30:57 2006
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Thu, 23 Mar 2006 14:30:57 +0100
Subject: [Aldor-l] Problem with extending SparseUnivariatePolynomial0
In-Reply-To: <Pine.LNX.4.61.0603231155000.18914@ralph.cs.bath.ac.uk>
References: <Pine.LNX.4.61.0603231155000.18914@ralph.cs.bath.ac.uk>
Message-ID: <4422A311.7010100@hemmecke.de>

Hmm, the only difference is in the arguments. In the ALGEBRA sources it 
is "avar" instead of "var". But a modification does not help.

I've also tried with "-q1 -DDEBUG -lalgebrad -laldord", because 
sometimes this works while the usual compile fails (compiler bug).

Your case is even worse. I cannot find an error in your source so it 
looks like a compiler bug to me. Please report it at aldor.org.

Ralf

On 03/23/2006 01:13 PM, W Naylor wrote:
> Hi,
> 
> I find that I have problems with extending the domains 
> SparseUnivariatePolynomial0 and UnivariateMonomial.
> If I compile a file tst.as containing:
> 
> --------------------------------------
> #include "algebra"
> 
> extend SparseUnivariatePolynomial0(R:Join(ArithmeticType, ExpressionType),
>         var:Symbol == new()):with {
>   foo : String -> String
> } == add {
>   foo(s:String):String == s
> }


From tmgisi at gmx.at  Fri Mar 24 03:08:55 2006
From: tmgisi at gmx.at (Christian Aistleitner)
Date: Fri, 24 Mar 2006 09:08:55 +0100
Subject: [Aldor-l] Problem with extending SparseUnivariatePolynomial0
In-Reply-To: <Pine.LNX.4.61.0603231155000.18914@ralph.cs.bath.ac.uk>
References: <Pine.LNX.4.61.0603231155000.18914@ralph.cs.bath.ac.uk>
Message-ID: <op.s6wrk5nwu6j4vy@spencer.aistleitner.info>

Hello,

> I find that I have problems with extending the domains
> SparseUnivariatePolynomial0 and UnivariateMonomial.

I tried to play around with your code, and the segfault comes from the line

l0->X20_dom = fiCCall2(FiWord, l0-> X5_SparseUnivariatePolynomial0,  
l0->X4_AldorInteger, T6);

in the C code (of course the number of the X's an T's may be different at  
your place). None of

l0
l0-> X5_SparseUnivariatePolynomial0
l0->X4_AldorInteger
T6

is NULL. But this observation probably helps you just as much as it help  
me ... namely not at all. However, it might be usefull for the people  
debugging the compiler (if there is anybody doing this).

Nevertheless, I have some more usefull comment to make as well:
If you put your code into one file, everything compiles ond works properly.
I do not know, if this is possible for you or not ... but this may be a  
workaround.

Kind regards,
Christian


From ralf at hemmecke.de  Fri Mar 24 05:17:39 2006
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Fri, 24 Mar 2006 11:17:39 +0100
Subject: [Aldor-l] Problem with extending SparseUnivariatePolynomial0
In-Reply-To: <op.s6wrk5nwu6j4vy@spencer.aistleitner.info>
References: <Pine.LNX.4.61.0603231155000.18914@ralph.cs.bath.ac.uk> <op.s6wrk5nwu6j4vy@spencer.aistleitner.info>
Message-ID: <4423C743.9080203@hemmecke.de>

Hello,

On 03/24/2006 09:08 AM, Christian Aistleitner wrote:
> Nevertheless, I have some more usefull comment to make as well:
> If you put your code into one file, everything compiles ond works properly.
> I do not know, if this is possible for you or not ... but this may be a 
> workaround.

I could not believe what Christian was writing, but it is true also on 
my machine the following happens with the files below...

aldor -lalgebra -laldor -fx -DONE use.as
use
blah
x^2
foo('bar') = bar
baz

aldor -fo -fao tst.as
aldor -lalgebra -laldor -fx use.as tst.o
use
blah
Segmentation fault

The strange thing is that I was once told that the use of an "extend"ed 
domain has to be in another file.

Ralf

--tst.as
#include "algebra"
extend SparseUnivariatePolynomial0(R:Join(ArithmeticType, ExpressionType),
     avar:Symbol == new()):with {
	foo : String -> String
} == add {
	foo(s:String):String == s
}
--end tst.as

--use.as
#if ONE
#include "tst.as"
#else
#include "algebra"
#library SUP "tst.ao"
import from SUP;
#endif

#include "aldorio"
main(): () == {
	import from Symbol, Integer;
	import from SparseUnivariatePolynomial0(Integer, -"x");
	stdout << "blah" << newline;
	stdout << monomial 2 << newline;
	stdout << "foo('bar') = " << foo("bar") << newline;
	stdout << "baz" << newline;
}
main();
--end use.as



From wn at cs.bath.ac.uk  Thu Mar 30 11:33:21 2006
From: wn at cs.bath.ac.uk (W Naylor)
Date: Thu, 30 Mar 2006 17:33:21 +0100 (BST)
Subject: [Aldor-l] Exceptions in aldor
Message-ID: <Pine.LNX.4.61.0603301726430.22756@ralph.cs.bath.ac.uk>

Hi,

I'm trying to do some expception handling in my aldor code. I find that 
the documentation on aldor exceptions is pretty limited. All I can find 
about this is chapter 11 in the aldor user guide. Which is fine for 
telling you how to catch throw and create them, however it would be nice 
to find a list of the ones that already exist in the library. 
The very well documented libalgebra just adds ReducibleModulusExtension, I 
wondered if any one knows of any documentation for the libaldor ones?

cheers,

Bill

-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
-
-                  Dr. W.A. Naylor
-
-                  http://www.cs.bath.ac.uk/~wn
-                  http://orcca.on.ca/~bill
-
-                  work tel: +44 1225 386183
-
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*



From ralf at hemmecke.de  Thu Mar 30 12:40:56 2006
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Thu, 30 Mar 2006 19:40:56 +0200
Subject: [Aldor-l] Exceptions in aldor
In-Reply-To: <Pine.LNX.4.61.0603301726430.22756@ralph.cs.bath.ac.uk>
References: <Pine.LNX.4.61.0603301726430.22756@ralph.cs.bath.ac.uk>
Message-ID: <442C1828.1000008@hemmecke.de>

Since you have Aldor, you have the libaldor sources. You simply grep for 
"Exception" and you find the following:

cd src
grep -R -l Exception

arith/sal_complex.as
arith/sal_fltcat.as
arith/sal_itools.as
arith/sal_pointer.as
arith/sal_segment.as
base/sal_gener.as
base/sal_partial.as
base/sal_syntax.as
datastruc/sal_array.as
datastruc/sal_ckarray.as
datastruc/sal_cklist.as
datastruc/sal_ckmembk.as
datastruc/sal_hash.as
datastruc/sal_list.as
datastruc/sal_parray.as
datastruc/sal_pkarray.as
datastruc/sal_set.as
datastruc/sal_table.as
gmp/sal_fltgmp.as
util/rtexns.as
util/sal_file.as

There are

SyntaxException
GeneratorException
ArrayException
ListException
TableException
FileException

Look at the Libaldor Documentation

http://www-sop.inria.fr/cafe/Manuel.Bronstein/libaldor/html/node13.html

Whould that be enough?

Ralf


On 03/30/2006 06:33 PM, W Naylor wrote:
> Hi,
> 
> I'm trying to do some expception handling in my aldor code. I find that 
> the documentation on aldor exceptions is pretty limited. All I can find 
> about this is chapter 11 in the aldor user guide. Which is fine for 
> telling you how to catch throw and create them, however it would be nice 
> to find a list of the ones that already exist in the library. 
> The very well documented libalgebra just adds ReducibleModulusExtension, I 
> wondered if any one knows of any documentation for the libaldor ones?


From tmgisi at gmx.at  Fri Mar 31 00:37:04 2006
From: tmgisi at gmx.at (Christian Aistleitner)
Date: Fri, 31 Mar 2006 07:37:04 +0200
Subject: [Aldor-l] Exceptions in aldor
In-Reply-To: <442C1828.1000008@hemmecke.de>
References: <Pine.LNX.4.61.0603301726430.22756@ralph.cs.bath.ac.uk> <442C1828.1000008@hemmecke.de>
Message-ID: <op.s69i72tau6j4vy@spencer.aistleitner.info>

Hello,

> Since you have Aldor, you have the libaldor sources. You simply grep for  
> "Exception" and you find the following:

if every exception contains "Exception" in its name, this approach should  
be fair enough.
However, this need not be the case.
There is for example the exception RuntimeError :)
RuntimeError is actually thrown, so I consider it an exception.
It is however of type RuntimeException (sadly enough a category of the  
aldor library NOT ending in Type), so even the grepping for Exception  
would give some hint to it.


> There are
>
> SyntaxException
> GeneratorException
> ArrayException
> ListException
> TableException
> FileException

and
RuntimeError(...);

Kind regards,
Christian


From ralf at hemmecke.de  Fri Mar 31 05:02:57 2006
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Fri, 31 Mar 2006 12:02:57 +0200
Subject: [Aldor-l] Exceptions in aldor
In-Reply-To: <op.s69i72tau6j4vy@spencer.aistleitner.info>
References: <Pine.LNX.4.61.0603301726430.22756@ralph.cs.bath.ac.uk> <442C1828.1000008@hemmecke.de> <op.s69i72tau6j4vy@spencer.aistleitner.info>
Message-ID: <442CFE51.6050000@hemmecke.de>

On 03/31/2006 07:37 AM, Christian Aistleitner wrote:
> Hello,
> 
>> Since you have Aldor, you have the libaldor sources. You simply grep 
>> for "Exception" and you find the following:
> 
> if every exception contains "Exception" in its name, this approach 
> should be fair enough.
> However, this need not be the case.
> There is for example the exception RuntimeError :)
> RuntimeError is actually thrown, so I consider it an exception.
> It is however of type RuntimeException (sadly enough a category of the 
> aldor library NOT ending in Type), so even the grepping for Exception 
> would give some hint to it.


Yes, Christian is right. But on the other hand RuntimeError only appears 
in /src/util/rtexns.as and additionally, it doesn't look like it should 
be called from Aldor code (though it could).

-- s is a C-string, which is not the same as a salli debug String
RuntimeError(s: Pointer): RuntimeException == add {
	name(): String == string s;
	printError(o: TextWriter): () == { import from String; o << name(); }
}

One cannot simply say

   throw RuntimeError("Message");

but has to say more unnaturally...

   throw RuntimeError pointer "Message";

I don't think that RuntimeError should be used.

Anyway, there is some work to be done to somehow bring some order in all 
the exception stuff. For example there is no common ExceptionType that 
all other exceptions inherit from.

Ralf


From wn at cs.bath.ac.uk  Fri Mar 31 05:49:00 2006
From: wn at cs.bath.ac.uk (W Naylor)
Date: Fri, 31 Mar 2006 11:49:00 +0100 (BST)
Subject: [Aldor-l] Exceptions in aldor
In-Reply-To: <442CFE51.6050000@hemmecke.de>
References: <Pine.LNX.4.61.0603301726430.22756@ralph.cs.bath.ac.uk>
 <442C1828.1000008@hemmecke.de> <op.s69i72tau6j4vy@spencer.aistleitner.info>
 <442CFE51.6050000@hemmecke.de>
Message-ID: <Pine.LNX.4.61.0603311132130.22756@ralph.cs.bath.ac.uk>

> 
> One cannot simply say
> 
>   throw RuntimeError("Message");
> 
> but has to say more unnaturally...
> 
>   throw RuntimeError pointer "Message";
> 
> I don't think that RuntimeError should be used.
> 
> Anyway, there is some work to be done to somehow bring some order in all the
> exception stuff. For example there is no common ExceptionType that all other
> exceptions inherit from.
> 
> Ralf

In particular, I notice the last example in chapter 11 of the aldor user 
guide defines a couple of Categorys extending 'Exception'. As far as I can 
make out the Category Exception does not exist

Bill

-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
-
-                  Dr. W.A. Naylor
-
-                  http://www.cs.bath.ac.uk/~wn
-                  http://orcca.on.ca/~bill
-
-                  work tel: +44 1225 386183
-
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*



From ralf at hemmecke.de  Fri Mar 31 06:10:33 2006
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Fri, 31 Mar 2006 13:10:33 +0200
Subject: [Aldor-l] Exceptions in aldor
In-Reply-To: <Pine.LNX.4.61.0603311132130.22756@ralph.cs.bath.ac.uk>
References: <Pine.LNX.4.61.0603301726430.22756@ralph.cs.bath.ac.uk> <442C1828.1000008@hemmecke.de> <op.s69i72tau6j4vy@spencer.aistleitner.info> <442CFE51.6050000@hemmecke.de> <Pine.LNX.4.61.0603311132130.22756@ralph.cs.bath.ac.uk>
Message-ID: <442D0E29.9090107@hemmecke.de>

On 03/31/2006 12:49 PM, W Naylor wrote:
> In particular, I notice the last example in chapter 11 of the aldor user 
> guide defines a couple of Categorys extending 'Exception'. As far as I can 
> make out the Category Exception does not exist

That is right. All the Exceptions in libaldor are just of type
Category if they end in "ExceptionType" (some kind of convention) and 
ordinary domains if you see

   SOMEException: SOMEExceptionType == add {...}

(Of course you can have paremeters and everything.)

So exceptions are domains and their types are categories. There is 
actually no language defined type "Exception".

I haven't tried, but I belief, it would be perfectly possible to say 
something like

try {
    throw Integer;
} catch E in {
   E has Monoid => foo();
}

Maybe one of the Aldor developers could say more.

Ralf


From tmgisi at gmx.at  Fri Mar 31 13:21:17 2006
From: tmgisi at gmx.at (Christian Aistleitner)
Date: Fri, 31 Mar 2006 20:21:17 +0200
Subject: [Aldor-l] Exceptions in aldor
In-Reply-To: <442CFE51.6050000@hemmecke.de>
References: <Pine.LNX.4.61.0603301726430.22756@ralph.cs.bath.ac.uk> <442C1828.1000008@hemmecke.de> <op.s69i72tau6j4vy@spencer.aistleitner.info> <442CFE51.6050000@hemmecke.de>
Message-ID: <op.s7ailrezu6j4vy@spencer.aistleitner.info>

Hello,

> I don't think that RuntimeError should be used.

the whole runtime thing is a bit scary to me anyways, so I guess you are  
right. But I wanted to mention it for the sake of completeness -- and for  
the fact that I stumbled across it while implementing AldorUnit.

> Anyway, there is some work to be done to somehow bring some order in all  
> the exception stuff. For example there is no common ExceptionType that  
> all other exceptions inherit from.

<advertisement product="ExtIO library">
At last! :))
Look at my ExtIO Library.
http://www.risc.uni-linz.ac.at/software/aldor/project.php?id=ExtIO
According to the ChangeLog of ExtIO, ExceptionType exists in ExtIO at  
least since about a year ago. And (you can probably guess it)  
ExceptionType serves excatly the purpose of a common category for  
exceptions. However, extending the categories of LibAldor and LibAlgebra  
to this ExceptionType is rather frustrating, as the extension does not  
work as expected: LibAldor's and LibAlgebra's functions still throw the  
Exception _without_ the extension (Such much for post-facto extensions).
Therefore I did not bother to search for all exceptions in LibAldor and  
LibAlgebra to extend them. It was sufficient for me to use ExceptionType  
for my exceptions.
However, since we now have a (hopefully) complete list of exceptions I  
added the necessary code to extend all exceptions to ExceptionType in  
ExtIO. I will release the new version within the next few days.

But again, be aware, that such an extension does _not_ affect those  
exceptions thrown from LibAldor or LibAlgebra. It only affects those  
exceptions you throw in _your_ code.
So if you throw a SyntaxException in your code, it will have  
ExceptionType. The InputType functions of LibAldor's List will still throw  
SyntaxExceptions _not_ having ExceptionType.
</advertisement>

Kind regards,
Christian


From ralf at hemmecke.de  Fri Mar 31 16:46:00 2006
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Fri, 31 Mar 2006 23:46:00 +0200
Subject: [Aldor-l] Exceptions in aldor
In-Reply-To: <op.s7ailrezu6j4vy@spencer.aistleitner.info>
References: <Pine.LNX.4.61.0603301726430.22756@ralph.cs.bath.ac.uk> <442C1828.1000008@hemmecke.de> <op.s69i72tau6j4vy@spencer.aistleitner.info> <442CFE51.6050000@hemmecke.de> <op.s7ailrezu6j4vy@spencer.aistleitner.info>
Message-ID: <442DA318.1050309@hemmecke.de>

On 03/31/2006 08:21 PM, Christian Aistleitner wrote:

> ExceptionType serves excatly the purpose of a common category for 
> exceptions. However, extending the categories of LibAldor and LibAlgebra 
> to this ExceptionType is rather frustrating, as the extension does not 
> work as expected: LibAldor's and LibAlgebra's functions still throw the 
> Exception _without_ the extension (Such much for post-facto extensions).

Well, I somehow would have expected that. But on the other hand I 
somehow think that this is a bug.

I guess that problem would be the same for any function in library A 
that returns the domain Integer where Integer is extended in another 
library B. Now having two Integer available of different categories 
doesn't sound OK to me.

Christian, could you provide the code that demonstrates that behaviour. 
Maybe you send it to aldor-l and file it as a bug.

Ralf



