Zheng Yin | 25 Aug 2002 12:19
Picon

puzzle with pattern matching

Hi, I noticed the following puzzling behavior when I do pattern matching 
of a subscript construction and variables read from batch file.
Since I am new to maxima I am not sure if this is a bug or something 
(un)documented in the Byzantine manual.  It looks to me like the additional 
information inserted during batch loading for source level debugging is 
interfering with the pattern matcher:

(C106) batch ("matchmake.mac");

batching /tmp/matchmake.mac
(C107)                    DECLARE(myfeature, FEATURE)
(C108)                      DECLARE(she, myfeature)
(C109)             myfeatureP(x) := FEATUREP(x, 'myfeature)
(C110)          MATCHDECLARE([matchme, matchmetoo], myfeatureP)
(C111)                DEFRULE(mymatch, matchme, matchme)
(C112)           DEFRULE(mymatch2, matchme[matchmetoo], matchme)
(C113)                          heralias : she
(C114)                        heralias2 : she[she]
(C115) mymatch (heralias);
(D115)                                she
(C116) mymatch2 (heralias2);

*** - GET: 0 is not a symbol
1. Break [15]> :q
(C117) heralias2;
(D117)                              she
                                       she
(C118) mymatch2 (she[she]);
(D118)                                she
(C119) heralias2_alt : she[she];
(Continue reading)

James Amundson | 25 Aug 2002 18:05
Favicon

List of contributors

I just made my first attempt at updating the AUTHORS file for Maxima. It
was my intention to include everyone who has made a contribution.
However, I may have missed one or more contributors. If you have made a
contribution to Maxima but are not listed in the AUTHORS file, please
let me know. If you are listed in the AUTHORS file but would prefer not
to be for any reason, please let me know about that, too.

--Jim
Zheng Yin | 25 Aug 2002 19:51
Picon

Re: puzzle with pattern matching

I just want to add the following annotation to my bug? report, 
although it is quite obvious.  The pattern matching rule 
return the correct result for a variable defined from keyboard 
input (heralias2_alt) but not for a variable with the "same" 
content defined in the batch file (heralias2).  Inspection from 
the lisp (clisp) level shows that heralias2 contains extra internal 
information related to the bug file.  It somehow was not filtered 
by the pattern matcher when calling FEATUREP, I suppose.

Zheng

Gmane