From martin.rubey at univie.ac.at  Thu Oct  4 02:23:51 2007
From: martin.rubey at univie.ac.at (martin.rubey at univie.ac.at)
Date: Thu, 04 Oct 2007 08:23:51 +0200
Subject: [Aldor-l] [Axiom-mail] A combinatorial question
Message-ID: <E1IdK7j-0007P0-Vq@justin.univie.ac.at>

<fbcd16d40710021736o863cb50v4c6e2b09409925ca at mail.gmail.com>
<1d67a53c0710021740y5150fc8n538b6cc75e4a47f7 at mail.gmail.com>
<fbcd16d40710031842t7c2bb11ase97a0527f83d147b at mail.gmail.com> Gcc:
nnml:mail.axiom
From: Martin Rubey <martin.rubey at univie.ac.at>
Date: 04 Oct 2007 08:23:51 +0200
In-Reply-To: <fbcd16d40710031842t7c2bb11ase97a0527f83d147b at mail.gmail.com>
Message-ID: <9qtzp7o0so.fsf at aquin.mat.univie.ac.at>
Lines: 47
User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
--text follows this line--
"Bill Page" <bill.page at newsynthesis.org> writes:

> (1) -> )set message time on
> (1) -> a:=[subSet(25,5,i) for i in 0..binomial(25,5)-1];
> (1) ->
>                                                       Type: List List Integer
>                                      Time: 58.00 (EV) + 6.61 (GC) = 64.61 sec
> 
> This works but obviously it should be possible to write an algorithm that
> performs better than this ... :-( Sage can do it in less than a second (via
> GAP) and apparently Mathematica can do it in about 0.04 seconds!

As I said before (but maybe my message didn't get through), good algorithms are
described in Ruskey (google: "Ruskey, combinatorial generation", goto
RuskeyCombGen.pdf)

If you are indeed interested in such things, PLEASE consider joining the
species project.  Much work has already been done, and since Aldor is semi-free
now, I think it was not a wasted effort.  Note also that the framework provided
by the species project is very general - it becomes very easy to build new
structures from old.

We have some big problems, which we probably should be open about:

* apart from Ralf and myself, we have no users so far.  Well, we didn't
  advertise it either.  This is where you could help.

The other problems have to do with Aldor - Axiom internals.  I'll still mention
them here:

* Axiom does not support Aldor's extend construct.  I.e., one cannot say

  #include "axiom"
  extend Integer: LabelType == add ...

  which makes some ugly - user visible - workarounds necessary.  Enabling that
  would be wonderful.

* Axiom does not support general signatures like

  Combination(k: Integer)(L: LabelType): CombinatorialSpecies(L) with { ... }

  Again, we provide a workaround.  I expect a real fix to be rather hard, here.

Martin





From ralf at hemmecke.de  Fri Oct  5 04:35:49 2007
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Fri, 05 Oct 2007 10:35:49 +0200
Subject: [Aldor-l] cannot access SVN repository
Message-ID: <4705F765.4090005@hemmecke.de>

svn co https://aquarium.aldor.csd.uwo.ca/svn/trunk aldor

is currently not working for me?

could you check

svn co https://aquarium.aldor.csd.uwo.ca/svn/trunk aldor
Error validating server certificate for 
'https://aquarium.aldor.csd.uwo.ca:443':
  - The certificate is not issued by a trusted authority. Use the
    fingerprint to validate the certificate manually!
  - The certificate hostname does not match.
  - The certificate has expired.
Certificate information:
  - Hostname: localhost.localdomain
  - Valid: from Fri, 07 Apr 2006 15:26:33 GMT until Sat, 07 Apr 2007 
15:26:33 GMT
  - Issuer: SomeOrganizationalUnit, SomeOrganization, SomeCity, 
SomeState, --
  - Fingerprint: 13:b7:0c:c5:35:e1:f1:c9:90:e8:b7:0e:b9:3d:ff:65:cb:45:61:03
(R)eject, accept (t)emporarily or accept (p)ermanently? p

No reaction after that.

Ralf



From daly at axiom-developer.org  Fri Oct  5 04:45:39 2007
From: daly at axiom-developer.org (root)
Date: Fri, 5 Oct 2007 04:45:39 -0400
Subject: [Aldor-l] cannot access SVN repository
In-Reply-To: <4705F765.4090005@hemmecke.de> (message from Ralf Hemmecke on
	Fri, 05 Oct 2007 10:35:49 +0200)
References: <4705F765.4090005@hemmecke.de>
Message-ID: <200710050845.l958jda11205@localhost.localdomain>

I get the same non-response when I choose permanent.

Tim


From martin.rubey at univie.ac.at  Sat Oct  6 12:33:57 2007
From: martin.rubey at univie.ac.at (Martin Rubey)
Date: 06 Oct 2007 18:33:57 +0200
Subject: [Aldor-l] [Axiom-mail] A combinatorial question
In-Reply-To: <BAY127-F25BA73617316D6C2E356C796AA0@phx.gbl>
References: <BAY127-F25BA73617316D6C2E356C796AA0@phx.gbl>
Message-ID: <9qhcl4fbii.fsf@aquin.mat.univie.ac.at>

"Peter Broadbery" <p_broadbery at hotmail.com> writes:

> >* Axiom does not support Aldor's extend construct.  I.e., one cannot say
> >
> >  #include "axiom"
> >  extend Integer: LabelType == add ...
> >
> >  which makes some ugly - user visible - workarounds necessary.  Enabling that
> >  would be wonderful.
> 
> Now that the aldor source has turned up (thanks stephen, and apologies for
> missing the august  get together), I'm having another go at getting this going
> (although I have to admit it's not really a primary goal for me)..  I might
> have something together in a few weeks with a following wind.

That would be truly wonderful.  If there is anything we could do to support
you, please don't hesitate to ask.

But now I have to ask: what is the primary goal for you?  :-)

Martin



From martin.rubey at univie.ac.at  Tue Oct  9 04:33:34 2007
From: martin.rubey at univie.ac.at (Martin Rubey)
Date: 09 Oct 2007 10:33:34 +0200
Subject: [Aldor-l] aldor extend, was: A combinatorial question
In-Reply-To: <BAY127-F2722F927D32F472A3AA74696A50@phx.gbl>
References: <BAY127-F2722F927D32F472A3AA74696A50@phx.gbl>
Message-ID: <9q1wc41ych.fsf@aquin.mat.univie.ac.at>

"Peter Broadbery" <p_broadbery at hotmail.com> writes:

> >But now I have to ask: what is the primary goal for you?  :-)
> >
> >Martin
> 
> Getting axiom to play nice with aldor is the starting point, then there's a
> few compiler things that I would like to play with - axiom extend will be
> good to have, but may involve more axiom hacking than I have the patience
> for.
> 
> Having the interop stuff in at least one of the various axioms that are
> floating around is also on the list.

It just occurred to me that there would indeed be a different way to help Ralf
and myself:  a long while ago Waldek mentioned that it might not be too hard to
provide "extend" for SPAD.

This would be slightly different, since the aldor compiler would not even
notice that a domain is extended - i.e., no work on the aldor side.

Of course, libaxiom would then have to be regenerated if I want to use the
extended domain within aldor.

Our combinat distribution would then contain a spad file containing the
necessary extend's.  Since there is currently not much code in the extend's
anyway, that wouldn't matter too much - at least not for me.

What does matter to me however is that I definitively want SPAD to become
Aldor, either by replacement or by improvement.  I have the feeling that having
extend being understood by axiom would be a big step in the right direction.
And it does seem to me that making axiom understand arbitrary signatures as
allowed in aldor is a bit too much to ask for...  It's a shame I have neither
time nor expertise to hack there myself.

Good luck,

Martin



From ralf at hemmecke.de  Sat Oct 20 20:50:04 2007
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Sun, 21 Oct 2007 02:50:04 +0200
Subject: [Aldor-l] The following could be suitable if imported
In-Reply-To: <87abqh7ggg.fsf_-_@atiyah.home>
References: <42529.193.170.37.45.1192607437.squirrel@193.170.37.45>	<4715E53C.2040003@risc.uni-linz.ac.at>
	<87ejftgbsl.fsf_-_@atiyah.home>	<47161F61.2010803@risc.uni-linz.ac.at>
	<87abqh7ggg.fsf_-_@atiyah.home>
Message-ID: <471AA23C.4070705@hemmecke.de>

Hello,
I have already discussed it with Johannes personally, but it seems that 
my answer was only partially correct.
Since that seems to be a more general problem I forward this mail also 
to aldor-l.

Indeed the reference to the AUG page 90 would suggest that the program 
compiles.

And it does indeed compile if the function definition of "test" is 
commented out.

But how can one use foo?

The only way I found was a (seemingly very strange) construction like
Replace

      b : DOM(2,2) == foo(a,a);

by

   if 2=2 then b: DOM(2,2) == foo(a,a);

I've no idea whether the produced code is reasonable, but at least one 
can shut up the compiler.

Ralf

On 10/17/2007 08:18 PM, Johannes Middeke wrote:
> Hello,
> 
> 
> I get just another error message I cannot get rid of. I use the
> following programme which is but a simplified version of my original
> sources.
> 
> File: TMP.as __________________________________________________________________
> #include "aldor"
> #include "aldorio"
> 
> Int ==> MachineInteger;
> 
> DOM(a : Int, b : Int) : with {
>     0 : %;
>     if (a = b) then foo : (%,%) -> %;
> } == add {
>     Rep == Int;
>     0 : % == per 0;
>     if (a = b) then foo(a : %, b : %) : % == 0;
> }
> 
> test () : Int == {
>     import { integer : Literal -> % } from Int;
>     import { foo : (%,%) -> % } from DOM(2,2);
>     local a : DOM(2,2) == 0;
>     local b : DOM(2,2) == foo(a,a);
> }
> _______________________________________________________________________________
> 
> Upon compiling I get the following:
> 
> _______________________________________________________________________________
> $ aldor -Fx -laldor TMP.as
> "TMP.as", line 19:     local b : DOM(2,2) == foo(a,a);
>                    ..........................^
> [L19 C27] #1 (Error) There are no suitable meanings for the operator `foo'.
> The following could be suitable if imported:
>   foo: (DOM(2, 2), DOM(2, 2)) -> DOM(2, 2) from DOM(2, 2), if 2 = 2
> _______________________________________________________________________________
> 
> Searching the web suggested that aldors compiler might not be clever
> enough to notice, that the condition 2 = 2 really is true. But on the
> other hand, the code follows rather closely an example from th euser
> guide (page 90).
> 
> So, is there anything I can do to bring foo into scope? Maybe some
> compiler flag to enable compile time evaluation of conditions?


From martin.rubey at univie.ac.at  Sun Oct 21 02:43:08 2007
From: martin.rubey at univie.ac.at (Martin Rubey)
Date: 21 Oct 2007 08:43:08 +0200
Subject: [Aldor-l] The following could be suitable if imported
In-Reply-To: <471AA23C.4070705@hemmecke.de>
References: <42529.193.170.37.45.1192607437.squirrel@193.170.37.45>
	<4715E53C.2040003@risc.uni-linz.ac.at> <87ejftgbsl.fsf_-_@atiyah.home>
	<47161F61.2010803@risc.uni-linz.ac.at> <87abqh7ggg.fsf_-_@atiyah.home>
	<471AA23C.4070705@hemmecke.de>
Message-ID: <9qlk9x7ytf.fsf@aquin.mat.univie.ac.at>

Ralf Hemmecke <ralf at hemmecke.de> writes:

> The only way I found was a (seemingly very strange) construction like
> Replace
> 
>       b : DOM(2,2) == foo(a,a);
> 
> by
> 
>    if 2=2 then b: DOM(2,2) == foo(a,a);

Isn't that the same workaround Christian AIstleitner suggested for our combinat
troubles?

BugWorkaround(CONDITION)(CODE) == {
        assert(CONDITION);
        if CONDITION then CODE else never;
}


Martin



From ralf at hemmecke.de  Sun Oct 21 15:48:25 2007
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Sun, 21 Oct 2007 21:48:25 +0200
Subject: [Aldor-l] [open-axiom-devel] [fricas-devel] Re: iterators
In-Reply-To: <9qzlyca6yz.fsf@aquin.mat.univie.ac.at>
References: <E1IjR7R-0006NO-00@hera.math.uni.wroc.pl>
	<9qzlyca6yz.fsf@aquin.mat.univie.ac.at>
Message-ID: <471BAD09.2090509@hemmecke.de>

> OK.  I'd still prefer to keep the language simple.  What I would like a lot
> however is something like
> 
> for e in g repeat
>     (a, b) := e
>     ...

Possible in Aldor

> or even
> 
> for (a, b) in g repeat
>     ...
> 
> given that g returns a Cross.

Not possible in Aldor.



Stephen Watt,

is there a particular reason why the latter construction is not allowed 
in the Aldor language (I am not speaking of the compiler)?

Ralf


From watt at scl.csd.uwo.ca  Sun Oct 21 16:28:09 2007
From: watt at scl.csd.uwo.ca (Stephen Watt)
Date: Sun, 21 Oct 2007 16:28:09 -0400
Subject: [Aldor-l] [open-axiom-devel] [fricas-devel] Re: iterators
In-Reply-To: <471BAD09.2090509@hemmecke.de>
References: <E1IjR7R-0006NO-00@hera.math.uni.wroc.pl>
	<9qzlyca6yz.fsf@aquin.mat.univie.ac.at>
	<471BAD09.2090509@hemmecke.de>
Message-ID: <20071021202809.GA23544@ptibonum.scl.csd.uwo.ca>

There is no deep reason why it is not allowed.  
It would be a compatible extension to allow it.  

-- Stephen

On Sun, Oct 21, 2007 at 09:48:25PM +0200, Ralf Hemmecke wrote:
> >OK.  I'd still prefer to keep the language simple.  What I would like a lot
> >however is something like
> >
> >for e in g repeat
> >    (a, b) := e
> >    ...
> 
> Possible in Aldor
> 
> >or even
> >
> >for (a, b) in g repeat
> >    ...
> >
> >given that g returns a Cross.
> 
> Not possible in Aldor.
> 
> 
> 
> Stephen Watt,
> 
> is there a particular reason why the latter construction is not allowed 
> in the Aldor language (I am not speaking of the compiler)?
> 
> Ralf


From ralf at hemmecke.de  Sun Oct 21 16:40:38 2007
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Sun, 21 Oct 2007 22:40:38 +0200
Subject: [Aldor-l] Old reference into the mailing list does not work
Message-ID: <471BB946.9060200@hemmecke.de>

Hello people at aldor.org,

is there a particular reason why an old reference into the mailing list

http://www.aldor.org/pipermail/aldor-l/2007-January/000579.html

does no longer work? Could you make that working again?

Thank you

Ralf


From ralf at hemmecke.de  Sun Oct 21 18:03:40 2007
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Mon, 22 Oct 2007 00:03:40 +0200
Subject: [Aldor-l] The following could be suitable if imported
In-Reply-To: <9qlk9x7ytf.fsf@aquin.mat.univie.ac.at>
References: <42529.193.170.37.45.1192607437.squirrel@193.170.37.45>	<4715E53C.2040003@risc.uni-linz.ac.at>
	<87ejftgbsl.fsf_-_@atiyah.home>	<47161F61.2010803@risc.uni-linz.ac.at>
	<87abqh7ggg.fsf_-_@atiyah.home>	<471AA23C.4070705@hemmecke.de>
	<9qlk9x7ytf.fsf@aquin.mat.univie.ac.at>
Message-ID: <471BCCBC.4090303@hemmecke.de>

Hi Martin,

Yes, actually we use that trick in Aldor-Combinat. How could I forget?

Thanks
Ralf

On 10/21/2007 08:43 AM, Martin Rubey wrote:
> Ralf Hemmecke <ralf at hemmecke.de> writes:
> 
>> The only way I found was a (seemingly very strange) construction like
>> Replace
>>
>>       b : DOM(2,2) == foo(a,a);
>>
>> by
>>
>>    if 2=2 then b: DOM(2,2) == foo(a,a);
> 
> Isn't that the same workaround Christian AIstleitner suggested for our combinat
> troubles?
> 
> BugWorkaround(CONDITION)(CODE) == {
>         assert(CONDITION);
>         if CONDITION then CODE else never;
> }
> 
> 
> Martin


From ralf at hemmecke.de  Wed Oct 24 17:55:28 2007
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Wed, 24 Oct 2007 23:55:28 +0200
Subject: [Aldor-l] [open-axiom-devel] generators
In-Reply-To: <9q7ildkkho.fsf_-_@aquin.mat.univie.ac.at>
References: <E1IjR7R-0006NO-00@hera.math.uni.wroc.pl>	<fbcd16d40710220903j19204785l2072b8f005466281@mail.gmail.com>	<Pine.LNX.4.64.0710221103300.17358@gauss.cs.tamu.edu>	<471D449F.4020305@hemmecke.de>	<fbcd16d40710231700p765b1867h743803ba998f26cb@mail.gmail.com>	<471E8D7E.6070801@hemmecke.de>	<fbcd16d40710231720i5f802f92p5cb8c4373589d057@mail.gmail.com>	<471E957A.1040403@hemmecke.de>	<fbcd16d40710231807w3631fcbeo431f2834e4c8f393@mail.gmail.com>	<471E9EC1.3090707@hemmecke.de>	<fbcd16d40710231856n7f5379f6r52c31da01d1d5c18@mail.gmail.com>
	<9q7ildkkho.fsf_-_@aquin.mat.univie.ac.at>
Message-ID: <471FBF50.9090408@hemmecke.de>

> Just curious: can something of type Generator(Something) ever be a domain?
> (Probably yes...)

 >aldor -fx -laldor aaa.as
 >aaa
MachineInteger
123

---BEGIN aaa.as
#include "aldor"
#include "aldorio"

CAT ==> OutputType with {integer: Literal -> %}
g(): Generator(CAT) == generate {
	yield MachineInteger;
--	yield Integer;
}

foo(D: CAT): () == {
	import from D, TextWriter, String, Character;
	stdout << name(D)$Trace << newline;
	stdout << (123 at D) << newline;
}

for D in g() repeat foo(D);
---END aaa.as

But don't remove the -- before "yield Integer", because then the 
compiler tells you... :-(

"aaa.as", line 5: g(): Generator(CAT) == generate {
                   ................................^
[L5 C33] #1 (Fatal Error) Compiler bug: no exit list for terrorSequence 
(ooops).

Since in Aldor domains are first class, it should be possible to return 
them by a generator. (Compare to lists of domains.)

However, your question asks whether g is a domain if

   g: Generator(Something)

and I would tend to say that this is not a domain. Why? Well, 
"Generator(Something)" should be a category then, right? But if you look 
int sal_gener.as you clearly see that Generator(T) is a domain.

Ralf



From bill.page at newsynthesis.org  Thu Oct 25 20:10:43 2007
From: bill.page at newsynthesis.org (Bill Page)
Date: Thu, 25 Oct 2007 20:10:43 -0400
Subject: [Aldor-l] Type equivalence of domains in Axiom and Aldor
Message-ID: <fbcd16d40710251710v22eb1444w3ff5d8d56a9f6bd2@mail.gmail.com>

Dear Friends of Axiom and Aldor,

As a result of the recent message thread about "iterators and
cartesian product" in the Axiom library I have been thinking again
about type equivalence. For example consider the following domains in
Axiom:

(1) -> P:=Product(Stream Integer,Stream Integer)

   (1)  Product(Stream Integer,Stream Integer)
                                                        Type: Domain
(2) -> Q:=Stream Product(Integer,Integer)

   (2)  Stream Product(Integer,Integer)
                                                       Type: Domain

On reflection (pun intended) it seems that 'Stream' is a "sum-like"
domain constructor so that we might reasonably expect algebraically
that a 'Product' distributes over a 'Stream' and therefore wish to
design the Axiom library so that this is satisfied.

Thus we should have

   P = Q

Side Note: Perhaps with an extension of the domain 'Domain' that Gaby
recently introduced in OpenAxiom it would actually be possible to
write and evaluate this expression in Axiom.

I understand that neither Spad nor Aldor actually evaluate type
expressions like P and Q above so it does not make sense to ask for
"value" equality of these two domains. But perhaps EQUAL in the Lisp
sense (ref: http://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node74.html)
could appliy?

Therefore I would propose the following definition of type-equivalence
of domains:

  Def: Two domains P and Q are equivalent if and only if both domains satisfy
  exactly the same set of categories: (P has x) = (Q has x) for all Category
  expressions x *and* neither P nor Q has any explicit exports that are not
  provided by some named category.

It seems that in principle it should be possible to give an efficient
decision procedure for this test if it is not already implemented
somewhere in the Spad and Aldor compilers. I would like to understand
this better from the point of view of the compiler and iterpreter
design.

Obviously it makes sense to require that two equivalent domains must
provide the same set of exported operations (the same interface)
having the same names and same signatures. But as I understand the
intention of the semantics of categories in both Axiom and Aldor this
is not enough. We want categories to represent abstract concepts
usually with a well-defined mathematical meaning. That is the reason
for explicitly referring to satisfaction of categories in the
definition above. Further since domains can also explicitly include
exported operations in the 'with' clause (i.e. "anonymous categories"
as defined in the Aldor user's guide), if this mathematical meaning is
carried only by the named categories, such anonymous categories must
always be assumed to represent different categories in each domain in
which they occur.

With this definition it is easy to show that the current definitions
of 'Product' and 'Stream' do not satisfy the expected distributive
property. Right now both 'Stream' and 'Product' have explicit exports,
further the actual list of exported operations does not match at all:

(3) -> )sh P
 Product(Stream Integer,Stream Integer) is a domain constructor.
 Abbreviation for Product is PRODUCT
 This constructor is not exposed in this frame.
 Issue )edit /usr/local/lib/axiom/target/i686-suse-linux/../../src/algebra/PRODUCT.spad
to see algebra source code for PRODUCT

------------------------------- Operations --------------------------------

 ?*? : (Integer,%) -> %                ?*? : (PositiveInteger,%) -> %
...

(3) -> )sh Q
 Stream Product(Integer,Integer) is a domain constructor.
 Abbreviation for Stream is STREAM
 This constructor is exposed in this frame.
 Issue )edit /usr/local/lib/axiom/target/i686-suse-linux/../../src/algebra/STREAM.spad
to see algebra source code for STREAM

------------------------------- Operations --------------------------------

 #? : % -> NonNegativeInteger          ?=? : (%,%) -> Boolean
...

As a mininum it would probably be necessary to introduce two new
cateogies: StreamCat(S) and ProductCat(X,Y). Then it would seem that
would be necessary add code along the lines of

   Product(A: SetCategory,B: SetCategory): ProductCat(A,B) with
     if A has StreamCat(S) and B has StreamCat(S) then
        StreamCat(S)

And

  Stream(S:Type): StreamCat(S) with
    if S has ProductCat(A,B) then
       ProductCat(A,B)

for some set of allowed domains A, B and S, including for example
'Integer'. Of course there is a problem here about specifying the
specific list of domains for A, B and C. It would be desirable I
think, if the compiler could produce generic code which would apply
whtn A, B and C are still unknowns. Is this possible?

Of course we also need the implementations of the associate operations.

With these changes we would be able to satisfy the definition of the
type-equivalence of P and Q above.

I would like to know if other developers think this more algebraic
approach to the design of the Axiom library domains makes sense.
Comments and criticisms are invited.

Regards,
Bill Page.


From youssef at bu.edu  Fri Oct 26 00:09:18 2007
From: youssef at bu.edu (Saul Youssef)
Date: Fri, 26 Oct 2007 00:09:18 -0400
Subject: [Aldor-l] Type equivalence of domains in Axiom and Aldor
In-Reply-To: <fbcd16d40710251710v22eb1444w3ff5d8d56a9f6bd2@mail.gmail.com>
References: <fbcd16d40710251710v22eb1444w3ff5d8d56a9f6bd2@mail.gmail.com>
Message-ID: <d7d109480710252109j597f3175pb018befeece3e635@mail.gmail.com>

Hi Bill,

      I unfortunately couldn't make it to the Aldor workshop and I
haven't touched the language in a few years, but I do have a comment.

      Your questions have definite answers in category theory and
since Aldor is *almost* doing category theory, it's tempting to think
that the categorical answers to your questions are really what should
naturally fit into the language.  I wrote up something trying this out
for the 2001 workshop

http://atlas.bu.edu/~youssef/papers/math/aldor/aldor.pdf

I still think that this is a good way to look for flaws in the
language - implement category theory and see what goes wrong.

Best regards,

    Saul Youssef

On 10/25/07, Bill Page <bill.page at newsynthesis.org> wrote:
> Dear Friends of Axiom and Aldor,
>
> As a result of the recent message thread about "iterators and
> cartesian product" in the Axiom library I have been thinking again
> about type equivalence. For example consider the following domains in
> Axiom:
>
> (1) -> P:=Product(Stream Integer,Stream Integer)
>
>    (1)  Product(Stream Integer,Stream Integer)
>                                                         Type: Domain
> (2) -> Q:=Stream Product(Integer,Integer)
>
>    (2)  Stream Product(Integer,Integer)
>                                                        Type: Domain
>
> On reflection (pun intended) it seems that 'Stream' is a "sum-like"
> domain constructor so that we might reasonably expect algebraically
> that a 'Product' distributes over a 'Stream' and therefore wish to
> design the Axiom library so that this is satisfied.
>
> Thus we should have
>
>    P = Q
>
> Side Note: Perhaps with an extension of the domain 'Domain' that Gaby
> recently introduced in OpenAxiom it would actually be possible to
> write and evaluate this expression in Axiom.
>
> I understand that neither Spad nor Aldor actually evaluate type
> expressions like P and Q above so it does not make sense to ask for
> "value" equality of these two domains. But perhaps EQUAL in the Lisp
> sense (ref: http://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node74.html)
> could appliy?
>
> Therefore I would propose the following definition of type-equivalence
> of domains:
>
>   Def: Two domains P and Q are equivalent if and only if both domains satisfy
>   exactly the same set of categories: (P has x) = (Q has x) for all Category
>   expressions x *and* neither P nor Q has any explicit exports that are not
>   provided by some named category.
>
> It seems that in principle it should be possible to give an efficient
> decision procedure for this test if it is not already implemented
> somewhere in the Spad and Aldor compilers. I would like to understand
> this better from the point of view of the compiler and iterpreter
> design.
>
> Obviously it makes sense to require that two equivalent domains must
> provide the same set of exported operations (the same interface)
> having the same names and same signatures. But as I understand the
> intention of the semantics of categories in both Axiom and Aldor this
> is not enough. We want categories to represent abstract concepts
> usually with a well-defined mathematical meaning. That is the reason
> for explicitly referring to satisfaction of categories in the
> definition above. Further since domains can also explicitly include
> exported operations in the 'with' clause (i.e. "anonymous categories"
> as defined in the Aldor user's guide), if this mathematical meaning is
> carried only by the named categories, such anonymous categories must
> always be assumed to represent different categories in each domain in
> which they occur.
>
> With this definition it is easy to show that the current definitions
> of 'Product' and 'Stream' do not satisfy the expected distributive
> property. Right now both 'Stream' and 'Product' have explicit exports,
> further the actual list of exported operations does not match at all:
>
> (3) -> )sh P
>  Product(Stream Integer,Stream Integer) is a domain constructor.
>  Abbreviation for Product is PRODUCT
>  This constructor is not exposed in this frame.
>  Issue )edit /usr/local/lib/axiom/target/i686-suse-linux/../../src/algebra/PRODUCT.spad
> to see algebra source code for PRODUCT
>
> ------------------------------- Operations --------------------------------
>
>  ?*? : (Integer,%) -> %                ?*? : (PositiveInteger,%) -> %
> ...
>
> (3) -> )sh Q
>  Stream Product(Integer,Integer) is a domain constructor.
>  Abbreviation for Stream is STREAM
>  This constructor is exposed in this frame.
>  Issue )edit /usr/local/lib/axiom/target/i686-suse-linux/../../src/algebra/STREAM.spad
> to see algebra source code for STREAM
>
> ------------------------------- Operations --------------------------------
>
>  #? : % -> NonNegativeInteger          ?=? : (%,%) -> Boolean
> ...
>
> As a mininum it would probably be necessary to introduce two new
> cateogies: StreamCat(S) and ProductCat(X,Y). Then it would seem that
> would be necessary add code along the lines of
>
>    Product(A: SetCategory,B: SetCategory): ProductCat(A,B) with
>      if A has StreamCat(S) and B has StreamCat(S) then
>         StreamCat(S)
>
> And
>
>   Stream(S:Type): StreamCat(S) with
>     if S has ProductCat(A,B) then
>        ProductCat(A,B)
>
> for some set of allowed domains A, B and S, including for example
> 'Integer'. Of course there is a problem here about specifying the
> specific list of domains for A, B and C. It would be desirable I
> think, if the compiler could produce generic code which would apply
> whtn A, B and C are still unknowns. Is this possible?
>
> Of course we also need the implementations of the associate operations.
>
> With these changes we would be able to satisfy the definition of the
> type-equivalence of P and Q above.
>
> I would like to know if other developers think this more algebraic
> approach to the design of the Axiom library domains makes sense.
> Comments and criticisms are invited.
>
> Regards,
> Bill Page.
>
> _______________________________________________
> Aldor-l mailing list
> Aldor-l at aldor.org
> http://aldor.org/mailman/listinfo/aldor-l_aldor.org
>
>


