=================================================================== RCS file: /home/cvs/OpenXM/src/asir-doc/exp/exp-ja.texi,v retrieving revision 1.6 retrieving revision 1.16 diff -u -p -r1.6 -r1.16 --- OpenXM/src/asir-doc/exp/exp-ja.texi 2004/04/16 01:57:51 1.6 +++ OpenXM/src/asir-doc/exp/exp-ja.texi 2004/07/28 11:46:23 1.16 @@ -1,4 +1,4 @@ -%% $OpenXM: OpenXM/src/asir-doc/exp/exp-ja.texi,v 1.5 2004/03/27 05:58:50 takayama Exp $ +%% $OpenXM: OpenXM/src/asir-doc/exp/exp-ja.texi,v 1.15 2004/07/14 05:48:44 takayama Exp $ \input texinfo @iftex @catcode`@#=6 @@ -38,9 +38,9 @@ @title 実験的仕様の関数 @subtitle Risa/Asir 実験的仕様関数説明書 @subtitle 1.0 版 -@subtitle 2004 年 4 月 +@subtitle 2004 年 7 月 -@author by Risa/Asir comitters +@author by Risa/Asir committers @page @vskip 0pt plus 1filll Copyright @copyright{} Risa/Asir committers @@ -116,6 +116,15 @@ ChangeLog の項目は www.openxm.org の cvswe * dp_initial_term:: * dp_order:: * dp_weyl_gr_main:: +* list:: +* mapat:: +* set_print_function:: +* small_jacobi:: +* flatten_quote:: +* sprintf:: +* quote_to_funargs:: +* funargs_to_quote:: +* remove_paren:: @end menu @comment --- ◯◯◯◯ 関数 quotetotex, quotetotex_env の説明 ◯◯◯◯ @@ -454,15 +463,15 @@ Sugar strategy を適用するときの weight vector.  dp_gr_main $B$N?7$7$$%$%s%?%U%'!<%9$G$O=g=x$r$"$kJ8K!$K=>$$;XDj$9$k. @comment ~taka/this03/misc-2003/A2/dp @item 順序 order は次の文法で定義する. @{, @} は 0 回以上の繰り返しを意味する. -@verbatim +@example order : '[' orderElement { ',' orderElement } ']' orderElement : weightVec | builtinOrder weightVec : '[' weightElement { ',' weightElement } ']' builtiniOrder : '[' orderName ',' setOfVariables ']' weightElement : NUMBER | setOfVariables ',' NUMBER setOfVariables: V | range(V,V) - orderName : @grlex | @glex | @lex -@end verbatim + orderName : @@grlex | @@glex | @@lex +@end example ここで @code{V} は 変数名, @code{NUMBER} は整数をあわらす. 例1: @code{v=[x,y,z,u,v], order=[[x,10,y,5,z,1],[@@grlex,range(x,v)]]} は @code{x},@code{y},@code{z} がそれぞれ weight 10, 5, 1 をもつ @@ -517,11 +526,6 @@ Gr\"obner Deformations of Hypergeometric Differential [-y^4+y^2-1,x+y^3-y] @end example -@table @t -@item 参照 -@ref{xyz_abc} -@end table - @comment --- ChangeLog を書く. 動機. ソースコードの位置. 変更日時 など CVSサーバを見るため @noindent ChangeLog @@ -572,7 +576,7 @@ parse/parse.h 1.23--1.26 @itemize @bullet @item asir-port.sh は knoppix 専用である. -このコマンドは asir のバイナリおよび FFL で配布できない部分を +このコマンドは asir のバイナリおよび FLL で配布できない部分を ftp.math.kobe-u.ac.jp よりダウンロードして /home/knoppix/.asir-tmp へセーブして, 実行する. .asirrc および .TeXmacs/plugins/ox/progs/init-ox.scm もダウンロードする. @@ -726,13 +730,8 @@ Sugar strategy を適用するときの weight vector.  [1220] F=sm1.gkz([ [[1,1,1,1],[0,1,3,4]], [0,0]]); /* Command in asir-contrib*/ [[x4*dx4+x3*dx3+x2*dx2+x1*dx1,4*x4*dx4+3*x3*dx3+x2*dx2,-dx1*dx4+dx2*dx3,-dx2^2*dx4+dx1*dx3^2,dx1^2*dx3-dx2^3,-dx2*dx4^2+dx3^3],[x1,x2,x3,x4]] [1221] V=[x1,x2,x3,x4,dx1,dx2,dx3,dx4]$ -[1222] dp_weyl_gr_main(F | v=V, order=[[dx1,1,dx2,1,dx3,1,dx4,1]]); - -[ 0 0 0 0 1 1 1 1 ] -[ R R R R R R R R ] -internal error (SEGV) -return to toplevel - +[1222] dp_weyl_gr_main(F[0] | v=V, order=[[dx1,1,dx2,1,dx3,1,dx4,1]]); +... [1238] FF=map(dp_ptod,F[0],V); [(1)*<<1,0,0,0,1,0,0,0>>+(1)*<<0,1,0,0,0,1,0,0>>+(1)*<<0,0,1,0,0,0,1,0>>+(1)*<<0,0,0,1,0,0,0,1>>,(1)*<<0,1,0,0,0,1,0,0>>+(3)*<<0,0,1,0,0,0,1,0>>+(4)*<<0,0,0,1,0,0,0,1>>,0,0,0,0] @@ -741,11 +740,10 @@ return to toplevel dp_weyl_gr_main(FF | v=V, order=[[0,0,0,0,1,1,1,1]]); -[1246] dp_weyl_gr_main(F | v=V, order=[[dx1,1,dx2,1,dx3,1,dx4,1]]); +[1246] dp_weyl_gr_main(FF | v=V, order=[[dx1,1,dx2,1,dx3,1,dx4,1]]); [ 0 0 0 0 1 1 1 1 ] [ R R R R R R R R ] -internal error (SEGV) -return to toplevel + ... @end example @@ -890,6 +888,462 @@ builtin/dp-supp.c 1.32 builtin/dp.c 1.49 @end itemize + +@comment mapat +@node mapat,,, 実験的仕様の関数 +@subsection @code{mapat} +@findex mapat + +@table @t +@item mapat(@var{fname},@var{pos}[,@var{arg0}, @var{arg1}, ...]) +:: @var{pos} に対する map 関数 +@end table + +@table @var +@item return +オブジェクト +@item pos +整数 +@item arg0, arg1, arg2, ... +オブジェクト +@end table + +@itemize @bullet +@item +@code{map} 関数は 0 番目の引数に対してしか動作しないが, @code{mapat} +関数は指定した番号の引数に対して @code{map} 関数を実行する. +@item +@code{mapat(fname,0,A0,A1,...)} は +@code{map(fname,A0,A1,...)} に等価である. +@item +次の副作用がある. まだ書いてない. +@end itemize + +@example +[219] mapat(deg,1,x^2+y^3+x+y,[x,y]); +[2,3] +[220] mapat(subst,1,x+y+z,[x,y,z],2); +[y+z+2,x+z+2,x+y+2] +@end example + +@table @t +@item 参照 +@ref{map} +@end table + +@comment --- ChangeLog を書く. 動機. ソースコードの位置. 変更日時 など CVSサーバを見るため +@comment --- openxm の外部からの寄与も述べる. Credit. +@noindent +ChangeLog +@itemize @bullet +@item この関数は 2004-6-22 にコミットされた. + 変更をうけたソースコードは builtin/pf.c, subst.c である. +@end itemize + +@comment list +@node list,,, 実験的仕様の関数 +@subsection @code{list} +@findex list + +@table @t +@item list([@var{arg0}, @var{arg1}, ...]) +:: list を生成する. +@end table + +@table @var +@item return +リスト +@item arg0, arg1, arg2, ... +オブジェクト +@end table + +@itemize @bullet +@item +@var{arg0}, @var{arg1}, ... を要素とするリストを生成する. +@end itemize + +@example +[219] list(1,2,3); +[1,2,3] +[220] list(1,2,[3,4]); +[1,2,[3,4]] +@end example + +@table @t +@item 参照 +@ref{cons} +@end table + +@comment --- ChangeLog を書く. 動機. ソースコードの位置. 変更日時 など CVSサーバを見るため +@comment --- openxm の外部からの寄与も述べる. Credit. +@noindent +ChangeLog +@itemize @bullet +@item この関数は 2004-6-22 にコミットされた. + 変更をうけたソースコードは builtin/list.c である. +@end itemize + + +@node set_print_function,,, 実験的仕様の関数 +@subsection @code{set_print_function} +@findex set_print_function + +@comment --- 関数の簡単な説明 --- +@table @t +@item set_print_function([@var{fname}]) +:: 画面表示用の関数を登録 +@end table + +@table @var +@item return +整数 +@item fname +文字列 +@end table + +@itemize @bullet +@item +@code{set_print_function} は @code{fname(F)} を通常の画面表示関数の代わりによぶ. +@code 引数がない場合は画面表示関数をデフォールトへ戻す. +@code Asir-contrib はこの関数を用いて出力関数を Asir-contrib 用に変更している. +@end itemize + +@example +[219] def my_output(F) { + print("Out: ",0); print(rtostr(F)); + } +[220] set_print_function("my_output"); +Out: 0 +[221] 1+2; +Out: 3 +@end example + +@table @t +@item 参照 +@ref{rtostr} +@end table + +@noindent +ChangeLog +@itemize @bullet +@item この関数は 2001-9-4 に asir-contrib のために導入された. + 変更をうけたソースコードは builtin/print.c 1.11 である. +@end itemize + + +@node small_jacobi,,, 実験的仕様の関数 +@subsection @code{small_jacobi} +@findex small_jacobi + +@comment --- 関数の簡単な説明 --- +@table @t +@item small_jacobi(@var{a},@var{m}) +:: Jacobi 記号の計算 +@end table + +@table @var +@item return +整数 +@item arg1, arg2 +整数 +@end table + +@itemize @bullet +@item + @var{m} が素数のときは Legendre 記号とよばれ, + x^2 = @var{a} mod @var{m} に解があるとき 1, 解がないとき -1 をもどす. +@item +Jacobi 記号は Legendre 記号の積で定義される (初等整数論の本参照). +@item + この関数は machine int の範囲で jacobi 記号を計算する. +@end itemize + +@example +[1286] small_jacobi(2,3); +-1 +[1287] small_jacobi(2,7); +1 +@end example + +@table @t +@item 参照 +http://members.jcom.home.ne.jp/yokolabo/asirlib/ +も見てね. +@end table + +@comment --- ChangeLog を書く. 動機. ソースコードの位置. 変更日時 など CVSサーバを見るため +@noindent +ChangeLog +@itemize @bullet +@item この関数の由来は不明. +@end itemize + + +@node quote_flatten,,, 実験的仕様の関数 +@subsection @code{quote_flatten} +@findex quote_flatten + +@comment --- 関数の簡単な説明 --- +@table @t +@item quote_flatten(@var{q},@var{op}) +:: quote の括弧をとりさる. +@end table + +@table @var +@item return +Quote +@item q +Quote +@item op +演算子を表す文字列. +@end table + +@itemize @bullet +@item +Quote 型のデータは木構造をしている +( quotetolist 参照 ). +@code{quote_flatten()} は, @var{q} の中にあられる演算子 @var{op} +の子供ノードを平等にする. +つまり演算子 @var{op} に関する括弧づけがあった場合それをすべてとりさる. +たとえば (1+2)+(3+4) という表現を 1+2+3+4 に変換する. +@item + 現在の実装では n-ary の演算子は定義されていないので, + 1+2+3 は実は (1+2)+3 と表現されている. + つまり + 演算子は左結合的である. +@end itemize + +@example +[1288] flatten_quote(quote((1+2)+(3+4*(x+3))),"+"); +quote(1+2+3+4*(x+3)) +[1289] flatten_quote(quote( (x*y)*(p*3)-(x*y)*z),"*"); +quote(x*y*p*3-x*y*z) +[1290] quotetolist(quote(1+2+3)); +[b_op,+,[b_op,+,[internal,1],[internal,2]],[internal,3]] +@end example + +@table @t +@item 参照 +@ref{quotetolist}, @ref{print_tex_form}(contrib) +@end table + +@comment --- ChangeLog を書く. 動機. ソースコードの位置. 変更日時 など CVSサーバを見るため +@noindent +ChangeLog +@itemize @bullet +@item + この関数は 2004-7-7 から 2004-7-8 にかけて + quote に関する操作を研究するために実験的に書かれた. + OpenXM/fb で蓄積された公式の不要な括弧をとりはずし, tex 形式に変換するのに + 応用. +@item + 変更をうけたソースコードは + builtin/strobj.c 1.47, + parse/eval.c 1.35, + parse/parse.h 1.31, + parse/quote.c 1.14--1.16. +@end itemize + +@node assoc,,, 実験的仕様の関数 +@subsection @code{assoc} +@findex assoc + +@comment --- 関数の簡単な説明 --- +@table @t +@item assoc(@var{a},@var{b}) +:: 連想リストをつくる +@end table + +@table @var +@item return +List +@item a +List +@item b +List +@end table + +@itemize @bullet +@item リスト @var{a}, @var{b} より +[[@var{a}[0],@var{b}[0]], [@var{a}[1],@var{b}[1]], ...] +なる新しいリストを生成する. +@end itemize + +下の例では @code{A} に動物の名前が, +@code{B} に足の本数が入っている. +@code{assoc(A,B)} で動物と足の本数をペアにしたリストを生成する. + +@example +[1192] A=["dog","cat","snake"]; +[dog,cat,snake] +[1193] B=[4,4,0]; +[4,4,0] +[1194] assoc(A,B); +[[dog,4],[cat,4],[snake,0]] +@end example + +@table @t +@item 参照 +@ref{cons}, @ref{append} +@end table + +@comment --- ChangeLog を書く. 動機. ソースコードの位置. 変更日時 など CVSサーバを見るため +@noindent +ChangeLog +@itemize @bullet +@item + この関数は 2004-6-28 に書かれた. + 変更をうけたソースコードは + builtin/list.c 1.9 + parse/eval.c 1.35, + parse/parse.h 1.31, + parse/quote.c 1.14--1.16. +@end itemize + + +@node sprintf,,, 実験的仕様の関数 +@subsection @code{sprintf} +@findex sprintf + +@table @t +@item sprintf(@var{format}[,@var{args}]) +:: C に似たプリント関数 +@end table + +@table @var +@item return +文字列 +@item format +文字列 +@item args +オブジェクト +@end table + +@itemize @bullet +@item +フォーマット文字列 @var{format } にしたがい @var{args} を文字列に変換する. +@item +フォーマット文字列の中に @code{%a} (any) が利用可能. +@var{args} の個数はフォーマット文字列の中の @code{%a} の個数に等しくすること. +@end itemize + +@example +[0] sprintf("%a: rat = %a",10,x^2-1); + 10: rat = x^2-1 +@end example + +@table @t +@item 参照 +@ref{rtostr} +@end table + +@comment --- ChangeLog を書く. 動機. ソースコードの位置. 変更日時 など CVSサーバを見るため +@comment --- openxm の外部からの寄与も述べる. Credit. +@noindent +ChangeLog +@itemize @bullet +@item + この関数は 2004-7-13 にコミットされた. + 変更をうけたソースコードは builtin/strobj (1.50) である. +@item + @code{%a} は Maple の sprintf の真似か. +@end itemize + + +@node quote_to_funargs,,, 実験的仕様の関数 +@subsection @code{quote_to_funargs}, @code{funargs_to_quote}, @code{remove_paren} +@findex quote_to_funargs +@findex funargs_to_quote +@findex remove_paren + +@table @t +@item quote_to_funargs(@var{q}) +:: quote を funarg 形式(リスト) へ. +@item funargs_to_quote(@var{f}) +:: funarg 形式を quote へ. +@item remove_paren(@var{q}) +:: 上の関数を用いて書かれた余分な括弧を取り去る simplifier (asir-contrib マニュアルへ: todo) +@end table + +@table @var +@item return +quote(funargs_to_quote, remove_paren) か リスト(quote_to_funargs) +@item q +quote +@item f +リスト +@end table + +@itemize @bullet +@item + @code{quote_to_funargs} は quote 型のデータ (内部的には FNODE) を +quote への復元可能な形でリストへ変換する. +@code{quotetolist} は quote をリストへ変換するが, 一部の情報を捨てるため +もとの quote の復元はできない. +@item + @code{quote_to_funargs} の戻り値は [fid, op, arg1, arg2] なる形式をしている. +ここで op はなにか謎 (Todo) +@item + 下の例で + quote_to_funargs(FA[2]); +[34,[b_op,+,[internal,x],[internal,1]]] +となるが, この 34 も謎 (Todo). +@end itemize + +次の例では (x+1)+(x+2) の括弧をはずして x+1+x+2 に変換している. +@example +[0] ctrl("print_quote",1) $ + +[1] Q=quote((x+1)+(x+2)); +[b_op,+,[u_op,(),[b_op,+,[internal,x],[internal,1]]], + [u_op,(),[b_op,+,[internal,x],[internal,2]]]] + +[2] FA=quote_to_funargs(Q); +[0,<...quoted...>, + [u_op,(),[b_op,+,[internal,x],[internal,1]]], + [u_op,(),[b_op,+,[internal,x],[internal,2]]]] + +[3] FA2=quote_to_funargs(FA[2])[1]; +[b_op,+,[internal,x],[internal,1]] + +[4] FA3=quote_to_funargs(FA[3])[1]; +[b_op,+,[internal,x],[internal,2]] + +[5] funargs_to_quote([FA[0],FA[1],FA2,FA3]); +[b_op,+,[b_op,+,[internal,x],[internal,1]], + [b_op,+,[internal,x],[internal,2]]] +@end example + +次の例は OpenXM/asir-contrib 版の asir で実行. +@example +[1287] load("noro_simplify.rr"); +1 +[1293] noro_simplify.remove_paren(quote( f(1-(x)))); +quote(f(1-x)) +@end example + +@table @t +@item 参照 +@ref{quotetolist} +@end table + +@noindent +ChangeLog +@itemize @bullet +@item + このマニュアルは覚え書きである. 開発者が本格的なのを書くだろう. +@item + これらの関数は 2004-7-8 から開発のはじまっている quote の simplification 関連 + の実験的関数である. + 変更をうけたソースコードは多岐にわたるのでまだ書かない. +@item + 括弧を取り去る問題は OpenXM/fb が蓄えている公式を tex で綺麗に表示するのが動機の一つ. +@item + 2004-6-26 の計算代数セミナーにおいて, 中川さんが simplifier についていろいろ問題提起 +をした (計算代数セミナービデオ参照). +@end itemize + +@comment --- ◯◯◯◯ 以下他の関数について真似して記述する. ◯◯◯◯ + @comment 新しい関数の説明を書くためのテンプレートである. 消すな. @comment --- ◯◯◯◯ 関数 syz_pqr, xyz_stu の説明 ◯◯◯◯ @comment --- 複数の関数をまとめて説明する例 --- @@ -950,11 +1404,6 @@ ChangeLog 変更をうけたソースコードは xxxyy.rr, ppp.c である. @item この関数は 2000 頃にはじめてのバージョンが書かれた. ソースは ppp.c である. @end itemize - - - -@comment --- ◯◯◯◯ 以下他の関数について真似して記述する. ◯◯◯◯ - @comment --- おまじない --- @node Index,,, Top