[0e1846] | 1 | #ifndef IPSHELL_H |
---|
| 2 | #define IPSHELL_H |
---|
| 3 | /**************************************** |
---|
| 4 | * Computer Algebra System SINGULAR * |
---|
| 5 | ****************************************/ |
---|
[341696] | 6 | /* $Id$ */ |
---|
[0e1846] | 7 | /* |
---|
| 8 | * ABSTRACT |
---|
| 9 | */ |
---|
| 10 | #include <stdio.h> |
---|
| 11 | #include "structs.h" |
---|
[995a6a] | 12 | #include "ideals.h" |
---|
[508937] | 13 | |
---|
[0e051f] | 14 | struct _ssubexpr; |
---|
| 15 | typedef struct _ssubexpr *Subexpr; |
---|
| 16 | |
---|
[0e1846] | 17 | |
---|
| 18 | extern leftv iiCurrArgs; |
---|
[f71681] | 19 | extern idhdl iiCurrProc; |
---|
[0e1846] | 20 | extern int iiOp; /* the current operation*/ |
---|
[85e68dd] | 21 | extern const char * currid; |
---|
[0e1846] | 22 | extern int iiRETURNEXPR_len; |
---|
| 23 | extern sleftv *iiRETURNEXPR; |
---|
[0a3ddd] | 24 | #ifdef USE_IILOCALRING |
---|
[0e1846] | 25 | extern ring *iiLocalRing; |
---|
[77ff8e] | 26 | #endif |
---|
[2617dd5] | 27 | //extern cmdnames cmds[]; |
---|
[85e68dd] | 28 | extern const char *lastreserved; |
---|
[995a6a] | 29 | extern const char *singular_date; /* tesths.cc, set by final compile */ |
---|
[923c27] | 30 | |
---|
[34fbd93] | 31 | extern BOOLEAN yyInRingConstruction; /* 1: during ring construction */ |
---|
[0e1846] | 32 | |
---|
[2c52262] | 33 | int IsCmd(const char *n, int & tok); |
---|
[6bc5bb] | 34 | short IsCmdToken(short tok); |
---|
| 35 | |
---|
[057e93c] | 36 | BOOLEAN iiPStart(idhdl pn, sleftv * sl); |
---|
| 37 | BOOLEAN iiEStart(char* example, procinfo *pi); |
---|
[0e1846] | 38 | void type_cmd(idhdl h); |
---|
| 39 | void test_cmd(int i); |
---|
[7da3cd] | 40 | void list_cmd(int typ, const char* what, const char * prefix, |
---|
| 41 | BOOLEAN iterate, BOOLEAN fullname=FALSE); |
---|
[8dde75] | 42 | //char * iiStringMatrix(matrix im, int dim, char ch=','); |
---|
[0e1846] | 43 | void killlocals(int v); |
---|
| 44 | int exprlist_length(leftv v); |
---|
[85e68dd] | 45 | const char * Tok2Cmdname(int i); |
---|
| 46 | const char * iiTwoOps(int t); |
---|
[0e1846] | 47 | int IsPrime(int i); |
---|
| 48 | |
---|
| 49 | BOOLEAN iiWRITE(leftv res,leftv exprlist); |
---|
| 50 | BOOLEAN iiExport(leftv v, int toLev); |
---|
[bd4cb92] | 51 | BOOLEAN iiExport(leftv v, int toLev, idhdl roothdl); |
---|
| 52 | BOOLEAN iiInternalExport (leftv v, int toLev, idhdl roothdl); |
---|
[2ba9a6] | 53 | char * iiGetLibName(procinfov v); |
---|
| 54 | char * iiGetLibProcBuffer( procinfov pi, int part=1 ); |
---|
[0e1846] | 55 | char * iiProcName(char *buf, char & ct, char* &e); |
---|
| 56 | char * iiProcArgs(char *e,BOOLEAN withParenth); |
---|
[22ed4c] | 57 | BOOLEAN iiLibCmd( char *newlib, BOOLEAN autoexport, BOOLEAN tellerror, BOOLEAN force ); |
---|
[698457] | 58 | /* sees wheter library lib has already been loaded |
---|
| 59 | if yes, writes filename of lib into where and returns TRUE, |
---|
| 60 | if no, returns FALSE |
---|
| 61 | */ |
---|
| 62 | BOOLEAN iiLocateLib(const char* lib, char* where); |
---|
[85e68dd] | 63 | leftv iiMap(map theMap, const char * what); |
---|
[0e1846] | 64 | void iiMakeResolv(resolvente r, int length, int rlen, char * name, int typ0, |
---|
| 65 | intvec ** weights=NULL); |
---|
| 66 | BOOLEAN jjMINRES(leftv res, leftv v); |
---|
| 67 | BOOLEAN jjBETTI(leftv res, leftv v); |
---|
[7f14f2] | 68 | BOOLEAN jjBETTI2(leftv res, leftv u, leftv v); |
---|
[709ab0] | 69 | BOOLEAN jjBETTI2_ID(leftv res, leftv u, leftv v); |
---|
[762bfd] | 70 | BOOLEAN jjIMPORTFROM(leftv res, leftv u, leftv v); |
---|
[7f14f2] | 71 | |
---|
[f46646] | 72 | BOOLEAN jjVARIABLES_P(leftv res, leftv u); |
---|
| 73 | BOOLEAN jjVARIABLES_ID(leftv res, leftv u); |
---|
| 74 | |
---|
[0e1846] | 75 | int iiRegularity(lists L); |
---|
| 76 | leftv singular_system(sleftv h); |
---|
| 77 | BOOLEAN jjSYSTEM(leftv res, leftv v); |
---|
| 78 | void iiDebug(); |
---|
| 79 | BOOLEAN iiCheckRing(int i); |
---|
[f99917f] | 80 | poly iiHighCorner(ideal i, int ak); |
---|
[f43a74] | 81 | char * iiConvName(const char *libname); |
---|
[bf4ff72] | 82 | BOOLEAN iiLoadLIB(FILE *fp, char *libnamebuf, char *newlib, |
---|
| 83 | idhdl pl, BOOLEAN autoexport, BOOLEAN tellerror); |
---|
| 84 | |
---|
[f43a74] | 85 | |
---|
[0e1846] | 86 | /* ================================================================== */ |
---|
| 87 | /* Expressions : */ |
---|
| 88 | BOOLEAN iiExprArith1(leftv res, sleftv* a, int op); |
---|
| 89 | BOOLEAN iiExprArith2(leftv res, sleftv* a, int op, sleftv* b, |
---|
| 90 | BOOLEAN proccall=FALSE); |
---|
| 91 | BOOLEAN iiExprArith3(leftv res, int op, leftv a, leftv b, leftv c); |
---|
| 92 | BOOLEAN iiExprArithM(leftv res, sleftv* a, int op); |
---|
| 93 | |
---|
| 94 | typedef BOOLEAN (*proc1)(leftv,leftv); |
---|
| 95 | |
---|
[637428] | 96 | #ifdef __GNUC__ |
---|
| 97 | #if (__GNUC__ < 3) |
---|
| 98 | #define INIT_BUG 1 |
---|
[0e1846] | 99 | void jjInitTab1(); |
---|
| 100 | #endif |
---|
[637428] | 101 | #endif |
---|
| 102 | |
---|
[0e1846] | 103 | #ifdef GENTABLE |
---|
| 104 | typedef char * (*Proc1)(char *); |
---|
| 105 | struct sValCmd1 |
---|
| 106 | { |
---|
| 107 | proc1 p; |
---|
| 108 | short cmd; |
---|
| 109 | short res; |
---|
| 110 | short arg; |
---|
[ee9485] | 111 | short valid_for; |
---|
[0e1846] | 112 | }; |
---|
| 113 | |
---|
| 114 | typedef BOOLEAN (*proc2)(leftv,leftv,leftv); |
---|
| 115 | struct sValCmd2 |
---|
| 116 | { |
---|
| 117 | proc2 p; |
---|
| 118 | short cmd; |
---|
| 119 | short res; |
---|
| 120 | short arg1; |
---|
| 121 | short arg2; |
---|
[ee9485] | 122 | short valid_for; |
---|
[0e1846] | 123 | }; |
---|
| 124 | |
---|
| 125 | typedef BOOLEAN (*proc3)(leftv,leftv,leftv,leftv); |
---|
| 126 | struct sValCmd3 |
---|
| 127 | { |
---|
| 128 | proc3 p; |
---|
| 129 | short cmd; |
---|
| 130 | short res; |
---|
| 131 | short arg1; |
---|
| 132 | short arg2; |
---|
| 133 | short arg3; |
---|
[ee9485] | 134 | short valid_for; |
---|
[0e1846] | 135 | }; |
---|
| 136 | struct sValCmdM |
---|
| 137 | { |
---|
| 138 | proc1 p; |
---|
| 139 | short cmd; |
---|
| 140 | short res; |
---|
| 141 | short number_of_args; /* -1: any, -2: any >0, .. */ |
---|
[ee9485] | 142 | short valid_for; |
---|
[0e1846] | 143 | }; |
---|
| 144 | extern struct sValCmd2 dArith2[]; |
---|
| 145 | extern struct sValCmd1 dArith1[]; |
---|
| 146 | extern struct sValCmd3 dArith3[]; |
---|
| 147 | extern struct sValCmdM dArithM[]; |
---|
| 148 | #endif |
---|
| 149 | |
---|
| 150 | /* ================================================================== */ |
---|
| 151 | /* Assigments : */ |
---|
| 152 | BOOLEAN iiAssign(leftv left, leftv right); |
---|
| 153 | |
---|
| 154 | typedef BOOLEAN (*proci)(leftv,leftv,Subexpr); |
---|
| 155 | struct sValAssign_sys |
---|
| 156 | { |
---|
| 157 | proc1 p; |
---|
| 158 | short res; |
---|
| 159 | short arg; |
---|
| 160 | }; |
---|
| 161 | |
---|
| 162 | struct sValAssign |
---|
| 163 | { |
---|
| 164 | proci p; |
---|
| 165 | short res; |
---|
| 166 | short arg; |
---|
| 167 | }; |
---|
| 168 | |
---|
| 169 | BOOLEAN iiParameter(leftv p); |
---|
| 170 | /* ================================================================== */ |
---|
| 171 | int iiDeclCommand(leftv sy, leftv name, int lev, int t, idhdl* root, |
---|
[0a3ddd] | 172 | BOOLEAN isring = FALSE, BOOLEAN init_b=TRUE); |
---|
[a3bc95e] | 173 | sleftv * iiMake_proc(idhdl pn, package pack, sleftv* sl); |
---|
[0e1846] | 174 | // from misc.cc: |
---|
[979a09f] | 175 | char * showOption(); |
---|
[0e1846] | 176 | BOOLEAN setOption(leftv res, leftv v); |
---|
| 177 | /* ================================================================== */ |
---|
[9ea9c6] | 178 | char * versionString(); |
---|
[706c95] | 179 | /* ================================================================== */ |
---|
| 180 | void singular_example(char *str); |
---|
[a3bc95e] | 181 | |
---|
[85e68dd] | 182 | BOOLEAN iiTryLoadLib(leftv v, const char *id); |
---|
[5c5638] | 183 | |
---|
[a78f216] | 184 | void listall(int showproc=1); |
---|
[d66a7d] | 185 | void iiCheckPack(package &p); |
---|
[5c5638] | 186 | #ifndef NDEBUG |
---|
| 187 | void checkall(); |
---|
| 188 | #endif |
---|
[a3bc95e] | 189 | #endif |
---|
[0e1846] | 190 | |
---|