From ralf at hemmecke.de  Sat Oct 27 16:53:42 2007
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Sat, 27 Oct 2007 22:53:42 +0200
Subject: [Aldor-l] [Axiom-math] Type equivalence of domains in Axiom and
	Aldor
In-Reply-To: <fbcd16d40710251710v22eb1444w3ff5d8d56a9f6bd2@mail.gmail.com>
References: <fbcd16d40710251710v22eb1444w3ff5d8d56a9f6bd2@mail.gmail.com>
Message-ID: <4723A556.8040502@hemmecke.de>

>   Def: Two domains P and Q are equivalent if and only if both domains satisfy
>   exactly the same set of categories: (P has x) = (Q has x) for all Category
>   expressions x *and* neither P nor Q has any explicit exports that are not
>   provided by some named category.

Let's see...

Cat: Category == with {
   coerce: Integer -> %;
   coerce: % -> Integer;
   bar: (%, %) ->  %;
}
P: Cat == add {
   Rep == Integer; import from Rep
   coerce(x: Integer): % == per x;
   coerce(x: %): Integer == rep x;
   bar(x: %, y: %): % == per(rep x + rep y);
}
----------------------------------^

Q: Cat == add {
   Rep == Integer; import from Rep
   coerce(x: Integer): % == per x;
   coerce(x: %): Integer == rep x;
   bar(x: %, y: %): % == per(rep x - rep y);
}
----------------------------------^

