FORM  4.1
inivar.h
Go to the documentation of this file.
1 
7 /* #[ License : */
8 /*
9  * Copyright (C) 1984-2013 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 
80  ,{" Functions"
81  ," Commuting Functions"}
82 
83  ,{"left "
84  ,"active "
85  ,"in output"}
86 
87  ,(char *)0
88  ,(UBYTE *)"1"
89 
90 /* ASCII table of character types. Note that on some computers this
91  table may be different from the ASCII table.
92 
93  -1 Illegal character
94  0 Alphabetic character
95  1 Digit
96  2 . $ _ ? # or '
97  3 [,]
98  4 ( ) = ; or ,
99  5 + - * % / ^ :
100  6 blank, tab, linefeed
101  7 {,|,}
102  8 ! & < >
103  9 "
104  10 The ultimate end.
105 */
106  ,{ 10,255,255,255,255,255,255,255,255, 6, 6,255,255, 6,255,255,
107  255,255,255,255,255,255,255,255,255,255, 10,255,255,255,255,255,
108  6, 8, 9, 2, 2, 5, 8, 2, 4, 4, 5, 5, 4, 5, 2, 5,
109  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 4, 8, 4, 8, 2,
110  255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
111  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,255, 3, 5, 2,
112  255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
113  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7,255,255,
114  255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
115  255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
116  255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
117  255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
118  255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
119  255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
120  255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
121  255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255 }
122 };
123 
124 ALLGLOBALS A;
125 #ifdef WITHPTHREADS
126 ALLPRIVATES **AB;
127 #endif
128 
129 static struct fixedfun {
130  char *name;
131  int commu ,tensor ,complx ,symmetric;
132 } fixedfunctions[] = {
133  {"exp_" ,1 ,0 ,0 ,0} /* EXPONENT */
134  ,{"denom_" ,1 ,0 ,0 ,0} /* DENOMINATOR */
135  ,{"setfun_" ,1 ,0 ,0 ,0} /* SETFUNCTION */
136  ,{"g_" ,1 ,GAMMAFUNCTION ,VARTYPEIMAGINARY,0} /* GAMMA */
137  ,{"gi_" ,1 ,GAMMAFUNCTION ,VARTYPEIMAGINARY,0} /* GAMMAI */
138  ,{"g5_" ,1 ,GAMMAFUNCTION ,VARTYPEIMAGINARY,0} /* GAMMAFIVE */
139  ,{"g6_" ,1 ,GAMMAFUNCTION ,VARTYPEIMAGINARY,0} /* GAMMASIX */
140  ,{"g7_" ,1 ,GAMMAFUNCTION ,VARTYPEIMAGINARY,0} /* GAMMASEVEN */
141  ,{"sum_" ,1 ,0 ,0 ,0} /* SUMF1 */
142  ,{"sump_" ,1 ,0 ,0 ,0} /* SUMF2 */
143  ,{"dum_" ,1 ,0 ,0 ,0} /* DUMFUN */
144  ,{"replace_" ,0 ,0 ,0 ,0} /* REPLACEMENT */
145  ,{"reverse_" ,1 ,0 ,0 ,0} /* REVERSEFUNCTION */
146  ,{"distrib_" ,1 ,0 ,0 ,0} /* DISTRIBUTION */
147  ,{"dd_" ,0 ,TENSORFUNCTION ,0 ,0} /* DELTA3 */
148  ,{"dummy_" ,0 ,0 ,0 ,0} /* DUMMYFUN */
149  ,{"dummyten_",0 ,TENSORFUNCTION ,0 ,0} /* DUMMYTEN */
150  ,{"e_" ,0 ,TENSORFUNCTION|1 ,VARTYPEIMAGINARY,ANTISYMMETRIC}
151  /* LEVICIVITA */
152  ,{"fac_" ,0 ,0 ,0 ,0} /* FACTORIAL */
153  ,{"invfac_" ,0 ,0 ,0 ,0} /* INVERSEFACTORIAL */
154  ,{"binom_" ,0 ,0 ,0 ,0} /* BINOMIAL */
155  ,{"nargs_" ,0 ,0 ,0 ,0} /* NUMARGSFUN */
156  ,{"sign_" ,0 ,0 ,0 ,0} /* SIGNFUN */
157  ,{"mod_" ,0 ,0 ,0 ,0} /* MODFUNCTION */
158  ,{"mod2_" ,0 ,0 ,0 ,0} /* MOD2FUNCTION */
159  ,{"min_" ,0 ,0 ,0 ,0} /* MINFUNCTION */
160  ,{"max_" ,0 ,0 ,0 ,0} /* MAXFUNCTION */
161  ,{"abs_" ,0 ,0 ,0 ,0} /* ABSFUNCTION */
162  ,{"sig_" ,0 ,0 ,0 ,0} /* SIGFUNCTION */
163  ,{"integer_" ,0 ,0 ,0 ,0} /* INTFUNCTION */
164  ,{"theta_" ,0 ,0 ,0 ,0} /* THETA */
165  ,{"thetap_" ,0 ,0 ,0 ,0} /* THETA2 */
166  ,{"delta_" ,0 ,0 ,0 ,0} /* DELTA2 */
167  ,{"deltap_" ,0 ,0 ,0 ,0} /* DELTAP */
168  ,{"bernoulli_",0,0 ,0 ,0} /* BERNOULLIFUNCTION */
169  ,{"count_" ,0 ,0 ,0 ,0} /* COUNTFUNCTION */
170  ,{"match_" ,0 ,0 ,0 ,0} /* MATCHFUNCTION */
171  ,{"pattern_" ,0 ,0 ,VARTYPECOMPLEX ,0} /* PATTERNFUNCTION */
172  ,{"term_" ,1 ,0 ,0 ,0} /* TERMFUNCTION */
173  ,{"conjg_" ,1 ,0 ,VARTYPECOMPLEX ,0} /* CONJUGATEFUNCTION */
174  ,{"root_" ,0 ,0 ,0 ,0} /* ROOTFUNCTION */
175  ,{"table_" ,1 ,0 ,0 ,0} /* TABLEFUNCTION */
176  ,{"firstbracket_",0 ,0 ,0 ,0} /* FIRSTBRACKET */
177  ,{"termsin_" ,0 ,0 ,0 ,0} /* TERMSINEXPR */
178  ,{"nterms_" ,0 ,0 ,0 ,0} /* NUMTERMSFUN */
179  ,{"gcd_" ,0 ,0 ,0 ,0} /* GCDFUNCTION */
180  ,{"div_" ,0 ,0 ,0 ,0} /* DIVFUNCTION */
181  ,{"rem_" ,0 ,0 ,0 ,0} /* REMFUNCTION */
182  ,{"maxpowerof_",0 ,0 ,0 ,0} /* MAXPOWEROF */
183  ,{"minpowerof_",0 ,0 ,0 ,0} /* MINPOWEROF */
184  ,{"tbl_" ,0 ,0 ,0 ,0} /* TABLESTUB */
185  ,{"factorin_",0 ,0 ,0 ,0} /* FACTORIN */
186  ,{"termsinbracket_",0 ,0 ,0 ,0} /* TERMSINBRACKET */
187  ,{"farg_" ,0 ,0 ,0 ,0} /* WILDARGFUN */
188 /*
189  The following names are reserved for the floating point library.
190  As long as we have no floating point numbers they do not do anything.
191 */
192  ,{"sqrt_" ,0 ,0 ,0 ,0} /* SQRTFUNCTION */
193  ,{"ln_" ,0 ,0 ,0 ,0} /* LNFUNCTION */
194  ,{"sin_" ,0 ,0 ,0 ,0} /* SINFUNCTION */
195  ,{"cos_" ,0 ,0 ,0 ,0} /* COSFUNCTION */
196  ,{"tan_" ,0 ,0 ,0 ,0} /* TANFUNCTION */
197  ,{"asin_" ,0 ,0 ,0 ,0} /* ASINFUNCTION */
198  ,{"acos_" ,0 ,0 ,0 ,0} /* ACOSFUNCTION */
199  ,{"atan_" ,0 ,0 ,0 ,0} /* ATANFUNCTION */
200  ,{"atan2_" ,0 ,0 ,0 ,0} /* ATAN2FUNCTION */
201  ,{"sinh_" ,0 ,0 ,0 ,0} /* SINHFUNCTION */
202  ,{"cosh_" ,0 ,0 ,0 ,0} /* COSHFUNCTION */
203  ,{"tanh_" ,0 ,0 ,0 ,0} /* TANHFUNCTION */
204  ,{"asinh_" ,0 ,0 ,0 ,0} /* ASINHFUNCTION */
205  ,{"acosh_" ,0 ,0 ,0 ,0} /* ACOSHFUNCTION */
206  ,{"atanh_" ,0 ,0 ,0 ,0} /* ATANHFUNCTION */
207  ,{"li2_" ,0 ,0 ,0 ,0} /* LI2FUNCTION */
208  ,{"lin_" ,0 ,0 ,0 ,0} /* LINFUNCTION */
209 /*
210  From here on we continue with new functions (26-sep-2010)
211 */
212  ,{"extrasymbol_",0 ,0 ,0 ,0} /* EXTRASYMFUN */
213  ,{"random_" ,0 ,0 ,0 ,0} /* RANDOMFUNCTION */
214  ,{"ranperm_" ,1 ,0 ,0 ,0} /* RANPERM */
215  ,{"numfactors_" ,0 ,0 ,0 ,0} /* NUMFACTORS */
216  ,{"firstterm_" ,0 ,0 ,0 ,0} /* FIRSTTERM */
217  ,{"content_" ,0 ,0 ,0 ,0} /* CONTENTTERM */
218  ,{"prime_" ,0 ,0 ,0 ,0} /* PRIMENUMBER */
219  ,{"exteuclidean_",0 ,0 ,0 ,0} /* EXTEUCLIDEAN */
220  ,{"makerational_",0 ,0 ,0 ,0} /* MAKERATIONAL */
221  ,{"inverse_" ,0 ,0 ,0 ,0} /* INVERSEFUNCTION */
222 };
223 
224 FIXEDSET fixedsets[] = {
225  {"pos_", "integers > 0", CSYMBOL, 0} /* POS_ 0 */
226  ,{"pos0_", "integers >= 0", CSYMBOL, 0} /* POS0_ 1 */
227  ,{"neg_", "integers < 0", CSYMBOL, 0} /* NEG_ 2 */
228  ,{"neg0_", "integers <= 0", CSYMBOL, 0} /* NEG0_ 3 */
229  ,{"even_", "even integers", CSYMBOL, 0} /* EVEN_ 4 */
230  ,{"odd_", "odd integers", CSYMBOL, 0} /* ODD_ 5 */
231  ,{"int_", "all integers", CSYMBOL, 0} /* Z_ 6 */
232  ,{"symbol_","only symbols", CSYMBOL, MAXPOSITIVE} /* SYMBOL_ 7 */
233  ,{"fixed_", "fixed indices", CINDEX, 0} /* FIXED_ 8 */
234  ,{"index_", "all indices", CINDEX, 0} /* INDEX_ 9 */
235  ,{"number_","all rationals", CSYMBOL, 0} /* Q_ 10 */
236  ,{"dummyindices_", "dummy indices", CINDEX, 0} /* DUMMYINDEX_ 11 */
237 };
238 
239 UBYTE BufferForOutput[MAXLINELENGTH+14];
240 
241 char *setupfilename = "form.set";
242 
243 #ifdef WITHPTHREADS
244 INILOCK(ErrorMessageLock);
245 INILOCK(FileReadLock);
246 #endif