axiom-math
[Top][All Lists]
Advanced

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

[Axiom-math] Re: [fricas-devel] Re: iterators and cartesian product.


From: Bill Page
Subject: [Axiom-math] Re: [fricas-devel] Re: iterators and cartesian product.
Date: Mon, 22 Oct 2007 10:53:10 -0400

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.

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.). 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'.

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:

  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.

What do other people think?

Regards,
Bill Page.




reply via email to

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