> The original use case that I presented in another thread involved a > different use of "CatOf(R)". If it were possible to refer directly to > the category to which a domain belongs, then implementing something > similar to Aldor 'extend' would be easy in Spad
> MyInteger():CatOf(Integer) with > ... > == Integer add > ... OK, that should work if CatOf exists. But now suppose I want MyInteger to have a representation that is given by sticks, i.e. the integer 5 is represented in MyInteger as 11111 (or rather as the string "11111". Now, please implement MyInteger with this representation. (You are not allowed to look up the source code of Integer in order to find out what exports Integer provides. All you have is CatOf. If you manage to get MyInteger done, I will be surprised. > The domain MyInteger is then an extension of Integer. Yes that would be one use of CatOf, but "extend" is better. (IMHO) > In less abstract terms 'S:CatOf(Integer)' simply means that everywhere > I use 'S' I can treat it exactly like 'Integer' even though it may be > a conceptually distinct domain. An example of something like this > already in the the FriCAS library is 'RomanNumeral'. And why not write IntegerNumberSystem instead of CatOf(Integer)? I don't see the gain of CatOf. >>> I would much prefer that we have some theory and a model for Spad >>> for which we can (at least in principle) prove that it provides at least >>> the generality that is necessary to express a very large part of modern >>> mathematics. As you know, I have frequently promoted the idea that >>> mathematical category theory provides such a model. And it turns out >>> that the concept of SubDomain is a very critical part of such a model. >> Can you somehow turn your ideas into code? Suppose you have a >> perfect SPAD (call it SPAD-CAT). > > Yes, I am continuing to think about that. For example I have given an > example on axiom-wiki of Spad code that implements data structures > similar to Record and Union based on categorical products and > co-products. > > http://axiom-wiki.newsynthesis.org/LimitsAndColimits Now, I guess you are saying that Product and Sum should be taken as primitives in SPAD-CAT and not Record and Union. Your implementation is not really what I was asking for. Now take your Product and Sum and show some code where it is superior to Record and Union. (If you like you can assume that Product and Sum work for arbitrarily many arguments. It's compiler supported in SPAD-CAT.) >> How would a polynomial domain in infinitely many variables over >> some coefficient ring look like. Make it concrete. > > Re: "polynomial domain in infinitely many variables" ??? Isn't that > exactly what the domain 'Polynomial' is FriCAS is already? I don't see > that as a concrete example of what I am talking about. OK. I want a polynomial domain where every integer i is a variable (for better readability denote the variable i by x_i. Coefficients can come from any ring. No other variables are allowed. So in some sense the polynomial domain I am asking for does not allow kernels to count as variables. And you should program it in SPAD-CAT, not in SPAD. In SPAD we know. But how would it look like in a more categorical oriented language SPAD-CAT (the language you dream of)? > For example, in the case of 'Product(X,Y)' the operation that is > required to exist and be uniquely defined is > > product: (A:Type, A->X,A->Y) -> (A->%) > > for any domain A and functions A->X, A->Y. But I don't see how that helps me with programming. I don't just want to model a language but also use it later for concrete programs. 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 -~----------~----~----~----~------~----~------~--~---
