Sindbad~EG File Manager

Current Path : /usr/home/beeson/MathXpert/
Upload File :
Current File : /usr/home/beeson/MathXpert/functors.h

/* M. Beeson, for Mathpert */
/* definitions of built-in atoms and functors */

/* Predefined atoms  (not given by ascii codes)___________________________*/

#define FALSEFUNCTOR 1   /* not FALSE, so as not to cause any conflicts */
#define TRUEFUNCTOR 2
#define ALPHA 3          /* first atom to use the symbol font */
#define BETA 4
#define LITTLEGAMMA 5
#define INFINITYFUNCTOR 6
#define DELTA  7
#define EPSILON 8
#define LAMBDA 9
#define MU 10
#define SIGMA 11   /* lowercase sigma; big sigma means 'sum' */
#define PI_ATOM 12
#define THETA 13
#define PHI 14
#define LEFT 15    /* for one-sided limit terms */
#define RIGHT 16
#define UNDEFINED 17
#define BOUNDED_OSCILLATIONS 18
#define UNBOUNDED_OSCILLATIONS 19
#define TINY 20   /* an infinitesimal for use by the theorem-prover */
#define EULERGAMMA 194   /* Euler-Mascheroni constant */
#define RHO 197
#define PSI 198
#define TAU 199
#define OMEGA 200
#define NU 201
#define PREDEFINED_ATOM(x) ((x) < 21 || x == EULERGAMMA || x == RHO || x == PSI || x == TAU || x == OMEGA || x == NU)
#define GREEK(x) ((x) == ALPHA || (x) == BETA || (x) == LITTLEGAMMA || (x) == DELTA || (x) == EPSILON || (x) == LAMBDA || (x) == MU || (x) == THETA || (x) == PHI || (x) == RHO || (x) == PSI || (x) == TAU || (x) == OMEGA || (x)==NU )
               


/*________________________________________________________________________*/
/* functors predefined in MATHPERT */
/* first the prefix ones like sin, cos, etc. */
/* If new functors are added then string_functor must be changed in
parser.c (but not if only the numbers are changed); and functor_string
in dispfunc.c must also be modified. */

#define LITERALFUNCTOR(f) ((f)==42 || (f)==43 || (f)==45 || (f)==47 || (f)==58 || (f)==60 || (f)==61 || (f)==62 || (f)==94)
  /*                        *          +           -           /          :           <          =          >           ^  */
  /* all other functors will be #-defined */

/* in principle the functors and the predefined atoms can overlap; but
perhaps some code just checks FUNCTOR(t) without also checking whether
ATOMIC(t);  so it will be safer if the functor numbers do not overlap
the atom numbers.  The following sequence allows functors to overlap
the metavariables VAR, etc., in order to fit in all the prefix
functors (just barely) before 42, the first literal functor */

#define ACOS 21    /* This should stay first--automode.c relies on it */
#define ACOT 22
#define ACSC 23
#define ASEC 24
#define ASIN 25
#define ATAN 26
#define SIN  27
#define COS  28
#define SEC  29
#define TAN  30
#define CSC  31
#define COT  32
#define SG   33
#define SQRT 34
#define LN   35
#define LOG  36
#define ABSFUNCTOR  37
#define DET  38   /* determinant of a matrix */
#define SINH 39
#define COSH 40
#define TANH 41
#define PREFIXBOUND 42  /* one more than last prefix functor */

#define PREFIX(f) ((0 < f && f < PREFIXBOUND) || (CSCH <= (f) && (f) <= ACOTH))   /* prefix on INPUT, that is */

/* Now the non-prefix ones */
/* The four kinds of Bessel functions are binary, but the first parameter
must be of type INTEGER */

/* 42,43,45,47 are *,+,-,and / */

#define POSTFIX(f)  (((f) == DEG) || ((f)==FACTORIAL))
#define DEG 44         /* degrees, as in angle measure */
  /* 45 is '-' */
  /* 46 is ascii code of period, which can't be used as functor
                       directly, so its ascii code is available here */
#define FACTORIAL 46
#define FLOOR 48
#define NOT 49
#define REALPART 50
#define IMAGPART 51
#define CIS 52       /* for use in polar form of complex numbers */

#define BESSELJ 53
#define BESSELY 54
#define BESSELI 55
#define BESSELK 56    /* See UNARY if you change this */
               /* Note this makes the Bessel functions unary, even
                  though they are parsed as binary, with one arg for the
                  subscript.  See remarks in parser.c  about this.  */
#define GCD  57
/* 58 is ':'  */
#define BINOMIAL 59
/* 60,61,62 are <, =, >  */

#define VAR  63      /* serves as the symbol of all metavariables */
#define ILLEGAL  64  /* used for indicating error in functions
                        that return terms */
#define BIGOH 91
#define PSEUDOATOM 92   /* used in bblock and display */
#define MAXFUNCTOR 93   /* for the function 'max'     */
/* 94 is '^', a literal functor */
#define LINEARSYSTEM 95  /* used for displaying lined-up systems of equations */
#define NUM 96   /* used for numbers instead of zero when packing terms to strings */
/* Now, we skip the ascii codes of the letters */

