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! [EMAIL PROTECTED]:~# cat mylibs.as #include "aldor" #include "aldorinterp" #include "algebra" [EMAIL PROTECTED]:~# aldor -gloop Aldor Copyright (c) 1990-2007 Aldor Software Organization Ltd (Aldor.org). Release: Aldor(C) version 1.1.0 for LINUX(glibc2.3) Type "#int help" for more details. %1 >> #include "mylibs" Comp: 260 msec, Interp: 0 msec %2 >> Type () @ with == add () And subtypes of Type are categories, so like in OpenAxiom Category is also a domain - the domain of subtypes of Type. %3 >> Category () @ with == add () Domains are the members of Type and therefore also are members of one or more Category. For example, in http://www.csd.uwo.ca/~watt/pub/reprints/2003-cahand-aldor.pdf Stephen Watt wrote: "Each value belongs to some unique type, known as its domain, and the domains of expressions can be inferred statically. 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." > %8 >> Cat:Category == with; > > %11 >> Integer > () @ Join( > PrimitiveType with > coerce: BInt -> % > coerce: % -> BInt > == add () > , > IntegerType with export to IntegerSegment(%) > == add () > ) http://www.aldor.org/docs/HTML/chap7.html#7 Aldor does not use the name 'Domain' to refer to any type. So far I have not found any explicit name for the category with {} so I guess it is a cruel little comedy that 'Domain' seems like a good name for the top of the *category* hierachy in Aldor though it is called 'Type' in Axiom. Meanwhile 'Domain' in Axiom corresponds to 'Type', and 'Type' in Aldor is a domain... ;-( > ... Ralf, you are also right that 'has' has a more restricted meaning in Aldor than in Axiom. In Axiom we can write: <domain> or <category> has <category> or <attribute> an <attribute> is just a named category with no exports. In the Axiom interpreter <category 1> has <category 2> is true if <category 1> is a subtype of <category 2> <domain> has <category> is true if <category> appears in the a 'Join' expression or to the left of the keyword 'with'. This is described in The Axiom book, APPENDIX B. GLOSSARY, especiall page #1064, headings: 'category' and 'Category'. Also page #1083, headings 'type' and 'Type'. Refer also to 'domain' and 'attribute' in this section. OpenAxiom still has some oddities inherited from Axiom. For example, although as you pointed out Category is formally defined in the OpenAxiom library and you can write: (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 Given this dual personality of Category, your earlier comment about the use of 'Domain' to define domains in SPAD also makes sense to me. In fact, in the OpenAxiom interpreter one can write: (5) -> I:Domain:=Integer (5) Integer Type: Domain (6) -> i:I := 1 (6) 1 Type: Integer By analogy in SPAD I think it might also be useful to be able to write (for example): NewInteger():Domain with <public> == Integer add <private> Here 'Domain' would refer to the category expression from the domain to the left of the keyword 'add'. It is a little awkward to extend domains in this way now in Axiom because there is currently no way to directly reference the category of a domain. Regards, Bill Page. ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php _______________________________________________ open-axiom-devel mailing list open-axiom-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/open-axiom-devel