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