#define MINFUNCTOR 123   /* for the function 'min' */
#define GE 124     /* Keep GE,LE,NE,MOD together and in this order */
#define LE 125
#define NE 126
#define MOD 127
#define MULTIPLICITY (unsigned short) 128
#define IMPLIES 129    /*  -> when used as logical implication */
#define ARROW 129   /*   ->   when used in lim(x->0,f(x))  */
#define SEQ 130     /* not used in Mathpert, meant for theorem-proving */
#define INFIX(f)   (((GE <= (f)) && ((f) <= SEQ)) || ((f) == APPROXEQ) || \
                    ((f) == '=') || (f) == '>' || (f) == '<' || (f) == ':' )
#define DIFF 131
#define INTEGRAL 132
#define LOGB 133
#define IF   134
#define AND (unsigned short) 135
#define OR  (unsigned short) 136
#define PR 137   /*  as in f'(x)  */
    /* PRIME is a macro with an argument defined below so we use PR here */
#define ROOT 138
#define BINARYBOUND 139  /* one more than last binary function */
#define LIMIT 139
#define CASES 140
#define SUM 141       /* indexed sums */
#define PRODUCT 142   /* indexed products */
#define EVAL 143      /* as in evaluating f with respect to x from a to b,
                        used when evaluating definite integrals */
                     /* cannot be parsed, is only created by operators */
#define VECTOR 144    /* can't be bblocked or displayed */
#define EVEN1 145  /* EVEN is already defined in arith.h so can't use it */
#define FRACT 146     /* for use by 'display' for horizontal-form fractions */
#define ODD1  147      /* ODD is already defined in arith.h so can't use it */
#define DEFINED 148
#define MATRIXINVERSE 149
#define STROKE 150  /* used in lambda calculus, not in MathXpert */
#define LIST 150   /* like MATRIX but without bars */
         /* used to make titles, not parsed */
#define POLY 151    /* for polynomials with all coefficients present, even zero ones*/
#define MATRIXMULT 152
#define MATRIX 153

/* Next the rest of the hyperbolic and inverse hyperbolic functions */

#define CSCH 154
#define SECH 155
#define COTH 156
#define ASINH 157
#define ACOSH 158
#define ATANH 159
#define ACSCH 160
#define ASECH 161
#define ACOTH 162

/* Now come the 'special functions'  (other than the Bessel functions, which
are listed above) */
#define GAMMA         163
#define DIGAMMA       164
#define ERF           165
#define ERFC          166
#define POLYGAMMA     167
#define COSINTEGRAL   168
#define LOGINTEGRAL   169
#define SININTEGRAL   170
#define EXPINTEGRALI  171
#define BETAFUNCTION  172  /* as opposed to atom BETA */
#define INCOMPLETEBETA 173
#define EXPINTEGRALE   174
#define INCOMPLETEGAMMA 175
#define INCOMPLETEGAMMAP 176
#define COMPLETE_ELLIPTIC1 177
#define COMPLETE_ELLIPTIC2 178
#define COMPLETE_ELLIPTIC3 179
#define ELLIPTICF          180
#define ELLIPTICE          181
#define ELLIPTICPI         182
#define EXISTS 183
#define FORALL 184
#define ALL    184
#define INFINITESIMAL 185
#define LAM 186   /* for lambda abstraction; LAMBDA is an atom */
#define AP 187    /* for lambda-calculus function application */
#define NUMERATOR 188   /* projection functions for RATIONAL -> INTEGER x NATNUM */
#define DENOM 189
#define CONSTANTOFINTEGRATION 190
#define RIEMANNZETA 191    /* parsed but not used */
#define SERIES 192    /* for power series */
#define SETOF 193     /* for use by Otter-lambda */
//  EULERGAMMA 194  /* Euler-Mascheroni constant, defined near the top of the file.  */
#define BERNOULLI 195  /* Bernoulli number */
#define EULERNUMBER 196   /* Needed in the future but not used as of May 2013 */
// EULERGAMMA, RHO, PSI, TAU, OMEGA, NU are defined above but have values here
#define APPROXEQ  202     /* approximately equal, needed in Riemann sums */
#define WEIERSTRASSP 203   /* not actually used; should stay last in this list */

#define UNARY(f)  (PREFIX(f) || POSTFIX(f) || (47 < (f) && (f) <= BESSELK) || (CSCH <= (f) && (f) <= ACOTH))
/* does not include the unary 'special functions' >= GAMMA */
/* UNARY is called by correct_arity in parser.c, which must handle
the special functions itself */

#define INEQUALITY(f)   ((f) == '=' || (f) == '<' || (f)==LE || (f)==GE || (f) == '>' || (f)==NE)
#define TRIGFUNCTOR(f)  ((f) == SIN || (f) == COS || (f) == TAN || (f) == COT || (f) == CSC || (f) == SEC)
#define ARCTRIGFUNCTOR(f) ( ACOS <= (f) && (f) <= ATAN )
#define TRIGHFUNCTOR(f)  ((f) == SINH || (f) == COSH || (f) == TANH || (f) == COTH || (f) == CSCH || (f) == SECH)

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists