Bill Page | 2 Apr 2009 21:31
Gravatar

Re: [open-axiom-devel] Re: rep/per again

On Thu, Apr 2, 2009 at 2:19 PM, Gabriel Dos Reis <gdr@...> wrote:
> Bill Page writes:
>
> | Since BinarySearchTree is a particular class of BinaryTree for
> | consistency in BinarySearchTree I would expect to see:
> |
> |  Implementation == BinaryTree(S) add
> |    Rep == List Tree S
>
> As I said, I would not.  I would not expect any definition of Rep
> at all.   The domain extension says BinaryTree(S) is the Rep of
> BinarySearchTree(S).
>

Sorry, then this is my confusion. As I said, I expected that the Rep
of BinarySearchTree should be the same as the Rep of the domain from
which it inherits - *not* the domain itself.

My (perhaps poor) understanding of add-inheritance

NewDomain(): with
    ... exports ...
  == OldDomain add
    ... body ...

was that all functions and constants defined in the OldDomain
(regardless of whether they are exported or not) are visible to code
in the body of the new domain. Is that true or not?

In the Axiom Book it says:
(Continue reading)

Gabriel Dos Reis | 2 Apr 2009 21:58
Picon
Favicon

Re: [open-axiom-devel] rep/per again

Bill Page <bill.page <at> newsynthesis.org> writes:

| On Thu, Apr 2, 2009 at 2:19 PM, Gabriel Dos Reis <gdr <at> cs.tamu.edu> wrote:
| > Bill Page writes:
| >
| > | Since BinarySearchTree is a particular class of BinaryTree for
| > | consistency in BinarySearchTree I would expect to see:
| > |
| > | ═Implementation == BinaryTree(S) add
| > | ═ ═Rep == List Tree S
| >
| > As I said, I would not. ═I would not expect any definition of Rep
| > at all. ═ The domain extension says BinaryTree(S) is the Rep of
| > BinarySearchTree(S).
| >
| 
| Sorry, then this is my confusion.

confusion seems cleared then.

| As I said, I expected that the Rep
| of BinarySearchTree should be the same as the Rep of the domain from
| which it inherits - *not* the domain itself.

I think that is unnecessary leakage.  Indeed, if I understand your
description correctly, 'rep' would return a value of the Rep of old
domain, this achieve the effective effect of exporting Rep -- because,
you can now write functions to get access to that representation.

That breaks abstraction.
(Continue reading)


Gmane