You are saying that P and Q are equivalent.

Ralf



From bill.page at newsynthesis.org  Sun Oct 28 17:26:28 2007
From: bill.page at newsynthesis.org (Bill Page)
Date: Sun, 28 Oct 2007 17:26:28 -0400
Subject: [Aldor-l] [fricas-devel] Re: [Axiom-math] Type equivalence of
	domains in Axiom and Aldor
In-Reply-To: <4723A556.8040502@hemmecke.de>
References: <fbcd16d40710251710v22eb1444w3ff5d8d56a9f6bd2@mail.gmail.com>
	<4723A556.8040502@hemmecke.de>
Message-ID: <fbcd16d40710281426k71569088i2f3545a7a9572174@mail.gmail.com>

On 10/27/07, Ralf Hemmecke wrote:
>
> >   Def: Two domains P and Q are equivalent if and only if both domains satisfy
> >   exactly the same set of categories: (P has x) = (Q has x) for all Category
> >   expressions x *and* neither P nor Q has any explicit exports that are not
> >   provided by some named category.
>
> Let's see...
>
> Cat: Category == with {
>    coerce: Integer -> %;
>    coerce: % -> Integer;
>    bar: (%, %) ->  %;
> }
> P: Cat == add {
>    Rep == Integer; import from Rep
>    coerce(x: Integer): % == per x;
>    coerce(x: %): Integer == rep x;
>    bar(x: %, y: %): % == per(rep x + rep y);
> }
> ----------------------------------^
>
> Q: Cat == add {
>    Rep == Integer; import from Rep
>    coerce(x: Integer): % == per x;
>    coerce(x: %): Integer == rep x;
>    bar(x: %, y: %): % == per(rep x - rep y);
> }
> ----------------------------------^
>
> You are saying that P and Q are equivalent.
>

