Thread View: fj.mail-lists.reduce
1 messages
1 total messages
Started by Rainer Schoepf
Mon, 22 Feb 1993 16:51
Re: incomplete evaluation
Author: Rainer Schoepf
Date: Mon, 22 Feb 1993 16:51
Date: Mon, 22 Feb 1993 16:51
45 lines
2153 bytes
2153 bytes
"Dresse Alain" writes:
>
> I have attempted to implement this with the code included below, but
> I have the following unexpected result :
>
> P({1}) * P({2});
>
> -1
> ==> - P({1})*P({1}) *P({2,1})
>
>
> reval(ws);
>
> ==> - P({2,1})
>
> I have no idea why the result is not fully evaluated in the first
> place.
The problem is that you are generating non-unique (i.e. non eq)
kernels by using the symbolic operator .** instead of calling mksp.
Hence, REDUCE is not able to cancel the two instances of P({1}) until
you feed them back into the simplifier by calling reval.
The following definition of simpp works:
symbolic procedure simpp u;
begin scalar a;
a := aeval car u;
if not listp a or car a neq 'list
then return !*p2q mksp({'p, a},1);
if null cdr a then return 1 ./ 1;
a := antisym_list cdr a;
if car a eq 0 then return nil ./ 1;
if car a eq 1 then return !*p2q mksp({'p, 'list . cdr a},1);
return !*t2q (mksp({'p, 'list . cdr a},1) .* - 1)
end;
Rainer Schoepf
Konrad-Zuse-Zentrum
fuer Informationstechnik Berlin
Heilbronner Strasse 10
W-1000 Berlin 31
Federal Republic of Germany
<Schoepf@sc.ZIB-Berlin.de> or <Schoepf@sc.ZIB-Berlin.dbp.de>
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads