[BACK]Return to usage.c CVS log [TXT][DIR] Up to [local] / OpenXM / src / kan96xx / Kan

Annotation of OpenXM/src/kan96xx/Kan/usage.c, Revision 1.28

1.28    ! takayama    1: /* $OpenXM: OpenXM/src/kan96xx/Kan/usage.c,v 1.27 2003/12/03 09:00:46 takayama Exp $ */
1.1       maekawa     2: #include <stdio.h>
                      3: #include "datatype.h"
                      4: #include "stackm.h"
                      5: #include "extern.h"
                      6:
                      7: /* A list of undocumented commands for debugging.
                      8:
                      9:   (red@) (debug) switch_function
                     10: */
                     11:
                     12: void Kusage(ob)
1.7       takayama   13:      struct object ob;
1.1       maekawa    14: {
                     15:   char *s;
                     16:   printf("\n");
                     17:   if (ob.tag != Sdollar) {
                     18:     printf("Type in ? in order to see system dictionary.\n");
                     19:     printf("$keyword$ usage  ; \n");
                     20:   }else {
                     21:     s = ob.lc.str;
                     22:     Kusage2(stdout,s);
                     23:   }
                     24:
                     25: }
                     26:
                     27: #define fppp fprintf
                     28:
                     29: void Kusage2(fp,s)
1.7       takayama   30:      FILE *fp;
                     31:      char *s;