No. I should have explicitly written "type-equivalent" as I did
elsewhere in that message. I would only want to say that their types
are equivalent - that they necessarily represent the same kind of
things. Something like: "they are both monoids".

I would also say that without giving more information about the use of
the category 'Cat' you are at risk of abusing the intention of
defining a category - at least in the context of the design of a
library such as Axiom library. What is the "meaning" of 'Cat' if it
makes sense to give two rather different definitions of 'bar'? I
started my discussion by saying that I assumed that the intention of
defining a category was to represent some specific aspect or common
mathematical property of a as set of mathematical object(s). I do not
want to think of a category as a mere syntactical convenience for
example like a macro.

Regards,
Bill Page.


From tmgisi at gmx.at  Mon Oct 29 01:56:58 2007
From: tmgisi at gmx.at (Christian Aistleitner)
Date: Mon, 29 Oct 2007 06:56:58 +0100
Subject: [Aldor-l] Type equivalence of domains in Axiom and Aldor
In-Reply-To: <fbcd16d40710251710v22eb1444w3ff5d8d56a9f6bd2@mail.gmail.com>
References: <fbcd16d40710251710v22eb1444w3ff5d8d56a9f6bd2@mail.gmail.com>
Message-ID: <op.t0x2s8zvu6j4vy@spencer.aistleitner.info>

Hello,

On Fri, 26 Oct 2007 02:10:43 +0200, Bill Page <bill.page at newsynthesis.org>  
wrote:

> [...] I would propose the following definition of type-equivalence
> of domains:
>
>   Def: Two domains P and Q are equivalent if and only if both domains  
> satisfy
>   exactly the same set of categories: (P has x) = (Q has x) for all  
> Category
>   expressions x *and* neither P nor Q has any explicit exports that are  
> not
>   provided by some named category.

Although it's trivial to see, I thought it might be good to explicitly say  
that this property can only be checked at runtime--due to Aldor's "extend".

If P and Q are type equivalent in the above sense, linking the code with a  
further library extending only P by another named category breaks type  
equivalence.

