Re: List quastion -- polynomial arithmetic operations

From: Cesar Rabak (crabak_at_acm.org)
Date: 10/18/04


Date: Mon, 18 Oct 2004 14:16:21 -0300

Bart Demoen escreveu:
>>> Z=[1,2] is the expected answer
>>> im still stuck with it
>>
>>
>
> This thread started on 10 Oct and died on 16 Oct. There was no real
> conclusion nor a final answer. I think even the question was never
> clear. This suggests that the initial question was homework and that
> c.l.p. did not provide a solution. Excellent.

Can I feel a bit or irony here ;-)

>
> And what did c.l.p. get out of it ? Almost nothing.

I can't agree more on that!

>
> But we can get something out if we want to: let c.l.p. resume this
> thread and let people send in LP/Prolog programs that implement
> arithmetic on polynomials (as suggested by one contributor, the
> representation of 3x^2-7x+12 could be [12,-7,3]): the homework deadline
> was probably during the weekend (yesterday) so don't worry about that
> anymore.

Fair enough. With the proviso new drills based on poly ops will have to
be more challenging after we publish here!

>
> Since the OP wants ?- prod_poly([3],[4],Z). to give Z = [2,1] (*)
> (s)he might have wanted arithmetic on decimal representations of
> numbers rather than arithmetic on polynomials (they differ and are
> both interesting). So we could do that too.
>
> Any takers ?

So let's see:

We agree in giving to lists of integers the semantic meaning of
polynomial coefficients. It remains we agree on the convention.

1) Can we settle on increasing order from left to right?

2) The result of the operations shall be lists representing the
resulting polynomials?

3) And a specific predicate can bring the decimal representation?

>
> Cheers
>
> Bart Demoen
>
> (*) Z = [1,2] is (in view of the good suggestion for representing
> polynomials) of course not so good: OPs don't always know what's best
> for them :-)

I see this as a vote for a 'yes' to the first question!

Regards,

--
Cesar Rabak