1.1       maekawa    32: {
                     33:   /*int n,i; fprintf(stderr,"\n%d: ",strlen(s));
1.7       takayama   34:     for (i=0; i<strlen(s); i++) fprintf(stderr," %x",s[i]);*/
1.1       maekawa    35:   if (strcmp(s,"add")==0) {
                     36:     fppp(fp,"<< obj1 obj2 add obj3 >>\n");
                     37:     fppp(fp,"obj3 is the sum of obj1 and obj2.\n");
                     38:     fppp(fp,"If obj1=f1/f2, obj2=g1/g2, then obj3 is given by (g2 f1 + f2 g1)/(f2 g2)\n");
                     39:     fppp(fp,"Example:  2 3 add ::  ==> 5\n");
                     40:   } else if (strcmp(s,"[")==0 || strcmp(s,"]")==0) {
                     41:     fppp(fp,"[ and ] are used to construct an array.\n");
                     42:     fppp(fp,"The left bracket [ is an operator that leaves an object called\n");
                     43:     fppp(fp,"a mark on the stack. The interpreter puts more objects\n");
                     44:     fppp(fp,"until it encounters a right bracket, which creates\n");
                     45:     fppp(fp,"an array. So, it is possible to construct an array, for example, in the way\n");
                     46:     fppp(fp," [  1  2  [ 2 1 roll 3] ] print ==> [1 [2 3]]\n");
                     47:   } else if (strcmp(s,"aload")==0) {
                     48:     fppp(fp,"<< [f1 f2 ... fn] aload f1 f2 ... fn [f1 ... fn] >>\n");
                     49:     fppp(fp,"The primitive aload decomposes an array into the set of the elements.\n");
                     50:     fppp(fp,"Example: [(x1+1) (23)] aload length ===> (x1+1) (23) 2\n");
                     51:   }else if (strcmp(s,"lt")==0 || strcmp(s,"gt")==0 || strcmp(s,"eq")==0) {
                     52:     fppp(fp,"<< o1 o2 lt r1  >> or  <<  o1 o2 gt r1 >> or <<  o1 o2 gt r1 >>\n");
                     53:     fppp(fp,"integer r1;\n");
                     54:     fppp(fp,"These premitives compare objects o1 and o2.\n");
                     55:     fppp(fp,"[lt (less than), gt (greater than), eq (equal)]\n");
                     56:     fppp(fp,"The result is r1 which is integer object.\n");
                     57:     fppp(fp,"Here, 1 means true and 0 means false.\n");
                     58:     fppp(fp,"Example:  (abc) (bca) eq ::  ===> 0\n");
                     59:   }else if (strcmp(s,"bye")==0 || strcmp(s,"QUIT")==0 || strcmp(s,"quit")==0) {
                     60:     fppp(fp,"The bye or QUIT or quit statement terminates the kan/sm1.\n");
                     61:   }else if (strcmp(s,"cat_n")==0) {
                     62:     fppp(fp,"<< s1 s2 ... sn n cat_n s1s2...sn >>\n");
                     63:     fppp(fp,"string s1, s2, ..., sn ; integer n ; string s1s2...sn\n");
                     64:     fppp(fp,"The primitive cat_n concatnates the strings(dollars) s1 ... sn.\n");
                     65:     fppp(fp,"Example: (ab c) (2) 2 cat_n ===> (ab c2)\n"); /*\hrule*/
                     66:   }else if (strcmp(s,"cclass") == 0) {
                     67:     fppp(fp,"<< [super-class-tag, o1, o2, ...] size [class-tag] cclass [class-tag, o1, o2, .... ] >>\n");
                     68:   }else if (strcmp(s,"closefile")==0) {
                     69:     fppp(fp,"<< fd closefile >>\n");
                     70:     fppp(fp,"file fd;\n");
1.24      takayama   71:     fppp(fp,"cf. file (open a file)\n");
1.1       maekawa    72:   }else if (strcmp(s,"coefficients")==0 || strcmp(s,"coeff")==0) {
                     73:     fppp(fp,"<< f v coeff [exponents coefficients] >>\n");
                     74:     fppp(fp,"poly f,v; list of integers exponents; list of poly coefficients;\n");
                     75:     fppp(fp,"The primitive coeff returns the array of exponents and\n");
                     76:     fppp(fp,"the array of coefficients of the polynomial f with respect to\n");
                     77:     fppp(fp,"the variable v.\n");
                     78:     fppp(fp,"The primitive coefficients have not yet removed for a compatibility with the old macro packages.\n");
                     79:     fppp(fp,"Note that the data type of each element of exponents is <Poly>(9) and it may cause a trouble when p>0.\n");
                     80:     fppp(fp,"cf. dc,  (interger) dc\n");
                     81:     fppp(fp,"C-functions: Kparts2, parts2\n");
                     82:     fppp(fp,"Example: [(x,y) ring_of_polynomials [[(x) 1 (y) 1]] weight_vector\n");
                     83:     fppp(fp,"           0] define_ring\n");
                     84:     fppp(fp,"         (x^2+ x y + x). (x). coeff print ;\n");
                     85:     fppp(fp,"  ===>  [ [ 2 , 1 ] , [1 , y+1] ]\n");
                     86:   }else if (strcmp(s,"copy")==0) {
                     87:     fppp(fp,"<< f1 f2 ... fn n copy f1 f2 ... fn f1 f2 ... fn >>\n");
                     88:     fppp(fp,"The primitive copy_n duplicates the objects f1 f2 ... fn.\n");
                     89:     fppp(fp,"integer n;\n");
                     90:     fppp(fp,"Example: (x1+1) 1 copy ===> (x1+1) (x1+1)\n");
                     91:     fppp(fp,"<<copy>> copies the values of the objects.  cf. dup\n");
                     92:   }else if (strcmp(s,"data_conversion")==0) {
                     93:     fppp(fp,"<< obj (type?) data_conversion type >>\n");
                     94:     fppp(fp,"<< obj (type??) data_conversion type >>\n");
                     95:     fppp(fp,"<< obj (key word) data_conversion obj >>\n");
                     96:     fppp(fp,"integer type; object obj;\n");
                     97:     fppp(fp,"Key words: null, integer, literal, dollar, string, poly, universalNumber,\n");
                     98:     fppp(fp,"           ring, numerator, denominator, double, cancel,\n");
                     99:     fppp(fp,"           map, orderMatrix, error, \n");
                    100:     fppp(fp," or [(class) (class-name)].\n");
                    101:     fppp(fp,"The primitive reports and converts the data type of obj.\n");
1.28    ! takayama  102:     fppp(fp,"Special combinations of obj and keyword.\n");
        !           103:     fppp(fp,"   ring (oxRingStructure) data_conversion list\n");
1.1       maekawa   104:     fppp(fp,"Example: (2) (integer) data_conversion ===> 2\n");
                    105:   }else if (strcmp(s,"def")==0 || strcmp(s,"set")==0) {
                    106:     fppp(fp,"<< /name object def >>  or  << object /name set >>\n");
                    107:     fppp(fp,"The primitive def or set binds the object to the name\n");
                    108:     fppp(fp,"Example: /abc (23) def    abc :: ---> (23)\n");
                    109:     fppp(fp,"Example: (23) /abc set    abc :: ---> (23)\n");
                    110:   }else if (strcmp(s,"degree")==0) {
                    111:     fppp(fp,"<< f  v  degree  deg >>\n");
                    112:     fppp(fp,"poly f,v; integer deg;\n");
                    113:     fppp(fp,"deg is the degree of the polynomial f with respect to the variable v.\n");
                    114:     fppp(fp,"Example: (x^3 + x h + 1).  (x).  degree :: ---> 3\n");
                    115:   }else if (strcmp(s,"div") == 0) {
                    116:     fppp(fp,"<< obj1  obj2 div obj3 >>\n");
                    117:     fppp(fp,"obj3 is obj1/obj2\n");
                    118:     fppp(fp,"cf. data_conversion (numerator, denominator, cancel)\n");
                    119:   }else if (strcmp(s,"dup") == 0) {
                    120:     fppp(fp,"<< obj dup obj obj >>\n");
                    121:     fppp(fp,"cf. 1 copy. Dup copies the object by the pointer.\n");
                    122:   }else if (strcmp(s,"elimination_order")==0) {
                    123:     fppp(fp,"<< (v1,...,vm) elimination_order >>\n");
                    124:     fppp(fp,"The primitive returns the weight matrix where the variables\n");
                    125:     fppp(fp,"v1, ..., vm are most expensive terms.\n");
                    126:     fppp(fp,"cf. define_ring, define_qring.\n");
                    127:   }else if (strcmp(s,"error")==0) {
                    128:     fppp(fp,"<<error>> causes kan/sm1 error.\n");
                    129:     fppp(fp,"<< s error >>   string s;\n");
                    130:     fppp(fp,"s is printed as the error message.\n");
                    131:   }else if (strcmp(s,"eval")==0) {
                    132:     fppp(fp,"<< [$key$ arguments] eval >>\n");
                    133:     fppp(fp,"key :   \n");
                    134:   }else if (strcmp(s,"exec")==0) {
                    135:     fppp(fp,"<< { executable array } exec >>\n");
                    136:     fppp(fp,"The primitive exec executes each primitive in the executable\n");
                    137:     fppp(fp,"array sequentially.\n");
                    138:     fppp(fp,"Example: {1 2 add print pop} exec ;\n");
                    139:     fppp(fp,"    ===> 3\n");
                    140:   }else if (strcmp(s,"extension")==0) {
                    141:     fppp(fp,"<< obj1 extension obj2 >>\n");
                    142:     fppp(fp,"array of object obj1; object obj2; \n");
                    143:     fppp(fp,"The first element of the obj1 should be the key word tag.\n");
                    144:     fppp(fp,"<< extension >> is used to install a new function to a system. cf.ext.c and plugin/\n");
                    145:     fppp(fp,"  [(parse) string] extension result-integer \n");
                    146:     fppp(fp,"  [(chattr) num literal] extension result-object \n");
                    147:     fppp(fp,"  [(chattrs) num ] extension result-object \n");
                    148:     fppp(fp,"  [(defaultPolyRing) num ] extension result-object \n");
                    149:     fppp(fp,"  [(flush) ] extension null \n");
                    150:     fppp(fp,"  [(getpid) ] extension result-integer \n");
                    151:     fppp(fp,"  [(getenv) envName] extension valueOfEnvName \n");
                    152:     fppp(fp,"  [(stat) fname] extension v \n");
1.5       takayama  153:     fppp(fp,"       v = [null,[(error no), p]] or [0, [size ]]\n");
1.1       maekawa   154:     fppp(fp,"  [(forkExec) argList fdList sigblock] extension pid\n");
                    155:     fppp(fp,"  [(getchild)] extension listOfPid (generated by forkExec)\n");
                    156:     fppp(fp,"  [(keywords) ] extension array-of-names-of-primitives \n");
1.11      takayama  157:     fppp(fp,"  [(nobody) ] extension null \n");
1.22      takayama  158:     fppp(fp,"  [(newMatrix) m n] extension mat \n");
                    159:     fppp(fp,"  [(newVector) m ] extension vec \n");
1.1       maekawa   160:     fppp(fp,"  [(getUniqueFileName) path] extension newName \n");
                    161:     fppp(fp,"  [(outputObjectToFile) path obj] extension null \n");
1.8       takayama  162:     fppp(fp,"  [(ostype)] extension list \n");
1.9       takayama  163:     fppp(fp,"  [(regionMatches) string stringArray] extension list \n");
1.1       maekawa   164:     /* fppp(fp,"  [(asir0) string] extension result-object \n"); */
                    165:     fppp(fp,"See also plugin-* in ??. \n");
                    166:   }else if (strcmp(s,"file")==0) {
                    167:     fppp(fp,"<< filename mode file fd >>\n");
                    168:     fppp(fp,"string filename, mode; file fd;\n");
                    169:     fppp(fp,"It opens the <<filename>> with the <<mode>>. <<fd>> is the\n");
                    170:     fppp(fp,"file descripter and is used in writestring and closefile.\n");
                    171:     fppp(fp,"If filename part is an integer, it calls fdopen() and returns the file descripter.\n");
1.24      takayama  172:     fppp(fp,"cf. closefile, writestring, pushfile \n");
1.1       maekawa   173:   }else if (strcmp(s,"for")==0) {
                    174:     fppp(fp,"<<init inc limit {executable array} for >>\n");
                    175:     fppp(fp,"integer init inc limit;\n");
                    176:     fppp(fp,"Repeat the executable array.\n");
                    177:     fppp(fp,"Example: [ 1 1 3 {(a)} for] ::---> [1 (a) 2 (a) 3 (a)]\n");
                    178:   }else if (strcmp(s,"gbext")==0) {
                    179:     fppp(fp,"<< obj1 gbext obj2 >>\n");
                    180:     fppp(fp,"array of objects obj1;");
                    181:     fppp(fp,"The first element of the obj1 should be the key word tag.\n");
                    182:     fppp(fp,"<< gbext >> is used to call auxiliary functions for g-basis computation. \n");
                    183:     fppp(fp,"  [(isReducible) poly1 poly2 ] gbext integer \n");
                    184:     fppp(fp,"  [(lcm) poly1 poly2] gbext poly \n");
                    185:     fppp(fp,"  [(grade) poly1 ] gbext integer \n");
1.19      takayama  186:     fppp(fp,"  [(ord_ws_all) fv wv] gbext integer \n");
1.1       maekawa   187:     fppp(fp,"  [(mod) poly1 universalNumber] gbext poly \n");
                    188:     fppp(fp,"          poly = poly1 mod universalNumber where char=0 and \n");
                    189:     fppp(fp,"          poly and poly2 belong to a same ring.\n");
                    190:     fppp(fp,"  [(tomodp) poly1 ring] gbext poly, char(ring)>0. \n");
                    191:     fppp(fp,"          poly = poly1 mod char(ring) where poly belongs to ring.\n");
                    192:     fppp(fp,"  [(tomod0) poly1 ring] gbext poly, char(ring)=0. \n");
                    193:     fppp(fp,"  [(divByN) poly1 n(universalNumber)] gbext [qpoly rpoly] \n");
                    194:     fppp(fp,"     where poly1 = n*qpoly+rpoly.\n");
                    195:     fppp(fp,"     (see also cancelCoeff) \n");
                    196:     fppp(fp,"  [(isConstant) poly] gbext bool \n");
1.22      takayama  197:     fppp(fp,"  [(isConstantAll) poly] gbext bool \n");
1.1       maekawa   198:     fppp(fp,"  [(lcoeff) poly] gbext poly \n");
                    199:     fppp(fp,"  [(lmonom) poly] gbext poly \n");
                    200:     fppp(fp,"  [(schreyerSkelton) array_of_poly] gbext array \n");
                    201:     fppp(fp,"  [(toes) array_of_poly] gbext poly \n");
1.6       takayama  202:     fppp(fp,"  [(toe_) poly] gbext poly   \n");
                    203:     fppp(fp,"  [(toe_) array_of_poly] gbext poly   cf. toVectors \n");
1.1       maekawa   204:     fppp(fp,"  [(isOrdered) poly] gbext poly \n");
1.15      takayama  205:     fppp(fp,"  [(reduceContent) poly] gbext [poly c] \n");
1.1       maekawa   206:   }else if (strcmp(s,"get")==0) {
                    207:     fppp(fp,"<< [f0 f1 ... fn] k get fk >>\n");
                    208:     fppp(fp,"integer k;");
                    209:     fppp(fp,"The primitive gets the k-th element of a given array.\n");
                    210:     fppp(fp,"Example: [1 4 3] 1 get :: ---> 4\n");
                    211:   }else if (strcmp(s,"goto")==0) {
                    212:     fppp(fp,"<< label goto >>\n");
                    213:     fppp(fp,"literal label;\n");
                    214:     fppp(fp,"Break the loops and jump to the <<literal>>.\n");
                    215:     fppp(fp,"The label <<literal>> has to be out of all the loops.\n");
                    216:     fppp(fp,"You cannot jump inside of the executable array { .... }.\n");
                    217:     fppp(fp,"Example: /point goto (skip me) message /point \n");
                    218:   }else if (strcmp(s,"groebner")==0) {
                    219:     fppp(fp,"<< [[f1 ... fn] [options]] groebner \n");
                    220:     fppp(fp,"   [[g1 ... gm] backward-transformation syzygy]>>\n");
                    221:     fppp(fp,"poly f1, ..., fn; poly g1, ..., gm;\n");
                    222:     fppp(fp,"optional return value: matrix of poly backward-transformation, syzygy;\n");
                    223:     fppp(fp,"Computation of the Groebner basis of f1,...,fn. The basis is {g1,...,gm}.\n");
                    224:     fppp(fp,"Options:  << (needBack), (needSyz), (countDown) number (StopDegree) number, (forceReduction)>>\n");
                    225:     fppp(fp,"Flags:<< [(ReduceLowerTerms) 1] system_variable >>\n");
                    226:     fppp(fp,"      << [(UseCriterion1) 0]    system_variable >>\n");
                    227:     fppp(fp,"      << [(UseCriterion2B) 0]   system_variable >>\n");
                    228:     fppp(fp,"      << [(Sugar) 0]            system_variable >>\n");
                    229:     fppp(fp,"      << [(Homogenize) 1]       system_variable >>\n");
                    230:     fppp(fp,"      << [(CheckHomogenization) 1] system_variable >>\n");
                    231:     fppp(fp,"      << [(Statistics) 1]       system_variable >>\n");
                    232:     fppp(fp,"      << [(KanGBmessage) 1]     system_variable >>\n");
                    233:     fppp(fp,"      << [(Verbose) 0]          system_variable >>\n");
                    234:     fppp(fp,"Example: [(x0,x1) ring_of_polynomials 0] define_ring\n");
                    235:     fppp(fp,"         [(x0^2+x1^2-h^2). (x0 x1 -4 h^2).] /ff set ;\n");
                    236:     fppp(fp,"         [ff] groebner /gg set ;\n");
                    237:     fppp(fp,"         gg ::\n");
                    238:     fppp(fp,"cf. homogenize, groebner_sugar, define_ring, \n");
                    239:     fppp(fp,"    ring_of_polynomials, ring_of_differential_operators.\n");
                    240:   }else if (strcmp(s,"homogenize") == 0) {
                    241:     fppp(fp,"<< f homogenize g >>\n");
                    242:     fppp(fp,"poly f,g;\n");
1.20      takayama  243:     fppp(fp,"array of poly f,g;\n\n");
                    244:        fppp(fp,"[(degreeShift) (value)] homogenize [shiftD shiftUV]\n");
                    245:        fppp(fp,"[(degreeShift) (reset)] homogenize [null null]\n");
                    246:        fppp(fp,"[(degreeShift) shiftD ] homogenize [shiftD shiftUV]\n");
                    247:        fppp(fp,"[(degreeShift) [shiftD shiftUV]] homogenize [shiftD shiftUV]\n");
                    248:        fppp(fp,"[(degreeShift) [ ]     fv] homogenize   hfv\n");
                    249:        fppp(fp,"[(degreeShift) shiftD  fv] homogenize   hfv\n");
                    250:        fppp(fp,"[(degreeShift) [shiftD shiftUV] fv] homogenize hfv\n");
                    251:     fppp(fp,"shiftD : degree shift vector for (0,1)-h homogenization\n");
                    252:     fppp(fp,"shiftUV : degree shift vector for (-1,1)-s homogenization (internal for ecart.)\n");
                    253:     fppp(fp,"fv : polynomial or vector of polynomials.\n");
                    254:     fppp(fp,"Example:  [(x) ring_of_differential_operators 0] define_ring\n");
                    255:        fppp(fp,"   [(degreeShift) [[1 0] [0 1]] [(x+1). (Dx+1).]] homogenize ::\n");
                    256:        fppp(fp,"   [(degreeShift) (value)] homogenize ::\n");
                    257:        fppp(fp,"Note. min of ord (-1,1)[0,1] is min {-1,1, 1+1,1+0} = -1 =m \n");
                    258:     fppp(fp,"      Degree of H is b-a+v(i)-m where v=[0,1]\n");
1.21      takayama  259:     fppp(fp,"Side effects:  It changes h-degree shift vector and s-degree shift vector\n");
                    260:        fppp(fp,"   in homogenizeObject_go(), which is called from ecart division codes\n");
                    261:     fppp(fp,"   as well as the function homogenize.\n");
1.20      takayama  262:     fppp(fp,"DegreeShift is automatically reset when set_up_ring is called.\n");
1.1       maekawa   263:   }else if (strcmp(s,"idiv") == 0) {
                    264:     fppp(fp,"<< a b idiv a/b >>\n");
                    265:     fppp(fp,"int a,b,a/b;\n");
                    266:     fppp(fp,"Example:  5 2 idiv ::  ===> 2\n");
                    267:   }else if (strcmp(s,"ifelse") == 0) {
                    268:     fppp(fp,"<< condition { true case } { false case } ifelse >>\n"); /*:*/
1.7       takayama  269:     /* Tenuki mark --------------^ */
1.1       maekawa   270:     fppp(fp,"integer condition;\n");
                    271:     fppp(fp,"If condition is non-zero, then true-case will be executed,\n");
                    272:     fppp(fp,"else false-case will be executed.\n");
                    273:   }else if (strcmp(s,"index") == 0) {
                    274:     fppp(fp,"<<  a_0 ... a_{n-1} n index a_0 ... a_{n-1} a_0 >>\n");/*:*/
                    275:     fppp(fp,"integer n; \n");
                    276:     fppp(fp,"It takes a_0 from the stack.\n");
                    277:   }else if (strcmp(s,"init")==0) {
                    278:     fppp(fp,"<< f init h >>\n");
                    279:     fppp(fp,"<< f weight_vector init h >>\n");
                    280:     fppp(fp,"poly f,h; array of integer weight_vector;\n");
                    281:     fppp(fp,"h is the initial term of the polynomial f.\n");
                    282:     fppp(fp,"Example: (2 x^3 + 3 x + 1). init :: ---> 2 x^3\n");
                    283:     fppp(fp,"Example: [(x^3+1). (x h+ h^5).] {init} map ::\n");
1.18      takayama  284:     fppp(fp,"Example: (x+1). [0 1 1 1] init ::    cf. weightv \n\n");
                    285:     fppp(fp,"<< fv weight_vector init h >>\n");
                    286:     fppp(fp,"<< fv [weight_vector shift_vector] init h >>\n");
1.19      takayama  287:     fppp(fp,"<< fv init h >> or << hv [ ] init h >>\n");
1.18      takayama  288:     fppp(fp,"fv is a polynomial or a vector of polynomials.\n");
1.19      takayama  289:     fppp(fp,"h is the initial term with respect to the weight vector and the shift vector\n");
                    290:     fppp(fp,"if they are given.\n");
1.18      takayama  291:     fppp(fp,"Note: the last x variable is always assumed to be the vector index.\n");
                    292:     fppp(fp,"Example: [(x,y) ring_of_differential_operators 0] define_ring\n");
                    293:        fppp(fp,"    [(x^2*Dx^2+2*x*Dx+x). (Dx+x).] [[(Dx) 1 (x) -1] weightv [0 -1]] init ::\n");
1.1       maekawa   294:   }else if (strcmp(s,"lc")==0) {
                    295:     fppp(fp,"<< obj lc leftCell >>\n");
                    296:     fppp(fp,"class leftCell;\n");
                    297:     fppp(fp,"leftCell is the left cell of the obj of which type must be class.\n");
                    298:   }else if (strcmp(s,"length")==0) {
                    299:     fppp(fp,"<< [a0 a1 ... an] length <n+1> >>\n");
                    300:     fppp(fp,"<< s length p >>\n");
                    301:     fppp(fp,"integer <n+1>; integer p; string s;\n");
                    302:     fppp(fp,"It returns the length of the argument. p is the length of the string.\n");
                    303:   }else if (strcmp(s,"load")==0) {
                    304:     fppp(fp,"<< /literal load obj >>\n");
                    305:     fppp(fp,"<<load>> gets the value of <<literal>>.\n");
                    306:   }else if (strcmp(s,"loop") == 0) {
                    307:     fppp(fp,"<< {executable array} loop >>\n"); /*:*/
                    308:     fppp(fp,"cf. exit\n");
                    309:   }else if (strcmp(s,"map")==0) {
                    310:     fppp(fp,"<< [f1 ... fn] {code} map [f1 {code}exec ... fn {code}exec] >>\n");
                    311:     fppp(fp,"map applies {code} to each element in [f1 ... fn].\n");
                    312:     fppp(fp,"Example: [1 2 3] {1 add} map ===> [2 3 4]\n");
                    313:   }else if (strcmp(s,"mpzext") == 0) {
                    314:     fppp(fp,"[(key) arguments] mpzext ans\n"); /*:*/
                    315:     fppp(fp,"It calls mpz functions.\n");
                    316:     fppp(fp,"arguments should be numbers(universalNumber).\n");
                    317:     fppp(fp,"Keys: gcd, tdiv_qr, cancel, powm, probab_prim_p, sqrt, and, ior, com\n");
                    318:     fppp(fp,"For details, see gmp-2.0.2/texinfo.tex.\n");
                    319:   }else if (strcmp(s,"mul") ==0) {
                    320:     fppp(fp,"obj1 obj2 mul obj3\n");
                    321:     fppp(fp,"obj3 = obj1 * obj2\n");
                    322:   }else if (strcmp(s,"newcontext") == 0) {
                    323:     fppp(fp,"<< name super newcontext class.Context >>\n"); /*:*/
                    324:     fppp(fp,"It creates new context and new user dictionary.\n"); /*:*/
                    325:     fppp(fp,"Ex. (mycontext) StandardContextp newcontext /nc set.\n");
                    326:     fppp(fp,"cf. setcontext.\n");
                    327:   }else if (strcmp(s,"newstack") == 0) {
                    328:     fppp(fp,"<< size newstack class.OperandStack >>\n"); /*:*/
                    329:     fppp(fp,"cf. setstack, stdstack.\n");
1.26      takayama  330:   }else if (strcmp(s,"oxshell") == 0) {
                    331:     fppp(fp,"<< cmds oxshell result >>\n"); /*:*/
                    332:     fppp(fp,"cmds is an array of strings.\n");
1.27      takayama  333:        KoxShellHelp((char *)NULL,fp);
1.1       maekawa   334:   }else if (strcmp(s,"pop")==0) {
                    335:     fppp(fp,"<< obj pop >>  \n"); /*:*/
                    336:     fppp(fp,"It removes the obj from the stack.\n");
                    337:   }else if (strcmp(s,"principal")==0) {
                    338:     fppp(fp,"<< obj principal obj >>  Get the principal part.\n"); /*:*/
                    339:     fppp(fp,"This is an old command. init should be used.\n");
                    340:     fppp(fp,"Example: (x Dx + Dy^2+ y Dx Dy). [(Dx) 1 (Dy) 1] weightv init\n");
                    341:   }else if (strcmp(s,"print")==0) {
                    342:     fppp(fp,"<< obj print >> \n"); /*:*/
                    343:     fppp(fp,"Print the object to stdout. cf. obj (string) dc \n");
                    344:   }else if (strcmp(s,"print_switch_status")==0) {
                    345:     fppp(fp,"<< print_switch_status >>\n"); /*:*/
                    346:     fppp(fp,"cf. switch_function\n");
                    347:   }else if (strcmp(s,"primmsg")==0) {
                    348:     fppp(fp,"<< { executable array } primmsg >> \n");
                    349:     fppp(fp,"The << executable array >> is executed in the PrimitiveContext.\n");
                    350:     fppp(fp,"cf. sendmsg, sendmsg2, supmsg2, system_variable\n");
                    351:   }else if (strcmp(s,"pstack")==0) {
                    352:     fppp(fp,"<< pstack >>\n");
                    353:     fppp(fp,"The operator prints the entire contents of the stack.\n");
                    354:   }else if (strcmp(s,"pushfile")==0) {
                    355:     fppp(fp,"<< filename pushfile sss >>\n");
                    356:     fppp(fp,"string filename, sss ; \n");
                    357:     fppp(fp,"Read the file and push the contents of file as the string.\n");
                    358:     fppp(fp,"The file will be search in the search path as run operator.\n");
                    359:     fppp(fp,"Example: (myfile.txt) pushfile /sss set \n");
                    360:     fppp(fp,"cf:  [(parse) sss] extension\n");
                    361:   }else if (strcmp(s,"put")==0) {
                    362:     fppp(fp,"<< [a0 a1 ... ap] i any put >>\n");
                    363:     fppp(fp,"<< [a0 a1 ... ap] multi-index any put >>\n");
                    364:     fppp(fp,"<< s i any put >>\n");
                    365:     fppp(fp,"integer i; string s; array of integers multi-index;\n");
                    366:     fppp(fp,"The operator put <<any>> at the place i.\n");
                    367:     fppp(fp,"Example: /a [1 2 3] def  a 2 (Hi) put a :: --->[1 2 (Hi)]\n");
                    368:     fppp(fp,"Example: /a [[1 2] [3 4]] def  a [0 1] 10 put a :: --->\n");
                    369:     fppp(fp,"                                               [[1 10] [3 4]]\n");
                    370:   }else if (strcmp(s,"rc")==0) {
                    371:     fppp(fp,"<< obj rc rightCell >>\n");
                    372:     fppp(fp,"rightCell is the right cell of the obj of which type must be class.\n");
                    373:     fppp(fp,"class rightCell;\n");
                    374:   }else if (strcmp(s,"reduction")==0) {
                    375:     fppp(fp,"<< f [g_1 g_2 ... g_m] reduction [h c0 syz input] >>\n");
                    376:     fppp(fp,"poly f, g1_1, ..., g_m, h, c0; array of poly syz, input;\n");
                    377:     fppp(fp,"h is the normal of f by {g1 .... fm}.\n");
                    378:     fppp(fp,"h = c0 f + \\sum syz_i g_i \n");
                    379:   }else if (strcmp(s,"replace")==0) {
                    380:     fppp(fp,"<< f [[L1 R1] ... [Ln Rn]] replace g >>\n");
                    381:     fppp(fp,"poly f, L1, R1, ..., Ln, Rn, g; \n");
                    382:     fppp(fp,"<<replace>> applies the rules L1-->R1, ..., Ln-->Rn to transform f.\n");
                    383:     fppp(fp,"Example: (x^2+x+1). [[(x). (2).]] replace :: ---> 7\n");
                    384:   }else if (strcmp(s,"roll")==0) {
                    385:     fppp(fp,"<< f(n-1) ... f(0) n j roll f(j-1 mod n) f(j-2 mod n) ... f(j-n mod n) >>\n");
                    386:     fppp(fp,"integer n, j;\n");
                    387:     fppp(fp,"Example: [(a) (b) (c) 3 1 roll] ::  ==>[(c) (a) (b)]\n");
                    388:   }else if (strcmp(s,"run") == 0) {
                    389:     fppp(fp,"<< filename run >>\n"); /*:*/
                    390:     fppp(fp,"string filename ;\n"); /*:*/
                    391:     fppp(fp,"Example. (restriction.sm1) run \n");
                    392:     fppp(fp,"File will be searched in the current directory, /usr/local/lib/sm1,\n");
                    393:     fppp(fp,"and the directory specified by the environment variable LOAD_SM1_PATH\n");
                    394:     fppp(fp,"Example. setenv LOAD_SM1_PATH ~/lib/sm1/ \n");
                    395:   }else if (strcmp(s,"sendmsg") == 0) {
                    396:     fppp(fp,"<< obj { executable array } sendmsg >>\n"); /*:*/
                    397:     fppp(fp,"When obj is in k-class (i.e. obj is of the form \n");
                    398:     fppp(fp," [<<class.Context>> , body ]), then the CurrentContextp is changed\n");
                    399:     fppp(fp,"to <<class.Context>> and the obj <<executable array>> will be executed.\n");
                    400:     fppp(fp,"If not, CurrentContextp is changed to the PrimitiveContextp and\n");
                    401:     fppp(fp,"the obj <<executable array>> will be executed.\n");
                    402:     fppp(fp,"cf. setcontext, newcontext, StandardContextp, system_variable,\n");
                    403:     fppp(fp,"    sendmsg2, primmsg, supmsg2.\n");
                    404:   }else if (strcmp(s,"sendmsg2") == 0) {
                    405:     fppp(fp,"<< obj2 obj3 { executable array } sendmsg2 >>\n"); /*:*/
                    406:     fppp(fp,"Context is determined by obj2 if obj2 is class.context.\n");
                    407:     fppp(fp,"If not, it is determined by obj3 if obj2 is class.context.\n");
                    408:     fppp(fp,"cf. sendmsg.\n");
                    409:   }else if (strcmp(s,"set_order_by_matrix")==0) {
                    410:     fppp(fp,"<< order-matrix set_order_by_matrix >>\n"); /*:*/
                    411:     fppp(fp,"matrix of integers order-matrix; \n");
                    412:     fppp(fp,"cf. weight_vector, show_ring, elimination_order, switch_function\n");
                    413:     fppp(fp,"    system_variable \n");
                    414:   }else if (strcmp(s,"set_timer")==0) {
                    415:     fppp(fp,"cf. timer\n"); /*:*/
                    416:   }else if (strcmp(s,"set_up_ring@")==0) {
                    417:     fppp(fp,"<< [x-variables] [d-variables] [p c l m n cc ll mm nn next] order-matrix \n");
                    418:     fppp(fp,"   [(keyword) value (keyword) value ....]  set_up_ring@ >>\n");
                    419:     fppp(fp,"<<next>> is the optional argument. The last argument is also optional.\n");
                    420:     fppp(fp,"Keywords are mpMult, coeffient ring, valuation, characteristic,\n");
                    421:     fppp(fp,"             schreyer, ringName.\n\n");
                    422:     fppp(fp,"1.When [x[0] .... x[n-1]] [D[0] .... D[n-1]] is given as the lists\n");
                    423:     fppp(fp,"  of variables, D[0] is usually used as the variable for homogenization\n");
                    424:     fppp(fp,"  and x[n-1] is used for the variable for the graduation.\n");
                    425:     fppp(fp,"2.Order matrix should be given in the order x[n-1] ... x[0], D[n-1]...D[0]\n");
                    426:     fppp(fp,"3.0<=i<c : commutative; c<=i<l : q-difference;\n");
                    427:     fppp(fp,"  l<=i<m : difference(better not to use it); m<=i<n : differential;\n");
                    428:     fppp(fp,"4.Graduation variables :\n");
                    429:     fppp(fp,"  cc<=i<c : commutative; ll<=i<l : q-difference;\n");
                    430:     fppp(fp,"  mm<=i<m : difference;  nn<=i<n : differential;\n");
                    431:     fppp(fp,"  If you do not use graduation variables, set, for example, cc=c.\n");
                    432:     fppp(fp,"5.c-cc>0 or l-ll>0 or m-mm>0 or n-nn>0 must be held.\n\n");
                    433:     fppp(fp,"Example: [$H$ $x$ $y$ $e$] [$h$ $Dx$ $Dy$ $E$]\n");
                    434:     fppp(fp,"         [0 1 1 1 4 1 1 1 3]\n");
                    435:     fppp(fp,"        (  e y x H   E Dy Dx h )\n");
                    436:     fppp(fp,"         [[1 1 1 1   1 1  1  0]\n");
                    437:     fppp(fp,"          [1 0 0 0   0 0  0  0]\n");
                    438:     fppp(fp,"          [0 0 0 0   0 1  0  0]\n");
                    439:     fppp(fp,"           ........\n\n");
                    440:     fppp(fp,"cf. polynomial_ring, ring_of_..., groebner.\n");
                    441:   }else if (strcmp(s,"setcontext")==0) {
                    442:     fppp(fp,"<< class.Context setcontext >>\n");
                    443:     fppp(fp,"Change the CurrentContextp (and the user dictionary) ");
                    444:     fppp(fp,"to class.Context.\n");
                    445:     fppp(fp,"Ex. (mynew) StandardContextp newcontext /cp set cp setcontext\n");
                    446:     fppp(fp,"cf. system_variable(CurrentContextp), newcontext,\n");
                    447:     fppp(fp,"    show_user_dictionary, StandardContextp.\n");
                    448:   }else if (strcmp(s,"setstack")==0) {
                    449:     fppp(fp,"<< class.OperandStack setstack >>\n");
                    450:     fppp(fp,"Change the current operand stack to class.OperandStack.\n");
                    451:     fppp(fp,"Ex. 1000 newstack /st set  st setstack\n");
                    452:     fppp(fp,"cf. newstack, stdstack\n");
                    453:   }else if (strcmp(s,"show_ring")==0 ) {
                    454:     fppp(fp,"<< show_ring >>\n"); /*:*/
                    455:     fppp(fp,"cf. set_up_ring.\n");
                    456:   }else if (strcmp(s,"show_systemdictionary") == 0 || strcmp(s,"show_user_dictionary")==0 ) {
                    457:     fppp(fp,"<< show_systemdictionary >>  << show_user_dictionary >>\n"); /*:*/
                    458:   }else if (strcmp(s,"spol")==0) {
                    459:     fppp(fp,"<< f  g spol  [ [c d] r] >>\n"); /*:*/
                    460:     fppp(fp,"poly f, g, c, d, r;\n");
                    461:     fppp(fp,"r is the s-polynomial of f and g.\n");
                    462:     fppp(fp," r = c f + d g\n");
                    463:   }else if (strcmp(s,"stdstack")==0) {
                    464:     fppp(fp,"<< stdstack >>\n");
                    465:     fppp(fp,"Change the current operand stack to the standard stack.\n");
                    466:     fppp(fp,"cf. newstack, setstack\n");
                    467:   }else if (strcmp(s,"sub") ==0) {
                    468:     fppp(fp,"obj1 obj2 sub obj3\n");
                    469:     fppp(fp,"obj3 = obj1 - obj2.\n");
                    470:   }else if (strcmp(s,"supercontext")==0) {
                    471:     fppp(fp,"<< class.Context supercontext class.Context2 >>\n"); /*:*/
                    472:     fppp(fp,"cf. setcontext, newcontext\n");
                    473:   }else if (strcmp(s,"supmsg2") == 0) {
                    474:     fppp(fp,"<< obj2 obj3 { executable array } supmsg2 >>\n"); /*:*/
                    475:     fppp(fp,"Context is the super of obj2 or obj3.\n");
                    476:     fppp(fp,"cf. sendmsg, sendmsg2, primmsg.\n");
                    477:   }else if (strcmp(s,"switch_function")==0) {
                    478:     fppp(fp,"<< (function) (name) switch_function >>\n"); /*:*/
                    479:     fppp(fp,"<< (report) (function) switch_function value >>\n"); /*:*/
                    480:     fppp(fp,"cf. print_switch_status, getOptions, restoreOptions.\n");
                    481:   }else if (strcmp(s,"system")==0) {
                    482:     fppp(fp,"<< command system >>\n"); /*:*/
                    483:     fppp(fp,"string command; \n");
                    484:     fppp(fp,"Execute unix command.\n");
                    485:     fppp(fp,"Example: (ls) system \n");
                    486:   }else if (strcmp(s,"system_variable")==0) {
                    487:     fppp(fp,"<< [(key word)] system_variable result >> or\n");
                    488:     fppp(fp,"<< [(key word) value] system_variable result >>\n");
                    489:     fppp(fp,"<< [(key word) optional arg] system_variable result >>\n");
                    490:     fppp(fp,"The primitive returns the value of a given system constant.\n");
                    491:     fppp(fp,"The primitive sets the value of a given system constant.\n");
1.3       takayama  492:     fppp(fp,"PrintDollar [0,1,2], Wrap, P, N, NN, M, MM, L, LL, C, CC,ringName,\n");
                    493:     fppp(fp,"CurrentRingp, Verbose, UseCriterion1, UseCriterion2B,\n");
                    494:     fppp(fp,"ReduceLowerTerms, CheckHomogenization, Homogenize, Sugar, Homogenize_vec,\n");
                    495:     fppp(fp,"Statistics, StackPointer, StandardOperandStack,\n");
                    496:     fppp(fp,"ErrorStack, ErrorMessageMode, WarningMessageMode,\n");
1.25      takayama  497:     fppp(fp,"CatchCtrlC, Strict, CurrentContextp, NullContextp, Strict2, QuoteMode\n");
1.3       takayama  498:     fppp(fp,"SigIgn, KSPushEnvMode, PrimitiveContextp, KanGBmessage,\n");
1.1       maekawa   499:     fppp(fp,"orderMatrix, gbListTower, Schreyer, \n");
1.3       takayama  500:     fppp(fp,"outputOrder, multSymbol, variableNames, Version,\n");
                    501:     fppp(fp,"AvoidTheSameRing, RingStack, LeftBracket, RightBracket,\n");
1.14      takayama  502:     fppp(fp,"AutoReduce, SecureMode, Ecart, EcartAutomaticHomogenization\n");
1.16      takayama  503:     fppp(fp,"DoCancel, DebugContentReduction\n");
1.1       maekawa   504:     fppp(fp,"Example: [(N)] system_variable\n");
                    505:     fppp(fp,"                             (maximum number of variables)/2.\n");
                    506:     fppp(fp,"         [(x) (var) 3] system_variable\n");
                    507:     fppp(fp,"                              The 3rd variable.\n");
                    508:     fppp(fp,"         [(D) (var) 4] system_variable\n");
                    509:     fppp(fp,"                              The 4th differential operator.\n");
                    510:     fppp(fp,"         [(PrintDollar) 0] system_variable\n");
                    511:     fppp(fp,"                          Set the global variable PrintDollar to 0\n");
1.16      takayama  512:     fppp(fp,"DebugReductionEcart (bit):  (2) *% (1) find_reducer,in(r) \n");
                    513:     fppp(fp,"              (any) cont   (4) #+[rat division, + ecartd] \n");
1.23      takayama  514:     fppp(fp,"                           (8) check the order. \n");
1.16      takayama  515:     fppp(fp,"DoCancel (bit):  (2) always_reduce_content  (1) Noro_strategy \n");
1.17      takayama  516:     fppp(fp,"                 (4) DoCancel_in_reduction1 \n");
1.10      takayama  517:   }else if (strcmp(s,"tlimit")==0) {
                    518:     fppp(fp,"<< { ... } t tlimit results >>\n");
                    519:     fppp(fp,"Limit the execution time to t seconds.\n");
                    520:     fppp(fp,"When t is not positive, tlimit pushes the execution time.\n");
1.1       maekawa   521:   }else if (strcmp(s,"to_records")==0) {
                    522:     fppp(fp,"<< ({arg1,arg2,...,argn})  to_records (arg1) ... (argn) n >>\n");
                    523:     fppp(fp,"Example: ({x,y2}) to_records ===> (x) (y2) 2\n");
                    524:     fppp(fp,"Example: (x,y2)   to_records ===> (x) (y2) 2\n");
                    525:     fppp(fp,"Example: [(x,y2) to_records pop] ===> [(x) (y2)]\n");
                    526:   }else if (strcmp(s,"writestring") == 0) {
                    527:     fppp(fp,"<< fd s writestring >>\n"); /*:*/
                    528:     fppp(fp,"file fd; string s;\n");
                    529:     fppp(fp,"Write the string s to the file fd.\n");
                    530:     fppp(fp,"cf. [(PrintDollar)] system_variable, file, closefile\n");
1.7       takayama  531:     /******* macros ************/
1.1       maekawa   532:   }else if (strcmp(s,"timer")==0) {
                    533:     fppp(fp,"<< { executable array } timer >>\n"); /*:*/
                    534:   }else{
                    535:     fppp(fp,"The keyword <<%s>> cannot be found.\n",s);
                    536:     fppp(fp,"Type in ? in order to see system dictionary.\n");
                    537:   }
                    538: }

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