> Obviously it makes sense to require that two equivalent domains must
> provide the same set of exported operations (the same interface)
> having the same names and same signatures. But as I understand the
> intention of the semantics of categories in both Axiom and Aldor this
> is not enough. We want categories to represent abstract concepts
> usually with a well-defined mathematical meaning. That is the reason
> for explicitly referring to satisfaction of categories in the
> definition above. Further since domains can also explicitly include
> exported operations in the 'with' clause (i.e. "anonymous categories"
> as defined in the Aldor user's guide), if this mathematical meaning is
> carried only by the named categories, such anonymous categories must
> always be assumed to represent different categories in each domain in
> which they occur.

In a nutshell, you want each anonymous category to be different from any  
category.

My feeling about Aldor is different:
Important exports with well-defined semantics should be defined in named  
categories.
Unimportant exports, syntactic sugar and the like (so all the exports  
which do not represent some general mechanism and do not contribute to the  
essence of a domain) may go into unnamed categories.

Using such an intuition, unnamed categories and their current semantics  
for type satisfaction really fit the concept. Still, you could define type  
equivalence by just checking the named categories and ignoring the unnamed  
categories.

Currently, lots of domains do not stick to this intuition, but that's a  
different story.

> As a mininum it would probably be necessary to introduce two new
> cateogies: StreamCat(S) and ProductCat(X,Y). Then it would seem that
> would be necessary add code along the lines of
>
>    Product(A: SetCategory,B: SetCategory): ProductCat(A,B) with
>      if A has StreamCat(S) and B has StreamCat(S) then
>         StreamCat(S)
>
> And
>
>   Stream(S:Type): StreamCat(S) with
>     if S has ProductCat(A,B) then
>        ProductCat(A,B)
>
> for some set of allowed domains A, B and S, including for example
> 'Integer'. Of course there is a problem here about specifying the
> specific list of domains for A, B and C. It would be desirable I
> think, if the compiler could produce generic code which would apply
> whtn A, B and C are still unknowns.

The code seems to somehow model a distributive law you described above.  
That's ok for me, but I cannot see how this relates to type equivalence.
Assume, I give you a binary operator "type-equivalent?" taking two Aldor  
entities and computing whether or not they are type-equivalent in the  
sense you presented in your last mail. What problem can you solve with it?

Kind regards,
Christian


From martin.rubey at univie.ac.at  Thu Oct  4 02:23:51 2007
From: martin.rubey at univie.ac.at (martin.rubey at univie.ac.at)
Date: Thu, 04 Oct 2007 08:23:51 +0200
Subject: [Aldor-l] [Axiom-mail] A combinatorial question
Message-ID: <E1IdK7j-0007P0-Vq@justin.univie.ac.at>

<fbcd16d40710021736o863cb50v4c6e2b09409925ca at mail.gmail.com>
<1d67a53c0710021740y5150fc8n538b6cc75e4a47f7 at mail.gmail.com>
<fbcd16d40710031842t7c2bb11ase97a0527f83d147b at mail.gmail.com> Gcc:
nnml:mail.axiom
From: Martin Rubey <martin.rubey at univie.ac.at>
Date: 04 Oct 2007 08:23:51 +0200
In-Reply-To: <fbcd16d40710031842t7c2bb11ase97a0527f83d147b at mail.gmail.com>
Message-ID: <9qtzp7o0so.fsf at aquin.mat.univie.ac.at>
Lines: 47
User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
--text follows this line--
"Bill Page" <bill.page at newsynthesis.org> writes:

> (1) -> )set message time on
> (1) -> a:=[subSet(25,5,i) for i in 0..binomial(25,5)-1];
> (1) ->
>                                                       Type: List List Integer
>                                      Time: 58.00 (EV) + 6.61 (GC) = 64.61 sec
> 
> This works but obviously it should be possible to write an algorithm that
> performs better than this ... :-( Sage can do it in less than a second (via
> GAP) and apparently Mathematica can do it in about 0.04 seconds!

As I said before (but maybe my message didn't get through), good algorithms are
described in Ruskey (google: "Ruskey, combinatorial generation", goto
RuskeyCombGen.pdf)

If you are indeed interested in such things, PLEASE consider joining the
species project.  Much work has already been done, and since Aldor is semi-free
now, I think it was not a wasted effort.  Note also that the framework provided
by the species project is very general - it becomes very easy to build new
structures from old.

We have some big problems, which we probably should be open about:

* apart from Ralf and myself, we have no users so far.  Well, we didn't
  advertise it either.  This is where you could help.

The other problems have to do with Aldor - Axiom internals.  I'll still mention
them here:

* Axiom does not support Aldor's extend construct.  I.e., one cannot say

  #include "axiom"
  extend Integer: LabelType == add ...

  which makes some ugly - user visible - workarounds necessary.  Enabling that
  would be wonderful.

* Axiom does not support general signatures like

  Combination(k: Integer)(L: LabelType): CombinatorialSpecies(L) with { ... }

  Again, we provide a workaround.  I expect a real fix to be rather hard, here.

Martin






From ralf at hemmecke.de  Fri Oct  5 04:35:49 2007
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Fri, 05 Oct 2007 10:35:49 +0200
Subject: [Aldor-l] cannot access SVN repository
Message-ID: <4705F765.4090005@hemmecke.de>

svn co https://aquarium.aldor.csd.uwo.ca/svn/trunk aldor

is currently not working for me?

could you check

svn co https://aquarium.aldor.csd.uwo.ca/svn/trunk aldor
Error validating server certificate for 
'https://aquarium.aldor.csd.uwo.ca:443':
  - The certificate is not issued by a trusted authority. Use the
    fingerprint to validate the certificate manually!
  - The certificate hostname does not match.
  - The certificate has expired.
Certificate information:
  - Hostname: localhost.localdomain
  - Valid: from Fri, 07 Apr 2006 15:26:33 GMT until Sat, 07 Apr 2007 
15:26:33 GMT
  - Issuer: SomeOrganizationalUnit, SomeOrganization, SomeCity, 
SomeState, --
  - Fingerprint: 13:b7:0c:c5:35:e1:f1:c9:90:e8:b7:0e:b9:3d:ff:65:cb:45:61:03
(R)eject, accept (t)emporarily or accept (p)ermanently? p

No reaction after that.

Ralf




From daly at axiom-developer.org  Fri Oct  5 04:45:39 2007
From: daly at axiom-developer.org (root)
Date: Fri, 5 Oct 2007 04:45:39 -0400
Subject: [Aldor-l] cannot access SVN repository
In-Reply-To: <4705F765.4090005@hemmecke.de> (message from Ralf Hemmecke on
	Fri, 05 Oct 2007 10:35:49 +0200)
References: <4705F765.4090005@hemmecke.de>
Message-ID: <200710050845.l958jda11205@localhost.localdomain>

I get the same non-response when I choose permanent.

Tim



From martin.rubey at univie.ac.at  Sat Oct  6 12:33:57 2007
From: martin.rubey at univie.ac.at (Martin Rubey)
Date: 06 Oct 2007 18:33:57 +0200
Subject: [Aldor-l] [Axiom-mail] A combinatorial question
In-Reply-To: <BAY127-F25BA73617316D6C2E356C796AA0@phx.gbl>
References: <BAY127-F25BA73617316D6C2E356C796AA0@phx.gbl>
Message-ID: <9qhcl4fbii.fsf@aquin.mat.univie.ac.at>

"Peter Broadbery" <p_broadbery at hotmail.com> writes:

> >* Axiom does not support Aldor's extend construct.  I.e., one cannot say
> >
> >  #include "axiom"
> >  extend Integer: LabelType == add ...
> >
> >  which makes some ugly - user visible - workarounds necessary.  Enabling that
> >  would be wonderful.
> 
> Now that the aldor source has turned up (thanks stephen, and apologies for
> missing the august  get together), I'm having another go at getting this going
> (although I have to admit it's not really a primary goal for me)..  I might
> have something together in a few weeks with a following wind.

That would be truly wonderful.  If there is anything we could do to support
you, please don't hesitate to ask.

But now I have to ask: what is the primary goal for you?  :-)

Martin




From martin.rubey at univie.ac.at  Tue Oct  9 04:33:34 2007
From: martin.rubey at univie.ac.at (Martin Rubey)
Date: 09 Oct 2007 10:33:34 +0200
Subject: [Aldor-l] aldor extend, was: A combinatorial question
In-Reply-To: <BAY127-F2722F927D32F472A3AA74696A50@phx.gbl>
References: <BAY127-F2722F927D32F472A3AA74696A50@phx.gbl>
Message-ID: <9q1wc41ych.fsf@aquin.mat.univie.ac.at>

"Peter Broadbery" <p_broadbery at hotmail.com> writes:

> >But now I have to ask: what is the primary goal for you?  :-)
> >
> >Martin
> 
> Getting axiom to play nice with aldor is the starting point, then there's a
> few compiler things that I would like to play with - axiom extend will be
> good to have, but may involve more axiom hacking than I have the patience
> for.
> 
> Having the interop stuff in at least one of the various axioms that are
> floating around is also on the list.

It just occurred to me that there would indeed be a different way to help Ralf
and myself:  a long while ago Waldek mentioned that it might not be too hard to
provide "extend" for SPAD.

This would be slightly different, since the aldor compiler would not even
notice that a domain is extended - i.e., no work on the aldor side.

Of course, libaxiom would then have to be regenerated if I want to use the
extended domain within aldor.

Our combinat distribution would then contain a spad file containing the
necessary extend's.  Since there is currently not much code in the extend's
anyway, that wouldn't matter too much - at least not for me.

What does matter to me however is that I definitively want SPAD to become
Aldor, either by replacement or by improvement.  I have the feeling that having
extend being understood by axiom would be a big step in the right direction.
And it does seem to me that making axiom understand arbitrary signatures as
allowed in aldor is a bit too much to ask for...  It's a shame I have neither
time nor expertise to hack there myself.

Good luck,

Martin




From ralf at hemmecke.de  Sat Oct 20 20:50:04 2007
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Sun, 21 Oct 2007 02:50:04 +0200
Subject: [Aldor-l] The following could be suitable if imported
In-Reply-To: <87abqh7ggg.fsf_-_@atiyah.home>
References: <42529.193.170.37.45.1192607437.squirrel@193.170.37.45>	<4715E53C.2040003@risc.uni-linz.ac.at>
	<87ejftgbsl.fsf_-_@atiyah.home>	<47161F61.2010803@risc.uni-linz.ac.at>
	<87abqh7ggg.fsf_-_@atiyah.home>
Message-ID: <471AA23C.4070705@hemmecke.de>

Hello,
I have already discussed it with Johannes personally, but it seems that 
my answer was only partially correct.
Since that seems to be a more general problem I forward this mail also 
to aldor-l.

Indeed the reference to the AUG page 90 would suggest that the program 
compiles.

And it does indeed compile if the function definition of "test" is 
commented out.

But how can one use foo?

The only way I found was a (seemingly very strange) construction like
Replace

      b : DOM(2,2) == foo(a,a);

by

   if 2=2 then b: DOM(2,2) == foo(a,a);

I've no idea whether the produced code is reasonable, but at least one 
can shut up the compiler.

Ralf

On 10/17/2007 08:18 PM, Johannes Middeke wrote:
> Hello,
> 
> 
> I get just another error message I cannot get rid of. I use the
> following programme which is but a simplified version of my original
> sources.
> 
> File: TMP.as __________________________________________________________________
> #include "aldor"
> #include "aldorio"
> 
> Int ==> MachineInteger;
> 
> DOM(a : Int, b : Int) : with {
>     0 : %;
>     if (a = b) then foo : (%,%) -> %;
> } == add {
>     Rep == Int;
>     0 : % == per 0;
>     if (a = b) then foo(a : %, b : %) : % == 0;
> }
> 
> test () : Int == {
>     import { integer : Literal -> % } from Int;
>     import { foo : (%,%) -> % } from DOM(2,2);
>     local a : DOM(2,2) == 0;
>     local b : DOM(2,2) == foo(a,a);
> }
> _______________________________________________________________________________
> 
> Upon compiling I get the following:
> 
> _______________________________________________________________________________
> $ aldor -Fx -laldor TMP.as
> "TMP.as", line 19:     local b : DOM(2,2) == foo(a,a);
>                    ..........................^
> [L19 C27] #1 (Error) There are no suitable meanings for the operator `foo'.
> The following could be suitable if imported:
>   foo: (DOM(2, 2), DOM(2, 2)) -> DOM(2, 2) from DOM(2, 2), if 2 = 2
> _______________________________________________________________________________
> 
> Searching the web suggested that aldors compiler might not be clever
> enough to notice, that the condition 2 = 2 really is true. But on the
> other hand, the code follows rather closely an example from th euser
> guide (page 90).
> 
> So, is there anything I can do to bring foo into scope? Maybe some
> compiler flag to enable compile time evaluation of conditions?



From martin.rubey at univie.ac.at  Sun Oct 21 02:43:08 2007
From: martin.rubey at univie.ac.at (Martin Rubey)
Date: 21 Oct 2007 08:43:08 +0200
Subject: [Aldor-l] The following could be suitable if imported
In-Reply-To: <471AA23C.4070705@hemmecke.de>
References: <42529.193.170.37.45.1192607437.squirrel@193.170.37.45>
	<4715E53C.2040003@risc.uni-linz.ac.at> <87ejftgbsl.fsf_-_@atiyah.home>
	<47161F61.2010803@risc.uni-linz.ac.at> <87abqh7ggg.fsf_-_@atiyah.home>
	<471AA23C.4070705@hemmecke.de>
Message-ID: <9qlk9x7ytf.fsf@aquin.mat.univie.ac.at>

Ralf Hemmecke <ralf at hemmecke.de> writes:

> The only way I found was a (seemingly very strange) construction like
> Replace
> 
>       b : DOM(2,2) == foo(a,a);
> 
> by
> 
>    if 2=2 then b: DOM(2,2) == foo(a,a);

Isn't that the same workaround Christian AIstleitner suggested for our combinat
troubles?

BugWorkaround(CONDITION)(CODE) == {
        assert(CONDITION);
        if CONDITION then CODE else never;
}


Martin




From ralf at hemmecke.de  Sun Oct 21 15:48:25 2007
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Sun, 21 Oct 2007 21:48:25 +0200
Subject: [Aldor-l] [open-axiom-devel] [fricas-devel] Re: iterators
In-Reply-To: <9qzlyca6yz.fsf@aquin.mat.univie.ac.at>
References: <E1IjR7R-0006NO-00@hera.math.uni.wroc.pl>
	<9qzlyca6yz.fsf@aquin.mat.univie.ac.at>
Message-ID: <471BAD09.2090509@hemmecke.de>

> OK.  I'd still prefer to keep the language simple.  What I would like a lot
> however is something like
> 
> for e in g repeat
>     (a, b) := e
>     ...

Possible in Aldor

> or even
> 
> for (a, b) in g repeat
>     ...
> 
> given that g returns a Cross.

Not possible in Aldor.



Stephen Watt,

is there a particular reason why the latter construction is not allowed 
in the Aldor language (I am not speaking of the compiler)?

Ralf



From watt at scl.csd.uwo.ca  Sun Oct 21 16:28:09 2007
From: watt at scl.csd.uwo.ca (Stephen Watt)
Date: Sun, 21 Oct 2007 16:28:09 -0400
Subject: [Aldor-l] [open-axiom-devel] [fricas-devel] Re: iterators
In-Reply-To: <471BAD09.2090509@hemmecke.de>
References: <E1IjR7R-0006NO-00@hera.math.uni.wroc.pl>
	<9qzlyca6yz.fsf@aquin.mat.univie.ac.at>
	<471BAD09.2090509@hemmecke.de>
Message-ID: <20071021202809.GA23544@ptibonum.scl.csd.uwo.ca>

There is no deep reason why it is not allowed.  
It would be a compatible extension to allow it.  

-- Stephen

On Sun, Oct 21, 2007 at 09:48:25PM +0200, Ralf Hemmecke wrote:
> >OK.  I'd still prefer to keep the language simple.  What I would like a lot
> >however is something like
> >
> >for e in g repeat
> >    (a, b) := e
> >    ...
> 
> Possible in Aldor
> 
> >or even
> >
> >for (a, b) in g repeat
> >    ...
> >
> >given that g returns a Cross.
> 
> Not possible in Aldor.
> 
> 
> 
> Stephen Watt,
> 
> is there a particular reason why the latter construction is not allowed 
> in the Aldor language (I am not speaking of the compiler)?
> 
> Ralf



From ralf at hemmecke.de  Sun Oct 21 16:40:38 2007
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Sun, 21 Oct 2007 22:40:38 +0200
Subject: [Aldor-l] Old reference into the mailing list does not work
Message-ID: <471BB946.9060200@hemmecke.de>

Hello people at aldor.org,

is there a particular reason why an old reference into the mailing list

http://www.aldor.org/pipermail/aldor-l/2007-January/000579.html

does no longer work? Could you make that working again?

Thank you

Ralf



From ralf at hemmecke.de  Sun Oct 21 18:03:40 2007
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Mon, 22 Oct 2007 00:03:40 +0200
Subject: [Aldor-l] The following could be suitable if imported
In-Reply-To: <9qlk9x7ytf.fsf@aquin.mat.univie.ac.at>
References: <42529.193.170.37.45.1192607437.squirrel@193.170.37.45>	<4715E53C.2040003@risc.uni-linz.ac.at>
	<87ejftgbsl.fsf_-_@atiyah.home>	<47161F61.2010803@risc.uni-linz.ac.at>
	<87abqh7ggg.fsf_-_@atiyah.home>	<471AA23C.4070705@hemmecke.de>
	<9qlk9x7ytf.fsf@aquin.mat.univie.ac.at>
Message-ID: <471BCCBC.4090303@hemmecke.de>

Hi Martin,

Yes, actually we use that trick in Aldor-Combinat. How could I forget?

Thanks
Ralf

On 10/21/2007 08:43 AM, Martin Rubey wrote:
> Ralf Hemmecke <ralf at hemmecke.de> writes:
> 
>> The only way I found was a (seemingly very strange) construction like
>> Replace
>>
>>       b : DOM(2,2) == foo(a,a);
>>
>> by
>>
>>    if 2=2 then b: DOM(2,2) == foo(a,a);
> 
> Isn't that the same workaround Christian AIstleitner suggested for our combinat
> troubles?
> 
> BugWorkaround(CONDITION)(CODE) == {
>         assert(CONDITION);
>         if CONDITION then CODE else never;
> }
> 
> 
> Martin



From ralf at hemmecke.de  Wed Oct 24 17:55:28 2007
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Wed, 24 Oct 2007 23:55:28 +0200
Subject: [Aldor-l] [open-axiom-devel] generators
In-Reply-To: <9q7ildkkho.fsf_-_@aquin.mat.univie.ac.at>
References: <E1IjR7R-0006NO-00@hera.math.uni.wroc.pl>	<fbcd16d40710220903j19204785l2072b8f005466281@mail.gmail.com>	<Pine.LNX.4.64.0710221103300.17358@gauss.cs.tamu.edu>	<471D449F.4020305@hemmecke.de>	<fbcd16d40710231700p765b1867h743803ba998f26cb@mail.gmail.com>	<471E8D7E.6070801@hemmecke.de>	<fbcd16d40710231720i5f802f92p5cb8c4373589d057@mail.gmail.com>	<471E957A.1040403@hemmecke.de>	<fbcd16d40710231807w3631fcbeo431f2834e4c8f393@mail.gmail.com>	<471E9EC1.3090707@hemmecke.de>	<fbcd16d40710231856n7f5379f6r52c31da01d1d5c18@mail.gmail.com>
	<9q7ildkkho.fsf_-_@aquin.mat.univie.ac.at>
Message-ID: <471FBF50.9090408@hemmecke.de>

> Just curious: can something of type Generator(Something) ever be a domain?
> (Probably yes...)

 >aldor -fx -laldor aaa.as
 >aaa
MachineInteger
123

---BEGIN aaa.as
#include "aldor"
#include "aldorio"

CAT ==> OutputType with {integer: Literal -> %}
g(): Generator(CAT) == generate {
	yield MachineInteger;
--	yield Integer;
}

foo(D: CAT): () == {
	import from D, TextWriter, String, Character;
	stdout << name(D)$Trace << newline;
	stdout << (123 at D) << newline;
}

for D in g() repeat foo(D);
---END aaa.as

But don't remove the -- before "yield Integer", because then the 
compiler tells you... :-(

"aaa.as", line 5: g(): Generator(CAT) == generate {
                   ................................^
[L5 C33] #1 (Fatal Error) Compiler bug: no exit list for terrorSequence 
(ooops).

Since in Aldor domains are first class, it should be possible to return 
them by a generator. (Compare to lists of domains.)

However, your question asks whether g is a domain if

   g: Generator(Something)

and I would tend to say that this is not a domain. Why? Well, 
"Generator(Something)" should be a category then, right? But if you look 
int sal_gener.as you clearly see that Generator(T) is a domain.

Ralf




From bill.page at newsynthesis.org  Thu Oct 25 20:10:43 2007
From: bill.page at newsynthesis.org (Bill Page)
Date: Thu, 25 Oct 2007 20:10:43 -0400
Subject: [Aldor-l] Type equivalence of domains in Axiom and Aldor
Message-ID: <fbcd16d40710251710v22eb1444w3ff5d8d56a9f6bd2@mail.gmail.com>

Dear Friends of Axiom and Aldor,

As a result of the recent message thread about "iterators and
cartesian product" in the Axiom library I have been thinking again
about type equivalence. For example consider the following domains in
Axiom:

(1) -> P:=Product(Stream Integer,Stream Integer)

   (1)  Product(Stream Integer,Stream Integer)
                                                        Type: Domain
(2) -> Q:=Stream Product(Integer,Integer)

   (2)  Stream Product(Integer,Integer)
                                                       Type: Domain

On reflection (pun intended) it seems that 'Stream' is a "sum-like"
domain constructor so that we might reasonably expect algebraically
that a 'Product' distributes over a 'Stream' and therefore wish to
design the Axiom library so that this is satisfied.

Thus we should have

   P = Q

Side Note: Perhaps with an extension of the domain 'Domain' that Gaby
recently introduced in OpenAxiom it would actually be possible to
write and evaluate this expression in Axiom.

I understand that neither Spad nor Aldor actually evaluate type
expressions like P and Q above so it does not make sense to ask for
"value" equality of these two domains. But perhaps EQUAL in the Lisp
sense (ref: http://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node74.html)
could appliy?

Therefore I would propose the following definition of type-equivalence
of domains:

  Def: Two domains P and Q are equivalent if and only if both domains satisfy
  exactly the same set of categories: (P has x) = (Q has x) for all Category
  expressions x *and* neither P nor Q has any explicit exports that are not
  provided by some named category.

It seems that in principle it should be possible to give an efficient
decision procedure for this test if it is not already implemented
somewhere in the Spad and Aldor compilers. I would like to understand
this better from the point of view of the compiler and iterpreter
design.

Obviously it makes sense to require that two equivalent domains must
provide the same set of exported operations (the same interface)
having the same names and same signatures. But as I understand the
intention of the semantics of categories in both Axiom and Aldor this
is not enough. We want categories to represent abstract concepts
usually with a well-defined mathematical meaning. That is the reason
for explicitly referring to satisfaction of categories in the
definition above. Further since domains can also explicitly include
exported operations in the 'with' clause (i.e. "anonymous categories"
as defined in the Aldor user's guide), if this mathematical meaning is
carried only by the named categories, such anonymous categories must
always be assumed to represent different categories in each domain in
which they occur.

With this definition it is easy to show that the current definitions
of 'Product' and 'Stream' do not satisfy the expected distributive
property. Right now both 'Stream' and 'Product' have explicit exports,
further the actual list of exported operations does not match at all:

(3) -> )sh P
 Product(Stream Integer,Stream Integer) is a domain constructor.
 Abbreviation for Product is PRODUCT
 This constructor is not exposed in this frame.
 Issue )edit /usr/local/lib/axiom/target/i686-suse-linux/../../src/algebra/PRODUCT.spad
to see algebra source code for PRODUCT

------------------------------- Operations --------------------------------

 ?*? : (Integer,%) -> %                ?*? : (PositiveInteger,%) -> %
...

(3) -> )sh Q
 Stream Product(Integer,Integer) is a domain constructor.
 Abbreviation for Stream is STREAM
 This constructor is exposed in this frame.
 Issue )edit /usr/local/lib/axiom/target/i686-suse-linux/../../src/algebra/STREAM.spad
to see algebra source code for STREAM

------------------------------- Operations --------------------------------

 #? : % -> NonNegativeInteger          ?=? : (%,%) -> Boolean
...

As a mininum it would probably be necessary to introduce two new
cateogies: StreamCat(S) and ProductCat(X,Y). Then it would seem that
would be necessary add code along the lines of

   Product(A: SetCategory,B: SetCategory): ProductCat(A,B) with
     if A has StreamCat(S) and B has StreamCat(S) then
        StreamCat(S)

And

  Stream(S:Type): StreamCat(S) with
    if S has ProductCat(A,B) then
       ProductCat(A,B)

for some set of allowed domains A, B and S, including for example
'Integer'. Of course there is a problem here about specifying the
specific list of domains for A, B and C. It would be desirable I
think, if the compiler could produce generic code which would apply
whtn A, B and C are still unknowns. Is this possible?

Of course we also need the implementations of the associate operations.

With these changes we would be able to satisfy the definition of the
type-equivalence of P and Q above.

I would like to know if other developers think this more algebraic
approach to the design of the Axiom library domains makes sense.
Comments and criticisms are invited.

Regards,
Bill Page.



From youssef at bu.edu  Fri Oct 26 00:09:18 2007
From: youssef at bu.edu (Saul Youssef)
Date: Fri, 26 Oct 2007 00:09:18 -0400
Subject: [Aldor-l] Type equivalence of domains in Axiom and Aldor
In-Reply-To: <fbcd16d40710251710v22eb1444w3ff5d8d56a9f6bd2@mail.gmail.com>
References: <fbcd16d40710251710v22eb1444w3ff5d8d56a9f6bd2@mail.gmail.com>
Message-ID: <d7d109480710252109j597f3175pb018befeece3e635@mail.gmail.com>

Hi Bill,

      I unfortunately couldn't make it to the Aldor workshop and I
haven't touched the language in a few years, but I do have a comment.

      Your questions have definite answers in category theory and
since Aldor is *almost* doing category theory, it's tempting to think
that the categorical answers to your questions are really what should
naturally fit into the language.  I wrote up something trying this out
for the 2001 workshop

http://atlas.bu.edu/~youssef/papers/math/aldor/aldor.pdf

I still think that this is a good way to look for flaws in the
language - implement category theory and see what goes wrong.

Best regards,

    Saul Youssef

On 10/25/07, Bill Page <bill.page at newsynthesis.org> wrote:
> Dear Friends of Axiom and Aldor,
>
> As a result of the recent message thread about "iterators and
> cartesian product" in the Axiom library I have been thinking again
> about type equivalence. For example consider the following domains in
> Axiom:
>
> (1) -> P:=Product(Stream Integer,Stream Integer)
>
>    (1)  Product(Stream Integer,Stream Integer)
>                                                         Type: Domain
> (2) -> Q:=Stream Product(Integer,Integer)
>
>    (2)  Stream Product(Integer,Integer)
>                                                        Type: Domain
>
> On reflection (pun intended) it seems that 'Stream' is a "sum-like"
> domain constructor so that we might reasonably expect algebraically
> that a 'Product' distributes over a 'Stream' and therefore wish to
> design the Axiom library so that this is satisfied.
>
> Thus we should have
>
>    P = Q
>
> Side Note: Perhaps with an extension of the domain 'Domain' that Gaby
> recently introduced in OpenAxiom it would actually be possible to
> write and evaluate this expression in Axiom.
>
> I understand that neither Spad nor Aldor actually evaluate type
> expressions like P and Q above so it does not make sense to ask for
> "value" equality of these two domains. But perhaps EQUAL in the Lisp
> sense (ref: http://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node74.html)
> could appliy?
>
> Therefore I would propose the following definition of type-equivalence
> of domains:
>
>   Def: Two domains P and Q are equivalent if and only if both domains satisfy
>   exactly the same set of categories: (P has x) = (Q has x) for all Category
>   expressions x *and* neither P nor Q has any explicit exports that are not
>   provided by some named category.
>
> It seems that in principle it should be possible to give an efficient
> decision procedure for this test if it is not already implemented
> somewhere in the Spad and Aldor compilers. I would like to understand
> this better from the point of view of the compiler and iterpreter
> design.
>
> Obviously it makes sense to require that two equivalent domains must
> provide the same set of exported operations (the same interface)
> having the same names and same signatures. But as I understand the
> intention of the semantics of categories in both Axiom and Aldor this
> is not enough. We want categories to represent abstract concepts
> usually with a well-defined mathematical meaning. That is the reason
> for explicitly referring to satisfaction of categories in the
> definition above. Further since domains can also explicitly include
> exported operations in the 'with' clause (i.e. "anonymous categories"
> as defined in the Aldor user's guide), if this mathematical meaning is
> carried only by the named categories, such anonymous categories must
> always be assumed to represent different categories in each domain in
> which they occur.
>
> With this definition it is easy to show that the current definitions
> of 'Product' and 'Stream' do not satisfy the expected distributive
> property. Right now both 'Stream' and 'Product' have explicit exports,
> further the actual list of exported operations does not match at all:
>
> (3) -> )sh P
>  Product(Stream Integer,Stream Integer) is a domain constructor.
>  Abbreviation for Product is PRODUCT
>  This constructor is not exposed in this frame.
>  Issue )edit /usr/local/lib/axiom/target/i686-suse-linux/../../src/algebra/PRODUCT.spad
> to see algebra source code for PRODUCT
>
> ------------------------------- Operations --------------------------------
>
>  ?*? : (Integer,%) -> %                ?*? : (PositiveInteger,%) -> %
> ...
>
> (3) -> )sh Q
>  Stream Product(Integer,Integer) is a domain constructor.
>  Abbreviation for Stream is STREAM
>  This constructor is exposed in this frame.
>  Issue )edit /usr/local/lib/axiom/target/i686-suse-linux/../../src/algebra/STREAM.spad
> to see algebra source code for STREAM
>
> ------------------------------- Operations --------------------------------
>
>  #? : % -> NonNegativeInteger          ?=? : (%,%) -> Boolean
> ...
>
> As a mininum it would probably be necessary to introduce two new
> cateogies: StreamCat(S) and ProductCat(X,Y). Then it would seem that
> would be necessary add code along the lines of
>
>    Product(A: SetCategory,B: SetCategory): ProductCat(A,B) with
>      if A has StreamCat(S) and B has StreamCat(S) then
>         StreamCat(S)
>
> And
>
>   Stream(S:Type): StreamCat(S) with
>     if S has ProductCat(A,B) then
>        ProductCat(A,B)
>
> for some set of allowed domains A, B and S, including for example
> 'Integer'. Of course there is a problem here about specifying the
> specific list of domains for A, B and C. It would be desirable I
> think, if the compiler could produce generic code which would apply
> whtn A, B and C are still unknowns. Is this possible?
>
> Of course we also need the implementations of the associate operations.
>
> With these changes we would be able to satisfy the definition of the
> type-equivalence of P and Q above.
>
> I would like to know if other developers think this more algebraic
> approach to the design of the Axiom library domains makes sense.
> Comments and criticisms are invited.
>
> Regards,
> Bill Page.
>
> _______________________________________________
> Aldor-l mailing list
> Aldor-l at aldor.org
> http://aldor.org/mailman/listinfo/aldor-l_aldor.org
>
>



