source: git/doc/usercard.tex @ 7a9a32

fieker-DuValspielwiese
Last change on this file since 7a9a32 was c8c3b8, checked in by Jens Schmidt <schmidt@…>, 26 years ago
* usercard.tex: minor fixes git-svn-id: file:///usr/local/Singular/svn/trunk@2193 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 14.6 KB
Line 
1% $Id: usercard.tex,v 1.4 1998-06-18 10:43:01 schmidt Exp $
2
3%
4% usercard.tex - Singular user quick reference card.
5%
6
7\input singcard.tex
8
9\centerline{\hbf SINGULAR Quick Reference}
10
11\centerline{\srm {\ssc Singular} Version 1.2.0}
12
13\bigskip
14
15Do not forget to terminate all commands with a {\tt ;} (semicolon)!
16
17In particular if \Singular\ prints the continuation prompt {\tt .}
18(peri\-od) instead of the regular command prompt {\tt >}, then it
19waits for a command to be terminated by a {\tt ;}.  If that does
20not help, try one or more {\tt "} or {\tt \char`}} to close an
21opened string or block.
22
23Comments start with {\tt //} and extend to end of line.
24
25\smallskip
26Some of the topics concerning interactive use are system dependent.
27
28\sec Starting SINGULAR(2.5cm)
29Singular&                       start \Singular\cr
30Singular {\it file} \rep&       read {\it files\/} and prompt for further commands\cr
31Singular --help&                print help on command line options and exit\cr
32\endsec
33
34\sec Stopping SINGULAR()
35quit;&                          exit \Singular; also {\tt exit;} or {\tt \$}\cr
36\ctl c&                         interrupt \Singular\cr
37\endsec
38
39\sec Getting help()
40help;&                          enter online help system\cr
41help {\it topic\/};&            describe {\it topic\/}; also {\tt? {\it topic\/};}\cr
42\subsec{Inside the online help system:}
43\ctl h&                         get help on help system\cr
44q&                              exit from help system\cr
45n\rmslash p\rmslash u&          go to next/previous/upper node\cr
46m&                              pick menu item by name\cr
47l&                              go to last visited node/exit from help on help\cr
48SPC\rmslash DEL&                scroll forward/backward one page\cr
49\endsec
50
51\sec Commandline editing()
52\sectext
53Commandline editing is similar to that of, e.g., {\tt bash} or {\tt tcsh}:\cr
54BS\rmslash\ctl d&               remove character on the left/right of cursor\cr
55\ctl p\rmslash\ctl n&           get previous/next line from history\cr
56\ctl b\rmslash\ctl f&           move cursor left/right\cr
57\ctl a\rmslash\ctl e&           go to beginning/end of line\cr
58\ctl u\rmslash\ctl k&           delete to beginning/end of line\cr
59\endsec
60
61\sec Names and objects()
62\sectext
63\parskip=\verysmallskipamount
64All names(=identifiers) have to be declared.  A declaration has the syntax
65
66{\tt\quad {\it type\/} {\it name\/} \opt{= {\it expression\/}};}
67
68Names of type {\tt number}, {\tt poly}, {\tt ideal}, {\tt vector}, {\tt
69module}, {\tt matrix}, {\tt map}, and {\tt resolution} may be declared
70only inside a ring.  They are local to that ring.  The same holds for a {\tt
71list} if it contains an object of the above types.  All other types may be
72declared at any time.  They are globally visible.
73
74Names may consist of alphanumeric characters including {\tt \_}
75(underscore) and have to start with a letter.  Capital and small letters
76are distinguished.  Names may be followed by an integer expression in
77parentheses, resulting in so-called {\it indexed names}.
78
79The expression {\tt {\it name\/}({\it n}..{\it m\/})} is a shortcut for {\tt
80{\it name\/}({\it n\/}), $\ldots$, {\it name\/}({\it m\/})} which in particular
81is useful for declaring ring variables (\eg {\tt ring r = 0, x(1..3), dp;}).
82
83The special name {\tt \_} (underscore) may be used to refer to the value of the
84last expression printed.
85\cr
86\endsec
87
88\vfill
89\centerline{\srm \copyright 1998 \qquad Permissions on back}
90
91\eject
92
93\sec Ring declaration()
94\longentry ring {\it name\/} = {\it basefield}, ({\it ringvars\/}), {\it ordering\/};&
95                                \hyphenpenalty=50 \tolerance=200 declare ring
96                                {\it name\/} and make it the new base\-ring.
97                                {\it ringvars\/} has to be a list of names, the
98                                other items are described below.  Example:\par
99                                {\tt ring r = 32003, (x, y, z), dp;}\cr
100\longentry qring {\it name\/} = {\it ideal\/};&
101                                declare quotient ring {\it name\/} of the
102                                current base\-ring with respect to {\it
103                                ideal\/}{\it ideal\/} has to be a standard
104                                basis.  Make {\it name\/} the new basering.\cr
105\subsec{Available {\bit basefields\/}:}
1060&                              the rational numbers\cr
107\it p&                          the finite field $Z_p$ with {\it p\/}
108                                elements,\par
109                                $2 \le p \le 32003$ a prime\cr
110({\it p\/}\^{}{\it n}, {\it gen\/})&
111                                the finite field with $p^n$ elements, {\it p\/}
112                                a prime and\par $4 \le p^n \le 32671$. The name
113                                {\it gen\/} refers to some generator of the
114                                cyclic group of unities.\cr
115({\it p}, {\it alpha\/})&       algebraic extension of $Q$ or $Z_p$ ($p =
116                                0$ or as above) by {\it alpha}.  The minpoly
117                                $\mu_{\hbox{\tit alpha}}$ for {\it alpha\/} has
118                                to be specified with an assignment to {\tt
119                                minpoly} (\eg {\tt minpoly=a\^{}2+1;}, for
120                                $\hbox{\it alpha}=\hbox{\tt a}$).  {\it
121                                alpha\/} has to be a name.\cr
122({\it p}, $t_1$, $\ldots$)&     transcendental extension of $Q$ or $Z_p$
123                                ($p = 0$ or as above) by~$t_i$.  The $t_i$ have
124                                to be names.\cr
125real&                           the real numbers represented by floating point
126                                numbers\cr
127\endsec
128
129\sec Term orderings()
130\sectext
131An {\it ordering\/} as referred to in the ring declaration may either be
132a global, local, or matrix ordering or a list of these resulting in a
133pro\-duct ordering.  The list may include extra weight vectors and may be
134preceded or followed by a module ordering specification.\cr
135\subsec{Global orderings}
136lp&                             lexicographical ordering\cr
137dp&                             degree reverse lexicographical ordering\cr
138Dp&                             degree lexicographical ordering\cr
139wp($w_1$, $\ldots$)&            weighted reverse lexicographical ordering\cr
140Wp($w_1$, $\ldots$)&            weighted lexicographical ordering\cr
141&                               The $w_i$ have to be positive integers.\cr
142\subsec{Local orderings}
143ls&                             negative lexicographical ordering\cr
144ds&                             negative degree reverse lexicographical ordering\cr
145Ds&                             negative degree lexicographical ordering\cr
146ws($w_1$, $\ldots$)&            general weighted reverse lexicographical ordering\cr
147Ws($w_1$, $\ldots$)&            general weighted lexicographical ordering\cr
148&                               $w_1$ has to be a non-zero integer, every other
149                                $w_i$ may be any integer\cr
150\subsec{Matrix orderings}
151\longentry M($m_{11}$, $m_{12}$, $\ldots$, $m_{nn}$)&
152                                {\it m\/} has to be an invertible matrix with
153                                integer coeffi\-cients.  Coefficients have to be
154                                specified row-wise.\cr
155\subsec{Product orderings}
156\longentry($o_1$\opt{($k_1$)}, $o_2$\opt{($k_2$)}, $\ldots$, $o_n$\opt{($k_n$)})&
157                                the $o_i$ have to be any of the above orderings.
158                                {\tt lp}, {\tt dp}, {\tt Dp}, {\tt ls}, {\tt
159                                ds}, {\tt Ds} may be followed by an integer
160                                expression $k_i$ in parentheses specifying the
161                                number of variables $o_i$ refers to (\eg {\tt
162                                (lp(3), dp(2))}).\cr
163\subsec{Extra weight vector}
164a($w_1$, $\ldots$)&             any of the above degree orderings may be
165                                preceded by an extra weight vector\cr
166\noalign{\eject}
167\subsec{Module orderings}
168({\it c}, $o_1$, $\ldots$)&     sort by components first\cr
169($o_1$, $\ldots$, {\it c\/})&   sort by variables first\cr
170&                               $o_i$ may be any of the above orderings or an
171                                extra weight vector, {\it c\/} may be one of
172                                {\tt C} or {\tt c}:\cr
173C&                              sort generators in ascending order (\ie {\tt
174                                gen({\it i\/})} $<$ {\tt gen({\it j\/})} iff $i <
175                                j$)\cr
176c&                              sort generators in descending order\cr
177\endsec
178
179\sec Data types(1.5cm)
180\sectext
181Examples of ring-independent types:\cr
182\entryskip
183\longitem
184int i1 = 101; int i2 = 13 div 3;\cr
185\entryskip
186\longitem
187intvec iv = 13 div 3, -4, i1;\cr
188\entryskip
189\longentry
190intmat im[2][2] = 13 div 3, -4, i1;&
191                                a $2\times 2$ matrix.  Entries are filled
192                                row-wise, missing entries are set to zero, extra
193                                entries are ignored.  vector/matrix elements are
194                                accessed using the {\tt[$\ldots$]} operator,
195                                where the first element has index one (\eg {\tt
196                                iv[3]; im[1, 2];}).\cr
197\entryskip
198\longitem
199string s1 = "a quote \char"5C " and a backslash \char"5C \char"5C";\par
200string s2 = "con" + "catenation";\cr
201\entryskip
202\sectext
203Basering in the following is {\tt ring r = 0, (x, y, z, mu, nu), dp;}\cr
204\entryskip
205\longitem
206number n = 5/3;\cr
207\entryskip
208\longentry
209poly p(1) = 3/4x3yz4+2xy2;\par
210poly p(2) = (5/3)*mu\^{}2*nu\^{}3+n*yz2;&
211                                {\tt p(1)} equals $3/4x^3yz^4+2xy^2$.  Short
212                                format of mono\-mials is valid for one-character
213                                ring variables only.\cr
214\entryskip
215\longentry
216ideal i = p(1..2), x+y;&        note the use of indexed names\cr
217\entryskip
218\longentry
219vector v = [p(1), p(2), x+y];\par
220vector w = 2*p(1)*gen(6)+n*nu*gen(1);&
221                                vectors may be written in brackets ({\tt
222                                [$\ldots$]}) or expressed as linear
223                                combinations of the canonical generators {\tt
224                                gen({\it i\/})}\cr
225\entryskip
226\longitem
227module mo = v, w, x+y*gen(1);\cr
228\entryskip
229\longitem
230resolution r = sres(std(mo), 0);\cr
231\entryskip
232\longentry
233matrix ma[2][2] = 5/3, p(1), 101;&
234                                the rules for declaring, filling, and accessing
235                                integer matrices apply to types {\tt matrix}
236                                and {\tt vector}, too\cr
237\entryskip
238\longentry
239list l = iv, v, p(1..2), mo;&
240                                lists may collect objects of any type.  They are
241                                ring-dependent iff one of the entries is.\cr
242\entryskip
243\longentry
244def d = read("MPfile:r example.mp");&
245                                a name of type {\tt def} inherits the type of
246                                the object assigned first to it.  Useful if the
247                                actual type of an object is unknown.\cr
248\endsec
249
250\sec Monitoring and debugging tools()
251timer = 1;&                     print time used for commands to execute\cr
252\longentry int t = timer; {\it command\/}; \rep; timer-t;&
253                                print time used for {\it commands\/} to execute\cr
254memory(1);&                     print number of bytes allocated from system\cr
255option(prot);&                  show algorithm protocol\cr
256option(mem);&                   show algorithm memory usage\cr
257\entryskip
258TRACE = 1;&                     print protocol on execution of procedures\cr
259listvar(all);&                  list all (user-)defined names\cr
260\longentry listvar({\it ringname\/});&
261                                list all names belonging to {\it ringname}\cr
262\endsec
263
264\eject
265
266\sec Options()
267option();&                      show current option settings\cr
268\longentry option($option_1$, no$option_2$, $\ldots$);&
269                                switch $option_1$ on and $option_2$ off, resp.\cr
270option(none);&                  reset all options to default values\cr
271\sectext
272Type {\tt help option;} for a list of all options.\cr
273\subsec{Monitoring}
274debugLib&                       show loading of procedures from libraries\cr
275mem&                            show algorithm memory usage\cr
276prot&                           show algorithm protocol\cr
277\subsec{Standard bases}
278fastHC&                         try to find highest corner as fast as possible\cr
279intStrategy&                    avoid divisions\cr
280morePairs&                      create additional pairs\cr
281notSugar&                       disable sugar strategy\cr
282redSB&                          compute reduced standard bases\cr
283redTail&                        reduce tails\cr
284sugarCrit&                      use sugar criteria\cr
285weightM&                        automatically compute weights\cr
286\subsec{Resolutions}
287minRes&                         do additional minimizing\cr
288notRegularity&                  disable regularity bound\cr
289\subsec{Miscellany}
290returnSB&                       let some functions return standard bases\cr
291\endsec
292
293\sec System variables()
294\sectext
295Type {\tt help System variables;} for a list of all system variables.\cr
296\subsec{Standard bases}
297degBound&                       stop if (weighted) total degree exceeds {\tt
298                                degBound}\cr
299multBound&                      stop if multiplicity gets smaller than {\tt
300                                multBound}\cr
301noether&                        cut off all monomials above monomial {\tt
302                                noether}\cr
303\subsec{Miscellany}
304basering&                       current basering\cr
305minpoly&                        minimal polynomial for algebraic extensions\cr
306short&                          do not print monomials in short format if zero\cr
307timer&                          on assignment of a non-zero value show time
308                                used for execution of executed commands.  On
309                                evaluation, return system time in seconds used
310                                by \Singular\ since start\cr
311TRACE&                          print information on procedures being executed
312                                if larger than one\cr
313\endsec
314
315\sec Input and output()
316< "{\it filename\/}";&          load and execute {\it filename\/}\cr
317\longentry write("{\it filename\/}", {\it expression}, \rep)&
318                                write {\it expressions} to ASCII file {\it
319                                filename}\cr
320\longentry read("{\it filename\/}");&
321                                read ASCII file {\it filename\/} and return
322                                content as a string.  See also example below.\cr
323\longentry
324dump("MPfile: {\it filename\/}");\par
325getdump("MPfile: {\it filename\/}");&
326                                dump current state of {\sc Singular} to {\it
327                                filename} and retrieve it, resp.\cr
328\entryskip
329\sectext
330An example how to write one single expression (in this case the
331ideal {\tt i}) to a file and read it back from there:
332
333{\tt
334write("i.save", i);\par
335execute("ideal i=" + read("i.save") + ";");
336}\cr
337\endsec
338
339\eject
340                               
341\sec Libraries()
342LIB "{\it library\/}";&         load {\it library}\cr
343help {\it library\/};&          show help on {\it library}\cr
344help all.lib;&                  show list of all libraries\cr
345\endsec
346
347\sec Mapping(1.5cm)
348\longentry map {\it name\/} = {\it ringname}, {\it ideal\/};&
349                                declare a map {\it name\/} from {\it ringname\/}
350                                to current basering.  The $i$-th ring variable
351                                from {\it ringname\/} is mapped to the $i$-th
352                                generator of {\it ideal}.\cr
353\longentry {\it mapname\/}({\it expression\/})&
354                                apply map {\it mapname\/} to {\it expression}\cr
355\entryskip
356\sectext
357Coefficients between rings with different basefields are mapped in the following
358way (non-canonical maps only):\strut
359\abovedisplayskip=0pt
360\belowdisplayskip=0pt
361$$
362\eqalign{Z_p \rightarrow Q&  :[i]_p \mapsto i \in [-p/2,p/2] \subset Z\cr
363         Z_p \rightarrow Z_q&:[i]_p \mapsto i \in [-p/2,p/2] \subset Z, i \mapsto [i]_q}
364$$
365\cr
366\noalign{\vskip -9pt} % dirty trick, gobbles the trailing \strut from \sectext
367\entryskip
368\longentry fetch({\it ringname}, {\it name\/})&
369                                map object {\it name\/} from ring {\it
370                                ringname\/} to current base\-ring.  The rings
371                                have to be ``almost'' identical.\cr
372\longentry imap({\it ringname}, {\it name\/})&
373                                map object {\it name\/} from subring {\it
374                                ringname\/} to current basering\cr
375\longentry subst({\it expression}, {\it ringvar}, {\it monomial\/})&
376                                substitute {\it ringvar\/} by {\it monomial\/}
377                                in {\it expression}\cr
378\endsec
379
380\sec Miscellany(1.5cm)
381\longentry ord({\it poly\/\alt vector\/})&
382                                return (weighted) degree of initial term\cr
383\longentry deg({\it poly\/\alt vector\/})&
384                                return maximal (weighted) degree\cr
385\longentry
386size({\it ideal\/\alt module\/})\par
387size({\it poly\/\alt vector\/})\par
388size({\it string\/\alt intvec\/\alt list\/})&
389                                return (1) number of non-zero generators;
390                                (2) number of monomials; (3) length\cr
391\longentry kill({\it name\/})&
392                                delete variable {\it name}\cr
393\longentry setring({\it name}\/)&
394                                make {\it name} the current basering\cr
395\endsec
396
397\sec Standard bases(1.5cm)
398\longentry groebner({\it ideal\/\alt module\/}\opt{, {\it int\/}})&
399                                compute a standard basis using a heuristically
400                                choosen method.  Delimit computation time to
401                                {\it int\/} seconds.\cr
402\longentry std({\it ideal\/\alt module\/}\opt{, {\it intvec\/}})&
403                                compute a standard basis.  Use first
404                                Hilbert-series {\it intvec\/} (result from {\tt
405                                hilb($\ldots$, 1)}) for Hilbert-driven
406                                computation.\cr
407\longentry stdfglm({\it ideal\/}\opt{,{\it string\/}})&
408                                compute a standard basis\cr
409\longentry stdhilb({\it ideal\/}\opt{,{\it intvec\/}})&
410                                compute a standard basis\cr
411\endsec
412
413\sec Invariants of ideals and modules(1.5cm)
414\longentry hilb({\it ideal\/\alt module\/}\opt{, {\it int\/}})&
415                                display first and second hilbert series with one
416                                argument.\cr
417\endsec
418
419\bye
Note: See TracBrowser for help on using the repository browser.