[BACK]Return to risa.texi CVS log [TXT][DIR] Up to [local] / OpenXM / src / asir-doc / parts

Annotation of OpenXM/src/asir-doc/parts/risa.texi, Revision 1.16

1.16    ! noro        1: @comment $OpenXM: OpenXM/src/asir-doc/parts/risa.texi,v 1.15 2014/12/14 00:53:08 takayama Exp $
1.1       noro        2: @node Risa/Asir,,, Top
                      3: @chapter Risa/Asir
                      4:
                      5: @menu
1.2       noro        6: \BJP
1.1       noro        7: * Risa $B$*$h$S(B Asir::
                      8: * Asir $B$NFCD'(B::
1.9       noro        9: * Installation::
1.1       noro       10: * $B%3%^%s%I%i%$%s%*%W%7%g%s(B::
                     11: * $B4D6-JQ?t(B::
                     12: * $B5/F0$+$i=*N;$^$G(B::
                     13: * $B3d$j9~$_(B::
                     14: * $B%(%i!<=hM}(B::
                     15: * $B7W;;7k2L$*$h$SFC<l$J?t(B::
1.2       noro       16: \E
                     17: \BEG
                     18: * Risa and Asir::
                     19: * Features of Asir::
                     20: * Installation::
                     21: * Command line options::
                     22: * Environment variable::
                     23: * Starting and Terminating an Asir session::
                     24: * Interruption::
                     25: * Error handling::
                     26: * Referencing results and special numbers::
                     27: \E
1.1       noro       28: @end menu
                     29:
1.2       noro       30: \BJP
1.1       noro       31: @node Risa $B$*$h$S(B Asir,,, Risa/Asir
                     32: @section Risa $B$*$h$S(B Asir
1.2       noro       33: \E
                     34: \BEG
                     35: @node Risa and Asir,,, Risa/Asir
                     36: @section @b{Risa} and @b{Asir}
                     37: \E
1.1       noro       38:
                     39: @noindent
1.2       noro       40: \BJP
1.1       noro       41: @b{Risa} $B$O(B, $BIY;NDL8&$G3+H/Cf$N?t<0=hM}%7%9%F%`(B/$B%i%$%V%i%j$NAm>N$G$"$k(B.
                     42: @b{Risa} $B$N9=@.$O<!$NDL$j$G$"$k(B.
1.2       noro       43: \E
                     44: \BEG
                     45: @b{Risa} is the name of whole libraries of a computer algebra system
                     46: which is under development at FUJITSU LABORATORIES LIMITED.
                     47: The structure of @b{Risa} is as follows.
                     48: \E
1.1       noro       49:
                     50: @itemize @bullet
                     51: @item
1.2       noro       52: \JP @code{$B4pK\1i;;It(B}
                     53: \EG @b{The basic algebraic engine}
1.8       noro       54: @*
1.2       noro       55: \BJP
1.1       noro       56: $B$3$l$O(B, @b{Risa} $B$NFbIt7A<0$KJQ49$5$l$?%*%V%8%'%/%H(B ($B?t(B, $BB?9`<0$J$I(B)
                     57: $B$N4V$N1i;;$r<B9T$9$kItJ,$G$"$j(B, UNIX $B$N(B @samp{libc.a} $B$J$I$HF1MM$N(B, $B%i%$%V%i(B
                     58: $B%j$H$7$FB8:_$9$k(B. $B%(%s%8%s$O(B, C $B$*$h$S(B $B%"%;%s%V%i$G5-=R$5$l(B, $B8e=R$9$k(B
1.2       noro       59: $B8@8l%$%s%?%U%'!<%9(B @b{Asir} $B$N4pK\1i;;It$H$7$FMQ$$$i$l$F$$$k(B.
                     60: @comment $B0lJ}(B, $B?t<07W;;$rI,MW$H$9$k$5$^$6$^$J%W%m%0%i%`Cf$K%j%s%/$7$FMQ$$$k$3$H$,$G$-$k(B.
                     61: \E
                     62: \BEG
                     63: This is the part which performs basic algebraic operations,
                     64: such as arithmetic operations, to algebraic objects, e.g., numbers and
                     65: polynomials, which are already converted into internal forms.
                     66: It exists, like @samp{libc.a} of UNIX, as a library of ordinary UNIX system.
                     67: The algebraic engine is written mainly in C language and
                     68: partly in assembler.
                     69: It serves as the basic operation part of @b{Asir}, a standard
                     70: language interface of @b{Risa}.
                     71: @comment It can also be linked to various programs that need some symbolic
                     72: @comment and algebraic computation.
                     73: \E
                     74:
1.1       noro       75: @item
1.2       noro       76: \JP @code{$B%a%b%j4IM}It(B}
                     77: \EG @b{Memory Manager}
1.8       noro       78: @*
1.2       noro       79: \BJP
1.1       noro       80: @b{Risa} $B$G$O(B, $B%a%b%j4IM}It$H$7$F(B, @code{[Boehm,Weiser]} $B$K$h$k%U%j!<(B
1.11      noro       81: $B%=%U%H%&%'%"(B (@code{gc-6.1alpha5}) $B$rMQ$$$F$$$k(B. $B$3$l$O%,!<%Y%8%3%l%/%7%g%s(B
1.1       noro       82: ($B0J2<(B GC $B$H8F$V(B) $B$r<+F0E*$K9T$&%a%b%j3d$jEv$F5!9=$r;}$A(B, @b{Risa} $B$N3F(B
                     83: $BItJ,$O$9$Y$F$3$l$K$h$jI,MW$J%a%b%j$rF@$F$$$k(B.
1.2       noro       84: \E
                     85: \BEG
                     86: @b{Risa} employs, as its memory management component (the memory
1.11      noro       87: manager), a free software distributed by Boehm (@code{gc-6.1alpha5}).
1.2       noro       88: It is proposed by @code{[Boehm,Weiser]}, and developed by Boehm and
                     89: his colleagues.
                     90: The memory manager has a memory allocator which automatically
                     91: reclaims garbages, i.e., allocated but unused memories,
                     92: and refreshes them for further use.
                     93: The algebraic engine gets all its necessary memories through the memory
                     94: manager.
                     95: \E
1.1       noro       96:
                     97: @item
                     98: @b{Asir}
1.8       noro       99: @*
1.2       noro      100: \BJP
1.1       noro      101: @b{Asir} $B$O(B, @b{Risa} $B$N7W;;%(%s%8%s$N8@8l%$%s%?%U%'!<%9$G(B
                    102: $B$"$k(B. @b{Risa} $B$G$O(B, $BHf3SE*MF0W$K%f!<%6MQ$N8@8l%$%s%?%U%'!<%9$r:n$k(B
                    103: $B$3$H$,$G$-$k(B. @b{Asir} $B$O$=$N0l$D$NNc$H$7$F:n$C$?$b$N$G(B, C $B8@8l$K6a(B
                    104: $B$$J8K!$r$b$D(B. $B$^$?(B, C $B$N%G%P%C%,$H$7$F9-$/MQ$$$i$l$F$$$k(B @code{dbx} $BIw(B
                    105: $B$N%G%P%C%,$bHw$($F$$$k(B.
1.2       noro      106: \E
                    107: \BEG
                    108: @b{Asir} is a standard language interface of @b{Risa}'s algebraic
                    109: engine. It is one of the possible language interfaces, because
                    110: one can develop one's own language interface easily on @b{Risa}
                    111: system.
                    112: @b{Asir} is an example of such language interfaces.
                    113: @b{Asir} has very similar syntax and semantics as C language.
                    114: Furthermore, it has a debugger that provide a subset of commands of
                    115: @code{dbx}, a widely used debugger of C language.
                    116: \E
1.1       noro      117: @end itemize
                    118:
1.2       noro      119: \BJP
1.1       noro      120: @node Asir $B$NFCD'(B,,, Risa/Asir
                    121: @section Asir $B$NFCD'(B
1.2       noro      122: \E
                    123: \BEG
                    124: @node Features of Asir,,, Risa/Asir
                    125: @section Features of @b{Asir}
                    126: \E
1.1       noro      127:
                    128: @noindent
1.2       noro      129: \BJP
1.1       noro      130: @b{Asir} $B$O(B, $BA0=R$NDL$j(B, $B7W;;%(%s%8%s$N8@8l%$%s%?%U%'!<%9$G$"(B
                    131: $B$k(B. $BDL>o(B @b{Asir} $B$H$$$&L>A0$N<B9T2DG=%U%!%$%k$H$7$FDs6!$5$l$k(B.
                    132: $B8=:_%5%]!<%H$5$l$F$$$k5!G=$O35$M<!$NDL$j$G$"$k(B.
1.2       noro      133: \E
                    134: \BEG
                    135: As mentioned in the previous section, @b{Asir} is a standard language
                    136: interface for@b{Risa}'s algebraic engine.
                    137: Usually, it is provided as an executable file named @code{asir}.
                    138: Main features supported for the current version of Asir is as follows.
                    139: \E
1.1       noro      140:
                    141: @itemize @bullet
1.2       noro      142: \BJP
1.1       noro      143: @item
                    144: C $B8@8lIw$N%f!<%68@8l(B
                    145:
                    146: @item
                    147: $B?t(B, $BB?9`<0(B, $BM-M}<0$N2C8:>h(B($B=|(B)
                    148:
                    149: @item
                    150: $B%Y%/%H%k(B, $B9TNs$N1i;;(B
                    151:
                    152: @item
                    153: $B:G>.8B$N%j%9%H=hM}(B
                    154:
                    155: @item
                    156: $BAH$_9~$_H!?t(B ($B0x?tJ,2r(B, GCD, $B%0%l%V%J4pDl$J$I(B)
                    157:
                    158: @item
                    159: $B%f!<%6Dj5AH!?t$K$h$k%D!<%k(B ($BBe?tBN>e$N0x?tJ,2r$J$I(B)
                    160:
                    161: @item
                    162: @code{dbx} $BIw$N%G%P%C%,(B
                    163:
                    164: @item
                    165: $B1"H!?t$NIA2h(B
                    166:
                    167: @item
                    168: @b{PARI} (@pxref{pari}) $B$K$h$k=iEyD61[H!?t$r4^$`<0$NI>2A(B
                    169:
                    170: @item
                    171: UNIX $B>e$G$NJ,;67W;;5!G=(B (Open XM)
                    172: @comment @item
                    173: @comment $B%R%9%H%jCV495!G=$r$b$D(B X11 $B%$%s%?%U%'!<%9(B
1.2       noro      174: \E
                    175: \BEG
                    176: @item
                    177: A C-like programming language
                    178:
                    179: @item
                    180: Arithmetic operations (addition, subtraction, multiplication
                    181: and division) on numbers, polynomials and rational expressions
                    182:
                    183: @item
                    184: Operations on vectors and matrices
                    185:
                    186: @item
                    187: List processing operations at the minimum
                    188:
                    189: @item
                    190: Several Built-in functions (factorization, GCD computation, Groebner basis
                    191: computation etc.)
                    192:
                    193: @item
                    194: Useful user defined functions(e.g., factorization over algebraic number fields)
                    195:
                    196: @item
                    197: A @code{dbx}-like debugger
                    198:
                    199: @item
                    200: Plotting of implicit functions
                    201:
                    202: @item
                    203: Numerical evaluation of mathematical expressions including elementary
                    204: transcendental functions at arbitrary precision. This feature is
                    205: in force only if @b{PARI} system (@pxref{pari}).
                    206:
                    207: @item
                    208: Distributed computation over UNIX
                    209: \E
1.1       noro      210: @end itemize
                    211:
1.2       noro      212: @node Installation,,, Risa/Asir
                    213: @section Installation
                    214:
                    215: \JP $B0J2<$N<jB3$-$GITL@$JE@(B, $BITET9g$JE@$,$"$C$?>l9g$NLd$$9g$o$;$O(B
                    216: \BEG
1.9       noro      217: Any questions and any comments on this manual are welcome by e-mails
1.2       noro      218: to the following address.
                    219: \E
1.1       noro      220:
                    221: @example
1.11      noro      222: noro@@math.kobe-u.ac.jp
1.1       noro      223: @end example
                    224:
                    225: @noindent
1.2       noro      226: \JP $B08$K(B e-mail $B$G$*4j$$$7$^$9(B.
1.1       noro      227:
                    228: @menu
1.9       noro      229: * UNIX binary version::
                    230: * UNIX source code version::
1.2       noro      231: * Windows version::
1.1       noro      232: @end menu
                    233:
1.9       noro      234: @node UNIX binary version,,, Installation
                    235: @subsection UNIX binary version
1.1       noro      236:
                    237: @noindent
1.2       noro      238: \BJP
1.9       noro      239: $B%?!<%2%C%H(B CPU/OS $B$KBP1~$9$k(B @samp{asir.tgz} $B$,I,MW$G$"$k(B.
1.1       noro      240: $B$3$l$i$OA4$F(B @code{gzip} $B$G05=L$7$F$"$k$N$G(B, $BF~<j8e(B @code{gzip} $B$G(B
                    241: $BE83+$9$k(B. $B$^$:(B, $B%$%s%9%H!<%k$9$k%G%#%l%/%H%j$r7h$a$k(B. $B%G%U%)%k%H$G$O(B
                    242: @samp{/usr/local/lib} $B$K(B @samp{asir} $B$H$$$&%G%#%l%/%H%j$H$7$F(B
                    243: $B%$%s%9%H!<%k$5$l$k$3$H$r2>Dj$7$F$$$k(B. $B0J2<$3$N%G%#%l%/%H%j$r%i%$%V%i%j(B
                    244: $B%G%#%l%/%H%j$H8F$V(B.
1.2       noro      245: \E
                    246: \BEG
1.9       noro      247: A file @samp{asir.tgz} suitable for the target machine/architecture
1.2       noro      248: is required. After getting it,
                    249: you have to unpack it by @code{gzip}. First of all, determine
                    250: a derectory where binaries and library files are installed.
                    251: We call the directory the @b{library directory}.
                    252: The following installs the files in @samp{/usr/local/lib/asir}.
                    253: \E
1.1       noro      254:
                    255: @example
                    256: # gzip -dc asir.tgz | ( cd /usr/local/lib; tar xf - )
                    257: @end example
                    258:
1.2       noro      259: \JP $B8D?ME*$K;HMQ$9$k>l9g$K$O(B, @samp{$HOME}$B$J$I$KCV$$$F$b$h$$(B.
                    260: \BEG
                    261: In this case you don't have to set any environment variable.
1.1       noro      262:
1.2       noro      263: You can install them elsewhere.
                    264: \E
1.1       noro      265: @example
                    266: % gzip -dc asir.tgz | ( cd $HOME; tar xf - )
                    267: @end example
                    268:
                    269: @noindent
1.2       noro      270: \BJP
1.1       noro      271: $B$3$N>l9g(B, $B%i%$%V%i%j%G%#%l%/%H%j$NL>A0$r4D6-JQ?t(B
                    272: @code{ASIR_LIBDIR} $B$K@_Dj$9$kI,MW$,$"$k(B.
1.2       noro      273: \E
                    274: \BEG
                    275: In this case you have to set the name of the library directory
                    276: to the environment variable @code{ASIR_LIBDIR}.
                    277: \E
1.1       noro      278:
                    279: @example
                    280: % setenv ASIR_LIBDIR $HOME/asir
                    281: @end example
                    282:
                    283: @noindent
1.2       noro      284: \BJP
1.1       noro      285: Asir $BK\BN$O(B, $B%i%$%V%i%j%G%#%l%/%H%j$N(B @samp{asir} $B$G$"$k(B.
                    286: @samp{/usr/local/bin} $B$"$k$$$O%f!<%6$N<B9T%U%!%$%k%5!<%A%Q%9(B
                    287: $B$N$I$3$+$K%7%s%\%j%C%/%j%s%/$r:n$k$HJXMx$G$"$k(B.
1.2       noro      288: \E
                    289: \BEG
                    290: @b{Asir} itself is in the library directory. It will be convenient
                    291: to create a symbolic link to it from @samp{/usr/local/bin} or
                    292: the user's search path.
                    293: \E
1.1       noro      294:
                    295: @example
                    296: # ln -s /usr/local/lib/asir/asir /usr/local/bin/asir
                    297: @end example
                    298:
                    299: @noindent
1.9       noro      300: \JP $B$3$l$G(B @samp{asir} $B$,5/F0$G$-$k(B.
1.2       noro      301: \BEG
1.9       noro      302: Then you can start @samp{asir}.
1.2       noro      303: \E
1.1       noro      304:
                    305: @example
                    306: % /usr/local/bin/asir
1.9       noro      307: This is Risa/Asir, Version 20000821.
                    308: Copyright (C) FUJITSU LABORATORIES LIMITED.
                    309: 1994-2000. All rights reserved.
                    310: [0]
1.1       noro      311: @end example
                    312:
1.9       noro      313: @node UNIX source code version,,, Installation
                    314: @subsection UNIX source code version
1.1       noro      315:
1.9       noro      316: \BEG
1.11      noro      317: First of all you have to determine the install directory.
                    318: In the install directory, the following subdirectories are put:
                    319: \E
                    320:
                    321: \BJP
                    322: $B$^$:(B, $B%$%s%9%H!<%k@h$N%G%#%l%/%H%j$r7h$a$kI,MW$,$"$k(B.
                    323: $B$3$3$K$O(B, $B0J2<$N%5%V%G%#%l%/%H%j$,CV$+$l$k(B.
                    324: \E
                    325:
                    326: @itemize @bullet
                    327: @item bin
                    328:
                    329: \EG executables of PARI and Asir
                    330: \JP PARI $B$*$h$S(B Asir $B$N<B9T2DG=%U%!%$%k(B
                    331:
                    332: @item lib
                    333:
                    334: \EG library files of PARI and Asir
                    335: \JP PARI $B$*$h$S(B Asir $B$N%i%$%V%i%j(B
                    336: @item include
                    337:
                    338: \EG header files of PARI
                    339: \JP PARI $B$N%X%C%@%U%!%$%k(B
                    340: @end itemize
                    341:
                    342: \BEG
                    343: These subdirectories are created automatically if they does not exist.
                    344: If you can be a root, it is recommended to set the install directory
                    345: to @samp{/usr/local}.  In the following the directory is denoted by TARGETDIR.
                    346: \E
                    347: \BJP
                    348: $B$3$l$i$N%5%V%G%#%l%/%H%j$OL5$1$l$P<+F0E*$K:n$i$l$k(B.
                    349: root $B8"8B$,$"$k>l9g$K$O(B, @samp{/usr/local} $B$K%$%s%9%H!<%k$9$k$3$H$r(B
                    350: $B$*4+$a$9$k(B. $B0J2<(B, $B$3$N%G%#%l%/%H%j$r(B TARGETDIR $B$H=q$/(B.
                    351: \E
                    352:
                    353: \BEG
                    354: Then, install PARI library. After getting @samp{pari.tgz},
                    355: unpack and install it as follows:
1.2       noro      356: \E
1.9       noro      357: \BJP
1.11      noro      358: $B$^$:(B PARI $B%i%$%V%i%j$r%$%s%9%H!<%k$9$kI,MW$,$"$k(B.
                    359: @samp{pari.tgz} $B$rF~<j8e(B, $BE,Ev$J%G%#%l%/%H%j$GE83+(B, $B%$%s%9%H!<%k$9$k(B.
1.2       noro      360: \E
1.1       noro      361:
                    362: @example
1.11      noro      363: % gzip -dc pari.tgz | tar xvf -
                    364: % cd pari
                    365: % ./Configure --prefix=TARGETDIR
                    366: % make all
                    367: % su
1.9       noro      368: # make install
                    369: # make install-lib-sta
1.1       noro      370: @end example
                    371:
1.2       noro      372: \BJP
1.11      noro      373: make $BCf$K%(%i!<$G;_$^$C$?$i(B, $B0J2<$r<B9T$9$k(B.
1.9       noro      374: \E
1.11      noro      375:
1.9       noro      376: \BEG
1.11      noro      377: While executing 'make install', the procedure may stop due to
                    378: some error. Then try the following:
                    379: \E
                    380:
                    381: @example
                    382: % cd Oxxx
                    383: % make lib-sta
                    384: % su
                    385: # make install-lib-sta
                    386: # make install-include
                    387: # exit
                    388: %
                    389: @end example
                    390:
                    391: \BEG
                    392: In the above example, xxx denotes the name of the target operating system.
                    393: Although GP is not built, the library necessary for building asir2000
                    394: will be generated.
                    395:
                    396: After getting @samp{asir2000.tgz}, unpack it
1.9       noro      397: and install necessary files as follows.
1.2       noro      398: \E
1.1       noro      399:
1.11      noro      400: \BJP
                    401: $B>e$NNc$G(B, xxx $B$O8=:_%?!<%2%C%H$H$J$C$F$$$k(B OS $B$NL>A0$r<($9(B.
                    402: GP $B$O%$%s%9%H!<%k$5$l$J$$$,(B, asir2000 $B$N:n@.$KI,MW$J%U%!%$%k$O%$%s%9%H!<%k(B
                    403: $B$5$l$k(B.
                    404:
                    405: @samp{asir2000.tgz} $B$rF~<j8e(B, $BE,Ev$J%G%#%l%/%H%j$G(B
                    406: $B$GE83+$7(B, $B0J2<$N<j=g$G%$%s%9%H!<%k$9$k(B.
                    407: \E
                    408:
1.1       noro      409: @example
1.9       noro      410: % gzip -dc asir.tgz | tar xf -
                    411: % cd asir2000
1.11      noro      412: % ./configure --prefix=TARGETDIR --with-pari --enable-plot
1.9       noro      413: % make
                    414: % su
                    415: # make install
                    416: # make install-lib
                    417: # make install-doc
1.11      noro      418: # exit
1.1       noro      419: @end example
                    420:
1.2       noro      421: @node Windows version,,, Installation
                    422: @subsection Windows version
1.1       noro      423:
                    424: @noindent
1.2       noro      425: \BJP
1.15      takayama  426: @samp{asirwin32.msi} (32bit $BHG%$%s%9%H!<%i!<(B) $B$^$?$O(B
                    427: @samp{asirwin64.msi} (64bit $BHG%$%s%9%H!<%i!<(B)$B$rMQ$$$F%$%s%9%H!<%k$9$k(B.  $B$3$N%$%s%9%H!<%i!<$O(B $B4D6-JQ?t(B @samp{ASIR_ROOTDIR} $B$K%$%s%9%H!<%k$7$?%U%)%k%@$r@_Dj$9$k(B.
                    428: (zip $BHG$O(B @samp{ASIR_ROOTDIR} $B$r<jF0$G@_Dj$9$kI,MW$,$"$j(B, $B$^$?%;%-%e%j%F%#%V%m%C%/$r2r=|$7$F$+$iE83+$7$J$$$H$$$1$J$$(B. zip$BHG$O3+H/<TMQ(B.)
                    429: $B%G%9%/%H%C%W$N(B asirgui $B$r%@%V%k%/%j%C%/$9$l$P(B asir $B$,%9%?!<%H$9$k(B. $B%F%-%9%H%(%G%#%?$H$NO"7H5!G=$r;H$&$K$O(B,
                    430: @samp{%ASIR_ROOTDIR%\share\editor} $B$N;X<($K=>$$@_Dj$r9T$&(B.
                    431: $B$J$*%$%s%9%H!<%k%U%)%k%@!<L>$d%f!<%6!<$N%[!<%`%U%)%k%@L>$,$$$o$f$k%@%aJ8;z$r4^$`>l9g$O@5>o$KF0:n$7$J$$5!G=$,$"$k(B.
                    432: (|$B%@%aJ8;z(B $B%A%'%C%+!<(B| $B$G8!:w$7$F<+J,$N%f!<%6!<L>$,3:Ev$9$k$+3NG'(B)
                    433: \E
                    434: \BEG
                    435: The installers are
                    436: @samp{asirwin32.msi} (32bit version) and
                    437: @samp{asirwin64.msi} (64bit version).
                    438: These installers set the installed folder to the environmental variable
                    439: @samp{ASIR_ROOTDIR}.
                    440: (If you install Risa/Asir by the zip version,
                    441: you need to set the environmental variable  @samp{ASIR_ROOTDIR}
                    442: by hand.
                    443: You also need to unlock the security block before unzipping.
                    444: The zip version is for developpers.)
                    445: Double click the ``asirgui'' on the desktop,
                    446: then the asir starts.
                    447: To use a unified environment with text editors,
                    448: follow the instruction in
                    449: @samp{%ASIR_ROOTDIR%\share\editor}.
                    450: If the folder name to which you install asir or your home folder name
                    451: contain non-ascii characters,
                    452: some functions of asir may not work properly.
                    453: For example, in the Japense locale, names which may cause troubles
                    454: can be checked by ``damemoji checker''.
1.2       noro      455: \E
1.1       noro      456:
1.2       noro      457: \BJP
1.1       noro      458: @node $B%3%^%s%I%i%$%s%*%W%7%g%s(B,,, Risa/Asir
                    459: @section $B%3%^%s%I%i%$%s%*%W%7%g%s(B
1.2       noro      460: \E
                    461: \BEG
                    462: @node Command line options,,, Risa/Asir
                    463: @section Command line options
                    464: \E
1.1       noro      465:
                    466: @noindent
1.2       noro      467: \JP $B%3%^%s%I%i%$%s%*%W%7%g%s$O<!$NDL$j(B.
                    468: \EG Command-line options for the command @samp{asir} are as follows.
1.1       noro      469:
                    470: @table @code
                    471:
                    472: @item -heap @var{number}
1.2       noro      473: \BJP
1.1       noro      474: @code{Risa/Asir} $B$G$O(B, 4KB $B$N%V%m%C%/$r%a%b%j3d$jEv$F$NC10L$H$7$FMQ$$$F$$$k(B.
                    475: $B%G%U%)%k%H$G$O(B, $B=i4|(B heap $B$H$7$F(B, 16 $B%V%m%C%/(B (64KB) $B3d$jEv$F$k$,(B, $B$=$l(B
                    476: $B$rJQ99$9$k>l9g(B, @code{-heap} $B$rMQ$$$k(B. $BC10L$O%V%m%C%/$G$"$k(B.
                    477: heap $B$NBg$-$5$O(B, @code{heap()} $BH!?t$GD4$Y$k$3$H$,$G$-$k(B ($BC10L$O%P%$%H(B).
1.2       noro      478: \E
                    479: \BEG
                    480: In @b{Risa/Asir}, 4KB is used as an unit, called block,
                    481: for memory allocation.
                    482: By default, 16 blocks (64KB) are allocated initially.
                    483: This value can be changed by giving an option @code{-heap}
                    484: a number parameter in unit block.
                    485: Size of the heap area is obtained by a Built-in function heap(),
                    486: the result of which is a number in Bytes.
                    487: \E
1.1       noro      488:
                    489: @item -adj @var{number}
1.2       noro      490: \BJP
1.1       noro      491: $B$3$NCM$,Bg$-$$$[$I(B, $B;HMQ%a%b%jNL$OBg$-$/$J$k$,(B, GC $B;~4V$,>/$J$/$J(B
                    492: $B$k(B. @var{number} $B$H$7$F(B 1 $B0J>e$N@0?t$,;XDj$G$-$k(B. $B%G%U%)%k%H$G$O(B 3 $B$G$"(B
                    493: $B$k(B. $B$3$NCM$,(B 1 $B0J2<$K$J$k$H(B GC $B$r$7$J$$@_Dj$K$J$k$N$GMWCm0U$G$"$k(B. heap
                    494: $B$r$J$k$Y$/?-$P$5$:$K(B, GC $B$r<gBN$K$7$F%a%b%j4IM}$7$?$$>l9g$K$O(B, $B$3$NCM$r(B
                    495: $BBg$-$/(B ($BNc$($P(B 8) $B@_Dj$9$k(B.
1.2       noro      496: \E
                    497: \BEG
                    498: Heap area will be stretched by the memory manager,
                    499: if the size of reclaimed memories is less than 1/@var{number}
                    500: of currently allocated heap area.
                    501: The default value for @var{number} is 3.
                    502: If you do not prefer to stretch heap area by some reason, perhaps by
                    503: restriction of available memories, but if prefer to resort to
                    504: reclaiming garbages as far as possible,
                    505: then a large value should be chosen for @var{number}, e.g., 8.
                    506: \E
1.1       noro      507:
                    508: @item -norc
1.2       noro      509: \JP $B=i4|2=%U%!%$%k(B @samp{$HOME/.asirrc} $B$rFI$^$J$$(B.
                    510: \BEG
                    511: When this option is specified, @b{Asir} does not read the
                    512: initial file @samp{$HOME/.asirrc}.
1.12      ohara     513: \E
                    514:
                    515: @item -quiet
                    516: \JP $B5/F0;~$NCx:n8"I=<($r9T$o$J$$(B.
                    517: \BEG Be quiet at boot time.
1.2       noro      518: \E
1.1       noro      519:
                    520: @item -f @var{file}
1.2       noro      521: \BJP
1.1       noro      522: $BI8=`F~NO$NBe$o$j$K(B, @var{file} $B$+$iF~NO$rFI$_9~$s$G<B9T$9$k(B.
                    523: $B%(%i!<$N:]$K$O$?$@$A$K=*N;$9$k(B.
1.2       noro      524: \E
                    525: \BEG
                    526: Instead of the standard input, @var{file} is used as the input.
                    527: Upon an error, the execution immediately terminates.
                    528: \E
1.1       noro      529:
                    530: @item -paristack @var{number}
1.2       noro      531: \BJP
1.1       noro      532: @b{PARI} (@pxref{pari}) $B@lMQ$NNN0h$NBg$-$5$r;XDj$9$k(B. $BC10L$O%P%$%H(B. $B%G%U%)(B
                    533: $B%k%H$G$O(B 1 MB.
1.2       noro      534: \E
                    535: \BEG
                    536: This option specifies the private memory size for @code{PARI} (@pxref{pari}).
                    537: The unit is Bytes. By default, it is set to 1 MB.
                    538: \E
1.1       noro      539:
                    540: @item -maxheap @var{number}
1.2       noro      541: \BJP
1.1       noro      542: heap $BNN0h$N>e8B$r;XDj$9$k(B. $BC10L$O%P%$%H(B. $B%G%U%)%k%H$G$OL5@)8B(B. UNIX $B$N(B
                    543: $B>l9g(B, $B<B:]$K$O(B @code{limit} $B%3%^%s%I$GI=<($5$l$k(B @code{datasize} $B$NCM(B
                    544: $B$K@)8B$5$l$F$$$k$?$a(B, @code{-maxheap} $B$N;XDj$,$J$/$F$b0lDjNL0J>e$K(B
                    545: heap $B$r3MF@$G$-$J$$>l9g$,$"$k$N$GCm0U(B.)
1.2       noro      546: \E
                    547: \BEG
                    548: This option sets an upper limit of the heap size. The unit is Bytes.
                    549: Note that the size is already limited by the value of @code{datasize}
                    550: displayed by the command @code{limit} on UNIX.
                    551: \E
1.1       noro      552: @end table
                    553:
1.2       noro      554: \BJP
1.1       noro      555: @node $B4D6-JQ?t(B,,, Risa/Asir
                    556: @section $B4D6-JQ?t(B
1.2       noro      557: \E
                    558: \BEG
                    559: @node Environment variable,,, Risa/Asir
                    560: @section Environment variable
                    561: \E
1.1       noro      562:
                    563: @noindent
1.2       noro      564: \BJP
1.15      takayama  565: @b{Asir} $B$N<B9T$K4X$9$k$$$/$D$+$N4D6-JQ?t$,B8:_$9$k(B. UNIX $B>e$G$O4D6-JQ?t(B $B$O(B shell $B$N%3%^%s%I%i%$%s$+$iD>@\@_Dj$9$k$+(B, shell $B$N(B rc $B%U%!%$%k$G@_Dj(B $B$9$k(B. Windows $B$G$O(B,  [$B4D6-JQ?t$NJT=8(B] $B$G@_Dj$9$k(B.
1.2       noro      566: \E
                    567: \BEG
                    568: There exist several environment variables concerning with an execution
                    569: of @b{Asir}. On UNIX, an environment variable is set from shells, or
1.15      takayama  570: in rc files of shells. On Windows, it can be set from
                    571: [Editing environmetal variables].
1.2       noro      572: \E
1.1       noro      573: @itemize @bullet
                    574: @item
                    575: @code{ASIR_LIBDIR}
1.8       noro      576: @*
1.2       noro      577: \BJP
1.15      takayama  578: $B$3$N4D6-JQ?t$OGQ;_M=Dj(B.
1.2       noro      579: \E
                    580: \BEG
1.15      takayama  581: This environmental variable is obsolete.
1.13      takayama  582: \E
                    583: @item
                    584: @code{ASIR_CONTRIB_DIR}
                    585: @*
                    586: \BJP
1.15      takayama  587: $B$3$N4D6-JQ?t$OGQ;_M=Dj(B.
                    588: \E
                    589: \BEG
                    590: This environmental variable is obsolete.
1.2       noro      591: \E
1.1       noro      592:
                    593: @item
                    594: @code{ASIRLOADPATH}
1.8       noro      595: @*
1.2       noro      596: \BJP
1.1       noro      597: $B%m!<%I$5$l$k%U%!%$%k$,$"$k%G%#%l%/%H%j$r(B UNIX $B$N>l9g(B ':',
                    598: Windows$B$N>l9g(B ';' $B$G6h@Z$C$FJB$Y$k(B. $B%G%#%l(B
                    599: $B%/%H%j$O:8$+$i=g$K%5!<%A$5$l$k(B. $B$3$N;XDj$,$J$$>l9g(B, $B$*$h$S;XDj$5$l$?(B
                    600: $B%U%!%$%k$,(B @code{ASIRLOADPATH} $B$K$J$+$C$?>l9g(B, $B%i%$%V%i%j%G%#%l%/%H%j(B
                    601: $B$b%5!<%A$5$l$k(B.
1.2       noro      602: \E
                    603: \BEG
                    604: This environment specifies directories which contains files to be
                    605: loaded by @b{Asir} command @code{load()}.
                    606: Directories are separated by a `:' on UNIX, a ';' on Windows respectively.
                    607: The search order is from the left to the right.
                    608: After searching out all directories in @code{ASIRLOADPATH},
                    609: or in case of no specification at all,
                    610: the library directory will be searched.
                    611: \E
1.15      takayama  612: \BJP
                    613: unix $BHG$N%i%$%V%i%j%G%#%l%/%H%j$O(B
                    614: \E
                    615: \BEG
                    616: The library directories of the unix version are
                    617: \E
                    618: @samp{$OpenXM_HOME/lib/asir-contrib},
                    619: @samp{$OpenXM_HOME/lib/asir},
                    620: /usr/local/lib/asir-contrib,
                    621: /usr/local/lib/asir.
                    622: \BJP
                    623: Windows $BHG$N%i%$%V%i%j%G%#%l%/%H%j$O(B,
                    624: @samp{OpenXM_HOME} $B$,@_Dj$5$l$F$$$J$$$H$-$O(B,
                    625: \E
                    626: \BEG
                    627: When @samp{OpenXM_HOME} is not set,
                    628: the library directories of the Windows version are
                    629: \E
                    630: %ASIR_ROOTDIR%\lib\asir-contrib,
                    631: %ASIR_ROOTDIR%\lib\asir.
                    632: \BJP
                    633: @samp{OpenXM_HOME} $B@_Dj$5$l$F$$$l$P(B, unix $BHG$HF1MM(B.
                    634: \E
                    635: \BEG
                    636: When @samp{OpenXM_HOME} is set, the library directories are same with
                    637: the unix version.
                    638: \E
                    639: \BJP
                    640: $B$^$?(BWindows $BHG$N>l9g(B, $B8D?MNN0h(B
                    641: @samp{%APPDATA%\OpenXM\lib\asir-contrib}
                    642: $B$b%i%$%V%i%j%G%#%l%/%H%j$H$J$k(B.
                    643: $B$J$*(B unix $BHG$G$O>e5-$N$h$&$J8D?MNN0h$rC5:w$9$k;EAH$_$O$J$/(B,
                    644: OpenXM $BHG$N(B asir $B$G$O(B
1.16    ! noro      645: @samp{OpenXM/rc/} $B$K$*$$$F(B @samp{ASIRLOADPATH} $B$G(B
1.15      takayama  646: @samp{$OpenXM_tmp/OpenXM/lib/asir-contrib} $B$r%5!<%A%Q%9$K2C$($F$$$k(B.  asir_contrib_update $B$r;2>H(B.
                    647: which, ctrl("loadpath"), asir2000/parse/load.c $B$b;2>H(B.
                    648: \E
                    649: \BEG
                    650: In the Windows version, the private folder
                    651: @samp{%APPDATA%\OpenXM\lib\asir-contrib}
                    652: is also set to the library folders.
                    653: In the unix version, there is no default private library folder.
                    654: In the OpenXM/unix version,
                    655: @samp{$OpenXM_tmp/OpenXM/lib/asir-contrib} is added to the @samp{ASIRLOADPATH}
1.16    ! noro      656: by a script in @samp{OpenXM/rc/}.
1.15      takayama  657: See also asir_contrib_update.
                    658: See which, ctrl("loadpath"), asir2000/parse/load.c.
                    659: \E
                    660:
1.1       noro      661: @item
                    662: @code{HOME}
1.8       noro      663: @*
1.2       noro      664: \BJP
1.1       noro      665: @var{-norc} $B%*%W%7%g%s$D$-$G5/F0$7$J$$>l9g(B, @samp{$HOME/.asirrc}$B$,$"$l$P(B,
                    666: $BM=$a$3$N%U%!%$%k$r<B9T$9$k(B. @code{HOME} $B$,@_Dj$5$l$F$$$J$$>l9g(B, UNIX $BHG(B
                    667: $B$G$O$J$K$bFI$^$J$$$,(B, Windows $BHG$G$O(B Asir $B%a%$%s%G%#%l%/%H%j(B
                    668: (@code{get_rootdir()} $B$GJV$5$l$k%G%#%l%/%H%j(B) $B$N(B @samp{.asirrc} $B$rC5$7(B,
                    669: $B$"$l$P$=$l$r<B9T$9$k(B.
1.2       noro      670: \E
                    671: \BEG
                    672: If @b{Asir} is invoked without @var{-norc}, @samp{$HOME/.asirrc}, if exists,
                    673: is executed. If @code{HOME} is not set, nothing is done on UNIX. On Windows,
                    674: @samp{.asirrc} in @b{Asir root directory} is executed if it exists.
                    675: \E
1.1       noro      676: @end itemize
                    677:
1.2       noro      678: \BJP
1.1       noro      679: @node $B5/F0$+$i=*N;$^$G(B,,, Risa/Asir
                    680: @section $B5/F0$+$i=*N;$^$G(B
1.2       noro      681: \E
                    682: \BEG
                    683: @node Starting and Terminating an Asir session,,, Risa/Asir
                    684: @section Starting and Terminating an @b{Asir} session
                    685: \E
1.1       noro      686:
                    687: @noindent
1.2       noro      688: \JP @b{Asir} $B$r5/F0$9$k$H(B,
                    689: \BEG
                    690: Run @b{Asir}, then the copyright notice and the first prompt
                    691: will appear on your screen,
                    692: and a new @b{Asir} session will be started.
                    693: \E
                    694:
1.1       noro      695: @example
                    696: [0]
                    697: @end example
                    698:
                    699: @noindent
1.2       noro      700: \BJP
1.1       noro      701: $B$J$k%W%m%s%W%H$,I=<($5$l(B, $B%;%C%7%g%s$,3+;O$9$k(B. @samp{$HOME/.asirrc}
                    702: (Windows $BHG$N>l9g(B, @code{HOME} $B@_Dj$5$l$F$$$J$$>l9g$K$O(B @code{get_rootdir()}
                    703: $B$GJV$5$l$k%G%#%l%/%H%j$K$"$k(B @samp{.asirrc})
                    704: $B$,B8:_$7$F$$$k>l9g(B, $B$3$N%U%!%$%k$r(B @b{Asir} $B%f!<%68@8l$G$+$+$l$?(B
                    705: $B%U%!%$%k$H8+$J$7(B, $B2r<a<B9T$9$k(B.
1.2       noro      706: \E
                    707: \BEG
                    708: When initialization file @samp{$HOME/.asirrc} exists,
                    709: @b{Asir} interpreter executes it at first taking it as a program
                    710: file written in @b{Asir}.
                    711: \E
1.1       noro      712:
                    713: @noindent
1.2       noro      714: \BJP
1.1       noro      715: $B%W%m%s%W%H$OF~NO$NHV9f$rI=$9(B. $B%;%C%7%g%s$O(B, @code{end;} $B$^$?$O(B
                    716: @code{quit;} $B$rF~NO$9$k$3$H$K$h$j=*N;$9$k(B. $BF~NO$O(B, @samp{;} $B$^$?$O(B
                    717: @samp{$} $B$^$G$r0l6h@Z$j$H$7$FI>2A$5$l$k(B. @samp{;} $B$N$H$-7k2L$OI=<($5$l(B,
                    718: @samp{$} $B$N$H$-I=<($5$l$J$$(B.
1.2       noro      719: \E
                    720: \BEG
                    721: The prompt indicates the sequential number of your input commands to
                    722: @b{Asir}.
                    723: The session will terminate when you input @code{end;} or @code{quit;}
                    724: to @b{Asir}.
                    725: Input commands are evaluated statement by statement.
                    726: A statement normally ends with its terminator
                    727: @samp{;} or @samp{$}.
                    728: (There are some exceptions. See, syntax of @b{Asir}.)
                    729: The result will be displayed when the command, i.e. statement,
                    730: is terminated by a @samp{;},
                    731: and will not when terminated by a @samp{$}.
                    732: \E
1.1       noro      733:
                    734: @example
                    735: % asir
                    736: [0] A;
                    737: 0
                    738: [1] A=(x+y)^5;
                    739: x^5+5*y*x^4+10*y^2*x^3+10*y^3*x^2+5*y^4*x+y^5
                    740: [2] A;
                    741: x^5+5*y*x^4+10*y^2*x^3+10*y^3*x^2+5*y^4*x+y^5
                    742: [3] a=(x+y)^5;
                    743: evalpv : invalid assignment
                    744: return to toplevel
                    745: [3] a;
                    746: a
                    747: [4] fctr(A);
                    748: [[1,1],[x+y,5]]
                    749: [5] quit;
                    750: %
                    751: @end example
                    752:
                    753: @noindent
1.2       noro      754: \BJP
1.1       noro      755: $B$3$NNc$G$O(B, @code{A}, @code{a}, @code{x}, @code{y} $B$J$kJ8;z$,;HMQ$5$l$F$$$k(B.
                    756: @code{A} $B$O%W%m%0%i%`$K$*$1$kJQ?t$G(B, @code{a}, @code{x}, @code{y} $B$O?t3XE*(B
                    757: $B$J0UL#$G$NITDj85$G$"$k(B. $B0lHL$K%W%m%0%i%`JQ?t$OBgJ8;z$G;O$^$j(B,
                    758: $BITDj85$O>.J8;z$G;O$^$k(B. $B$3$NNc$G$o$+$k$h$&$K(B, $B%W%m%0%i%`JQ?t$O(B,
                    759: $B?t(B, $B<0$J$I$r3JG<$7$F$*$/$?$a$N$b$N$G$"$j(B, C $B8@8l$J$I$K$*$1$kJQ?t$KBP1~$9$k(B.
                    760: $B0lJ}(B, $BITDj85$O$=$l<+?H$GCM$r;}$D$3$H$O$G$-$:(B, $B=>$C$F(B, $BITDj85$KBP$9$k(B
                    761: $BBeF~$O5v$5$l$J$$(B. $B8e$K<($9$,(B, $BITDj85$KBP$9$kBeF~$O(B, $BAH$_9~$_H!?t(B @code{subst()}
                    762: $B$K$h$jL@<(E*$K9T$o$l$k(B.
1.2       noro      763: \E
                    764: \BEG
                    765: In the above example, names @code{A}, @code{a}, @code{x} and @code{y}
                    766: are used to identify mathematical and programming objects.
                    767: There, the name @code{A} denotes a program variable
                    768: (some times called simply as a program variable.)
                    769: while the other names, @code{a}, @code{x} and @code{y}, denote
                    770: mathematical objects, that is, indeterminates.
                    771: In general, program variables have names which begin with
                    772: capital letters, while names of indeterminates begin with
                    773: small letters.
                    774: As you can see in the example, program variables are used to hold and
                    775: keep objects, such as numbers and expressions, as their values,
                    776: just like variables in C programming language.
                    777: Whereas, indeterminates cannot have values so that assignment to
                    778: indeterminates are illegal.
                    779: If one wants to get a result by substituting a value for an indeterminate
                    780: in an expression, it is achieved by the function @code{subst} as the
                    781: value of the function.
                    782: \E
1.1       noro      783:
1.2       noro      784: \BJP
1.1       noro      785: @node $B3d$j9~$_(B,,, Risa/Asir
                    786: @section $B3d$j9~$_(B
1.2       noro      787: \E
                    788: \BEG
                    789: @node Interruption,,, Risa/Asir
                    790: @section Interruption
                    791: \E
1.1       noro      792:
                    793: @noindent
1.2       noro      794: \BJP
1.1       noro      795: $B7W;;$r<B9TCf$K3d$j9~$_$r$+$1$?$$>l9g(B, $B3d$j9~$_%-%c%i%/%?(B($BDL>o$O(B
1.10      noro      796: @kbd{C-c}, Windows, DOS $BHG$G$O(B @kbd{C-x} $B$rF~NO$9$k(B.
1.2       noro      797: \E
                    798: \BEG
                    799: To interrupt the @b{Asir} execution, input an interrupt character
                    800: from the keyboard.  A @kbd{C-c} is usually used for it.
1.10      noro      801: (Notice: @kbd{C-x} on Windows and DOS.)
1.2       noro      802: \E
1.1       noro      803:
                    804: @example
                    805: @@ (x+y)^1000;
                    806: @kbd{C-c}interrupt ?(q/t/c/d/u/w/?)
                    807: @end example
                    808:
                    809: @noindent
1.2       noro      810: \JP $B3FA*Br;h$N0UL#$O<!$NDL$j(B.
                    811: \EG Here, the meaning of options are as follows.
1.1       noro      812:
                    813: @table @code
1.2       noro      814: \BJP
1.1       noro      815: @item q
                    816: @b{Asir} $B$r=*N;$9$k(B. ($B3NG'$"$j(B)
                    817: @item t
                    818: $B%H%C%W%l%Y%k$KLa$k(B. ($B3NG'$"$j(B)
                    819: @item c
                    820: $B<B9T$r7QB3$9$k(B.
                    821: @item d
                    822: $B%G%P%C%0%b!<%I$KF~$k(B. $B%G%P%C%,$K4X$7$F$O(B @xref{$B%G%P%C%,(B}.
                    823: @item u
1.3       noro      824: @code{register_handler()} (@pxref{ox_reset ox_intr register_handler}) $B$GEPO?$5$l$?(B
1.1       noro      825: $B4X?t$r<B9T8e%H%C%W%l%Y%k$KLa$k(B. ($B3NG'$"$j(B)
                    826: @item w
                    827: $BCfCGE@$^$G$NH!?t$N8F$S=P$7Ns$rI=<($9$k(B.
                    828: @item ?
                    829: $B3FA*Br;h$N0UL#$r@bL@$9$k(B.
1.2       noro      830: \E
                    831: \BEG
                    832: @item q
                    833: Terminates @b{Asir} session. (Confirmation requested.)
                    834: @item t
                    835: Returns to toplevel. (Confirmation requested.)
                    836: @item c
                    837: Resumes to continue the execution.
                    838: @item d
                    839: Enters debugging mode at the next statement of the @b{Asir} program,
                    840: if @b{Asir} has been executing a program loaded from a file.
                    841: Note that it will sometimes take a long time before entering
                    842: debugging mode when @b{Asir} is executing basic functions in the
                    843: algebraic engine, (e.g., arithmetic operation, factorization etc.)
                    844: Detailed description about the debugger will be given in @ref{Debugger}.
                    845: @item u
                    846: After executing a function registered by @code{register_handler()}
1.3       noro      847: (@pxref{ox_reset ox_intr register_handler}), returns to toplevel. A confirmation
1.2       noro      848: is prompted.
                    849: @item w
                    850: Displays the calling sequence up to the interruption.
                    851: @item ?
                    852: Show a brief description of options.
                    853: \E
1.1       noro      854: @end table
                    855:
1.2       noro      856: \BJP
1.1       noro      857: @node $B%(%i!<=hM}(B,,, Risa/Asir
                    858: @section $B%(%i!<=hM}(B
1.2       noro      859: \E
                    860: \BEG
                    861: @node Error handling,,, Risa/Asir
                    862: @section Error handling
                    863: \E
1.1       noro      864:
                    865: @noindent
1.2       noro      866: \BJP
1.1       noro      867: $BAH$_9~$_H!?t$KIT@5$J7?$N0z?t$rEO$7$?>l9g$J$I$K$O<B9T$,CfCG$5$l$k$,(B,
                    868: $B%f!<%6H!?t$NCf$G%(%i!<$,5/$-$?>l9g$K$O%H%C%W%l%Y%k$KLa$kA0$K<+F0E*$K%G%P%C%0(B
                    869: $B%b!<%I$KF~$k(B. $B$3$N>uBV$G(B
                    870: $B%(%i!<$N>l=j(B, $BD>A0$N0z?t$NCM$J$I$rD4$Y$k$3$H$,$G$-$k(B.
                    871: $BI=<($5$l$k%(%i!<%a%C%;!<%8$O$5$^$6$^$G$"$j(B, $BFbIt$NH!?tL>$K0z$-B3$$$F(B
                    872: $B%a%C%;!<%8$,I=<($5$l$k(B. $B$3$l$O(B, $B8F$S=P$5$l$?AH$_9~$_H!?t(B
                    873: $B$HI,$:$7$bBP1~$O$7$J$$(B.
1.2       noro      874: \E
                    875: \BEG
                    876: When arguments with illegal types are given to a built-in function,
                    877: an error will be detected and the execution will be quit.
                    878: In many cases, when an error is detected in a built-in function,
                    879: @b{Asir} automatically enters debugging mode before coming back
                    880: to toplevel.
                    881: At that time, one can examine the state of the program,
                    882: for example, inspect argument values just before the error occurred.
                    883: Messages reported there are various depending on cases.  They are
                    884: reported after the internal function name.  The internal function name
                    885: sometimes differs from the built-in function name that is specified by
                    886: the user program.
                    887: \E
1.1       noro      888:
                    889: @noindent
1.2       noro      890: \BJP
1.1       noro      891: $B$=$NB>(B, $B$5$^$6$^$J860x$K$h$jFbIt1i;;H!?t$K$*$$$F%(%i!<$,@8$:$k$3$H$,(B
                    892: $B$"$k(B. UNIX $BHG$N>l9g(B, $B$3$l$O<!$N$$$:$l$+$N(B
                    893: @code{internal error} $B$H$7$FJs9p$5$l(B, $BDL>o$N%(%i!<$HF1MM$K07$C$F(B,
                    894: $B%G%P%C%0%b!<%I$KF~$k(B.
1.2       noro      895: \E
                    896: \BEG
                    897: In the execution of internal functions, errors may happen by various
                    898: reasons.  The UNIX version of @b{Asir} will report those errors as one of
                    899: the following @code{internal error}'s, and enters debugging mode just
                    900: like normal errors.
                    901: \E
1.1       noro      902:
                    903: @table @code
                    904: @item SEGV
                    905: @itemx BUS ERROR
1.8       noro      906: @*
1.2       noro      907: \BJP
1.1       noro      908: $BAH$_9~$_H!?t$K$h$C$F$O(B, $B0z?t$N7?$r87L)$K%A%'%C%/$;$:$K1i;;%k!<%A%s$K0z(B
                    909: $B$-EO$7$F$7$^$&$b$N$bB8:_$7$F$$$k(B. $B$3$N$h$&$J>u67$K$*$$$F(B,
                    910: $BIT@5$J%]%$%s%?(B, $B$"$k$$$O(B NULL $B%]%$%s%?$K$h$k%"%/%;%90cH?$,$"$C$?>l9g(B, $B$3$l$i(B
                    911: $B$N%(%i!<$H$J$k(B.
1.2       noro      912: \E
                    913: \BEG
                    914: Some of the built-in functions transmit their arguments to internal
                    915: operation routines without strict type-checking.  In such cases,
                    916: one of these two errors will be reported
                    917: when an access violation caused by an illegal pointer or a NULL pointer
                    918: is detected.
                    919: \E
1.1       noro      920:
                    921: @item BROKEN PIPE
1.8       noro      922: @*
1.2       noro      923: \BJP
1.1       noro      924: $B%W%m%;%94VDL?.$K$*$$$F(B, $BAj<j@h$N%W%m%;%9$H$N4V$N%9%H%j!<%`(B
                    925: $B$,4{$KB8:_$7$F$$$J$$>l9g(B ($BNc$($P4{$KAj<j@h$N%W%m%;%9$,=*N;$7$F$$$k>l9g$J$I(B)
                    926: $B$K(B, $B$=$N%9%H%j!<%`$KF~=PNO$7$h$&$H$7$?>l9g$K$3$N%(%i!<$H$J$k(B.
1.2       noro      927: \E
                    928: \BEG
                    929: In the process communication, this error will be reported if a process
                    930: attempts to read from or to write onto the partner process when the
                    931: stream to the partner process does not already exist, (e.g., terminated
                    932: process.)
                    933: \E
1.1       noro      934: @end table
                    935:
                    936: @noindent
1.2       noro      937: \BJP
1.1       noro      938: $B$3$l$i$O<B:]$K$O(B, $BAH$_9~$_H!?t$NF~8}$K$*$$$F(B, $B0z?t$r40A4$K%A%'%C%/(B
                    939: $B$9$k$3$H$K$h$jBgItJ,$OKI$2$k$,(B, $B<j4V$,B?$/$+$+$k$3$H$H(B, $B>l9g$K(B
                    940: $B$h$C$F$O8zN($rMn$9$3$H$K$b$J$k$?$a(B, $B$"$($F0z?t%A%'%C%/$O%f!<%6(B
                    941: $BG$$;$K$7$F$"$k(B.
1.2       noro      942: \E
                    943: \BEG
                    944: For UNIX version, even in such a case, the process itself does not
                    945: terminate because such an error can be caught by @code{signal()} and
                    946: recovered.
                    947: To remove this weak point, complete type
                    948: checking of all arguments are indispensable at the entry of a built-in
                    949: function, which requires an enormous amount of re-making efforts.
                    950: \E
1.1       noro      951:
1.2       noro      952: \BJP
1.1       noro      953: @node $B7W;;7k2L$*$h$SFC<l$J?t(B,,, Risa/Asir
                    954: @section $B7W;;7k2L(B, $BFC<l$J?t(B
1.2       noro      955: \E
                    956: \BEG
                    957: @node Referencing results and special numbers,,, Risa/Asir
                    958: @section Referencing results and special numbers
                    959: \E
1.1       noro      960:
                    961: @noindent
1.2       noro      962: \JP @code{@@} $B$O%(%9%1!<%WJ8;z$H$7$F;HMQ$5$l$k(B. $B8=:_<!$N$h$&$J5,Dj$,$"$k(B.
                    963: \BEG
                    964: An @code{@@} used for an escape character; rules currently in force
                    965: are as follows.
                    966: \E
1.1       noro      967: @table @code
1.2       noro      968: \BJP
1.1       noro      969: @item @@@var{n}
                    970: @var{n} $BHVL\$N7W;;7k2L(B.
                    971: @item @@@@
                    972: $BD>A0$N7W;;7k2L(B.
                    973: @item @@i
                    974: $B5u?tC10L(B.
                    975: @item @@pi
                    976: $B1_<~N((B.
                    977: @item @@e
                    978: $B<+A3BP?t$NDl(B.
                    979: @item @@
                    980: 2 $B85BN(B GF(2) $B>e$N0lJQ?tB?9`<0$NJQ?t(B ($BITDj85(B).
                    981: @item @@>, @@<, @@>=, @@<=, @@==, @@&&, @@||
                    982: quantifier elimination $B$K$*$1$k(B, $B0l3,=R8lO@M}1i;;;R(B
1.2       noro      983: \E
                    984: \BEG
                    985: @item @@@var{n}
                    986: The evaluated result of @var{n}-th input command
                    987: @item @@@@
                    988: The evaluated result of the last command
                    989: @item @@i
                    990: The unit of imaginary number, square root of -1.
                    991: @item @@pi
                    992: The number pi,
                    993: the ratio of a circumference of the circle and its diameter.
                    994: @item @@e
                    995: Napier's number, the base of natural logarithm.
                    996: @item @@
                    997: A generator of GF(2^m), a finite field of characteristic 2, over GF(2).
                    998: It is a root of an irreducible univariate polynomial over GF(2)
                    999: which is set as the defining polynomial of GF(2^m).
                   1000: @item @@>, @@<, @@>=, @@<=, @@==, @@&&, @@||
                   1001: Fist order logical operators. They are used in quantifier elimination.
                   1002: \E
1.1       noro     1003: @end table
                   1004:
                   1005: @example
                   1006: [0] fctr(x^10-1);
                   1007: [[1,1],[x-1,1],[x+1,1],[x^4+x^3+x^2+x+1,1],[x^4-x^3+x^2-x+1,1]]
                   1008: [1] @@@@[3];
                   1009: [x^4+x^3+x^2+x+1,1]
                   1010: [2] eval(sin(@@pi/2));
                   1011: 1.000000000000000000000000000000000000000000000000000000000
                   1012: [3] eval(log(@@e),20);
                   1013: 0.99999999999999999999999999998
                   1014: [4] @@0[4][0];
                   1015: x^4-x^3+x^2-x+1
                   1016: [5] (1+@@i)^5;
                   1017: (-4-4*@@i)
                   1018: [6] eval(exp(@@pi*@@i));
                   1019: -1.0000000000000000000000000000
                   1020: [7] (@@+1)^9;
                   1021: (@@^9+@@^8+@@+1)
                   1022: @end example
                   1023:
                   1024: @noindent
1.2       noro     1025: \BJP
1.1       noro     1026: $B%H%C%W%l%Y%k$G7W;;$5$l$?CM$O$3$N$h$&$K%R%9%H%j$H$7$F<h$j=P$72DG=$G$"$k$,(B,
                   1027: $B$3$N$3$H$O(B, $B%,%Y!<%8%3%l%/%?$K$H$C$F$OIiC4$r$b$?$i$92DG=@-$,$"$k(B. $BFC$K(B,
                   1028: $BBg$-$J<0$r%H%C%W%l%Y%k$G7W;;$7$?>l9g(B, $B$=$N8e$N(B GC $B;~4V$,5^B.$KA}Bg$9$k2D(B
                   1029: $BG=@-$,$"$k(B. $B$3$N$h$&$J>l9g(B, @code{delete_history()}
                   1030: (@pxref{delete_history,,@code{delete_history}}) $B$,M-8z$G$"$k(B.
1.2       noro     1031: \E
                   1032: \BEG
                   1033: As you can see in the above example,
                   1034: results of toplevel computation can be referred to
                   1035: by @code{@@} convention.
                   1036: This is convenient for users, while it sometimes imposes a heavy
                   1037: burden to the garbage collector.
                   1038: It may happen that GC time will rapidly increase after computing
                   1039: a very large expression at the toplevel.
                   1040: In such cases @code{delete_history()}
                   1041: (@pxref{delete_history,,@code{delete_history}}) takes effect.
                   1042: \E
1.1       noro     1043:
                   1044:

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>