From ralf at hemmecke.de  Sat Oct 27 16:53:42 2007
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Sat, 27 Oct 2007 22:53:42 +0200
Subject: [Aldor-l] [Axiom-math] Type equivalence of domains in Axiom and
	Aldor
In-Reply-To: <fbcd16d40710251710v22eb1444w3ff5d8d56a9f6bd2@mail.gmail.com>
References: <fbcd16d40710251710v22eb1444w3ff5d8d56a9f6bd2@mail.gmail.com>
Message-ID: <4723A556.8040502@hemmecke.de>

>   Def: Two domains P and Q are equivalent if and only if both domains satisfy
>   exactly the same set of categories: (P has x) = (Q has x) for all Category
>   expressions x *and* neither P nor Q has any explicit exports that are not
>   provided by some named category.

Let's see...

Cat: Category == with {
   coerce: Integer -> %;
   coerce: % -> Integer;
   bar: (%, %) ->  %;
}
P: Cat == add {
   Rep == Integer; import from Rep
   coerce(x: Integer): % == per x;
   coerce(x: %): Integer == rep x;
   bar(x: %, y: %): % == per(rep x + rep y);
}
----------------------------------^

Q: Cat == add {
   Rep == Integer; import from Rep
   coerce(x: Integer): % == per x;
   coerce(x: %): Integer == rep x;
   bar(x: %, y: %): % == per(rep x - rep y);
}
----------------------------------^

