axiom-math
[Top][All Lists]
Advanced

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

Re: [Axiom-math] The right type for the right job


From: Martin Rubey
Subject: Re: [Axiom-math] The right type for the right job
Date: 22 Aug 2006 07:50:15 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

Dear Igor,

"Igor Khavkine" <address@hidden> writes:

> Say I have a few symbols [x,y,z,...] and a binary operagor g. I'm only
> interested in polynomials or rational functions with, say, integer
> coefficients in the formal expressions g(x,x), g(x,y), g(y,z), etc. Is there
> a type that restricts to just this sort of expressions? Expression Integer
> can handle them, but it will also allow other symbols like a,b,c,...  and
> different operators f(a), h(x,c), etc. None of the Polynomial or similar
> domains in Axiom can handle this situation because non-symbols like g(x,y).
> 
> What's the solution?

One possible solution is to mimick the internals of the expression domain. It
represents it's objects, i.e., the expressions, as rational functions with
the domain of variables being "Kernel EXPR INT".

So, let's start with polynomials. You first need a domain for the variables,
and that's the part where you will need to do some programming: it has to be an
OrderedSet, since SMP wants that. And it has to accomodate the symbols
specified by you as well as constructions like g(x,y), g(y,z) etc.

So you'll have something like

)abb domain IVD IgorsVariableDomain
IgorsVariableDomain: OrderedSet with
  
   makeAnElementOfThisDomain: DontKnowWhatGoesHere -> %

 == add

   makeAnElementOfThisDomain(s : DontKnowWhatGoesHere): % ==

   <<implement also all the operations of OrderedSet>>



The rational functions you then get for free, it is

FRAC SMP(INT, IgorsVariableDomain)

In fact, I suppose that this would be useful for the general public, too.

Martin





reply via email to

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