[Aldor-l] recursive polynomial

Ralf Hemmecke ralf at hemmecke.de
Sat Jul 29 12:16:57 EDT 2006


Hello,

Please excuse a BIG error in my last mail.

> RecPol(R: Coeff): RecPolCat R == UP ( RecPol R ) add;

That line is wrong since it misses the base case.

So you could have
RecPol(R: Coeff): RecPolCat R == MyUnion( UP R, UP( RecPol R )) add;

where MyUnion is Union, but it must export the type RecPolyCat R.

Of course, if you just need the data structure you can define that 
inside RecursivePolynomial (see my last mail).

RecursivePolynomials(R: CoefCat, vars: List Symbol): RecPolCat R with {
      -- some more functionality
} == add {
     Rep == Union(base: R, up: UP %);
     ....
}

I think that should work. But be careful, I might be wrong again.

Ralf



More information about the Aldor-l mailing list