FORM  4.2
inivar.h
Go to the documentation of this file.
1 
7 /* #[ License : */
8 /*
9  * Copyright (C) 1984-2017 J.A.M. Vermaseren
10  * When using this file you are requested to refer to the publication
11  * J.A.M.Vermaseren "New features of FORM" math-ph/0010025
12  * This is considered a matter of courtesy as the development was paid
13  * for by FOM the Dutch physics granting agency and we would like to
14  * be able to track its scientific use to convince FOM of its value
15  * for the community.
16  *
17  * This file is part of FORM.
18  *
19  * FORM is free software: you can redistribute it and/or modify it under the
20  * terms of the GNU General Public License as published by the Free Software
21  * Foundation, either version 3 of the License, or (at your option) any later
22  * version.
23  *
24  * FORM is distributed in the hope that it will be useful, but WITHOUT ANY
25  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
26  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
27  * details.
28  *
29  * You should have received a copy of the GNU General Public License along
30  * with FORM. If not, see <http://www.gnu.org/licenses/>.
31  */
32 /* #] License : */
33 
34 FIXEDGLOBALS FG = {
35  {Traces /* Dummy as zeroeth argument */
36  ,Traces
37  ,EpfCon
38  ,RatioGen
39  ,SymGen
40  ,TenVec
41  ,DoSumF1
42  ,DoSumF2}
43 
44  ,{TraceFind /* Dummy as zeroeth argument */
45  ,TraceFind
46  ,EpfFind
47  ,RatioFind
48  ,SymFind
49  ,TenVecFind}
50 
51  ,{"symbol"
52  ,"index"
53  ,"vector"
54  ,"function"
55  ,"set"
56  ,"expression"
57  ,"dotproduct"
58  ,"number"
59  ,"subexp"
60  ,"delta"}
61 
62  ,{"(local)"
63  ,"(skip/local)"
64  ,"(drop/local)"
65  ,"(dropped)"
66  ,"(global)"
67  ,"(skip/global)"
68  ,"(drop/global)"
69  ,"(dropped)"
70  ,"(stored)"
71  ,"(local-hidden)"
72  ,"(local-to be hidden)"
73  ,"(local-hidden-dropped)"
74  ,"(local-to be unhidden)"
75  ,"(global-hidden)"
76  ,"(global-to be hidden)"
77  ,"(global-hidden-dropped)"
78  ,"(global-to be unhidden)"
79  ,"(into-hide-local)"
80  ,"(into-hide-global)"
81  ,"(spectator)"
82  ,"(drop/spectator)"}
83 
84  ,{" Functions"
85  ," Commuting Functions"}
86 
87  ,{"left "
88  ,"active "
89  ,"in output"}
90 
91  ,(char *)0
92  ,(char *)0
93  ,(UBYTE *)"1"
94  ,(WORD)0
95  ,(WORD)0
96 
97 /* ASCII table of character types. Note that on some computers this
98  table may be different from the ASCII table.
99 
100  -1 Illegal character
101  0 Alphabetic character
102  1 Digit
103  2 . $ _ ? # or '
104  3 [,]
105  4 ( ) = ; or ,
106  5 + - * % / ^ :
107  6 blank, tab, linefeed
108  7 {,|,}
109  8 ! & < >
110  9 "
111  10 The ultimate end.
112 */
113  ,{ 10,255,255,255,255,255,255,255,255, 6, 6,255,255, 6,255,255,
114  255,255,255,255,255,255,255,255,255,255, 10,255,255,255,255,255,
115  6, 8, 9, 2, 2, 5, 8, 2, 4, 4, 5, 5, 4, 5, 2, 5,
116  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 4, 8, 4, 8, 2,
117  255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
118  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,255, 3, 5, 2,
119  255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
120  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7,255,255,
121  255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
122  255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
123  255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
124  255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
125  255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
126  255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
127  255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
128  255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255 }
129 };
130 
131 ALLGLOBALS A;
132 #ifdef WITHPTHREADS
133 ALLPRIVATES **AB;
134 #endif
135 
136 static struct fixedfun {
137  char *name;
138  int commu ,tensor ,complx ,symmetric;
139 } fixedfunctions[] = {
140  {"exp_" ,1 ,0 ,0 ,0} /* EXPONENT */
141  ,{"denom_" ,1 ,0 ,0 ,0} /* DENOMINATOR */
142  ,{"setfun_" ,1 ,0 ,0 ,0} /* SETFUNCTION */
143  ,{"g_" ,1 ,GAMMAFUNCTION ,VARTYPEIMAGINARY,0} /* GAMMA */
144  ,{"gi_" ,1 ,GAMMAFUNCTION ,VARTYPEIMAGINARY,0} /* GAMMAI */
145  ,{"g5_" ,1 ,GAMMAFUNCTION ,VARTYPEIMAGINARY,0} /* GAMMAFIVE */
146  ,{"g6_" ,1 ,GAMMAFUNCTION ,VARTYPEIMAGINARY,0} /* GAMMASIX */
147  ,{"g7_" ,1 ,GAMMAFUNCTION ,VARTYPEIMAGINARY,0} /* GAMMASEVEN */
148  ,{"sum_" ,1 ,0 ,0 ,0} /* SUMF1 */
149  ,{"sump_" ,1 ,0 ,0 ,0} /* SUMF2 */
150  ,{"dum_" ,1 ,0 ,0 ,0} /* DUMFUN */
151  ,{"replace_" ,0 ,0 ,0 ,0} /* REPLACEMENT */
152  ,{"reverse_" ,1 ,0 ,0 ,0} /* REVERSEFUNCTION */
153  ,{"distrib_" ,1 ,0 ,0 ,0} /* DISTRIBUTION */
154  ,{"dd_" ,0 ,TENSORFUNCTION ,0 ,0} /* DELTA3 */
155  ,{"dummy_" ,0 ,0 ,0 ,0} /* DUMMYFUN */
156  ,{"dummyten_",0 ,TENSORFUNCTION ,0 ,0} /* DUMMYTEN */
157  ,{"e_" ,0 ,TENSORFUNCTION|1 ,VARTYPEIMAGINARY,ANTISYMMETRIC}
158  /* LEVICIVITA */
159  ,{"fac_" ,0 ,0 ,0 ,0} /* FACTORIAL */
160  ,{"invfac_" ,0 ,0 ,0 ,0} /* INVERSEFACTORIAL */
161  ,{"binom_" ,0 ,0 ,0 ,0} /* BINOMIAL */
162  ,{"nargs_" ,0 ,0 ,0 ,0} /* NUMARGSFUN */
163  ,{"sign_" ,0 ,0 ,0 ,0} /* SIGNFUN */
164  ,{"mod_" ,0 ,0 ,0 ,0} /* MODFUNCTION */
165  ,{"mod2_" ,0 ,0 ,0 ,0} /* MOD2FUNCTION */
166  ,{"min_" ,0 ,0 ,0 ,0} /* MINFUNCTION */
167  ,{"max_" ,0 ,0 ,0 ,0} /* MAXFUNCTION */
168  ,{"abs_" ,0 ,0 ,0 ,0} /* ABSFUNCTION */
169  ,{"sig_" ,0 ,0 ,0 ,0} /* SIGFUNCTION */
170  ,{"integer_" ,0 ,0 ,0 ,0} /* INTFUNCTION */
171  ,{"theta_" ,0 ,0 ,0 ,0} /* THETA */
172  ,{"thetap_" ,0 ,0 ,0 ,0} /* THETA2 */
173  ,{"delta_" ,0 ,0 ,0 ,0} /* DELTA2 */
174  ,{"deltap_" ,0 ,0 ,0 ,0} /* DELTAP */
175  ,{"bernoulli_",0,0 ,0 ,0} /* BERNOULLIFUNCTION */
176  ,{"count_" ,0 ,0 ,0 ,0} /* COUNTFUNCTION */
177  ,{"match_" ,0 ,0 ,0 ,0} /* MATCHFUNCTION */
178  ,{"pattern_" ,0 ,0 ,VARTYPECOMPLEX ,0} /* PATTERNFUNCTION */
179  ,{"term_" ,1 ,0 ,0 ,0} /* TERMFUNCTION */
180  ,{"conjg_" ,1 ,0 ,VARTYPECOMPLEX ,0} /* CONJUGATEFUNCTION */
181  ,{"root_" ,0 ,0 ,0 ,0} /* ROOTFUNCTION */
182  ,{"table_" ,1 ,0 ,0 ,0} /* TABLEFUNCTION */
183  ,{"firstbracket_",0 ,0 ,0 ,0} /* FIRSTBRACKET */
184  ,{"termsin_" ,0 ,0 ,0 ,0} /* TERMSINEXPR */
185  ,{"nterms_" ,0 ,0 ,0 ,0} /* NUMTERMSFUN */
186  ,{"gcd_" ,0 ,0 ,0 ,0} /* GCDFUNCTION */
187  ,{"div_" ,0 ,0 ,0 ,0} /* DIVFUNCTION */
188  ,{"rem_" ,0 ,0 ,0 ,0} /* REMFUNCTION */
189  ,{"maxpowerof_",0 ,0 ,0 ,0} /* MAXPOWEROF */
190  ,{"minpowerof_",0 ,0 ,0 ,0} /* MINPOWEROF */
191  ,{"tbl_" ,0 ,0 ,0 ,0} /* TABLESTUB */
192  ,{"factorin_",0 ,0 ,0 ,0} /* FACTORIN */
193  ,{"termsinbracket_",0 ,0 ,0 ,0} /* TERMSINBRACKET */
194  ,{"farg_" ,0 ,0 ,0 ,0} /* WILDARGFUN */
195 /*
196  The following names are reserved for the floating point library.
197  As long as we have no floating point numbers they do not do anything.
198 */
199  ,{"sqrt_" ,0 ,0 ,0 ,0} /* SQRTFUNCTION */
200  ,{"ln_" ,0 ,0 ,0 ,0} /* LNFUNCTION */
201  ,{"sin_" ,0 ,0 ,0 ,0} /* SINFUNCTION */
202  ,{"cos_" ,0 ,0 ,0 ,0} /* COSFUNCTION */
203  ,{"tan_" ,0 ,0 ,0 ,0} /* TANFUNCTION */
204  ,{"asin_" ,0 ,0 ,0 ,0} /* ASINFUNCTION */
205  ,{"acos_" ,0 ,0 ,0 ,0} /* ACOSFUNCTION */
206  ,{"atan_" ,0 ,0 ,0 ,0} /* ATANFUNCTION */
207  ,{"atan2_" ,0 ,0 ,0 ,0} /* ATAN2FUNCTION */
208  ,{"sinh_" ,0 ,0 ,0 ,0} /* SINHFUNCTION */
209  ,{"cosh_" ,0 ,0 ,0 ,0} /* COSHFUNCTION */
210  ,{"tanh_" ,0 ,0 ,0 ,0} /* TANHFUNCTION */
211  ,{"asinh_" ,0 ,0 ,0 ,0} /* ASINHFUNCTION */
212  ,{"acosh_" ,0 ,0 ,0 ,0} /* ACOSHFUNCTION */
213  ,{"atanh_" ,0 ,0 ,0 ,0} /* ATANHFUNCTION */
214  ,{"li2_" ,0 ,0 ,0 ,0} /* LI2FUNCTION */
215  ,{"lin_" ,0 ,0 ,0 ,0} /* LINFUNCTION */
216 /*
217  From here on we continue with new functions (26-sep-2010)
218 */
219  ,{"extrasymbol_",0 ,0 ,0 ,0} /* EXTRASYMFUN */
220  ,{"random_" ,0 ,0 ,0 ,0} /* RANDOMFUNCTION */
221  ,{"ranperm_" ,1 ,0 ,0 ,0} /* RANPERM */
222  ,{"numfactors_" ,0 ,0 ,0 ,0} /* NUMFACTORS */
223  ,{"firstterm_" ,0 ,0 ,0 ,0} /* FIRSTTERM */
224  ,{"content_" ,0 ,0 ,0 ,0} /* CONTENTTERM */
225  ,{"prime_" ,0 ,0 ,0 ,0} /* PRIMENUMBER */
226  ,{"exteuclidean_",0 ,0 ,0 ,0} /* EXTEUCLIDEAN */
227  ,{"makerational_",0 ,0 ,0 ,0} /* MAKERATIONAL */
228  ,{"inverse_" ,0 ,0 ,0 ,0} /* INVERSEFUNCTION */
229  ,{"id_" ,1 ,0 ,0 ,0} /* IDFUNCTION */
230  ,{"putfirst_" ,1 ,0 ,0 ,0} /* PUTFIRST */
231  ,{"perm_" ,1 ,0 ,0 ,0} /* PERMUTATIONS */
232  ,{"partitions_" ,1 ,0 ,0 ,0} /* PARTITIONS */
233  ,{"mul_" ,0 ,0 ,0 ,0} /* MULFUNCTION */
234 };
235 
236 FIXEDSET fixedsets[] = {
237  {"pos_", "integers > 0", CSYMBOL, 0} /* POS_ 0 */
238  ,{"pos0_", "integers >= 0", CSYMBOL, 0} /* POS0_ 1 */
239  ,{"neg_", "integers < 0", CSYMBOL, 0} /* NEG_ 2 */
240  ,{"neg0_", "integers <= 0", CSYMBOL, 0} /* NEG0_ 3 */
241  ,{"even_", "even integers", CSYMBOL, 0} /* EVEN_ 4 */
242  ,{"odd_", "odd integers", CSYMBOL, 0} /* ODD_ 5 */
243  ,{"int_", "all integers", CSYMBOL, 0} /* Z_ 6 */
244  ,{"symbol_","only symbols", CSYMBOL, MAXPOSITIVE} /* SYMBOL_ 7 */
245  ,{"fixed_", "fixed indices", CINDEX, 0} /* FIXED_ 8 */
246  ,{"index_", "all indices", CINDEX, 0} /* INDEX_ 9 */
247  ,{"number_","all rationals", CSYMBOL, 0} /* Q_ 10 */
248  ,{"dummyindices_", "dummy indices", CINDEX, 0} /* DUMMYINDEX_ 11 */
249  ,{"vector_","only vectors", CVECTOR, 0} /* VECTOR_ 12 */
250 };
251 
252 UBYTE BufferForOutput[MAXLINELENGTH+14];
253 
254 char *setupfilename = "form.set";
255 
256 #ifdef WITHPTHREADS
257 INILOCK(ErrorMessageLock);
258 INILOCK(FileReadLock);
259 #endif