source: CGBLisp/latex-doc/colored-poly.tex@ 1

Last change on this file since 1 was 1, checked in by Marek Rychlik, 15 years ago

First import of a version circa 1997.

File size: 26.3 KB
Line 
1\begin{lisp:documentation}{*colored$-$poly$-$debug*}{VARIABLE}{nil }
2If true debugging output is on.
3\end{lisp:documentation}
4
5\begin{lisp:documentation}{debug$-$cgb}{MACRO}{{\sf \&rest} args }
6{\ } % NO DOCUMENTATION FOR DEBUG-CGB
7\end{lisp:documentation}
8
9\begin{lisp:documentation}{make$-$colored$-$poly}{FUNCTION}{poly k {\sf \&key} (key \#'identity) (main$-$order \#'lex$>$) (parameter$-$order \#'lex$>$) {\sf \&aux} l }
10Colored poly is represented as a list
11 (TERM1 TERM2 ... TERMS)
12where each term is a triple
13 (MONOM . (POLY . COLOR))
14where monoms and polys have common number of variables while color is
15one of the three: :RED, :GREEN or :WHITE. This function translates
16an ordinary polynomial into a colored one by dividing variables into
17K and N$-$K, where N is the total number of variables in the
18polynomial poly; the function KEY can be called to select variables
19in arbitrary order.
20\end{lisp:documentation}
21
22\begin{lisp:documentation}{make$-$colored$-$poly$-$list}{FUNCTION}{plist {\sf \&rest} rest }
23Translate a list of polynomials PLIST into a list of colored
24polynomials by calling MAKE$-$COLORED$-$POLY. Returns the resulting
25list.
26\end{lisp:documentation}
27
28\begin{lisp:documentation}{color$-$poly$-$list}{FUNCTION}{flist {\sf \&optional} (cond (list nil nil)) }
29Add colors to an ordinary list of polynomials FLIST, according to a
30condition COND. A condition is a pair of polynomial lists. Each
31polynomial in COND is a polynomial in parameters only. The list
32(FIRST COND) is called the ``green list'' and it consists of
33polynomials which vanish for the parameters associated with the
34condition. The list (SECOND COND) is called the ``red list
35\end{lisp:documentation}
36
37\begin{lisp:documentation}{color$-$poly}{FUNCTION}{f {\sf \&optional} (cond (list nil nil)) }
38Add color to a single polynomial F, according to condition COND.
39See the documentation of COLOR$-$POLY$-$LIST.
40\end{lisp:documentation}
41
42\begin{lisp:documentation}{colored$-$poly$-$to$-$poly}{FUNCTION}{cpoly }
43For a given colored polynomial CPOLY, removes the colors and
44it returns the polynomial as an ordinary polynomial with
45coefficients which are polynomials in parameters.
46\end{lisp:documentation}
47
48\begin{lisp:documentation}{colored$-$poly$-$print}{FUNCTION}{poly vars {\sf \&key} (stream t) (beg t) (print$-$green$-$part nil) (mark$-$coefficients nil) }
49Print a colored polynomial POLY. Use variables VARS to represent
50the variables. Some of the variables are going to be used as
51parameters, according to the length of the monomials in the main
52monomial and coefficient part of each term in POLY. The key variable
53STREAM may be used to redirect the output. If parameter
54PRINT$-$GREEN$-$PART is set then the coefficients which have color
55:GREEN will be printed, otherwise they are discarded silently. If
56MARK$-$COEFFICIENTS is not NIL then every coefficient will be marked
57according to its color, for instance G(U$-$1) would mean that U$-$1
58is in the green list. Returns P.
59\end{lisp:documentation}
60
61\begin{lisp:documentation}{colored$-$poly$-$print$-$list}{FUNCTION}{poly$-$list vars {\sf \&key} (stream t) (beg t) (print$-$green$-$part nil) (mark$-$coefficients nil) }
62Pring a list of colored polynomials via a call to
63COLORED$-$POLY$-$PRINT.
64\end{lisp:documentation}
65
66\begin{lisp:documentation}{determine}{FUNCTION}{f {\sf \&optional} (cond (list nil nil)) (order \#'lex$>$) (ring *coefficient$-$ring*) }
67This function takes a list of colored polynomials F and a condition
68COND, and it returns a list of pairs (COND' F') such that COND' cover
69COND and F' is a ``determined'' version of the colored polynomial
70list F, i.e. every polynomial has its leading coefficient determined.
71This means that some of the initial coefficients in each polynomial
72in F' are in the green list of COND, and the first non$-$green
73coefficient is in the red list of COND. We note that F' differs from
74F only by different colors: some of the terms marked :WHITE are now
75marked either :GREEN or :RED. Coloring is done either by explicitly
76checking membership in red or green list of COND, or implicitly by
77performing Grobner basis calculations in the polynomial ring over the
78parameters. The admissible monomial order ORDER is used only in the
79parameter space. Also, the ring structure RING is used only for
80calculations on polynomials of the parameters only.
81\end{lisp:documentation}
82
83\begin{lisp:documentation}{determine$-$1}{FUNCTION}{cond p end gp order ring }
84Determine a single colored polynomial P according to condition COND.
85Prepend green part GP to P. Cons the result with END, which should be
86a list of colored polynomials, and return the resulting list of
87polynomials. This is an auxillary function of DETERMINE.
88\end{lisp:documentation}
89
90\begin{lisp:documentation}{determine$-$white$-$term}{FUNCTION}{cond term restp end gp order ring }
91This is an auxillary function of DETERMINE. In this function the
92parameter COND is a condition. The parameters TERM, RESTP and GP are
93three parts of a polynomial being processed, where TERM is colored
94:WHITE. We test the membership in the red and green list of COND we
95try to determine whether the term is :RED or :GREEN. This is done by
96performing ideal membership tests in the polynomial ring. Let C be
97the coefficient of TERM. Thus, C is a polynomial in parameters. We
98find whether C is in the green list by performing a plain ideal
99membership test. However, to test properly whether C is in the red
100list, one needs a different strategy. In fact, we test whether
101adding C to the red list would produce a non$-$empty set of
102parameters in some algebraic extension. The test is whether 1 belongs
103to the saturation ideal of (FIRST COND) in (CONS C (SECOND COND)).
104Thus, we use POLY$-$SATURATION. If we are successful in determining
105the color of TERM, we simply change the color of the term and return
106the list ((COND P)) where P is obtained by appending GP, (LIST TERM)
107and RESTP. If we cannot determine whether TERM is :RED or :GREEN, we
108return the list ((COND' P') (COND'' P
109\end{lisp:documentation}
110
111\begin{lisp:documentation}{cond$-$system$-$print}{FUNCTION}{system vars params {\sf \&key} (suppress$-$value t) (print$-$green$-$part nil) (mark$-$coefficients nil) {\sf \&aux} (label 0) }
112A conditional system SYSTEM is a list of pairs (COND PLIST), where
113COND is a condition (a pair (GREEN$-$LIST RED$-$LIST)) and PLIST is a
114list of colored polynomials. This function pretty$-$prints this list
115of pairs. A conditional system is the data structure returned by
116GROBNER$-$SYSTEM. This function returns SYSTEM, if SUPPRESS$-$VALUE
117is non$-$NIL and no value otherwise. If MARK$-$COEFFICIENTS is
118non$-$NIL coefficients will be marked as in G(u$-$1)*x+R(2)*y, which
119means that u$-$1 is :GREEN and 2 is :RED.
120\end{lisp:documentation}
121
122\begin{lisp:documentation}{cond$-$print}{FUNCTION}{cond params }
123Pretty$-$print a condition COND, using symbol list PARAMS as
124parameter names.
125\end{lisp:documentation}
126
127\begin{lisp:documentation}{add$-$pairs}{FUNCTION}{gs pred }
128The parameter GS shoud be a Grobner system, i.e. a set of pairs
129(CONDITION POLY$-$LIST) This functions adds the third component: the
130list of initial critical pairs (I J), as in the ordinary Grobner
131basis algorithm. In addition, it adds the length of of the
132POLY$-$LIST, less 1, as the fourth component. The resulting list of
133quadruples is returned.
134\end{lisp:documentation}
135
136\begin{lisp:documentation}{cond$-$part}{FUNCTION}{p }
137Find the part of a colored polynomial P starting with the first
138 non$-$green term.
139\end{lisp:documentation}
140
141\begin{lisp:documentation}{cond$-$hm}{FUNCTION}{p }
142Return the conditional head monomial of a colored polynomial P.
143\end{lisp:documentation}
144
145\begin{lisp:documentation}{delete$-$green$-$polys}{FUNCTION}{gamma }
146Delete totally green polynomials from in a grobner system GAMMA.
147\end{lisp:documentation}
148
149\begin{lisp:documentation}{grobner$-$system}{FUNCTION}{f {\sf \&key} (cover (list '(nil nil))) (main$-$order \#'lex$>$) (parameter$-$order \#'lex$>$) (reduce t) (green$-$reduce t) (top$-$reduction$-$only
150 nil) (ring
151 *coefficient$-$ring*) {\sf \&aux} (cover
152 (saturate$-$cover
153 cover
154 parameter$-$order
155 ring)) (gamma
156 (delete$-$green$-$polys
157 (mapcan
158 \#'(lambda (cond) (determine f cond parameter$-$order ring))
159 cover))) }
160This function returns a grobner system, given a list of colored
161polynomials F, Other parameters are:
162A cover COVER, i.e. a list of conditions, i.e. pairs of the form
163(GREEN$-$LIST RED$-$LIST), where GREEN$-$LIST and RED$-$LIST are to
164lists of ordinary polynomials in parameters. A monomial order
165MAIN$-$ORDER used on main variables (not parameters). A monomial
166order PARAMETER$-$ORDER used in calculations with parameters only.
167REDUCE, a flag deciding whether COLORED$-$REDUCTION will be performed
168on the resulting grobner system. GREEN$-$REDUCE, a flag deciding
169whether the green list of each condition will be reduced in a form of
170a reduced Grobner basis. TOP$-$REDUCTION$-$ONLY, a flag deciding
171whether in the internal calculations in the space of parameters top
172reduction only will be used. RING, a structure as in the package
173COEFFICIENT$-$RING, used in operations on the coefficients of the
174polynomials in parameters.
175\end{lisp:documentation}
176
177\begin{lisp:documentation}{reorder$-$pairs}{FUNCTION}{b bnew g pred {\sf \&optional} (sort$-$first nil) }
178Reorder pairs according to some heuristic. The heuristic at this time
179is ad hoc, in the future it should be replaced with sugar strategy
180and a mechanism for implementing new heuristic strategies, as in the
181GROBNER package.
182\end{lisp:documentation}
183
184\begin{lisp:documentation}{colored$-$criterion$-$1}{FUNCTION}{i j f }
185Buchberger criterion 1 for colored polynomials.
186\end{lisp:documentation}
187
188\begin{lisp:documentation}{colored$-$criterion$-$2}{FUNCTION}{i j f b s }
189Buchberger criterion 2 for colored polynomials.
190\end{lisp:documentation}
191
192\begin{lisp:documentation}{cond$-$normal$-$form}{FUNCTION}{f fl main$-$order parameter$-$order top$-$reduction$-$only ring }
193Returns the conditional normal form of a colored polynomial F with
194respect to the list of colored polynomials FL. The list FL is assumed
195to consist of determined polynomials, i.e. such that the first term
196which is not marked :GREEN is :RED.
197\end{lisp:documentation}
198
199\begin{lisp:documentation}{cond$-$spoly}{FUNCTION}{f g main$-$order parameter$-$order ring }
200Returns the conditional S$-$polynomial of two colored polynomials F
201and G. Both polynomials are assumed to be determined.
202\end{lisp:documentation}
203
204\begin{lisp:documentation}{cond$-$lm}{FUNCTION}{f }
205Returns the conditional leading monomial of a colored polynomial F,
206which is assumed to be determined.
207\end{lisp:documentation}
208
209\begin{lisp:documentation}{cond$-$lc}{FUNCTION}{f }
210Returns the conditional leading coefficient of a colored polynomial
211F, which is assumed to be determined.
212\end{lisp:documentation}
213
214\begin{lisp:documentation}{colored$-$term$-$times$-$poly}{FUNCTION}{term f order ring }
215Returns the product of a colored term TERM and a colored polynomial
216F.
217\end{lisp:documentation}
218
219\begin{lisp:documentation}{colored$-$scalar$-$times$-$poly}{FUNCTION}{c f ring }
220Returns the product of an element of the coefficient ring C a colored
221polynomial F.
222\end{lisp:documentation}
223
224\begin{lisp:documentation}{colored$-$term*}{FUNCTION}{term1 term2 order ring }
225Returns the product of two colored terms TERM1 and TERM2.
226\end{lisp:documentation}
227
228\begin{lisp:documentation}{color*}{FUNCTION}{c1 c2 }
229Returns a product of two colores. Rules:
230:red * :red yields :red
231any * :green yields :green
232otherwise the result is :white.
233\end{lisp:documentation}
234
235\begin{lisp:documentation}{color+}{FUNCTION}{c1 c2 }
236Returns a sum of colors. Rules:
237:green + :green yields :green,
238:red + :green yields :red
239any other result is :white.
240\end{lisp:documentation}
241
242\begin{lisp:documentation}{color$-$}{FUNCTION}{c1 c2 }
243Identical to COLOR+.
244\end{lisp:documentation}
245
246\begin{lisp:documentation}{colored$-$poly+}{FUNCTION}{p q main$-$order parameter$-$order ring }
247Returns the sum of colored polynomials P and Q.
248\end{lisp:documentation}
249
250\begin{lisp:documentation}{colored$-$poly$-$}{FUNCTION}{p q main$-$order parameter$-$order ring }
251Returns the difference of colored polynomials P and Q.
252\end{lisp:documentation}
253
254\begin{lisp:documentation}{colored$-$term$-$uminus}{FUNCTION}{term ring }
255Returns the negation of a colored term TERM.
256\end{lisp:documentation}
257
258\begin{lisp:documentation}{colored$-$minus$-$poly}{FUNCTION}{p ring }
259Returns the negation of a colored polynomial P.
260\end{lisp:documentation}
261
262\begin{lisp:documentation}{string$-$grobner$-$system}{FUNCTION}{f vars params {\sf \&key} (cover (list (list "[]" "[]"))) (main$-$order \#'lex$>$) (parameter$-$order \#'lex$>$) (ring
263 *coefficient$-$ring*) (suppress$-$value
264 t) (suppress$-$printing
265 nil) (mark$-$coefficients
266 nil) (reduce
267 t) (green$-$reduce
268 t) {\sf \&aux} (f
269 (parse$-$to$-$colored$-$poly$-$list
270 f
271 vars
272 params
273 main$-$order
274 parameter$-$order)) (cover
275 (string$-$cover
276 cover
277 params
278 parameter$-$order)) }
279An interface to GROBNER$-$SYSTEM in which polynomials can be
280specified in infix notations as strings. Lists of polynomials are
281comma$-$separated list marked by a matchfix operators []
282\end{lisp:documentation}
283
284\begin{lisp:documentation}{string$-$cond}{FUNCTION}{cond params {\sf \&optional} (order \#'lex$>$) }
285Return the internal representation of a condition COND, specified
286as pairs of strings (GREEN$-$LIST RED$-$LIST). GREEN$-$LIST and
287RED$-$LIST in the input are assumed to be strings which parse to two
288lists of polynomials with respect to variables whose names are in the
289list of symbols PARAMS. ORDER is the predicate used to sort the terms
290of the polynomials.
291\end{lisp:documentation}
292
293\begin{lisp:documentation}{string$-$cover}{FUNCTION}{cover params {\sf \&optional} (order \#'lex$>$) }
294Returns the internal representation of COVER, given in the form of
295a list of conditions. See STRING$-$COND for description of a
296condition.
297\end{lisp:documentation}
298
299\begin{lisp:documentation}{saturate$-$cover}{FUNCTION}{cover order ring }
300Brings every condition of a list of conditions COVER to the form (G
301R) where G is saturated with respect to R and G is a Grobner basis
302We could reduce R so that the elements of R are relatively prime,
303but this is not currently done.
304\end{lisp:documentation}
305
306\begin{lisp:documentation}{saturate$-$cond}{FUNCTION}{cond order ring }
307Saturate a single condition COND. An auxillary function of
308SATURATE$-$COVER.
309\end{lisp:documentation}
310
311\begin{lisp:documentation}{string$-$determine}{FUNCTION}{f vars params {\sf \&key} (cond '([] [])) (main$-$order \#'lex$>$) (parameter$-$order \#'lex$>$) (suppress$-$value t) (suppress$-$printing
312 nil) (mark$-$coefficients
313 nil) (ring
314 *coefficient$-$ring*) {\sf \&aux} (f
315 (parse$-$to$-$colored$-$poly$-$list
316 f
317 vars
318 params
319 main$-$order
320 parameter$-$order)) (cond
321 (string$-$cond
322 cond
323 params
324 parameter$-$order)) }
325A string interface to DETERMINE. See the documentation of
326STRING$-$GROBNER$-$SYSTEM.
327\end{lisp:documentation}
328
329\begin{lisp:documentation}{tidy$-$grobner$-$system}{FUNCTION}{gs main$-$order parameter$-$order reduce green$-$reduce ring }
330Apply TIDY$-$PAIR to every pair of a Grobner system.
331\end{lisp:documentation}
332
333\begin{lisp:documentation}{tidy$-$pair}{FUNCTION}{pair main$-$order parameter$-$order reduce green$-$reduce ring {\sf \&aux} gs }
334Make the output of Grobner system more readable by performing
335certain simplifications on an element of a Grobner system.
336If REDUCE is non$-$NIL then COLORED$-$reduction will be performed.
337In addition TIDY$-$COND is called on the condition part of the pair
338PAIR.
339\end{lisp:documentation}
340
341\begin{lisp:documentation}{tidy$-$cond}{FUNCTION}{cond order ring }
342Currently saturates condition COND and does RED$-$REDUCTION on the
343red list.
344\end{lisp:documentation}
345
346\begin{lisp:documentation}{colored$-$reduction}{FUNCTION}{cond p main$-$order parameter$-$order ring {\sf \&aux} (open (list (list cond nil p))) closed }
347Reduce a list of colored polynomials P. The difficulty as compared
348to the usual Buchberger algorithm is that the polys may have the same
349leading monomial which may result in cancellations and polynomials
350which may not be determined. Thus, when we find those, we will have
351to split the condition by calling determine. Returns a list of pairs
352(COND' P') where P' is a reduced grobner basis with respect to any
353parameter choice compatible with condition COND'. Moreover, COND'
354form a cover of COND.
355\end{lisp:documentation}
356
357\begin{lisp:documentation}{green$-$reduce$-$colored$-$poly}{FUNCTION}{cond f parameter$-$order ring }
358It takes a colored polynomial F and it returns a modified
359polynomial obtained by reducing coefficient of F modulo green list of
360the condition COND.
361\end{lisp:documentation}
362
363\begin{lisp:documentation}{green$-$reduce$-$colored$-$list}{FUNCTION}{cond fl parameter$-$order ring }
364Apply GREEN$-$REDUCE$-$COLORED$-$POLY to a list of polynomials FL.
365\end{lisp:documentation}
366
367\begin{lisp:documentation}{cond$-$system$-$green$-$reduce}{FUNCTION}{gs parameter$-$order ring }
368Apply GREEN$-$REDUCE$-$COLORED$-$LIST to every pair of
369a grobner system GS.
370\end{lisp:documentation}
371
372\begin{lisp:documentation}{parse$-$to$-$colored$-$poly$-$list}{FUNCTION}{f vars params main$-$order parameter$-$order {\sf \&aux} (k (length vars)) (vars$-$params (append vars params)) }
373Parse a list of polynomials F, given as a string, with respect to
374a list of variables VARS, given as a list of symbols, to the internal
375representation of a colored polynomial. The polynomials will be
376properly sorted by MAIN$-$ORDER, with the coefficients, which are
377polynomials in parameters, sorted by PARAMETER$-$ORDER. Both orders
378must be admissible monomial orders. This form is suitable for parsing
379polynomials with integer coefficients.
380\end{lisp:documentation}
381
382\begin{lisp:documentation}{red$-$reduction}{FUNCTION}{p pred ring {\sf \&aux} (p (remove$-$if \#'poly$-$constant$-$p p)) }
383Takes a family of polynomials and produce a list whose prime factors
384are the same but they are relatively prime
385Repetitively used the following procedure: it finds two elements f, g
386of P which are not relatively prime; it replaces f and g with
387f/GCD(f,g), g/ GCD(f,f) and GCD(f,g).
388\end{lisp:documentation}
389
Note: See TracBrowser for help on using the repository browser.