axiom-math
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Axiom-math] Re: [open-axiom-devel] [fricas-devel] Re: iterators and car


From: Gabriel Dos Reis
Subject: [Axiom-math] Re: [open-axiom-devel] [fricas-devel] Re: iterators and cartesian product.
Date: 22 Oct 2007 10:16:33 -0500

"Bill Page" <address@hidden> writes:

| On 22 Oct 2007 13:40:26 +0200, Martin Rubey wrote:
| >
| > Francois Maltey writes:
| >
| > > >   [matrix [[a,b,15-a-b],[c,d,15-c-d]] _
| > > >    for (a,b,c,d) in CartesianProduct([1..9, 1..9, 1..9, 1..9])]
| >
| >
| > > But what is the signature of this function CartesianProduct ?
| >
| > Sorry, I didn't bother to think about a good way to specify the Cartesian
| > product itself, but I think what Bill showed was quite good.
| >
| 
| I would like to consider what is?
| 
|   1..9
| 
| Right now in Axiom this is evaluated as a member of 'Segment
| PositiveInteger', i.e. the domain of all such segments. But in general
| I think I would prefer if '1..9' actually denoted a domain - a subset
| of the Positive Integers - with members 1, 2, 3 ... etc.

Couold you elaborate on why `1..9' should denote a domain, and what
the benefits would be?

| I am having a little trouble actually articulating the difference
| between these two. It seems somewhat artificially imposed by Axiom's
| type hierarchy that does not easily allow domains to be members of
| domains. (Domains belong to categories, not other domains.). 

In fact, that is not so clear. If you ask the interpreter what is the
type of Domain, it would answer 'SubDomain Domain'.  And don't go query
the type of SubDomain Domain :-/

| We want to be able to write:
| 
|   DirectProduct(4,1..9)
| 
| but this does not work because '1..9' is not a type - it is an object
| of 'Segment PositiveInteger'.

If it worked, what would you have liked the mathematical meaning to
be, and why?

[I'm not being facetious, I'm trying to understand your perspectives]

| Another example of this in Axiom that *does* work right now is:
| 
|   DirectProduct(4,OrderedVariableList [a,b,c])
| 
| OrderedVariableList is a domain constructor that takes something of
| List Symbol as a parameter. In order to introduce '1..9' as a domain
| it would be possible to introduce new domain constructor like
| 
|    )abbrev domain INTS IntegerSegment
|    IntegerSegment(S:Segment Integer): with Finite ...
| 
| that takes something of 'Segment Integer' as a parameter. Do we want
| 'IntegerSegment' to also be a subdomain of Integer?. In any case,
| then we could write:

I do not see obvious reasons why I would want IntegerSegment to be a
subdomain of Integer.

|   DirectProduct(4,IntegerSegment 1..9)
| 
| But somehow the distinction between '1..9' and 'IntegerSegment 1..9'
| and '[a,b,c]' and 'OrderedVariableList [a,b,c]' seems artificial.
| 
| It occurs to me that one might like at least the Axiom interpreter to
| perform some kind of automatic coercion from 'x' in a domain like
| 'Segment Integer' into the *category* consisting of domains
| 'IntegerSegment(x)'.
| 
| I think Gaby recently referred to this preference for things like
| '1..9' and [a,b,c] to also
| represent domains as a more "categorical" approach.

In general, I would like OpenAxiom to take a more categorial approach
to almost everything -- in particular `cross'.
However, I'm interested in some of you ideas here.  Please, could you
elaborate, and if possible, give some use cases?

-- Gaby




reply via email to

[Prev in Thread] Current Thread [Next in Thread]