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