axiom-developer
[Top][All Lists]
Advanced

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

Re: [Axiom-developer] Question concerning types...


From: C Y
Subject: Re: [Axiom-developer] Question concerning types...
Date: Sat, 16 Sep 2006 10:18:38 -0700 (PDT)

--- Martin Rubey <address@hidden> wrote:

> Currently, you can't. Note that you promise axiom that a1 is a
> Quaternion Fraction Integer. However, you don't hold your promise...

How do I not hold it?  I never told it anything about a1 except what
type it is - were did I contradict this?

> What you want is to make a1 a variable. Currently, there is no domain
> of "Variables, which can take values only in Quaternion Fraction
> Integer".

Um.  That's surprising, at least to me.  (I suppose it wouldn't be if I
understood...)  Intuitively I would expect Variable to mean simply "an
unspecified specific instance of a Domain/Type/what have you" with ALL
domains being possible - just so long as you specify the type of the
variable, e.g.:

a1 : Variable(Matrix Quaternion Fraction Integer)

A specific example might be with working in dimensional types:  If I
define F as type Force, m as type Mass, and a as type Length/Time^2 I
want to be able to define m1 as type Mass and enter the expression
m*a/m1 into the interperter to return a of type Length/Time^2 without
having to ever specify any particular mass or acceleration.  But I want
that type information to be carried and used in the calculations - in
fact, it is essential.

> In fact, it is (or should be) a FAQ. See MathAction.

I took a look at the FAQ link, but I might have missed it.  I'll check
again.

> The point of Axioms type system is that any identifier has a typed
> value. There is no such thing as a identifier that does not have a
> value.
> 
> If you type 
> 
> 5*a+a^2
> 
> into the interpreter, it responds with
> 
> Polynomial Integer.

But what if I want a to have a specific type, for example limit it to
Quaternions only?
 
> When you say p:=5*a+3*a^2, the identifier p refers to this
> polynomial. The internal representation is something like
> 
> [[5,a,1],[3,a,2]]
> 
> How would you represent a generic polynomial? You need a different
> domain for that.

I guess I'm not following why things can't be further restricted by
saying in this particulary case a is of type FOO, and therefore doing
two things:

1)  restricting the evaluation of the polynomial substitutions for a
which are of type FOO

2)  allowing algorithms to use the knowledge that for this polynomial a
is restricted to some subset to make further deductions,
simplifications, and otherwise provide more precise answers

Sorry if this is an obviously trivial question.

Cheers,
CY


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 




reply via email to

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