axiom-math
[Top][All Lists]
Advanced

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

[Axiom-math] Re: [fricas-devel] Re: [open-axiom-devel] [fricas-devel] Re


From: Bill Page
Subject: [Axiom-math] Re: [fricas-devel] Re: [open-axiom-devel] [fricas-devel] Re: iterators and cartesian product.
Date: Mon, 22 Oct 2007 12:48:33 -0400

On 10/22/07, Gabriel Dos Reis wrote:
>
> On Mon, 22 Oct 2007, Bill Page wrote:
> ...
> |
> | Well, for one I could then write the cross-product of such domains:
> |
> |   Product(1..9,1..4)
>
> What would be its meaning?
> The reason I'm after the meaning is that once I figured out what you
> really want to express -- not the syntax -- then I can figure out
> how to work on the syntax.
>

You mean that was not clear in what followed in my previous message?
As I said, I want

  Product(1..9,1..4)

to be a domain - the cross-product of two other domains.

> | and iterate over them like this
> |
> |   for i in expand()$Product(1..9,1..4)
> |
> | where 'expand' (or whatever we decide we want to call this operator
> | from the category Finite). Or even better if the generator 'expand'
> | also is implicit for any domain in Finite so that we could write:
> |
> |   for i in Prooduct(1..9,1..4)
> |
> | Of course we could also simply define some new 'CrossProduct' domain
> | constructor that takes as argument something of type 'Segment Integer'
> | but this seems considerably less general.
>
> If we introduce a Cross domain, I would expect it to take a sequence
> (e.g. List) of domain as argument.  Why would that be less general?
>

What I call 'Product' you can call 'Cross', I have no problem with the
name. If you want 'Cross' to have a signature like:

  Cross(x:List Type): with ... appropriate access operations

that is fine. But still you would not be able to write:

  Cross [1..9,1..4]

> ...
> |
> | Yes. As I have said several times before (e.g. in an exchange a few
> | years with Peter Broadbery), I think this upper part of the Axiom
> | domain/category type system is a little messed up. I believe Aldor
> | presents one possible solution to these problems but there may be
> | other solutions.
>
> Well, my own opinions are not definite yet, but I do see some value to
> the `domain theoretic' approach to this matter.  In that scheme
> `Categories' are left to just to ensure the availability of certain
> operators to help the compiler in semantics analysis and efficient
> code-generation.  From that perspective, asking the question `what is
> the type of this domain' is an ill-posed problem.  Rather, one should
> be asking the question `does this domain satisfy that category?'.
>
> Indeed, once you've queried the type of a domain, what do you do with it?
>

Yes, that is the point. Apparently Stephen Watt's answer in Aldor is
that allow the domain of 'Domain' to be 'Domain' is ok provided we are
careful exactly what operations we expect to provide in 'Domain'. I
kind of like this approach since I think in general we do want a
semantics in which we have "vary large" classes like '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 would like the result to be a finite domain.
>
> that says what property the result would have, but it does not tell me
> what the meaning of the result is.  I would like to underdstand
> the mathematical meaning.
>

I think the concept of an interval (segment) on the domain Integer is
a fairly well-defined concept, no?

> [...]
> |
> | Well for example, maybe I would want to write:
> |
> |   x:IntegerSegment 1..9
> |   y:=x + 1
> |
> | where the type of 'y' might be Union(IntegerSegment 1..9,"failed").
>
> So, you are actually after a domain that constrains all operations on
> the values of its objects to deliver a value in a specified bound.  I
> can be persuaded that IntegerSegment convays such meaning, but I'm not
> sure the notation `1..9' is intuitive to me, given its other existing
> meaning.

Do you have another suggestion?

> ...
> I'm specifically after `1..9' that you would want to be a domain
> and the various constructs you based on it.
>

Ok. Well as I said, I am willing to live with '1..9' being a member of
the domain 'Segment PositiveInteger' provided that there is also a
coercion of such objects to an equivalent Finite domain so then at
least in the interpreter I could write for example like:

   for i in DirectProduct(3,1..9)

and

  map(x->x+1,expand()$DirectProduct(3,1..9))

where in 'DirectProduct' we have the operations like:

  expand: () -> List %
  +: (%,%) -> %
  1: () -> %

Iteration over the members of such a domain seems like the most common
requirement but not the only one.

Regards,
Bill Page.




reply via email to

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