@comment $OpenXM: OpenXM/src/asir-doc/parts/type.texi,v 1.15 2019/09/13 09:31:00 noro Exp $ \BJP @node 型,,, Top @chapter 型 \E \BEG @node Data types,,, Top @chapter Data types \E @menu \BJP * Asir で使用可能な型:: * 数の型:: * 不定元の型:: \E \BEG * Types in Asir:: * Types of numbers:: * Types of indeterminates:: \E @end menu \BJP @node Asir で使用可能な型,,, 型 @section @b{Asir} で使用可能な型 \E \BEG @node Types in Asir,,, Data types @section Types in @b{Asir} \E @noindent \BJP @b{Asir} においては, 可読な形式で入力されたさまざまな対象は, パーザにより 中間言語に変換され, インタプリタにより @b{Risa} の計算エンジンを呼び出し ながら内部形式に変換される. 変換された対象は, 次のいずれかの型を持つ. 各番号は, 組み込み函数 @code{type()} により返される値に対応している. 各例は, @b{Asir} のプロンプトに対する入力が可能な形式のいくつかを 示す. \E \BEG In @b{Asir}, various objects described according to the syntax of @b{Asir} are translated to intermediate forms and by @b{Asir} interpreter further translated into internal forms with the help of basic algebraic engine. Such an object in an internal form has one of the following types listed below. In the list, the number coincides with the value returned by the built-in function @code{type()}. Each example shows possible forms of inputs for @b{Asir}'s prompt. \E @table @code @item 0 @b{0} @* \BJP 実際には 0 を識別子にもつ対象は存在しない. 0 は, C における 0 ポインタに より表現されている. しかし, 便宜上 @b{Asir} の @code{type(0)} は 値 0 を返す. \E \BEG As a matter of fact, no object exists that has 0 as its identification number. The number 0 is implemented as a null (0) pointer of C language. For convenience's sake, a 0 is returned for the input @code{type(0)}. \E \JP @item 1 @b{数} \EG @item 1 @b{number} @example 1 2/3 14.5 3+2*@@i @end example \JP 数は, さらにいくつかの型に分けられる. これについては下で述べる. \EG Numbers have sub-types. @xref{Types of numbers}. \JP @item 2 @b{多項式} (数でない) \EG @item 2 @b{polynomial} (but not a number) @example x afo (2.3*x+y)^10 @end example \BJP 多項式は, 全て展開され, その時点における変数順序に従って, 再帰的に 1 変数多項式として降冪の順に整理される. (@xref{分散表現多項式}.) この時, その多項式に現れる順序最大の変数を @b{主変数} と呼ぶ. \E \BEG Every polynomial is maintained internally in its full expanded form, represented as a nested univariate polynomial, according to the current variable ordering, arranged by the descending order of exponents. (@xref{Distributed polynomial}.) In the representation, the indeterminate (or variable), appearing in the polynomial, with maximum ordering is called the @b{main variable}. Moreover, we call the coefficient of the maximum degree term of the polynomial with respect to the main variable the @b{leading coefficient}. \E \JP @item 3 @b{有理式} (多項式でない) \EG @item 3 @b{rational expression} (not a polynomial) @example (x+1)/(y^2-y-x) x/x @end example \BJP 有理式は, 分母分子が約分可能でも, 明示的に @code{red()} が呼ばれない 限り約分は行われない. これは, 多項式の GCD 演算が極めて重い演算である ためで, 有理式の演算は注意が必要である. \E \BEG Note that in @b{Risa/Asir} a rational expression is not simplified by reducing the common divisors unless @code{red()} is called explicitly, even if it is possible. This is because the GCD computation of polynomials is a considerably heavy operation. You have to be careful enough in operating rational expressions. \E \JP @item 4 @b{リスト} \EG @item 4 @b{list} @example [] [1,2,[3,4],[x,y]] @end example \BJP リストは読み出し専用である. @code{[]} は空リストを意味する. リストに対する 操作としては, @code{car()}, @code{cdr()}, @code{cons()} などによる操作の他に, 読み出し専用の配列とみなして, @code{[@var{index}]} を必要なだけつけることにより 要素の取り出しを行うことができる. 例えば \E \BEG Lists are all read-only object. A null list is specified by @code{[]}. There are operations for lists: @code{car()}, @code{cdr()}, @code{cons()} etc. And further more, element referencing by indexing is available. Indexing is done by putting @code{[@var{index}]}'s after a program variable as many as are required. For example, \E @example [0] L = [[1,2,3],[4,[5,6]],7]$ [1] L[1][1]; [5,6] @end example \BJP 注意すべきことは, リスト, 配列 (行列, ベクトル) 共に, インデックスは 0 から始まることと, リストの要素の取り出しをインデックスで行うことは, 結局は先頭からポインタをたどることに相当するため, 配列に対する操作に 比較して大きなリストでは時間がかかる場合があるということである. \E \BEG Notice that for lists, matrices and vectors, the index begins with number 0. Also notice that referencing list elements is done by following pointers from the first element. Therefore, it sometimes takes much more time to perform referencing operations on a large list than on a vectors or a matrices with the same size. \E \JP @item 5 @b{ベクトル} \EG @item 5 @b{vector} @example newvect(3) newvect(2,[a,1]) @end example \BJP ベクトルは, @code{newvect()} で明示的に生成する必要がある. 前者の例で は2 成分の 0 ベクトルが生成され, 後者では, 第 0 成分が @code{a}, 第 1 成分が @code{1} のベクトルが生成される. 初期化のための 第 2 引数は, 第 1 引数以下の長さのリストを受け付ける. リストの要素は左から用いられ, 足 りない分は 0 が補われる. 成分は @code{[@var{index}]} により取り出せる. 実際 には, 各成分に, ベクトル, 行列, リストを含む任意の型の対象を代入できる ので, 多次元配列をベクトルで表現することができる. \E \BEG Vector objects are created only by explicit execution of @code{newvect()} command. The first example above creates a null vector object with 3 elements. The other example creates a vector object with 2 elements which is initialized such that its 0-th element is @code{a} and 1st element is @code{1}. The second argument for @code{newvect} is used to initialize elements of the newly created vector. A list with size smaller or equal to the first argument will be accepted. Elements of the initializing list is used from the left to the right. If the list is too short to specify all the vector elements, the unspecified elements are filled with as many 0's as are required. Any vector element is designated by indexing, e.g., @code{[@var{index}]}. @code{Asir} allows any type, including vector, matrix and list, for each respective element of a vector. As a matter of course, arrays with arbitrary dimensions can be represented by vectors, because each element of a vector can be a vector or matrix itself. An element designator of a vector can be a left value of assignment statement. This implies that an element designator is treated just like a simple program variable. Note that an assignment to the element designator of a vector has effect on the whole value of that vector. \E @example [0] A3 = newvect(3); [ 0 0 0 ] [1] for (I=0;I<3;I++)A3[I] = newvect(3); [2] for (I=0;I<3;I++)for(J=0;J<3;J++)A3[I][J]=newvect(3); [3] A3; [ [ [ 0 0 0 ] [ 0 0 0 ] [ 0 0 0 ] ] [ [ 0 0 0 ] [ 0 0 0 ] [ 0 0 0 ] ] [ [ 0 0 0 ] [ 0 0 0 ] [ 0 0 0 ] ] ] [4] A3[0]; [ [ 0 0 0 ] [ 0 0 0 ] [ 0 0 0 ] ] [5] A3[0][0]; [ 0 0 0 ] @end example \JP @item 6 @b{行列} \EG @item 6 @b{matrix} @example newmat(2,2) newmat(2,3,[[x,y],[z]]) @end example \BJP 行列の生成も @code{newmat()} により明示的に行われる. 初期化も, 引数 がリストのリストとなることを除いてはベクトルと同様で, リストの各要素 (これはまたリストである) は, 各行の初期化に使われ, 足りない部分には 0 が埋められる. 行列も, 各要素には任意の対象を代入できる. 行列の各 行は, ベクトルとして取り出すことができる. \E \BEG Like vector objects, matrix objects are also created only by explicit execution of @code{newmat()} command. Initialization of the matrix elements are done in a similar manner with that of the vector elements except that the elements are specified by a list of lists. Each element, again a list, is used to initialize each row; if the list is too short to specify all the row elements, unspecified elements are filled with as many 0's as are required. Like vectors, any matrix element is designated by indexing, e.g., @code{[@var{index}][@var{index}]}. @code{Asir} also allows any type, including vector, matrix and list, for each respective element of a matrix. An element designator of a matrix can also be a left value of assignment statement. This implies that an element designator is treated just like a simple program variable. Note that an assignment to the element designator of a matrix has effect on the whole value of that matrix. Note also that every row, (not column,) of a matrix can be extracted and referred to as a vector. \E @example [0] M=newmat(2,3); [ 0 0 0 ] [ 0 0 0 ] [1] M[1]; [ 0 0 0 ] [2] type(@@@@); 5 @end example \JP @item 7 @b{文字列} \EG @item 7 @b{string} @example "" "afo" @end example \BJP 文字列は, 主にファイル名などに用いられる. 文字列に対しては加算のみが 定義されていて, 結果は 2 つの文字列の結合である. \E \BEG Strings are used mainly for naming files. It is also used for giving comments of the results. Operator symbol @code{+} denote the concatenation operation of two strings. \E @example [0] "afo"+"take"; afotake @end example \JP @item 8 @b{構造体} \EG @item 8 @b{structure} @example newstruct(afo) @end example \BJP Asir における構造体は, C における構造体を簡易化したものである. 固定長配列の各成分を名前でアクセスできるオブジェクトで, 構造体定義毎に名前をつける. \E \BEG The type @b{structure} is a simplified version of that in C language. It is defined as a fixed length array and each entry of the array is accessed by its name. A name is associated with each structure. \E \JP @item 9 @b{分散表現多項式} \EG @item 9 @b{distributed polynomial} @example 2*<<0,1,2,3>>-3*<<1,2,3,4>> @end example \BJP これは, ほとんどグレブナ基底専用の型で, 通常の計算でこの型が必要と なることはまずないが, グレブナ基底計算パッケージ自体がユーザ言語 で書かれているため, ユーザが操作できるよう独立した型として @b{Asir} で使用できるようにしてある. これについては @xref{グレブナ基底の計算}. \E \BEG This is the short for `Distributed representation of polynomials.' This type is specially devised for computation of Groebner bases. Though for ordinary users this type may never be needed, it is provided as a distinguished type that user can operate by @code{Asir}. This is because the Groebner basis package provided with @code{Risa/Asir} is written in the @code{Asir} user language. For details @xref{Groebner basis computation}. \E \JP @item 10 @b{符号なしマシン 32bit 整数} \EG @item 10 @b{32bit unsigned integer} \JP @item 11 @b{エラーオブジェクト} \EG @item 11 @b{error object} @* \JP 以上二つは, Open XM において用いられる特殊オブジェクトである. \EG These are special objects used for OpenXM. \JP @item 12 @b{GF(2) 上の行列} \EG @item 12 @b{matrix over GF(2)} @* \BJP 現在, 標数 2 の有限体における基底変換のためのオブジェクトとして用いられ る. \E \BEG This is used for basis conversion in finite fields of characteristic 2. \E \JP @item 13 @b{MATHCAP オブジェクト} \EG @item 13 @b{MATHCAP object} @* \JP Open XM において, 実装されている機能を送受信するためのオブジェクトである. \EG This object is used to express available funcionalities for Open XM. @item 14 @b{first order formula} @* \JP quantifier elimination で用いられる一階述語論理式. \EG This expresses a first order formula used in quantifier elimination. @item 15 @b{matrix over GF(@var{p})} @* \JP 小標数有限体上の行列. \EG A matrix over a small finite field. @item 16 @b{byte array} @* \JP 符号なし byte の配列 \EG An array of unsigned bytes. \JP @item 26 @b{分散表現加群多項式} \EG @item 26 @b{distributed module polynomial} @example 2*<<0,1,2,3:1>>-3*<<1,2,3,4:2>> @end example \BJP これは, 多項式環上の自由加群の元を, 加群単項式の和として内部表現したものである. ここで, 加群単項式とは単項式と加群の標準基底の積である. これについては @xref{グレブナ基底の計算}. \E \BEG This represents an element in a free module over a polynomial ring as a linear sum of module monomials, where a module monomial is the product of a monomial in the polynomial ring and a standard base of the free module. For details @xref{Groebner basis computation}. \E \JP @item -1 @b{VOID オブジェクト} \EG @item -1 @b{VOID object} @* \JP 型識別子 -1 をもつオブジェクトは関数の戻り値などが無効であることを示す. \BEG The object with the object identifier -1 indicates that a return value of a function is void. \E @end table \BJP @node 数の型,,, 型 @section 数の型 \E \BEG @node Types of numbers,,, Data types @section Types of numbers \E @table @code @item 0 \JP @b{有理数} \EG @b{rational number} @* \BJP 有理数は, 任意多倍長整数 (@b{bignum}) により実現されている. 有理数は常に 既約分数で表現される. \E \BEG Rational numbers are implemented by arbitrary precision integers (@b{bignum}). A rational number is always expressed by a fraction of lowest terms. \E @item 1 \JP @b{倍精度浮動小数} \EG @b{double precision floating point number (double float)} @* \BJP マシンの提供する倍精度浮動小数である. @b{Asir} の起動時には, 通常の形式で入力された浮動小数はこの型に変換される. ただし, @code{ctrl()} により @b{bigfloat} が選択されている場合には @b{bigfloat} に変換される. \E \BEG The numbers of this type are numbers provided by the computer hardware. By default, when @b{Asir} is started, floating point numbers in a ordinary form are transformed into numbers of this type. However, they will be transformed into @b{bigfloat} numbers when the switch @b{bigfloat} is turned on (enabled) by @code{ctrl()} command. \E @example [0] 1.2; 1.2 [1] 1.2e-1000; 0 [2] ctrl("bigfloat",1); 1 [3] 1.2e-1000; 1.20000000000000000513 E-1000 @end example \BJP 倍精度浮動小数と有理数の演算は, 有理数が浮動小数に変換されて, 浮動小数として演算される. \E \BEG A rational number shall be converted automatically into a double float number before the operation with another double float number and the result shall be computed as a double float number. \E @item 2 \JP @b{代数的数} \EG @b{algebraic number} @* \JP @xref{代数的数に関する演算}. \EG @xref{Algebraic numbers}. @item 3 @b{bigfloat} @* \BJP @b{bigfloat} は, @b{Asir} では @b{MPFR} ライブラリにより 実現されている. @b{MPFR} においては, @b{bigfloat} は, 仮数部 のみ任意多倍長で, 指数部は 64bit 整数である. @code{ctrl()} で @b{bigfloat} を選択することにより, 以後の浮動小数 の入力は @b{bigfloat} として扱われる. 精度はデフォルトでは 10 進 9 桁程度であるが, @code{setprec()}, @code{setbprec()} により指定可能である. \E \BEG The @b{bigfloat} numbers of @b{Asir} is realized by @b{MPFR} library. A @b{bigfloat} number of @b{MPFR} has an arbitrary precision mantissa part. However, its exponent part admits only a 64bit integer. Floating point operations will be performed all in @b{bigfloat} after activating the @b{bigfloat} switch by @code{ctrl()} command. The default precision is 53 bits (about 15 digits), which can be specified by @code{setbprec()} and @code{setprec()} command. \E @example [0] ctrl("bigfloat",1); 1 [1] eval(2^(1/2)); 1.4142135623731 [2] setprec(100); 15 [3] eval(2^(1/2)); 1.41421356237309504880168872420969807856967187537694...764157 [4] setbprec(100); 332 [5] 1.41421356237309504880168872421 @end example \BJP @code{eval()} は, 引数に含まれる函数値を可能な限り数値化する函数である. @code{setbprec()} で指定された2 進桁数は, 丸めモードに応じた結果の精度を保証する. @code{setprec()} で指定される10進桁数は 2 進桁数に変換されて設定される. \E \BEG Function @code{eval()} evaluates numerically its argument as far as possible. Notice that the integer given for the argument of @code{setbprec()} guarantees the accuracy of the result according to the current rounding mode. The argument of @code{setbprec()} is converted to the corresonding bit length and set. \E (@xref{eval deval}.) @item 4 \JP @b{複素数} \EG @b{complex number} @* \BJP 複素数は, 有理数, 倍精度浮動小数, @b{bigfloat} を実部, 虚部として @code{a+b*@@i} (@@i は虚数単位) として与えられる数である. 実部, 虚部は それぞれ @code{real()}, @code{imag()} で取り出せる. \E \BEG A @b{complex} number of @b{Risa/Asir} is a number with the form @code{a+b*@@i}, where @@i is the unit of imaginary number, and @code{a} and @code{b} are either a @b{rational} number, @b{double float} number or @b{bigfloat} number, respectively. The real part and the imaginary part of a @b{complex} number can be taken out by @code{real()} and @code{imag()} respectively. \E @item 5 \JP @b{小標数の有限素体の元} \EG @b{element of a small finite prime field} @* \BJP ここで言う小標数とは, 標数が 2^27 未満のもののことである. このような有限 体は, 現在のところグレブナ基底計算において内部的に用いられ, 有限体係数の 分散表現多項式の係数を取り出すことで得られる. それ自身は属する有限体に関 する情報は持たず, @code{setmod()} で設定されている素数 @var{p} を用いて GF(@var{p}) 上での演算が適用される. \E \BEG Here a small finite fieid means that its characteristic is less than 2^27. At present small finite fields are used mainly for groebner basis computation, and elements in such finite fields can be extracted by taking coefficients of distributed polynomials whose coefficients are in finite fields. Such an element itself does not have any information about the field to which the element belongs, and field operations are executed by using a prime @var{p} which is set by @code{setmod()}. \E @item 6 \JP @b{大標数の有限素体の元} \EG @b{element of large finite prime field} @* \BJP 標数として任意の素数がとれる. この型の数は, 整数に対し@code{simp_ff} を適用することにより得られる. \E \BEG This type expresses an element of a finite prime field whose characteristic is an arbitrary prime. An object of this type is obtained by applying @code{simp_ff} to an integer. \E @item 7 \JP @b{標数 2 の有限体の元} \EG @b{element of a finite field of characteristic 2} @* \BJP 標数 2 の任意の有限体の元を表現する. 標数 2 の有限体 F は, 拡大次数 [F:GF(2)] を n とすれば, GF(2) 上既約な n 次多項式 f(t) により F=GF(2)[t]/(f(t)) とあらわされる. さらに, GF(2)[t] の元 g は, f(t) も含めて自然な仕方でビット列とみなされるため, 形式上は, F の元 g mod f は, g, f をあらわす 2 つのビット列で表現することができる. \E \BEG This type expresses an element of a finite field of characteristic 2. Let @var{F} be a finite field of characteristic 2. If [F:GF(2)] is equal to @var{n}, then @var{F} is expressed as F=GF(2)[t]/(f(t)), where f(t) is an irreducible polynomial over GF(2) of degree @var{n}. As an element @var{g} of GF(2)[t] can be expressed by a bit string, An element @var{g mod f} in @var{F} can be expressed by two bit strings representing @var{g} and @var{f} respectively. \E \JP F の元を入力するいくつかの方法が用意されている. \EG Several methods to input an element of @var{F} are provided. @itemize @bullet @item @code{@@} @* \BJP @code{@@} はその後ろに数字, 文字を伴って, ヒストリや特殊な数をあらわすが, 単独で現れた場合には, F=GF(2)[t]/(f(t)) における t mod f をあらわす. よって, @@ の多項式として F の元を入力できる. (@@^10+@@+1 など) \E \BEG @code{@@} represents @var{t mod f} in F=GF(2)[t](f(t)). By using @code{@@} one can input an element of @var{F}. For example @code{@@^10+@@+1} represents an element of @var{F}. \E @item @code{ptogf2n} @* \JP 任意変数の 1 変数多項式を, @code{ptogf2n} により対応する F の元に変換する. \BEG @code{ptogf2n} converts a univariate polynomial into an element of @var{F}. \E @item @code{ntogf2n} @* \BJP 任意の自然数を, 自然な仕方で F の元とみなす. 自然数としては, 10 進, 16 進 (0x で始まる), 2 進 (0b で始まる) で入力が可能である. \E \BEG As a bit string, a non-negative integer can be regarded as an element of @var{F}. Note that one can input a non-negative integer in decimal, hexadecimal (@code{0x} prefix) and binary (@code{0b} prefix) formats. \E @item \JP @code{その他} \EG @code{micellaneous} @* \BJP 多項式の係数を丸ごと F の元に変換するような場合, @code{simp_ff} により変換できる. \E \BEG @code{simp_ff} is available if one wants to convert the whole coefficients of a polynomial. \E @end itemize @item 8 \JP @b{位数 @var{p^n} の有限体の元} \EG @b{element of a finite field of characteristic @var{p^n}} \BJP 位数が @var{p^n} (@var{p} は任意の素数, @var{n} は正整数) は, 標数 @var{p} および GF(@var{p}) 上既約な @var{n} 次多項式 m(x) を @code{setmod_ff} により指定することにより設定する. この体の元は m(x) を法とする GF(@var{p}) 上の多項式として 表現される. \E \BEG A finite field of order @var{p^n}, where @var{p} is an arbitrary prime and @var{n} is a positive integer, is set by @code{setmod_ff} by specifying its characteristic @var{p} and an irreducible polynomial of degree @var{n} over GF(@var{p}). An element of this field is represented by a polynomial over GF(@var{p}) modulo m(x). \E @item 9 \JP @b{位数 @var{p^n} の有限体の元 (小位数)} \EG @b{element of a finite field of characteristic @var{p^n} (small order)} \BJP 位数が @var{p^n} の有限体 (@var{p^n} が @var{2^29} 以下, @var{p} が @var{2^14} 以上 なら @var{n} は 1) は, 標数 @var{p} および拡大次数 @var{n} を @code{setmod_ff} により指定することにより設定する. この体の 0 でない元は, @var{p} が @var{2^14} 未満の場合, GF(@var{p^n}) の乗法群の生成元を固定すること により, この元のべきとして表される. これにより, この体の 0 でない元 は, このべき指数として表現される. @var{p} が @var{2^14} 以上 の場合は通常の剰余による表現となるが, 共通のプログラムで 双方の場合を扱えるようにこのような仕様となっている. \E \BEG A finite field of order @var{p^n}, where @var{p^n} must be less than @var{2^29} and @var{n} must be equal to 1 if @var{p} is greater or equal to @var{2^14}, is set by @code{setmod_ff} by specifying its characteristic @var{p} the extension degree @var{n}. If @var{p} is less than @var{2^14}, each non-zero element of this field is a power of a fixed element, which is a generator of the multiplicative group of the field, and it is represented by its exponent. Otherwise, each element is represented by the redue modulo @var{p}. This specification is useful for treating both cases in a single program. \E @item 10 \JP @b{位数 @var{p^n} の小位数有限体の代数拡大の元} \EG @b{element of a finite field which is an algebraic extension of a small finite field of characteristic @var{p^n}} \BJP 前項の, 位数が @var{p^n} の小位数有限体の @var{m} 次拡大の元である. 標数 @var{p} および拡大次数 @var{n}, @var{m} を @code{setmod_ff} により指定することにより設定する. 基礎体上の @var{m} 次既約多項式が自動生成され, その代数拡大の生成元の定義多項式として用いられる. 生成元は @code{@@s} である. \E \BEG An extension field @var{K} of the small finite field @var{F} of order @var{p^n} is set by @code{setmod_ff} by specifying its characteristic @var{p} the extension degree @var{n} and @var{m}=[@var{K}:@var{F}]. An irreducible polynomial of degree @var{m} over @var{K} is automatically generated and used as the defining polynomial of the generator of the extension @var{K/F}. The generator is denoted by @code{@@s}. \E @item 11 \JP @b{分散表現の代数的数} \EG @b{algebraic number represented by a distributed polynomial} @* \JP @xref{代数的数に関する演算}. \EG @xref{Algebraic numbers}. \BJP \E \BEG \E @end table \BJP 小標数有限素体以外の有限体は @code{setmod_ff} で設定する. 有限体の元どうしの演算では, 一方が有理数の場合には, その有理数は自動的に現在設定されている 有限体の元に変換され, 演算が行われる. \E \BEG Finite fields other than small finite prime fields are set by @code{setmod_ff}. Elements of finite fields do not have informations about the modulus. Upon an arithmetic operation, i f one of the operands is a rational number, it is automatically converted into an element of the finite field currently set and the operation is done in the finite field. \E \BJP @node 不定元の型,,, 型 @section 不定元の型 \E \BEG @node Types of indeterminates,,, Data types @section Types of indeterminates \E @noindent \BJP 多項式の変数となり得る対象を@b{不定元}とよぶ. @b{Asir} では, 英小文字で始まり, 任意個のアルファベット, 数字, @samp{_} からなる文字列 を不定元として扱うが, その他にもシステムにより不定元として扱われるもの がいくつかある. @b{Asir} の内部形式としては, これらは全て多項式としての 型を持つが, 数と同様, 不定元の型により区別される. \E \BEG An algebraic object is recognized as an indeterminate when it can be a (so-called) variable in polynomials. An ordinary indeterminate is usually denoted by a string that start with a small alphabetical letter followed by an arbitrary number of alphabetical letters, digits or @samp{_}. In addition to such ordinary indeterminates, there are other kinds of indeterminates in a wider sense in @b{Asir}. Such indeterminates in the wider sense have type @b{polynomial}, and further are classified into sub-types of the type @b{indeterminate}. \E @table @code @item 0 \JP @b{一般不定元} \EG @b{ordinary indeterminate} @* \JP 英小文字で始まる文字列. 多項式の変数として最も普通に用いられる. \BEG An object of this sub-type is denoted by a string that start with a small alphabetical letter followed by an arbitrary number of alphabetical letters, digits or @samp{_}. This kind of indeterminates are most commonly used for variables of polynomials. \E @example [0] [vtype(a),vtype(aA_12)]; [0,0] @end example @item 1 \JP @b{未定係数} \EG @b{undetermined coefficient} @* \BJP @code{uc()} は, @samp{_} で始まる文字列を名前とする不定元を生成する. これらは, ユーザが入力できないというだけで, 一般不定元と変わらないが, ユーザが入力した不定元と衝突しないという性質を利用して未定係数の 自動生成などに用いることができる. \E \BEG The function @code{uc()} creates an indeterminate which is denoted by a string that begins with @samp{_}. Such an indeterminate cannot be directly input by its name. Other properties are the same as those of @b{ordinary indeterminate}. Therefore, it has a property that it cannot cause collision with the name of ordinary indeterminates input by the user. And this property is conveniently used to create undetermined coefficients dynamically by programs. \E @example [1] U=uc(); _0 [2] vtype(U); 1 @end example @item 2 \JP @b{函数形式} \EG @b{function form} @* \BJP 組み込み函数, ユーザ函数の呼び出しは, 評価されて何らかの @b{Asir} の 内部形式に変換されるが, @code{sin(x)}, @code{cos(x+1)} などは, 評価後 もそのままの形で存在する. これは函数形式と呼ばれ, それ自身が 1 つの 不定元として扱われる. またやや特殊な例として, 円周率 @code{@@pi} や 自然対数の底 @code{@@e} も函数形式として扱われる. \E \BEG A function call to a built-in function or to an user defined function is usually evaluated by @b{Asir} and retained in a proper internal form. Some expressions, however, will remain in the same form after evaluation. For example, @code{sin(x)} and @code{cos(x+1)} will remain as if they were not evaluated. These (unevaluated) forms are called `function forms' and are treated as if they are indeterminates in a wider sense. Also, special forms such as @code{@@pi} the ratio of circumference and diameter, and @code{@@e} Napier's number, will be treated as `function forms.' \E @example [3] V=sin(x); sin(x) [4] vtype(V); 2 [5] vars(V^2+V+1); [sin(x)] @end example @item 3 \JP @b{函数子} \EG @b{functor} @* \BJP 函数呼び出しは, @var{fname}(@var{args}) という形で行なわれるが, @var{fname} の 部分を函数子と呼ぶ. 函数子には, 函数の種類により組み込み函数子, ユーザ定義函数子, 初等函数子などがあるが, 函数子は単独で不定元として 機能する. \E \BEG A function call (or a function form) has a form @var{fname}(@var{args}). Here, @var{fname} alone is called a @b{functor}. There are several kinds of @b{functor}s: built-in functor, user defined functor and functor for the elementary functions. A functor alone is treated as an indeterminate in a wider sense. \E @example [6] vtype(sin); 3 @end example @end table