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

Annotation of OpenXM/src/asir-doc/parts/type.texi, Revision 1.15

1.15    ! noro        1: @comment $OpenXM: OpenXM/src/asir-doc/parts/type.texi,v 1.14 2016/03/22 07:25:14 noro Exp $
1.3       noro        2: \BJP
1.1       noro        3: @node $B7?(B,,, Top
                      4: @chapter $B7?(B
1.3       noro        5: \E
                      6: \BEG
                      7: @node Data types,,, Top
                      8: @chapter Data types
                      9: \E
1.1       noro       10:
                     11: @menu
1.3       noro       12: \BJP
1.1       noro       13: * Asir $B$G;HMQ2DG=$J7?(B::
                     14: * $B?t$N7?(B::
                     15: * $BITDj85$N7?(B::
1.3       noro       16: \E
                     17: \BEG
                     18: * Types in Asir::
                     19: * Types of numbers::
                     20: * Types of indeterminates::
                     21: \E
1.1       noro       22: @end menu
                     23:
1.3       noro       24: \BJP
1.1       noro       25: @node Asir $B$G;HMQ2DG=$J7?(B,,, $B7?(B
                     26: @section @b{Asir} $B$G;HMQ2DG=$J7?(B
1.3       noro       27: \E
                     28: \BEG
                     29: @node Types in Asir,,, Data types
                     30: @section Types in @b{Asir}
                     31: \E
1.1       noro       32:
                     33: @noindent
1.3       noro       34: \BJP
1.1       noro       35: @b{Asir} $B$K$*$$$F$O(B, $B2DFI$J7A<0$GF~NO$5$l$?$5$^$6$^$JBP>]$O(B, $B%Q!<%6$K$h$j(B
                     36: $BCf4V8@8l$KJQ49$5$l(B, $B%$%s%?%W%j%?$K$h$j(B @b{Risa} $B$N7W;;%(%s%8%s$r8F$S=P$7(B
                     37: $B$J$,$iFbIt7A<0$KJQ49$5$l$k(B. $BJQ49$5$l$?BP>]$O(B, $B<!$N$$$:$l$+$N7?$r;}$D(B.
                     38: $B3FHV9f$O(B, $BAH$_9~$_H!?t(B @code{type()} $B$K$h$jJV$5$l$kCM$KBP1~$7$F$$$k(B.
                     39: $B3FNc$O(B, @b{Asir} $B$N%W%m%s%W%H$KBP$9$kF~NO$,2DG=$J7A<0$N$$$/$D$+$r(B
                     40: $B<($9(B.
1.3       noro       41: \E
                     42: \BEG
                     43: In @b{Asir}, various objects described according to the syntax of
                     44: @b{Asir} are translated to intermediate forms and by @b{Asir}
                     45: interpreter further translated into internal forms with the help of
                     46: basic algebraic engine.  Such an object in an internal form has one of
                     47: the following types listed below.
                     48: In the list, the number coincides with the value returned by the
                     49: built-in function @code{type()}.
                     50: Each example shows possible forms of inputs for @b{Asir}'s prompt.
                     51: \E
1.1       noro       52:
                     53: @table @code
1.2       noro       54: @item 0 @b{0}
1.5       noro       55: @*
1.3       noro       56: \BJP
1.1       noro       57: $B<B:]$K$O(B 0 $B$r<1JL;R$K$b$DBP>]$OB8:_$7$J$$(B. 0 $B$O(B, C $B$K$*$1$k(B 0 $B%]%$%s%?$K(B
                     58: $B$h$jI=8=$5$l$F$$$k(B. $B$7$+$7(B, $BJX59>e(B @b{Asir} $B$N(B @code{type(0)} $B$O(B
                     59: $BCM(B 0 $B$rJV$9(B.
1.3       noro       60: \E
                     61: \BEG
                     62: As a matter of fact, no object exists that has 0 as its identification
                     63: number.  The number 0 is implemented as a null (0) pointer of C language.
                     64: For convenience's sake,  a 0 is returned for the input @code{type(0)}.
                     65: \E
1.1       noro       66:
1.3       noro       67: \JP @item 1 @b{$B?t(B}
                     68: \EG @item 1 @b{number}
1.1       noro       69:
                     70: @example
                     71: 1 2/3  14.5  3+2*@@i
                     72: @end example
                     73:
1.3       noro       74: \JP $B?t$O(B, $B$5$i$K$$$/$D$+$N7?$KJ,$1$i$l$k(B. $B$3$l$K$D$$$F$O2<$G=R$Y$k(B.
                     75: \EG Numbers have sub-types. @xref{Types of numbers}.
1.1       noro       76:
1.3       noro       77: \JP @item 2 @b{$BB?9`<0(B} ($B?t$G$J$$(B)
                     78: \EG @item 2 @b{polynomial} (but not a number)
1.1       noro       79:
                     80: @example
                     81: x  afo  (2.3*x+y)^10
                     82: @end example
                     83:
1.3       noro       84: \BJP
1.1       noro       85: $BB?9`<0$O(B, $BA4$FE83+$5$l(B, $B$=$N;~E@$K$*$1$kJQ?t=g=x$K=>$C$F(B, $B:F5"E*$K(B
1.9       noro       86: 1 $BJQ?tB?9`<0$H$7$F9_QQ$N=g$K@0M}$5$l$k(B. (@xref{$BJ,;6I=8=B?9`<0(B}.)
1.1       noro       87: $B$3$N;~(B, $B$=$NB?9`<0$K8=$l$k=g=x:GBg$NJQ?t$r(B @b{$B<gJQ?t(B} $B$H8F$V(B.
1.3       noro       88: \E
                     89: \BEG
                     90: Every polynomial is maintained internally in its full expanded form,
                     91: represented as a nested univariate polynomial, according to the current
                     92: variable ordering, arranged by the descending order of exponents.
1.9       noro       93: (@xref{Distributed polynomial}.)
1.3       noro       94: In the representation, the indeterminate (or variable), appearing in
                     95: the polynomial, with maximum ordering is called the @b{main variable}.
                     96: Moreover, we call the coefficient of the maximum degree term of
                     97: the polynomial with respect to the main variable the @b{leading coefficient}.
                     98: \E
1.1       noro       99:
1.3       noro      100: \JP @item 3 @b{$BM-M}<0(B} ($BB?9`<0$G$J$$(B)
                    101: \EG @item 3 @b{rational expression} (not a polynomial)
1.1       noro      102:
                    103: @example
                    104: (x+1)/(y^2-y-x)  x/x
                    105: @end example
                    106:
1.3       noro      107: \BJP
1.1       noro      108: $BM-M}<0$O(B, $BJ,JlJ,;R$,LsJ,2DG=$G$b(B, $BL@<(E*$K(B @code{red()} $B$,8F$P$l$J$$(B
                    109: $B8B$jLsJ,$O9T$o$l$J$$(B. $B$3$l$O(B, $BB?9`<0$N(B GCD $B1i;;$,6K$a$F=E$$1i;;$G$"$k(B
                    110: $B$?$a$G(B, $BM-M}<0$N1i;;$OCm0U$,I,MW$G$"$k(B.
1.3       noro      111: \E
                    112: \BEG
                    113: Note that in @b{Risa/Asir} a rational expression is not simplified
                    114: by reducing the common divisors unless @code{red()} is called
                    115: explicitly, even if it is possible.  This is because the GCD computation
                    116: of polynomials is a considerably heavy operation.  You have to be careful
                    117: enough in operating rational expressions.
                    118: \E
1.1       noro      119:
1.3       noro      120: \JP @item 4 @b{$B%j%9%H(B}
                    121: \EG @item 4 @b{list}
1.1       noro      122:
                    123: @example
                    124: []  [1,2,[3,4],[x,y]]
                    125: @end example
                    126:
1.3       noro      127: \BJP
1.1       noro      128: $B%j%9%H$OFI$_=P$7@lMQ$G$"$k(B. @code{[]} $B$O6u%j%9%H$r0UL#$9$k(B. $B%j%9%H$KBP$9$k(B
                    129: $BA`:n$H$7$F$O(B, @code{car()}, @code{cdr()}, @code{cons()} $B$J$I$K$h$kA`:n$NB>$K(B,
                    130: $BFI$_=P$7@lMQ$NG[Ns$H$_$J$7$F(B, @code{[@var{index}]} $B$rI,MW$J$@$1$D$1$k$3$H$K$h$j(B
                    131: $BMWAG$N<h$j=P$7$r9T$&$3$H$,$G$-$k(B. $BNc$($P(B
1.3       noro      132: \E
                    133: \BEG
                    134: Lists are all read-only object. A null list is specified by @code{[]}.
                    135: There are operations for lists: @code{car()}, @code{cdr()},
                    136: @code{cons()} etc.  And further more, element referencing by indexing is
                    137: available.  Indexing is done by putting @code{[@var{index}]}'s after a
                    138: program variable as many as are required.
                    139: For example,
                    140: \E
1.1       noro      141:
                    142: @example
                    143: [0] L = [[1,2,3],[4,[5,6]],7]$
                    144: [1] L[1][1];
                    145: [5,6]
                    146: @end example
                    147:
1.3       noro      148: \BJP
1.1       noro      149: $BCm0U$9$Y$-$3$H$O(B, $B%j%9%H(B, $BG[Ns(B ($B9TNs(B, $B%Y%/%H%k(B) $B6&$K(B, $B%$%s%G%C%/%9$O(B
                    150: 0 $B$+$i;O$^$k$3$H$H(B, $B%j%9%H$NMWAG$N<h$j=P$7$r%$%s%G%C%/%9$G9T$&$3$H$O(B,
                    151: $B7k6I$O@hF,$+$i%]%$%s%?$r$?$I$k$3$H$KAjEv$9$k$?$a(B, $BG[Ns$KBP$9$kA`:n$K(B
                    152: $BHf3S$7$FBg$-$J%j%9%H$G$O;~4V$,$+$+$k>l9g$,$"$k$H$$$&$3$H$G$"$k(B.
1.3       noro      153: \E
                    154: \BEG
                    155: Notice that for lists, matrices and vectors, the index begins with
                    156: number 0.  Also notice that referencing list elements is done by
                    157: following pointers from the first element.  Therefore, it sometimes takes
                    158: much more time to perform referencing operations on a large list than
                    159: on a vectors or a matrices with the same size.
                    160: \E
1.1       noro      161:
1.3       noro      162: \JP @item 5 @b{$B%Y%/%H%k(B}
                    163: \EG @item 5 @b{vector}
1.1       noro      164:
                    165: @example
                    166: newvect(3)  newvect(2,[a,1])
                    167: @end example
                    168:
1.3       noro      169: \BJP
1.1       noro      170: $B%Y%/%H%k$O(B, @code{newvect()} $B$GL@<(E*$K@8@.$9$kI,MW$,$"$k(B. $BA0<T$NNc$G(B
                    171: $B$O(B2 $B@.J,$N(B 0 $B%Y%/%H%k$,@8@.$5$l(B, $B8e<T$G$O(B, $BBh(B 0 $B@.J,$,(B @code{a}, $BBh(B 1
                    172: $B@.J,$,(B @code{1} $B$N%Y%/%H%k$,@8@.$5$l$k(B. $B=i4|2=$N$?$a$N(B $BBh(B 2 $B0z?t$O(B, $BBh(B
                    173: 1 $B0z?t0J2<$ND9$5$N%j%9%H$r<u$1IU$1$k(B. $B%j%9%H$NMWAG$O:8$+$iMQ$$$i$l(B, $BB-(B
                    174: $B$j$J$$J,$O(B 0 $B$,Jd$o$l$k(B. $B@.J,$O(B @code{[@var{index}]} $B$K$h$j<h$j=P$;$k(B. $B<B:](B
                    175: $B$K$O(B, $B3F@.J,$K(B, $B%Y%/%H%k(B, $B9TNs(B, $B%j%9%H$r4^$`G$0U$N7?$NBP>]$rBeF~$G$-$k(B
                    176: $B$N$G(B, $BB?<!85G[Ns$r%Y%/%H%k$GI=8=$9$k$3$H$,$G$-$k(B.
1.3       noro      177: \E
                    178: \BEG
                    179: Vector objects are created only by explicit execution of @code{newvect()}
                    180: command.  The first example above creates a null vector object with
                    181: 3 elements.  The other example creates a vector object
                    182: with 2 elements which is initialized such that its 0-th element
                    183: is @code{a} and 1st element is @code{1}.
                    184: The second argument for @code{newvect} is used to initialize
                    185: elements of the newly created vector.  A list with size smaller or equal
                    186: to the first argument will be accepted.  Elements of the initializing
                    187: list is used from the left to the right.  If the list is too short to
                    188: specify all the vector elements,
                    189: the unspecified elements are filled with as many 0's as are required.
                    190: Any vector element is designated by indexing, e.g.,
                    191: @code{[@var{index}]}.
                    192: @code{Asir} allows any type, including vector, matrix and list,
                    193: for each respective element of a vector.
                    194: As a matter of course, arrays with arbitrary dimensions can be
                    195: represented by vectors, because each element of a vector can be a vector
                    196: or matrix itself.
                    197: An element designator of a vector can be a left value of assignment
                    198: statement.  This implies that an element designator is treated just like
                    199: a simple program variable.
                    200: Note that an assignment to the element designator of a vector has effect
                    201: on the whole value of that vector.
                    202: \E
1.1       noro      203:
                    204: @example
                    205: [0] A3 = newvect(3);
                    206: [ 0 0 0 ]
                    207: [1] for (I=0;I<3;I++)A3[I] = newvect(3);
                    208: [2] for (I=0;I<3;I++)for(J=0;J<3;J++)A3[I][J]=newvect(3);
                    209: [3] A3;
1.12      noro      210: [ [ [ 0 0 0 ] [ 0 0 0 ] [ 0 0 0 ] ]
                    211: [ [ 0 0 0 ] [ 0 0 0 ] [ 0 0 0 ] ]
1.4       noro      212: [ [ 0 0 0 ] [ 0 0 0 ] [ 0 0 0 ] ] ]
1.1       noro      213: [4] A3[0];
                    214: [ [ 0 0 0 ] [ 0 0 0 ] [ 0 0 0 ] ]
                    215: [5] A3[0][0];
                    216: [ 0 0 0 ]
                    217: @end example
                    218:
1.3       noro      219: \JP @item 6 @b{$B9TNs(B}
                    220: \EG @item 6 @b{matrix}
1.1       noro      221:
                    222: @example
                    223: newmat(2,2)  newmat(2,3,[[x,y],[z]])
                    224: @end example
                    225:
1.3       noro      226: \BJP
1.1       noro      227: $B9TNs$N@8@.$b(B @code{newmat()} $B$K$h$jL@<(E*$K9T$o$l$k(B. $B=i4|2=$b(B, $B0z?t(B
                    228: $B$,%j%9%H$N%j%9%H$H$J$k$3$H$r=|$$$F$O%Y%/%H%k$HF1MM$G(B, $B%j%9%H$N3FMWAG(B
                    229: ($B$3$l$O$^$?%j%9%H$G$"$k(B) $B$O(B, $B3F9T$N=i4|2=$K;H$o$l(B, $BB-$j$J$$ItJ,$K$O(B
                    230: 0 $B$,Kd$a$i$l$k(B. $B9TNs$b(B, $B3FMWAG$K$OG$0U$NBP>]$rBeF~$G$-$k(B. $B9TNs$N3F(B
                    231: $B9T$O(B, $B%Y%/%H%k$H$7$F<h$j=P$9$3$H$,$G$-$k(B.
1.3       noro      232: \E
                    233: \BEG
                    234: Like vector objects, matrix objects are also created only by explicit
                    235: execution of @code{newmat()} command. Initialization of the matrix
                    236: elements are done in a similar manner with that of the vector elements
                    237: except that the elements are specified by a list of lists.  Each element,
                    238: again a list, is used to initialize each row; if the list is too short
                    239: to specify all the row elements, unspecified elements are filled with
                    240: as many 0's as are required.
                    241: Like vectors, any matrix element is designated by indexing, e.g.,
                    242: @code{[@var{index}][@var{index}]}.
                    243: @code{Asir} also allows any type, including vector, matrix and list,
                    244: for each respective element of a matrix.
                    245: An element designator of a matrix can also be a left value of assignment
                    246: statement.  This implies that an element designator is treated just like
                    247: a simple program variable.
                    248: Note that an assignment to the element designator of a matrix has effect
                    249: on the whole value of that matrix.
                    250: Note also that every row, (not column,) of a matrix can be extracted
                    251: and referred to as a vector.
                    252: \E
1.1       noro      253:
                    254: @example
                    255: [0] M=newmat(2,3);
                    256: [ 0 0 0 ]
                    257: [ 0 0 0 ]
                    258: [1] M[1];
                    259: [ 0 0 0 ]
                    260: [2] type(@@@@);
                    261: 5
                    262: @end example
                    263:
1.3       noro      264: \JP @item 7 @b{$BJ8;zNs(B}
                    265: \EG @item 7 @b{string}
1.1       noro      266:
                    267: @example
                    268: ""  "afo"
                    269: @end example
                    270:
1.3       noro      271: \BJP
1.1       noro      272: $BJ8;zNs$O(B, $B<g$K%U%!%$%kL>$J$I$KMQ$$$i$l$k(B. $BJ8;zNs$KBP$7$F$O2C;;$N$_$,(B
                    273: $BDj5A$5$l$F$$$F(B, $B7k2L$O(B 2 $B$D$NJ8;zNs$N7k9g$G$"$k(B.
1.3       noro      274: \E
                    275: \BEG
                    276: Strings are used mainly for naming files.  It is also used for giving
                    277: comments of the results.  Operator symbol @code{+} denote the
                    278: concatenation  operation of two strings.
                    279: \E
1.1       noro      280:
                    281: @example
                    282: [0] "afo"+"take";
                    283: afotake
                    284: @end example
1.2       noro      285:
1.3       noro      286: \JP @item 8 @b{$B9=B$BN(B}
                    287: \EG @item 8 @b{structure}
1.1       noro      288:
                    289: @example
                    290: newstruct(afo)
                    291: @end example
                    292:
1.6       noro      293: \BJP
                    294: Asir $B$K$*$1$k9=B$BN$O(B, C $B$K$*$1$k9=B$BN$r4J0W2=$7$?$b$N$G$"$k(B.
                    295: $B8GDjD9G[Ns$N3F@.J,$rL>A0$G%"%/%;%9$G$-$k%*%V%8%'%/%H$G(B,
                    296: $B9=B$BNDj5AKh$KL>A0$r$D$1$k(B.
                    297: \E
                    298:
                    299: \BEG
                    300: The type @b{structure} is a simplified version of that in C language.
                    301: It is defined as a fixed length array and each entry of the array
                    302: is accessed by its name. A name is associated with each structure.
                    303: \E
1.1       noro      304:
1.3       noro      305: \JP @item 9 @b{$BJ,;6I=8=B?9`<0(B}
                    306: \EG @item 9 @b{distributed polynomial}
1.1       noro      307:
                    308: @example
                    309: 2*<<0,1,2,3>>-3*<<1,2,3,4>>
                    310: @end example
                    311:
1.3       noro      312: \BJP
1.1       noro      313: $B$3$l$O(B, $B$[$H$s$I%0%l%V%J4pDl@lMQ$N7?$G(B, $BDL>o$N7W;;$G$3$N7?$,I,MW$H(B
                    314: $B$J$k$3$H$O$^$:$J$$$,(B, $B%0%l%V%J4pDl7W;;%Q%C%1!<%8<+BN$,%f!<%68@8l(B
                    315: $B$G=q$+$l$F$$$k$?$a(B, $B%f!<%6$,A`:n$G$-$k$h$&FHN)$7$?7?$H$7$F(B  @b{Asir}
                    316: $B$G;HMQ$G$-$k$h$&$K$7$F$"$k(B. $B$3$l$K$D$$$F$O(B @xref{$B%0%l%V%J4pDl$N7W;;(B}.
1.3       noro      317: \E
                    318: \BEG
                    319: This is the short for `Distributed representation of polynomials.'
                    320: This type is specially devised for computation of Groebner bases.
                    321: Though for ordinary users this type may never be needed, it is provided
                    322: as a distinguished type that user can operate by @code{Asir}.
                    323: This is because the Groebner basis package provided with
                    324: @code{Risa/Asir} is written in the @code{Asir} user language.
                    325: For details @xref{Groebner basis computation}.
                    326: \E
                    327:
                    328: \JP @item 10 @b{$BId9f$J$7%^%7%s(B 32bit $B@0?t(B}
                    329: \EG @item 10 @b{32bit unsigned integer}
                    330:
                    331: \JP @item 11 @b{$B%(%i!<%*%V%8%'%/%H(B}
                    332: \EG @item 11 @b{error object}
1.5       noro      333: @*
1.3       noro      334: \JP $B0J>eFs$D$O(B, Open XM $B$K$*$$$FMQ$$$i$l$kFC<l%*%V%8%'%/%H$G$"$k(B.
                    335: \EG These are special objects used for OpenXM.
1.1       noro      336:
1.3       noro      337: \JP @item 12 @b{GF(2) $B>e$N9TNs(B}
                    338: \EG @item 12 @b{matrix over GF(2)}
1.5       noro      339: @*
1.3       noro      340: \BJP
1.1       noro      341: $B8=:_(B, $BI8?t(B 2 $B$NM-8BBN$K$*$1$k4pDlJQ49$N$?$a$N%*%V%8%'%/%H$H$7$FMQ$$$i$l(B
                    342: $B$k(B.
1.3       noro      343: \E
                    344: \BEG
                    345: This is used for basis conversion in finite fields of characteristic 2.
                    346: \E
1.1       noro      347:
1.3       noro      348: \JP @item 13 @b{MATHCAP $B%*%V%8%'%/%H(B}
                    349: \EG @item 13 @b{MATHCAP object}
1.5       noro      350: @*
1.3       noro      351: \JP Open XM $B$K$*$$$F(B, $B<BAu$5$l$F$$$k5!G=$rAw<u?.$9$k$?$a$N%*%V%8%'%/%H$G$"$k(B.
                    352: \EG This object is used to express available funcionalities for Open XM.
1.1       noro      353:
1.2       noro      354: @item 14 @b{first order formula}
1.5       noro      355: @*
1.3       noro      356: \JP quantifier elimination $B$GMQ$$$i$l$k0l3,=R8lO@M}<0(B.
                    357: \EG This expresses a first order formula used in quantifier elimination.
1.7       noro      358:
1.11      noro      359: @item 15 @b{matrix over GF(@var{p})}
1.7       noro      360: @*
                    361: \JP $B>.I8?tM-8BBN>e$N9TNs(B.
                    362: \EG A matrix over a small finite field.
                    363:
                    364: @item 16 @b{byte array}
                    365: @*
                    366: \JP $BId9f$J$7(B byte $B$NG[Ns(B
                    367: \EG An array of unsigned bytes.
1.2       noro      368:
1.15    ! noro      369: \JP @item 26 @b{$BJ,;6I=8=2C72B?9`<0(B}
        !           370: \EG @item 26 @b{distributed module polynomial}
        !           371:
        !           372: @example
        !           373: 2*<<0,1,2,3:1>>-3*<<1,2,3,4:2>>
        !           374: @end example
        !           375:
        !           376: \BJP
        !           377: $B$3$l$O(B, $BB?9`<04D>e$N<+M32C72$N85$r(B, $B2C72C19`<0$NOB$H$7$FFbItI=8=$7$?$b$N$G$"$k(B.
        !           378: $B$3$3$G(B, $B2C72C19`<0$H$OC19`<0$H2C72$NI8=`4pDl$N@Q$G$"$k(B.
        !           379: $B$3$l$K$D$$$F$O(B @xref{$B%0%l%V%J4pDl$N7W;;(B}.
        !           380: \E
        !           381: \BEG
        !           382: This represents an element in a free module over a polynomial ring
        !           383: as a linear sum of module monomials, where a module monomial is
        !           384: the product of a monomial in the polynomial ring and a standard base of the free module.
        !           385: For details @xref{Groebner basis computation}.
        !           386: \E
1.3       noro      387: \JP @item -1 @b{VOID $B%*%V%8%'%/%H(B}
                    388: \EG @item -1 @b{VOID object}
1.5       noro      389: @*
1.3       noro      390: \JP $B7?<1JL;R(B -1 $B$r$b$D%*%V%8%'%/%H$O4X?t$NLa$jCM$J$I$,L58z$G$"$k$3$H$r<($9(B.
                    391: \BEG
                    392: The object with the object identifier -1 indicates that a return value
                    393: of a function is void.
                    394: \E
1.1       noro      395: @end table
                    396:
1.3       noro      397: \BJP
1.1       noro      398: @node $B?t$N7?(B,,, $B7?(B
                    399: @section $B?t$N7?(B
1.3       noro      400: \E
                    401: \BEG
                    402: @node Types of numbers,,, Data types
                    403: @section Types of numbers
                    404: \E
1.1       noro      405:
                    406: @table @code
                    407: @item 0
1.3       noro      408: \JP @b{$BM-M}?t(B}
                    409: \EG @b{rational number}
1.5       noro      410: @*
1.3       noro      411: \BJP
1.1       noro      412: $BM-M}?t$O(B, $BG$0UB?G\D9@0?t(B (@b{bignum}) $B$K$h$j<B8=$5$l$F$$$k(B. $BM-M}?t$O>o$K(B
                    413: $B4{LsJ,?t$GI=8=$5$l$k(B.
1.3       noro      414: \E
                    415: \BEG
                    416: Rational numbers are implemented by arbitrary precision integers
                    417: (@b{bignum}).  A rational number is always expressed by a fraction of
                    418: lowest terms.
                    419: \E
1.1       noro      420:
                    421: @item 1
1.3       noro      422: \JP @b{$BG\@:EYIbF0>.?t(B}
                    423: \EG @b{double precision floating point number (double float)}
1.5       noro      424: @*
1.3       noro      425: \BJP
1.1       noro      426: $B%^%7%s$NDs6!$9$kG\@:EYIbF0>.?t$G$"$k(B. @b{Asir} $B$N5/F0;~$K$O(B,
                    427: $BDL>o$N7A<0$GF~NO$5$l$?IbF0>.?t$O$3$N7?$KJQ49$5$l$k(B. $B$?$@$7(B,
                    428: @code{ctrl()} $B$K$h$j(B @b{bigfloat} $B$,A*Br$5$l$F$$$k>l9g$K$O(B
                    429: @b{bigfloat} $B$KJQ49$5$l$k(B.
1.3       noro      430: \E
                    431: \BEG
                    432: The numbers of this type are numbers provided by the computer hardware.
                    433: By default, when @b{Asir} is started, floating point numbers in a
                    434: ordinary form are transformed into numbers of this type.  However,
                    435: they will be transformed into @b{bigfloat} numbers
                    436: when the switch @b{bigfloat} is turned on (enabled) by @code{ctrl()}
                    437: command.
                    438: \E
1.1       noro      439:
                    440: @example
                    441: [0] 1.2;
                    442: 1.2
                    443: [1] 1.2e-1000;
                    444: 0
                    445: [2] ctrl("bigfloat",1);
                    446: 1
                    447: [3] 1.2e-1000;
                    448: 1.20000000000000000513 E-1000
                    449: @end example
                    450:
1.3       noro      451: \BJP
1.1       noro      452: $BG\@:EYIbF0>.?t$HM-M}?t$N1i;;$O(B, $BM-M}?t$,IbF0>.?t$KJQ49$5$l$F(B,
                    453: $BIbF0>.?t$H$7$F1i;;$5$l$k(B.
1.3       noro      454: \E
                    455: \BEG
                    456: A rational number shall be converted automatically into a double float
                    457: number before the operation with another double float number and the
                    458: result shall be computed as a double float number.
                    459: \E
1.1       noro      460:
                    461: @item 2
1.3       noro      462: \JP @b{$BBe?tE*?t(B}
                    463: \EG @b{algebraic number}
1.5       noro      464: @*
1.3       noro      465: \JP @xref{$BBe?tE*?t$K4X$9$k1i;;(B}.
                    466: \EG @xref{Algebraic numbers}.
1.1       noro      467:
                    468: @item 3
                    469: @b{bigfloat}
1.5       noro      470: @*
1.3       noro      471: \BJP
1.14      noro      472: @b{bigfloat} $B$O(B, @b{Asir} $B$G$O(B @b{MPFR} $B%i%$%V%i%j$K$h$j(B
                    473: $B<B8=$5$l$F$$$k(B. @b{MPFR} $B$K$*$$$F$O(B, @b{bigfloat} $B$O(B, $B2>?tIt(B
                    474: $B$N$_G$0UB?G\D9$G(B, $B;X?tIt$O(B 64bit $B@0?t$G$"$k(B.
1.1       noro      475: @code{ctrl()} $B$G(B @b{bigfloat} $B$rA*Br$9$k$3$H$K$h$j(B, $B0J8e$NIbF0>.?t(B
                    476: $B$NF~NO$O(B @b{bigfloat} $B$H$7$F07$o$l$k(B. $B@:EY$O%G%U%)%k%H$G$O(B
1.14      noro      477: 10 $B?J(B 9 $B7eDxEY$G$"$k$,(B, @code{setprec()}, @code{setbprec()} $B$K$h$j;XDj2DG=$G$"$k(B.
1.3       noro      478: \E
                    479: \BEG
1.14      noro      480: The @b{bigfloat} numbers of @b{Asir} is realized by @b{MPFR} library.
                    481: A @b{bigfloat} number of @b{MPFR} has an arbitrary precision mantissa
                    482: part.  However, its exponent part admits only a 64bit integer.
1.3       noro      483: Floating point operations will be performed all in @b{bigfloat} after
                    484: activating the @b{bigfloat} switch by @code{ctrl()} command.
1.14      noro      485: The default precision is 53 bits (about 15 digits), which can be specified by
                    486: @code{setbprec()} and @code{setprec()} command.
1.3       noro      487: \E
1.1       noro      488:
                    489: @example
                    490: [0] ctrl("bigfloat",1);
                    491: 1
                    492: [1] eval(2^(1/2));
1.14      noro      493: 1.4142135623731
1.1       noro      494: [2] setprec(100);
1.14      noro      495: 15
1.1       noro      496: [3] eval(2^(1/2));
1.14      noro      497: 1.41421356237309504880168872420969807856967187537694...764157
                    498: [4] setbprec(100);
                    499: 332
                    500: [5] 1.41421356237309504880168872421
1.1       noro      501: @end example
                    502:
1.3       noro      503: \BJP
1.1       noro      504: @code{eval()} $B$O(B, $B0z?t$K4^$^$l$kH!?tCM$r2DG=$J8B$j?tCM2=$9$kH!?t$G$"$k(B.
1.14      noro      505: @code{setbprec()} $B$G;XDj$5$l$?(B2 $B?J7e?t$O(B, $B4]$a%b!<%I$K1~$8$?7k2L$N@:EY$rJ]>Z$9$k(B. @code{setprec()} $B$G;XDj$5$l$k(B10$B?J7e?t$O(B 2 $B?J7e?t$KJQ49$5$l$F@_Dj$5$l$k(B.
                    506:
1.3       noro      507: \E
                    508: \BEG
                    509: Function @code{eval()} evaluates numerically its argument as far as
                    510: possible.
1.14      noro      511: Notice that the integer given for the argument of @code{setbprec()}
                    512: guarantees the accuracy of the result according to the current rounding mode.
                    513: The argument of @code{setbprec()} is converted to the corresonding bit length
                    514: and set.
1.3       noro      515: \E
1.14      noro      516: (@xref{eval deval}.)
1.1       noro      517:
                    518: @item 4
1.3       noro      519: \JP @b{$BJ#AG?t(B}
                    520: \EG @b{complex number}
1.5       noro      521: @*
1.3       noro      522: \BJP
1.1       noro      523: $BJ#AG?t$O(B, $BM-M}?t(B, $BG\@:EYIbF0>.?t(B, @b{bigfloat} $B$r<BIt(B, $B5uIt$H$7$F(B
                    524: @code{a+b*@@i} (@@i $B$O5u?tC10L(B) $B$H$7$FM?$($i$l$k?t$G$"$k(B. $B<BIt(B, $B5uIt$O(B
                    525: $B$=$l$>$l(B @code{real()}, @code{imag()} $B$G<h$j=P$;$k(B.
1.3       noro      526: \E
                    527: \BEG
                    528: A @b{complex} number of @b{Risa/Asir} is a number with the form
                    529: @code{a+b*@@i}, where @@i is the unit of imaginary number, and @code{a}
                    530: and @code{b}
                    531: are either a @b{rational} number, @b{double float} number or
                    532: @b{bigfloat} number, respectively.
                    533: The real part and the imaginary part of a @b{complex} number can be
                    534: taken out by @code{real()} and @code{imag()} respectively.
                    535: \E
1.1       noro      536:
                    537: @item 5
1.3       noro      538: \JP @b{$B>.I8?t$NM-8BAGBN$N85(B}
                    539: \EG @b{element of a small finite prime field}
1.5       noro      540: @*
1.3       noro      541: \BJP
1.1       noro      542: $B$3$3$G8@$&>.I8?t$H$O(B, $BI8?t$,(B 2^27 $BL$K~$N$b$N$N$3$H$G$"$k(B. $B$3$N$h$&$JM-8B(B
                    543: $BBN$O(B, $B8=:_$N$H$3$m%0%l%V%J4pDl7W;;$K$*$$$FFbItE*$KMQ$$$i$l(B, $BM-8BBN78?t$N(B
                    544: $BJ,;6I=8=B?9`<0$N78?t$r<h$j=P$9$3$H$GF@$i$l$k(B. $B$=$l<+?H$OB0$9$kM-8BBN$K4X(B
                    545: $B$9$k>pJs$O;}$?$:(B, @code{setmod()} $B$G@_Dj$5$l$F$$$kAG?t(B @var{p} $B$rMQ$$$F(B
                    546: GF(@var{p}) $B>e$G$N1i;;$,E,MQ$5$l$k(B.
1.3       noro      547: \E
                    548: \BEG
                    549: Here a small finite fieid means that its characteristic is less than
                    550: 2^27.
                    551: At present small finite fields are used mainly
                    552: for groebner basis computation, and elements in such finite fields
                    553: can be extracted by taking coefficients of distributed polynomials
                    554: whose coefficients are in finite fields. Such an element itself does not
                    555: have any information about the field to which the element belongs, and
                    556: field operations are executed by using a prime @var{p} which is set by
                    557: @code{setmod()}.
                    558: \E
1.1       noro      559:
                    560: @item 6
1.3       noro      561: \JP @b{$BBgI8?t$NM-8BAGBN$N85(B}
                    562: \EG @b{element of large finite prime field}
1.5       noro      563: @*
1.3       noro      564: \BJP
1.1       noro      565: $BI8?t$H$7$FG$0U$NAG?t$,$H$l$k(B.
                    566: $B$3$N7?$N?t$O(B, $B@0?t$KBP$7(B@code{simp_ff} $B$rE,MQ$9$k$3$H$K$h$jF@$i$l$k(B.
1.3       noro      567: \E
                    568: \BEG
                    569: This type expresses an element of a finite prime field whose characteristic
                    570: is an arbitrary prime. An object of this type is obtained by applying
                    571: @code{simp_ff} to an integer.
                    572: \E
1.1       noro      573:
                    574: @item 7
1.3       noro      575: \JP @b{$BI8?t(B 2 $B$NM-8BBN$N85(B}
                    576: \EG @b{element of a finite field of characteristic 2}
1.5       noro      577: @*
1.3       noro      578: \BJP
1.1       noro      579: $BI8?t(B 2 $B$NG$0U$NM-8BBN$N85$rI=8=$9$k(B. $BI8?t(B 2 $B$NM-8BBN(B F $B$O(B, $B3HBg<!?t(B
                    580: [F:GF(2)] $B$r(B n $B$H$9$l$P(B, GF(2) $B>e4{Ls$J(B n $B<!B?9`<0(B f(t) $B$K$h$j(B
                    581: F=GF(2)[t]/(f(t)) $B$H$"$i$o$5$l$k(B. $B$5$i$K(B, GF(2)[t] $B$N85(B g $B$O(B, f(t)
1.3       noro      582: $B$b4^$a$F<+A3$J;EJ}$G%S%C%HNs$H$_$J$5$l$k$?$a(B, $B7A<0>e$O(B, F $B$N85(B
1.1       noro      583: g mod f $B$O(B, g, f  $B$r$"$i$o$9(B 2 $B$D$N%S%C%HNs$GI=8=$9$k$3$H$,$G$-$k(B.
1.3       noro      584: \E
                    585: \BEG
                    586: This type expresses an element of a finite field of characteristic 2.
1.11      noro      587: Let @var{F} be a finite field of characteristic 2. If [F:GF(2)]
                    588: is equal to @var{n}, then @var{F} is expressed as F=GF(2)[t]/(f(t)),
                    589: where f(t) is an irreducible polynomial over GF(2)
1.3       noro      590: of degree @var{n}.
1.11      noro      591: As an element @var{g} of GF(2)[t] can be expressed by a bit string,
1.3       noro      592: An element @var{g mod f} in @var{F} can be expressed by two bit strings
                    593: representing @var{g} and @var{f} respectively.
                    594: \E
1.1       noro      595:
1.3       noro      596: \JP F $B$N85$rF~NO$9$k$$$/$D$+$NJ}K!$,MQ0U$5$l$F$$$k(B.
                    597: \EG Several methods to input an element of @var{F} are provided.
1.1       noro      598:
                    599: @itemize @bullet
                    600: @item
                    601: @code{@@}
1.5       noro      602: @*
1.3       noro      603: \BJP
1.1       noro      604: @code{@@} $B$O$=$N8e$m$K?t;z(B, $BJ8;z$rH<$C$F(B, $B%R%9%H%j$dFC<l$J?t$r$"$i$o$9$,(B,
                    605: $BC1FH$G8=$l$?>l9g$K$O(B, F=GF(2)[t]/(f(t)) $B$K$*$1$k(B t mod f $B$r$"$i$o$9(B.
                    606: $B$h$C$F(B, @@ $B$NB?9`<0$H$7$F(B F $B$N85$rF~NO$G$-$k(B. (@@^10+@@+1 $B$J$I(B)
1.3       noro      607: \E
                    608: \BEG
1.11      noro      609: @code{@@} represents @var{t mod f} in F=GF(2)[t](f(t)).
1.3       noro      610: By using @code{@@} one can input an element of @var{F}. For example
                    611: @code{@@^10+@@+1} represents an element of @var{F}.
                    612: \E
1.1       noro      613:
                    614: @item
                    615: @code{ptogf2n}
1.5       noro      616: @*
1.3       noro      617: \JP $BG$0UJQ?t$N(B 1 $BJQ?tB?9`<0$r(B, @code{ptogf2n} $B$K$h$jBP1~$9$k(B F $B$N85$KJQ49$9$k(B.
                    618: \BEG
                    619: @code{ptogf2n} converts a univariate polynomial into an element of @var{F}.
                    620: \E
1.1       noro      621:
                    622: @item
                    623: @code{ntogf2n}
1.5       noro      624: @*
1.3       noro      625: \BJP
1.1       noro      626: $BG$0U$N<+A3?t$r(B, $B<+A3$J;EJ}$G(B F $B$N85$H$_$J$9(B. $B<+A3?t$H$7$F$O(B, 10 $B?J(B,
                    627: 16 $B?J(B (0x $B$G;O$^$k(B), 2 $B?J(B (0b $B$G;O$^$k(B) $B$GF~NO$,2DG=$G$"$k(B.
1.3       noro      628: \E
                    629: \BEG
                    630: As a bit string, a non-negative integer can be regarded as an element
                    631: of @var{F}. Note that one can input a non-negative integer in decimal,
                    632: hexadecimal (@code{0x} prefix) and binary (@code{0b} prefix) formats.
                    633: \E
1.1       noro      634:
                    635: @item
1.3       noro      636: \JP @code{$B$=$NB>(B}
                    637: \EG @code{micellaneous}
1.5       noro      638: @*
1.3       noro      639: \BJP
1.1       noro      640: $BB?9`<0$N78?t$r4]$4$H(B F $B$N85$KJQ49$9$k$h$&$J>l9g(B, @code{simp_ff}
                    641: $B$K$h$jJQ49$G$-$k(B.
1.3       noro      642: \E
                    643: \BEG
                    644: @code{simp_ff} is available if one wants to convert the whole
                    645: coefficients of a polynomial.
                    646: \E
1.1       noro      647:
                    648: @end itemize
1.10      noro      649:
                    650:
                    651: @item 8
                    652: \JP @b{$B0L?t(B @var{p^n} $B$NM-8BBN$N85(B}
                    653: \EG @b{element of a finite field of characteristic @var{p^n}}
                    654:
                    655: \BJP
                    656: $B0L?t$,(B @var{p^n} (@var{p} $B$OG$0U$NAG?t(B, @var{n} $B$O@5@0?t(B) $B$O(B,
1.11      noro      657: $BI8?t(B @var{p} $B$*$h$S(B GF(@var{p}) $B>e4{Ls$J(B @var{n} $B<!B?9`<0(B m(x)
1.10      noro      658: $B$r(B @code{setmod_ff} $B$K$h$j;XDj$9$k$3$H$K$h$j@_Dj$9$k(B.
1.11      noro      659: $B$3$NBN$N85$O(B m(x) $B$rK!$H$9$k(B GF(@var{p}) $B>e$NB?9`<0$H$7$F(B
1.10      noro      660: $BI=8=$5$l$k(B.
                    661: \E
                    662: \BEG
                    663: A finite field of order @var{p^n}, where @var{p} is an arbitrary prime
                    664: and @var{n} is a positive integer, is set by @code{setmod_ff}
                    665: by specifying its characteristic @var{p} and an irreducible polynomial
1.11      noro      666: of degree @var{n} over GF(@var{p}). An element of this field
                    667: is represented by a polynomial over GF(@var{p}) modulo m(x).
1.10      noro      668: \E
                    669:
                    670: @item 9
                    671: \JP @b{$B0L?t(B @var{p^n} $B$NM-8BBN$N85(B ($B>.0L?t(B)}
                    672: \EG @b{element of a finite field of characteristic @var{p^n} (small order)}
                    673:
                    674: \BJP
                    675: $B0L?t$,(B @var{p^n} $B$NM-8BBN(B (@var{p^n} $B$,(B @var{2^29} $B0J2<(B, @var{p} $B$,(B @var{2^14} $B0J>e(B
                    676: $B$J$i(B @var{n} $B$O(B 1) $B$O(B,
                    677: $BI8?t(B @var{p} $B$*$h$S3HBg<!?t(B @var{n}
                    678: $B$r(B @code{setmod_ff} $B$K$h$j;XDj$9$k$3$H$K$h$j@_Dj$9$k(B.
                    679: $B$3$NBN$N(B 0 $B$G$J$$85$O(B, @var{p} $B$,(B @var{2^14} $BL$K~$N>l9g(B,
1.11      noro      680: GF(@var{p^n}) $B$N>hK!72$N@8@.85$r8GDj$9$k$3$H(B
1.10      noro      681: $B$K$h$j(B, $B$3$N85$N$Y$-$H$7$FI=$5$l$k(B. $B$3$l$K$h$j(B, $B$3$NBN$N(B 0 $B$G$J$$85(B
                    682: $B$O(B, $B$3$N$Y$-;X?t$H$7$FI=8=$5$l$k(B. @var{p} $B$,(B @var{2^14} $B0J>e(B
                    683: $B$N>l9g$ODL>o$N>jM>$K$h$kI=8=$H$J$k$,(B, $B6&DL$N%W%m%0%i%`$G(B
                    684: $BAPJ}$N>l9g$r07$($k$h$&$K$3$N$h$&$J;EMM$H$J$C$F$$$k(B.
                    685:
                    686: \E
                    687: \BEG
                    688: A finite field of order @var{p^n}, where @var{p^n} must be less than
                    689: @var{2^29} and @var{n} must be equal to 1 if @var{p} is greater or
1.13      noro      690: equal to @var{2^14},
1.10      noro      691: is set by @code{setmod_ff}
                    692: by specifying its characteristic @var{p} the extension degree
                    693: @var{n}. If @var{p} is less than @var{2^14}, each non-zero element
                    694: of this field
                    695: is a power of a fixed element, which is a generator of the multiplicative
                    696: group of the field, and it is represented by its exponent.
                    697: Otherwise, each element is represented by the redue modulo @var{p}.
                    698: This specification is useful for treating both cases in a single
                    699: program.
                    700: \E
                    701:
1.13      noro      702: @item 10
                    703: \JP @b{$B0L?t(B @var{p^n} $B$N>.0L?tM-8BBN$NBe?t3HBg$N85(B}
                    704: \EG @b{element of a finite field which is an algebraic extension of a small finite field of characteristic @var{p^n}}
                    705:
                    706: \BJP
                    707: $BA09`$N(B, $B0L?t$,(B @var{p^n} $B$N>.0L?tM-8BBN$N(B @var{m} $B<!3HBg$N85$G$"$k(B.
                    708: $BI8?t(B @var{p} $B$*$h$S3HBg<!?t(B @var{n}, @var{m}
                    709: $B$r(B @code{setmod_ff} $B$K$h$j;XDj$9$k$3$H$K$h$j@_Dj$9$k(B. $B4pACBN>e$N(B @var{m}
                    710: $B<!4{LsB?9`<0$,<+F0@8@.$5$l(B, $B$=$NBe?t3HBg$N@8@.85$NDj5AB?9`<0$H$7$FMQ$$$i$l$k(B.
                    711: $B@8@.85$O(B @code{@@s} $B$G$"$k(B.
                    712:
                    713: \E
                    714: \BEG
                    715: An extension field @var{K} of the small finite field @var{F} of order @var{p^n}
                    716: is set by @code{setmod_ff}
                    717: by specifying its characteristic @var{p} the extension degree
                    718: @var{n} and @var{m}=[@var{K}:@var{F}]. An irreducible polynomial of degree @var{m}
                    719: over @var{K} is automatically generated and used as the defining polynomial of
                    720: the generator of the extension @var{K/F}. The generator is denoted by @code{@@s}.
                    721: \E
                    722:
                    723: @item 11
                    724: \JP @b{$BJ,;6I=8=$NBe?tE*?t(B}
                    725: \EG @b{algebraic number represented by a distributed polynomial}
                    726: @*
                    727: \JP @xref{$BBe?tE*?t$K4X$9$k1i;;(B}.
                    728: \EG @xref{Algebraic numbers}.
                    729:
                    730: \BJP
                    731:
                    732: \E
                    733: \BEG
                    734: \E
1.1       noro      735: @end table
                    736:
1.3       noro      737: \BJP
1.10      noro      738: $B>.I8?tM-8BAGBN0J30$NM-8BBN$O(B @code{setmod_ff} $B$G@_Dj$9$k(B.
                    739: $BM-8BBN$N85$I$&$7$N1i;;$G$O(B,
1.1       noro      740: $B0lJ}$,M-M}?t$N>l9g$K$O(B, $B$=$NM-M}?t$O<+F0E*$K8=:_@_Dj$5$l$F$$$k(B
                    741: $BM-8BBN$N85$KJQ49$5$l(B, $B1i;;$,9T$o$l$k(B.
1.3       noro      742: \E
                    743: \BEG
1.10      noro      744: Finite fields other than small finite prime fields are
                    745: set by @code{setmod_ff}.
1.3       noro      746: Elements of finite fields do not have informations about the modulus.
1.10      noro      747: Upon an arithmetic operation, i
                    748: f one of the operands is a rational number, it is automatically
1.3       noro      749: converted into an element of the finite field currently set and
                    750: the operation is done in the finite field.
                    751: \E
1.1       noro      752:
1.3       noro      753: \BJP
1.1       noro      754: @node $BITDj85$N7?(B,,, $B7?(B
                    755: @section $BITDj85$N7?(B
1.3       noro      756: \E
                    757: \BEG
                    758: @node Types of indeterminates,,, Data types
                    759: @section Types of indeterminates
                    760: \E
1.1       noro      761:
                    762: @noindent
1.3       noro      763: \BJP
1.1       noro      764: $BB?9`<0$NJQ?t$H$J$jF@$kBP>]$r(B@b{$BITDj85(B}$B$H$h$V(B. @b{Asir} $B$G$O(B,
                    765: $B1Q>.J8;z$G;O$^$j(B, $BG$0U8D$N%"%k%U%!%Y%C%H(B, $B?t;z(B, @samp{_} $B$+$i$J$kJ8;zNs(B
                    766: $B$rITDj85$H$7$F07$&$,(B, $B$=$NB>$K$b%7%9%F%`$K$h$jITDj85$H$7$F07$o$l$k$b$N(B
                    767: $B$,$$$/$D$+$"$k(B. @b{Asir} $B$NFbIt7A<0$H$7$F$O(B, $B$3$l$i$OA4$FB?9`<0$H$7$F$N(B
                    768: $B7?$r;}$D$,(B, $B?t$HF1MM(B, $BITDj85$N7?$K$h$j6hJL$5$l$k(B.
1.3       noro      769: \E
                    770: \BEG
                    771: An algebraic object is recognized as an indeterminate when it can be
                    772: a (so-called) variable in polynomials.
                    773: An ordinary indeterminate is usually denoted by a string that start with
                    774: a small alphabetical letter followed by an arbitrary number of
                    775: alphabetical letters, digits or @samp{_}.
                    776: In addition to such ordinary indeterminates,
                    777: there are other kinds of indeterminates in a wider sense in @b{Asir}.
                    778: Such indeterminates in the wider sense have type @b{polynomial},
                    779: and further are classified into sub-types of the type @b{indeterminate}.
                    780: \E
1.1       noro      781:
                    782: @table @code
                    783: @item 0
1.3       noro      784: \JP @b{$B0lHLITDj85(B}
                    785: \EG @b{ordinary indeterminate}
1.5       noro      786: @*
1.3       noro      787: \JP $B1Q>.J8;z$G;O$^$kJ8;zNs(B. $BB?9`<0$NJQ?t$H$7$F:G$bIaDL$KMQ$$$i$l$k(B.
                    788: \BEG
                    789: An object of this sub-type is denoted by a string that start with
                    790: a small alphabetical letter followed by an arbitrary number of
                    791: alphabetical letters, digits or @samp{_}.
                    792: This kind of indeterminates are most commonly used for variables of
                    793: polynomials.
                    794: \E
1.1       noro      795:
                    796: @example
                    797: [0] [vtype(a),vtype(aA_12)];
                    798: [0,0]
                    799: @end example
                    800:
                    801: @item 1
1.3       noro      802: \JP @b{$BL$Dj78?t(B}
                    803: \EG @b{undetermined coefficient}
1.5       noro      804: @*
1.3       noro      805: \BJP
1.1       noro      806: @code{uc()} $B$O(B, @samp{_} $B$G;O$^$kJ8;zNs$rL>A0$H$9$kITDj85$r@8@.$9$k(B.
                    807: $B$3$l$i$O(B, $B%f!<%6$,F~NO$G$-$J$$$H$$$&$@$1$G(B, $B0lHLITDj85$HJQ$o$i$J$$$,(B,
                    808: $B%f!<%6$,F~NO$7$?ITDj85$H>WFM$7$J$$$H$$$&@-<A$rMxMQ$7$FL$Dj78?t$N(B
                    809: $B<+F0@8@.$J$I$KMQ$$$k$3$H$,$G$-$k(B.
1.3       noro      810: \E
                    811: \BEG
                    812: The function @code{uc()} creates an indeterminate which is denoted by
                    813: a string that begins with @samp{_}.  Such an indeterminate cannot be
                    814: directly input by its name.  Other properties are the same as those of
                    815: @b{ordinary indeterminate}.  Therefore, it has a property that it cannot
                    816: cause collision with the name of ordinary indeterminates input by the
                    817: user.  And this property is conveniently used to create undetermined
                    818: coefficients dynamically by programs.
                    819: \E
1.1       noro      820:
                    821: @example
                    822: [1] U=uc();
                    823: _0
                    824: [2] vtype(U);
                    825: 1
                    826: @end example
                    827:
                    828: @item 2
1.3       noro      829: \JP @b{$BH!?t7A<0(B}
                    830: \EG @b{function form}
1.5       noro      831: @*
1.3       noro      832: \BJP
1.1       noro      833: $BAH$_9~$_H!?t(B, $B%f!<%6H!?t$N8F$S=P$7$O(B, $BI>2A$5$l$F2?$i$+$N(B @b{Asir} $B$N(B
                    834: $BFbIt7A<0$KJQ49$5$l$k$,(B, @code{sin(x)}, @code{cos(x+1)} $B$J$I$O(B, $BI>2A8e(B
                    835: $B$b$=$N$^$^$N7A$GB8:_$9$k(B. $B$3$l$OH!?t7A<0$H8F$P$l(B, $B$=$l<+?H$,(B 1 $B$D$N(B
                    836: $BITDj85$H$7$F07$o$l$k(B. $B$^$?$d$dFC<l$JNc$H$7$F(B, $B1_<~N((B @code{@@pi} $B$d(B
                    837: $B<+A3BP?t$NDl(B @code{@@e} $B$bH!?t7A<0$H$7$F07$o$l$k(B.
1.3       noro      838: \E
                    839: \BEG
                    840: A function call to a built-in function or to an user defined function
                    841: is usually evaluated by @b{Asir} and retained in a proper internal form.
                    842: Some expressions, however, will remain in the same form after evaluation.
                    843: For example, @code{sin(x)} and @code{cos(x+1)} will remain as if they
                    844: were not evaluated.  These (unevaluated) forms are called
                    845: `function forms' and are treated as if they are indeterminates in a
                    846: wider sense.  Also, special forms such as @code{@@pi} the ratio of
                    847: circumference and diameter, and @code{@@e} Napier's number, will be
                    848: treated as `function forms.'
                    849: \E
1.1       noro      850:
                    851: @example
                    852: [3] V=sin(x);
                    853: sin(x)
                    854: [4] vtype(V);
                    855: 2
                    856: [5] vars(V^2+V+1);
                    857: [sin(x)]
                    858: @end example
                    859:
                    860: @item 3
1.3       noro      861: \JP @b{$BH!?t;R(B}
                    862: \EG @b{functor}
1.5       noro      863: @*
1.3       noro      864: \BJP
1.11      noro      865: $BH!?t8F$S=P$7$O(B, @var{fname}(@var{args}) $B$H$$$&7A$G9T$J$o$l$k$,(B, @var{fname} $B$N(B
1.1       noro      866: $BItJ,$rH!?t;R$H8F$V(B. $BH!?t;R$K$O(B, $BH!?t$N<oN`$K$h$jAH$_9~$_H!?t;R(B,
                    867: $B%f!<%6Dj5AH!?t;R(B, $B=iEyH!?t;R$J$I$,$"$k$,(B, $BH!?t;R$OC1FH$GITDj85$H$7$F(B
                    868: $B5!G=$9$k(B.
1.3       noro      869: \E
                    870: \BEG
1.11      noro      871: A function call (or a function form) has a form @var{fname}(@var{args}).
1.3       noro      872: Here, @var{fname} alone is called a @b{functor}.
                    873: There are several kinds of @b{functor}s: built-in functor, user defined
                    874: functor and functor for the elementary functions.  A functor alone is
                    875: treated as an indeterminate in a wider sense.
                    876: \E
1.1       noro      877:
                    878: @example
                    879: [6] vtype(sin);
                    880: 3
                    881: @end example
                    882: @end table
                    883:

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