1 | <!--Converted with LaTeX2HTML 97.1 (release) (July 13th, 1997)
|
---|
2 | by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds
|
---|
3 | * revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan
|
---|
4 | * with significant contributions from:
|
---|
5 | Jens Lippman, Marek Rouchal, Martin Wilck and others -->
|
---|
6 | <HTML>
|
---|
7 | <HEAD>
|
---|
8 | <TITLE>The Parser Package</TITLE>
|
---|
9 | <META NAME="description" CONTENT="The Parser Package">
|
---|
10 | <META NAME="keywords" CONTENT="manual">
|
---|
11 | <META NAME="resource-type" CONTENT="document">
|
---|
12 | <META NAME="distribution" CONTENT="global">
|
---|
13 | <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso_8859_1">
|
---|
14 | <LINK REL="STYLESHEET" HREF="manual.css">
|
---|
15 | <LINK REL="next" HREF="node12.html">
|
---|
16 | <LINK REL="previous" HREF="node10.html">
|
---|
17 | <LINK REL="up" HREF="manual.html">
|
---|
18 | <LINK REL="next" HREF="node12.html">
|
---|
19 | </HEAD>
|
---|
20 | <BODY bgcolor="#ffffff">
|
---|
21 | <!--Navigation Panel-->
|
---|
22 | <A NAME="tex2html1063"
|
---|
23 | HREF="node12.html">
|
---|
24 | <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next_motif.gif"></A>
|
---|
25 | <A NAME="tex2html1060"
|
---|
26 | HREF="manual.html">
|
---|
27 | <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up_motif.gif"></A>
|
---|
28 | <A NAME="tex2html1054"
|
---|
29 | HREF="node10.html">
|
---|
30 | <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="previous_motif.gif"></A>
|
---|
31 | <A NAME="tex2html1062"
|
---|
32 | HREF="node1.html">
|
---|
33 | <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents_motif.gif"></A>
|
---|
34 | <BR>
|
---|
35 | <B> Next:</B> <A NAME="tex2html1064"
|
---|
36 | HREF="node12.html">Other packages</A>
|
---|
37 | <B> Up:</B> <A NAME="tex2html1061"
|
---|
38 | HREF="manual.html">CGBLisp User Guide and</A>
|
---|
39 | <B> Previous:</B> <A NAME="tex2html1055"
|
---|
40 | HREF="node10.html">The Polynomial Package</A>
|
---|
41 | <BR>
|
---|
42 | <BR>
|
---|
43 | <!--End of Navigation Panel-->
|
---|
44 | <!--Table of Child-Links-->
|
---|
45 | <A NAME="CHILD_LINKS"><strong>Subsections</strong></A>
|
---|
46 | <UL>
|
---|
47 | <LI><A NAME="tex2html1065"
|
---|
48 | HREF="node11.html#SECTION000110010000000000000">
|
---|
49 | <I>parse</I></A>
|
---|
50 | <LI><A NAME="tex2html1066"
|
---|
51 | HREF="node11.html#SECTION000110020000000000000">
|
---|
52 | <I>alist<MATH CLASS="INLINE">
|
---|
53 | -
|
---|
54 | </MATH>form</I></A>
|
---|
55 | <LI><A NAME="tex2html1067"
|
---|
56 | HREF="node11.html#SECTION000110030000000000000">
|
---|
57 | <I>alist<MATH CLASS="INLINE">
|
---|
58 | -
|
---|
59 | </MATH>form<MATH CLASS="INLINE">
|
---|
60 | -
|
---|
61 | </MATH>1</I></A>
|
---|
62 | <LI><A NAME="tex2html1068"
|
---|
63 | HREF="node11.html#SECTION000110040000000000000">
|
---|
64 | <I>powers</I></A>
|
---|
65 | <LI><A NAME="tex2html1069"
|
---|
66 | HREF="node11.html#SECTION000110050000000000000">
|
---|
67 | <I>parse<MATH CLASS="INLINE">
|
---|
68 | -
|
---|
69 | </MATH>to<MATH CLASS="INLINE">
|
---|
70 | -
|
---|
71 | </MATH>alist</I></A>
|
---|
72 | <LI><A NAME="tex2html1070"
|
---|
73 | HREF="node11.html#SECTION000110060000000000000">
|
---|
74 | <I>parse<MATH CLASS="INLINE">
|
---|
75 | -
|
---|
76 | </MATH>string<MATH CLASS="INLINE">
|
---|
77 | -
|
---|
78 | </MATH>to<MATH CLASS="INLINE">
|
---|
79 | -
|
---|
80 | </MATH>alist</I></A>
|
---|
81 | <LI><A NAME="tex2html1071"
|
---|
82 | HREF="node11.html#SECTION000110070000000000000">
|
---|
83 | <I>parse<MATH CLASS="INLINE">
|
---|
84 | -
|
---|
85 | </MATH>to<MATH CLASS="INLINE">
|
---|
86 | -
|
---|
87 | </MATH>sorted<MATH CLASS="INLINE">
|
---|
88 | -
|
---|
89 | </MATH>alist</I></A>
|
---|
90 | <LI><A NAME="tex2html1072"
|
---|
91 | HREF="node11.html#SECTION000110080000000000000">
|
---|
92 | <I>parse<MATH CLASS="INLINE">
|
---|
93 | -
|
---|
94 | </MATH>string<MATH CLASS="INLINE">
|
---|
95 | -
|
---|
96 | </MATH>to<MATH CLASS="INLINE">
|
---|
97 | -
|
---|
98 | </MATH>sorted<MATH CLASS="INLINE">
|
---|
99 | -
|
---|
100 | </MATH>alist</I></A>
|
---|
101 | <LI><A NAME="tex2html1073"
|
---|
102 | HREF="node11.html#SECTION000110090000000000000">
|
---|
103 | <I>sort<MATH CLASS="INLINE">
|
---|
104 | -
|
---|
105 | </MATH>poly<MATH CLASS="INLINE">
|
---|
106 | -
|
---|
107 | </MATH>1</I></A>
|
---|
108 | <LI><A NAME="tex2html1074"
|
---|
109 | HREF="node11.html#SECTION0001100100000000000000">
|
---|
110 | <I>sort<MATH CLASS="INLINE">
|
---|
111 | -
|
---|
112 | </MATH>poly</I></A>
|
---|
113 | <LI><A NAME="tex2html1075"
|
---|
114 | HREF="node11.html#SECTION0001100110000000000000">
|
---|
115 | <I>poly<MATH CLASS="INLINE">
|
---|
116 | -
|
---|
117 | </MATH>eval<MATH CLASS="INLINE">
|
---|
118 | -
|
---|
119 | </MATH>1</I></A>
|
---|
120 | <LI><A NAME="tex2html1076"
|
---|
121 | HREF="node11.html#SECTION0001100120000000000000">
|
---|
122 | <I>poly<MATH CLASS="INLINE">
|
---|
123 | -
|
---|
124 | </MATH>eval</I></A>
|
---|
125 | <LI><A NAME="tex2html1077"
|
---|
126 | HREF="node11.html#SECTION0001100130000000000000">
|
---|
127 | <I>monom<MATH CLASS="INLINE">
|
---|
128 | -
|
---|
129 | </MATH>basis</I></A>
|
---|
130 | <LI><A NAME="tex2html1078"
|
---|
131 | HREF="node11.html#SECTION0001100140000000000000">
|
---|
132 | <I>convert<MATH CLASS="INLINE">
|
---|
133 | -
|
---|
134 | </MATH>number</I></A>
|
---|
135 | <LI><A NAME="tex2html1079"
|
---|
136 | HREF="node11.html#SECTION0001100150000000000000">
|
---|
137 | <I>$poly+</I></A>
|
---|
138 | <LI><A NAME="tex2html1080"
|
---|
139 | HREF="node11.html#SECTION0001100160000000000000">
|
---|
140 | <I>$poly<MATH CLASS="INLINE">
|
---|
141 | -
|
---|
142 | </MATH></I></A>
|
---|
143 | <LI><A NAME="tex2html1081"
|
---|
144 | HREF="node11.html#SECTION0001100170000000000000">
|
---|
145 | <I>$minus<MATH CLASS="INLINE">
|
---|
146 | -
|
---|
147 | </MATH>poly</I></A>
|
---|
148 | <LI><A NAME="tex2html1082"
|
---|
149 | HREF="node11.html#SECTION0001100180000000000000">
|
---|
150 | <I>$poly*</I></A>
|
---|
151 | <LI><A NAME="tex2html1083"
|
---|
152 | HREF="node11.html#SECTION0001100190000000000000">
|
---|
153 | <I>$poly/</I></A>
|
---|
154 | <LI><A NAME="tex2html1084"
|
---|
155 | HREF="node11.html#SECTION0001100200000000000000">
|
---|
156 | <I>$poly<MATH CLASS="INLINE">
|
---|
157 | -
|
---|
158 | </MATH>expt</I></A>
|
---|
159 | </UL>
|
---|
160 | <!--End of Table of Child-Links-->
|
---|
161 | <HR>
|
---|
162 | <H1><A NAME="SECTION000110000000000000000">
|
---|
163 | The Parser Package</A>
|
---|
164 | </H1>
|
---|
165 | <H4><A NAME="SECTION000110010000000000000">
|
---|
166 | <I>parse</I></A>
|
---|
167 | </H4>
|
---|
168 | <P><IMG WIDTH="576" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
|
---|
169 | SRC="img162.gif"
|
---|
170 | ALT="$\textstyle\parbox{\pboxargslen}{\em {\sf \&optional} stream \/}$"> [<EM>FUNCTION</EM>]
|
---|
171 | <BLOCKQUOTE>
|
---|
172 | Parser of infis expressions with integer/rational coefficients
|
---|
173 | The parser will recognize two kinds of polynomial expressions:
|
---|
174 | <MATH CLASS="INLINE">
|
---|
175 | -
|
---|
176 | </MATH> polynomials in fully expanded forms with coefficients
|
---|
177 | written in front of symbolic expressions; constants can be
|
---|
178 | optionally enclosed in (); for example, the infix form
|
---|
179 | X^2<MATH CLASS="INLINE">
|
---|
180 | -
|
---|
181 | </MATH>Y^2+(<MATH CLASS="INLINE">
|
---|
182 | -
|
---|
183 | </MATH>4/3)*U^2*W^3<MATH CLASS="INLINE">
|
---|
184 | -
|
---|
185 | </MATH>5 parses to
|
---|
186 | (+ (<MATH CLASS="INLINE">
|
---|
187 | -
|
---|
188 | </MATH> (EXPT X 2) (EXPT Y 2)) (* (<MATH CLASS="INLINE">
|
---|
189 | -
|
---|
190 | </MATH> (/ 4 3)) (EXPT U 2) (EXPT W
|
---|
191 | 3)) (<MATH CLASS="INLINE">
|
---|
192 | -
|
---|
193 | </MATH> 5))
|
---|
194 | <MATH CLASS="INLINE">
|
---|
195 | -
|
---|
196 | </MATH> lists of polynomials; for example
|
---|
197 | [X<MATH CLASS="INLINE">
|
---|
198 | -
|
---|
199 | </MATH>Y, X^2+3*Z]
|
---|
200 | parses to
|
---|
201 | (:[ (<MATH CLASS="INLINE">
|
---|
202 | -
|
---|
203 | </MATH> X Y) (+ (EXPT X 2) (* 3 Z)))
|
---|
204 | where the first symbol [ marks a list of polynomials.
|
---|
205 | <MATH CLASS="INLINE">
|
---|
206 | -
|
---|
207 | </MATH>other infix expressions, for example
|
---|
208 | [(X<MATH CLASS="INLINE">
|
---|
209 | -
|
---|
210 | </MATH>Y)*(X+Y)/Z,(X+1)^2]
|
---|
211 | parses to:
|
---|
212 | (:[ (/ (* (<MATH CLASS="INLINE">
|
---|
213 | -
|
---|
214 | </MATH> X Y) (+ X Y)) Z) (EXPT (+ X 1) 2))
|
---|
215 | Currently this function is implemented using M. Kantrowitz's INFIX
|
---|
216 | package. </BLOCKQUOTE><H4><A NAME="SECTION000110020000000000000">
|
---|
217 | <I>alist<MATH CLASS="INLINE">
|
---|
218 | -
|
---|
219 | </MATH>form</I></A>
|
---|
220 | </H4>
|
---|
221 | <P><IMG WIDTH="539" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
|
---|
222 | SRC="img163.gif"
|
---|
223 | ALT="$\textstyle\parbox{\pboxargslen}{\em plist vars \/}$"> [<EM>FUNCTION</EM>]
|
---|
224 | <BLOCKQUOTE>
|
---|
225 | Translates an expression PLIST, which should be a list of polynomials
|
---|
226 | in variables VARS, to an alist representation of a polynomial.
|
---|
227 | It returns the alist. See also PARSE<MATH CLASS="INLINE">
|
---|
228 | -
|
---|
229 | </MATH>TO<MATH CLASS="INLINE">
|
---|
230 | -
|
---|
231 | </MATH>ALIST.</BLOCKQUOTE><H4><A NAME="SECTION000110030000000000000">
|
---|
232 | <I>alist<MATH CLASS="INLINE">
|
---|
233 | -
|
---|
234 | </MATH>form<MATH CLASS="INLINE">
|
---|
235 | -
|
---|
236 | </MATH>1</I></A>
|
---|
237 | </H4>
|
---|
238 | <P><IMG WIDTH="517" HEIGHT="31" ALIGN="MIDDLE" BORDER="0"
|
---|
239 | SRC="img164.gif"
|
---|
240 | ALT="$\textstyle\parbox{\pboxargslen}{\em p vars {\sf \&aux} (ht
|
---|
241 | (make$-$hash$-$table
|
---|
242 | :test
|
---|
243 | \char93 'equal
|
---|
244 | :size
|
---|
245 | 16)) stack \/}$"> [<EM>FUNCTION</EM>]
|
---|
246 | <BLOCKQUOTE>
|
---|
247 | </BLOCKQUOTE><H4><A NAME="SECTION000110040000000000000">
|
---|
248 | <I>powers</I></A>
|
---|
249 | </H4>
|
---|
250 | <P><IMG WIDTH="564" HEIGHT="50" ALIGN="MIDDLE" BORDER="0"
|
---|
251 | SRC="img165.gif"
|
---|
252 | ALT="$\textstyle\parbox{\pboxargslen}{\em monom vars {\sf \&aux} (tab
|
---|
253 | (pairlis vars
|
---|
254 | (make$-$list (length vars)
|
---|
255 | :initial$-$element 0))) \/}$"> [<EM>FUNCTION</EM>]
|
---|
256 | <BLOCKQUOTE>
|
---|
257 | </BLOCKQUOTE><H4><A NAME="SECTION000110050000000000000">
|
---|
258 | <I>parse<MATH CLASS="INLINE">
|
---|
259 | -
|
---|
260 | </MATH>to<MATH CLASS="INLINE">
|
---|
261 | -
|
---|
262 | </MATH>alist</I></A>
|
---|
263 | </H4>
|
---|
264 | <P><IMG WIDTH="508" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
|
---|
265 | SRC="img166.gif"
|
---|
266 | ALT="$\textstyle\parbox{\pboxargslen}{\em vars {\sf \&optional} stream \/}$"> [<EM>FUNCTION</EM>]
|
---|
267 | <BLOCKQUOTE>
|
---|
268 | Parse an expression already in prefix form to an association list
|
---|
269 | form according to the internal CGBlisp polynomial syntax: a
|
---|
270 | polynomial is an alist of pairs (MONOM . COEFFICIENT). For example:
|
---|
271 | (WITH<MATH CLASS="INLINE">
|
---|
272 | -
|
---|
273 | </MATH>INPUT<MATH CLASS="INLINE">
|
---|
274 | -
|
---|
275 | </MATH>FROM<MATH CLASS="INLINE">
|
---|
276 | -
|
---|
277 | </MATH>STRING (S
|
---|
278 | "X^2<MATH CLASS="INLINE">
|
---|
279 | -
|
---|
280 | </MATH>Y^2+(<MATH CLASS="INLINE">
|
---|
281 | -
|
---|
282 | </MATH>4/3)*U^2*W^3<MATH CLASS="INLINE">
|
---|
283 | -
|
---|
284 | </MATH>5") (PARSE<MATH CLASS="INLINE">
|
---|
285 | -
|
---|
286 | </MATH>TO<MATH CLASS="INLINE">
|
---|
287 | -
|
---|
288 | </MATH>ALIST '(X Y U W) S))
|
---|
289 | evaluates to
|
---|
290 | (((0 0 2 3) . <MATH CLASS="INLINE">
|
---|
291 | -
|
---|
292 | </MATH>4/3) ((0 2 0 0) . <MATH CLASS="INLINE">
|
---|
293 | -
|
---|
294 | </MATH>1) ((2 0 0 0) . 1) ((0 0 0 0) .
|
---|
295 | <MATH CLASS="INLINE">
|
---|
296 | -
|
---|
297 | </MATH>5)) </BLOCKQUOTE><H4><A NAME="SECTION000110060000000000000">
|
---|
298 | <I>parse<MATH CLASS="INLINE">
|
---|
299 | -
|
---|
300 | </MATH>string<MATH CLASS="INLINE">
|
---|
301 | -
|
---|
302 | </MATH>to<MATH CLASS="INLINE">
|
---|
303 | -
|
---|
304 | </MATH>alist</I></A>
|
---|
305 | </H4>
|
---|
306 | <P><IMG WIDTH="456" HEIGHT="27" ALIGN="MIDDLE" BORDER="0"
|
---|
307 | SRC="img167.gif"
|
---|
308 | ALT="$\textstyle\parbox{\pboxargslen}{\em str vars \/}$"> [<EM>FUNCTION</EM>]
|
---|
309 | <BLOCKQUOTE>
|
---|
310 | Parse string STR and return a polynomial as a sorted association
|
---|
311 | list of pairs (MONOM . COEFFICIENT). For example:
|
---|
312 | (parse<MATH CLASS="INLINE">
|
---|
313 | -
|
---|
314 | </MATH>string<MATH CLASS="INLINE">
|
---|
315 | -
|
---|
316 | </MATH>to<MATH CLASS="INLINE">
|
---|
317 | -
|
---|
318 | </MATH>alist
|
---|
319 | "[x^2<MATH CLASS="INLINE">
|
---|
320 | -
|
---|
321 | </MATH>y^2+(<MATH CLASS="INLINE">
|
---|
322 | -
|
---|
323 | </MATH>4/3)*u^2*w^3<MATH CLASS="INLINE">
|
---|
324 | -
|
---|
325 | </MATH>5,y]" '(x y u w)) ([ (((0 0 2 3) . <MATH CLASS="INLINE">
|
---|
326 | -
|
---|
327 | </MATH>4/3) ((0 2 0 0) . <MATH CLASS="INLINE">
|
---|
328 | -
|
---|
329 | </MATH>1) ((2 0 0 0) . 1)
|
---|
330 | ((0 0 0 0) . <MATH CLASS="INLINE">
|
---|
331 | -
|
---|
332 | </MATH>5))
|
---|
333 | (((0 1 0 0) . 1)))
|
---|
334 | The functions PARSE<MATH CLASS="INLINE">
|
---|
335 | -
|
---|
336 | </MATH>TO<MATH CLASS="INLINE">
|
---|
337 | -
|
---|
338 | </MATH>SORTED<MATH CLASS="INLINE">
|
---|
339 | -
|
---|
340 | </MATH>ALIST and
|
---|
341 | PARSE<MATH CLASS="INLINE">
|
---|
342 | -
|
---|
343 | </MATH>STRING<MATH CLASS="INLINE">
|
---|
344 | -
|
---|
345 | </MATH>TO<MATH CLASS="INLINE">
|
---|
346 | -
|
---|
347 | </MATH>SORTED<MATH CLASS="INLINE">
|
---|
348 | -
|
---|
349 | </MATH>ALIST sort terms by the predicate
|
---|
350 | defined in the ORDER package. </BLOCKQUOTE><H4><A NAME="SECTION000110070000000000000">
|
---|
351 | <I>parse<MATH CLASS="INLINE">
|
---|
352 | -
|
---|
353 | </MATH>to<MATH CLASS="INLINE">
|
---|
354 | -
|
---|
355 | </MATH>sorted<MATH CLASS="INLINE">
|
---|
356 | -
|
---|
357 | </MATH>alist</I></A>
|
---|
358 | </H4>
|
---|
359 | <P><IMG WIDTH="453" HEIGHT="31" ALIGN="MIDDLE" BORDER="0"
|
---|
360 | SRC="img168.gif"
|
---|
361 | ALT="$\textstyle\parbox{\pboxargslen}{\em vars {\sf \&optional} (order
|
---|
362 | \char93 'lex$\gt$) (stream t) \/}$"> [<EM>FUNCTION</EM>]
|
---|
363 | <BLOCKQUOTE>
|
---|
364 | Parses streasm STREAM and returns a polynomial represented as
|
---|
365 | a sorted alist. For example:
|
---|
366 | (WITH<MATH CLASS="INLINE">
|
---|
367 | -
|
---|
368 | </MATH>INPUT<MATH CLASS="INLINE">
|
---|
369 | -
|
---|
370 | </MATH>FROM<MATH CLASS="INLINE">
|
---|
371 | -
|
---|
372 | </MATH>STRING (S
|
---|
373 | "X^2<MATH CLASS="INLINE">
|
---|
374 | -
|
---|
375 | </MATH>Y^2+(<MATH CLASS="INLINE">
|
---|
376 | -
|
---|
377 | </MATH>4/3)*U^2*W^3<MATH CLASS="INLINE">
|
---|
378 | -
|
---|
379 | </MATH>5") (PARSE<MATH CLASS="INLINE">
|
---|
380 | -
|
---|
381 | </MATH>TO<MATH CLASS="INLINE">
|
---|
382 | -
|
---|
383 | </MATH>SORTED<MATH CLASS="INLINE">
|
---|
384 | -
|
---|
385 | </MATH>ALIST '(X Y U W) S))
|
---|
386 | returns
|
---|
387 | (((2 0 0 0) . 1) ((0 2 0 0) . <MATH CLASS="INLINE">
|
---|
388 | -
|
---|
389 | </MATH>1) ((0 0 2 3) . <MATH CLASS="INLINE">
|
---|
390 | -
|
---|
391 | </MATH>4/3) ((0 0 0 0) .
|
---|
392 | <MATH CLASS="INLINE">
|
---|
393 | -
|
---|
394 | </MATH>5)) and
|
---|
395 | (WITH<MATH CLASS="INLINE">
|
---|
396 | -
|
---|
397 | </MATH>INPUT<MATH CLASS="INLINE">
|
---|
398 | -
|
---|
399 | </MATH>FROM<MATH CLASS="INLINE">
|
---|
400 | -
|
---|
401 | </MATH>STRING (S
|
---|
402 | "X^2<MATH CLASS="INLINE">
|
---|
403 | -
|
---|
404 | </MATH>Y^2+(<MATH CLASS="INLINE">
|
---|
405 | -
|
---|
406 | </MATH>4/3)*U^2*W^3<MATH CLASS="INLINE">
|
---|
407 | -
|
---|
408 | </MATH>5") (PARSE<MATH CLASS="INLINE">
|
---|
409 | -
|
---|
410 | </MATH>TO<MATH CLASS="INLINE">
|
---|
411 | -
|
---|
412 | </MATH>SORTED<MATH CLASS="INLINE">
|
---|
413 | -
|
---|
414 | </MATH>ALIST '(X Y U W) T #'GRLEX<MATH CLASS="INLINE">
|
---|
415 | >
|
---|
416 | </MATH>) S)
|
---|
417 | returns
|
---|
418 | (((0 0 2 3) . <MATH CLASS="INLINE">
|
---|
419 | -
|
---|
420 | </MATH>4/3) ((2 0 0 0) . 1) ((0 2 0 0) . <MATH CLASS="INLINE">
|
---|
421 | -
|
---|
422 | </MATH>1) ((0 0 0 0) .
|
---|
423 | <MATH CLASS="INLINE">
|
---|
424 | -
|
---|
425 | </MATH>5)) </BLOCKQUOTE><H4><A NAME="SECTION000110080000000000000">
|
---|
426 | <I>parse<MATH CLASS="INLINE">
|
---|
427 | -
|
---|
428 | </MATH>string<MATH CLASS="INLINE">
|
---|
429 | -
|
---|
430 | </MATH>to<MATH CLASS="INLINE">
|
---|
431 | -
|
---|
432 | </MATH>sorted<MATH CLASS="INLINE">
|
---|
433 | -
|
---|
434 | </MATH>alist</I></A>
|
---|
435 | </H4>
|
---|
436 | <P><IMG WIDTH="401" HEIGHT="31" ALIGN="MIDDLE" BORDER="0"
|
---|
437 | SRC="img169.gif"
|
---|
438 | ALT="$\textstyle\parbox{\pboxargslen}{\em str vars {\sf \&optional} (order
|
---|
439 | \char93 'lex$\gt$) \/}$"> [<EM>FUNCTION</EM>]
|
---|
440 | <BLOCKQUOTE>
|
---|
441 | Parse a string to a sorted alist form, the internal representation
|
---|
442 | of polynomials used by our system.</BLOCKQUOTE><H4><A NAME="SECTION000110090000000000000">
|
---|
443 | <I>sort<MATH CLASS="INLINE">
|
---|
444 | -
|
---|
445 | </MATH>poly<MATH CLASS="INLINE">
|
---|
446 | -
|
---|
447 | </MATH>1</I></A>
|
---|
448 | </H4>
|
---|
449 | <P><IMG WIDTH="523" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
|
---|
450 | SRC="img170.gif"
|
---|
451 | ALT="$\textstyle\parbox{\pboxargslen}{\em p order \/}$"> [<EM>FUNCTION</EM>]
|
---|
452 | <BLOCKQUOTE>
|
---|
453 | Sort the terms of a single polynomial P using an admissible monomial
|
---|
454 | order ORDER. Returns the sorted polynomial. Destructively modifies P.</BLOCKQUOTE><H4><A NAME="SECTION0001100100000000000000">
|
---|
455 | <I>sort<MATH CLASS="INLINE">
|
---|
456 | -
|
---|
457 | </MATH>poly</I></A>
|
---|
458 | </H4>
|
---|
459 | <P><IMG WIDTH="544" HEIGHT="31" ALIGN="MIDDLE" BORDER="0"
|
---|
460 | SRC="img171.gif"
|
---|
461 | ALT="$\textstyle\parbox{\pboxargslen}{\em poly$-$or$-$poly$-$list {\sf \&optional} (order \char93 'lex$\gt$) \/}$"> [<EM>FUNCTION</EM>]
|
---|
462 | <BLOCKQUOTE>
|
---|
463 | Sort POLY<MATH CLASS="INLINE">
|
---|
464 | -
|
---|
465 | </MATH>OR<MATH CLASS="INLINE">
|
---|
466 | -
|
---|
467 | </MATH>POLY<MATH CLASS="INLINE">
|
---|
468 | -
|
---|
469 | </MATH>LIST, which could be either a single
|
---|
470 | polynomial or a list of polynomials in internal alist representation,
|
---|
471 | using admissible monomial order ORDER. Each polynomial is sorted
|
---|
472 | using SORT<MATH CLASS="INLINE">
|
---|
473 | -
|
---|
474 | </MATH>POLY<MATH CLASS="INLINE">
|
---|
475 | -
|
---|
476 | </MATH>1.</BLOCKQUOTE><H4><A NAME="SECTION0001100110000000000000">
|
---|
477 | <I>poly<MATH CLASS="INLINE">
|
---|
478 | -
|
---|
479 | </MATH>eval<MATH CLASS="INLINE">
|
---|
480 | -
|
---|
481 | </MATH>1</I></A>
|
---|
482 | </H4>
|
---|
483 | <P><IMG WIDTH="521" HEIGHT="31" ALIGN="MIDDLE" BORDER="0"
|
---|
484 | SRC="img172.gif"
|
---|
485 | ALT="$\textstyle\parbox{\pboxargslen}{\em expr vars order ring {\sf \&aux} (n (length vars)) \/}$"> [<EM>FUNCTION</EM>]
|
---|
486 | <BLOCKQUOTE>
|
---|
487 | Evaluate an expression EXPR as polynomial
|
---|
488 | by substituting operators + <MATH CLASS="INLINE">
|
---|
489 | -
|
---|
490 | </MATH> * expt with
|
---|
491 | corresponding polynomial operators
|
---|
492 | and variables VARS with monomials (1 0 ... 0), (0 1 ... 0) etc.
|
---|
493 | We use special versions of binary
|
---|
494 | operators $poly+, $poly<MATH CLASS="INLINE">
|
---|
495 | -
|
---|
496 | </MATH>, $minus<MATH CLASS="INLINE">
|
---|
497 | -
|
---|
498 | </MATH>poly, $poly* and
|
---|
499 | $poly<MATH CLASS="INLINE">
|
---|
500 | -
|
---|
501 | </MATH>expt which work like the corresponding functions in the
|
---|
502 | POLY package, but accept scalars as arguments as well.</BLOCKQUOTE><H4><A NAME="SECTION0001100120000000000000">
|
---|
503 | <I>poly<MATH CLASS="INLINE">
|
---|
504 | -
|
---|
505 | </MATH>eval</I></A>
|
---|
506 | </H4>
|
---|
507 | <P><IMG WIDTH="543" HEIGHT="31" ALIGN="MIDDLE" BORDER="0"
|
---|
508 | SRC="img173.gif"
|
---|
509 | ALT="$\textstyle\parbox{\pboxargslen}{\em expr vars {\sf \&optional} (order
|
---|
510 | \char93 'lex$\gt$) (ring
|
---|
511 | *coefficient$-$ring*) \/}$"> [<EM>FUNCTION</EM>]
|
---|
512 | <BLOCKQUOTE>
|
---|
513 | Evaluate an expression EXPR, which should be a polynomial
|
---|
514 | expression or a list of polynomial expressions (a list of expressions
|
---|
515 | marked by prepending keyword :[ to it) given in lisp prefix notation,
|
---|
516 | in variables VARS, which should be a list of symbols. The result of
|
---|
517 | the evaluation is a polynomial or a list of polynomials (marked by
|
---|
518 | prepending symbol '[) in the internal alist form. This evaluator is
|
---|
519 | used by the PARSE package to convert input from strings directly to
|
---|
520 | internal form.</BLOCKQUOTE><H4><A NAME="SECTION0001100130000000000000">
|
---|
521 | <I>monom<MATH CLASS="INLINE">
|
---|
522 | -
|
---|
523 | </MATH>basis</I></A>
|
---|
524 | </H4>
|
---|
525 | <P><IMG WIDTH="514" HEIGHT="50" ALIGN="MIDDLE" BORDER="0"
|
---|
526 | SRC="img174.gif"
|
---|
527 | ALT="$\textstyle\parbox{\pboxargslen}{\em n {\sf \&aux} (basis
|
---|
528 | (copy$-$tree
|
---|
529 | (make$-...
|
---|
530 | ...
|
---|
531 | (list 'quote
|
---|
532 | (list
|
---|
533 | (cons
|
---|
534 | (make$-$list n :initial$-$element 0)
|
---|
535 | 1)))))) \/}$"> [<EM>FUNCTION</EM>]
|
---|
536 | <BLOCKQUOTE>
|
---|
537 | Generate a list of monomials ((1 0 ... 0) (0 1 0 ... 0) ... (0 0 ...
|
---|
538 | 1) which correspond to linear monomials X1, X2, ... XN.</BLOCKQUOTE><H4><A NAME="SECTION0001100140000000000000">
|
---|
539 | <I>convert<MATH CLASS="INLINE">
|
---|
540 | -
|
---|
541 | </MATH>number</I></A>
|
---|
542 | </H4>
|
---|
543 | <P><IMG WIDTH="495" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
|
---|
544 | SRC="img175.gif"
|
---|
545 | ALT="$\textstyle\parbox{\pboxargslen}{\em number$-$or$-$poly n \/}$"> [<EM>FUNCTION</EM>]
|
---|
546 | <BLOCKQUOTE>
|
---|
547 | Returns NUMBER<MATH CLASS="INLINE">
|
---|
548 | -
|
---|
549 | </MATH>OR<MATH CLASS="INLINE">
|
---|
550 | -
|
---|
551 | </MATH>POLY, if it is a polynomial. If it is a number,
|
---|
552 | it converts it to the constant monomial in N variables. If the result
|
---|
553 | is a number then convert it to a polynomial in N variables.</BLOCKQUOTE><H4><A NAME="SECTION0001100150000000000000">
|
---|
554 | <I>$poly+</I></A>
|
---|
555 | </H4>
|
---|
556 | <P><IMG WIDTH="561" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
|
---|
557 | SRC="img176.gif"
|
---|
558 | ALT="$\textstyle\parbox{\pboxargslen}{\em p q n order ring \/}$"> [<EM>FUNCTION</EM>]
|
---|
559 | <BLOCKQUOTE>
|
---|
560 | Add two polynomials P and Q, where each polynomial is either a
|
---|
561 | numeric constant or a polynomial in internal representation. If the
|
---|
562 | result is a number then convert it to a polynomial in N variables.</BLOCKQUOTE><H4><A NAME="SECTION0001100160000000000000">
|
---|
563 | <I>$poly<MATH CLASS="INLINE">
|
---|
564 | -
|
---|
565 | </MATH></I></A>
|
---|
566 | </H4>
|
---|
567 | <P><IMG WIDTH="561" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
|
---|
568 | SRC="img176.gif"
|
---|
569 | ALT="$\textstyle\parbox{\pboxargslen}{\em p q n order ring \/}$"> [<EM>FUNCTION</EM>]
|
---|
570 | <BLOCKQUOTE>
|
---|
571 | Subtract two polynomials P and Q, where each polynomial is either a
|
---|
572 | numeric constant or a polynomial in internal representation. If the
|
---|
573 | result is a number then convert it to a polynomial in N variables.</BLOCKQUOTE><H4><A NAME="SECTION0001100170000000000000">
|
---|
574 | <I>$minus<MATH CLASS="INLINE">
|
---|
575 | -
|
---|
576 | </MATH>poly</I></A>
|
---|
577 | </H4>
|
---|
578 | <P><IMG WIDTH="521" HEIGHT="28" ALIGN="MIDDLE" BORDER="0"
|
---|
579 | SRC="img177.gif"
|
---|
580 | ALT="$\textstyle\parbox{\pboxargslen}{\em p n ring \/}$"> [<EM>FUNCTION</EM>]
|
---|
581 | <BLOCKQUOTE>
|
---|
582 | Negation of P is a polynomial is either a numeric constant or a
|
---|
583 | polynomial in internal representation. If the result is a number then
|
---|
584 | convert it to a polynomial in N variables.</BLOCKQUOTE><H4><A NAME="SECTION0001100180000000000000">
|
---|
585 | <I>$poly*</I></A>
|
---|
586 | </H4>
|
---|
587 | <P><IMG WIDTH="561" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
|
---|
588 | SRC="img176.gif"
|
---|
589 | ALT="$\textstyle\parbox{\pboxargslen}{\em p q n order ring \/}$"> [<EM>FUNCTION</EM>]
|
---|
590 | <BLOCKQUOTE>
|
---|
591 | Multiply two polynomials P and Q, where each polynomial is either a
|
---|
592 | numeric constant or a polynomial in internal representation. If the
|
---|
593 | result is a number then convert it to a polynomial in N variables.</BLOCKQUOTE><H4><A NAME="SECTION0001100190000000000000">
|
---|
594 | <I>$poly/</I></A>
|
---|
595 | </H4>
|
---|
596 | <P><IMG WIDTH="566" HEIGHT="28" ALIGN="MIDDLE" BORDER="0"
|
---|
597 | SRC="img178.gif"
|
---|
598 | ALT="$\textstyle\parbox{\pboxargslen}{\em p q ring \/}$"> [<EM>FUNCTION</EM>]
|
---|
599 | <BLOCKQUOTE>
|
---|
600 | Divide a polynomials P which is either a numeric constant or a
|
---|
601 | polynomial in internal representation, by a number Q.</BLOCKQUOTE><H4><A NAME="SECTION0001100200000000000000">
|
---|
602 | <I>$poly<MATH CLASS="INLINE">
|
---|
603 | -
|
---|
604 | </MATH>expt</I></A>
|
---|
605 | </H4>
|
---|
606 | <P><IMG WIDTH="532" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
|
---|
607 | SRC="img179.gif"
|
---|
608 | ALT="$\textstyle\parbox{\pboxargslen}{\em p l n order ring \/}$"> [<EM>FUNCTION</EM>]
|
---|
609 | <BLOCKQUOTE>
|
---|
610 | Raise polynomial P, which is a polynomial in internal
|
---|
611 | representation or a numeric constant, to power L. If P is a number,
|
---|
612 | convert the result to a polynomial in N variables.</BLOCKQUOTE><HR>
|
---|
613 | <!--Navigation Panel-->
|
---|
614 | <A NAME="tex2html1063"
|
---|
615 | HREF="node12.html">
|
---|
616 | <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next_motif.gif"></A>
|
---|
617 | <A NAME="tex2html1060"
|
---|
618 | HREF="manual.html">
|
---|
619 | <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up_motif.gif"></A>
|
---|
620 | <A NAME="tex2html1054"
|
---|
621 | HREF="node10.html">
|
---|
622 | <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="previous_motif.gif"></A>
|
---|
623 | <A NAME="tex2html1062"
|
---|
624 | HREF="node1.html">
|
---|
625 | <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents_motif.gif"></A>
|
---|
626 | <BR>
|
---|
627 | <B> Next:</B> <A NAME="tex2html1064"
|
---|
628 | HREF="node12.html">Other packages</A>
|
---|
629 | <B> Up:</B> <A NAME="tex2html1061"
|
---|
630 | HREF="manual.html">CGBLisp User Guide and</A>
|
---|
631 | <B> Previous:</B> <A NAME="tex2html1055"
|
---|
632 | HREF="node10.html">The Polynomial Package</A>
|
---|
633 | <!--End of Navigation Panel-->
|
---|
634 | <ADDRESS>
|
---|
635 | <I>Marek Rychlik</I>
|
---|
636 | <BR><I>3/21/1998</I>
|
---|
637 | </ADDRESS>
|
---|
638 | </BODY>
|
---|
639 | </HTML>
|
---|