>> As you probably realize here. >> >> UnivariatePolynomialCategory(T) with ... >> >> is certainly not a "one-element category". >> > > Au contraire, I do believe that if you include *everything* between : > and ==, i.e. > (*) > UnivariatePolynomialCategory(T) with > outputForm : (%,OutputForm) -> OutputForm > fmecg: (%,NonNegativeInteger,T,%) -> % > > then given some value for T e.g. 'Integer', this is indeed a category > that is satisfied by only one domain, namely: > 'SparseUnivariatePolynomial(Integer)'. If you do not agree, could you > give me an example of another domain that has this category?
Enter UnivariatePolynomialCategory into HyperDoc. Then click on "domains". (But that is probably not what you mean.) Let's abbreviate the above category (*) with T replaced by Integer by Cat. Then you are probably right that in the current Algebra of panAxiom, there is only one domain that exactly has these exports. But in the next version of FriCAS I might have added RalfPolynomials: Cat == SparseUnivariatePolynomial(Integer); RalfPolynomials2: Cat == SparseUnivariatePolynomial(Integer) add foo(x: %): % == x; These are two more domains with exactly Cat as exports. If you still don't like that they are basically the same as SparseUnivariatePolynomial(Integer), then let's build a domain with exports Cat and another representation. RalfPolynomial3(n: Integer): Cat == add Rep == Record(pol: SparseUnivariatePolynomial(Integer), tag: Integer) coerce(i: Integer): % == [i::SparseUnivariatePolynomial(Integer), n] _-(x: %): % == [-(rep(x).pol), n] ... Now whether you count that RalfPolynomial3 is just one new domain that fulfils Cat or whether that gives one domain for every integer n doesn't matter. It is at least saying that Cat is not a one-element-category. > I think it is important distinguish when one is simply referring to a > category by name and when one wants a category *value*. A category > value is required to the right of the ':'. The operators 'Join' and > 'with' form category expressions that need to be evaluated by the > compiler to a category value. > > In Aldor 'with' clauses are said to form anonymous categories and one > anonymous category is never equal to another, even if they include the > same exports. Where did you find this statement in the Aldor User Guide? Aldor gives me no way to compare categories anyway. And where would it matter anyway. What is important is the type satisfaction (see Section 7.7 (and 7.5) in the AUG). > For example, the domains A1 and A2 > > A1:with f:B->C == > > and > > A2:with f:B->C == > > necessarily belong to different categories. That is > > A1 has CatOfA2 > > and > > A2 has CatOfA1 > > are necessarily false. If you mean a constructor CatOf and say CatOfA1=CatOf(A1), then I might agree, but why do you think that is important. Give a concrete program where you would like to have this feature. <snip> > Since Spad is strongly typed, of course that is not what I meant. By: > > ... if all we know is R, we have *no* syntactical means (other than > perhaps SubsetCategory) to tell the compiler that this is the > category ... > > I meant there is no construct in the Spad language that I can use to > tell the compiler that I am referring to the *category* to which R > belongs and not the domain R itself. I do not want to manually copy > the category part of the definition of R into my new source code every > time I need something that should belong to the same category as R. I > would like to be able to change the definition of R in just one place > and still expect everything to work. Please give a conrete use case. >> What you want is to compute with category expression. That is >> not really a such a bad idea, but leads to problems as you certainly >> know from >> http://axiom-portal.newsynthesis.org/refs/articles/define.pdf >> in particular (see page 5) when the CatOfR from above is >> >> CatOfR: Category == >> if random() then >> with {a: SingleInteger} >> else >> with {a: Float} >> > > No. As I said above anonymous categories formed from 'with' clauses > are never equal. But named categories are equal if their *names* are > the same. As you have defined it abouve 'CatOfR' is a constant whose > value is determined just once at the start of the program. It can be a > different value each time the program is run, but within an instance > of the program it always refers to the same category. OK. Then write a domain that belongs to my CatOfR from above. As you know you can only write that domain before you run the program. <Rest skipped for now> Ralf --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "FriCAS - computer algebra system" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/fricas-devel?hl=en -~----------~----~----~----~------~----~------~--~---
