Gaby, In a previous email you said you thought SubDomain was "half-baked". If you meant this in the sense of "not fully implemented" then I agree but if you meant that you think it was "ill-conceived" than I no longer agree. I think that the type system of Axiom could be completed that way.
On Tue, Jul 8, 2008 at 9:26 PM, Gabriel Dos Reis wrote: > Bill Page writes: > | > | Since 'Type' is the category of 'Domain', perhaps one should write: > | > | Type():Category == SetCategory with ... > | > | Domain():Type == add ... > | > | Then > | > | Category():Type with ... == SubDomain Domain > | > | In other words Category is a Domain with additional exports. > > I'm unclear about > > (1) Why Type should extend SetCategory; The bug report that (re-)started this topic was: http://axiom-wiki.newsynthesis.org/[EMAIL PROTECTED] In that page I observed that putting Domain in SetCategory provided a solution to the problem. (Later you implemented this in a patch to OpenAxiom.) But in http://axiom-wiki.newsynthesis.org/[EMAIL PROTECTED] I argued that Type is just Domain as a category and the OpenAxiom interpret already returns: (1) -> Domain has Type (1) true Type: Boolean So having Type extend SetCategory and define Domain and Category in terms of Type seemed to make sense. However I also wanted Type to be the top of the category hierarchy (supremum of the lattice) so I guess this is half-baked (ill-conceived). All we really need is Category():SetCategory with ... == SubDomain Domain > (2) what is the idea being captured by SubDomain Domain, and what > that constructor is. > In OpenAxiom you introduced the domain 'Category' and that seems like a good move to me - it's just that I think we should not forget the original half-backed idea from Axiom now implemented somewhat differently in Aldor: that categories are subtypes of Type (in Aldor Type is the domain of domains). But the actual implementation of Category():SetCategory with has:(Domain,%) -> Boolean members: % -> List Domain == add ... does not need to make direct reference to any domain constructor such SubDomain. The idea is just that the domain Category is a kind of interface to the Axiom library that implements categories as its values. In fact I do not see much point in abstracting SubDomain unless it also solves problems with the definition of other sub-domains such as PositiveInteger and NonNegativeInteger in a more general way than is done at present. But these are rather different. SubDomain(Domain) is like Set Domain, i.e. SubDomain a power set constructor. PositiveInteger on the other hand is just one domain in SubDomain(Integer), namely the largest subdomain of Integer that contains only values > 0. One the really half-baked ideas I suppose is that SubDomain should be abstracted. Like Category == SubDomain(Domain), SubDomain(Integer) could consult the Axiom library, looking for domains like PositiveInteger and NonNegativeInteger that are sub-domains of Integer as values. Such a thing would be like Category. SubDomain(R:Domain):SetCategory with has:(R,%) -> Boolean members: % -> List R == add But to be really useful, just like compiling: X:Category == with ... defines a Category==SubDomain(Domain), then compiling something like: PositiveInteger():SubDomain(Integer) with subtractIfCan:(%,%)->Union($,"failed") without 0: () -> % -: (%,%) -> % == Integer add has(x:Integer,%) == x>0 should define PositiveInteger in the Axiom library as a sub-domain of Integer. Here 'has' provides the boolean condition that defines values of this domain. The equivalent thing in the case of Category is the boolean operation: domain has Category > In fact, as I said earlier, I like to see specifications, then > implementations. Presenting me with with implementation without > prior explanation of what the implementation is supposed to achieve > is unlikely to persuade me -- no matter how right the implementation > is. Ok, I admit that I am kind of short on specifications. I think we (I, at least) have reached here another good place to pause for more reflection (pun intended). Regards, Bill Page. ------------------------------------------------------------------------- Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! Studies have shown that voting for your favorite open source project, along with a healthy diet, reduces your potential for chronic lameness and boredom. Vote Now at http://www.sourceforge.net/community/cca08 _______________________________________________ open-axiom-devel mailing list open-axiom-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/open-axiom-devel