You are saying that P and Q are equivalent.

Ralf




From bill.page at newsynthesis.org  Sun Oct 28 17:26:28 2007
From: bill.page at newsynthesis.org (Bill Page)
Date: Sun, 28 Oct 2007 17:26:28 -0400
Subject: [Aldor-l] [fricas-devel] Re: [Axiom-math] Type equivalence of
	domains in Axiom and Aldor
In-Reply-To: <4723A556.8040502@hemmecke.de>
References: <fbcd16d40710251710v22eb1444w3ff5d8d56a9f6bd2@mail.gmail.com>
	<4723A556.8040502@hemmecke.de>
Message-ID: <fbcd16d40710281426k71569088i2f3545a7a9572174@mail.gmail.com>

On 10/27/07, Ralf Hemmecke wrote:
>
> >   Def: Two domains P and Q are equivalent if and only if both domains satisfy
> >   exactly the same set of categories: (P has x) = (Q has x) for all Category
> >   expressions x *and* neither P nor Q has any explicit exports that are not
> >   provided by some named category.
>
> Let's see...
>
> Cat: Category == with {
>    coerce: Integer -> %;
>    coerce: % -> Integer;
>    bar: (%, %) ->  %;
> }
> P: Cat == add {
>    Rep == Integer; import from Rep
>    coerce(x: Integer): % == per x;
>    coerce(x: %): Integer == rep x;
>    bar(x: %, y: %): % == per(rep x + rep y);
> }
> ----------------------------------^
>
> Q: Cat == add {
>    Rep == Integer; import from Rep
>    coerce(x: Integer): % == per x;
>    coerce(x: %): Integer == rep x;
>    bar(x: %, y: %): % == per(rep x - rep y);
> }
> ----------------------------------^
>
> You are saying that P and Q are equivalent.
>

