FORM  4.1
ftypes.h
Go to the documentation of this file.
1 
9 /* #[ License : */
10 /*
11  * Copyright (C) 1984-2013 J.A.M. Vermaseren
12  * When using this file you are requested to refer to the publication
13  * J.A.M.Vermaseren "New features of FORM" math-ph/0010025
14  * This is considered a matter of courtesy as the development was paid
15  * for by FOM the Dutch physics granting agency and we would like to
16  * be able to track its scientific use to convince FOM of its value
17  * for the community.
18  *
19  * This file is part of FORM.
20  *
21  * FORM is free software: you can redistribute it and/or modify it under the
22  * terms of the GNU General Public License as published by the Free Software
23  * Foundation, either version 3 of the License, or (at your option) any later
24  * version.
25  *
26  * FORM is distributed in the hope that it will be useful, but WITHOUT ANY
27  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
28  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
29  * details.
30  *
31  * You should have received a copy of the GNU General Public License along
32  * with FORM. If not, see <http://www.gnu.org/licenses/>.
33  */
34 /* #] License : */
35 
50 #ifdef WITHPTHREADS
51 #define PHEAD ALLPRIVATES *B,
52 #define PHEAD0 ALLPRIVATES *B
53 #define BHEAD B,
54 #define BHEAD0 B
55 #else
56 #define PHEAD
57 #define PHEAD0 VOID
58 #define BHEAD
59 #define BHEAD0
60 #endif
61 
62 #define WITHOUTERROR 0
63 #define WITHERROR 1
64 
65 /*
66  The various streams. (look also in tools.c)
67 */
68 
69 #define FILESTREAM 0
70 #define PREVARSTREAM 1
71 #define PREREADSTREAM 2
72 #define PIPESTREAM 3
73 #define PRECALCSTREAM 4
74 #define DOLLARSTREAM 5
75 #define PREREADSTREAM2 6
76 #define EXTERNALCHANNELSTREAM 7
77 #define PREREADSTREAM3 8
78 
79 #define ENDOFSTREAM 0xFF
80 #define ENDOFINPUT 0xFF
81 
82 /*
83  Types of files
84 */
85 
86 #define SUBROUTINEFILE 0
87 #define PROCEDUREFILE 1
88 #define HEADERFILE 2
89 #define SETUPFILE 3
90 #define TABLEBASEFILE 4
91 
92 /*
93  Types of modules
94 */
95 
96 #define FIRSTMODULE -1
97 #define GLOBALMODULE 0
98 #define SORTMODULE 1
99 #define STOREMODULE 2
100 #define CLEARMODULE 3
101 #define ENDMODULE 4
102 
103 #define POLYFUN 0
104 
105 #define NOPARALLEL_DOLLAR 0x0001
106 #define NOPARALLEL_RHS 0x0002
107 #define NOPARALLEL_CONVPOLY 0x0004
108 #define NOPARALLEL_USER 0x0010
109 #define NOPARALLEL_TBLDOLLAR 0x0100
110 #define NOPARALLEL_NPROC 0x0200
111 #define PARALLELFLAG 0x0000
112 
113 #define PRENOACTION 0
114 #define PRERAISEAFTER 1
115 #define PRELOWERAFTER 2
116 /*
117 #define ELIUMOD 1
118 #define ELIZMOD 2
119 #define SKIUMOD 3
120 #define SKIZMOD 4
121 */
122 #define WITHSEMICOLON 0
123 #define WITHOUTSEMICOLON 1
124 #define MODULEINSTACK 8
125 #define EXECUTINGIF 0
126 #define LOOKINGFORELSE 1
127 #define LOOKINGFORENDIF 2
128 #define NEWSTATEMENT 1
129 #define OLDSTATEMENT 0
130 
131 #define EXECUTINGPRESWITCH 0
132 #define SEARCHINGPRECASE 1
133 #define SEARCHINGPREENDSWITCH 2
134 
135 #define PREPROONLY 1
136 #define DUMPTOCOMPILER 2
137 #define DUMPOUTTERMS 4
138 #define DUMPINTERMS 8
139 #define DUMPTOSORT 16
140 #define DUMPTOPARALLEL 32
141 #define THREADSDEBUG 64
142 
143 #define ERROROUT 0
144 #define INPUTOUT 1
145 #define STATSOUT 2
146 #define EXPRSOUT 3
147 #define WRITEOUT 4
148 
149 #define EXTERNALCHANNELOUT 5
150 
151 #define NUMERICALLOOP 0
152 #define LISTEDLOOP 1
153 #define ONEEXPRESSION 2
154 
155 #define PRETYPENONE 0
156 #define PRETYPEIF 1
157 #define PRETYPEDO 2
158 #define PRETYPEPROCEDURE 3
159 #define PRETYPESWITCH 4
160 #define PRETYPEINSIDE 5
161 
162 /*
163  Type of statement. Used to make sure that the statements are in proper order
164 */
165 
166 #define DECLARATION 1
167 #define SPECIFICATION 2
168 #define DEFINITION 3
169 #define STATEMENT 4
170 #define TOOUTPUT 5
171 #define ATENDOFMODULE 6
172 #define MIXED 9
173 
174 /*
175  The typedefs are to allow the compilers to do better error checking.
176 */
177 
178 /*
179  icc doesn't like the typedef void VOID; Neither does g++ on the apple
180  Hence we work the old fashioned way:
181 */
182 #define VOID void
183 
184 #ifdef ANSI
185 typedef VOID (*PVFUNWP)(WORD *);
186 #ifdef INTELCOMPILER
187 typedef VOID (*PVFUNV)();
188 typedef int (*CFUN)();
189 #else
190 typedef VOID (*PVFUNV)(VOID);
191 typedef int (*CFUN)(VOID);
192 #endif
193 typedef int (*TFUN)(UBYTE *);
194 typedef int (*TFUN1)(UBYTE *,int);
195 #else
196 typedef VOID (*PVFUNWP)();
197 typedef VOID (*PVFUNV)();
198 typedef int (*CFUN)();
199 typedef int (*TFUN)();
200 typedef int (*TFUN1)();
201 #endif
202 
203 
204 #define NOAUTO 0
205 #define PARTEST 1
206 #define WITHAUTO 2
207 
208 #define ALLVARIABLES -1
209 #define SYMBOLONLY 1
210 #define INDEXONLY 2
211 #define VECTORONLY 4
212 #define FUNCTIONONLY 8
213 #define SETONLY 16
214 #define EXPRESSIONONLY 32
215 
216 
224 
225 #define CDELETE -1
226 #define ANYTYPE -1
227 #define CSYMBOL 0
228 #define CINDEX 1
229 #define CVECTOR 2
230 #define CFUNCTION 3
231 #define CSET 4
232 #define CEXPRESSION 5
233 #define CDOTPRODUCT 6
234 #define CNUMBER 7
235 #define CSUBEXP 8
236 #define CDELTA 9
237 #define CDOLLAR 10
238 #define CDUBIOUS 11
239 #define CRANGE 12
240 #define CVECTOR1 21
241 #define CDOUBLEDOT 22
242 
245 /*
246  Types of tokens in the tokenizer.
247 */
248 
249 #define TSYMBOL -1
250 #define TINDEX -2
251 #define TVECTOR -3
252 #define TFUNCTION -4
253 #define TSET -5
254 #define TEXPRESSION -6
255 #define TDOTPRODUCT -7
256 #define TNUMBER -8
257 #define TSUBEXP -9
258 #define TDELTA -10
259 #define TDOLLAR -11
260 #define TDUBIOUS -12
261 #define LPARENTHESIS -13
262 #define RPARENTHESIS -14
263 #define TWILDCARD -15
264 #define TWILDARG -16
265 #define TDOT -17
266 #define LBRACE -18
267 #define RBRACE -19
268 #define TCOMMA -20
269 #define TFUNOPEN -21
270 #define TFUNCLOSE -22
271 #define TMULTIPLY -23
272 #define TDIVIDE -24
273 #define TPOWER -25
274 #define TPLUS -26
275 #define TMINUS -27
276 #define TNOT -28
277 #define TENDOFIT -29
278 #define TSETOPEN -30
279 #define TSETCLOSE -31
280 #define TGENINDEX -32
281 #define TCONJUGATE -33
282 #define LRPARENTHESES -34
283 #define TNUMBER1 -35
284 #define TPOWER1 -36
285 #define TEMPTY -37
286 #define TSETNUM -38
287 #define TSGAMMA -39
288 #define TSETDOL -40
289 
290 #define TYPEISFUN 0
291 #define TYPEISSUB 1
292 #define TYPEISMYSTERY -1
293 
294 #define LHSIDEX 2
295 #define LHSIDE 1
296 #define RHSIDE 0
297 
298 /*
299  Output modes
300 */
301 
302 #define FORTRANMODE 1
303 #define REDUCEMODE 2
304 #define MAPLEMODE 3
305 #define MATHEMATICAMODE 4
306 #define CMODE 5
307 #define VORTRANMODE 6
308 #define PFORTRANMODE 7
309 #define DOUBLEFORTRANMODE 33
310 #define DOUBLEPRECISIONFLAG 32
311 #define NODOUBLEMASK 31
312 #define NORMALFORMAT 0
313 #define NOSPACEFORMAT 1
314 
315 #define ISNOTFORTRAN90 0
316 #define ISFORTRAN90 1
317 
318 #define ALSOREVERSE 1
319 #define CHISHOLM 2
320 #define NOTRICK 16
321 
322 #define SORTLOWFIRST 0
323 #define SORTHIGHFIRST 1
324 #define SORTPOWERFIRST 2
325 #define SORTANTIPOWER 3
326 
327 #define NMIN4SHIFT 4
328 /*
329  The next are the main codes.
330  Note: SETSET is not allowed to be 4*n+1
331  We use those codes in CoIdExpression for function information
332  after the pattern. Because SETSET also stands there we have to
333  be careful!!
334  Don't forget MAXBUILTINFUNCTION when adding codes!
335  The object FUNCTION is at the start of the functions that are in regular
336  notation. Anything below it is in special notation.
337 
338  Remark: HAAKJE0 is for compression purposes and should only occur
339  at moments that ARGWILD cannot occur.
340 */
341 #define SYMBOL 1
342 #define DOTPRODUCT 2
343 #define VECTOR 3
344 #define INDEX 4
345 #define EXPRESSION 5
346 #define SUBEXPRESSION 6
347 #define DOLLAREXPRESSION 7
348 #define SETSET 8
349 #define ARGWILD 9
350 #define MINVECTOR 10
351 #define SETEXP 11
352 #define DOLLAREXPR2 12
353 #define HAAKJE0 9
354 #define FUNCTION 20
355 
356 #define ARGFIELD 15
357 #define SNUMBER 16
358 #define LNUMBER 17
359 #define HAAKJE 18
360 #define DELTA 19
361 #define EXPONENT 20
362 #define DENOMINATOR 21
363 #define SETFUNCTION 22
364 #define GAMMA 23
365 #define GAMMAI 24
366 #define GAMMAFIVE 25
367 #define GAMMASIX 26
368 #define GAMMASEVEN 27
369 #define SUMF1 28
370 #define SUMF2 29
371 #define DUMFUN 30
372 #define REPLACEMENT 31
373 #define REVERSEFUNCTION 32
374 #define DISTRIBUTION 33
375 #define DELTA3 34
376 #define DUMMYFUN 35
377 #define DUMMYTEN 36
378 #define LEVICIVITA 37
379 #define FACTORIAL 38
380 #define INVERSEFACTORIAL 39
381 #define BINOMIAL 40
382 #define NUMARGSFUN 41
383 #define SIGNFUN 42
384 #define MODFUNCTION 43
385 #define MOD2FUNCTION 44
386 #define MINFUNCTION 45
387 #define MAXFUNCTION 46
388 #define ABSFUNCTION 47
389 #define SIGFUNCTION 48
390 #define INTFUNCTION 49
391 #define THETA 50
392 #define THETA2 51
393 #define DELTA2 52
394 #define DELTAP 53
395 #define BERNOULLIFUNCTION 54
396 #define COUNTFUNCTION 55
397 #define MATCHFUNCTION 56
398 #define PATTERNFUNCTION 57
399 #define TERMFUNCTION 58
400 #define CONJUGATION 59
401 #define ROOTFUNCTION 60
402 #define TABLEFUNCTION 61
403 #define FIRSTBRACKET 62
404 #define TERMSINEXPR 63
405 #define NUMTERMSFUN 64
406 #define GCDFUNCTION 65
407 #define DIVFUNCTION 66
408 #define REMFUNCTION 67
409 #define MAXPOWEROF 68
410 #define MINPOWEROF 69
411 #define TABLESTUB 70
412 #define FACTORIN 71
413 #define TERMSINBRACKET 72
414 #define WILDARGFUN 73
415 /*
416  In the past we would add new functions here and raise the numbers
417  on the special reserved names. This is impractical in the light of
418  the .sav files. The .sav files need a mechanism that contains the
419  value of MAXBUILTINFUNCTION at the moment of writing. This allows
420  form corrections if this value has changed in the mean time.
421 */
422 #define SQRTFUNCTION 74
423 #define LNFUNCTION 75
424 #define SINFUNCTION 76
425 #define COSFUNCTION 77
426 #define TANFUNCTION 78
427 #define ASINFUNCTION 79
428 #define ACOSFUNCTION 80
429 #define ATANFUNCTION 81
430 #define ATAN2FUNCTION 82
431 #define SINHFUNCTION 83
432 #define COSHFUNCTION 84
433 #define TANHFUNCTION 85
434 #define ASINHFUNCTION 86
435 #define ACOSHFUNCTION 87
436 #define ATANHFUNCTION 88
437 #define LI2FUNCTION 89
438 #define LINFUNCTION 90
439 
440 #define EXTRASYMFUN 91
441 #define RANDOMFUNCTION 92
442 #define RANPERM 93
443 #define NUMFACTORS 94
444 #define FIRSTTERM 95
445 #define CONTENTTERM 96
446 #define PRIMENUMBER 97
447 #define EXTEUCLIDEAN 98
448 #define MAKERATIONAL 99
449 #define INVERSEFUNCTION 100
450 
451 #define MAXBUILTINFUNCTION 100
452 #define FIRSTUSERFUNCTION 150
453 
454 /*
455  Note: if we add a builtin table we have to look also inside names.c
456  in the routine Globalize because there we assume there does not exist
457  such an object
458 */
459 
460 #define ISYMBOL 0
461 #define PISYMBOL 1
462 #define COEFFSYMBOL 2
463 #define NUMERATORSYMBOL 3
464 #define DENOMINATORSYMBOL 4
465 #define WILDARGSYMBOL 5
466 #define DIMENSIONSYMBOL 6
467 #define FACTORSYMBOL 7
468 #define SEPARATESYMBOL 8
469 
470 #define BUILTINSYMBOLS 9
471 #define FIRSTUSERSYMBOL 20
472 
473 #define BUILTININDICES 1
474 #define BUILTINVECTORS 1
475 #define BUILTINDOLLARS 1
476 
477 #define WILDARGVECTOR 0
478 #define WILDARGINDEX 0
479 
480 /*
481  The objects that have a name that starts with TYPE are codes of statements
482  made by the compiler. Each statement starts with such a code, followed by
483  its size. For how most of these statements are used can be seen in the
484  Generator function in the file proces.c
485  TYPEOPERATION is an anachronism that remains used only for the statements
486  that are executed in the file opera.c (like traces and contractions).
487 */
488 
489 #define TYPEEXPRESSION 0
490 #define TYPEIDNEW 1
491 #define TYPEIDOLD 2
492 #define TYPEOPERATION 3
493 #define TYPEREPEAT 4
494 #define TYPEENDREPEAT 5
495 /*
496  The next counts must be higher than the ones before
497 */
498 #define TYPECOUNT 20
499 #define TYPEMULT 21
500 #define TYPEGOTO 22
501 #define TYPEDISCARD 23
502 #define TYPEIF 24
503 #define TYPEELSE 25
504 #define TYPEELIF 26
505 #define TYPEENDIF 27
506 #define TYPESUM 28
507 #define TYPECHISHOLM 29
508 #define TYPEREVERSE 30
509 #define TYPEARG 31
510 #define TYPENORM 32
511 #define TYPENORM2 33
512 #define TYPENORM3 34
513 #define TYPEEXIT 35
514 #define TYPESETEXIT 36
515 #define TYPEPRINT 37
516 #define TYPEFPRINT 38
517 #define TYPEREDEFPRE 39
518 #define TYPESPLITARG 40
519 #define TYPESPLITARG2 41
520 #define TYPEFACTARG 42
521 #define TYPEFACTARG2 43
522 #define TYPETRY 44
523 #define TYPEASSIGN 45
524 #define TYPERENUMBER 46
525 #define TYPESUMFIX 47
526 #define TYPEFINDLOOP 48
527 #define TYPEUNRAVEL 49
528 #define TYPEADJUSTBOUNDS 50
529 #define TYPEINSIDE 51
530 #define TYPETERM 52
531 #define TYPESORT 53
532 #define TYPEDETCURDUM 54
533 #define TYPEINEXPRESSION 55
534 #define TYPESPLITFIRSTARG 56
535 #define TYPESPLITLASTARG 57
536 #define TYPEMERGE 58
537 #define TYPETESTUSE 59
538 #define TYPEAPPLY 60
539 #define TYPEAPPLYRESET 61
540 #define TYPECHAININ 62
541 #define TYPECHAINOUT 63
542 #define TYPENORM4 64
543 #define TYPEFACTOR 65
544 #define TYPEARGIMPLODE 66
545 #define TYPEARGEXPLODE 67
546 #define TYPEDENOMINATORS 68
547 #define TYPESTUFFLE 69
548 #define TYPEDROPCOEFFICIENT 70
549 #define TYPETRANSFORM 71
550 #define TYPETOPOLYNOMIAL 72
551 #define TYPEFROMPOLYNOMIAL 73
552 #define TYPEDOLOOP 74
553 #define TYPEENDDOLOOP 75
554 #define TYPEDROPSYMBOLS 76
555 #define TYPEPUTINSIDE 77
556 /*
557  The codes for the 'operations' that are part of TYPEOPERATION.
558 */
559 
560 #define TAKETRACE 1
561 #define CONTRACT 2
562 #define RATIO 3
563 #define SYMMETRIZE 4
564 #define TENVEC 5
565 #define SUMNUM1 6
566 #define SUMNUM2 7
567 
568 /*
569  The various types of wildcards.
570 */
571 
572 #define WILDDUMMY 0
573 #define SYMTONUM 1
574 #define SYMTOSYM 2
575 #define SYMTOSUB 3
576 #define VECTOMIN 4
577 #define VECTOVEC 5
578 #define VECTOSUB 6
579 #define INDTOIND 7
580 #define INDTOSUB 8
581 #define FUNTOFUN 9
582 #define ARGTOARG 10
583 #define ARLTOARL 11
584 #define EXPTOEXP 12
585 #define FROMBRAC 13
586 #define FROMSET 14
587 #define SETTONUM 15
588 #define WILDCARDS 16
589 #define SETNUMBER 17
590 #define LOADDOLLAR 18
591 /*
592  Some new types of wildcards that hold only for function arguments.
593 */
594 #define NUMTONUM 20
595 #define NUMTOSYM 21
596 #define NUMTOIND 22
597 #define NUMTOSUB 23
598 
599 /*
600  Dirty flags (introduced when functions got a field with a dirty flag)
601 */
602 
603 #define CLEANFLAG 0
604 #define DIRTYFLAG 1
605 #define DIRTYSYMFLAG 2
606 #define ALLDIRTY (DIRTYFLAG|DIRTYSYMFLAG)
607 #define CLEANPRF 4
608 
609 #define ARGHEAD 2
610 #define FUNHEAD 3
611 #define SUBEXPSIZE 5
612 #define EXPRHEAD 5
613 #define TYPEARGHEADSIZE 6
614 
615 /*
616  Actions to be taken with expressions. They are marked with these objects
617  during compilation.
618 */
619 
620 #define SKIP 1
621 #define DROP 2
622 #define HIDE 3
623 #define UNHIDE 4
624 #define INTOHIDE 5
625 
626 /*
627  Types of expressions
628 */
629 
630 #define LOCALEXPRESSION 0
631 #define SKIPLEXPRESSION 1
632 #define DROPLEXPRESSION 2
633 #define DROPPEDEXPRESSION 3
634 #define GLOBALEXPRESSION 4
635 #define SKIPGEXPRESSION 5
636 #define DROPGEXPRESSION 6
637 #define STOREDEXPRESSION 8
638 #define HIDDENLEXPRESSION 9
639 #define HIDDENGEXPRESSION 13
640 #define INCEXPRESSION 9
641 #define HIDELEXPRESSION 10
642 #define HIDEGEXPRESSION 14
643 #define DROPHLEXPRESSION 11
644 #define DROPHGEXPRESSION 15
645 #define UNHIDELEXPRESSION 12
646 #define UNHIDEGEXPRESSION 16
647 #define INTOHIDELEXPRESSION 17
648 #define INTOHIDEGEXPRESSION 18
649 
650 #define PRINTOFF 0
651 #define PRINTON 1
652 #define PRINTCONTENTS 2
653 #define PRINTCONTENT 3
654 #define PRINTLFILE 4
655 #define PRINTONETERM 8
656 #define PRINTONEFUNCTION 16
657 #define PRINTALL 32
658 
659 /*
660  Special codes for the replace variable in the EXPRESSIONS struct
661 */
662 
663 #define REGULAREXPRESSION -1
664 #define REDEFINEDEXPRESSION -2
665 #define NEWLYDEFINEDEXPRESSION -3
666 
674 #define GENERALFUNCTION 0
675 #define FASTFUNCTION 1
676 #define TENSORFUNCTION 2
677 #define GAMMAFUNCTION 4
678 
680 /*
681  Special sets
682 */
683 
684 #define POS_ 0 /* integer > 0 */
685 #define POS0_ 1 /* integer >= 0 */
686 #define NEG_ 2 /* integer < 0 */
687 #define NEG0_ 3 /* integer <= 0 */
688 #define EVEN_ 4 /* integer (even) */
689 #define ODD_ 5 /* integer (odd) */
690 #define Z_ 6 /* integer */
691 #define SYMBOL_ 7 /* symbol only */
692 #define FIXED_ 8 /* fixed index */
693 #define INDEX_ 9 /* index only */
694 #define Q_ 10 /* rational */
695 #define DUMMYINDEX_ 11 /* dummy index only */
696 
697 /*
698  Special indices.
699 */
700 
701 #define GAMMA1 0
702 #define GAMMA5 -1
703 #define GAMMA6 -2
704 #define GAMMA7 -3
705 #define FUNNYVEC -4
706 #define FUNNYWILD -5
707 #define SUMMEDIND -6
708 #define NOINDEX -7
709 #define FUNNYDOLLAR -8
710 #define EMPTYINDEX -9
711 
712 /*
713  The next one should be less than all of the above special indices.
714 */
715 
716 #define MINSPEC -10
717 
718 #define USEDFLAG 2
719 #define DUMMYFLAG 1
720 
721 #define MAINSORT 0
722 #define FUNCTIONSORT 1
723 #define SUBSORT 2
724 
725 #define FLOATMODE 1
726 #define RATIONALMODE 0
727 
728 #define NUMSPECSETS 10
729 #define EATTENSOR 0x2000
730 
731 #define ISZERO 1
732 #define ISUNMODIFIED 2
733 #define ISCOMPRESSED 4
734 #define ISINRHS 8
735 #define ISFACTORIZED 16
736 #define TOBEFACTORED 32
737 #define TOBEUNFACTORED 64
738 #define KEEPZERO 128
739 
740 #define VARTYPENONE 0
741 #define VARTYPECOMPLEX 1
742 #define VARTYPEIMAGINARY 2
743 #define VARTYPEROOTOFUNITY 4
744 #define VARTYPEMINUS 8
745 #define CYCLESYMMETRIC 1
746 #define RCYCLESYMMETRIC 2
747 #define SYMMETRIC 3
748 #define ANTISYMMETRIC 4
749 #define REVERSEORDER 256
750 
751 /*
752  Types of id statements (substitutions)
753 */
754 
755 #define SUBMULTI 1
756 #define SUBONCE 2
757 #define SUBONLY 3
758 #define SUBMANY 4
759 #define SUBALL 5
760 #define SUBSELECT 6
761 #define SUBMASK 15
762 #define SUBDISORDER 16
763 #define SUBAFTER 32
764 #define SUBAFTERNOT 64
765 
766 #define IDHEAD 5
767 
768 #define GIDENT 1
769 #define GFIVE 4
770 #define GPLUS 3
771 #define GMINUS 2
772 
773 /*
774  Types of objects inside an if clause.
775 */
776 
777 #define LONGNUMBER 1
778 #define MATCH 2
779 #define COEFFI 3
780 #define SUBEXPR 4
781 #define MULTIPLEOF 5
782 #define IFDOLLAR 6
783 #define IFEXPRESSION 7
784 #define IFDOLLAREXTRA 8
785 #define IFISFACTORIZED 9
786 #define GREATER 0
787 #define GREATEREQUAL 1
788 #define LESS 2
789 #define LESSEQUAL 3
790 #define EQUAL 4
791 #define NOTEQUAL 5
792 #define ORCOND 6
793 #define ANDCOND 7
794 #define DUMMY 1
795 #define SORT 1
796 #define STORE 2
797 #define END 3
798 #define GLOBAL 4
799 #define CLEAR 5
800 
801 #define VECTBIT 1
802 #define DOTPBIT 2
803 #define FUNBIT 4
804 #define SETBIT 8
805 
806 #define EXTRAPARAMETER 0x4000
807 #define GENCOMMUTE 0
808 #define GENNONCOMMUTE 0x2000
809 
810 #define NAMENOTFOUND -9
811 
812 /*
813  Types of dollar expressions.
814 */
815 
816 #define DOLUNDEFINED 0
817 #define DOLNUMBER 1
818 #define DOLARGUMENT 2
819 #define DOLSUBTERM 3
820 #define DOLTERMS 4
821 #define DOLWILDARGS 5
822 #define DOLINDEX 6
823 #define DOLZERO 7
824 
825 #define FINDLOOP 0
826 #define REPLACELOOP 1
827 
828 #define NOFUNPOWERS 0
829 #define COMFUNPOWERS 1
830 #define ALLFUNPOWERS 2
831 
832 #define PROPERORDERFLAG 0
833 
834 #define REGULAR 0
835 #define FINISH 1
836 
837 #define POLYADD 1
838 #define POLYSUB 2
839 #define POLYMUL 3
840 #define POLYDIV 4
841 #define POLYREM 5
842 #define POLYGCD 6
843 #define POLYINTFAC 7
844 #define POLYNORM 8
845 
846 #define MODNONE 0
847 #define MODSUM 1
848 #define MODMAX 2
849 #define MODMIN 3
850 #define MODLOCAL 4
851 
852 #define ELEMENTUSED 1
853 #define ELEMENTLOADED 2
854 /*
855  Variables for the modulus statement, flags in AC.modmode
856  For explanation, see CoModulus
857 */
858 #define POSNEG 0x1
859 #define INVERSETABLE 0x2
860 #define COEFFICIENTSONLY 0x4
861 #define ALSOPOWERS 0x8
862 #define ALSOFUNARGS 0x10
863 #define ALSODOLLARS 0x20
864 #define NOINVERSES 0x40
865 
866 #define POSITIVEONLY 0
867 #define UNPACK 0x80
868 #define NOUNPACK 0
869 #define FROMFUNCTION 0x100
870 
871 #define VARNAMES 0
872 #define AUTONAMES 1
873 #define EXPRNAMES 2
874 #define DOLLARNAMES 3
875 
876 #ifdef WITHPTHREADS
877 /*
878  Signals that the workers have to react to
879 */
880 
881 #define TERMINATETHREAD -1
882 #define STARTNEWEXPRESSION 1
883 #define LOWESTLEVELGENERATION 2
884 #define FINISHEXPRESSION 3
885 #define CLEANUPEXPRESSION 4
886 #define HIGHERLEVELGENERATION 5
887 #define STARTNEWMODULE 6
888 #define CLAIMOUTPUT 7
889 #define FINISHEXPRESSION2 8
890 #define INISORTBOT 7
891 #define RUNSORTBOT 8
892 #define DOONEEXPRESSION 9
893 #define DOBRACKETS 10
894 #define CLEARCLOCK 11
895 #define MCTSEXPANDTREE 12
896 #define OPTIMIZEEXPRESSION 13
897 
898 #define MASTERBUFFERISFULL 1
899 
900 /*
901  Bucket states
902 */
903 
904 #define BUCKETFREE 1
905 #define BUCKETINUSE 0
906 #define BUCKETCOMINGFREE 2
907 #define BUCKETFILLED -1
908 #define BUCKETATEND -2
909 #define BUCKETTERMINATED 3
910 #define BUCKETRELEASED 4
911 
912 #define NUMBEROFBLOCKSINSORT 10
913 #define MINIMUMNUMBEROFTERMS 10
914 
915 #define BUCKETDOINGTERM 1
916 #define BUCKETASSIGNED -1
917 #define BUCKETTOBERELEASED -2
918 #define BUCKETPREPARINGTERM 0
919 
920 #define BUCKETDOINGTERMS 0
921 #define BUCKETDOINGBRACKET 1
922 #endif
923 
924 /*
925  The next variable is because there is some use of cbufnum that is
926  probably irrelevant. We use here DUMMYBUFNUM instead of AC.cbufnum
927  just in case we run into trouble later.
928 */
929 #define DUMMYBUFFER 1
930 
931 #define ALLARGS 1
932 #define NUMARG 2
933 #define ARGRANGE 3
934 #define MAKEARGS 4
935 #define MAXRANGEINDICATOR 4
936 #define REPLACEARG 5
937 #define ENCODEARG 6
938 #define DECODEARG 7
939 #define IMPLODEARG 8
940 #define EXPLODEARG 9
941 #define PERMUTEARG 10
942 #define REVERSEARG 11
943 #define CYCLEARG 12
944 #define ISLYNDON 13
945 #define ISLYNDONR 14
946 #define TOLYNDON 15
947 #define TOLYNDONR 16
948 
949 #define BASECODE 1
950 #define YESLYNDON 1
951 #define NOLYNDON 2
952 
953 #define TOPOLYNOMIALFLAG 1
954 #define FACTARGFLAG 2
955 
956 #define OLDFACTARG 1
957 #define NEWFACTARG 0
958 
959 #define FROMMODULEOPTION 0
960 #define FROMPOINTINSTRUCTION 1
961 
962 #define EXTRASYMBOL 0
963 #define REGULARSYMBOL 1
964 #define EXPRESSIONNUMBER 2
965 
966 #define O_NONE 0
967 #define O_CSE 1
968 #define O_CSEGREEDY 2
969 #define O_GREEDY 3
970 
971 #define O_OCCURRENCE 0
972 #define O_MCTS 1
973 
974 #define O_FORWARD 0
975 #define O_BACKWARD 1
976 #define O_FORWARDORBACKWARD 2
977 #define O_FORWARDANDBACKWARD 3
978 
979 #define OPTHEAD 3
980 #define DOALL 1
981 #define ONLYFUNCTIONS 2