Re: Declaring super types
Date: Mon, 19 Apr 2010 07:55:57 -0700 (PDT)
Message-ID: <c52fcc9b-2745-4aba-b5cc-553aad5c81cb_at_g11g2000yqe.googlegroups.com>
On Apr 18, 11:57 pm, David BL <davi..._at_iinet.net.au> wrote:
> What's the view on whether a nominal type definition can declare
> itself to be a super type of another type (even of a built-in type)?
>
> E.g. suppose that INTEGER is a built-in type and we wish to define
> type RATIONAL parameterised by (n:INTEGER, d:INTEGER) where n,d
> represent numerator and denominator.
>
> We seem to want to declare
>
> INTEGER(n) isa RATIONAL(n,1)
>
> which is analogous to
>
> CIRCLE(c,r) isa ELLIPSE(c,r,r)
>
> where ELLIPSE is parameterised in (c:POINT, a:NUMBER, b:NUMBER)
The right way to approach it is to take Maple, Mathematica or similar system and to study how they are implemented it. As somebody put it an ounce of math is worth a pound of CS. Received on Mon Apr 19 2010 - 16:55:57 CEST