No. I should have explicitly written "type-equivalent" as I did
elsewhere in that message. I would only want to say that their types
are equivalent - that they necessarily represent the same kind of
things. Something like: "they are both monoids".

I would also say that without giving more information about the use of
the category 'Cat' you are at risk of abusing the intention of
defining a category - at least in the context of the design of a
library such as Axiom library. What is the "meaning" of 'Cat' if it
makes sense to give two rather different definitions of 'bar'? I
started my discussion by saying that I assumed that the intention of
defining a category was to represent some specific aspect or common
mathematical property of a as set of mathematical object(s). I do not
want to think of a category as a mere syntactical convenience for
example like a macro.

Regards,
Bill Page.



From tmgisi at gmx.at  Mon Oct 29 01:56:58 2007
From: tmgisi at gmx.at (Christian Aistleitner)
Date: Mon, 29 Oct 2007 06:56:58 +0100
Subject: [Aldor-l] Type equivalence of domains in Axiom and Aldor
In-Reply-To: <fbcd16d40710251710v22eb1444w3ff5d8d56a9f6bd2@mail.gmail.com>
References: <fbcd16d40710251710v22eb1444w3ff5d8d56a9f6bd2@mail.gmail.com>
Message-ID: <op.t0x2s8zvu6j4vy@spencer.aistleitner.info>

Hello,

On Fri, 26 Oct 2007 02:10:43 +0200, Bill Page <bill.page at newsynthesis.org>  
wrote:

> [...] I would propose the following definition of type-equivalence
> of domains:
>
>   Def: Two domains P and Q are equivalent if and only if both domains  
> satisfy
>   exactly the same set of categories: (P has x) = (Q has x) for all  
> Category
>   expressions x *and* neither P nor Q has any explicit exports that are  
> not
>   provided by some named category.

Although it's trivial to see, I thought it might be good to explicitly say  
that this property can only be checked at runtime--due to Aldor's "extend".

If P and Q are type equivalent in the above sense, linking the code with a  
further library extending only P by another named category breaks type  
equivalence.

> Obviously it makes sense to require that two equivalent domains must
> provide the same set of exported operations (the same interface)
> having the same names and same signatures. But as I understand the
> intention of the semantics of categories in both Axiom and Aldor this
> is not enough. We want categories to represent abstract concepts
> usually with a well-defined mathematical meaning. That is the reason
> for explicitly referring to satisfaction of categories in the
> definition above. Further since domains can also explicitly include
> exported operations in the 'with' clause (i.e. "anonymous categories"
> as defined in the Aldor user's guide), if this mathematical meaning is
> carried only by the named categories, such anonymous categories must
> always be assumed to represent different categories in each domain in
> which they occur.

In a nutshell, you want each anonymous category to be different from any  
category.

My feeling about Aldor is different:
Important exports with well-defined semantics should be defined in named  
categories.
Unimportant exports, syntactic sugar and the like (so all the exports  
which do not represent some general mechanism and do not contribute to the  
essence of a domain) may go into unnamed categories.

Using such an intuition, unnamed categories and their current semantics  
for type satisfaction really fit the concept. Still, you could define type  
equivalence by just checking the named categories and ignoring the unnamed  
categories.

Currently, lots of domains do not stick to this intuition, but that's a  
different story.

> As a mininum it would probably be necessary to introduce two new
> cateogies: StreamCat(S) and ProductCat(X,Y). Then it would seem that
> would be necessary add code along the lines of
>
>    Product(A: SetCategory,B: SetCategory): ProductCat(A,B) with
>      if A has StreamCat(S) and B has StreamCat(S) then
>         StreamCat(S)
>
> And
>
>   Stream(S:Type): StreamCat(S) with
>     if S has ProductCat(A,B) then
>        ProductCat(A,B)
>
> for some set of allowed domains A, B and S, including for example
> 'Integer'. Of course there is a problem here about specifying the
> specific list of domains for A, B and C. It would be desirable I
> think, if the compiler could produce generic code which would apply
> whtn A, B and C are still unknowns.

The code seems to somehow model a distributive law you described above.  
That's ok for me, but I cannot see how this relates to type equivalence.
Assume, I give you a binary operator "type-equivalent?" taking two Aldor  
entities and computing whether or not they are type-equivalent in the  
sense you presented in your last mail. What problem can you solve with it?

Kind regards,
Christian



