From ralf at hemmecke.de  Wed Jul  2 09:09:13 2008
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Wed, 02 Jul 2008 15:09:13 +0200
Subject: [Aldor-l] Dangerous use of GMP
In-Reply-To: <20080626203321.GA28680@osiris.xinutec.org>
References: <20080626203321.GA28680@osiris.xinutec.org>
Message-ID: <486B7DF9.90202@hemmecke.de>

Hi Pippijn, hello Peter,

When I say

aldor -fc -q5 salfltgmp.as

I get

static FiWord
CF26_coerce(FiEnv e1, FiWord P0_a)
{
         PFmt14 T2;
         PFmt13 T0, T1;
         PFmt21 l1;
         l1 = (PFmt21) fiEnvLevel(e1);
         if ((FiBool) l1->X57_b64_QMARK_) goto L0;
         T1 = fi0RecNew(struct Fmt13 , CENSUS_Rec);
         T1->X0_pr = (FiWord) 0L;
         T1->X1_sz = (FiWord) 0L;
         T1->X2_expo = (FiWord) 0L;
         T1->X3_lmbs = (FiWord) fiNil;
         T0 = T1;
L1:	__gmpf_init((FiWord) T0);
         __gmpf_set_d((FiWord) T0, P0_a);
         return (FiWord) T0;
L0:	T2 = fi0RecNew(struct Fmt14 , CENSUS_Rec);
         T2->X0_szpr = (FiWord) 0L;
         T2->X1_expo = (FiWord) 0L;
         T2->X2_lmbs = (FiWord) fiNil;
         T0 = (PFmt13) T2;
         goto L1;
}

with

struct Fmt13 {
         FiWord X0_pr;
         FiWord X1_sz;
         FiWord X2_expo;
         FiWord X3_lmbs;
};
struct Fmt14 {
         FiWord X0_szpr;
         FiWord X1_expo;
         FiWord X2_lmbs;
};

being the equivalent of

	coerce(a:DoubleFloat):%		== {
		e:% := new();
		____gmpf__set__d(rep e, a);
		e;
	}

         new():%                         == {
		n: Pointer := {
			b64? => [0,0,nil]$Rec64 pretend Pointer;
			[0,0,0,nil]$Rec32 pretend Pointer;
		}
                 ____gmpf__init(n);
		per n;
	}

So the structures given to __gmpf_init() differ according to whether the 
program runs on 32 or 64 bits. Seems that I didn't understand your 
problem. Could you make that issue a bit more precise?

Now if gmp on a 64 bit machine requires the second argument of 
__gmpf_set_d() to be a float instead of a pointer to it, then there must 
be made some change to the .as sources. Actually, it would be 
interesting to know whether Aldor deals with single and double floats 
*always* in a boxed form.

Peter, do you happen to know?

In that case maybe something like

   coerce(a:DoubleFloat):%		== {
	e:% := new();
	if b64? then {
		Box ==> Record(myfloatdata: Pointer);
		import from Box;
		f: Pointer := (a pretend Box).myfloatdata;
		____gmpf__set__d(rep e, (f pretend DoubleFloat));
	} else {
		____gmpf__set__d(rep e, a);
	}
	e;
   }

might help. It leads to

static FiWord
CF26_coerce(FiEnv e1, FiWord P0_a)
{
         PFmt14 T3;
         PFmt13 T1, T2;
         FiWord T0_f;
         PFmt22 l1;
         l1 = (PFmt22) fiEnvLevel(e1);
         if ((FiBool) l1->X57_b64_QMARK_) goto L2;
         T2 = fi0RecNew(struct Fmt13 , CENSUS_Rec);
         T2->X0_pr = (FiWord) 0L;
         T2->X1_sz = (FiWord) 0L;
         T2->X2_expo = (FiWord) 0L;
         T2->X3_lmbs = (FiWord) fiNil;
         T1 = T2;
L3:	__gmpf_init((FiWord) T1);
         if ((FiBool) l1->X57_b64_QMARK_) goto L0;
         __gmpf_set_d((FiWord) T1, P0_a);
L1:	return (FiWord) T1;
L0:	T0_f = ((PFmt19) P0_a)->X0_myfloatdata;
         __gmpf_set_d((FiWord) T1, T0_f);
         goto L1;
L2:	T3 = fi0RecNew(struct Fmt14 , CENSUS_Rec);
         T3->X0_szpr = (FiWord) 0L;
         T3->X1_expo = (FiWord) 0L;
         T3->X2_lmbs = (FiWord) fiNil;
         T1 = (PFmt13) T3;
         goto L3;
}

Does that you more right to you, Pippijn?

In any case, my change of the .as stuff looks very ugly and dangerous.

Ralf

PS: Unfortunately, I could not find any contact data of Helene Prieto 
(the author of sal_fltgmp.as).



On 06/26/2008 10:33 PM, Pippijn van Steenhoven wrote:
> Hi List,
> 
> in libaldor, the file sal_fltgmp.as uses GMP functions in 'coerce' as
> follows:
> 
> struct Fmt13 {
>         FiWord X0_pr;
>         FiWord X1_sz;
>         FiWord X2_expo;
>         FiWord X3_lmbs;
> };
> [...]
> struct Fmt32 {
>         FiDFlo X0_float;
> };
> [...]
> static FiWord
> CF24_coerce(FiEnv e1, FiWord P0_a)
> {
>         [...]
>         PFmt13 T2, T3;
>         PFmt32 T1;
>         [...]
>         T1 = fi0RecNew(struct Fmt32 , CENSUS_Rec);
>         [...]
>         T3 = fi0RecNew(struct Fmt13 , CENSUS_Rec);
>         [...]
>         T2 = T3;
> L1:     __gmpf_init((FiWord) T2);
>         __gmpf_set_d((FiWord) T2, T1);
>         [...]
> }
> 
> 1) Fmt13 is not what __gmpf_init expects. What the function expects is
>    more like
>    struct mpf_struct {
>         int X0_pr;
>         int X1_sz;
>         int X2_expo;
>         Pointer X3_lmbs;
>    };
>    This is fine on 32 bit platforms, but on 64 bit platforms with the
>    LP64 data model, this breaks horribly.
> 2) __gmpf_set_d expects the same struct as above as first argument and a
>    plain double as second argument. T1, however, is a pointer to a struct
>    containing a plain double. It will *always* receive garbage. Passing
>    T1->X0_float would work, but currently, there is no support for
>    something like that.
> 
> This seems to be an inherent problem with the way Aldor generates C code.
> How should this be solved? I really don't have many ideas on this one.
> The compiler expects the functions to nicely work with those arguments,
> but they don't. The only solution I can think of is wrapping all foreign
> functions.


From pip88nl at gmail.com  Wed Jul  2 19:52:14 2008
From: pip88nl at gmail.com (Pippijn van Steenhoven)
Date: Thu, 3 Jul 2008 01:52:14 +0200
Subject: [Aldor-l] Code audit
In-Reply-To: <alpine.OSX.1.00.0806301042200.272@david-caspersons-computer.local>
References: <8c584a860806241332o6c6d8abfk19e2735f3c6af936@mail.gmail.com>
	<20080628174625.GA5250@osiris.xinutec.org>
	<alpine.OSX.1.00.0806301042200.272@david-caspersons-computer.local>
Message-ID: <20080702235214.GA17569@osiris.xinutec.org>

On Mon, Jun 30, 2008 at 10:47:51AM -0700, David Casperson wrote:
> buffer points at, just the buffer itself.  This matches
> bufCapture, which does not copy the ``String s'', just makes a
> buffer that points at it.
>
> Does this seem right?

It seems right, but in some cases (dgCycleError, dgOrderError), the
buffer is created with bufNew, not bufCapture. Your explanation of
"memory leak is okay on error paths" is not really what I'm looking for.
As I explained on my website, the Aldor GC performs best if memory is
manually returned to the allocator. Am I missing anything here? Is
bufLiberate really the right thing even in these functions?

-- 
Pippijn van Steenhoven
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://aldor.org/pipermail/aldor-l_aldor.org/attachments/20080703/7a5fbaea/attachment.bin 

From casper at unbc.ca  Wed Jul  2 20:19:17 2008
From: casper at unbc.ca (David Casperson)
Date: Wed, 2 Jul 2008 17:19:17 -0700 (PDT)
Subject: [Aldor-l] Code audit
In-Reply-To: <20080702235214.GA17569@osiris.xinutec.org>
References: <8c584a860806241332o6c6d8abfk19e2735f3c6af936@mail.gmail.com>
	<20080628174625.GA5250@osiris.xinutec.org>
	<alpine.OSX.1.00.0806301042200.272@david-caspersons-computer.local>
	<20080702235214.GA17569@osiris.xinutec.org>
Message-ID: <alpine.OSX.1.00.0807021708326.299@david-caspersons-computer.local>

Pippijn, you wrote:

> On Mon, Jun 30, 2008 at 10:47:51AM -0700, David Casperson wrote:
> > buffer points at, just the buffer itself.  This matches
> > bufCapture, which does not copy the ``String s'', just makes a
> > buffer that points at it.
> >
> > Does this seem right?
> 
> It seems right, but in some cases (dgCycleError, dgOrderError), the
> buffer is created with bufNew, not bufCapture. Your explanation of
> "memory leak is okay on error paths" is not really what I'm looking for.
> As I explained on my website, the Aldor GC performs best if memory is
> manually returned to the allocator. Am I missing anything here? Is
> bufLiberate really the right thing even in these functions?


The code in dgCycleError and dgOrderError looks erroneous to me,
as it appears to not free the string contents of the buffer.

Stephen, Laurentiu ?


David
-- 
Dr. David Casperson, Assistant Professor     |  casper at unbc.ca
Department of Computer Science               |  (250)   960-6672 Fax 960-5544
College of Science and Management            |  3333 University Way
University of Northern British Columbia      |  Prince George, BC   V2N 4Z9
                                              |  CANADA



From gdr at integrable-solutions.net  Thu Jul  3 12:18:49 2008
From: gdr at integrable-solutions.net (Gabriel Dos Reis)
Date: Thu, 3 Jul 2008 11:18:49 -0500
Subject: [Aldor-l] [open-axiom-devel] [#428] 'Domain' in 'SetCategory'?
In-Reply-To: <fbcd16d40806181006v2fd89702r6e7b310fc777bfba@mail.gmail.com>
References: <20080617145633-0700@axiom-wiki.newsynthesis.org>
	<4858B619.6060003@hemmecke.de>
	<fbcd16d40806180338k7434d913k6eadfaa2416dc826@mail.gmail.com>
	<4858EADF.70701@hemmecke.de>
	<fbcd16d40806180437h34a2b465i6894b58c264b7025@mail.gmail.com>
	<4858F72E.5010903@hemmecke.de>
	<fbcd16d40806181006v2fd89702r6e7b310fc777bfba@mail.gmail.com>
Message-ID: <206fcf960807030918q615ea18dw10411f17c8fc3e89@mail.gmail.com>

On Wed, Jun 18, 2008 at 12:06 PM, Bill Page <bill.page at newsynthesis.org> wrote:
> On Wed, Jun 18, 2008 at 7:53 AM, Ralf Hemmecke wrote:
>> On 06/18/2008 01:37 PM, Bill Page wrote:
>>>
>>> On 6/18/08, Ralf Hemmecke wrote:
>>>>
>>>> ...
>>>> Bill Page wrote:
>>>>>
>>>>> That category that plays this role in Axiom is called Type
>>>>> (1) -> )sh Type
>>>>>  Type  is a category constructor
>>>>
>>>> Hmmm, maybe I mix again Aldor and SPAD...
>>>>
>>>> See section 7.7 AUG:
>>>> Type: A type S satisfies the language-defined type Type if S is
>>>> the type of a domain or category. In other words, all domains
>>>> and categories are types.
>>>>
>>>> Is this really different for SPAD? (I am not saying anything about
>>>> the interpreter.)
>>>
>>> No, I think it is the same. Both domains and categories satisfy
>>> Type, e.g.
>>>
>>> (1) -> SetCategory has Type
>>>
>>>   (1)  true
>>>                                                       Type: Boolean
>>> (2) -> Integer has Type
>>>
>>>   (2)  true
>>>                                                       Type: Boolean
>>
>> See AUG page 96:
>>
>> Has expressions
>> A "has" expression has the following form:
>>    dom has cat
>> where dom is a domain-valued expression, and cat is a category-valued
>> expression.
>>
>> So at least "has" is different in the Axiom interpreter or in SPAD.
>>
>
> You are right, there is a difference between Aldor and OpenAxiom. In
> Aldor Type is not a category - it is a domain!

Yes.  The fact that `Type' is a category, but not a domain is something that
OpenAxiom inherits form the base AXIOM system.  On many occasions
I've found it a blessing and a curse.

It is annoying when your realize that OpenAxiom can correctly evaluate
[Ring, Integer] as a List Type, but will not be able to print it correctly.
The reason being that Type is a category, therefore does not know
(yet) how to print itself, i.e. the query

    Type has CoercibleTo OutputForm

is meaningless.

-- Gaby


From bill.page at newsynthesis.org  Thu Jul  3 22:47:55 2008
From: bill.page at newsynthesis.org (Bill Page)
Date: Thu, 3 Jul 2008 22:47:55 -0400
Subject: [Aldor-l] [open-axiom-devel] [#428] 'Domain' in 'SetCategory'?
In-Reply-To: <206fcf960807030918q615ea18dw10411f17c8fc3e89@mail.gmail.com>
References: <20080617145633-0700@axiom-wiki.newsynthesis.org>
	<4858B619.6060003@hemmecke.de>
	<fbcd16d40806180338k7434d913k6eadfaa2416dc826@mail.gmail.com>
	<4858EADF.70701@hemmecke.de>
	<fbcd16d40806180437h34a2b465i6894b58c264b7025@mail.gmail.com>
	<4858F72E.5010903@hemmecke.de>
	<fbcd16d40806181006v2fd89702r6e7b310fc777bfba@mail.gmail.com>
	<206fcf960807030918q615ea18dw10411f17c8fc3e89@mail.gmail.com>
Message-ID: <fbcd16d40807031947w23d29b47ld1dbef71ba436e87@mail.gmail.com>

On Thu, Jul 3, 2008 at 12:18 PM, Gabriel Dos Reis wrote:
> ...
>> Bill Page wrote:
>> You are right, there is a difference between Aldor and OpenAxiom.
>> In Aldor Type is not a category - it is a domain!
>
> Yes.  The fact that `Type' is a category, but not a domain is something
> that OpenAxiom inherits form the base AXIOM system.  On many
> occasions I've found it a blessing and a curse.
>

It is not clear to me when it might be a blessing... :-) As I see it,
the main purpose of a category in OpenAxiom is to stand for some
mathematical (or datastructure-like) concept. Usually these also
correspond to some recognizable "category" in the mathematical sense,
e.g. Ring. But what concept is represented by the category Type? (A
possible answer is provided by Saul Yousseph, but I do not think that
was the original intention of the design of Axiom.)

There is a related problem with the definition of the domain
'Category' - is it a domain or a category?

Earler in this thread I gave the example:

(3) -> x := IntegerNumberSystem

  (3)  IntegerNumberSystem
                                                    Type: Category

but this fails:

(4) -> x:Category := IntegerNumberSystem

  Category is a category, not a domain, and declarations require
     domains.

and one can also write:

(4) -> Integer has Category

  (4)  true
                                               Type: Boolean

But we find:

(5) -> I:Type := IntegerNumberSystem

   Type is a category, not a domain, and declarations require domains.

(5) -> I:Domain := IntegerNumberSystem

   (5)  IntegerNumberSystem
                                                Type: Category


> It is annoying when your realize that OpenAxiom can correctly
> evaluate [Ring, Integer] as a List Type, but will not be able to print
> it correctly. The reason being that Type is a category, therefore does
> not know (yet) how to print itself,

Yes. As a category Type can have no exports.

> i.e. the query
>
>    Type has CoercibleTo OutputForm
>
> is meaningless.
>

Yes. But as I understand it, in Axiom (OpenAxiom?) 'has' has two meanings

     x has y

is true if 1) domain 'x' satisfies category (or property) 'y' or 2) if
category 'x' is a subset of category 'y'.

Under the second interpretation 'Type has x' is necessarily false for
any category 'x' not identical to 'Type'. Similarly,

    x has Type

is necessarily true if it is defined at all.

-----------

I think the way out of this mess was correctly identified by Stephen
Watt in the description of Aldor when he wrote: (ibid.):

"Each domain is itself a value belonging to the domain Type. Domains
may additionally belong to some number of subtypes (of Type), known as
categories."

I.e. 'Type' is a Domain. Categories are subtypes of Type, but as such
Type (being itself a subtype of Type) is also a category unless we
consider only proper subtypes.

In OpenAxiom we now have the domain named 'Domain' so we should be
able to say: "Each domain is itself a value belonging to the domain
'Domain'. Categories are sub-domains of 'Domain'. Then 'Type' is just
Domain as a whole considered as a category."

'Domain' is a domain, but are sub-domains of domain also domains? So
again, what is Category?

For example IntegerNumberSystem is a category. Right now OpenAxiom says:

(1) -> I:=Integer

   (1)  Integer
                                                   Type: Domain

(2) -> x:=IntegerNumberSystem

   (2)  IntegerNumberSystem
                                                   Type: Category

But in FriCAS (and Axiom), we still get:

(1) -> I:=Integer

   (1)  Integer
                                                   Type: Domain

(2) -> x:=IntegerNumberSystem

   (2)  IntegerNumberSystem
                                   Type: SubDomain Domain

------

which I guess is technically correct, unfortunately 'Domain' and
'SubDomain' where never defined as domain constructors in either Axiom
or FriCAS. OpenAxiom corrected that problem but it introduced
'Category' as a domain (sometimes) instead of defining 'SubDomain'.

I guess I am still a little confused about all of this. :-)

Regards,
Bill Page.


