Changeset d9267f in git

May 25, 1998, 11:49:02 AM (25 years ago)
Jens Schmidt <schmidt@…>
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '0604212ebb110535022efecad887940825b97c3f')
	* usercard.tex (Input and output): new section
	  (Miscellany): new section

	* usercard.tex: fixes fixed

git-svn-id: file:///usr/local/Singular/svn/trunk@1977 2c84dea3-7e68-4137-9b89-c4e89433aadc
1 edited


  • doc/usercard.tex

    r129d72 rd9267f  
    1 % $Id: usercard.tex,v 1.1 1998-05-12 07:24:29 schmidt Exp $
     1% $Id: usercard.tex,v 1.2 1998-05-25 09:49:02 schmidt Exp $
    1515Do not forget to terminate all commands with a {\tt ;} (semicolon)!
    17 Especially if \Singular\ prints the continuation prompt {\tt .}
     17In particular if \Singular\ prints the continuation prompt {\tt .}
    1818(dot) instead of the regular command prompt {\tt >}, then it
    1919waits for a command to be terminated by a {\tt ;}.  If that does
    2020not help, try one or more {\tt "} or {\tt \char`}} to close an
    21 opened string or procedure.
    23 Comments start with {\tt //} and extend to the end of the line.
     21opened string or block.
     23Comments start with {\tt //} and extend to end of line.
     26Some of the topics concerning interactive use are system dependent.
    2528\sec Starting SINGULAR(2.5cm)
    2629Singular&                       start \Singular\cr
    2730Singular {\it files} $\ldots$&  read {\it files\/} and prompt for further commands\cr
    28 Singular --help&                print short help on command line options and
    29                                 exit\cr
     31Singular --help&                print help on command line options and exit\cr
    3234\sec Stopping SINGULAR()
    3335quit;&                          exit \Singular; also {\tt exit;} or {\tt \$}\cr
    34 \ctl c&                         interrupt \Singular\ (on $*$ix systems only)\cr
     36\ctl c&                         interrupt \Singular\cr
    3941help {\it topic\/};&            describe {\it topic\/}; also {\tt? {\it topic\/};}\cr
    4042\subsec{Inside the online help system:}
    41 &                               (on $*$ix systems only)\cr
    4243\ctl h&                         get help on help system\cr
    4344q&                              exit from help system\cr
    5051\sec Commandline editing()
    52 You may edit the commandline and retrieve previous commands in a
    53 way common to most modern shells (on $*$ix systems only):\cr
    54 BS\rmslash\ctl d&               remove character on the left/right of the
    55                                 cursor\cr
     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
    5655\ctl p\rmslash\ctl n&           get previous/next line from history\cr
    5756\ctl b\rmslash\ctl f&           move cursor left/right\cr
    7170only inside a ring.  They are local to that ring.  The same holds for a {\tt
    7271list} if it contains an object of the above types.  All other types may be
    73 declared at any moment.  They are visible globally.
    75 Names may consist of alphanumeric characters including {\tt \_} (underscore) and
    76 have to start with a letter.  Names may be followed by an integer expression in
     72declared at any time.  They are globally visible.
     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
    7777parentheses, resulting in so-called {\it indexed names}.
    7979The expression {\tt {\it name\/}({\it n}..{\it m\/})} is a shortcut for {\tt
    80 {\it name\/}({\it n\/}), $\ldots$, {\it name\/}({\it m\/})} which is especially
    81 useful for declaring ring variables (\eg {\tt ring r = 0, x(1..3), dp;}).\cr
     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;}).
     83The special name {\tt \_} (underscore) may be used to refer to the value of the
     84last expression printed.
    8993\sec Ring declaration()
    9094\longentry ring {\it name\/} = {\it basefield}, ({\it ringvars}), {\it ordering\/};&
    91                                 \hyphenpenalty=50 \tolerance=200 declare the
    92                                 ring {\it name\/} and make it the current
    93                                 base\-ring.  {\it ringvars\/} has to be a list
    94                                 of names or indexed names, the other items are
    95                                 described below.  An example:\par {\tt ring r =
    96                                 32003, (x, y, z), dp;}\cr
     95                                \hyphenpenalty=50 \tolerance=200 declare ring
     96                                {\it name\/} and make it the current 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
    97100\longentry qring {\it name\/} = {\it ideal\/};&
    98                                 declare the quotient ring {\it name\/} of the
    99                                 current basering with respect to ideal {\it
    100                                 ideal\/}.  Make {\it name\/} the new
    101                                 basering.\cr
     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                                bases.  Make {\it name\/} the new basering.\cr
    102105\subsec{Available {\bit basefields\/}:}
    103 0&                              the field of rational numbers\cr
     1060&                              the rational numbers\cr
    104107\it p&                          the finite field $Z_p$ with {\it p\/}
    105108                                elements,\par
    107110({\it p\/}\^{}{\it n}, {\it gen\/})&
    108111                                the finite field with $p^n$ elements, {\it p\/}
    109                                 a prime and\par
    110                                 $4 \le p^n \le 32671$. The name {\it gen\/}
    111                                 refers to some generator of the group of
    112                                 unities.\cr
     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
    113115({\it p}, {\it alpha\/})&       algebraic extension of $Q$ or $Z_p$ ($p =
    114                                 0$ or as above) by {\it alpha}.  You have to
    115                                 specify the minpoly $\mu_{\hbox{\tit alpha}}$
    116                                 for {\it alpha\/} immediately after the ring
    117                                 declaration with an assignment to {\tt minpoly}
    118                                 (\eg {\tt minpoly=a\^{}2+1;}).  {\it alpha\/}
    119                                 has to be a valid name.\cr
     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
    120122({\it p}, $t_1$, $\ldots$)&     transcendental extension of $Q$ or $Z_p$
    121                                 ($p = 0$ or as above) by~$t_i$.  As $t_i$ you
    122                                 may use either names or indexed names.\cr
     123                                ($p = 0$ or as above) by~$t_i$.  The $t_i$ have
     124                                to be names.\cr
    123125real&                           the real numbers represented by floating point
    124126                                numbers\cr
    127129\sec Term orderings()
    129 An {\it ordering\/} as referred to in the ring declaration may be either
     131An {\it ordering\/} as referred to in the ring declaration may either be
    130132a global, local, or matrix ordering or a list of these resulting in a
    131133pro\-duct ordering.  The list may include extra weight vectors and may be
    132 preceded or followed by a module order specification.\cr
     134preceded or followed by a module ordering specification.\cr
    133135\subsec{Global orderings}
    134136lp&                             lexicographical ordering\cr
    147149                                $w_i$ may be any integer\cr
    148150\subsec{Matrix orderings}
    149 \longentry M($M_{11}$, $M_{12}$, $\ldots$, $M_{nn}$)&
    150                                 {\it M\/} has to be an invertible matrix with
     151\longentry M($m_{11}$, $m_{12}$, $\ldots$, $m_{nn}$)&
     152                                {\it m\/} has to be an invertible matrix with
    151153                                integer coeffi\-cients.  Coefficients have to be
    152154                                specified row-wise.\cr
    153155\subsec{Product orderings}
    154156\longentry($o_1$\opt{($k_1$)}, $o_2$\opt{($k_2$)}, $\ldots$, $o_n$\opt{($k_n$)})&
    155                                 the orderings {\tt lp}, {\tt dp}, {\tt Dp}, {\tt
    156                                 ls}, {\tt ds}, {\tt Ds} may be followed by an
    157                                 integer expression $k_i$ in parentheses which
    158                                 specifies the number of variables $o_i$ refers
    159                                 to (\eg {\tt (lp(3), dp(2))}).\cr
     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
    160167\subsec{Module orderings}
    161168({\it c}, $o_1$, $\ldots$)&     sort by components first\cr
    168175                                j$)\cr
    169176c&                              sort generators in descending order\cr
    170 \subsec{Extra weight vector}
    171 a($w_1$, $\ldots$)&             any of the above degree orderings may be
    172                                 preceded by an extra weight vector\cr
    173 \endsec
    175 \begingroup
    176 \def\interentryskip{\noalign{\verysmallskip}}%
    177179\sec Data types(1.5cm)
    179 First, examples of ring-independent types:\cr
    180 \interentryskip
     181Examples of ring-independent types:\cr
    182184int i1 = 101; int i2 = 13 div 3;\cr
    183 \interentryskip
    185187intvec iv = 13 div 3, -4, i1;\cr
    186 \interentryskip
    188190intmat im[2][2] = 13 div 3, -4, i1;&
    191193                                entries are ignored.  vector/matrix elements are
    192194                                accessed using the {\tt[$\ldots$]} operator,
    193                                 where the first index is one (\eg {\tt iv[3];
    194                                 im[1, 2];}).\cr
    195 \interentryskip
     195                                where the first element has index one (\eg {\tt
     196                                iv[3]; im[1, 2];}).\cr
    197199string s1 = "a quote \char"5C " and a backslash \char"5C \char"5C";\par
    198200string s2 = "con" + "catenation";\cr
    199 \interentryskip
    200 \sectext
    201 The basering in the following is {\tt ring r = 0, (x, y, z, mu, nu), dp;}\cr
    202 \interentryskip
     203Basering in the following is {\tt ring r = 0, (x, y, z, mu, nu), dp;}\cr
    204206number n = 5/3;\cr
    205 \interentryskip
    207209poly p(1) = 2xy2+3/4x3yz4;\par
    208210poly p(2) = (5/3)*mu\^{}2*nu\^{}3+n*yz2;&
    209                                 {\tt p(1)} equals $3/4x^3yz^4+2xy^2$.  The
    210                                 short format of monomials is valid for
    211                                 one-character ring variables only.\cr
    212 \interentryskip
     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
    214216ideal i = p(1..2), x+y;&        note the use of indexed names\cr
    215 \interentryskip
    217219vector v = [p(1), p(2), x+y];\par
    221223                                combinations of the canonical generators {\tt
    222224                                gen({\it i\/})}\cr
    223 \interentryskip
    225227module mo = v, w, x+y*gen(1);\cr
    226 \interentryskip
    228230resolution r = sres(std(mo), 0);\cr
    229 \interentryskip
    231233matrix ma[2][2] = 5/3, p(1), 101;&
    232234                                the rules for declaring, filling, and accessing
    233                                 of integer matricies apply to the types {\tt
    234                                 matrix} and {\tt vector}, too\cr
    235 \interentryskip
     235                                integer matrices apply to types {\tt matrix}
     236                                and {\tt vector}, too\cr
    237239list l = iv, v, p(1..2), mo;&
    238240                                lists may collect objects of any type.  They are
    239241                                ring-dependent iff one of the entries is.\cr
    240 \endsec
    241 \endgroup
     244def d = read("MPfile:r");&
     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
    243250\sec Monitoring and debugging tools()
    244251timer = 1;&                     print time used for commands to execute\cr
    245252\longentry int t = timer; {\it commandsequence}; timer-t;&
    246                                 print time in seconds used for {\it commandsequence}
    247                                 to execute\cr
     253                                print time used for {\it commandsequence} to
     254                                execute\cr
    248255memory(1);&                     print number of bytes allocated from system\cr
    249256option(prot);&                  show algorithm protocol\cr
    250257option(mem);&                   show algorithm memory usage\cr
    251 \noalign{\medskip}
    252259TRACE = 1;&                     print protocol on execution of procedures\cr
    253260listvar(all);&                  list all (user-)defined names\cr
    264271option(none);&                  reset all options to default values\cr
    266 The most important options:\cr
     273Type {\tt help option;} for a list of all options.\cr
    268275debugLib&                       show loading of procedures from libraries\cr
    287294\sec System variables()
    289 The most important system variables:\cr
     296Type {\tt help System variables;} for a list of all system variables.\cr
    290297\subsec{Standard bases}
    291298degBound&                       stop if (weighted) total degree exceeds {\tt
    296303                                noether}\cr
    298 minPoly&                        use {\tt minPoly} as minimal polynomial for
    299                                 algebraic extensions\cr
    300 short&                          print monomials in a long format if non-zero\cr
     305basering&                       the current basering\cr
     306minpoly&                        minimal polynomial for algebraic extensions\cr
     307short&                          do not print monomials in short format if zero\cr
    301308timer&                          on assignment of a non-zero value show time
    302309                                used for execution of executed commands.  On
    304311                                by \Singular\ since start\cr
    305312TRACE&                          print information on procedures being executed
    306                                 if {\tt TRACE} is larger than one\cr
     313                                if larger than one\cr
     316\sec Input and output()
     317< "{\it filename}";&            load and execute {\it filename}\cr
     318\longentry write("{\it filename}", {\it expression\_list})&
     319                                write {\it expression\_list} to ASCII file {\it
     320                                filename}\cr
     321\longentry read("{\it filename}");&
     322                                read ASCII file {\it filename} and return
     323                                content as a string.  See also example below.\cr
     325dump("MPfile: {\it filename}");\par
     326getdump("MPfile: {\it filename}");&
     327                                dump current state of {\sc Singular} to {\it
     328                                filename} and retrieve it, resp.\cr
     331An example how to write one single expression (in this case the
     332ideal {\tt i}) to a file and read it back from there:
     335write("", i);\par
     336execute("ideal i=" + read("") + ";");
     342\sec Libraries()
     343LIB "{\it library\/}";&         load {\it library}\cr
     344help {\it library\/};&          show help on {\it library}\cr
     345help all.lib;&                  show list of all libraries\cr
    309348\sec Mapping(1.5cm)
    310 \longentry map {\it name\/} = {\it ringname}, {\it idealexpression};&
     349\longentry map {\it name\/} = {\it ringname}, {\it ideal\/};&
    311350                                declare a map {\it name\/} from {\it ringname}
    312351                                to current basering.  The $i$'th ring variable
    313352                                from {\it ringname} is mapped to the $i$'th
    314                                 generator from {\it idealexpression}.\cr
     353                                generator of {\it ideal}.\cr
    315354\longentry {\it mapname\/}({\it expression\/})&
    316355                                apply map {\it mapname\/} to {\it expression}\cr
    317 \noalign{\smallskip}
    319358Coefficients between rings with different basefields are mapped in the following
    320 way (non-canonical maps only):\par
    321 $Z_p \rightarrow Q: [i]_p \mapsto i \in [-p/2,p/2] \subset Z$\par
    322 $Z_p \rightarrow Z_q: [i]_p \mapsto i \in [-p/2,p/2] \subset Z \mapsto [i]_q \in
    323 Z_q$\cr
    324 \noalign{\smallskip}
     359way (non-canonical maps only):\strut
     363\eqalign{Z_p \rightarrow Q&  :[i]_p \mapsto i \in [-p/2,p/2] \subset Z\cr
     364         Z_p \rightarrow Z_q&:[i]_p \mapsto i \in [-p/2,p/2] \subset Z, i \mapsto [i]_q}
     367\noalign{\vskip -9pt} % dirty trick, gobbles the trailing \strut from \sectext
     369\longentry fetch({\it ringname}, {\it name\/})&
     370                                map object {\it name\/} from ring {\it
     371                                ringname\/} to current base\-ring.  The rings
     372                                have to be ``almost'' identical.\cr
     373\longentry imap({\it ringname}, {\it name\/})&
     374                                map object {\it name\/} from subring {\it
     375                                ringname\/} to current basering\cr
    325376\longentry subst({\it expression}, {\it ringvar}, {\it monomial\/})&
    326377                                substitute {\it ringvar\/} by {\it monomial\/}
    327378                                in {\it expression}\cr
    328 \longentry imap({\it ringname}, {\it name\/})&
    329                                 map object {\it name\/} from subring {\it
    330                                 ringname\/} to current basering\cr
    331 \longentry fetch({\it ringname}, {\it name\/})&
    332                                 map object {\it name\/} from ring {\it
    333                                 ringname\/} to current basering.  The rings
    334                                 have to be ``allmost'' identical.\cr
    335 \endsec
    337 \sec Liebe SINGULAR-Entwickler und Benutzer!()
    338 \sectext
    339 \font\ninerm=cmr9
    340 \ninerm\baselineskip=11pt
    341 \parindent=1em
    342 Das ist der Entwurf einer Quick-Reference-Card f\"ur SINGULAR.  Nachdem der
    343 `kanonische' Teil gesetzt ist, gebe ich die Arbeit weiter an Euch.  Genauer:
    345 \medskip
    346 \item{$\bullet$} K\"onntet Ihr bitte den bereits vorhandenen Text korrektur\-lesen,
    347   insbesondere auch auf typografische Fehler achtend.
    349 \item{$\bullet$} Eure \"Anderungsw\"unsche und Kritik dazu h\"atte ich gerne.
    350   Allerdings ist die erste Seite bereits voll.  Wenn Ihr also irgendwo eine
    351   Zeile mehr haben wollt, m\"u\ss t Ihr auch dazusagen, wo eine andere
    352   rausgenommen werden soll.
    354 \hang Die Karte ist keine Kurzeinf\"uhrung in SINGULAR, sondern soll als
    355   Ged\"achtnisst\"utze dienen.  Dies bitte bei Kritik der Art ``zu ungenau!''
    356   oder ``besser!'' beachten.  Davon abgesehen bitte ich um konstruktive Kritik.
    358 \item{$\bullet$} Es fehlen noch Abschnitte zu Input/Output und zu den
    359   meistgebrauchten mathematischen Funktionen.  F\"ur den Input/Output-Teil bitte
    360   das aufschreiben, was ihr f\"ur erw\"ahnenswert haltet bzw. h\"aufig braucht.
    361   Und f\"ur die mathematischen Funktionen bitte ich regelrecht um eine
    362   ``Top-Twenty'' der von Euch am h\"aufigsten gebrauchten SINGULAR-Kernel
    363   Funktionen.  Oder auch Library-Funktionen?
    365 \hang Irgendwann soll es noch eine ``Programmer's Quick Reference Card''
    366   geben (hoffentlich nicht von mir).  Dementsprechend also eher Funktionen
    367   ber\"ucksichtigen, die f\"ur den interaktiven Gebrauch wichtig sind.
    368 \cr
     381\sec Miscellany(1.5cm)
     382\longentry ord({\it poly\/}\alt{\it vector\/})&
     383                                return (weighted) degree of initial term\cr
     384\longentry deg({\it poly\/}\alt{\it vector\/})&
     385                                return maximal (weighted) degree of terms\cr
Note: See TracChangeset for help on using the changeset viewer.