Annotation of OpenXM/src/kan96xx/Kan/usage.c, Revision 1.29
1.29 ! takayama 1: /* $OpenXM: OpenXM/src/kan96xx/Kan/usage.c,v 1.28 2004/05/13 04:38:28 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");
1.29 ! takayama 183: fppp(fp," [(divByN) poly1 n(universalNumber)] gbext [qpoly rpoly] \n");
! 184: fppp(fp," where poly1 = n*qpoly+rpoly.\n");
! 185: fppp(fp," (see also cancelCoeff) \n");
! 186: fppp(fp," [(exponents) poly type ] gbext array \n");
! 187: fppp(fp," example: type == 0 x,y,Dx,Dy\n");
! 188: fppp(fp," type == 1 x,y,h,Dx,Dy,H\n");
! 189: fppp(fp," type == 2 x,y,Dx,Dy,h --- default.\n");
! 190: fppp(fp," [(grade) poly1 ] gbext integer \n");
! 191: fppp(fp," [(isConstant) poly] gbext bool \n");
! 192: fppp(fp," [(isConstantAll) poly] gbext bool \n");
! 193: fppp(fp," [(isOrdered) poly] gbext poly \n");
1.1 maekawa 194: fppp(fp," [(isReducible) poly1 poly2 ] gbext integer \n");
195: fppp(fp," [(lcm) poly1 poly2] gbext poly \n");
1.29 ! takayama 196: fppp(fp," [(lcoeff) poly] gbext poly \n");
! 197: fppp(fp," [(lmonom) poly] gbext poly \n");
1.1 maekawa 198: fppp(fp," [(mod) poly1 universalNumber] gbext poly \n");
199: fppp(fp," poly = poly1 mod universalNumber where char=0 and \n");
200: fppp(fp," poly and poly2 belong to a same ring.\n");
1.29 ! takayama 201: fppp(fp," [(ord_ws_all) fv wv] gbext integer \n");
! 202: fppp(fp," [(reduceContent) poly] gbext [poly c] \n");
1.1 maekawa 203: fppp(fp," [(tomodp) poly1 ring] gbext poly, char(ring)>0. \n");
204: fppp(fp," poly = poly1 mod char(ring) where poly belongs to ring.\n");
205: fppp(fp," [(tomod0) poly1 ring] gbext poly, char(ring)=0. \n");
206: fppp(fp," [(schreyerSkelton) array_of_poly] gbext array \n");
207: fppp(fp," [(toes) array_of_poly] gbext poly \n");
1.6 takayama 208: fppp(fp," [(toe_) poly] gbext poly \n");
209: fppp(fp," [(toe_) array_of_poly] gbext poly cf. toVectors \n");
1.1 maekawa 210: }else if (strcmp(s,"get")==0) {
211: fppp(fp,"<< [f0 f1 ... fn] k get fk >>\n");
212: fppp(fp,"integer k;");
213: fppp(fp,"The primitive gets the k-th element of a given array.\n");
214: fppp(fp,"Example: [1 4 3] 1 get :: ---> 4\n");
215: }else if (strcmp(s,"goto")==0) {
216: fppp(fp,"<< label goto >>\n");
217: fppp(fp,"literal label;\n");
218: fppp(fp,"Break the loops and jump to the <<literal>>.\n");
219: fppp(fp,"The label <<literal>> has to be out of all the loops.\n");
220: fppp(fp,"You cannot jump inside of the executable array { .... }.\n");
221: fppp(fp,"Example: /point goto (skip me) message /point \n");
222: }else if (strcmp(s,"groebner")==0) {
223: fppp(fp,"<< [[f1 ... fn] [options]] groebner \n");
224: fppp(fp," [[g1 ... gm] backward-transformation syzygy]>>\n");
225: fppp(fp,"poly f1, ..., fn; poly g1, ..., gm;\n");
226: fppp(fp,"optional return value: matrix of poly backward-transformation, syzygy;\n");
227: fppp(fp,"Computation of the Groebner basis of f1,...,fn. The basis is {g1,...,gm}.\n");
228: fppp(fp,"Options: << (needBack), (needSyz), (countDown) number (StopDegree) number, (forceReduction)>>\n");
229: fppp(fp,"Flags:<< [(ReduceLowerTerms) 1] system_variable >>\n");
230: fppp(fp," << [(UseCriterion1) 0] system_variable >>\n");
231: fppp(fp," << [(UseCriterion2B) 0] system_variable >>\n");
232: fppp(fp," << [(Sugar) 0] system_variable >>\n");
233: fppp(fp," << [(Homogenize) 1] system_variable >>\n");
234: fppp(fp," << [(CheckHomogenization) 1] system_variable >>\n");
235: fppp(fp," << [(Statistics) 1] system_variable >>\n");
236: fppp(fp," << [(KanGBmessage) 1] system_variable >>\n");
237: fppp(fp," << [(Verbose) 0] system_variable >>\n");
238: fppp(fp,"Example: [(x0,x1) ring_of_polynomials 0] define_ring\n");
239: fppp(fp," [(x0^2+x1^2-h^2). (x0 x1 -4 h^2).] /ff set ;\n");
240: fppp(fp," [ff] groebner /gg set ;\n");
241: fppp(fp," gg ::\n");
242: fppp(fp,"cf. homogenize, groebner_sugar, define_ring, \n");
243: fppp(fp," ring_of_polynomials, ring_of_differential_operators.\n");
244: }else if (strcmp(s,"homogenize") == 0) {
245: fppp(fp,"<< f homogenize g >>\n");
246: fppp(fp,"poly f,g;\n");
1.20 takayama 247: fppp(fp,"array of poly f,g;\n\n");
248: fppp(fp,"[(degreeShift) (value)] homogenize [shiftD shiftUV]\n");
249: fppp(fp,"[(degreeShift) (reset)] homogenize [null null]\n");
250: fppp(fp,"[(degreeShift) shiftD ] homogenize [shiftD shiftUV]\n");
251: fppp(fp,"[(degreeShift) [shiftD shiftUV]] homogenize [shiftD shiftUV]\n");
252: fppp(fp,"[(degreeShift) [ ] fv] homogenize hfv\n");
253: fppp(fp,"[(degreeShift) shiftD fv] homogenize hfv\n");
254: fppp(fp,"[(degreeShift) [shiftD shiftUV] fv] homogenize hfv\n");
255: fppp(fp,"shiftD : degree shift vector for (0,1)-h homogenization\n");
256: fppp(fp,"shiftUV : degree shift vector for (-1,1)-s homogenization (internal for ecart.)\n");
257: fppp(fp,"fv : polynomial or vector of polynomials.\n");
258: fppp(fp,"Example: [(x) ring_of_differential_operators 0] define_ring\n");
259: fppp(fp," [(degreeShift) [[1 0] [0 1]] [(x+1). (Dx+1).]] homogenize ::\n");
260: fppp(fp," [(degreeShift) (value)] homogenize ::\n");
261: fppp(fp,"Note. min of ord (-1,1)[0,1] is min {-1,1, 1+1,1+0} = -1 =m \n");
262: fppp(fp," Degree of H is b-a+v(i)-m where v=[0,1]\n");
1.21 takayama 263: fppp(fp,"Side effects: It changes h-degree shift vector and s-degree shift vector\n");
264: fppp(fp," in homogenizeObject_go(), which is called from ecart division codes\n");
265: fppp(fp," as well as the function homogenize.\n");
1.20 takayama 266: fppp(fp,"DegreeShift is automatically reset when set_up_ring is called.\n");
1.1 maekawa 267: }else if (strcmp(s,"idiv") == 0) {
268: fppp(fp,"<< a b idiv a/b >>\n");
269: fppp(fp,"int a,b,a/b;\n");
270: fppp(fp,"Example: 5 2 idiv :: ===> 2\n");
271: }else if (strcmp(s,"ifelse") == 0) {
272: fppp(fp,"<< condition { true case } { false case } ifelse >>\n"); /*:*/
1.7 takayama 273: /* Tenuki mark --------------^ */
1.1 maekawa 274: fppp(fp,"integer condition;\n");
275: fppp(fp,"If condition is non-zero, then true-case will be executed,\n");
276: fppp(fp,"else false-case will be executed.\n");
277: }else if (strcmp(s,"index") == 0) {
278: fppp(fp,"<< a_0 ... a_{n-1} n index a_0 ... a_{n-1} a_0 >>\n");/*:*/
279: fppp(fp,"integer n; \n");
280: fppp(fp,"It takes a_0 from the stack.\n");
281: }else if (strcmp(s,"init")==0) {
282: fppp(fp,"<< f init h >>\n");
283: fppp(fp,"<< f weight_vector init h >>\n");
284: fppp(fp,"poly f,h; array of integer weight_vector;\n");
285: fppp(fp,"h is the initial term of the polynomial f.\n");
286: fppp(fp,"Example: (2 x^3 + 3 x + 1). init :: ---> 2 x^3\n");
287: fppp(fp,"Example: [(x^3+1). (x h+ h^5).] {init} map ::\n");
1.18 takayama 288: fppp(fp,"Example: (x+1). [0 1 1 1] init :: cf. weightv \n\n");
289: fppp(fp,"<< fv weight_vector init h >>\n");
290: fppp(fp,"<< fv [weight_vector shift_vector] init h >>\n");
1.19 takayama 291: fppp(fp,"<< fv init h >> or << hv [ ] init h >>\n");
1.18 takayama 292: fppp(fp,"fv is a polynomial or a vector of polynomials.\n");
1.19 takayama 293: fppp(fp,"h is the initial term with respect to the weight vector and the shift vector\n");
294: fppp(fp,"if they are given.\n");
1.18 takayama 295: fppp(fp,"Note: the last x variable is always assumed to be the vector index.\n");
296: fppp(fp,"Example: [(x,y) ring_of_differential_operators 0] define_ring\n");
297: fppp(fp," [(x^2*Dx^2+2*x*Dx+x). (Dx+x).] [[(Dx) 1 (x) -1] weightv [0 -1]] init ::\n");
1.1 maekawa 298: }else if (strcmp(s,"lc")==0) {
299: fppp(fp,"<< obj lc leftCell >>\n");
300: fppp(fp,"class leftCell;\n");
301: fppp(fp,"leftCell is the left cell of the obj of which type must be class.\n");
302: }else if (strcmp(s,"length")==0) {
303: fppp(fp,"<< [a0 a1 ... an] length <n+1> >>\n");
304: fppp(fp,"<< s length p >>\n");
305: fppp(fp,"integer <n+1>; integer p; string s;\n");
306: fppp(fp,"It returns the length of the argument. p is the length of the string.\n");
307: }else if (strcmp(s,"load")==0) {
308: fppp(fp,"<< /literal load obj >>\n");
309: fppp(fp,"<<load>> gets the value of <<literal>>.\n");
310: }else if (strcmp(s,"loop") == 0) {
311: fppp(fp,"<< {executable array} loop >>\n"); /*:*/
312: fppp(fp,"cf. exit\n");
313: }else if (strcmp(s,"map")==0) {
314: fppp(fp,"<< [f1 ... fn] {code} map [f1 {code}exec ... fn {code}exec] >>\n");
315: fppp(fp,"map applies {code} to each element in [f1 ... fn].\n");
316: fppp(fp,"Example: [1 2 3] {1 add} map ===> [2 3 4]\n");
317: }else if (strcmp(s,"mpzext") == 0) {
318: fppp(fp,"[(key) arguments] mpzext ans\n"); /*:*/
319: fppp(fp,"It calls mpz functions.\n");
320: fppp(fp,"arguments should be numbers(universalNumber).\n");
321: fppp(fp,"Keys: gcd, tdiv_qr, cancel, powm, probab_prim_p, sqrt, and, ior, com\n");
322: fppp(fp,"For details, see gmp-2.0.2/texinfo.tex.\n");
323: }else if (strcmp(s,"mul") ==0) {
324: fppp(fp,"obj1 obj2 mul obj3\n");
325: fppp(fp,"obj3 = obj1 * obj2\n");
326: }else if (strcmp(s,"newcontext") == 0) {
327: fppp(fp,"<< name super newcontext class.Context >>\n"); /*:*/
328: fppp(fp,"It creates new context and new user dictionary.\n"); /*:*/
329: fppp(fp,"Ex. (mycontext) StandardContextp newcontext /nc set.\n");
330: fppp(fp,"cf. setcontext.\n");
331: }else if (strcmp(s,"newstack") == 0) {
332: fppp(fp,"<< size newstack class.OperandStack >>\n"); /*:*/
333: fppp(fp,"cf. setstack, stdstack.\n");
1.26 takayama 334: }else if (strcmp(s,"oxshell") == 0) {
335: fppp(fp,"<< cmds oxshell result >>\n"); /*:*/
336: fppp(fp,"cmds is an array of strings.\n");
1.27 takayama 337: KoxShellHelp((char *)NULL,fp);
1.1 maekawa 338: }else if (strcmp(s,"pop")==0) {
339: fppp(fp,"<< obj pop >> \n"); /*:*/
340: fppp(fp,"It removes the obj from the stack.\n");
341: }else if (strcmp(s,"principal")==0) {
342: fppp(fp,"<< obj principal obj >> Get the principal part.\n"); /*:*/
343: fppp(fp,"This is an old command. init should be used.\n");
344: fppp(fp,"Example: (x Dx + Dy^2+ y Dx Dy). [(Dx) 1 (Dy) 1] weightv init\n");
345: }else if (strcmp(s,"print")==0) {
346: fppp(fp,"<< obj print >> \n"); /*:*/
347: fppp(fp,"Print the object to stdout. cf. obj (string) dc \n");
348: }else if (strcmp(s,"print_switch_status")==0) {
349: fppp(fp,"<< print_switch_status >>\n"); /*:*/
350: fppp(fp,"cf. switch_function\n");
351: }else if (strcmp(s,"primmsg")==0) {
352: fppp(fp,"<< { executable array } primmsg >> \n");
353: fppp(fp,"The << executable array >> is executed in the PrimitiveContext.\n");
354: fppp(fp,"cf. sendmsg, sendmsg2, supmsg2, system_variable\n");
355: }else if (strcmp(s,"pstack")==0) {
356: fppp(fp,"<< pstack >>\n");
357: fppp(fp,"The operator prints the entire contents of the stack.\n");
358: }else if (strcmp(s,"pushfile")==0) {
359: fppp(fp,"<< filename pushfile sss >>\n");
360: fppp(fp,"string filename, sss ; \n");
361: fppp(fp,"Read the file and push the contents of file as the string.\n");
362: fppp(fp,"The file will be search in the search path as run operator.\n");
363: fppp(fp,"Example: (myfile.txt) pushfile /sss set \n");
364: fppp(fp,"cf: [(parse) sss] extension\n");
365: }else if (strcmp(s,"put")==0) {
366: fppp(fp,"<< [a0 a1 ... ap] i any put >>\n");
367: fppp(fp,"<< [a0 a1 ... ap] multi-index any put >>\n");
368: fppp(fp,"<< s i any put >>\n");
369: fppp(fp,"integer i; string s; array of integers multi-index;\n");
370: fppp(fp,"The operator put <<any>> at the place i.\n");
371: fppp(fp,"Example: /a [1 2 3] def a 2 (Hi) put a :: --->[1 2 (Hi)]\n");
372: fppp(fp,"Example: /a [[1 2] [3 4]] def a [0 1] 10 put a :: --->\n");
373: fppp(fp," [[1 10] [3 4]]\n");
374: }else if (strcmp(s,"rc")==0) {
375: fppp(fp,"<< obj rc rightCell >>\n");
376: fppp(fp,"rightCell is the right cell of the obj of which type must be class.\n");
377: fppp(fp,"class rightCell;\n");
378: }else if (strcmp(s,"reduction")==0) {
379: fppp(fp,"<< f [g_1 g_2 ... g_m] reduction [h c0 syz input] >>\n");
380: fppp(fp,"poly f, g1_1, ..., g_m, h, c0; array of poly syz, input;\n");
381: fppp(fp,"h is the normal of f by {g1 .... fm}.\n");
382: fppp(fp,"h = c0 f + \\sum syz_i g_i \n");
383: }else if (strcmp(s,"replace")==0) {
384: fppp(fp,"<< f [[L1 R1] ... [Ln Rn]] replace g >>\n");
385: fppp(fp,"poly f, L1, R1, ..., Ln, Rn, g; \n");
386: fppp(fp,"<<replace>> applies the rules L1-->R1, ..., Ln-->Rn to transform f.\n");
387: fppp(fp,"Example: (x^2+x+1). [[(x). (2).]] replace :: ---> 7\n");
388: }else if (strcmp(s,"roll")==0) {
389: 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");
390: fppp(fp,"integer n, j;\n");
391: fppp(fp,"Example: [(a) (b) (c) 3 1 roll] :: ==>[(c) (a) (b)]\n");
392: }else if (strcmp(s,"run") == 0) {
393: fppp(fp,"<< filename run >>\n"); /*:*/
394: fppp(fp,"string filename ;\n"); /*:*/
395: fppp(fp,"Example. (restriction.sm1) run \n");
396: fppp(fp,"File will be searched in the current directory, /usr/local/lib/sm1,\n");
397: fppp(fp,"and the directory specified by the environment variable LOAD_SM1_PATH\n");
398: fppp(fp,"Example. setenv LOAD_SM1_PATH ~/lib/sm1/ \n");
399: }else if (strcmp(s,"sendmsg") == 0) {
400: fppp(fp,"<< obj { executable array } sendmsg >>\n"); /*:*/
401: fppp(fp,"When obj is in k-class (i.e. obj is of the form \n");
402: fppp(fp," [<<class.Context>> , body ]), then the CurrentContextp is changed\n");
403: fppp(fp,"to <<class.Context>> and the obj <<executable array>> will be executed.\n");
404: fppp(fp,"If not, CurrentContextp is changed to the PrimitiveContextp and\n");
405: fppp(fp,"the obj <<executable array>> will be executed.\n");
406: fppp(fp,"cf. setcontext, newcontext, StandardContextp, system_variable,\n");
407: fppp(fp," sendmsg2, primmsg, supmsg2.\n");
408: }else if (strcmp(s,"sendmsg2") == 0) {
409: fppp(fp,"<< obj2 obj3 { executable array } sendmsg2 >>\n"); /*:*/
410: fppp(fp,"Context is determined by obj2 if obj2 is class.context.\n");
411: fppp(fp,"If not, it is determined by obj3 if obj2 is class.context.\n");
412: fppp(fp,"cf. sendmsg.\n");
413: }else if (strcmp(s,"set_order_by_matrix")==0) {
414: fppp(fp,"<< order-matrix set_order_by_matrix >>\n"); /*:*/
415: fppp(fp,"matrix of integers order-matrix; \n");
416: fppp(fp,"cf. weight_vector, show_ring, elimination_order, switch_function\n");
417: fppp(fp," system_variable \n");
418: }else if (strcmp(s,"set_timer")==0) {
419: fppp(fp,"cf. timer\n"); /*:*/
420: }else if (strcmp(s,"set_up_ring@")==0) {
421: fppp(fp,"<< [x-variables] [d-variables] [p c l m n cc ll mm nn next] order-matrix \n");
422: fppp(fp," [(keyword) value (keyword) value ....] set_up_ring@ >>\n");
423: fppp(fp,"<<next>> is the optional argument. The last argument is also optional.\n");
424: fppp(fp,"Keywords are mpMult, coeffient ring, valuation, characteristic,\n");
425: fppp(fp," schreyer, ringName.\n\n");
426: fppp(fp,"1.When [x[0] .... x[n-1]] [D[0] .... D[n-1]] is given as the lists\n");
427: fppp(fp," of variables, D[0] is usually used as the variable for homogenization\n");
428: fppp(fp," and x[n-1] is used for the variable for the graduation.\n");
429: fppp(fp,"2.Order matrix should be given in the order x[n-1] ... x[0], D[n-1]...D[0]\n");
430: fppp(fp,"3.0<=i<c : commutative; c<=i<l : q-difference;\n");
431: fppp(fp," l<=i<m : difference(better not to use it); m<=i<n : differential;\n");
432: fppp(fp,"4.Graduation variables :\n");
433: fppp(fp," cc<=i<c : commutative; ll<=i<l : q-difference;\n");
434: fppp(fp," mm<=i<m : difference; nn<=i<n : differential;\n");
435: fppp(fp," If you do not use graduation variables, set, for example, cc=c.\n");
436: fppp(fp,"5.c-cc>0 or l-ll>0 or m-mm>0 or n-nn>0 must be held.\n\n");
437: fppp(fp,"Example: [$H$ $x$ $y$ $e$] [$h$ $Dx$ $Dy$ $E$]\n");
438: fppp(fp," [0 1 1 1 4 1 1 1 3]\n");
439: fppp(fp," ( e y x H E Dy Dx h )\n");
440: fppp(fp," [[1 1 1 1 1 1 1 0]\n");
441: fppp(fp," [1 0 0 0 0 0 0 0]\n");
442: fppp(fp," [0 0 0 0 0 1 0 0]\n");
443: fppp(fp," ........\n\n");
444: fppp(fp,"cf. polynomial_ring, ring_of_..., groebner.\n");
445: }else if (strcmp(s,"setcontext")==0) {
446: fppp(fp,"<< class.Context setcontext >>\n");
447: fppp(fp,"Change the CurrentContextp (and the user dictionary) ");
448: fppp(fp,"to class.Context.\n");
449: fppp(fp,"Ex. (mynew) StandardContextp newcontext /cp set cp setcontext\n");
450: fppp(fp,"cf. system_variable(CurrentContextp), newcontext,\n");
451: fppp(fp," show_user_dictionary, StandardContextp.\n");
452: }else if (strcmp(s,"setstack")==0) {
453: fppp(fp,"<< class.OperandStack setstack >>\n");
454: fppp(fp,"Change the current operand stack to class.OperandStack.\n");
455: fppp(fp,"Ex. 1000 newstack /st set st setstack\n");
456: fppp(fp,"cf. newstack, stdstack\n");
457: }else if (strcmp(s,"show_ring")==0 ) {
458: fppp(fp,"<< show_ring >>\n"); /*:*/
459: fppp(fp,"cf. set_up_ring.\n");
460: }else if (strcmp(s,"show_systemdictionary") == 0 || strcmp(s,"show_user_dictionary")==0 ) {
461: fppp(fp,"<< show_systemdictionary >> << show_user_dictionary >>\n"); /*:*/
462: }else if (strcmp(s,"spol")==0) {
463: fppp(fp,"<< f g spol [ [c d] r] >>\n"); /*:*/
464: fppp(fp,"poly f, g, c, d, r;\n");
465: fppp(fp,"r is the s-polynomial of f and g.\n");
466: fppp(fp," r = c f + d g\n");
467: }else if (strcmp(s,"stdstack")==0) {
468: fppp(fp,"<< stdstack >>\n");
469: fppp(fp,"Change the current operand stack to the standard stack.\n");
470: fppp(fp,"cf. newstack, setstack\n");
471: }else if (strcmp(s,"sub") ==0) {
472: fppp(fp,"obj1 obj2 sub obj3\n");
473: fppp(fp,"obj3 = obj1 - obj2.\n");
474: }else if (strcmp(s,"supercontext")==0) {
475: fppp(fp,"<< class.Context supercontext class.Context2 >>\n"); /*:*/
476: fppp(fp,"cf. setcontext, newcontext\n");
477: }else if (strcmp(s,"supmsg2") == 0) {
478: fppp(fp,"<< obj2 obj3 { executable array } supmsg2 >>\n"); /*:*/
479: fppp(fp,"Context is the super of obj2 or obj3.\n");
480: fppp(fp,"cf. sendmsg, sendmsg2, primmsg.\n");
481: }else if (strcmp(s,"switch_function")==0) {
482: fppp(fp,"<< (function) (name) switch_function >>\n"); /*:*/
483: fppp(fp,"<< (report) (function) switch_function value >>\n"); /*:*/
484: fppp(fp,"cf. print_switch_status, getOptions, restoreOptions.\n");
485: }else if (strcmp(s,"system")==0) {
486: fppp(fp,"<< command system >>\n"); /*:*/
487: fppp(fp,"string command; \n");
488: fppp(fp,"Execute unix command.\n");
489: fppp(fp,"Example: (ls) system \n");
490: }else if (strcmp(s,"system_variable")==0) {
491: fppp(fp,"<< [(key word)] system_variable result >> or\n");
492: fppp(fp,"<< [(key word) value] system_variable result >>\n");
493: fppp(fp,"<< [(key word) optional arg] system_variable result >>\n");
494: fppp(fp,"The primitive returns the value of a given system constant.\n");
495: fppp(fp,"The primitive sets the value of a given system constant.\n");
1.3 takayama 496: fppp(fp,"PrintDollar [0,1,2], Wrap, P, N, NN, M, MM, L, LL, C, CC,ringName,\n");
497: fppp(fp,"CurrentRingp, Verbose, UseCriterion1, UseCriterion2B,\n");
498: fppp(fp,"ReduceLowerTerms, CheckHomogenization, Homogenize, Sugar, Homogenize_vec,\n");
499: fppp(fp,"Statistics, StackPointer, StandardOperandStack,\n");
500: fppp(fp,"ErrorStack, ErrorMessageMode, WarningMessageMode,\n");
1.25 takayama 501: fppp(fp,"CatchCtrlC, Strict, CurrentContextp, NullContextp, Strict2, QuoteMode\n");
1.3 takayama 502: fppp(fp,"SigIgn, KSPushEnvMode, PrimitiveContextp, KanGBmessage,\n");
1.1 maekawa 503: fppp(fp,"orderMatrix, gbListTower, Schreyer, \n");
1.3 takayama 504: fppp(fp,"outputOrder, multSymbol, variableNames, Version,\n");
505: fppp(fp,"AvoidTheSameRing, RingStack, LeftBracket, RightBracket,\n");
1.14 takayama 506: fppp(fp,"AutoReduce, SecureMode, Ecart, EcartAutomaticHomogenization\n");
1.16 takayama 507: fppp(fp,"DoCancel, DebugContentReduction\n");
1.1 maekawa 508: fppp(fp,"Example: [(N)] system_variable\n");
509: fppp(fp," (maximum number of variables)/2.\n");
510: fppp(fp," [(x) (var) 3] system_variable\n");
511: fppp(fp," The 3rd variable.\n");
512: fppp(fp," [(D) (var) 4] system_variable\n");
513: fppp(fp," The 4th differential operator.\n");
514: fppp(fp," [(PrintDollar) 0] system_variable\n");
515: fppp(fp," Set the global variable PrintDollar to 0\n");
1.16 takayama 516: fppp(fp,"DebugReductionEcart (bit): (2) *% (1) find_reducer,in(r) \n");
517: fppp(fp," (any) cont (4) #+[rat division, + ecartd] \n");
1.23 takayama 518: fppp(fp," (8) check the order. \n");
1.16 takayama 519: fppp(fp,"DoCancel (bit): (2) always_reduce_content (1) Noro_strategy \n");
1.17 takayama 520: fppp(fp," (4) DoCancel_in_reduction1 \n");
1.10 takayama 521: }else if (strcmp(s,"tlimit")==0) {
522: fppp(fp,"<< { ... } t tlimit results >>\n");
523: fppp(fp,"Limit the execution time to t seconds.\n");
524: fppp(fp,"When t is not positive, tlimit pushes the execution time.\n");
1.1 maekawa 525: }else if (strcmp(s,"to_records")==0) {
526: fppp(fp,"<< ({arg1,arg2,...,argn}) to_records (arg1) ... (argn) n >>\n");
527: fppp(fp,"Example: ({x,y2}) to_records ===> (x) (y2) 2\n");
528: fppp(fp,"Example: (x,y2) to_records ===> (x) (y2) 2\n");
529: fppp(fp,"Example: [(x,y2) to_records pop] ===> [(x) (y2)]\n");
530: }else if (strcmp(s,"writestring") == 0) {
531: fppp(fp,"<< fd s writestring >>\n"); /*:*/
532: fppp(fp,"file fd; string s;\n");
533: fppp(fp,"Write the string s to the file fd.\n");
534: fppp(fp,"cf. [(PrintDollar)] system_variable, file, closefile\n");
1.7 takayama 535: /******* macros ************/
1.1 maekawa 536: }else if (strcmp(s,"timer")==0) {
537: fppp(fp,"<< { executable array } timer >>\n"); /*:*/
538: }else{
539: fppp(fp,"The keyword <<%s>> cannot be found.\n",s);
540: fppp(fp,"Type in ? in order to see system dictionary.\n");
541: }
542: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>