From ralf at hemmecke.de  Fri Jul  4 18:06:21 2008
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Sat, 05 Jul 2008 00:06:21 +0200
Subject: [Aldor-l] [open-axiom-devel] [#428] 'Domain' in 'SetCategory'?
In-Reply-To: <fbcd16d40807041417rf689a7r24f2b3779b933aa7@mail.gmail.com>
References: <20080617145633-0700@axiom-wiki.newsynthesis.org>	<4858EADF.70701@hemmecke.de>	<fbcd16d40806180437h34a2b465i6894b58c264b7025@mail.gmail.com>	<4858F72E.5010903@hemmecke.de>	<fbcd16d40806181006v2fd89702r6e7b310fc777bfba@mail.gmail.com>	<206fcf960807030918q615ea18dw10411f17c8fc3e89@mail.gmail.com>	<fbcd16d40807031947w23d29b47ld1dbef71ba436e87@mail.gmail.com>	<87tzf53mjh.fsf_-_@gauss.cs.tamu.edu>	<fbcd16d40807041034o949558dn7c13a45a2138fa08@mail.gmail.com>	<87hcb5ikce.fsf@gauss.cs.tamu.edu>
	<fbcd16d40807041417rf689a7r24f2b3779b933aa7@mail.gmail.com>
Message-ID: <486E9EDD.7000802@hemmecke.de>

> | > | I think the way out of this mess was correctly identified by Stephen
> | > | Watt in the description of Aldor when he wrote: (ibid.):
> | > |
> | > | "Each domain is itself a value belonging to the domain Type. Domains
> | > | may additionally belong to some number of subtypes (of Type), known
> | > | as categories."
>> ...
>> Nothing in the semantics specification (the quote above without the
>> first sentence) requires Type to be a domain.

> I agree.

Yep.

I have no proof of it, but in my understanding Type is the type of all 
Aldor types including itself. Type lives conceptually above domains and 
categories. Maybe 'Type' is comparable to 'the class of all classes' in 
set theory (even if NBG
http://en.wikipedia.org/wiki/Von_Neumann%E2%80%93Bernays%E2%80%93G%C3%B6del_set_theory
does not admit it).

I know it proves nothing, but have you looked at a comment in
https://svn.origo.ethz.ch/algebraist/trunk/aldor/lib/aldor/src/lang/sal_lang.as
where it says?

-- Nice idea, but rejected by the compiler
-- Type:Category == add;

(Just a funny side remark.)

For me 'Category' and 'Type' are somewhat special.
Let me define as Saul Youssef did in Section 2 of 
http://axiom-portal.newsynthesis.org/refs/articles/Youssef-ProspectsForCategoryTheoryInAldor.pdf

   Domain: Category == with;

then I would (roughly) say that

   Type = Category + Domain + {Type}

i.e. Type comprises all categories, all domains and itself. The constant 
'Category' (which is a keyword) is on the same level as 'Type' but with 
less inhabitants than 'Type'.

Forgive me if anything is wrong, I am not a language expert.

Ralf


From daly at axiom-developer.org  Fri Jul  4 20:07:53 2008
From: daly at axiom-developer.org (root)
Date: Fri, 4 Jul 2008 20:07:53 -0400
Subject: [Aldor-l] [open-axiom-devel] [#428] 'Domain' in 'SetCategory'?
In-Reply-To: <486E9EDD.7000802@hemmecke.de> (message from Ralf Hemmecke on
	Sat, 05 Jul 2008 00:06:21 +0200)
References: <20080617145633-0700@axiom-wiki.newsynthesis.org>	<4858EADF.70701@hemmecke.de>	<fbcd16d40806180437h34a2b465i6894b58c264b7025@mail.gmail.com>	<4858F72E.5010903@hemmecke.de>	<fbcd16d40806181006v2fd89702r6e7b310fc777bfba@mail.gmail.com>	<206fcf960807030918q615ea18dw10411f17c8fc3e89@mail.gmail.com>	<fbcd16d40807031947w23d29b47ld1dbef71ba436e87@mail.gmail.com>	<87tzf53mjh.fsf_-_@gauss.cs.tamu.edu>	<fbcd16d40807041034o949558dn7c13a45a2138fa08@mail.gmail.com>	<87hcb5ikce.fsf@gauss.cs.tamu.edu>
	<fbcd16d40807041417rf689a7r24f2b3779b933aa7@mail.gmail.com>
	<486E9EDD.7000802@hemmecke.de>
Message-ID: <200807050007.m6507rw22464@localhost.localdomain>

>> | > | I think the way out of this mess was correctly identified by Stephen
>> | > | Watt in the description of Aldor when he wrote: (ibid.):
>> | > |
>> | > | "Each domain is itself a value belonging to the domain Type. Domains
>> | > | may additionally belong to some number of subtypes (of Type), known
>> | > | as categories."
>>> ...
>>> Nothing in the semantics specification (the quote above without the
>>> first sentence) requires Type to be a domain.
>
>> I agree.
>
>Yep.
>
>I have no proof of it, but in my understanding Type is the type of all 
>Aldor types including itself. Type lives conceptually above domains and 
>categories. Maybe 'Type' is comparable to 'the class of all classes' in 
>set theory (even if NBG



I think part of the struggle is the attempt to unify the ideas of
type theory with the ideas of category theory. Being able to do so
would be deeply interesting but I don't think there is a "correct"
way to do it in any theoretical sense. It seems more of a pragmatic
choice. 

>From a computational point of view, categories and domains are just
type objects. There is no obvious reason why categories could not
include methods, although the methods might be restricted to functors
from domain to domain, or predicates to test that domains which claim
to belong to the category actually do satisfy some tests (e.g. that
the domain exports the required signatures and has the required
properties, like commutativity). Types do not need to know properties
of categories or domains.

>From a mathematical point of view, Categories and domains can be
constructed without types, although to do so would end up with a very
different system than Axiom. The design decision to use types to
enforce the category/domain machinery is not a necessary design
choice, although it is rather convenient. Someone could describe type
theory using category theory but I haven't seen it.

So from a programming viewpoint, types certainly include categories
and domains (since they are objects with representation and methods).
>From a mathematical point of view, types are convenient but unnecessary
to support the category/domain hierarchy which can all be built with
things, arrows, and composition.

So, within Axiom's design, types include categories/domains but not
the other way around.

Ultimately it seems just a design decision based on expected behavior,
so that the interaction between the type theory and the category
theory aspects gives reasonable results.

Tim


From bill.page at newsynthesis.org  Fri Jul  4 19:49:33 2008
From: bill.page at newsynthesis.org (Bill Page)
Date: Fri, 4 Jul 2008 19:49:33 -0400
Subject: [Aldor-l] [open-axiom-devel] [#428] 'Domain' in 'SetCategory'?
In-Reply-To: <486E9EDD.7000802@hemmecke.de>
References: <20080617145633-0700@axiom-wiki.newsynthesis.org>
	<4858F72E.5010903@hemmecke.de>
	<fbcd16d40806181006v2fd89702r6e7b310fc777bfba@mail.gmail.com>
	<206fcf960807030918q615ea18dw10411f17c8fc3e89@mail.gmail.com>
	<fbcd16d40807031947w23d29b47ld1dbef71ba436e87@mail.gmail.com>
	<87tzf53mjh.fsf_-_@gauss.cs.tamu.edu>
	<fbcd16d40807041034o949558dn7c13a45a2138fa08@mail.gmail.com>
	<87hcb5ikce.fsf@gauss.cs.tamu.edu>
	<fbcd16d40807041417rf689a7r24f2b3779b933aa7@mail.gmail.com>
	<486E9EDD.7000802@hemmecke.de>
Message-ID: <fbcd16d40807041649v30f5cf86ka3641261747f2607@mail.gmail.com>

On Fri, Jul 4, 2008 at 6:06 PM, Ralf Hemmecke wrote:
> ...
> I have no proof of it, but in my understanding Type is the type of
> all Aldor types including itself. Type lives conceptually above
> domains and categories. Maybe 'Type' is comparable to
> 'the class of all classes' in set theory (even if NBG
> http://en.wikipedia.org/wiki/Von_Neumann%E2%80%93Bernays%E2%80%93G%C3%B6del_set_theory
> does not admit it).
>

Since there is no requirement that a Type be a classical set, I would
strongly prefer to let Type simply be non-well-founded in the sense of
http://en.wikipedia.org/wiki/Non-well-founded_set_theory

> ...
> For me 'Category' and 'Type' are somewhat special.
> Let me define as Saul Youssef did in Section 2 of
> http://axiom-portal.newsynthesis.org/refs/articles/Youssef-ProspectsForCategoryTheoryInAldor.pdf
>
>  Domain: Category == with;
>

I don't have any problems with defining a category of this sort for
specific purposes. In fact such categories are called "properties" in
all flavors of Axiom.

> then I would (roughly) say that
>
>  Type = Category + Domain + {Type}
>
> i.e. Type comprises all categories, all domains and itself. The constant
> 'Category' (which is a keyword) is on the same level as 'Type' but with
> less inhabitants than 'Type'.
>

I don't like this much since it seem to conflict with the actual usage
of these terms in both Axiom and Alsor.

> Forgive me if anything is wrong, I am not a language expert.

Well Ralf, I think you qualify as much as an "expert" as anyone else
here... :-) Thanks for contributing to the discussion.

Regards,
Bill Page.


From carette at mcmaster.ca  Fri Jul  4 21:03:36 2008
From: carette at mcmaster.ca (Jacques Carette)
Date: Fri, 04 Jul 2008 21:03:36 -0400
Subject: [Aldor-l] [open-axiom-devel] [#428] 'Domain' in 'SetCategory'?
In-Reply-To: <200807050007.m6507rw22464@localhost.localdomain>
References: <20080617145633-0700@axiom-wiki.newsynthesis.org>	<4858EADF.70701@hemmecke.de>	<fbcd16d40806180437h34a2b465i6894b58c264b7025@mail.gmail.com>	<4858F72E.5010903@hemmecke.de>	<fbcd16d40806181006v2fd89702r6e7b310fc777bfba@mail.gmail.com>	<206fcf960807030918q615ea18dw10411f17c8fc3e89@mail.gmail.com>	<fbcd16d40807031947w23d29b47ld1dbef71ba436e87@mail.gmail.com>	<87tzf53mjh.fsf_-_@gauss.cs.tamu.edu>	<fbcd16d40807041034o949558dn7c13a45a2138fa08@mail.gmail.com>	<87hcb5ikce.fsf@gauss.cs.tamu.edu>	<fbcd16d40807041417rf689a7r24f2b3779b933aa7@mail.gmail.com>	<486E9EDD.7000802@hemmecke.de>
	<200807050007.m6507rw22464@localhost.localdomain>
Message-ID: <486EC868.8090108@mcmaster.ca>

root wrote:
> I think part of the struggle is the attempt to unify the ideas of
> type theory with the ideas of category theory. Being able to do so
> would be deeply interesting but I don't think there is a "correct"
> way to do it in any theoretical sense. 
Sure there is - read Bart Jacobs's book "Categorical Logic and Type 
Theory".

Jacques


From ralf at hemmecke.de  Sat Jul  5 02:38:16 2008
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Sat, 05 Jul 2008 08:38:16 +0200
Subject: [Aldor-l] [open-axiom-devel] [#428] 'Domain' in 'SetCategory'?
In-Reply-To: <fbcd16d40807041649v30f5cf86ka3641261747f2607@mail.gmail.com>
References: <20080617145633-0700@axiom-wiki.newsynthesis.org>	
	<4858F72E.5010903@hemmecke.de>	
	<fbcd16d40806181006v2fd89702r6e7b310fc777bfba@mail.gmail.com>	
	<206fcf960807030918q615ea18dw10411f17c8fc3e89@mail.gmail.com>	
	<fbcd16d40807031947w23d29b47ld1dbef71ba436e87@mail.gmail.com>	
	<87tzf53mjh.fsf_-_@gauss.cs.tamu.edu>	
	<fbcd16d40807041034o949558dn7c13a45a2138fa08@mail.gmail.com>	
	<87hcb5ikce.fsf@gauss.cs.tamu.edu>	
	<fbcd16d40807041417rf689a7r24f2b3779b933aa7@mail.gmail.com>	
	<486E9EDD.7000802@hemmecke.de>
	<fbcd16d40807041649v30f5cf86ka3641261747f2607@mail.gmail.com>
Message-ID: <486F16D8.9030400@hemmecke.de>

>> For me 'Category' and 'Type' are somewhat special.
>> Let me define as Saul Youssef did in Section 2 of
>> http://axiom-portal.newsynthesis.org/refs/articles/Youssef-ProspectsForCategoryTheoryInAldor.pdf
>>
>>  Domain: Category == with;
>>
> 
> I don't have any problems with defining a category of this sort for
> specific purposes. In fact such categories are called "properties" in
> all flavors of Axiom.
> 
>> then I would (roughly) say that
>>
>>  Type = Category + Domain + {Type}
>>
>> i.e. Type comprises all categories, all domains and itself. The constant
>> 'Category' (which is a keyword) is on the same level as 'Type' but with
>> less inhabitants than 'Type'.
>>
> 
> I don't like this much since it seem to conflict with the actual usage
> of these terms in both Axiom and Alsor.

Why do you see a conflict here? Is, what I say, not what Doye says in
Section 2.5 of 
http://axiom-portal.newsynthesis.org/refs/articles/doye-aldor-phd.pdf/?searchterm=doye
?

items \in Domains \in Categories \in Category

where in my notation above "Domain" should just be considered the top of 
the category hierarchy. (Actually, the top is "with", I just named it 
"Domain").

Is OpenAxiom going to somehow blur the distinction between categories 
and domains?

I understand that it would be nice to really use categories as first 
class objects, but that does not mean that they must be considered as 
domains. Or does it?

Does http://axiom-portal.newsynthesis.org/refs/articles/define.pdf have 
something to do with your discussion?

Ralf


From ralf at hemmecke.de  Sat Jul  5 05:58:44 2008
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Sat, 05 Jul 2008 11:58:44 +0200
Subject: [Aldor-l] with issue
Message-ID: <486F45D4.5050609@hemmecke.de>

Hi Peter, hi Stephen

I remember that long time ago I was told that an instance where

   A with B

behaves different from

   with {A; B}

is a bug.

What would you say about the following?

---BEGIN aaa.as
#include "aldor"
A: with == add;
Cat: Category == with;
Cat2: Category == with;
extend IntegerSegment(Z: IntegerType) : with {
	Cat with {Cat2; foo: A -> A};
} == add {foo(a: A): A == a;}
---END aaa.as

Compiling with

   aldor aaa.as

results in

"aaa.as", line 5: extend IntegerSegment(Z: IntegerType) : with {
                   .............................................^
[L5 C46] #1 (Error) Improper form appearing in `with' statement.

Well, of course in that case it is easy to fix the sources, but the 
question is whether the above program should be considered a well-formed 
Aldor program. Is it?

Ralf


From ralf at hemmecke.de  Sat Jul  5 11:36:48 2008
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Sat, 05 Jul 2008 17:36:48 +0200
Subject: [Aldor-l] with issue
In-Reply-To: <73691350807050823t1f13f5f0j2ec1f0a476ce2d26@mail.gmail.com>
References: <486F45D4.5050609@hemmecke.de>
	<73691350807050823t1f13f5f0j2ec1f0a476ce2d26@mail.gmail.com>
Message-ID: <486F9510.6000403@hemmecke.de>

On 07/05/2008 05:23 PM, Peter Broadbery wrote:
> On Sat, Jul 5, 2008 at 10:58 AM, Ralf Hemmecke <ralf at hemmecke.de> wrote:
>> Hi Peter, hi Stephen
>>
>> I remember that long time ago I was told that an instance where
>>
>>  A with B
>>
>> behaves different from
>>
>>  with {A; B}
>>
>> is a bug.
>>
>> What would you say about the following?
>>
>> ---BEGIN aaa.as
>> #include "aldor"
>> A: with == add;
>> Cat: Category == with;
>> Cat2: Category == with;
>> extend IntegerSegment(Z: IntegerType) : with {
>>        Cat with {Cat2; foo: A -> A};
>> } == add {foo(a: A): A == a;}
>> ---END aaa.as
>>
>> Compiling with
>>
>>  aldor aaa.as
>>
>> results in
>>
>> "aaa.as", line 5: extend IntegerSegment(Z: IntegerType) : with {
>>                  .............................................^
>> [L5 C46] #1 (Error) Improper form appearing in `with' statement.
>>
>> Well, of course in that case it is easy to fix the sources, but the question
>> is whether the above program should be considered a well-formed Aldor
>> program. Is it?
>>
>> Ralf

> I don't think '(with C) with X' work gets through the parser either
> (not in a position to check it at the moment), so it's consistent.
> Given the parser refuses to look at the first one, making them both
> work might well be a problem.

Ooops, I would have thought, my code parses as

(*)   with (Cat with {Cat2; foo: A -> A})

instead of

(+)   (with Cat) with {Cat2; foo: A -> A}

as you see it. Why are the braces for, then?
Shouldn't they group together a sequence of statements and consider them 
basically as one statement? So (*) should apply and not (+). Where is my 
thinking error?

Ralf


From bill.page at newsynthesis.org  Mon Jul  7 23:05:21 2008
From: bill.page at newsynthesis.org (Bill Page)
Date: Mon, 7 Jul 2008 23:05:21 -0400
Subject: [Aldor-l] [open-axiom-devel] [#428] 'Domain' in 'SetCategory'?
In-Reply-To: <486F16D8.9030400@hemmecke.de>
References: <20080617145633-0700@axiom-wiki.newsynthesis.org>
	<206fcf960807030918q615ea18dw10411f17c8fc3e89@mail.gmail.com>
	<fbcd16d40807031947w23d29b47ld1dbef71ba436e87@mail.gmail.com>
	<87tzf53mjh.fsf_-_@gauss.cs.tamu.edu>
	<fbcd16d40807041034o949558dn7c13a45a2138fa08@mail.gmail.com>
	<87hcb5ikce.fsf@gauss.cs.tamu.edu>
	<fbcd16d40807041417rf689a7r24f2b3779b933aa7@mail.gmail.com>
	<486E9EDD.7000802@hemmecke.de>
	<fbcd16d40807041649v30f5cf86ka3641261747f2607@mail.gmail.com>
	<486F16D8.9030400@hemmecke.de>
Message-ID: <fbcd16d40807072005l1d353988jb72dcf1c22856ad5@mail.gmail.com>

On Sat, Jul 5, 2008 at 2:38 AM, Ralf Hemmecke wrote:
> ...
>>
>>> then I would (roughly) say that
>>>
>>>  Type = Category + Domain + {Type}
>>>
>>> i.e. Type comprises all categories, all domains and itself. The constant
>>> 'Category' (which is a keyword) is on the same level as 'Type' but with
>>> less inhabitants than 'Type'.
>>>

What do you mean by "'Category' which is a keyword"? Do you mean that
it is built-in? In that case I would not agree. In Aldor for example:

%1 >> #include "aldor"
                                           Comp: 60 msec, Interp: 0 msec
%2 >> #include "aldorinterp"
                                           Comp: 20 msec, Interp: 0 msec
%3 >> Category
  () @
 with
    ==  add ()

                                           Comp: 0 msec, Interp: 0 msec
%4 >> Type
  () @
 with
    ==  add ()

                                           Comp: 0 msec, Interp: 0 msec
%5 >> X:Category == with {};
                                           Comp: 0 msec, Interp: 0 msec
%6 >> Y:Category := X;
  () @ Category
                                           Comp: 0 msec, Interp: 0 msec
%7 >> x:X == add {};
Defined x @
X with
    ==  add ()

                                           Comp: 0 msec, Interp: 0 msec
%8 >> x has Y
T @ Boolean
                                           Comp: 0 msec, Interp: 0 msec
%9 >> y:Type := x;
 @ Type
                                           Comp: 0 msec, Interp: 0 msec
%10 >> z:Type := X;
 @ Type
                                           Comp: 0 msec, Interp: 10 msec
%11 >> y has Y
T @ Boolean
                                           Comp: 0 msec, Interp: 0 msec
%12 >> z has Y
T @ Boolean
                                           Comp: 0 msec, Interp: 0 msec


By "inhabitants" do you mean objects? E.g. the value of Y above?

> Bill Page wrote:
>> I don't like this much since it seems to conflict with the actual
>> usage of these terms in both Axiom and Aldor.
>
> Why do you see a conflict here? Is, what I say, not what Doye
> says in Section 2.5 of
> http://axiom-portal.newsynthesis.org/refs/articles/doye-aldor-phd.pdf/?searchterm=doye
> ?
>
> items \in Domains \in Categories \in Category
>

Perhaps it is almost ok if you include Doye's notation Obj(...) but
this ignores the concept of Categories as subtypes of Type. If 'x has
X' implies 'x has Y' for all x in Type then X is a subcategory of Y.

Between Axiom and Aldor the terminology is such a mess that it is hard
to say anything in a simple manner without defining everything from
basic principles.

For example, in Aldor 'Type' and 'Category' are domains. Objects are
related to domains by a membership relation. The objects of the domain
Type are themselves domains (of which Type is one and Category is
another). Categories are subtypes (subdomains) of Type arranged in a
lattice by the inclusion relation. The objects of the domain Category
are these subtypes of Type (categories). So it seems clear to me that
all values in Aldor are objects in some domain, i.e. there are no
"category-valued" objects at such but there are run-time objects of
the domain Category and the domain Type. Still, these objects are
treated as category values and domain values in the appropriate
context.

In Axiom (all flavors so far) Type is a category. The Axiom
interpreter automatically creates references to some types such as
'Domain', and 'SubDomain Domain' but these were not originally
included as built-in domains or domains in the Axiom library so values
of this kind could be implemented only in very limited ways.

OpenAxiom introduced Domain as a Domain consisting of all domains
(like Type in Aldor).  OpenAxiom also adds 'Category' as an
alternative to 'SubDomain Domain'. I believe that the intention of
OpenAxiom is that Category is a domain however it is not always
treated that way in the current revision.

> where in my notation above "Domain" should just be considered the top
> of the category hierarchy. (Actually, the top is "with", I just named it
> "Domain").
>

Names are significant for named categories. Categories reference other
categories by name. 'Category' is the domain of all categories. It's
objects are categories.

> Is OpenAxiom going to somehow blur the distinction between categories and
> domains?
>

If Aldor treats categories and domains as first order doesn't this
already blur the distinction? Although domains are never objects of
Category, both categories and domains are objects of Type.

> I understand that it would be nice to really use categories as first class
> objects, but that does not mean that they must be considered as domains.
> Or does it?
>

Yes, I think it does.

> Does http://axiom-portal.newsynthesis.org/refs/articles/define.pdf have
> something to do with your discussion?
>

Yes I think so, at least as far as it concerns Aldor. Kennedy's
description seems fairly complete but I think some of the comments
about Aldor may be a little out of date. I haven't checked everything
in detail but I think some of the issues raised by Kennedy may now be
resolved in the current release of Aldor. Perhaps OpenAxiom will also
be able to resolve these in the near future - perhaps in a somewhat
different way.

Regards,
Bill Page.


From ralf at hemmecke.de  Tue Jul  8 05:51:52 2008
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Tue, 08 Jul 2008 11:51:52 +0200
Subject: [Aldor-l] [open-axiom-devel] [#428] 'Domain' in 'SetCategory'?
In-Reply-To: <fbcd16d40807072005l1d353988jb72dcf1c22856ad5@mail.gmail.com>
References: <20080617145633-0700@axiom-wiki.newsynthesis.org>	
	<206fcf960807030918q615ea18dw10411f17c8fc3e89@mail.gmail.com>	
	<fbcd16d40807031947w23d29b47ld1dbef71ba436e87@mail.gmail.com>	
	<87tzf53mjh.fsf_-_@gauss.cs.tamu.edu>	
	<fbcd16d40807041034o949558dn7c13a45a2138fa08@mail.gmail.com>	
	<87hcb5ikce.fsf@gauss.cs.tamu.edu>	
	<fbcd16d40807041417rf689a7r24f2b3779b933aa7@mail.gmail.com>	
	<486E9EDD.7000802@hemmecke.de>	
	<fbcd16d40807041649v30f5cf86ka3641261747f2607@mail.gmail.com>	
	<486F16D8.9030400@hemmecke.de>
	<fbcd16d40807072005l1d353988jb72dcf1c22856ad5@mail.gmail.com>
Message-ID: <487338B8.9010308@hemmecke.de>

Dear Stephen,

could you clarify (***)? Thank you.

On 07/08/2008 05:05 AM, Bill Page wrote:
> On Sat, Jul 5, 2008 at 2:38 AM, Ralf Hemmecke wrote:
>> ...
>>>> then I would (roughly) say that
>>>>
>>>>  Type = Category + Domain + {Type}
>>>>
>>>> i.e. Type comprises all categories, all domains and itself. The constant
>>>> 'Category' (which is a keyword) is on the same level as 'Type' but with
>>>> less inhabitants than 'Type'.

> What do you mean by "'Category' which is a keyword"? Do you mean that
> it is built-in?

Of course, Category is built-in. That there is a definition like

Category: with == add;

in sal_lang.as does not say that it is not built-in. Also Boolean is 
built-in. And still the Aldor compiler *requires* a definition like

Boolean: with == add;

since otherwise it will not work properly. Don't ask me why the 
designers of the Aldor compiler did it in such a way that something like 
sal_lang.as is required to compile anything useful at all.

The meaning of "Category" is as in Doye's thesis.

(Section 2.5 of 
http://axiom-portal.newsynthesis.org/refs/articles/doye-aldor-phd.pdf/?searchterm=doye)

 > In that case I would not agree. In Aldor for example:
> 
> %1 >> #include "aldor"
>                                            Comp: 60 msec, Interp: 0 msec
> %2 >> #include "aldorinterp"
>                                            Comp: 20 msec, Interp: 0 msec
> %3 >> Category
>   () @
>  with
>     ==  add ()
> 
>                                            Comp: 0 msec, Interp: 0 msec
> %4 >> Type
>   () @
>  with
>     ==  add ()

Well that is as the definition in sal_lang.as, but still there is 
special treatment for them inside the compiler. And I don't think that 
output proves anything.

Aldor does also allow me to compile

---BEGIN aaa.as
#include "aldor"
extend Category: with {foo: () -> Integer} == add {foo(): Integer == 1}
-- import from Character, Integer, TextWriter;
-- stdout << foo()$Category << newline;
---END aaa.as

the only problem I have with that is that I don't know how to interpret 
it. In fact, I have the suspicion that the "Category" that prints like 
"with==add" is actually not usable at all. Uncomment the lines above and try

   aldor -fx aaa.as

My version of the compiler tells me

"aaa.as", line 4: stdout << foo()$Category << newline;
                   ...............^
[L4 C16] #1 (Error) There are no suitable meanings for the operator 
`foo$Category'.

If Category really were treated as a domain that should not happen.
I just think that a user should actually never see sal_lang.as, because 
it is misleading.

> %5 >> X:Category == with {};

> %6 >> Y:Category := X;
>   () @ Category

Fine. And Y is, of course not any different from X ...
> %7 >> x:X == add {};
> Defined x @
> X with
>     ==  add ()

> %8 >> x has Y
> T @ Boolean

... therefore that is OK, too.

> %9 >> y:Type := x;
>  @ Type

As you have defined it, x is a domain and thus a type, i.e. something of 
type Type. So that is also OK.

> %10 >> z:Type := X;
>  @ Type

As you have defined it, X is a category and thus of type Type. Also OK.

> %11 >> y has Y
> T @ Boolean

We had that discussion before (and actually also at the Aldor Workshop 
2007). Formerly I would have said that should give false. But as Stephen 
explained it should give true.

> %12 >> z has Y
> T @ Boolean

(***)
This should be considered a bug. z is a category, so the compiler is 
fooled by the definition of z: Type == X.

Hmm, maybe it's a feature and one can cure the problem with "has" in the 
definition of "List".

> By "inhabitants" do you mean objects? E.g. the value of Y above?

Actually, "object" doesn't say anything. But yes, I consider Y an 
"inhabitant" of Category, because Y: Category. And I would also consider 
Y an inhabitant of Type even though you have not explicitly said Y: 
Type. But any type in Aldor is of type Type.

>> Bill Page wrote:
>>> I don't like this much since it seems to conflict with the actual
>>> usage of these terms in both Axiom and Aldor.
>> Why do you see a conflict here? Is, what I say, not what Doye
>> says in Section 2.5 of
>> http://axiom-portal.newsynthesis.org/refs/articles/doye-aldor-phd.pdf/?searchterm=doye
>> ?
>>
>> items \in Domains \in Categories \in Category

> Perhaps it is almost ok if you include Doye's notation Obj(...)

I have no problem with that.

> but this ignores the concept of Categories as subtypes of Type.

> If 'x has X' implies 'x has Y' for all x in Type then X is a subcategory of Y.

Where do you see a problem here? Which "has" is it? In Aldor you must a 
domain in front of "has" and a category behind. You only get problems if 
you consider Type to be a domain and accept (the bug) that "z has Y" 
should give true.

> Between Axiom and Aldor the terminology is such a mess that it is hard
> to say anything in a simple manner without defining everything from
> basic principles.

Maybe we should start writing Aldor-has, OpenAxiom-has, etc. 
Aldor-Category, OpenAxiom-Category. ;-) at least it would clarify a bit 
more.

> For example, in Aldor 'Type' and 'Category' are domains.

Sorry, I don't agree. Where have you found that in the AUG? I don't 
accept compiler output as an argument.

> Objects are
> related to domains by a membership relation. The objects of the domain
> Type are themselves domains (of which Type is one and Category is
> another). Categories are subtypes (subdomains) of Type arranged in a
> lattice by the inclusion relation. The objects of the domain Category
> are these subtypes of Type (categories).

Bill, could you give exact AUG page references for this?

> So it seems clear to me that
> all values in Aldor are objects in some domain, i.e. there are no
> "category-valued" objects at such but there are run-time objects of
> the domain Category and the domain Type. Still, these objects are
> treated as category values and domain values in the appropriate
> context.

Sorry, I don't understand that.

> In Axiom (all flavors so far) Type is a category.

Reference to such a definition?

> The Axiom
> interpreter automatically creates references to some types such as
> 'Domain', and 'SubDomain Domain' but these were not originally
> included as built-in domains or domains in the Axiom library so values
> of this kind could be implemented only in very limited ways.
> 
> OpenAxiom introduced Domain as a Domain consisting of all domains
> (like Type in Aldor).

In my opinion, categories in Aldor are not domains. So I don't agree 
with "like Type in Aldor", because Type comprises domains and categories.

> OpenAxiom also adds 'Category' as an alternative to 'SubDomain Domain'.

Really? Gaby, does that mean that in OpenAxiom a category is 
(conceptually) a domain? I don't speak of implementation details here. 
That one can (perhaps) implement categories and domains (by the latter I 
mean the collection of all things of type C where C is any category) by 
the same data structure and find a common name for that data structure. 
But I would find it confusing if that concept is also called "domain".

Gaby, what do you consider to be a domain? Such a data structure concept 
or simply something that has a category as its type?

> I believe that the intention of
> OpenAxiom is that Category is a domain however it is not always
> treated that way in the current revision.

Again, that is confusing to me. Is it possible to choose some other name 
for that? "domain" should not be as meaningless as object is nowadays.

>> where in my notation above "Domain" should just be considered the top
>> of the category hierarchy. (Actually, the top is "with", I just named it
>> "Domain").

> Names are significant for named categories. Categories reference other
> categories by name. 'Category' is the domain of all categories. It's
> objects are categories.

If you had written "'Category' is the class of all categories.", I would 
relax. But you used "domain" and that confuses me.

>> Is OpenAxiom going to somehow blur the distinction between categories and
>> domains?

> If Aldor treats categories and domains as first order doesn't this
> already blur the distinction?

Not for me.

> Although domains are never objects of Category, both categories and
 > domains are objects of Type.

There is no problem with that. Or do you see one?

>> I understand that it would be nice to really use categories as first class
>> objects, but that does not mean that they must be considered as domains.
>> Or does it?

> Yes, I think it does.

No, it doesn't. What you want, is that categories and domains (by the 
latter I mean the collection of all things of type C where C is any 
category) are treated in the same way (first class objects). So that is 
more in the sense of a common data structure that I mentioned above. I 
have no problem with that common treatment, but please don't call it 
"domain". Maybe call it "class" or "magma" or whatever, but not "domain".

Let us clarify. I have started with my definitions on

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

Add yours.

Ralf


From bill.page at newsynthesis.org  Tue Jul  8 14:00:54 2008
From: bill.page at newsynthesis.org (Bill Page)
Date: Tue, 8 Jul 2008 14:00:54 -0400
Subject: [Aldor-l] [open-axiom-devel] [#428] 'Domain' in 'SetCategory'?
In-Reply-To: <487338B8.9010308@hemmecke.de>
References: <20080617145633-0700@axiom-wiki.newsynthesis.org>
	<87tzf53mjh.fsf_-_@gauss.cs.tamu.edu>
	<fbcd16d40807041034o949558dn7c13a45a2138fa08@mail.gmail.com>
	<87hcb5ikce.fsf@gauss.cs.tamu.edu>
	<fbcd16d40807041417rf689a7r24f2b3779b933aa7@mail.gmail.com>
	<486E9EDD.7000802@hemmecke.de>
	<fbcd16d40807041649v30f5cf86ka3641261747f2607@mail.gmail.com>
	<486F16D8.9030400@hemmecke.de>
	<fbcd16d40807072005l1d353988jb72dcf1c22856ad5@mail.gmail.com>
	<487338B8.9010308@hemmecke.de>
Message-ID: <fbcd16d40807081100i75d1e347n645edfbc68af028b@mail.gmail.com>

On Tue, Jul 8, 2008 at 5:51 AM, Ralf Hemmecke wrote:
> On 07/08/2008 05:05 AM, Bill Page wrote:
>
> Of course, Category is built-in. That there is a definition like
>
> Category: with == add;
>
> in sal_lang.as does not say that it is not built-in. Also Boolean is
> built-in. And still the Aldor compiler *requires* a definition like
>
> Boolean: with == add;
>
> since otherwise it will not work properly. Don't ask me why the designers
> of the Aldor compiler did it in such a way that something like sal_lang.as
> is required to compile anything useful at all.
>

I think I understand why. It is not unusual that that compile requires
some minimal built-in "bootstrap" assumptions about fundamental things
- just to get things started. But Aldor is designed with a bare
minimum of such built-in assumptions. Everything else is defined in
some library.

> ...
> Aldor does also allow me to compile
>
> ---BEGIN aaa.as
> #include "aldor"
> extend Category: with {foo: () -> Integer} == add {foo(): Integer == 1}
> -- import from Character, Integer, TextWriter;
> -- stdout << foo()$Category << newline;
> ---END aaa.as
>
> the only problem I have with that is that I don't know how to interpret
> it.

What is it unclear?

> In fact, I have the suspicion that the "Category" that prints like
> "with==add" is actually not usable at all. Uncomment the lines above and try
>
>  aldor -fx aaa.as
>
> My version of the compiler tells me
>
> "aaa.as", line 4: stdout << foo()$Category << newline;
>                  ...............^
> [L4 C16] #1 (Error) There are no suitable meanings for the operator
> `foo$Category'.
>
> If Category really were treated as a domain that should not happen.

Apparently this construction (extending the domain Category) was not
fully anticipated in Aldor and not fully tested. I wonder what would
happen if you modified the library containing the definition of
Category? Of course this still may not work correctly because the
compiler may be making some implicit assumptions about Category.

> I just think that a user should actually never see sal_lang.as, because
> it is misleading.
>

Perhaps there are some libraries that are closer to the system level
that would not normally be changed by a user only interested in
computer algebra. But as far as the language Aldor is concerned, a
library is a library.

> ...
>>    %5 >> X:Category == with {};
>>
> >   %6 >> Y:Category := X;
> >    () @ Category
>> ...
>> %10 >> z:Type := X;
>>  @ Type
>
> As you have defined it, X is a category and thus of type Type. Also OK.
>

But what is z? It is variable with values in the domain Type. The
objects of Type are either domains or categories.

>> %11 >> y has Y
>> T @ Boolean
>
> We had that discussion before (and actually also at the Aldor Workshop
> 2007). Formerly I would have said that should give false. But as Stephen
> explained it should give true.
>
>> %12 >> z has Y
>> T @ Boolean
>
> (***)
> This should be considered a bug. z is a category, so the compiler is
> fooled by the definition of z: Type == X.
>
> Hmm, maybe it's a feature and one can cure the problem with "has"
> in the definition of "List".
>

The Aldor Users Guide says:

  A ``has'' expression has the following form:

      dom has cat

  where dom is a domain-valued expression, and cat is a
category-valued expression.

but perhaps 'has' actually allows dom to be type-valued. So in this
case, yes I think it could cure the problem with "List Type", except
that in the current compiler one often gets: "Segmentation fault".
This I would consider definitely a bug.

>> By "inhabitants" do you mean objects? E.g. the value of Y above?
>
> Actually, "object" doesn't say anything. But yes, I consider Y an
> "inhabitant" of Category, because Y: Category. And I would also consider Y
> an inhabitant of Type even though you have not explicitly said Y: Type. But
> any type in Aldor is of type Type.
>

I think it is confusing to invent a new name like "inhabitant". Object
is fairly standard but comes from object-oriented programming. In
Aldor values do not carry any type information, so they are not
"objects" in this sense. I would agree to do what the Aldor users
guide does and use only the term "value". So your "inhabitants" and my
"objects" are just values of some type.

> ...
>> If 'x has X' implies 'x has Y' for all x in Type then X is a subcategory
>> of Y.
>
> Where do you see a problem here?

No problem. This is just the definition of subcategory.

>
>> For example, in Aldor 'Type' and 'Category' are domains.
>
> Sorry, I don't agree. Where have you found that in the AUG?

See references to AUG and to an article by Stephen Watt at:
http://axiom-wiki.newsynthesis.org/SandboxTypeDefinitions

>
>> Objects are related to domains by a membership relation. The
>> objects of the domain Type are themselves domains (of which
>> Type is one and Category is another). Categories are subtypes
>> (subdomains) of Type arranged in a lattice by the inclusion relation.
>> The objects of the domain Category are these subtypes of Type
>> (categories).
>
> Bill, could you give exact AUG page references for this?
>

Just substitute "values" where "objects" occur in the text above. I
added these definitions from AUG on the web page you created mentioned
above.

>> So it seems clear to me that all values in Aldor are objects in some
>> domain, i.e. there are no "category-valued" objects at such but there
>> are run-time objects of the domain Category and the domain Type.
>> Still, these objects are treated as category values and domain values
>> in the appropriate context.
>
> Sorry, I don't understand that.
>

So it seems clear to me that all values in Aldor are values in some
domain, i.e. there are no "category-valued" objects at such but there
are run-time values of the domain Category and the domain Type.
Still, these valuess are treated as category values and domain values
in the appropriate context.

Better?

>> In Axiom (all flavors so far) Type is a category.
>
> Reference to such a definition?
>

"Type

a category with no operations or attributes, of which all other
categories in Axiom are extensions."

from Appendix B of the Axiom book, page 1083.

>> The Axiom
>> interpreter automatically creates references to some types such as
>> 'Domain', and 'SubDomain Domain' but these were not originally
>> included as built-in domains or domains in the Axiom library so values
>> of this kind could be implemented only in very limited ways.
>>
>> OpenAxiom introduced Domain as a Domain consisting of all domains
>> (like Type in Aldor).
>
> In my opinion, categories in Aldor are not domains. So I don't agree with
> "like Type in Aldor", because Type comprises domains and categories.
>

In Aldor values of Type are domains and categories. In OpenAxiom as it
works today values of Domain are domains or categories so that is why
I said "like Type in Aldor".

>> OpenAxiom also adds 'Category' as an alternative to 'SubDomain Domain'.
>
> Really? Gaby, does that mean that in OpenAxiom a category is
> (conceptually) a domain? I don't speak of implementation details here.
> That one can (perhaps) implement categories and domains (by the latter
> I mean the collection of all things of type C where C is any category) by
> the same data structure and find a common name for that data structure.
> But I would find it confusing if that concept is also called "domain".
>

Aldor uses the name 'Type' for the domain (data structure) that
includes both domains and categories. In Axiom Type refers to the
category as referenced above. So either this has to change or
OpenAxiom needs some other name for the domain. Using the name
'Domain' does not seem all that confusing to me. Then a 'Domain' is
the only thing in the system that represents a user accessible data
structure of some kind. To say that

- Domain is a Domain
- Category is a Domain
- Type is a Category

is perhaps simpler than Aldor's

  - Domain is a Type
  - Category is a Type
  - Type is a Domain

> Gaby, what do you consider to be a domain? Such a data structure concept or
> simply something that has a category as its type?
>

In Axiom a domain is still something that has a category as its type
because categories are subdomains of Domain (just like categories are
subtypes of Type in Aldor).

>> I believe that the intention of OpenAxiom is that Category is a
>> domain however it is not always treated that way in the current revision.
>
> Again, that is confusing to me. Is it possible to choose some other name
> for that? "domain" should not be as meaningless as object is nowadays.
>

The concept of "domain" still seems clear to me. That is another
reason why I do not particularly like the idea of using "Domain" as
the top of the category hierarchy - that is confusing unless you
realize how these terms are used differently in Axiom and Aldor.

>>> where in my notation above "Domain" should just be considered the top
>>> of the category hierarchy. (Actually, the top is "with", I just named it
>>> "Domain").
>
>> Names are significant for named categories. Categories reference other
>> categories by name. 'Category' is the domain of all categories. It's
>> objects are categories.
>
> If you had written "'Category' is the class of all categories.", I would
> relax. But you used "domain" and that confuses me.

Is it better if I said: "It's values are categories."?

>
>>> I understand that it would be nice to really use categories as first
>>> class objects, but that does not mean that they must be considered
>>> as domains. Or does it?
>
>> Yes, I think it does.
>
> No, it doesn't. What you want, is that categories and domains (by the latter
> I mean the collection of all things of type C where C is any category) are
> treated in the same way (first class objects). So that is more in the sense
> of a common data structure that I mentioned above. I have no problem with
> that common treatment, but please don't call it "domain". Maybe call it
> "class" or "magma" or whatever, but not "domain".
>

But domains are precisely those things which allow us to define data
structures (of all kinds).

> Let us clarify. I have started with my definitions on
>
> http://axiom-wiki.newsynthesis.org/SandboxTypeDefinitions
>
> Add yours.
>

Do you mean "add my proposal for how this should work in OpenAxiom" or
my understanding of how it works now in Aldor? (I have already done
the latter.)

Regards,
Bill Page.


From nic at worldofnic.org  Tue Jul  8 17:27:08 2008
From: nic at worldofnic.org (Nicolas Doye)
Date: Tue, 8 Jul 2008 22:27:08 +0100
Subject: [Aldor-l] 'Domain' in 'SetCategory'?
Message-ID: <72d65e2d0807081427q9616273nd1966314c5d0994e@mail.gmail.com>

Bill Naylor pointed me at this discussion, so I've quickly subscribed.

I'm less familiar with Aldor - Axiom 1.x/2.x was more my thing.

I am rather confused as to Aldor's "Type" - from my brief perusing of
the e-mail chain, it appears to be a meta-programming piece of fun,
which you are now stuck with, not derived from a piece of serious
Mathematical design ??? (Pinch of salt required, perhaps).

My view (from my Axiom-centric brain) is to get rid of it. Why should
a both Integer and SetCategory have "Type"? Obj(SetCategory) doesn't
form a Set, but you want to think of it in the same way as the
collection (set) of all Integers? From some purist view, you may want
to use Functors and deal with Classes (things that don't form Sets) in
the same way as you use +(Int, Int) -> Int  but In Axiom they are
fundamentally different, and changing that would involve rewriting
pretty much all of it from scratch.

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

Note: I don't think the notation "Integer \in Obj(Ring)" is my
invention - it may be from Mac Lane, but I can't remember.

If I've got the wrong end of the stick let me know. I'm a bit rusty.
Nic Doye
--
http://worldofnic.org


From ralf at hemmecke.de  Wed Jul  9 11:00:46 2008
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Wed, 09 Jul 2008 17:00:46 +0200
Subject: [Aldor-l] Is Type a category?
In-Reply-To: <206fcf960807081642i7b459d53j5027443c76bfa87c@mail.gmail.com>
References: <4873E98A.2050703@hemmecke.de>
	<206fcf960807081642i7b459d53j5027443c76bfa87c@mail.gmail.com>
Message-ID: <4874D29E.50909@hemmecke.de>

Hello Stephen,

Could you also state your understanding of what Category, Type, domain 
etc. actually mean.

Would be nice if you could enter your definitions into

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

in particular, I would be interested to know whether 'Type' in Aldor is 
an Aldor-category, ie. not only Type: Type but also Type: Category.

Thank you in advance
Ralf

PS: Related link:
http://axiom.svn.sourceforge.net/viewvc/axiom/trunk/axiom/src/algebra/coerce.spad.pamphlet?revision=651&view=markup
where a definition says
Type(): Category == with nil


On 07/09/2008 01:42 AM, Gabriel Dos Reis wrote:
> On Tue, Jul 8, 2008 at 5:26 PM, Ralf Hemmecke <ralf at hemmecke.de> wrote:
> 
>> Somehow I now have the impression that Aldor-Type and OpenAxiom-Type are
>> different. That "Type" is a category in OpenAxiom would have never come
>> to my mind in Aldor.
> 
> Notice that, as far as I can determine, Type is a category is all current AXIOM
> systems.
> 
> -- Gaby


From ralf at hemmecke.de  Wed Jul  9 13:00:23 2008
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Wed, 09 Jul 2008 19:00:23 +0200
Subject: [Aldor-l] [open-axiom-devel] [#428] 'Domain' in 'SetCategory'?
In-Reply-To: <fbcd16d40807081100i75d1e347n645edfbc68af028b@mail.gmail.com>
References: <20080617145633-0700@axiom-wiki.newsynthesis.org>	
	<87tzf53mjh.fsf_-_@gauss.cs.tamu.edu>	
	<fbcd16d40807041034o949558dn7c13a45a2138fa08@mail.gmail.com>	
	<87hcb5ikce.fsf@gauss.cs.tamu.edu>	
	<fbcd16d40807041417rf689a7r24f2b3779b933aa7@mail.gmail.com>	
	<486E9EDD.7000802@hemmecke.de>	
	<fbcd16d40807041649v30f5cf86ka3641261747f2607@mail.gmail.com>	
	<486F16D8.9030400@hemmecke.de>	
	<fbcd16d40807072005l1d353988jb72dcf1c22856ad5@mail.gmail.com>	
	<487338B8.9010308@hemmecke.de>
	<fbcd16d40807081100i75d1e347n645edfbc68af028b@mail.gmail.com>
Message-ID: <4874EEA7.7030909@hemmecke.de>

>>> %5 >> X:Category == with {};
>>> 
>>> %6 >> Y:Category := X; () @ Category ... %10 >> z:Type := X; @
>>> Type
>> As you have defined it, X is a category and thus of type Type. Also
>> OK.

> But what is z? It is variable with values in the domain Type. The 
> objects of Type are either domains or categories.

After assignment z is a category since z is equal to X. You can also
make z a domain.

%3 >> X: Category == with;
                                            Comp: 10 msec, Interp: 0 msec
%4 >> x: X == add
Defined x @
X with
     ==  add ()

                                            Comp: 0 msec, Interp: 0 msec
%5 >> z: Type := X
   () @ Type
                                            Comp: 0 msec, Interp: 0 msec
%6 >> z: Type := x
   () @ Type

In any case, I don't see how useful z is, since Type does not export
anything.

>>> %11 >> y has Y T @ Boolean
>> We had that discussion before (and actually also at the Aldor
>> Workshop 2007). Formerly I would have said that should give false.
>> But as Stephen explained it should give true.
>> 
>>> %12 >> z has Y T @ Boolean
>> (***) This should be considered a bug. z is a category, so the
>> compiler is fooled by the definition of z: Type == X.
>> 
>> Hmm, maybe it's a feature and one can cure the problem with "has" 
>> in the definition of "List".
>> 
> 
> The Aldor Users Guide says:
> 
> A ``has'' expression has the following form:
> 
> dom has cat
> 
> where dom is a domain-valued expression, and cat is a category-valued
> expression.
> 
> but perhaps 'has' actually allows dom to be type-valued. So in this 
> case, yes I think it could cure the problem with "List Type", except 
> that in the current compiler one often gets: "Segmentation fault". 
> This I would consider definitely a bug.

I certainly don't rewrite the library to build on such a vague feature
of the compiler. That only calls for more segfaults later.

>>> By "inhabitants" do you mean objects? E.g. the value of Y above?
>> Actually, "object" doesn't say anything. But yes, I consider Y an 
>> "inhabitant" of Category, because Y: Category. And I would also
>> consider Y an inhabitant of Type even though you have not
>> explicitly said Y: Type. But any type in Aldor is of type Type.

> I think it is confusing to invent a new name like "inhabitant".
> Object is fairly standard but comes from object-oriented programming.
> In Aldor values do not carry any type information, so they are not 
> "objects" in this sense. I would agree to do what the Aldor users 
> guide does and use only the term "value". So your "inhabitants" and
> my "objects" are just values of some type.

Good. I can live with that.

>>> For example, in Aldor 'Type' and 'Category' are domains.
>> Sorry, I don't agree. Where have you found that in the AUG?

> See references to AUG and to an article by Stephen Watt at: 
> http://axiom-wiki.newsynthesis.org/SandboxTypeDefinitions

I've seen it in Stephen's article. But can you give the exact page
number in the .pdf version of the AUG? Or the exact link to the
information "'Type' and 'Category' are domains".

>>> Objects are related to domains by a membership relation. The 
>>> objects of the domain Type are themselves domains (of which Type
>>> is one and Category is another). Categories are subtypes 
>>> (subdomains) of Type arranged in a lattice by the inclusion
>>> relation. The objects of the domain Category are these subtypes
>>> of Type (categories).
>> Bill, could you give exact AUG page references for this?

> Just substitute "values" where "objects" occur in the text above. I 
> added these definitions from AUG on the web page you created
> mentioned above.

Still, I cannot find this wording in the AUG. Where is it? Searching for
'related' in the .pdf doesn't give too many items. And it's not among them.

>>> So it seems clear to me that all values in Aldor are objects in
>>> some domain, i.e. there are no "category-valued" objects at such
>>> but there are run-time objects of the domain Category and the
>>> domain Type. Still, these objects are treated as category values
>>> and domain values in the appropriate context.
>> Sorry, I don't understand that.

> So it seems clear to me that all values in Aldor are values in some 
> domain, i.e. there are no "category-valued" objects at such but there
>  are run-time values of the domain Category and the domain Type. 
> Still, these valuess are treated as category values and domain values
>  in the appropriate context.
> 
> Better?

I'd say, no.

If

X: Category == with;

then you don't call X "category-valued"? What happens at run-time is
another question, but this depends on how a compiler implements the
concept of a value of Category. I'd like to understand the relation of
all these names 'Type', 'Category', 'domain', 'Domain', etc. without
referring to an actual "data structure at runtime".

>>> In Axiom (all flavors so far) Type is a category.
>> Reference to such a definition?

> "Type

> a category with no operations or attributes, of which all other 
> categories in Axiom are extensions."
> 
> from Appendix B of the Axiom book, page 1083.

Hmmm, then why is there Type at all? "with" is exactly such a category.
'Type' is then only another name for "with" and less useful.

However, it is not just another name. Look at the definition of List.

List(T: Type): ...

It would be more restricted to write

List(T: with): ...

since then List would only accept categories as an argument.

>>> The Axiom interpreter automatically creates references to some
>>> types such as 'Domain', and 'SubDomain Domain' but these were not
>>> originally included as built-in domains or domains in the Axiom
>>> library so values of this kind could be implemented only in very
>>> limited ways.
>>> 
>>> OpenAxiom introduced Domain as a Domain consisting of all domains
>>>  (like Type in Aldor).
>> In my opinion, categories in Aldor are not domains. So I don't
>> agree with "like Type in Aldor", because Type comprises domains and
>> categories.

> In Aldor values of Type are domains and categories. In OpenAxiom as
> it works today values of Domain are domains or categories so that is
> why I said "like Type in Aldor".

OK, I understand. But that makes the world more complicated.

In Aldor:
We certainly agree that any aldor-type has the type 'Type'.
So that is fine (concerning the *name* 'Type').

In OpenAxiom:
Every domain has type 'Domain'. Fine.
Every category has type 'Category'. Fine.
But also every category has type 'Domain'. That is not so nice.

>>> OpenAxiom also adds 'Category' as an alternative to 'SubDomain
>>> Domain'.
>> Really? Gaby, does that mean that in OpenAxiom a category is 
>> (conceptually) a domain? I don't speak of implementation details
>> here. That one can (perhaps) implement categories and domains (by
>> the latter I mean the collection of all things of type C where C is
>> any category) by the same data structure and find a common name for
>> that data structure. But I would find it confusing if that concept
>> is also called "domain".
>> 
> 
> Aldor uses the name 'Type' for the domain (data structure) that 
> includes both domains and categories.

Ooops. Who told you that the internal data structures of domains and
categories are the same in the one and only Aldor compiler.

> In Axiom Type refers to the category as referenced above. So either
> this has to change or OpenAxiom needs some other name for the domain.
> Using the name 'Domain' does not seem all that confusing to me. Then
> a 'Domain' is the only thing in the system that represents a user
> accessible data structure of some kind. To say that
> 
> - Domain is a Domain - Category is a Domain - Type is a Category
> 
> is perhaps simpler than Aldor's
> 
> - Domain is a Type - Category is a Type - Type is a Domain

Who knows? I somehow start thinking that all this discussion has 'the 
implementation of reflection' as its background. True?

>> Gaby, what do you consider to be a domain? Such a data structure
>> concept or simply something that has a category as its type?

> In Axiom a domain is still something that has a category as its type 
> because categories are subdomains of Domain (just like categories are
> subtypes of Type in Aldor).

>>> I believe that the intention of OpenAxiom is that Category is a 
>>> domain however it is not always treated that way in the current
>>> revision.
>> Again, that is confusing to me. Is it possible to choose some other
>> name for that? "domain" should not be as meaningless as object is
>> nowadays.
>> 
> 
> The concept of "domain" still seems clear to me. That is another 
> reason why I do not particularly like the idea of using "Domain" as 
> the top of the category hierarchy - that is confusing unless you 
> realize how these terms are used differently in Axiom and Aldor.
> 
>>>> where in my notation above "Domain" should just be considered
>>>> the top of the category hierarchy. (Actually, the top is
>>>> "with", I just named it "Domain").
>>> Names are significant for named categories. Categories reference
>>> other categories by name. 'Category' is the domain of all
>>> categories. It's objects are categories.
>> If you had written "'Category' is the class of all categories.", I
>> would relax. But you used "domain" and that confuses me.
> 
> Is it better if I said: "It's values are categories."?

"It's" refers to what? If you mean "values of Category are called 
categories", I relax, since that is the same as saying "a category has 
'Category' as its type".

>> Let us clarify. I have started with my definitions on
>> 
>> http://axiom-wiki.newsynthesis.org/SandboxTypeDefinitions
>> 
>> Add yours.

> Do you mean "add my proposal for how this should work in OpenAxiom"
> or my understanding of how it works now in Aldor? (I have already
> done the latter.)

What I mean is to define *your* use of those concepts. So that whenever 
'domain', 'Domain', 'Type', etc. appears in a mail from you, I can 
always go to the page above and look up your definition.
I'd like to record the status so that we understand each other better.
So there should actually be no reference to Aldor or panAxiom.
If you have proposals for a better future, write them down, too, but 
mark it as "Proposal".

Ralf


From gdr at cs.tamu.edu  Wed Jul  9 13:08:28 2008
From: gdr at cs.tamu.edu (Gabriel Dos Reis)
Date: 09 Jul 2008 12:08:28 -0500
Subject: [Aldor-l] [open-axiom-devel] [#428] 'Domain' in 'SetCategory'?
In-Reply-To: <4874EEA7.7030909@hemmecke.de>
References: <20080617145633-0700@axiom-wiki.newsynthesis.org>
	<87tzf53mjh.fsf_-_@gauss.cs.tamu.edu>
	<fbcd16d40807041034o949558dn7c13a45a2138fa08@mail.gmail.com>
	<87hcb5ikce.fsf@gauss.cs.tamu.edu>
	<fbcd16d40807041417rf689a7r24f2b3779b933aa7@mail.gmail.com>
	<486E9EDD.7000802@hemmecke.de>
	<fbcd16d40807041649v30f5cf86ka3641261747f2607@mail.gmail.com>
	<486F16D8.9030400@hemmecke.de>
	<fbcd16d40807072005l1d353988jb72dcf1c22856ad5@mail.gmail.com>
	<487338B8.9010308@hemmecke.de>
	<fbcd16d40807081100i75d1e347n645edfbc68af028b@mail.gmail.com>
	<4874EEA7.7030909@hemmecke.de>
Message-ID: <87prpn7zoz.fsf@gauss.cs.tamu.edu>

Ralf Hemmecke <ralf at hemmecke.de> writes:

[...]

| In OpenAxiom:
| Every domain has type 'Domain'. Fine.
| Every category has type 'Category'. Fine.
| But also every category has type 'Domain'. That is not so nice.
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

I don't know how that come to be -- if true, it is a surprise to me.

-- Gaby


From ralf at hemmecke.de  Wed Jul  9 13:19:54 2008
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Wed, 09 Jul 2008 19:19:54 +0200
Subject: [Aldor-l] [open-axiom-devel] [#428] 'Domain' in 'SetCategory'?
In-Reply-To: <87prpn7zoz.fsf@gauss.cs.tamu.edu>
References: <20080617145633-0700@axiom-wiki.newsynthesis.org>	<87tzf53mjh.fsf_-_@gauss.cs.tamu.edu>	<fbcd16d40807041034o949558dn7c13a45a2138fa08@mail.gmail.com>	<87hcb5ikce.fsf@gauss.cs.tamu.edu>	<fbcd16d40807041417rf689a7r24f2b3779b933aa7@mail.gmail.com>	<486E9EDD.7000802@hemmecke.de>	<fbcd16d40807041649v30f5cf86ka3641261747f2607@mail.gmail.com>	<486F16D8.9030400@hemmecke.de>	<fbcd16d40807072005l1d353988jb72dcf1c22856ad5@mail.gmail.com>	<487338B8.9010308@hemmecke.de>	<fbcd16d40807081100i75d1e347n645edfbc68af028b@mail.gmail.com>	<4874EEA7.7030909@hemmecke.de>
	<87prpn7zoz.fsf@gauss.cs.tamu.edu>
Message-ID: <4874F33A.1070602@hemmecke.de>

On 07/09/2008 07:08 PM, Gabriel Dos Reis wrote:
> Ralf Hemmecke <ralf at hemmecke.de> writes:
> 
> [...]
> 
> | In OpenAxiom:
> | Every domain has type 'Domain'. Fine.
> | Every category has type 'Category'. Fine.
> | But also every category has type 'Domain'. That is not so nice.
>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> I don't know how that come to be -- if true, it is a surprise to me.

I only rephrased what I understood from Bill's mail. Bill I hope I cited 
you correctly.

Gaby, if "every category has type 'Domain'" is false for OpenAxiom, that 
makes me relax. I simply don't know/understand too much of the 
internals. That Boot code is still too much for me.

Ralf


From ralf at hemmecke.de  Thu Jul 10 00:29:55 2008
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Thu, 10 Jul 2008 06:29:55 +0200
Subject: [Aldor-l] {Spam?} bug with iterate
Message-ID: <48759043.1020807@hemmecke.de>

Hello,

that looks like a bug to me.

By mistake I've put an 'iterate' not in a 'repeat' body.
I think the compiler should reject that program instead of compiling it 
and then looping forever when I running the program.

Ralf

aldor -fx -laldor bugIterate.as
bugIterate
foo0 = 1
foo1 = 1
foo0 = 2
-- program doesn't stop


---BEGIN bugIterate.as
#include "aldor"
#include "aldorio"
import from Integer;
foo(i: Integer): () == {
	stdout << "foo0 = " << i << newline;
	if even? i then iterate;
	stdout << "foo1 = " << i << newline;
}
main(): () == for i in 1..5 repeat foo(i);
main();
---END bugIterate.as


From ralf at hemmecke.de  Fri Jul 11 07:29:03 2008
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Fri, 11 Jul 2008 13:29:03 +0200
Subject: [Aldor-l] {Spam?} bug with iterate
In-Reply-To: <73691350807110315r10a5056ey204cbdda2bf43c15@mail.gmail.com>
References: <48759043.1020807@hemmecke.de>
	<73691350807110315r10a5056ey204cbdda2bf43c15@mail.gmail.com>
Message-ID: <487743FF.5080009@hemmecke.de>

Peter,

I somehow don't see your messages recorded on the aldor-l archive. 
Aren't you subscribed?

Ralf

On 07/11/2008 12:15 PM, Peter Broadbery wrote:
> On Thu, Jul 10, 2008 at 5:29 AM, Ralf Hemmecke <ralf at hemmecke.de> wrote:
>> Hello,
>>
>> that looks like a bug to me.
>>
>> By mistake I've put an 'iterate' not in a 'repeat' body.
>> I think the compiler should reject that program instead of compiling it
>> and then looping forever when I running the program.
>>
>> Ralf
>>
>> aldor -fx -laldor bugIterate.as
>> bugIterate
>> foo0 = 1
>> foo1 = 1
>> foo0 = 2
>> -- program doesn't stop
>>
>>
>> ---BEGIN bugIterate.as
>> #include "aldor"
>> #include "aldorio"
>> import from Integer;
>> foo(i: Integer): () == {
>>        stdout << "foo0 = " << i << newline;
>>        if even? i then iterate;
>>        stdout << "foo1 = " << i << newline;
>> }
>> main(): () == for i in 1..5 repeat foo(i);
>> main();
>> ---END bugIterate.as
>>
> 
> Looks to be an unimplemented check, with code generation producing
> something daft.  The obvious fix is to add some code to recognise an
> iterate (or break) that's not within a repeat clause - the code would
> go into abcheck.c.  Only difficulty is in ensuring that one follows
> the syntax correctly - a break would be allowed only within contained
> sequence, conditions, exit clauses, try/catch clauses and probably one
> or two constructs.
> 
> Peter



From casper at unbc.ca  Tue Jul 22 19:37:34 2008
From: casper at unbc.ca (David Casperson)
Date: Tue, 22 Jul 2008 16:37:34 -0700 (PDT)
Subject: [Aldor-l] Access to aquarium
Message-ID: <alpine.OSX.1.00.0807221635010.21668@tl-fac-1-226-53.unbc.ca>

Can anyone access https://aquarium.aldor.csd.uwo.ca:443/ ?

I keep getting "could not connect to server" messages.

David
-- 
David Casperson
Computer Science


From casper at unbc.ca  Tue Jul 22 19:45:53 2008
From: casper at unbc.ca (David Casperson)
Date: Tue, 22 Jul 2008 16:45:53 -0700 (PDT)
Subject: [Aldor-l] OUTFLAG in aldor/tools/unix/Makefile
Message-ID: <alpine.OSX.1.00.0807221638530.21668@tl-fac-1-226-53.unbc.ca>

Hi folks,

someone has customized the aldor/tools/unix/Makefile so that instead of 
writing "-o" in DOCC commands there is indirection through $OUTFLAG. 
However, the space between -o and the target has been dropped, and this 
does not work with gcc 4.something, at least on Mac OS X Leopard.

Is there an operating system out there where we MUST write
     docc ... -otarget
rather than
     docc ... -o target
?

Can anyone else build aldor with gcc 4.x ?

David
-- 
Dr. David Casperson, Assistant Professor     |  casper at unbc.ca
Department of Computer Science               |  (250)   960-6672 Fax 960-5544
College of Science and Management            |  3333 University Way
University of Northern British Columbia      |  Prince George, BC   V2N 4Z9
                                              |  CANADA


From ralf at hemmecke.de  Wed Jul 23 02:23:58 2008
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Wed, 23 Jul 2008 08:23:58 +0200
Subject: [Aldor-l] OUTFLAG in aldor/tools/unix/Makefile
In-Reply-To: <alpine.OSX.1.00.0807221638530.21668@tl-fac-1-226-53.unbc.ca>
References: <alpine.OSX.1.00.0807221638530.21668@tl-fac-1-226-53.unbc.ca>
Message-ID: <4886CE7E.4050509@hemmecke.de>

svn blame 
https://svn.origo.ethz.ch/algebraist/trunk/aldor/aldor/tools/unix/Makefile 


answers both of your mails.

Unfortunately the old CVS archive is not public. :-( Or do you know 
where Laurentiu put it?

I think I was able to build with gcc4, but I am not 100% sure that it 
really works as it should.

Ralf


On 07/23/2008 01:45 AM, David Casperson wrote:
> Hi folks,
> 
> someone has customized the aldor/tools/unix/Makefile so that instead of 
> writing "-o" in DOCC commands there is indirection through $OUTFLAG. 
> However, the space between -o and the target has been dropped, and this 
> does not work with gcc 4.something, at least on Mac OS X Leopard.
> 
> Is there an operating system out there where we MUST write
>      docc ... -otarget
> rather than
>      docc ... -o target
> ?
> 
> Can anyone else build aldor with gcc 4.x ?
> 
> David


From ldragan at aldor.org  Wed Jul 23 12:53:33 2008
From: ldragan at aldor.org (ldragan at aldor.org)
Date: Wed, 23 Jul 2008 12:53:33 -0400
Subject: [Aldor-l] OUTFLAG in aldor/tools/unix/Makefile
In-Reply-To: <alpine.OSX.1.00.0807221638530.21668@tl-fac-1-226-53.unbc.ca>
References: <alpine.OSX.1.00.0807221638530.21668@tl-fac-1-226-53.unbc.ca>
Message-ID: <55403e3eae84037135497b6d3b28aedb@freemodule.com>

Hi David,

I changed from -o to $OUTFLAG. I needed to do that to use the same
makefiles for Windows build. 
I don't remember if I changed the spaces as well. Maybe MSVC doesn't like
any space between /Fe 
and the file name and that is why a changed it.

I used those Makefiles to build using gcc 4.x on Fedora and they worked. I
haven't 
tried it with newer versions and I certainly didn't try it on OS X :).

--
Laurentiu

On Tue, 22 Jul 2008 16:45:53 -0700 (PDT), David Casperson <casper at unbc.ca>
wrote:
> Hi folks,
> 
> someone has customized the aldor/tools/unix/Makefile so that instead of
> writing "-o" in DOCC commands there is indirection through $OUTFLAG.
> However, the space between -o and the target has been dropped, and this
> does not work with gcc 4.something, at least on Mac OS X Leopard.
> 
> Is there an operating system out there where we MUST write
>      docc ... -otarget
> rather than
>      docc ... -o target
> ?
> 
> Can anyone else build aldor with gcc 4.x ?
> 
> David
> --
> Dr. David Casperson, Assistant Professor     |  casper at unbc.ca
> Department of Computer Science               |  (250)   960-6672 Fax
> 960-5544
> College of Science and Management            |  3333 University Way
> University of Northern British Columbia      |  Prince George, BC   V2N
> 4Z9
>                                               |  CANADA
> 
> _______________________________________________
> Aldor-l mailing list
> Aldor-l at aldor.org
> http://aldor.org/mailman/listinfo/aldor-l_aldor.org



From casper at unbc.ca  Wed Jul 23 14:39:48 2008
From: casper at unbc.ca (David Casperson)
Date: Wed, 23 Jul 2008 11:39:48 -0700 (PDT)
Subject: [Aldor-l] OUTFLAG in aldor/tools/unix/Makefile
In-Reply-To: <55403e3eae84037135497b6d3b28aedb@freemodule.com>
References: <alpine.OSX.1.00.0807221638530.21668@tl-fac-1-226-53.unbc.ca>
	<55403e3eae84037135497b6d3b28aedb@freemodule.com>
Message-ID: <alpine.OSX.1.00.0807231132030.271@david-caspersons-computer.local>

ldragan at aldor.org, on 2008-07-23, you wrote:

> Date: Wed, 23 Jul 2008 12:53:33 -0400
> From: ldragan at aldor.org
> To: David Casperson <casper at unbc.ca>
> Cc: aldor-l <aldor-l at aldor.org>
> Subject: Re: [Aldor-l] OUTFLAG in aldor/tools/unix/Makefile
> 
> Hi David,
>
> I changed from -o to $OUTFLAG. I needed to do that to use the same
> makefiles for Windows build.
> I don't remember if I changed the spaces as well. Maybe MSVC doesn't like
> any space between /Fe
> and the file name and that is why a changed it.
>
> I used those Makefiles to build using gcc 4.x on Fedora and they worked. I
> haven't
> tried it with newer versions and I certainly didn't try it on OS X :).

Hmmm... looks like what I really need is access to a bunch of
platforms so that we can try the builds across them.

I'm guessing that what is correct here is

OUTFLAG="-o "

on everything but MSVC and

OUTFLAG="/Fe"

for it.  Are there versions of Make that don't evaluate (strip
quotes) on the right hand side of assignments?

David


From pip88nl at gmail.com  Sat Jul 26 09:20:20 2008
From: pip88nl at gmail.com (pip88nl at gmail.com)
Date: Sat, 26 Jul 2008 15:20:20 +0200
Subject: [Aldor-l] Aldor Compiler in website
Message-ID: <20080726132020.GA28579@xinutec.org>

Hello Aldor List,

as I have mentioned at the workshop, I provide an integrated aldor
compiler on my website which has (currently very limited) syntax
highlighting and arbitrary code execution. The link is
http://xinutec.org/~pippijn/en/projects_aldor.xhtml.

-- 
Pippijn
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://aldor.org/pipermail/aldor-l_aldor.org/attachments/20080726/8f5809dc/attachment.bin 

From ralf at hemmecke.de  Sat Jul 26 11:55:54 2008
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Sat, 26 Jul 2008 17:55:54 +0200
Subject: [Aldor-l] Operating System interface
Message-ID: <488B490A.7030604@hemmecke.de>

Hi Pippijn,

you were asking about an operating system interface.

You find it in

lib/axllib/src/oslow.as

And though that is saying "import from Foreign C", it seems to refer to 
some runtime that is coming with the compiler.

Does that help?

Ralf


From bill.page at newsynthesis.org  Sun Jul 27 02:03:12 2008
From: bill.page at newsynthesis.org (Bill Page)
Date: Sun, 27 Jul 2008 02:03:12 -0400
Subject: [Aldor-l] RISC
In-Reply-To: <f3c595c60807261943m182ae4cay95af221278621ec1@mail.gmail.com>
References: <f3c595c60807261943m182ae4cay95af221278621ec1@mail.gmail.com>
Message-ID: <fbcd16d40807262303h65eca6abib063b4cbf91d2cab@mail.gmail.com>

Alfredo,

On Sat, Jul 26, 2008 at 10:43 PM, you wrote:
> Hi Bill,
>
> For those no so fortune to be able to travel to Europe
> ( I cannot even travel in the states :-),
> is there gonna be a summary some where of what it
> was discussed ? or at least interesting news :)
>
> Maybe a video...:p...yeah I know I am asking for too much.
>
> Thank you,
>

I am quite sorry that you and some of the other Axiom and Aldor
developers and users were not able to come to the meeting. I am sure
you could have provided valuable input to the discussion. Notably
absent also was Tim Daly, especially since the main developers of the
two other other Axiom-related projects were there (Gaby, and Waldek).

Here is a fairly accurate updated schedule of the workshop prepared by
the organizer of the workshop Ralf Hemmecke:

http://portal.risc.uni-linz.ac.at/Members/hemmecke/aldoraxiom2008

I think that overall the organization of the workshop was very good -
much thanks to Ralf! And in spite of often being arranged at the "last
minute", the talks and discussions actually fit together into a quite
coherently whole. But sorry, there was no video or audio recording.
:-( In my opinion this is something that we need to try harder to do
in the future.

One very good thing that was done this year for the first time was to
combine both the Aldor and Axiom workshops into one. This meant that
Stephen Watt and a few other people were present specifically because
of Aldor and vice-versa. This was good for two reasons: Stephen of
course was deeply involved in the development of ScratchPad before it
became Axiom and the main developer of Aldor so he was able to offer a
lot of important background on both projects.

Secondly I think it helped strengthen the argument that Aldor should
have a more open open-source license because of the amount of
development work occurring in the Axiom forks in comparison to Aldor.
At the main ISSAC meeting which occurred just before the workshop
William Stein, the main developer of Sage, emphasized exactly the same
issue.

Besides many technical discussions on language design, comparing
developments in SPAD  (especially in OpenAxiom) and Aldor, there was
at least some small progress towards a more open license. One reason
for this is the work being done by Ralf Hemmecke and Peter Broadbery
on the Aldor-Axiom interface. There a few runtime-related files in the
Aldor distribution that are required to build the interface and
everyone agrees that it would be a good thing to be able to distribute
and build the Aldor-Axiom interface without having to include the
Aldor sources and it's license. More information about that will
follow in a few weeks I hope.

For me one of the most surprising and exciting developments in the
last year was that an entirely new and very active Aldor developer has
appeared thanks mainly due to the ubiquity of the Internet and the
still rapidly growing open source culture. Pippijn van Steenhoven
discussed his work on the internals of the Aldor compiler using
"state-of-the-art" tools and methods that are common in other open
source projects, such as valgrind and other profiling tools. As a
result of this work Pippijn has already been able to isolate and fix
some important causes of segfaults that plague the Aldor compiler. You
can both see (and use!) the results of his work here:

http://xinutec.org/~pippijn/en/projects_aldor.xhtml

Please ask more questions. It seems a bit hard for me, although it is
still current, to really summarize the results of the workshop. As
time permits, I will try to add more in follow-up comments. I hope
some of the other people who were there will also offer their
perspectives and comments here.

Regards,
Bill Page.


From ralf at hemmecke.de  Tue Jul 29 06:25:52 2008
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Tue, 29 Jul 2008 12:25:52 +0200
Subject: [Aldor-l] old bugs
Message-ID: <488EF030.2010002@hemmecke.de>

Dear Stephen,

the links to the old bugs on

http://www.aldor.org/bugs/

are not working.

Ralf


From ralf at hemmecke.de  Tue Jul 29 07:17:27 2008
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Tue, 29 Jul 2008 13:17:27 +0200
Subject: [Aldor-l] [fricas-devel] Re: RISC
In-Reply-To: <fbcd16d40807262303h65eca6abib063b4cbf91d2cab@mail.gmail.com>
References: <f3c595c60807261943m182ae4cay95af221278621ec1@mail.gmail.com>
	<fbcd16d40807262303h65eca6abib063b4cbf91d2cab@mail.gmail.com>
Message-ID: <488EFC47.9060004@hemmecke.de>

> Here is a fairly accurate updated schedule of the workshop prepared
> by the organizer of the workshop Ralf Hemmecke:
> 
> http://portal.risc.uni-linz.ac.at/Members/hemmecke/aldoraxiom2008

I've moved everything to the official conference page.

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

and added slides. For some talks there are still some slides missing
that were used during the talk. And I hope those people send me the
slides that they used.

To the participants: Certainly some of you have made notes during the
talks. So if you could add them to the obove site that would be
certainly good for others.

> But sorry, there was no video or audio recording. :-( In my opinion
> this is something that we need to try harder to do in the future.

Interesting, but hard to achieve. Note that we did not just have talks 
but rather lot's of discussions. It would be hard to record that. And I 
have no idea who could actually do that.

Bill, I think it would be nice if your summary of the workshop also 
appears at the conference page. Maybe others add their summaries, too, 
so we can share our knowledge and help to strengthen the still very 
small Aldor & panAxiom community.

Ralf


From pip88nl at gmail.com  Tue Jul 29 19:51:58 2008
From: pip88nl at gmail.com (pip88nl at gmail.com)
Date: Wed, 30 Jul 2008 01:51:58 +0200
Subject: [Aldor-l] GC Timing
Message-ID: <20080729235158.GA19601@xinutec.org>

Hi Aldor List,

I did some more elaborate benchmarks regarding garbage collection. The
results can be viewed on my website at
http://xinutec.org/~pippijn/en/projects_aldor_profile.xhtml. For those
who don't want to read, the conclusion is that the Aldor GC can
outperform Boehm if compiled with certain switches.

-- 
Pippijn
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://aldor.org/pipermail/aldor-l_aldor.org/attachments/20080730/a890aa37/attachment.bin 

From ralf at hemmecke.de  Wed Jul 30 07:45:28 2008
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Wed, 30 Jul 2008 13:45:28 +0200
Subject: [Aldor-l] Cross(List t for t in T) where T: Tuple(LabelType)
Message-ID: <48905458.2000204@hemmecke.de>

Dear Stephen,

here is a short file that demonstrates (inside #if MULTI) approximately
what I would like to have.

The file runs fine with

aldor -laldor -grun experimentalmultisortspecies.as

but of course not if I add "-DMULTI" on the command line.

Do you have some comments on it? Is that an instance that can be done 
with compile-time typechecking?

   Rep == Cross(List t for t in T)

I know that everything could certainly be done by using Object, but does 
Aldor also allow me to not carry the type information in the value?

Best regards

Ralf
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: experimentalmultisortspecies.as
Url: http://aldor.org/pipermail/aldor-l_aldor.org/attachments/20080730/6639c368/attachment.pl 

From ralf at hemmecke.de  Wed Jul  2 09:09:13 2008
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Wed, 02 Jul 2008 15:09:13 +0200
Subject: [Aldor-l] Dangerous use of GMP
In-Reply-To: <20080626203321.GA28680@osiris.xinutec.org>
References: <20080626203321.GA28680@osiris.xinutec.org>
Message-ID: <486B7DF9.90202@hemmecke.de>

Hi Pippijn, hello Peter,

When I say

aldor -fc -q5 salfltgmp.as

I get

static FiWord
CF26_coerce(FiEnv e1, FiWord P0_a)
{
         PFmt14 T2;
         PFmt13 T0, T1;
         PFmt21 l1;
         l1 = (PFmt21) fiEnvLevel(e1);
         if ((FiBool) l1->X57_b64_QMARK_) goto L0;
         T1 = fi0RecNew(struct Fmt13 , CENSUS_Rec);
         T1->X0_pr = (FiWord) 0L;
         T1->X1_sz = (FiWord) 0L;
         T1->X2_expo = (FiWord) 0L;
         T1->X3_lmbs = (FiWord) fiNil;
         T0 = T1;
L1:	__gmpf_init((FiWord) T0);
         __gmpf_set_d((FiWord) T0, P0_a);
         return (FiWord) T0;
L0:	T2 = fi0RecNew(struct Fmt14 , CENSUS_Rec);
         T2->X0_szpr = (FiWord) 0L;
         T2->X1_expo = (FiWord) 0L;
         T2->X2_lmbs = (FiWord) fiNil;
         T0 = (PFmt13) T2;
         goto L1;
}

with

struct Fmt13 {
         FiWord X0_pr;
         FiWord X1_sz;
         FiWord X2_expo;
         FiWord X3_lmbs;
};
struct Fmt14 {
         FiWord X0_szpr;
         FiWord X1_expo;
         FiWord X2_lmbs;
};

being the equivalent of

	coerce(a:DoubleFloat):%		== {
		e:% := new();
		____gmpf__set__d(rep e, a);
		e;
	}

         new():%                         == {
		n: Pointer := {
			b64? => [0,0,nil]$Rec64 pretend Pointer;
			[0,0,0,nil]$Rec32 pretend Pointer;
		}
                 ____gmpf__init(n);
		per n;
	}

So the structures given to __gmpf_init() differ according to whether the 
program runs on 32 or 64 bits. Seems that I didn't understand your 
problem. Could you make that issue a bit more precise?

Now if gmp on a 64 bit machine requires the second argument of 
__gmpf_set_d() to be a float instead of a pointer to it, then there must 
be made some change to the .as sources. Actually, it would be 
interesting to know whether Aldor deals with single and double floats 
*always* in a boxed form.

Peter, do you happen to know?

In that case maybe something like

   coerce(a:DoubleFloat):%		== {
	e:% := new();
	if b64? then {
		Box ==> Record(myfloatdata: Pointer);
		import from Box;
		f: Pointer := (a pretend Box).myfloatdata;
		____gmpf__set__d(rep e, (f pretend DoubleFloat));
	} else {
		____gmpf__set__d(rep e, a);
	}
	e;
   }

might help. It leads to

static FiWord
CF26_coerce(FiEnv e1, FiWord P0_a)
{
         PFmt14 T3;
         PFmt13 T1, T2;
         FiWord T0_f;
         PFmt22 l1;
         l1 = (PFmt22) fiEnvLevel(e1);
         if ((FiBool) l1->X57_b64_QMARK_) goto L2;
         T2 = fi0RecNew(struct Fmt13 , CENSUS_Rec);
         T2->X0_pr = (FiWord) 0L;
         T2->X1_sz = (FiWord) 0L;
         T2->X2_expo = (FiWord) 0L;
         T2->X3_lmbs = (FiWord) fiNil;
         T1 = T2;
L3:	__gmpf_init((FiWord) T1);
         if ((FiBool) l1->X57_b64_QMARK_) goto L0;
         __gmpf_set_d((FiWord) T1, P0_a);
L1:	return (FiWord) T1;
L0:	T0_f = ((PFmt19) P0_a)->X0_myfloatdata;
         __gmpf_set_d((FiWord) T1, T0_f);
         goto L1;
L2:	T3 = fi0RecNew(struct Fmt14 , CENSUS_Rec);
         T3->X0_szpr = (FiWord) 0L;
         T3->X1_expo = (FiWord) 0L;
         T3->X2_lmbs = (FiWord) fiNil;
         T1 = (PFmt13) T3;
         goto L3;
}

Does that you more right to you, Pippijn?

In any case, my change of the .as stuff looks very ugly and dangerous.

Ralf

PS: Unfortunately, I could not find any contact data of Helene Prieto 
(the author of sal_fltgmp.as).



On 06/26/2008 10:33 PM, Pippijn van Steenhoven wrote:
> Hi List,
> 
> in libaldor, the file sal_fltgmp.as uses GMP functions in 'coerce' as
> follows:
> 
> struct Fmt13 {
>         FiWord X0_pr;
>         FiWord X1_sz;
>         FiWord X2_expo;
>         FiWord X3_lmbs;
> };
> [...]
> struct Fmt32 {
>         FiDFlo X0_float;
> };
> [...]
> static FiWord
> CF24_coerce(FiEnv e1, FiWord P0_a)
> {
>         [...]
>         PFmt13 T2, T3;
>         PFmt32 T1;
>         [...]
>         T1 = fi0RecNew(struct Fmt32 , CENSUS_Rec);
>         [...]
>         T3 = fi0RecNew(struct Fmt13 , CENSUS_Rec);
>         [...]
>         T2 = T3;
> L1:     __gmpf_init((FiWord) T2);
>         __gmpf_set_d((FiWord) T2, T1);
>         [...]
> }
> 
> 1) Fmt13 is not what __gmpf_init expects. What the function expects is
>    more like
>    struct mpf_struct {
>         int X0_pr;
>         int X1_sz;
>         int X2_expo;
>         Pointer X3_lmbs;
>    };
>    This is fine on 32 bit platforms, but on 64 bit platforms with the
>    LP64 data model, this breaks horribly.
> 2) __gmpf_set_d expects the same struct as above as first argument and a
>    plain double as second argument. T1, however, is a pointer to a struct
>    containing a plain double. It will *always* receive garbage. Passing
>    T1->X0_float would work, but currently, there is no support for
>    something like that.
> 
> This seems to be an inherent problem with the way Aldor generates C code.
> How should this be solved? I really don't have many ideas on this one.
> The compiler expects the functions to nicely work with those arguments,
> but they don't. The only solution I can think of is wrapping all foreign
> functions.



From pip88nl at gmail.com  Wed Jul  2 19:52:14 2008
From: pip88nl at gmail.com (Pippijn van Steenhoven)
Date: Thu, 3 Jul 2008 01:52:14 +0200
Subject: [Aldor-l] Code audit
In-Reply-To: <alpine.OSX.1.00.0806301042200.272@david-caspersons-computer.local>
References: <8c584a860806241332o6c6d8abfk19e2735f3c6af936@mail.gmail.com>
	<20080628174625.GA5250@osiris.xinutec.org>
	<alpine.OSX.1.00.0806301042200.272@david-caspersons-computer.local>
Message-ID: <20080702235214.GA17569@osiris.xinutec.org>

On Mon, Jun 30, 2008 at 10:47:51AM -0700, David Casperson wrote:
> buffer points at, just the buffer itself.  This matches
> bufCapture, which does not copy the ``String s'', just makes a
> buffer that points at it.
>
> Does this seem right?

It seems right, but in some cases (dgCycleError, dgOrderError), the
buffer is created with bufNew, not bufCapture. Your explanation of
"memory leak is okay on error paths" is not really what I'm looking for.
As I explained on my website, the Aldor GC performs best if memory is
manually returned to the allocator. Am I missing anything here? Is
bufLiberate really the right thing even in these functions?

-- 
Pippijn van Steenhoven
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://mail.aldor.org/pipermail/aldor-l_aldor.org/attachments/20080703/7a5fbaea/attachment-0002.bin>

From casper at unbc.ca  Wed Jul  2 20:19:17 2008
From: casper at unbc.ca (David Casperson)
Date: Wed, 2 Jul 2008 17:19:17 -0700 (PDT)
Subject: [Aldor-l] Code audit
In-Reply-To: <20080702235214.GA17569@osiris.xinutec.org>
References: <8c584a860806241332o6c6d8abfk19e2735f3c6af936@mail.gmail.com>
	<20080628174625.GA5250@osiris.xinutec.org>
	<alpine.OSX.1.00.0806301042200.272@david-caspersons-computer.local>
	<20080702235214.GA17569@osiris.xinutec.org>
Message-ID: <alpine.OSX.1.00.0807021708326.299@david-caspersons-computer.local>

Pippijn, you wrote:

> On Mon, Jun 30, 2008 at 10:47:51AM -0700, David Casperson wrote:
> > buffer points at, just the buffer itself.  This matches
> > bufCapture, which does not copy the ``String s'', just makes a
> > buffer that points at it.
> >
> > Does this seem right?
> 
> It seems right, but in some cases (dgCycleError, dgOrderError), the
> buffer is created with bufNew, not bufCapture. Your explanation of
> "memory leak is okay on error paths" is not really what I'm looking for.
> As I explained on my website, the Aldor GC performs best if memory is
> manually returned to the allocator. Am I missing anything here? Is
> bufLiberate really the right thing even in these functions?


The code in dgCycleError and dgOrderError looks erroneous to me,
as it appears to not free the string contents of the buffer.

Stephen, Laurentiu ?


David
-- 
Dr. David Casperson, Assistant Professor     |  casper at unbc.ca
Department of Computer Science               |  (250)   960-6672 Fax 960-5544
College of Science and Management            |  3333 University Way
University of Northern British Columbia      |  Prince George, BC   V2N 4Z9
                                              |  CANADA




From gdr at integrable-solutions.net  Thu Jul  3 12:18:49 2008
From: gdr at integrable-solutions.net (Gabriel Dos Reis)
Date: Thu, 3 Jul 2008 11:18:49 -0500
Subject: [Aldor-l] [open-axiom-devel] [#428] 'Domain' in 'SetCategory'?
In-Reply-To: <fbcd16d40806181006v2fd89702r6e7b310fc777bfba@mail.gmail.com>
References: <20080617145633-0700@axiom-wiki.newsynthesis.org>
	<4858B619.6060003@hemmecke.de>
	<fbcd16d40806180338k7434d913k6eadfaa2416dc826@mail.gmail.com>
	<4858EADF.70701@hemmecke.de>
	<fbcd16d40806180437h34a2b465i6894b58c264b7025@mail.gmail.com>
	<4858F72E.5010903@hemmecke.de>
	<fbcd16d40806181006v2fd89702r6e7b310fc777bfba@mail.gmail.com>
Message-ID: <206fcf960807030918q615ea18dw10411f17c8fc3e89@mail.gmail.com>

On Wed, Jun 18, 2008 at 12:06 PM, Bill Page <bill.page at newsynthesis.org> wrote:
> On Wed, Jun 18, 2008 at 7:53 AM, Ralf Hemmecke wrote:
>> On 06/18/2008 01:37 PM, Bill Page wrote:
>>>
>>> On 6/18/08, Ralf Hemmecke wrote:
>>>>
>>>> ...
>>>> Bill Page wrote:
>>>>>
>>>>> That category that plays this role in Axiom is called Type
>>>>> (1) -> )sh Type
>>>>>  Type  is a category constructor
>>>>
>>>> Hmmm, maybe I mix again Aldor and SPAD...
>>>>
>>>> See section 7.7 AUG:
>>>> Type: A type S satisfies the language-defined type Type if S is
>>>> the type of a domain or category. In other words, all domains
>>>> and categories are types.
>>>>
>>>> Is this really different for SPAD? (I am not saying anything about
>>>> the interpreter.)
>>>
>>> No, I think it is the same. Both domains and categories satisfy
>>> Type, e.g.
>>>
>>> (1) -> SetCategory has Type
>>>
>>>   (1)  true
>>>                                                       Type: Boolean
>>> (2) -> Integer has Type
>>>
>>>   (2)  true
>>>                                                       Type: Boolean
>>
>> See AUG page 96:
>>
>> Has expressions
>> A "has" expression has the following form:
>>    dom has cat
>> where dom is a domain-valued expression, and cat is a category-valued
>> expression.
>>
>> So at least "has" is different in the Axiom interpreter or in SPAD.
>>
>
> You are right, there is a difference between Aldor and OpenAxiom. In
> Aldor Type is not a category - it is a domain!

Yes.  The fact that `Type' is a category, but not a domain is something that
OpenAxiom inherits form the base AXIOM system.  On many occasions
I've found it a blessing and a curse.

It is annoying when your realize that OpenAxiom can correctly evaluate
[Ring, Integer] as a List Type, but will not be able to print it correctly.
The reason being that Type is a category, therefore does not know
(yet) how to print itself, i.e. the query

    Type has CoercibleTo OutputForm

is meaningless.

-- Gaby



From bill.page at newsynthesis.org  Thu Jul  3 22:47:55 2008
From: bill.page at newsynthesis.org (Bill Page)
Date: Thu, 3 Jul 2008 22:47:55 -0400
Subject: [Aldor-l] [open-axiom-devel] [#428] 'Domain' in 'SetCategory'?
In-Reply-To: <206fcf960807030918q615ea18dw10411f17c8fc3e89@mail.gmail.com>
References: <20080617145633-0700@axiom-wiki.newsynthesis.org>
	<4858B619.6060003@hemmecke.de>
	<fbcd16d40806180338k7434d913k6eadfaa2416dc826@mail.gmail.com>
	<4858EADF.70701@hemmecke.de>
	<fbcd16d40806180437h34a2b465i6894b58c264b7025@mail.gmail.com>
	<4858F72E.5010903@hemmecke.de>
	<fbcd16d40806181006v2fd89702r6e7b310fc777bfba@mail.gmail.com>
	<206fcf960807030918q615ea18dw10411f17c8fc3e89@mail.gmail.com>
Message-ID: <fbcd16d40807031947w23d29b47ld1dbef71ba436e87@mail.gmail.com>

On Thu, Jul 3, 2008 at 12:18 PM, Gabriel Dos Reis wrote:
> ...
>> Bill Page wrote:
>> You are right, there is a difference between Aldor and OpenAxiom.
>> In Aldor Type is not a category - it is a domain!
>
> Yes.  The fact that `Type' is a category, but not a domain is something
> that OpenAxiom inherits form the base AXIOM system.  On many
> occasions I've found it a blessing and a curse.
>

It is not clear to me when it might be a blessing... :-) As I see it,
the main purpose of a category in OpenAxiom is to stand for some
mathematical (or datastructure-like) concept. Usually these also
correspond to some recognizable "category" in the mathematical sense,
e.g. Ring. But what concept is represented by the category Type? (A
possible answer is provided by Saul Yousseph, but I do not think that
was the original intention of the design of Axiom.)

There is a related problem with the definition of the domain
'Category' - is it a domain or a category?

Earler in this thread I gave the example:

(3) -> x := IntegerNumberSystem

  (3)  IntegerNumberSystem
                                                    Type: Category

but this fails:

(4) -> x:Category := IntegerNumberSystem

  Category is a category, not a domain, and declarations require
     domains.

and one can also write:

(4) -> Integer has Category

  (4)  true
                                               Type: Boolean

But we find:

(5) -> I:Type := IntegerNumberSystem

   Type is a category, not a domain, and declarations require domains.

(5) -> I:Domain := IntegerNumberSystem

   (5)  IntegerNumberSystem
                                                Type: Category


> It is annoying when your realize that OpenAxiom can correctly
> evaluate [Ring, Integer] as a List Type, but will not be able to print
> it correctly. The reason being that Type is a category, therefore does
> not know (yet) how to print itself,

Yes. As a category Type can have no exports.

> i.e. the query
>
>    Type has CoercibleTo OutputForm
>
> is meaningless.
>

Yes. But as I understand it, in Axiom (OpenAxiom?) 'has' has two meanings

     x has y

is true if 1) domain 'x' satisfies category (or property) 'y' or 2) if
category 'x' is a subset of category 'y'.

Under the second interpretation 'Type has x' is necessarily false for
any category 'x' not identical to 'Type'. Similarly,

    x has Type

is necessarily true if it is defined at all.

-----------

I think the way out of this mess was correctly identified by Stephen
Watt in the description of Aldor when he wrote: (ibid.):

"Each domain is itself a value belonging to the domain Type. Domains
may additionally belong to some number of subtypes (of Type), known as
categories."

I.e. 'Type' is a Domain. Categories are subtypes of Type, but as such
Type (being itself a subtype of Type) is also a category unless we
consider only proper subtypes.

In OpenAxiom we now have the domain named 'Domain' so we should be
able to say: "Each domain is itself a value belonging to the domain
'Domain'. Categories are sub-domains of 'Domain'. Then 'Type' is just
Domain as a whole considered as a category."

'Domain' is a domain, but are sub-domains of domain also domains? So
again, what is Category?

For example IntegerNumberSystem is a category. Right now OpenAxiom says:

(1) -> I:=Integer

   (1)  Integer
                                                   Type: Domain

(2) -> x:=IntegerNumberSystem

   (2)  IntegerNumberSystem
                                                   Type: Category

But in FriCAS (and Axiom), we still get:

(1) -> I:=Integer

   (1)  Integer
                                                   Type: Domain

(2) -> x:=IntegerNumberSystem

   (2)  IntegerNumberSystem
                                   Type: SubDomain Domain

------

which I guess is technically correct, unfortunately 'Domain' and
'SubDomain' where never defined as domain constructors in either Axiom
or FriCAS. OpenAxiom corrected that problem but it introduced
'Category' as a domain (sometimes) instead of defining 'SubDomain'.

I guess I am still a little confused about all of this. :-)

Regards,
Bill Page.



From ralf at hemmecke.de  Fri Jul  4 18:06:21 2008
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Sat, 05 Jul 2008 00:06:21 +0200
Subject: [Aldor-l] [open-axiom-devel] [#428] 'Domain' in 'SetCategory'?
In-Reply-To: <fbcd16d40807041417rf689a7r24f2b3779b933aa7@mail.gmail.com>
References: <20080617145633-0700@axiom-wiki.newsynthesis.org>	<4858EADF.70701@hemmecke.de>	<fbcd16d40806180437h34a2b465i6894b58c264b7025@mail.gmail.com>	<4858F72E.5010903@hemmecke.de>	<fbcd16d40806181006v2fd89702r6e7b310fc777bfba@mail.gmail.com>	<206fcf960807030918q615ea18dw10411f17c8fc3e89@mail.gmail.com>	<fbcd16d40807031947w23d29b47ld1dbef71ba436e87@mail.gmail.com>	<87tzf53mjh.fsf_-_@gauss.cs.tamu.edu>	<fbcd16d40807041034o949558dn7c13a45a2138fa08@mail.gmail.com>	<87hcb5ikce.fsf@gauss.cs.tamu.edu>
	<fbcd16d40807041417rf689a7r24f2b3779b933aa7@mail.gmail.com>
Message-ID: <486E9EDD.7000802@hemmecke.de>

> | > | I think the way out of this mess was correctly identified by Stephen
> | > | Watt in the description of Aldor when he wrote: (ibid.):
> | > |
> | > | "Each domain is itself a value belonging to the domain Type. Domains
> | > | may additionally belong to some number of subtypes (of Type), known
> | > | as categories."
>> ...
>> Nothing in the semantics specification (the quote above without the
>> first sentence) requires Type to be a domain.

> I agree.

Yep.

I have no proof of it, but in my understanding Type is the type of all 
Aldor types including itself. Type lives conceptually above domains and 
categories. Maybe 'Type' is comparable to 'the class of all classes' in 
set theory (even if NBG
http://en.wikipedia.org/wiki/Von_Neumann%E2%80%93Bernays%E2%80%93G%C3%B6del_set_theory
does not admit it).

I know it proves nothing, but have you looked at a comment in
https://svn.origo.ethz.ch/algebraist/trunk/aldor/lib/aldor/src/lang/sal_lang.as
where it says?

-- Nice idea, but rejected by the compiler
-- Type:Category == add;

(Just a funny side remark.)

For me 'Category' and 'Type' are somewhat special.
Let me define as Saul Youssef did in Section 2 of 
http://axiom-portal.newsynthesis.org/refs/articles/Youssef-ProspectsForCategoryTheoryInAldor.pdf

   Domain: Category == with;

then I would (roughly) say that

   Type = Category + Domain + {Type}

i.e. Type comprises all categories, all domains and itself. The constant 
'Category' (which is a keyword) is on the same level as 'Type' but with 
less inhabitants than 'Type'.

Forgive me if anything is wrong, I am not a language expert.

Ralf



From daly at axiom-developer.org  Fri Jul  4 20:07:53 2008
From: daly at axiom-developer.org (root)
Date: Fri, 4 Jul 2008 20:07:53 -0400
Subject: [Aldor-l] [open-axiom-devel] [#428] 'Domain' in 'SetCategory'?
In-Reply-To: <486E9EDD.7000802@hemmecke.de> (message from Ralf Hemmecke on
	Sat, 05 Jul 2008 00:06:21 +0200)
References: <20080617145633-0700@axiom-wiki.newsynthesis.org>	<4858EADF.70701@hemmecke.de>	<fbcd16d40806180437h34a2b465i6894b58c264b7025@mail.gmail.com>	<4858F72E.5010903@hemmecke.de>	<fbcd16d40806181006v2fd89702r6e7b310fc777bfba@mail.gmail.com>	<206fcf960807030918q615ea18dw10411f17c8fc3e89@mail.gmail.com>	<fbcd16d40807031947w23d29b47ld1dbef71ba436e87@mail.gmail.com>	<87tzf53mjh.fsf_-_@gauss.cs.tamu.edu>	<fbcd16d40807041034o949558dn7c13a45a2138fa08@mail.gmail.com>	<87hcb5ikce.fsf@gauss.cs.tamu.edu>
	<fbcd16d40807041417rf689a7r24f2b3779b933aa7@mail.gmail.com>
	<486E9EDD.7000802@hemmecke.de>
Message-ID: <200807050007.m6507rw22464@localhost.localdomain>

>> | > | I think the way out of this mess was correctly identified by Stephen
>> | > | Watt in the description of Aldor when he wrote: (ibid.):
>> | > |
>> | > | "Each domain is itself a value belonging to the domain Type. Domains
>> | > | may additionally belong to some number of subtypes (of Type), known
>> | > | as categories."
>>> ...
>>> Nothing in the semantics specification (the quote above without the
>>> first sentence) requires Type to be a domain.
>
>> I agree.
>
>Yep.
>
>I have no proof of it, but in my understanding Type is the type of all 
>Aldor types including itself. Type lives conceptually above domains and 
>categories. Maybe 'Type' is comparable to 'the class of all classes' in 
>set theory (even if NBG



I think part of the struggle is the attempt to unify the ideas of
type theory with the ideas of category theory. Being able to do so
would be deeply interesting but I don't think there is a "correct"
way to do it in any theoretical sense. It seems more of a pragmatic
choice. 

>From a computational point of view, categories and domains are just
type objects. There is no obvious reason why categories could not
include methods, although the methods might be restricted to functors
from domain to domain, or predicates to test that domains which claim
to belong to the category actually do satisfy some tests (e.g. that
the domain exports the required signatures and has the required
properties, like commutativity). Types do not need to know properties
of categories or domains.

>From a mathematical point of view, Categories and domains can be
constructed without types, although to do so would end up with a very
different system than Axiom. The design decision to use types to
enforce the category/domain machinery is not a necessary design
choice, although it is rather convenient. Someone could describe type
theory using category theory but I haven't seen it.

So from a programming viewpoint, types certainly include categories
and domains (since they are objects with representation and methods).
>From a mathematical point of view, types are convenient but unnecessary
to support the category/domain hierarchy which can all be built with
things, arrows, and composition.

So, within Axiom's design, types include categories/domains but not
the other way around.

Ultimately it seems just a design decision based on expected behavior,
so that the interaction between the type theory and the category
theory aspects gives reasonable results.

Tim



From bill.page at newsynthesis.org  Fri Jul  4 19:49:33 2008
From: bill.page at newsynthesis.org (Bill Page)
Date: Fri, 4 Jul 2008 19:49:33 -0400
Subject: [Aldor-l] [open-axiom-devel] [#428] 'Domain' in 'SetCategory'?
In-Reply-To: <486E9EDD.7000802@hemmecke.de>
References: <20080617145633-0700@axiom-wiki.newsynthesis.org>
	<4858F72E.5010903@hemmecke.de>
	<fbcd16d40806181006v2fd89702r6e7b310fc777bfba@mail.gmail.com>
	<206fcf960807030918q615ea18dw10411f17c8fc3e89@mail.gmail.com>
	<fbcd16d40807031947w23d29b47ld1dbef71ba436e87@mail.gmail.com>
	<87tzf53mjh.fsf_-_@gauss.cs.tamu.edu>
	<fbcd16d40807041034o949558dn7c13a45a2138fa08@mail.gmail.com>
	<87hcb5ikce.fsf@gauss.cs.tamu.edu>
	<fbcd16d40807041417rf689a7r24f2b3779b933aa7@mail.gmail.com>
	<486E9EDD.7000802@hemmecke.de>
Message-ID: <fbcd16d40807041649v30f5cf86ka3641261747f2607@mail.gmail.com>

On Fri, Jul 4, 2008 at 6:06 PM, Ralf Hemmecke wrote:
> ...
> I have no proof of it, but in my understanding Type is the type of
> all Aldor types including itself. Type lives conceptually above
> domains and categories. Maybe 'Type' is comparable to
> 'the class of all classes' in set theory (even if NBG
> http://en.wikipedia.org/wiki/Von_Neumann%E2%80%93Bernays%E2%80%93G%C3%B6del_set_theory
> does not admit it).
>

Since there is no requirement that a Type be a classical set, I would
strongly prefer to let Type simply be non-well-founded in the sense of
http://en.wikipedia.org/wiki/Non-well-founded_set_theory

> ...
> For me 'Category' and 'Type' are somewhat special.
> Let me define as Saul Youssef did in Section 2 of
> http://axiom-portal.newsynthesis.org/refs/articles/Youssef-ProspectsForCategoryTheoryInAldor.pdf
>
>  Domain: Category == with;
>

I don't have any problems with defining a category of this sort for
specific purposes. In fact such categories are called "properties" in
all flavors of Axiom.

> then I would (roughly) say that
>
>  Type = Category + Domain + {Type}
>
> i.e. Type comprises all categories, all domains and itself. The constant
> 'Category' (which is a keyword) is on the same level as 'Type' but with
> less inhabitants than 'Type'.
>

I don't like this much since it seem to conflict with the actual usage
of these terms in both Axiom and Alsor.

> Forgive me if anything is wrong, I am not a language expert.

Well Ralf, I think you qualify as much as an "expert" as anyone else
here... :-) Thanks for contributing to the discussion.

Regards,
Bill Page.



From carette at mcmaster.ca  Fri Jul  4 21:03:36 2008
From: carette at mcmaster.ca (Jacques Carette)
Date: Fri, 04 Jul 2008 21:03:36 -0400
Subject: [Aldor-l] [open-axiom-devel] [#428] 'Domain' in 'SetCategory'?
In-Reply-To: <200807050007.m6507rw22464@localhost.localdomain>
References: <20080617145633-0700@axiom-wiki.newsynthesis.org>	<4858EADF.70701@hemmecke.de>	<fbcd16d40806180437h34a2b465i6894b58c264b7025@mail.gmail.com>	<4858F72E.5010903@hemmecke.de>	<fbcd16d40806181006v2fd89702r6e7b310fc777bfba@mail.gmail.com>	<206fcf960807030918q615ea18dw10411f17c8fc3e89@mail.gmail.com>	<fbcd16d40807031947w23d29b47ld1dbef71ba436e87@mail.gmail.com>	<87tzf53mjh.fsf_-_@gauss.cs.tamu.edu>	<fbcd16d40807041034o949558dn7c13a45a2138fa08@mail.gmail.com>	<87hcb5ikce.fsf@gauss.cs.tamu.edu>	<fbcd16d40807041417rf689a7r24f2b3779b933aa7@mail.gmail.com>	<486E9EDD.7000802@hemmecke.de>
	<200807050007.m6507rw22464@localhost.localdomain>
Message-ID: <486EC868.8090108@mcmaster.ca>

root wrote:
> I think part of the struggle is the attempt to unify the ideas of
> type theory with the ideas of category theory. Being able to do so
> would be deeply interesting but I don't think there is a "correct"
> way to do it in any theoretical sense. 
Sure there is - read Bart Jacobs's book "Categorical Logic and Type 
Theory".

Jacques



From ralf at hemmecke.de  Sat Jul  5 02:38:16 2008
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Sat, 05 Jul 2008 08:38:16 +0200
Subject: [Aldor-l] [open-axiom-devel] [#428] 'Domain' in 'SetCategory'?
In-Reply-To: <fbcd16d40807041649v30f5cf86ka3641261747f2607@mail.gmail.com>
References: <20080617145633-0700@axiom-wiki.newsynthesis.org>	
	<4858F72E.5010903@hemmecke.de>	
	<fbcd16d40806181006v2fd89702r6e7b310fc777bfba@mail.gmail.com>	
	<206fcf960807030918q615ea18dw10411f17c8fc3e89@mail.gmail.com>	
	<fbcd16d40807031947w23d29b47ld1dbef71ba436e87@mail.gmail.com>	
	<87tzf53mjh.fsf_-_@gauss.cs.tamu.edu>	
	<fbcd16d40807041034o949558dn7c13a45a2138fa08@mail.gmail.com>	
	<87hcb5ikce.fsf@gauss.cs.tamu.edu>	
	<fbcd16d40807041417rf689a7r24f2b3779b933aa7@mail.gmail.com>	
	<486E9EDD.7000802@hemmecke.de>
	<fbcd16d40807041649v30f5cf86ka3641261747f2607@mail.gmail.com>
Message-ID: <486F16D8.9030400@hemmecke.de>

>> For me 'Category' and 'Type' are somewhat special.
>> Let me define as Saul Youssef did in Section 2 of
>> http://axiom-portal.newsynthesis.org/refs/articles/Youssef-ProspectsForCategoryTheoryInAldor.pdf
>>
>>  Domain: Category == with;
>>
> 
> I don't have any problems with defining a category of this sort for
> specific purposes. In fact such categories are called "properties" in
> all flavors of Axiom.
> 
>> then I would (roughly) say that
>>
>>  Type = Category + Domain + {Type}
>>
>> i.e. Type comprises all categories, all domains and itself. The constant
>> 'Category' (which is a keyword) is on the same level as 'Type' but with
>> less inhabitants than 'Type'.
>>
> 
> I don't like this much since it seem to conflict with the actual usage
> of these terms in both Axiom and Alsor.

Why do you see a conflict here? Is, what I say, not what Doye says in
Section 2.5 of 
http://axiom-portal.newsynthesis.org/refs/articles/doye-aldor-phd.pdf/?searchterm=doye
?

items \in Domains \in Categories \in Category

where in my notation above "Domain" should just be considered the top of 
the category hierarchy. (Actually, the top is "with", I just named it 
"Domain").

Is OpenAxiom going to somehow blur the distinction between categories 
and domains?

I understand that it would be nice to really use categories as first 
class objects, but that does not mean that they must be considered as 
domains. Or does it?

Does http://axiom-portal.newsynthesis.org/refs/articles/define.pdf have 
something to do with your discussion?

Ralf



From ralf at hemmecke.de  Sat Jul  5 05:58:44 2008
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Sat, 05 Jul 2008 11:58:44 +0200
Subject: [Aldor-l] with issue
Message-ID: <486F45D4.5050609@hemmecke.de>

Hi Peter, hi Stephen

I remember that long time ago I was told that an instance where

   A with B

behaves different from

   with {A; B}

is a bug.

What would you say about the following?

---BEGIN aaa.as
#include "aldor"
A: with == add;
Cat: Category == with;
Cat2: Category == with;
extend IntegerSegment(Z: IntegerType) : with {
	Cat with {Cat2; foo: A -> A};
} == add {foo(a: A): A == a;}
---END aaa.as

Compiling with

   aldor aaa.as

results in

"aaa.as", line 5: extend IntegerSegment(Z: IntegerType) : with {
                   .............................................^
[L5 C46] #1 (Error) Improper form appearing in `with' statement.

Well, of course in that case it is easy to fix the sources, but the 
question is whether the above program should be considered a well-formed 
Aldor program. Is it?

Ralf



From ralf at hemmecke.de  Sat Jul  5 11:36:48 2008
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Sat, 05 Jul 2008 17:36:48 +0200
Subject: [Aldor-l] with issue
In-Reply-To: <73691350807050823t1f13f5f0j2ec1f0a476ce2d26@mail.gmail.com>
References: <486F45D4.5050609@hemmecke.de>
	<73691350807050823t1f13f5f0j2ec1f0a476ce2d26@mail.gmail.com>
Message-ID: <486F9510.6000403@hemmecke.de>

On 07/05/2008 05:23 PM, Peter Broadbery wrote:
> On Sat, Jul 5, 2008 at 10:58 AM, Ralf Hemmecke <ralf at hemmecke.de> wrote:
>> Hi Peter, hi Stephen
>>
>> I remember that long time ago I was told that an instance where
>>
>>  A with B
>>
>> behaves different from
>>
>>  with {A; B}
>>
>> is a bug.
>>
>> What would you say about the following?
>>
>> ---BEGIN aaa.as
>> #include "aldor"
>> A: with == add;
>> Cat: Category == with;
>> Cat2: Category == with;
>> extend IntegerSegment(Z: IntegerType) : with {
>>        Cat with {Cat2; foo: A -> A};
>> } == add {foo(a: A): A == a;}
>> ---END aaa.as
>>
>> Compiling with
>>
>>  aldor aaa.as
>>
>> results in
>>
>> "aaa.as", line 5: extend IntegerSegment(Z: IntegerType) : with {
>>                  .............................................^
>> [L5 C46] #1 (Error) Improper form appearing in `with' statement.
>>
>> Well, of course in that case it is easy to fix the sources, but the question
>> is whether the above program should be considered a well-formed Aldor
>> program. Is it?
>>
>> Ralf

> I don't think '(with C) with X' work gets through the parser either
> (not in a position to check it at the moment), so it's consistent.
> Given the parser refuses to look at the first one, making them both
> work might well be a problem.

Ooops, I would have thought, my code parses as

(*)   with (Cat with {Cat2; foo: A -> A})

instead of

(+)   (with Cat) with {Cat2; foo: A -> A}

as you see it. Why are the braces for, then?
Shouldn't they group together a sequence of statements and consider them 
basically as one statement? So (*) should apply and not (+). Where is my 
thinking error?

Ralf



From bill.page at newsynthesis.org  Mon Jul  7 23:05:21 2008
From: bill.page at newsynthesis.org (Bill Page)
Date: Mon, 7 Jul 2008 23:05:21 -0400
Subject: [Aldor-l] [open-axiom-devel] [#428] 'Domain' in 'SetCategory'?
In-Reply-To: <486F16D8.9030400@hemmecke.de>
References: <20080617145633-0700@axiom-wiki.newsynthesis.org>
	<206fcf960807030918q615ea18dw10411f17c8fc3e89@mail.gmail.com>
	<fbcd16d40807031947w23d29b47ld1dbef71ba436e87@mail.gmail.com>
	<87tzf53mjh.fsf_-_@gauss.cs.tamu.edu>
	<fbcd16d40807041034o949558dn7c13a45a2138fa08@mail.gmail.com>
	<87hcb5ikce.fsf@gauss.cs.tamu.edu>
	<fbcd16d40807041417rf689a7r24f2b3779b933aa7@mail.gmail.com>
	<486E9EDD.7000802@hemmecke.de>
	<fbcd16d40807041649v30f5cf86ka3641261747f2607@mail.gmail.com>
	<486F16D8.9030400@hemmecke.de>
Message-ID: <fbcd16d40807072005l1d353988jb72dcf1c22856ad5@mail.gmail.com>

On Sat, Jul 5, 2008 at 2:38 AM, Ralf Hemmecke wrote:
> ...
>>
>>> then I would (roughly) say that
>>>
>>>  Type = Category + Domain + {Type}
>>>
>>> i.e. Type comprises all categories, all domains and itself. The constant
>>> 'Category' (which is a keyword) is on the same level as 'Type' but with
>>> less inhabitants than 'Type'.
>>>

What do you mean by "'Category' which is a keyword"? Do you mean that
it is built-in? In that case I would not agree. In Aldor for example:

%1 >> #include "aldor"
                                           Comp: 60 msec, Interp: 0 msec
%2 >> #include "aldorinterp"
                                           Comp: 20 msec, Interp: 0 msec
%3 >> Category
  () @
 with
    ==  add ()

                                           Comp: 0 msec, Interp: 0 msec
%4 >> Type
  () @
 with
    ==  add ()

                                           Comp: 0 msec, Interp: 0 msec
%5 >> X:Category == with {};
                                           Comp: 0 msec, Interp: 0 msec
%6 >> Y:Category := X;
  () @ Category
                                           Comp: 0 msec, Interp: 0 msec
%7 >> x:X == add {};
Defined x @
X with
    ==  add ()

                                           Comp: 0 msec, Interp: 0 msec
%8 >> x has Y
T @ Boolean
                                           Comp: 0 msec, Interp: 0 msec
%9 >> y:Type := x;
 @ Type
                                           Comp: 0 msec, Interp: 0 msec
%10 >> z:Type := X;
 @ Type
                                           Comp: 0 msec, Interp: 10 msec
%11 >> y has Y
T @ Boolean
                                           Comp: 0 msec, Interp: 0 msec
%12 >> z has Y
T @ Boolean
                                           Comp: 0 msec, Interp: 0 msec


By "inhabitants" do you mean objects? E.g. the value of Y above?

> Bill Page wrote:
>> I don't like this much since it seems to conflict with the actual
>> usage of these terms in both Axiom and Aldor.
>
> Why do you see a conflict here? Is, what I say, not what Doye
> says in Section 2.5 of
> http://axiom-portal.newsynthesis.org/refs/articles/doye-aldor-phd.pdf/?searchterm=doye
> ?
>
> items \in Domains \in Categories \in Category
>

Perhaps it is almost ok if you include Doye's notation Obj(...) but
this ignores the concept of Categories as subtypes of Type. If 'x has
X' implies 'x has Y' for all x in Type then X is a subcategory of Y.

Between Axiom and Aldor the terminology is such a mess that it is hard
to say anything in a simple manner without defining everything from
basic principles.

For example, in Aldor 'Type' and 'Category' are domains. Objects are
related to domains by a membership relation. The objects of the domain
Type are themselves domains (of which Type is one and Category is
another). Categories are subtypes (subdomains) of Type arranged in a
lattice by the inclusion relation. The objects of the domain Category
are these subtypes of Type (categories). So it seems clear to me that
all values in Aldor are objects in some domain, i.e. there are no
"category-valued" objects at such but there are run-time objects of
the domain Category and the domain Type. Still, these objects are
treated as category values and domain values in the appropriate
context.

In Axiom (all flavors so far) Type is a category. The Axiom
interpreter automatically creates references to some types such as
'Domain', and 'SubDomain Domain' but these were not originally
included as built-in domains or domains in the Axiom library so values
of this kind could be implemented only in very limited ways.

OpenAxiom introduced Domain as a Domain consisting of all domains
(like Type in Aldor).  OpenAxiom also adds 'Category' as an
alternative to 'SubDomain Domain'. I believe that the intention of
OpenAxiom is that Category is a domain however it is not always
treated that way in the current revision.

> where in my notation above "Domain" should just be considered the top
> of the category hierarchy. (Actually, the top is "with", I just named it
> "Domain").
>

Names are significant for named categories. Categories reference other
categories by name. 'Category' is the domain of all categories. It's
objects are categories.

> Is OpenAxiom going to somehow blur the distinction between categories and
> domains?
>

If Aldor treats categories and domains as first order doesn't this
already blur the distinction? Although domains are never objects of
Category, both categories and domains are objects of Type.

> I understand that it would be nice to really use categories as first class
> objects, but that does not mean that they must be considered as domains.
> Or does it?
>

Yes, I think it does.

> Does http://axiom-portal.newsynthesis.org/refs/articles/define.pdf have
> something to do with your discussion?
>

Yes I think so, at least as far as it concerns Aldor. Kennedy's
description seems fairly complete but I think some of the comments
about Aldor may be a little out of date. I haven't checked everything
in detail but I think some of the issues raised by Kennedy may now be
resolved in the current release of Aldor. Perhaps OpenAxiom will also
be able to resolve these in the near future - perhaps in a somewhat
different way.

Regards,
Bill Page.



From ralf at hemmecke.de  Tue Jul  8 05:51:52 2008
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Tue, 08 Jul 2008 11:51:52 +0200
Subject: [Aldor-l] [open-axiom-devel] [#428] 'Domain' in 'SetCategory'?
In-Reply-To: <fbcd16d40807072005l1d353988jb72dcf1c22856ad5@mail.gmail.com>
References: <20080617145633-0700@axiom-wiki.newsynthesis.org>	
	<206fcf960807030918q615ea18dw10411f17c8fc3e89@mail.gmail.com>	
	<fbcd16d40807031947w23d29b47ld1dbef71ba436e87@mail.gmail.com>	
	<87tzf53mjh.fsf_-_@gauss.cs.tamu.edu>	
	<fbcd16d40807041034o949558dn7c13a45a2138fa08@mail.gmail.com>	
	<87hcb5ikce.fsf@gauss.cs.tamu.edu>	
	<fbcd16d40807041417rf689a7r24f2b3779b933aa7@mail.gmail.com>	
	<486E9EDD.7000802@hemmecke.de>	
	<fbcd16d40807041649v30f5cf86ka3641261747f2607@mail.gmail.com>	
	<486F16D8.9030400@hemmecke.de>
	<fbcd16d40807072005l1d353988jb72dcf1c22856ad5@mail.gmail.com>
Message-ID: <487338B8.9010308@hemmecke.de>

Dear Stephen,

could you clarify (***)? Thank you.

On 07/08/2008 05:05 AM, Bill Page wrote:
> On Sat, Jul 5, 2008 at 2:38 AM, Ralf Hemmecke wrote:
>> ...
>>>> then I would (roughly) say that
>>>>
>>>>  Type = Category + Domain + {Type}
>>>>
>>>> i.e. Type comprises all categories, all domains and itself. The constant
>>>> 'Category' (which is a keyword) is on the same level as 'Type' but with
>>>> less inhabitants than 'Type'.

> What do you mean by "'Category' which is a keyword"? Do you mean that
> it is built-in?

Of course, Category is built-in. That there is a definition like

Category: with == add;

in sal_lang.as does not say that it is not built-in. Also Boolean is 
built-in. And still the Aldor compiler *requires* a definition like

Boolean: with == add;

since otherwise it will not work properly. Don't ask me why the 
designers of the Aldor compiler did it in such a way that something like 
sal_lang.as is required to compile anything useful at all.

The meaning of "Category" is as in Doye's thesis.

(Section 2.5 of 
http://axiom-portal.newsynthesis.org/refs/articles/doye-aldor-phd.pdf/?searchterm=doye)

 > In that case I would not agree. In Aldor for example:
> 
> %1 >> #include "aldor"
>                                            Comp: 60 msec, Interp: 0 msec
> %2 >> #include "aldorinterp"
>                                            Comp: 20 msec, Interp: 0 msec
> %3 >> Category
>   () @
>  with
>     ==  add ()
> 
>                                            Comp: 0 msec, Interp: 0 msec
> %4 >> Type
>   () @
>  with
>     ==  add ()

Well that is as the definition in sal_lang.as, but still there is 
special treatment for them inside the compiler. And I don't think that 
output proves anything.

Aldor does also allow me to compile

---BEGIN aaa.as
#include "aldor"
extend Category: with {foo: () -> Integer} == add {foo(): Integer == 1}
-- import from Character, Integer, TextWriter;
-- stdout << foo()$Category << newline;
---END aaa.as

the only problem I have with that is that I don't know how to interpret 
it. In fact, I have the suspicion that the "Category" that prints like 
"with==add" is actually not usable at all. Uncomment the lines above and try

   aldor -fx aaa.as

My version of the compiler tells me

"aaa.as", line 4: stdout << foo()$Category << newline;
                   ...............^
[L4 C16] #1 (Error) There are no suitable meanings for the operator 
`foo$Category'.

If Category really were treated as a domain that should not happen.
I just think that a user should actually never see sal_lang.as, because 
it is misleading.

> %5 >> X:Category == with {};

> %6 >> Y:Category := X;
>   () @ Category

Fine. And Y is, of course not any different from X ...
> %7 >> x:X == add {};
> Defined x @
> X with
>     ==  add ()

> %8 >> x has Y
> T @ Boolean

... therefore that is OK, too.

> %9 >> y:Type := x;
>  @ Type

As you have defined it, x is a domain and thus a type, i.e. something of 
type Type. So that is also OK.

> %10 >> z:Type := X;
>  @ Type

As you have defined it, X is a category and thus of type Type. Also OK.

> %11 >> y has Y
> T @ Boolean

We had that discussion before (and actually also at the Aldor Workshop 
2007). Formerly I would have said that should give false. But as Stephen 
explained it should give true.

> %12 >> z has Y
> T @ Boolean

(***)
This should be considered a bug. z is a category, so the compiler is 
fooled by the definition of z: Type == X.

Hmm, maybe it's a feature and one can cure the problem with "has" in the 
definition of "List".

> By "inhabitants" do you mean objects? E.g. the value of Y above?

Actually, "object" doesn't say anything. But yes, I consider Y an 
"inhabitant" of Category, because Y: Category. And I would also consider 
Y an inhabitant of Type even though you have not explicitly said Y: 
Type. But any type in Aldor is of type Type.

>> Bill Page wrote:
>>> I don't like this much since it seems to conflict with the actual
>>> usage of these terms in both Axiom and Aldor.
>> Why do you see a conflict here? Is, what I say, not what Doye
>> says in Section 2.5 of
>> http://axiom-portal.newsynthesis.org/refs/articles/doye-aldor-phd.pdf/?searchterm=doye
>> ?
>>
>> items \in Domains \in Categories \in Category

> Perhaps it is almost ok if you include Doye's notation Obj(...)

I have no problem with that.

> but this ignores the concept of Categories as subtypes of Type.

> If 'x has X' implies 'x has Y' for all x in Type then X is a subcategory of Y.

Where do you see a problem here? Which "has" is it? In Aldor you must a 
domain in front of "has" and a category behind. You only get problems if 
you consider Type to be a domain and accept (the bug) that "z has Y" 
should give true.

> Between Axiom and Aldor the terminology is such a mess that it is hard
> to say anything in a simple manner without defining everything from
> basic principles.

Maybe we should start writing Aldor-has, OpenAxiom-has, etc. 
Aldor-Category, OpenAxiom-Category. ;-) at least it would clarify a bit 
more.

> For example, in Aldor 'Type' and 'Category' are domains.

Sorry, I don't agree. Where have you found that in the AUG? I don't 
accept compiler output as an argument.

> Objects are
> related to domains by a membership relation. The objects of the domain
> Type are themselves domains (of which Type is one and Category is
> another). Categories are subtypes (subdomains) of Type arranged in a
> lattice by the inclusion relation. The objects of the domain Category
> are these subtypes of Type (categories).

Bill, could you give exact AUG page references for this?

> So it seems clear to me that
> all values in Aldor are objects in some domain, i.e. there are no
> "category-valued" objects at such but there are run-time objects of
> the domain Category and the domain Type. Still, these objects are
> treated as category values and domain values in the appropriate
> context.

Sorry, I don't understand that.

> In Axiom (all flavors so far) Type is a category.

Reference to such a definition?

> The Axiom
> interpreter automatically creates references to some types such as
> 'Domain', and 'SubDomain Domain' but these were not originally
> included as built-in domains or domains in the Axiom library so values
> of this kind could be implemented only in very limited ways.
> 
> OpenAxiom introduced Domain as a Domain consisting of all domains
> (like Type in Aldor).

In my opinion, categories in Aldor are not domains. So I don't agree 
with "like Type in Aldor", because Type comprises domains and categories.

> OpenAxiom also adds 'Category' as an alternative to 'SubDomain Domain'.

Really? Gaby, does that mean that in OpenAxiom a category is 
(conceptually) a domain? I don't speak of implementation details here. 
That one can (perhaps) implement categories and domains (by the latter I 
mean the collection of all things of type C where C is any category) by 
the same data structure and find a common name for that data structure. 
But I would find it confusing if that concept is also called "domain".

Gaby, what do you consider to be a domain? Such a data structure concept 
or simply something that has a category as its type?

> I believe that the intention of
> OpenAxiom is that Category is a domain however it is not always
> treated that way in the current revision.

Again, that is confusing to me. Is it possible to choose some other name 
for that? "domain" should not be as meaningless as object is nowadays.

>> where in my notation above "Domain" should just be considered the top
>> of the category hierarchy. (Actually, the top is "with", I just named it
>> "Domain").

> Names are significant for named categories. Categories reference other
> categories by name. 'Category' is the domain of all categories. It's
> objects are categories.

If you had written "'Category' is the class of all categories.", I would 
relax. But you used "domain" and that confuses me.

>> Is OpenAxiom going to somehow blur the distinction between categories and
>> domains?

> If Aldor treats categories and domains as first order doesn't this
> already blur the distinction?

Not for me.

> Although domains are never objects of Category, both categories and
 > domains are objects of Type.

There is no problem with that. Or do you see one?

>> I understand that it would be nice to really use categories as first class
>> objects, but that does not mean that they must be considered as domains.
>> Or does it?

> Yes, I think it does.

No, it doesn't. What you want, is that categories and domains (by the 
latter I mean the collection of all things of type C where C is any 
category) are treated in the same way (first class objects). So that is 
more in the sense of a common data structure that I mentioned above. I 
have no problem with that common treatment, but please don't call it 
"domain". Maybe call it "class" or "magma" or whatever, but not "domain".

Let us clarify. I have started with my definitions on

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

Add yours.

Ralf



From bill.page at newsynthesis.org  Tue Jul  8 14:00:54 2008
From: bill.page at newsynthesis.org (Bill Page)
Date: Tue, 8 Jul 2008 14:00:54 -0400
Subject: [Aldor-l] [open-axiom-devel] [#428] 'Domain' in 'SetCategory'?
In-Reply-To: <487338B8.9010308@hemmecke.de>
References: <20080617145633-0700@axiom-wiki.newsynthesis.org>
	<87tzf53mjh.fsf_-_@gauss.cs.tamu.edu>
	<fbcd16d40807041034o949558dn7c13a45a2138fa08@mail.gmail.com>
	<87hcb5ikce.fsf@gauss.cs.tamu.edu>
	<fbcd16d40807041417rf689a7r24f2b3779b933aa7@mail.gmail.com>
	<486E9EDD.7000802@hemmecke.de>
	<fbcd16d40807041649v30f5cf86ka3641261747f2607@mail.gmail.com>
	<486F16D8.9030400@hemmecke.de>
	<fbcd16d40807072005l1d353988jb72dcf1c22856ad5@mail.gmail.com>
	<487338B8.9010308@hemmecke.de>
Message-ID: <fbcd16d40807081100i75d1e347n645edfbc68af028b@mail.gmail.com>

On Tue, Jul 8, 2008 at 5:51 AM, Ralf Hemmecke wrote:
> On 07/08/2008 05:05 AM, Bill Page wrote:
>
> Of course, Category is built-in. That there is a definition like
>
> Category: with == add;
>
> in sal_lang.as does not say that it is not built-in. Also Boolean is
> built-in. And still the Aldor compiler *requires* a definition like
>
> Boolean: with == add;
>
> since otherwise it will not work properly. Don't ask me why the designers
> of the Aldor compiler did it in such a way that something like sal_lang.as
> is required to compile anything useful at all.
>

I think I understand why. It is not unusual that that compile requires
some minimal built-in "bootstrap" assumptions about fundamental things
- just to get things started. But Aldor is designed with a bare
minimum of such built-in assumptions. Everything else is defined in
some library.

> ...
> Aldor does also allow me to compile
>
> ---BEGIN aaa.as
> #include "aldor"
> extend Category: with {foo: () -> Integer} == add {foo(): Integer == 1}
> -- import from Character, Integer, TextWriter;
> -- stdout << foo()$Category << newline;
> ---END aaa.as
>
> the only problem I have with that is that I don't know how to interpret
> it.

What is it unclear?

> In fact, I have the suspicion that the "Category" that prints like
> "with==add" is actually not usable at all. Uncomment the lines above and try
>
>  aldor -fx aaa.as
>
> My version of the compiler tells me
>
> "aaa.as", line 4: stdout << foo()$Category << newline;
>                  ...............^
> [L4 C16] #1 (Error) There are no suitable meanings for the operator
> `foo$Category'.
>
> If Category really were treated as a domain that should not happen.

Apparently this construction (extending the domain Category) was not
fully anticipated in Aldor and not fully tested. I wonder what would
happen if you modified the library containing the definition of
Category? Of course this still may not work correctly because the
compiler may be making some implicit assumptions about Category.

> I just think that a user should actually never see sal_lang.as, because
> it is misleading.
>

Perhaps there are some libraries that are closer to the system level
that would not normally be changed by a user only interested in
computer algebra. But as far as the language Aldor is concerned, a
library is a library.

> ...
>>    %5 >> X:Category == with {};
>>
> >   %6 >> Y:Category := X;
> >    () @ Category
>> ...
>> %10 >> z:Type := X;
>>  @ Type
>
> As you have defined it, X is a category and thus of type Type. Also OK.
>

But what is z? It is variable with values in the domain Type. The
objects of Type are either domains or categories.

>> %11 >> y has Y
>> T @ Boolean
>
> We had that discussion before (and actually also at the Aldor Workshop
> 2007). Formerly I would have said that should give false. But as Stephen
> explained it should give true.
>
>> %12 >> z has Y
>> T @ Boolean
>
> (***)
> This should be considered a bug. z is a category, so the compiler is
> fooled by the definition of z: Type == X.
>
> Hmm, maybe it's a feature and one can cure the problem with "has"
> in the definition of "List".
>

The Aldor Users Guide says:

  A ``has'' expression has the following form:

      dom has cat

  where dom is a domain-valued expression, and cat is a
category-valued expression.

but perhaps 'has' actually allows dom to be type-valued. So in this
case, yes I think it could cure the problem with "List Type", except
that in the current compiler one often gets: "Segmentation fault".
This I would consider definitely a bug.

>> By "inhabitants" do you mean objects? E.g. the value of Y above?
>
> Actually, "object" doesn't say anything. But yes, I consider Y an
> "inhabitant" of Category, because Y: Category. And I would also consider Y
> an inhabitant of Type even though you have not explicitly said Y: Type. But
> any type in Aldor is of type Type.
>

I think it is confusing to invent a new name like "inhabitant". Object
is fairly standard but comes from object-oriented programming. In
Aldor values do not carry any type information, so they are not
"objects" in this sense. I would agree to do what the Aldor users
guide does and use only the term "value". So your "inhabitants" and my
"objects" are just values of some type.

> ...
>> If 'x has X' implies 'x has Y' for all x in Type then X is a subcategory
>> of Y.
>
> Where do you see a problem here?

No problem. This is just the definition of subcategory.

>
>> For example, in Aldor 'Type' and 'Category' are domains.
>
> Sorry, I don't agree. Where have you found that in the AUG?

See references to AUG and to an article by Stephen Watt at:
http://axiom-wiki.newsynthesis.org/SandboxTypeDefinitions

>
>> Objects are related to domains by a membership relation. The
>> objects of the domain Type are themselves domains (of which
>> Type is one and Category is another). Categories are subtypes
>> (subdomains) of Type arranged in a lattice by the inclusion relation.
>> The objects of the domain Category are these subtypes of Type
>> (categories).
>
> Bill, could you give exact AUG page references for this?
>

Just substitute "values" where "objects" occur in the text above. I
added these definitions from AUG on the web page you created mentioned
above.

>> So it seems clear to me that all values in Aldor are objects in some
>> domain, i.e. there are no "category-valued" objects at such but there
>> are run-time objects of the domain Category and the domain Type.
>> Still, these objects are treated as category values and domain values
>> in the appropriate context.
>
> Sorry, I don't understand that.
>

So it seems clear to me that all values in Aldor are values in some
domain, i.e. there are no "category-valued" objects at such but there
are run-time values of the domain Category and the domain Type.
Still, these valuess are treated as category values and domain values
in the appropriate context.

Better?

>> In Axiom (all flavors so far) Type is a category.
>
> Reference to such a definition?
>

"Type

a category with no operations or attributes, of which all other
categories in Axiom are extensions."

from Appendix B of the Axiom book, page 1083.

>> The Axiom
>> interpreter automatically creates references to some types such as
>> 'Domain', and 'SubDomain Domain' but these were not originally
>> included as built-in domains or domains in the Axiom library so values
>> of this kind could be implemented only in very limited ways.
>>
>> OpenAxiom introduced Domain as a Domain consisting of all domains
>> (like Type in Aldor).
>
> In my opinion, categories in Aldor are not domains. So I don't agree with
> "like Type in Aldor", because Type comprises domains and categories.
>

In Aldor values of Type are domains and categories. In OpenAxiom as it
works today values of Domain are domains or categories so that is why
I said "like Type in Aldor".

>> OpenAxiom also adds 'Category' as an alternative to 'SubDomain Domain'.
>
> Really? Gaby, does that mean that in OpenAxiom a category is
> (conceptually) a domain? I don't speak of implementation details here.
> That one can (perhaps) implement categories and domains (by the latter
> I mean the collection of all things of type C where C is any category) by
> the same data structure and find a common name for that data structure.
> But I would find it confusing if that concept is also called "domain".
>

Aldor uses the name 'Type' for the domain (data structure) that
includes both domains and categories. In Axiom Type refers to the
category as referenced above. So either this has to change or
OpenAxiom needs some other name for the domain. Using the name
'Domain' does not seem all that confusing to me. Then a 'Domain' is
the only thing in the system that represents a user accessible data
structure of some kind. To say that

- Domain is a Domain
- Category is a Domain
- Type is a Category

is perhaps simpler than Aldor's

  - Domain is a Type
  - Category is a Type
  - Type is a Domain

> Gaby, what do you consider to be a domain? Such a data structure concept or
> simply something that has a category as its type?
>

In Axiom a domain is still something that has a category as its type
because categories are subdomains of Domain (just like categories are
subtypes of Type in Aldor).

>> I believe that the intention of OpenAxiom is that Category is a
>> domain however it is not always treated that way in the current revision.
>
> Again, that is confusing to me. Is it possible to choose some other name
> for that? "domain" should not be as meaningless as object is nowadays.
>

The concept of "domain" still seems clear to me. That is another
reason why I do not particularly like the idea of using "Domain" as
the top of the category hierarchy - that is confusing unless you
realize how these terms are used differently in Axiom and Aldor.

>>> where in my notation above "Domain" should just be considered the top
>>> of the category hierarchy. (Actually, the top is "with", I just named it
>>> "Domain").
>
>> Names are significant for named categories. Categories reference other
>> categories by name. 'Category' is the domain of all categories. It's
>> objects are categories.
>
> If you had written "'Category' is the class of all categories.", I would
> relax. But you used "domain" and that confuses me.

Is it better if I said: "It's values are categories."?

>
>>> I understand that it would be nice to really use categories as first
>>> class objects, but that does not mean that they must be considered
>>> as domains. Or does it?
>
>> Yes, I think it does.
>
> No, it doesn't. What you want, is that categories and domains (by the latter
> I mean the collection of all things of type C where C is any category) are
> treated in the same way (first class objects). So that is more in the sense
> of a common data structure that I mentioned above. I have no problem with
> that common treatment, but please don't call it "domain". Maybe call it
> "class" or "magma" or whatever, but not "domain".
>

But domains are precisely those things which allow us to define data
structures (of all kinds).

> Let us clarify. I have started with my definitions on
>
> http://axiom-wiki.newsynthesis.org/SandboxTypeDefinitions
>
> Add yours.
>

Do you mean "add my proposal for how this should work in OpenAxiom" or
my understanding of how it works now in Aldor? (I have already done
the latter.)

Regards,
Bill Page.



From nic at worldofnic.org  Tue Jul  8 17:27:08 2008
From: nic at worldofnic.org (Nicolas Doye)
Date: Tue, 8 Jul 2008 22:27:08 +0100
Subject: [Aldor-l] 'Domain' in 'SetCategory'?
Message-ID: <72d65e2d0807081427q9616273nd1966314c5d0994e@mail.gmail.com>

Bill Naylor pointed me at this discussion, so I've quickly subscribed.

I'm less familiar with Aldor - Axiom 1.x/2.x was more my thing.

I am rather confused as to Aldor's "Type" - from my brief perusing of
the e-mail chain, it appears to be a meta-programming piece of fun,
which you are now stuck with, not derived from a piece of serious
Mathematical design ??? (Pinch of salt required, perhaps).

My view (from my Axiom-centric brain) is to get rid of it. Why should
a both Integer and SetCategory have "Type"? Obj(SetCategory) doesn't
form a Set, but you want to think of it in the same way as the
collection (set) of all Integers? From some purist view, you may want
to use Functors and deal with Classes (things that don't form Sets) in
the same way as you use +(Int, Int) -> Int  but In Axiom they are
fundamentally different, and changing that would involve rewriting
pretty much all of it from scratch.

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

Note: I don't think the notation "Integer \in Obj(Ring)" is my
invention - it may be from Mac Lane, but I can't remember.

If I've got the wrong end of the stick let me know. I'm a bit rusty.
Nic Doye
--
http://worldofnic.org



From ralf at hemmecke.de  Wed Jul  9 11:00:46 2008
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Wed, 09 Jul 2008 17:00:46 +0200
Subject: [Aldor-l] Is Type a category?
In-Reply-To: <206fcf960807081642i7b459d53j5027443c76bfa87c@mail.gmail.com>
References: <4873E98A.2050703@hemmecke.de>
	<206fcf960807081642i7b459d53j5027443c76bfa87c@mail.gmail.com>
Message-ID: <4874D29E.50909@hemmecke.de>

Hello Stephen,

Could you also state your understanding of what Category, Type, domain 
etc. actually mean.

Would be nice if you could enter your definitions into

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

in particular, I would be interested to know whether 'Type' in Aldor is 
an Aldor-category, ie. not only Type: Type but also Type: Category.

Thank you in advance
Ralf

PS: Related link:
http://axiom.svn.sourceforge.net/viewvc/axiom/trunk/axiom/src/algebra/coerce.spad.pamphlet?revision=651&view=markup
where a definition says
Type(): Category == with nil


On 07/09/2008 01:42 AM, Gabriel Dos Reis wrote:
> On Tue, Jul 8, 2008 at 5:26 PM, Ralf Hemmecke <ralf at hemmecke.de> wrote:
> 
>> Somehow I now have the impression that Aldor-Type and OpenAxiom-Type are
>> different. That "Type" is a category in OpenAxiom would have never come
>> to my mind in Aldor.
> 
> Notice that, as far as I can determine, Type is a category is all current AXIOM
> systems.
> 
> -- Gaby



From ralf at hemmecke.de  Wed Jul  9 13:00:23 2008
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Wed, 09 Jul 2008 19:00:23 +0200
Subject: [Aldor-l] [open-axiom-devel] [#428] 'Domain' in 'SetCategory'?
In-Reply-To: <fbcd16d40807081100i75d1e347n645edfbc68af028b@mail.gmail.com>
References: <20080617145633-0700@axiom-wiki.newsynthesis.org>	
	<87tzf53mjh.fsf_-_@gauss.cs.tamu.edu>	
	<fbcd16d40807041034o949558dn7c13a45a2138fa08@mail.gmail.com>	
	<87hcb5ikce.fsf@gauss.cs.tamu.edu>	
	<fbcd16d40807041417rf689a7r24f2b3779b933aa7@mail.gmail.com>	
	<486E9EDD.7000802@hemmecke.de>	
	<fbcd16d40807041649v30f5cf86ka3641261747f2607@mail.gmail.com>	
	<486F16D8.9030400@hemmecke.de>	
	<fbcd16d40807072005l1d353988jb72dcf1c22856ad5@mail.gmail.com>	
	<487338B8.9010308@hemmecke.de>
	<fbcd16d40807081100i75d1e347n645edfbc68af028b@mail.gmail.com>
Message-ID: <4874EEA7.7030909@hemmecke.de>

>>> %5 >> X:Category == with {};
>>> 
>>> %6 >> Y:Category := X; () @ Category ... %10 >> z:Type := X; @
>>> Type
>> As you have defined it, X is a category and thus of type Type. Also
>> OK.

> But what is z? It is variable with values in the domain Type. The 
> objects of Type are either domains or categories.

After assignment z is a category since z is equal to X. You can also
make z a domain.

%3 >> X: Category == with;
                                            Comp: 10 msec, Interp: 0 msec
%4 >> x: X == add
Defined x @
X with
     ==  add ()

                                            Comp: 0 msec, Interp: 0 msec
%5 >> z: Type := X
   () @ Type
                                            Comp: 0 msec, Interp: 0 msec
%6 >> z: Type := x
   () @ Type

In any case, I don't see how useful z is, since Type does not export
anything.

>>> %11 >> y has Y T @ Boolean
>> We had that discussion before (and actually also at the Aldor
>> Workshop 2007). Formerly I would have said that should give false.
>> But as Stephen explained it should give true.
>> 
>>> %12 >> z has Y T @ Boolean
>> (***) This should be considered a bug. z is a category, so the
>> compiler is fooled by the definition of z: Type == X.
>> 
>> Hmm, maybe it's a feature and one can cure the problem with "has" 
>> in the definition of "List".
>> 
> 
> The Aldor Users Guide says:
> 
> A ``has'' expression has the following form:
> 
> dom has cat
> 
> where dom is a domain-valued expression, and cat is a category-valued
> expression.
> 
> but perhaps 'has' actually allows dom to be type-valued. So in this 
> case, yes I think it could cure the problem with "List Type", except 
> that in the current compiler one often gets: "Segmentation fault". 
> This I would consider definitely a bug.

I certainly don't rewrite the library to build on such a vague feature
of the compiler. That only calls for more segfaults later.

>>> By "inhabitants" do you mean objects? E.g. the value of Y above?
>> Actually, "object" doesn't say anything. But yes, I consider Y an 
>> "inhabitant" of Category, because Y: Category. And I would also
>> consider Y an inhabitant of Type even though you have not
>> explicitly said Y: Type. But any type in Aldor is of type Type.

> I think it is confusing to invent a new name like "inhabitant".
> Object is fairly standard but comes from object-oriented programming.
> In Aldor values do not carry any type information, so they are not 
> "objects" in this sense. I would agree to do what the Aldor users 
> guide does and use only the term "value". So your "inhabitants" and
> my "objects" are just values of some type.

Good. I can live with that.

>>> For example, in Aldor 'Type' and 'Category' are domains.
>> Sorry, I don't agree. Where have you found that in the AUG?

> See references to AUG and to an article by Stephen Watt at: 
> http://axiom-wiki.newsynthesis.org/SandboxTypeDefinitions

I've seen it in Stephen's article. But can you give the exact page
number in the .pdf version of the AUG? Or the exact link to the
information "'Type' and 'Category' are domains".

>>> Objects are related to domains by a membership relation. The 
>>> objects of the domain Type are themselves domains (of which Type
>>> is one and Category is another). Categories are subtypes 
>>> (subdomains) of Type arranged in a lattice by the inclusion
>>> relation. The objects of the domain Category are these subtypes
>>> of Type (categories).
>> Bill, could you give exact AUG page references for this?

> Just substitute "values" where "objects" occur in the text above. I 
> added these definitions from AUG on the web page you created
> mentioned above.

Still, I cannot find this wording in the AUG. Where is it? Searching for
'related' in the .pdf doesn't give too many items. And it's not among them.

>>> So it seems clear to me that all values in Aldor are objects in
>>> some domain, i.e. there are no "category-valued" objects at such
>>> but there are run-time objects of the domain Category and the
>>> domain Type. Still, these objects are treated as category values
>>> and domain values in the appropriate context.
>> Sorry, I don't understand that.

> So it seems clear to me that all values in Aldor are values in some 
> domain, i.e. there are no "category-valued" objects at such but there
>  are run-time values of the domain Category and the domain Type. 
> Still, these valuess are treated as category values and domain values
>  in the appropriate context.
> 
> Better?

I'd say, no.

If

X: Category == with;

then you don't call X "category-valued"? What happens at run-time is
another question, but this depends on how a compiler implements the
concept of a value of Category. I'd like to understand the relation of
all these names 'Type', 'Category', 'domain', 'Domain', etc. without
referring to an actual "data structure at runtime".

>>> In Axiom (all flavors so far) Type is a category.
>> Reference to such a definition?

> "Type

> a category with no operations or attributes, of which all other 
> categories in Axiom are extensions."
> 
> from Appendix B of the Axiom book, page 1083.

Hmmm, then why is there Type at all? "with" is exactly such a category.
'Type' is then only another name for "with" and less useful.

However, it is not just another name. Look at the definition of List.

List(T: Type): ...

It would be more restricted to write

List(T: with): ...

since then List would only accept categories as an argument.

>>> The Axiom interpreter automatically creates references to some
>>> types such as 'Domain', and 'SubDomain Domain' but these were not
>>> originally included as built-in domains or domains in the Axiom
>>> library so values of this kind could be implemented only in very
>>> limited ways.
>>> 
>>> OpenAxiom introduced Domain as a Domain consisting of all domains
>>>  (like Type in Aldor).
>> In my opinion, categories in Aldor are not domains. So I don't
>> agree with "like Type in Aldor", because Type comprises domains and
>> categories.

> In Aldor values of Type are domains and categories. In OpenAxiom as
> it works today values of Domain are domains or categories so that is
> why I said "like Type in Aldor".

OK, I understand. But that makes the world more complicated.

In Aldor:
We certainly agree that any aldor-type has the type 'Type'.
So that is fine (concerning the *name* 'Type').

In OpenAxiom:
Every domain has type 'Domain'. Fine.
Every category has type 'Category'. Fine.
But also every category has type 'Domain'. That is not so nice.

>>> OpenAxiom also adds 'Category' as an alternative to 'SubDomain
>>> Domain'.
>> Really? Gaby, does that mean that in OpenAxiom a category is 
>> (conceptually) a domain? I don't speak of implementation details
>> here. That one can (perhaps) implement categories and domains (by
>> the latter I mean the collection of all things of type C where C is
>> any category) by the same data structure and find a common name for
>> that data structure. But I would find it confusing if that concept
>> is also called "domain".
>> 
> 
> Aldor uses the name 'Type' for the domain (data structure) that 
> includes both domains and categories.

Ooops. Who told you that the internal data structures of domains and
categories are the same in the one and only Aldor compiler.

> In Axiom Type refers to the category as referenced above. So either
> this has to change or OpenAxiom needs some other name for the domain.
> Using the name 'Domain' does not seem all that confusing to me. Then
> a 'Domain' is the only thing in the system that represents a user
> accessible data structure of some kind. To say that
> 
> - Domain is a Domain - Category is a Domain - Type is a Category
> 
> is perhaps simpler than Aldor's
> 
> - Domain is a Type - Category is a Type - Type is a Domain

Who knows? I somehow start thinking that all this discussion has 'the 
implementation of reflection' as its background. True?

>> Gaby, what do you consider to be a domain? Such a data structure
>> concept or simply something that has a category as its type?

> In Axiom a domain is still something that has a category as its type 
> because categories are subdomains of Domain (just like categories are
> subtypes of Type in Aldor).

>>> I believe that the intention of OpenAxiom is that Category is a 
>>> domain however it is not always treated that way in the current
>>> revision.
>> Again, that is confusing to me. Is it possible to choose some other
>> name for that? "domain" should not be as meaningless as object is
>> nowadays.
>> 
> 
> The concept of "domain" still seems clear to me. That is another 
> reason why I do not particularly like the idea of using "Domain" as 
> the top of the category hierarchy - that is confusing unless you 
> realize how these terms are used differently in Axiom and Aldor.
> 
>>>> where in my notation above "Domain" should just be considered
>>>> the top of the category hierarchy. (Actually, the top is
>>>> "with", I just named it "Domain").
>>> Names are significant for named categories. Categories reference
>>> other categories by name. 'Category' is the domain of all
>>> categories. It's objects are categories.
>> If you had written "'Category' is the class of all categories.", I
>> would relax. But you used "domain" and that confuses me.
> 
> Is it better if I said: "It's values are categories."?

"It's" refers to what? If you mean "values of Category are called 
categories", I relax, since that is the same as saying "a category has 
'Category' as its type".

>> Let us clarify. I have started with my definitions on
>> 
>> http://axiom-wiki.newsynthesis.org/SandboxTypeDefinitions
>> 
>> Add yours.

> Do you mean "add my proposal for how this should work in OpenAxiom"
> or my understanding of how it works now in Aldor? (I have already
> done the latter.)

What I mean is to define *your* use of those concepts. So that whenever 
'domain', 'Domain', 'Type', etc. appears in a mail from you, I can 
always go to the page above and look up your definition.
I'd like to record the status so that we understand each other better.
So there should actually be no reference to Aldor or panAxiom.
If you have proposals for a better future, write them down, too, but 
mark it as "Proposal".

Ralf



From gdr at cs.tamu.edu  Wed Jul  9 13:08:28 2008
From: gdr at cs.tamu.edu (Gabriel Dos Reis)
Date: 09 Jul 2008 12:08:28 -0500
Subject: [Aldor-l] [open-axiom-devel] [#428] 'Domain' in 'SetCategory'?
In-Reply-To: <4874EEA7.7030909@hemmecke.de>
References: <20080617145633-0700@axiom-wiki.newsynthesis.org>
	<87tzf53mjh.fsf_-_@gauss.cs.tamu.edu>
	<fbcd16d40807041034o949558dn7c13a45a2138fa08@mail.gmail.com>
	<87hcb5ikce.fsf@gauss.cs.tamu.edu>
	<fbcd16d40807041417rf689a7r24f2b3779b933aa7@mail.gmail.com>
	<486E9EDD.7000802@hemmecke.de>
	<fbcd16d40807041649v30f5cf86ka3641261747f2607@mail.gmail.com>
	<486F16D8.9030400@hemmecke.de>
	<fbcd16d40807072005l1d353988jb72dcf1c22856ad5@mail.gmail.com>
	<487338B8.9010308@hemmecke.de>
	<fbcd16d40807081100i75d1e347n645edfbc68af028b@mail.gmail.com>
	<4874EEA7.7030909@hemmecke.de>
Message-ID: <87prpn7zoz.fsf@gauss.cs.tamu.edu>

Ralf Hemmecke <ralf at hemmecke.de> writes:

[...]

| In OpenAxiom:
| Every domain has type 'Domain'. Fine.
| Every category has type 'Category'. Fine.
| But also every category has type 'Domain'. That is not so nice.
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

I don't know how that come to be -- if true, it is a surprise to me.

-- Gaby



From ralf at hemmecke.de  Wed Jul  9 13:19:54 2008
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Wed, 09 Jul 2008 19:19:54 +0200
Subject: [Aldor-l] [open-axiom-devel] [#428] 'Domain' in 'SetCategory'?
In-Reply-To: <87prpn7zoz.fsf@gauss.cs.tamu.edu>
References: <20080617145633-0700@axiom-wiki.newsynthesis.org>	<87tzf53mjh.fsf_-_@gauss.cs.tamu.edu>	<fbcd16d40807041034o949558dn7c13a45a2138fa08@mail.gmail.com>	<87hcb5ikce.fsf@gauss.cs.tamu.edu>	<fbcd16d40807041417rf689a7r24f2b3779b933aa7@mail.gmail.com>	<486E9EDD.7000802@hemmecke.de>	<fbcd16d40807041649v30f5cf86ka3641261747f2607@mail.gmail.com>	<486F16D8.9030400@hemmecke.de>	<fbcd16d40807072005l1d353988jb72dcf1c22856ad5@mail.gmail.com>	<487338B8.9010308@hemmecke.de>	<fbcd16d40807081100i75d1e347n645edfbc68af028b@mail.gmail.com>	<4874EEA7.7030909@hemmecke.de>
	<87prpn7zoz.fsf@gauss.cs.tamu.edu>
Message-ID: <4874F33A.1070602@hemmecke.de>

On 07/09/2008 07:08 PM, Gabriel Dos Reis wrote:
> Ralf Hemmecke <ralf at hemmecke.de> writes:
> 
> [...]
> 
> | In OpenAxiom:
> | Every domain has type 'Domain'. Fine.
> | Every category has type 'Category'. Fine.
> | But also every category has type 'Domain'. That is not so nice.
>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> I don't know how that come to be -- if true, it is a surprise to me.

I only rephrased what I understood from Bill's mail. Bill I hope I cited 
you correctly.

Gaby, if "every category has type 'Domain'" is false for OpenAxiom, that 
makes me relax. I simply don't know/understand too much of the 
internals. That Boot code is still too much for me.

Ralf



From ralf at hemmecke.de  Thu Jul 10 00:29:55 2008
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Thu, 10 Jul 2008 06:29:55 +0200
Subject: [Aldor-l] {Spam?} bug with iterate
Message-ID: <48759043.1020807@hemmecke.de>

Hello,

that looks like a bug to me.

By mistake I've put an 'iterate' not in a 'repeat' body.
I think the compiler should reject that program instead of compiling it 
and then looping forever when I running the program.

Ralf

aldor -fx -laldor bugIterate.as
bugIterate
foo0 = 1
foo1 = 1
foo0 = 2
-- program doesn't stop


---BEGIN bugIterate.as
#include "aldor"
#include "aldorio"
import from Integer;
foo(i: Integer): () == {
	stdout << "foo0 = " << i << newline;
	if even? i then iterate;
	stdout << "foo1 = " << i << newline;
}
main(): () == for i in 1..5 repeat foo(i);
main();
---END bugIterate.as



From ralf at hemmecke.de  Fri Jul 11 07:29:03 2008
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Fri, 11 Jul 2008 13:29:03 +0200
Subject: [Aldor-l] {Spam?} bug with iterate
In-Reply-To: <73691350807110315r10a5056ey204cbdda2bf43c15@mail.gmail.com>
References: <48759043.1020807@hemmecke.de>
	<73691350807110315r10a5056ey204cbdda2bf43c15@mail.gmail.com>
Message-ID: <487743FF.5080009@hemmecke.de>

Peter,

I somehow don't see your messages recorded on the aldor-l archive. 
Aren't you subscribed?

Ralf

On 07/11/2008 12:15 PM, Peter Broadbery wrote:
> On Thu, Jul 10, 2008 at 5:29 AM, Ralf Hemmecke <ralf at hemmecke.de> wrote:
>> Hello,
>>
>> that looks like a bug to me.
>>
>> By mistake I've put an 'iterate' not in a 'repeat' body.
>> I think the compiler should reject that program instead of compiling it
>> and then looping forever when I running the program.
>>
>> Ralf
>>
>> aldor -fx -laldor bugIterate.as
>> bugIterate
>> foo0 = 1
>> foo1 = 1
>> foo0 = 2
>> -- program doesn't stop
>>
>>
>> ---BEGIN bugIterate.as
>> #include "aldor"
>> #include "aldorio"
>> import from Integer;
>> foo(i: Integer): () == {
>>        stdout << "foo0 = " << i << newline;
>>        if even? i then iterate;
>>        stdout << "foo1 = " << i << newline;
>> }
>> main(): () == for i in 1..5 repeat foo(i);
>> main();
>> ---END bugIterate.as
>>
> 
> Looks to be an unimplemented check, with code generation producing
> something daft.  The obvious fix is to add some code to recognise an
> iterate (or break) that's not within a repeat clause - the code would
> go into abcheck.c.  Only difficulty is in ensuring that one follows
> the syntax correctly - a break would be allowed only within contained
> sequence, conditions, exit clauses, try/catch clauses and probably one
> or two constructs.
> 
> Peter




From casper at unbc.ca  Tue Jul 22 19:37:34 2008
From: casper at unbc.ca (David Casperson)
Date: Tue, 22 Jul 2008 16:37:34 -0700 (PDT)
Subject: [Aldor-l] Access to aquarium
Message-ID: <alpine.OSX.1.00.0807221635010.21668@tl-fac-1-226-53.unbc.ca>

Can anyone access https://aquarium.aldor.csd.uwo.ca:443/ ?

I keep getting "could not connect to server" messages.

David
-- 
David Casperson
Computer Science



From casper at unbc.ca  Tue Jul 22 19:45:53 2008
From: casper at unbc.ca (David Casperson)
Date: Tue, 22 Jul 2008 16:45:53 -0700 (PDT)
Subject: [Aldor-l] OUTFLAG in aldor/tools/unix/Makefile
Message-ID: <alpine.OSX.1.00.0807221638530.21668@tl-fac-1-226-53.unbc.ca>

Hi folks,

someone has customized the aldor/tools/unix/Makefile so that instead of 
writing "-o" in DOCC commands there is indirection through $OUTFLAG. 
However, the space between -o and the target has been dropped, and this 
does not work with gcc 4.something, at least on Mac OS X Leopard.

Is there an operating system out there where we MUST write
     docc ... -otarget
rather than
     docc ... -o target
?

Can anyone else build aldor with gcc 4.x ?

David
-- 
Dr. David Casperson, Assistant Professor     |  casper at unbc.ca
Department of Computer Science               |  (250)   960-6672 Fax 960-5544
College of Science and Management            |  3333 University Way
University of Northern British Columbia      |  Prince George, BC   V2N 4Z9
                                              |  CANADA



From ralf at hemmecke.de  Wed Jul 23 02:23:58 2008
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Wed, 23 Jul 2008 08:23:58 +0200
Subject: [Aldor-l] OUTFLAG in aldor/tools/unix/Makefile
In-Reply-To: <alpine.OSX.1.00.0807221638530.21668@tl-fac-1-226-53.unbc.ca>
References: <alpine.OSX.1.00.0807221638530.21668@tl-fac-1-226-53.unbc.ca>
Message-ID: <4886CE7E.4050509@hemmecke.de>

svn blame 
https://svn.origo.ethz.ch/algebraist/trunk/aldor/aldor/tools/unix/Makefile 


answers both of your mails.

Unfortunately the old CVS archive is not public. :-( Or do you know 
where Laurentiu put it?

I think I was able to build with gcc4, but I am not 100% sure that it 
really works as it should.

Ralf


On 07/23/2008 01:45 AM, David Casperson wrote:
> Hi folks,
> 
> someone has customized the aldor/tools/unix/Makefile so that instead of 
> writing "-o" in DOCC commands there is indirection through $OUTFLAG. 
> However, the space between -o and the target has been dropped, and this 
> does not work with gcc 4.something, at least on Mac OS X Leopard.
> 
> Is there an operating system out there where we MUST write
>      docc ... -otarget
> rather than
>      docc ... -o target
> ?
> 
> Can anyone else build aldor with gcc 4.x ?
> 
> David



From ldragan at aldor.org  Wed Jul 23 12:53:33 2008
From: ldragan at aldor.org (ldragan at aldor.org)
Date: Wed, 23 Jul 2008 12:53:33 -0400
Subject: [Aldor-l] OUTFLAG in aldor/tools/unix/Makefile
In-Reply-To: <alpine.OSX.1.00.0807221638530.21668@tl-fac-1-226-53.unbc.ca>
References: <alpine.OSX.1.00.0807221638530.21668@tl-fac-1-226-53.unbc.ca>
Message-ID: <55403e3eae84037135497b6d3b28aedb@freemodule.com>

Hi David,

I changed from -o to $OUTFLAG. I needed to do that to use the same
makefiles for Windows build. 
I don't remember if I changed the spaces as well. Maybe MSVC doesn't like
any space between /Fe 
and the file name and that is why a changed it.

I used those Makefiles to build using gcc 4.x on Fedora and they worked. I
haven't 
tried it with newer versions and I certainly didn't try it on OS X :).

--
Laurentiu

On Tue, 22 Jul 2008 16:45:53 -0700 (PDT), David Casperson <casper at unbc.ca>
wrote:
> Hi folks,
> 
> someone has customized the aldor/tools/unix/Makefile so that instead of
> writing "-o" in DOCC commands there is indirection through $OUTFLAG.
> However, the space between -o and the target has been dropped, and this
> does not work with gcc 4.something, at least on Mac OS X Leopard.
> 
> Is there an operating system out there where we MUST write
>      docc ... -otarget
> rather than
>      docc ... -o target
> ?
> 
> Can anyone else build aldor with gcc 4.x ?
> 
> David
> --
> Dr. David Casperson, Assistant Professor     |  casper at unbc.ca
> Department of Computer Science               |  (250)   960-6672 Fax
> 960-5544
> College of Science and Management            |  3333 University Way
> University of Northern British Columbia      |  Prince George, BC   V2N
> 4Z9
>                                               |  CANADA
> 
> _______________________________________________
> Aldor-l mailing list
> Aldor-l at aldor.org
> http://aldor.org/mailman/listinfo/aldor-l_aldor.org




From casper at unbc.ca  Wed Jul 23 14:39:48 2008
From: casper at unbc.ca (David Casperson)
Date: Wed, 23 Jul 2008 11:39:48 -0700 (PDT)
Subject: [Aldor-l] OUTFLAG in aldor/tools/unix/Makefile
In-Reply-To: <55403e3eae84037135497b6d3b28aedb@freemodule.com>
References: <alpine.OSX.1.00.0807221638530.21668@tl-fac-1-226-53.unbc.ca>
	<55403e3eae84037135497b6d3b28aedb@freemodule.com>
Message-ID: <alpine.OSX.1.00.0807231132030.271@david-caspersons-computer.local>

ldragan at aldor.org, on 2008-07-23, you wrote:

> Date: Wed, 23 Jul 2008 12:53:33 -0400
> From: ldragan at aldor.org
> To: David Casperson <casper at unbc.ca>
> Cc: aldor-l <aldor-l at aldor.org>
> Subject: Re: [Aldor-l] OUTFLAG in aldor/tools/unix/Makefile
> 
> Hi David,
>
> I changed from -o to $OUTFLAG. I needed to do that to use the same
> makefiles for Windows build.
> I don't remember if I changed the spaces as well. Maybe MSVC doesn't like
> any space between /Fe
> and the file name and that is why a changed it.
>
> I used those Makefiles to build using gcc 4.x on Fedora and they worked. I
> haven't
> tried it with newer versions and I certainly didn't try it on OS X :).

Hmmm... looks like what I really need is access to a bunch of
platforms so that we can try the builds across them.

I'm guessing that what is correct here is

OUTFLAG="-o "

on everything but MSVC and

OUTFLAG="/Fe"

for it.  Are there versions of Make that don't evaluate (strip
quotes) on the right hand side of assignments?

David



From pip88nl at gmail.com  Sat Jul 26 09:20:20 2008
From: pip88nl at gmail.com (pip88nl at gmail.com)
Date: Sat, 26 Jul 2008 15:20:20 +0200
Subject: [Aldor-l] Aldor Compiler in website
Message-ID: <20080726132020.GA28579@xinutec.org>

Hello Aldor List,

as I have mentioned at the workshop, I provide an integrated aldor
compiler on my website which has (currently very limited) syntax
highlighting and arbitrary code execution. The link is
http://xinutec.org/~pippijn/en/projects_aldor.xhtml.

-- 
Pippijn
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://mail.aldor.org/pipermail/aldor-l_aldor.org/attachments/20080726/8f5809dc/attachment-0002.bin>

From ralf at hemmecke.de  Sat Jul 26 11:55:54 2008
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Sat, 26 Jul 2008 17:55:54 +0200
Subject: [Aldor-l] Operating System interface
Message-ID: <488B490A.7030604@hemmecke.de>

Hi Pippijn,

you were asking about an operating system interface.

You find it in

lib/axllib/src/oslow.as

And though that is saying "import from Foreign C", it seems to refer to 
some runtime that is coming with the compiler.

Does that help?

Ralf



From bill.page at newsynthesis.org  Sun Jul 27 02:03:12 2008
From: bill.page at newsynthesis.org (Bill Page)
Date: Sun, 27 Jul 2008 02:03:12 -0400
Subject: [Aldor-l] RISC
In-Reply-To: <f3c595c60807261943m182ae4cay95af221278621ec1@mail.gmail.com>
References: <f3c595c60807261943m182ae4cay95af221278621ec1@mail.gmail.com>
Message-ID: <fbcd16d40807262303h65eca6abib063b4cbf91d2cab@mail.gmail.com>

Alfredo,

On Sat, Jul 26, 2008 at 10:43 PM, you wrote:
> Hi Bill,
>
> For those no so fortune to be able to travel to Europe
> ( I cannot even travel in the states :-),
> is there gonna be a summary some where of what it
> was discussed ? or at least interesting news :)
>
> Maybe a video...:p...yeah I know I am asking for too much.
>
> Thank you,
>

I am quite sorry that you and some of the other Axiom and Aldor
developers and users were not able to come to the meeting. I am sure
you could have provided valuable input to the discussion. Notably
absent also was Tim Daly, especially since the main developers of the
two other other Axiom-related projects were there (Gaby, and Waldek).

Here is a fairly accurate updated schedule of the workshop prepared by
the organizer of the workshop Ralf Hemmecke:

http://portal.risc.uni-linz.ac.at/Members/hemmecke/aldoraxiom2008

I think that overall the organization of the workshop was very good -
much thanks to Ralf! And in spite of often being arranged at the "last
minute", the talks and discussions actually fit together into a quite
coherently whole. But sorry, there was no video or audio recording.
:-( In my opinion this is something that we need to try harder to do
in the future.

One very good thing that was done this year for the first time was to
combine both the Aldor and Axiom workshops into one. This meant that
Stephen Watt and a few other people were present specifically because
of Aldor and vice-versa. This was good for two reasons: Stephen of
course was deeply involved in the development of ScratchPad before it
became Axiom and the main developer of Aldor so he was able to offer a
lot of important background on both projects.

Secondly I think it helped strengthen the argument that Aldor should
have a more open open-source license because of the amount of
development work occurring in the Axiom forks in comparison to Aldor.
At the main ISSAC meeting which occurred just before the workshop
William Stein, the main developer of Sage, emphasized exactly the same
issue.

Besides many technical discussions on language design, comparing
developments in SPAD  (especially in OpenAxiom) and Aldor, there was
at least some small progress towards a more open license. One reason
for this is the work being done by Ralf Hemmecke and Peter Broadbery
on the Aldor-Axiom interface. There a few runtime-related files in the
Aldor distribution that are required to build the interface and
everyone agrees that it would be a good thing to be able to distribute
and build the Aldor-Axiom interface without having to include the
Aldor sources and it's license. More information about that will
follow in a few weeks I hope.

For me one of the most surprising and exciting developments in the
last year was that an entirely new and very active Aldor developer has
appeared thanks mainly due to the ubiquity of the Internet and the
still rapidly growing open source culture. Pippijn van Steenhoven
discussed his work on the internals of the Aldor compiler using
"state-of-the-art" tools and methods that are common in other open
source projects, such as valgrind and other profiling tools. As a
result of this work Pippijn has already been able to isolate and fix
some important causes of segfaults that plague the Aldor compiler. You
can both see (and use!) the results of his work here:

http://xinutec.org/~pippijn/en/projects_aldor.xhtml

Please ask more questions. It seems a bit hard for me, although it is
still current, to really summarize the results of the workshop. As
time permits, I will try to add more in follow-up comments. I hope
some of the other people who were there will also offer their
perspectives and comments here.

Regards,
Bill Page.



From ralf at hemmecke.de  Tue Jul 29 06:25:52 2008
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Tue, 29 Jul 2008 12:25:52 +0200
Subject: [Aldor-l] old bugs
Message-ID: <488EF030.2010002@hemmecke.de>

Dear Stephen,

the links to the old bugs on

http://www.aldor.org/bugs/

are not working.

Ralf



From ralf at hemmecke.de  Tue Jul 29 07:17:27 2008
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Tue, 29 Jul 2008 13:17:27 +0200
Subject: [Aldor-l] [fricas-devel] Re: RISC
In-Reply-To: <fbcd16d40807262303h65eca6abib063b4cbf91d2cab@mail.gmail.com>
References: <f3c595c60807261943m182ae4cay95af221278621ec1@mail.gmail.com>
	<fbcd16d40807262303h65eca6abib063b4cbf91d2cab@mail.gmail.com>
Message-ID: <488EFC47.9060004@hemmecke.de>

> Here is a fairly accurate updated schedule of the workshop prepared
> by the organizer of the workshop Ralf Hemmecke:
> 
> http://portal.risc.uni-linz.ac.at/Members/hemmecke/aldoraxiom2008

I've moved everything to the official conference page.

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

and added slides. For some talks there are still some slides missing
that were used during the talk. And I hope those people send me the
slides that they used.

To the participants: Certainly some of you have made notes during the
talks. So if you could add them to the obove site that would be
certainly good for others.

> But sorry, there was no video or audio recording. :-( In my opinion
> this is something that we need to try harder to do in the future.

Interesting, but hard to achieve. Note that we did not just have talks 
but rather lot's of discussions. It would be hard to record that. And I 
have no idea who could actually do that.

Bill, I think it would be nice if your summary of the workshop also 
appears at the conference page. Maybe others add their summaries, too, 
so we can share our knowledge and help to strengthen the still very 
small Aldor & panAxiom community.

Ralf



From pip88nl at gmail.com  Tue Jul 29 19:51:58 2008
From: pip88nl at gmail.com (pip88nl at gmail.com)
Date: Wed, 30 Jul 2008 01:51:58 +0200
Subject: [Aldor-l] GC Timing
Message-ID: <20080729235158.GA19601@xinutec.org>

Hi Aldor List,

I did some more elaborate benchmarks regarding garbage collection. The
results can be viewed on my website at
http://xinutec.org/~pippijn/en/projects_aldor_profile.xhtml. For those
who don't want to read, the conclusion is that the Aldor GC can
outperform Boehm if compiled with certain switches.

-- 
Pippijn
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://mail.aldor.org/pipermail/aldor-l_aldor.org/attachments/20080730/a890aa37/attachment-0002.bin>

From ralf at hemmecke.de  Wed Jul 30 07:45:28 2008
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Wed, 30 Jul 2008 13:45:28 +0200
Subject: [Aldor-l] Cross(List t for t in T) where T: Tuple(LabelType)
Message-ID: <48905458.2000204@hemmecke.de>

Dear Stephen,

here is a short file that demonstrates (inside #if MULTI) approximately
what I would like to have.

The file runs fine with

aldor -laldor -grun experimentalmultisortspecies.as

but of course not if I add "-DMULTI" on the command line.

Do you have some comments on it? Is that an instance that can be done 
with compile-time typechecking?

   Rep == Cross(List t for t in T)

I know that everything could certainly be done by using Object, but does 
Aldor also allow me to not carry the type information in the value?

Best regards

Ralf
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: experimentalmultisortspecies.as
URL: <http://mail.aldor.org/pipermail/aldor-l_aldor.org/attachments/20080730/6639c368/attachment-0001.pl>

