version 1.17, 2003/04/02 09:43:33 |
version 1.32, 2004/07/13 07:59:54 |
|
|
* DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, |
* DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, |
* PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. |
* PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. |
* |
* |
* $OpenXM: OpenXM_contrib2/asir2000/parse/parse.h,v 1.16 2002/01/28 00:54:44 noro Exp $ |
* $OpenXM: OpenXM_contrib2/asir2000/parse/parse.h,v 1.31 2004/07/07 07:40:19 noro Exp $ |
*/ |
*/ |
# if defined(VISUAL) |
# if defined(VISUAL) |
#include <time.h> |
#include <time.h> |
|
|
I_FUNC, I_FUNC_OPT, I_IFUNC, I_MAP, I_RECMAP, I_PFDERIV, |
I_FUNC, I_FUNC_OPT, I_IFUNC, I_MAP, I_RECMAP, I_PFDERIV, |
I_ANS, I_PVAR, I_ASSPVAR, |
I_ANS, I_PVAR, I_ASSPVAR, |
I_FORMULA, I_LIST, I_STR, I_NEWCOMP, I_CAR, I_CDR, I_CAST, |
I_FORMULA, I_LIST, I_STR, I_NEWCOMP, I_CAR, I_CDR, I_CAST, |
I_COM, I_PROC, I_INDEX, I_EV, I_TIMER, I_GF2NGEN, I_GFPNGEN, I_GFSNGEN, |
I_INDEX, I_EV, I_TIMER, I_GF2NGEN, I_GFPNGEN, I_GFSNGEN, |
I_LOP, I_OPT, I_GETOPT, I_POINT, I_QUOTE, I_PAREN, I_MINUS |
I_LOP, I_OPT, I_GETOPT, I_POINT, I_PAREN, I_MINUS, |
|
I_NARYOP |
} fid; |
} fid; |
|
|
/* identifiers for statements */ |
/* identifiers for statements */ |
Line 96 typedef enum { A_UNDEF, A_BIN, A_USR, A_PURE, A_PARI } |
|
Line 97 typedef enum { A_UNDEF, A_BIN, A_USR, A_PURE, A_PARI } |
|
|
|
typedef enum { V_IND, V_UC, V_PF, V_SR } vid; |
typedef enum { V_IND, V_UC, V_PF, V_SR } vid; |
|
|
struct oVS { |
typedef struct oVS { |
unsigned int n; |
unsigned int n; |
unsigned int asize; |
unsigned int asize; |
unsigned int at; |
unsigned int at; |
|
|
struct oFUNC *usrf; |
struct oFUNC *usrf; |
struct oPV *va; |
struct oPV *va; |
NODE opt; |
NODE opt; |
}; |
} *VS; |
|
|
typedef struct oVS *VS; |
typedef struct oMODULE { |
|
char *name; |
|
VS pvs; |
|
NODE usrf_list; |
|
} *MODULE; |
|
|
struct oPV { |
typedef struct oPV { |
char *name; |
char *name; |
short attr,type; |
short attr,type; |
pointer priv; |
pointer priv; |
}; |
} *PV; |
|
|
typedef struct oPV *PV; |
typedef struct oINFILE { |
|
|
struct oINFILE { |
|
char *name; |
char *name; |
FILE *fp; |
FILE *fp; |
int ln; |
int ln; |
Line 124 struct oINFILE { |
|
Line 127 struct oINFILE { |
|
char *tname; |
char *tname; |
int encoded; |
int encoded; |
short vol; |
short vol; |
}; |
} *INFILE; |
|
|
typedef struct oINFILE *INFILE; |
|
|
|
struct oTKWD { |
struct oTKWD { |
char *name; |
char *name; |
int token; |
int token; |
}; |
}; |
|
|
struct oARF { |
typedef struct fid_spec { |
|
fid id; |
|
farg_type type[10]; |
|
} *fid_spec_p; |
|
|
|
typedef struct oARF { |
char *name; |
char *name; |
void (*fp)(); |
void (*fp)(); |
}; |
} *ARF; |
|
|
typedef struct oARF *ARF; |
typedef struct oFUNC { |
|
char *name,*fullname; |
struct oFUNC { |
|
char *name; |
|
int argc; |
int argc; |
int type; |
int type; |
aid id; |
aid id; |
|
|
struct oUSRF *usrf; |
struct oUSRF *usrf; |
struct oPF *puref; |
struct oPF *puref; |
} f; |
} f; |
}; |
} *FUNC; |
|
|
typedef struct oFUNC *FUNC; |
typedef struct oUSRF { |
|
|
struct oUSRF { |
|
char *fname; |
char *fname; |
short vol; |
MODULE module; |
int startl,endl; |
int startl,endl; |
NODE args; |
NODE args; |
VS pvs; |
VS pvs; |
char *desc; |
char *desc; |
struct oSNODE *body; |
struct oSNODE *body; |
}; |
} *USRF; |
|
|
typedef struct oUSRF *USRF; |
typedef struct oPF { |
|
|
struct oPF { |
|
char *name; |
char *name; |
int argc; |
int argc; |
Obj body; |
Obj body; |
|
|
int (*pari)(); |
int (*pari)(); |
double (*libm)(); |
double (*libm)(); |
int (*simplify)(); |
int (*simplify)(); |
}; |
} *PF; |
|
|
typedef struct oPF *PF; |
typedef struct oPFAD { |
|
|
struct oPFAD { |
|
Obj arg; |
Obj arg; |
int d; |
int d; |
}; |
} *PFAD; |
|
|
typedef struct oPFAD *PFAD; |
typedef struct oPFINS { |
|
|
struct oPFINS { |
|
struct oPF *pf; |
struct oPF *pf; |
struct oPFAD ad[1]; |
struct oPFAD ad[1]; |
}; |
} *PFINS; |
|
|
typedef struct oPFINS *PFINS; |
|
|
|
#define NEWPF(p) ((p)=(PF)MALLOC(sizeof(struct oPF))) |
#define NEWPF(p) ((p)=(PF)MALLOC(sizeof(struct oPF))) |
|
|
struct oFNODE { |
typedef struct oFNODE { |
fid id; |
fid id; |
pointer arg[1]; |
pointer arg[1]; |
}; |
} *FNODE; |
|
|
typedef struct oFNODE *FNODE; |
|
|
|
#define NEWFNODE(a,b) \ |
#define NEWFNODE(a,b) \ |
((a)=(FNODE)MALLOC(sizeof(struct oFNODE)+sizeof(pointer)*(b-1))) |
((a)=(FNODE)MALLOC(sizeof(struct oFNODE)+sizeof(pointer)*(b-1))) |
|
|
struct oSNODE { |
typedef struct oSNODE { |
sid id; |
sid id; |
int ln; |
int ln; |
pointer arg[1]; |
pointer arg[1]; |
}; |
} *SNODE; |
|
|
typedef struct oSNODE *SNODE; |
|
|
|
#define NEWSNODE(a,b) \ |
#define NEWSNODE(a,b) \ |
((a)=(SNODE)MALLOC(sizeof(struct oSNODE)+sizeof(pointer)*(b-1)),(a)->ln=asir_infile->ln) |
((a)=(SNODE)MALLOC(sizeof(struct oSNODE)+sizeof(pointer)*(b-1)),(a)->ln=asir_infile->ln) |
|
|
struct oPVI { |
typedef struct oPVI { |
int pv; |
int pv; |
NODE index; |
NODE index; |
}; |
} *PVI; |
|
|
typedef struct oPVI *PVI; |
typedef struct oNODE2 { |
|
|
struct oNODE2 { |
|
pointer body1,body2; |
pointer body1,body2; |
struct oNODE2 *next; |
struct oNODE2 *next; |
}; |
} *NODE2; |
|
|
typedef struct oNODE2 *NODE2; |
|
|
|
struct ftab { |
struct ftab { |
char *name; |
char *name; |
void (*f)(); |
void (*f)(); |
Line 283 switch ( id ) {\ |
|
Line 269 switch ( id ) {\ |
|
} |
} |
|
|
#define DEFSIZE 32 |
#define DEFSIZE 32 |
#define MSB (1<<31) |
#define PVGLOBAL(i) (((unsigned int)(i))|(1<<30)) |
|
#define PVMGLOBAL(i) (((unsigned int)(i))|(3<<30)) |
|
#define PVATTR(i) (((unsigned int)(i))>>30) |
|
#define PVIND(i) (((unsigned int)(i))&0x3fffffff) |
#define GETPV(i,p) \ |
#define GETPV(i,p) \ |
((int)(i)>=0 ? (int)((p)=CPVS->va[(unsigned int)(i)].priv)\ |
(PVATTR(i)==0?(int)((p)=CPVS->va[(unsigned int)(i)].priv)\ |
: (int)((p)=GPVS->va[(unsigned int)(i)&(~MSB)].priv)) |
:PVATTR(i)==1?(int)((p)=GPVS->va[PVIND(i)].priv)\ |
|
:(int)((p)=MPVS->va[PVIND(i)].priv)) |
|
#define GETPVREF(i,p) \ |
|
(PVATTR(i)==0?(int)((p)=&(CPVS->va[(unsigned int)(i)].priv))\ |
|
:PVATTR(i)==1?(int)((p)=&(GPVS->va[PVIND(i)].priv))\ |
|
:(int)((p)=&(MPVS->va[PVIND(i)].priv))) |
#define GETPVNAME(i,p) \ |
#define GETPVNAME(i,p) \ |
((int)(i)>=0 ? (int)((p)=CPVS->va[(unsigned int)(i)].name)\ |
(PVATTR(i)==0?(int)((p)=CPVS->va[(unsigned int)(i)].name)\ |
: (int)((p)=GPVS->va[(unsigned int)(i)&(~MSB)].name)) |
:PVATTR(i)==1?(int)((p)=GPVS->va[PVIND(i)].name)\ |
|
:(int)((p)=MPVS->va[PVIND(i)].name)) |
#define ASSPV(i,p) \ |
#define ASSPV(i,p) \ |
((int)(i)>=0 ? (int)(CPVS->va[(unsigned int)(i)].priv=(pointer)(p))\ |
(PVATTR(i)==0?(int)(CPVS->va[(unsigned int)(i)].priv=(pointer)(p))\ |
: (int)(GPVS->va[(unsigned int)(i)&(~MSB)].priv=(pointer)(p))) |
:PVATTR(i)==1?(int)(GPVS->va[PVIND(i)].priv=(pointer)(p))\ |
|
:(int)(MPVS->va[PVIND(i)].priv=(pointer)(p))) |
|
|
#define NEWNODE2(a) ((a)=(NODE2)MALLOC(sizeof(struct oNODE2))) |
#define NEWNODE2(a) ((a)=(NODE2)MALLOC(sizeof(struct oNODE2))) |
#define MKNODE2(a,b,c,d) \ |
#define MKNODE2(a,b,c,d) \ |
Line 300 switch ( id ) {\ |
|
Line 296 switch ( id ) {\ |
|
#define BDY1(a) ((a)->body1) |
#define BDY1(a) ((a)->body1) |
#define BDY2(a) ((a)->body2) |
#define BDY2(a) ((a)->body2) |
|
|
extern VS GPVS,CPVS,EPVS,APVS; |
extern VS GPVS,CPVS,EPVS,APVS,MPVS; |
|
extern MODULE CUR_MODULE; |
|
extern NODE MODULE_LIST; |
|
extern char *CUR_FUNC; |
extern ARF addfs, subfs, mulfs, divfs, remfs, pwrfs; |
extern ARF addfs, subfs, mulfs, divfs, remfs, pwrfs; |
extern INFILE asir_infile; |
extern INFILE asir_infile; |
extern NODE usrf,sysf,noargsysf,ubinf,parif,ONENODE; |
extern NODE usrf,sysf,noargsysf,ubinf,parif,ONENODE; |
extern int nextbp,nextbplevel; |
extern int nextbp,nextbplevel; |
extern int Verbose; |
extern int Verbose; |
|
extern int do_quiet; |
|
extern SYMBOL Symbol_grlex, Symbol_glex, Symbol_lex; |
|
extern NODE current_option; |
|
|
#if defined(VISUAL_LIB) |
#if defined(VISUAL_LIB) |
#include <w_stdio.h> |
#include <w_stdio.h> |
Line 322 extern int Verbose; |
|
Line 324 extern int Verbose; |
|
#define fflush w_fflush |
#define fflush w_fflush |
#endif |
#endif |
|
|
#if defined(VISUAL) || (defined(__MACH__) && defined(__ppc__)) |
#if defined(__GNUC__) || defined(VISUAL) || (defined(__MACH__) && defined(__ppc__)) || defined(__FreeBSD__) |
NODE mknode(int,...); |
NODE mknode(int,...); |
FNODE mkfnode(int,fid,...); |
FNODE mkfnode(int,fid,...); |
SNODE mksnode(int,sid,...); |
SNODE mksnode(int,sid,...); |
Line 376 void dp_mod(DP,int,NODE,DP *); |
|
Line 378 void dp_mod(DP,int,NODE,DP *); |
|
void dp_prim_mod(DP,int,DP *); |
void dp_prim_mod(DP,int,DP *); |
void dp_prim(DP,DP *); |
void dp_prim(DP,DP *); |
void heu_nezgcdnpz(VL,P *,int,P *); |
void heu_nezgcdnpz(VL,P *,int,P *); |
void homogenize_order(struct order_spec *,int,struct order_spec *); |
void homogenize_order(struct order_spec *,int,struct order_spec **); |
int create_order_spec(Obj,struct order_spec *); |
int create_order_spec(VL,Obj,struct order_spec **); |
|
|
int dl_equal(int,DL,DL); |
int dl_equal(int,DL,DL); |
void qltozl(Q *,int,Q *); |
void qltozl(Q *,int,Q *); |
Line 470 int get_heapsize(void); |
|
Line 472 int get_heapsize(void); |
|
int searchpvar(char *); |
int searchpvar(char *); |
void mkparif(char *,FUNC *); |
void mkparif(char *,FUNC *); |
void makevar(char *,P *); |
void makevar(char *,P *); |
void mkpvs(void); |
void mkpvs(char *); |
|
MODULE mkmodule(char *); |
void stoarg(char *,int *,char **); |
void stoarg(char *,int *,char **); |
void yyerror(char *); |
void yyerror(char *); |
void closecurrentinput(void); |
void closecurrentinput(void); |
Line 502 int gettype(unsigned int); |
|
Line 505 int gettype(unsigned int); |
|
int indextotype(int,int); |
int indextotype(int,int); |
int loadfile(char *); |
int loadfile(char *); |
int loadfiles(NODE); |
int loadfiles(NODE); |
int makepvar(char *); |
unsigned int makepvar(char *); |
int membertoindex(int,char *); |
int membertoindex(int,char *); |
int qcoefp(Obj); |
int qcoefp(Obj); |
int qcoefr(Obj); |
int qcoefr(Obj); |
Line 550 void instov(PFINS ,V *); |
|
Line 553 void instov(PFINS ,V *); |
|
Obj memberofstruct(COMP,char *); |
Obj memberofstruct(COMP,char *); |
void mkpf(char *,Obj ,int ,V *,int (*)(),double (*)(),int (*)(),PF *); |
void mkpf(char *,Obj ,int ,V *,int (*)(),double (*)(),int (*)(),PF *); |
void mkpfins(PF ,V *,V *); |
void mkpfins(PF ,V *,V *); |
void mkuf(char *,char *,NODE,SNODE,int,int,char *); |
void mkuf(char *,char *,NODE,SNODE,int,int,char *,MODULE); |
void newstruct(int,struct oCOMP **); |
void newstruct(int,struct oCOMP **); |
void optobj(Obj *); |
void optobj(Obj *); |
void println(int, char **, int); |
void println(int, char **, int); |
Line 606 int dp_redble(DP p1,DP p2); |
|
Line 609 int dp_redble(DP p1,DP p2); |
|
void sortbynm(Q *w,int n); |
void sortbynm(Q *w,int n); |
int comp_nm(Q *a,Q *b); |
int comp_nm(Q *a,Q *b); |
void qltozl(Q *w,int n,Q *dvr); |
void qltozl(Q *w,int n,Q *dvr); |
void homogenize_order(struct order_spec *old,int n,struct order_spec *new); |
|
void dp_rat(DP p,DP *rp); |
void dp_rat(DP p,DP *rp); |
void dp_mod(DP p,int mod,NODE subst,DP *rp); |
void dp_mod(DP p,int mod,NODE subst,DP *rp); |
void dp_dehomo(DP p,DP *rp); |
void dp_dehomo(DP p,DP *rp); |
void dp_homo(DP p,DP *rp); |
void dp_homo(DP p,DP *rp); |
int create_order_spec(Obj obj,struct order_spec *spec); |
|
void dp_nf_tab_mod(DP p,LIST *tab,int mod,DP *rp); |
void dp_nf_tab_mod(DP p,LIST *tab,int mod,DP *rp); |
void dp_lnf_mod(DP p1,DP p2,NODE g,int mod,DP *r1p,DP *r2p); |
void dp_lnf_mod(DP p1,DP p2,NODE g,int mod,DP *r1p,DP *r2p); |
void dp_lnf_f(DP p1,DP p2,NODE g,DP *r1p,DP *r2p); |
void dp_lnf_f(DP p1,DP p2,NODE g,DP *r1p,DP *r2p); |
Line 775 void igcd_cofactor(Q a,Q b,Q *gcd,Q *ca,Q *cb); |
|
Line 776 void igcd_cofactor(Q a,Q b,Q *gcd,Q *ca,Q *cb); |
|
int comp_n(N *a,N *b); |
int comp_n(N *a,N *b); |
int TypeT_NB_check(unsigned int m, unsigned int t); |
int TypeT_NB_check(unsigned int m, unsigned int t); |
int small_jacobi(int a,int m); |
int small_jacobi(int a,int m); |
void mkpvs(); |
|
void pushpvs(FUNC f); |
void pushpvs(FUNC f); |
void poppvs(); |
void poppvs(); |
int makepvar(char *str); |
unsigned int makepvar(char *str); |
int searchpvar(char *str); |
int searchpvar(char *str); |
int getpvar(VS pvs,char *str,int searchonly); |
int getpvar(VS pvs,char *str,int searchonly); |
void closecurrentinput(); |
void closecurrentinput(); |
Line 799 void chsgnquote(QUOTE a,QUOTE *c); |
|
Line 799 void chsgnquote(QUOTE a,QUOTE *c); |
|
void objtoquote(Obj a,QUOTE *c); |
void objtoquote(Obj a,QUOTE *c); |
void polytoquote(P a,QUOTE *c); |
void polytoquote(P a,QUOTE *c); |
void dptoquote(DP a,QUOTE *c); |
void dptoquote(DP a,QUOTE *c); |
void dctoquote(DCP dc,QUOTE v,QUOTE *c); |
void dctoquote(DCP dc,QUOTE v,QUOTE *c,int *sgn); |
void mptoquote(MP m,int n,QUOTE *c); |
void mptoquote(MP m,int n,QUOTE *c,int *sgn); |
void vartoquote(V v,QUOTE *c); |
void vartoquote(V v,QUOTE *c); |
void fnodetotree(FNODE f,LIST *rp); |
void fnodetotree(FNODE f,LIST *rp); |
FNODE eval_pvar_in_fnode(FNODE f); |
FNODE eval_pvar_in_fnode(FNODE f); |
Line 891 void gen_searchf(char *name,FUNC *r); |
|
Line 891 void gen_searchf(char *name,FUNC *r); |
|
void searchf(NODE fn,char *name,FUNC *r); |
void searchf(NODE fn,char *name,FUNC *r); |
void appenduf(char *name,FUNC *r); |
void appenduf(char *name,FUNC *r); |
void mkparif(char *name,FUNC *r); |
void mkparif(char *name,FUNC *r); |
void mkuf(char *name,char *fname,NODE args,SNODE body,int startl,int endl,char *desc); |
void mkuf(char *name,char *fname,NODE args,SNODE body,int startl,int endl,char *desc,MODULE module); |
Obj getopt_from_cpvs(char *key); |
Obj getopt_from_cpvs(char *key); |
void des_enc(unsigned long *, unsigned char *, unsigned long *); |
void des_enc(unsigned long *, unsigned char *, unsigned long *); |
unsigned long round_func(unsigned long , unsigned char *); |
unsigned long round_func(unsigned long , unsigned char *); |