[0e1846] | 1 | #ifndef IPSHELL_H |
---|
| 2 | #define IPSHELL_H |
---|
| 3 | /**************************************** |
---|
| 4 | * Computer Algebra System SINGULAR * |
---|
| 5 | ****************************************/ |
---|
| 6 | /* |
---|
| 7 | * ABSTRACT |
---|
| 8 | */ |
---|
| 9 | #include <stdio.h> |
---|
[f5a3a23] | 10 | //#include <kernel/structs.h> |
---|
[599326] | 11 | #include <kernel/ideals.h> |
---|
[f5a3a23] | 12 | #include <Singular/lists.h> |
---|
[508937] | 13 | |
---|
[0e051f] | 14 | struct _ssubexpr; |
---|
| 15 | typedef struct _ssubexpr *Subexpr; |
---|
| 16 | |
---|
[47a4c2] | 17 | BOOLEAN spectrumProc ( leftv,leftv ); |
---|
| 18 | BOOLEAN spectrumfProc( leftv,leftv ); |
---|
| 19 | BOOLEAN spaddProc ( leftv,leftv,leftv ); |
---|
| 20 | BOOLEAN spmulProc ( leftv,leftv,leftv ); |
---|
| 21 | BOOLEAN semicProc ( leftv,leftv,leftv ); |
---|
| 22 | BOOLEAN semicProc3 ( leftv,leftv,leftv,leftv ); |
---|
[0e1846] | 23 | |
---|
| 24 | extern leftv iiCurrArgs; |
---|
[f71681] | 25 | extern idhdl iiCurrProc; |
---|
[0e1846] | 26 | extern int iiOp; /* the current operation*/ |
---|
[85e68dd] | 27 | extern const char * currid; |
---|
[0e1846] | 28 | extern int iiRETURNEXPR_len; |
---|
| 29 | extern sleftv *iiRETURNEXPR; |
---|
[0a3ddd] | 30 | #ifdef USE_IILOCALRING |
---|
[0e1846] | 31 | extern ring *iiLocalRing; |
---|
[77ff8e] | 32 | #endif |
---|
[2617dd5] | 33 | //extern cmdnames cmds[]; |
---|
[85e68dd] | 34 | extern const char *lastreserved; |
---|
[995a6a] | 35 | extern const char *singular_date; /* tesths.cc, set by final compile */ |
---|
[923c27] | 36 | |
---|
[34fbd93] | 37 | extern BOOLEAN yyInRingConstruction; /* 1: during ring construction */ |
---|
[0e1846] | 38 | |
---|
[2c52262] | 39 | int IsCmd(const char *n, int & tok); |
---|
[6bc5bb] | 40 | |
---|
[057e93c] | 41 | BOOLEAN iiPStart(idhdl pn, sleftv * sl); |
---|
| 42 | BOOLEAN iiEStart(char* example, procinfo *pi); |
---|
[ba73e9] | 43 | BOOLEAN iiAllStart(procinfov pi, char *p,feBufferTypes t, int l); |
---|
[103560] | 44 | void type_cmd(leftv v); |
---|
[0e1846] | 45 | void test_cmd(int i); |
---|
[7da3cd] | 46 | void list_cmd(int typ, const char* what, const char * prefix, |
---|
| 47 | BOOLEAN iterate, BOOLEAN fullname=FALSE); |
---|
[8dde75] | 48 | //char * iiStringMatrix(matrix im, int dim, char ch=','); |
---|
[0e1846] | 49 | void killlocals(int v); |
---|
| 50 | int exprlist_length(leftv v); |
---|
[85e68dd] | 51 | const char * Tok2Cmdname(int i); |
---|
| 52 | const char * iiTwoOps(int t); |
---|
[06c0b3] | 53 | int iiOpsTwoChar(const char *s); |
---|
| 54 | |
---|
[0e1846] | 55 | int IsPrime(int i); |
---|
| 56 | |
---|
| 57 | BOOLEAN iiWRITE(leftv res,leftv exprlist); |
---|
| 58 | BOOLEAN iiExport(leftv v, int toLev); |
---|
[bd4cb92] | 59 | BOOLEAN iiExport(leftv v, int toLev, idhdl roothdl); |
---|
| 60 | BOOLEAN iiInternalExport (leftv v, int toLev, idhdl roothdl); |
---|
[2ba9a6] | 61 | char * iiGetLibName(procinfov v); |
---|
| 62 | char * iiGetLibProcBuffer( procinfov pi, int part=1 ); |
---|
[0e1846] | 63 | char * iiProcName(char *buf, char & ct, char* &e); |
---|
| 64 | char * iiProcArgs(char *e,BOOLEAN withParenth); |
---|
[22ed4c] | 65 | BOOLEAN iiLibCmd( char *newlib, BOOLEAN autoexport, BOOLEAN tellerror, BOOLEAN force ); |
---|
[698457] | 66 | /* sees wheter library lib has already been loaded |
---|
| 67 | if yes, writes filename of lib into where and returns TRUE, |
---|
| 68 | if no, returns FALSE |
---|
| 69 | */ |
---|
| 70 | BOOLEAN iiLocateLib(const char* lib, char* where); |
---|
[85e68dd] | 71 | leftv iiMap(map theMap, const char * what); |
---|
[0e1846] | 72 | void iiMakeResolv(resolvente r, int length, int rlen, char * name, int typ0, |
---|
| 73 | intvec ** weights=NULL); |
---|
| 74 | BOOLEAN jjMINRES(leftv res, leftv v); |
---|
| 75 | BOOLEAN jjBETTI(leftv res, leftv v); |
---|
[7f14f2] | 76 | BOOLEAN jjBETTI2(leftv res, leftv u, leftv v); |
---|
[709ab0] | 77 | BOOLEAN jjBETTI2_ID(leftv res, leftv u, leftv v); |
---|
[762bfd] | 78 | BOOLEAN jjIMPORTFROM(leftv res, leftv u, leftv v); |
---|
[146d90] | 79 | BOOLEAN jjLIST_PL(leftv res, leftv v); |
---|
[7f14f2] | 80 | |
---|
[f46646] | 81 | BOOLEAN jjVARIABLES_P(leftv res, leftv u); |
---|
| 82 | BOOLEAN jjVARIABLES_ID(leftv res, leftv u); |
---|
| 83 | |
---|
[0e1846] | 84 | int iiRegularity(lists L); |
---|
| 85 | leftv singular_system(sleftv h); |
---|
| 86 | BOOLEAN jjSYSTEM(leftv res, leftv v); |
---|
| 87 | void iiDebug(); |
---|
| 88 | BOOLEAN iiCheckRing(int i); |
---|
[f99917f] | 89 | poly iiHighCorner(ideal i, int ak); |
---|
[f43a74] | 90 | char * iiConvName(const char *libname); |
---|
[bf4ff72] | 91 | BOOLEAN iiLoadLIB(FILE *fp, char *libnamebuf, char *newlib, |
---|
| 92 | idhdl pl, BOOLEAN autoexport, BOOLEAN tellerror); |
---|
| 93 | |
---|
[8fa9ea] | 94 | // converts a resolution into a list of modules |
---|
| 95 | lists syConvRes(syStrategy syzstr,BOOLEAN toDel=FALSE,int add_row_shift=0); |
---|
| 96 | // converts a list of modules into a minimal resolution |
---|
| 97 | syStrategy syForceMin(lists li); |
---|
| 98 | // converts a list of modules into a resolution |
---|
| 99 | syStrategy syConvList(lists li,BOOLEAN toDel); |
---|
| 100 | |
---|
[ae3ad6] | 101 | BOOLEAN syBetti1(leftv res, leftv u); |
---|
| 102 | BOOLEAN syBetti2(leftv res, leftv u, leftv w); |
---|
| 103 | |
---|
[0e1846] | 104 | /* ================================================================== */ |
---|
| 105 | /* Expressions : */ |
---|
| 106 | BOOLEAN iiExprArith1(leftv res, sleftv* a, int op); |
---|
| 107 | BOOLEAN iiExprArith2(leftv res, sleftv* a, int op, sleftv* b, |
---|
| 108 | BOOLEAN proccall=FALSE); |
---|
| 109 | BOOLEAN iiExprArith3(leftv res, int op, leftv a, leftv b, leftv c); |
---|
| 110 | BOOLEAN iiExprArithM(leftv res, sleftv* a, int op); |
---|
| 111 | |
---|
| 112 | typedef BOOLEAN (*proc1)(leftv,leftv); |
---|
| 113 | |
---|
[637428] | 114 | #ifdef __GNUC__ |
---|
| 115 | #if (__GNUC__ < 3) |
---|
| 116 | #define INIT_BUG 1 |
---|
[0e1846] | 117 | void jjInitTab1(); |
---|
| 118 | #endif |
---|
[637428] | 119 | #endif |
---|
| 120 | |
---|
[0e1846] | 121 | #ifdef GENTABLE |
---|
| 122 | typedef char * (*Proc1)(char *); |
---|
| 123 | struct sValCmd1 |
---|
| 124 | { |
---|
| 125 | proc1 p; |
---|
| 126 | short cmd; |
---|
| 127 | short res; |
---|
| 128 | short arg; |
---|
[ee9485] | 129 | short valid_for; |
---|
[0e1846] | 130 | }; |
---|
| 131 | |
---|
| 132 | typedef BOOLEAN (*proc2)(leftv,leftv,leftv); |
---|
| 133 | struct sValCmd2 |
---|
| 134 | { |
---|
| 135 | proc2 p; |
---|
| 136 | short cmd; |
---|
| 137 | short res; |
---|
| 138 | short arg1; |
---|
| 139 | short arg2; |
---|
[ee9485] | 140 | short valid_for; |
---|
[0e1846] | 141 | }; |
---|
| 142 | |
---|
| 143 | typedef BOOLEAN (*proc3)(leftv,leftv,leftv,leftv); |
---|
| 144 | struct sValCmd3 |
---|
| 145 | { |
---|
| 146 | proc3 p; |
---|
| 147 | short cmd; |
---|
| 148 | short res; |
---|
| 149 | short arg1; |
---|
| 150 | short arg2; |
---|
| 151 | short arg3; |
---|
[ee9485] | 152 | short valid_for; |
---|
[0e1846] | 153 | }; |
---|
| 154 | struct sValCmdM |
---|
| 155 | { |
---|
| 156 | proc1 p; |
---|
| 157 | short cmd; |
---|
| 158 | short res; |
---|
| 159 | short number_of_args; /* -1: any, -2: any >0, .. */ |
---|
[ee9485] | 160 | short valid_for; |
---|
[0e1846] | 161 | }; |
---|
| 162 | extern struct sValCmd2 dArith2[]; |
---|
| 163 | extern struct sValCmd1 dArith1[]; |
---|
| 164 | extern struct sValCmd3 dArith3[]; |
---|
| 165 | extern struct sValCmdM dArithM[]; |
---|
| 166 | #endif |
---|
| 167 | |
---|
| 168 | /* ================================================================== */ |
---|
| 169 | /* Assigments : */ |
---|
| 170 | BOOLEAN iiAssign(leftv left, leftv right); |
---|
| 171 | |
---|
| 172 | typedef BOOLEAN (*proci)(leftv,leftv,Subexpr); |
---|
| 173 | struct sValAssign_sys |
---|
| 174 | { |
---|
| 175 | proc1 p; |
---|
| 176 | short res; |
---|
| 177 | short arg; |
---|
| 178 | }; |
---|
| 179 | |
---|
| 180 | struct sValAssign |
---|
| 181 | { |
---|
| 182 | proci p; |
---|
| 183 | short res; |
---|
| 184 | short arg; |
---|
| 185 | }; |
---|
| 186 | |
---|
| 187 | BOOLEAN iiParameter(leftv p); |
---|
[ea947e] | 188 | BOOLEAN iiAlias(leftv p); |
---|
[91ef34] | 189 | |
---|
| 190 | int iiTokType(int op); |
---|
[0e1846] | 191 | /* ================================================================== */ |
---|
| 192 | int iiDeclCommand(leftv sy, leftv name, int lev, int t, idhdl* root, |
---|
[0a3ddd] | 193 | BOOLEAN isring = FALSE, BOOLEAN init_b=TRUE); |
---|
[a3bc95e] | 194 | sleftv * iiMake_proc(idhdl pn, package pack, sleftv* sl); |
---|
[0e1846] | 195 | // from misc.cc: |
---|
[979a09f] | 196 | char * showOption(); |
---|
[0e1846] | 197 | BOOLEAN setOption(leftv res, leftv v); |
---|
| 198 | /* ================================================================== */ |
---|
[9ea9c6] | 199 | char * versionString(); |
---|
[706c95] | 200 | /* ================================================================== */ |
---|
| 201 | void singular_example(char *str); |
---|
[a3bc95e] | 202 | |
---|
[85e68dd] | 203 | BOOLEAN iiTryLoadLib(leftv v, const char *id); |
---|
[5c5638] | 204 | |
---|
[ce0ca7] | 205 | int iiAddCproc(const char *libname, const char *procname, BOOLEAN pstatic, |
---|
[b90cc8] | 206 | BOOLEAN(*func)(leftv res, leftv v)); |
---|
| 207 | |
---|
[d66a7d] | 208 | void iiCheckPack(package &p); |
---|
[5c5638] | 209 | #ifndef NDEBUG |
---|
| 210 | void checkall(); |
---|
| 211 | #endif |
---|
[2b7f4e] | 212 | |
---|
[88ece17] | 213 | void rSetHdl(idhdl h); |
---|
[db45a2] | 214 | ring rInit(sleftv* pn, sleftv* rv, sleftv* ord); |
---|
[2b7f4e] | 215 | idhdl rDefault(const char *s); |
---|
| 216 | |
---|
[6cc7f5] | 217 | idhdl rSimpleFindHdl(ring r, idhdl root, idhdl n=NULL); |
---|
[db45a2] | 218 | idhdl rFindHdl(ring r, idhdl n, idhdl w); |
---|
[1085d4] | 219 | void rKill(idhdl h); |
---|
| 220 | void rKill(ring r); |
---|
[bf38a4] | 221 | lists scIndIndset(ideal S, BOOLEAN all, ideal Q); |
---|
| 222 | BOOLEAN mpKoszul(leftv res,leftv c/*ip*/, leftv b/*in*/, leftv id); |
---|
[15ff9a] | 223 | BOOLEAN mpJacobi(leftv res,leftv a); |
---|
| 224 | BOOLEAN jjRESULTANT(leftv res, leftv u, leftv v, leftv w); |
---|
| 225 | BOOLEAN kQHWeight(leftv res,leftv v); |
---|
| 226 | BOOLEAN kWeight(leftv res,leftv id); |
---|
| 227 | BOOLEAN loSimplex( leftv res, leftv args ); |
---|
| 228 | BOOLEAN loNewtonP( leftv res, leftv arg1 ); |
---|
[c10515] | 229 | BOOLEAN nuMPResMat( leftv res, leftv arg1, leftv arg2 ); |
---|
| 230 | BOOLEAN nuLagSolve( leftv res, leftv arg1, leftv arg2, leftv arg3 ); |
---|
| 231 | BOOLEAN nuVanderSys( leftv res, leftv arg1, leftv arg2, leftv arg3); |
---|
| 232 | BOOLEAN nuUResSolve( leftv res, leftv args ); |
---|
[15ff9a] | 233 | |
---|
[f0168a5] | 234 | BOOLEAN jjCHARSERIES(leftv res, leftv u); |
---|
| 235 | /* |
---|
| 236 | BOOLEAN jjRESULTANT(leftv res, leftv u, leftv v, leftv w); |
---|
| 237 | #if 0 |
---|
| 238 | BOOLEAN jjIS_SQR_FREE(leftv res, leftv u); |
---|
| 239 | #endif |
---|
| 240 | */ |
---|
| 241 | |
---|
[88ece17] | 242 | |
---|
[a3bc95e] | 243 | #endif |
---|
[0e1846] | 244 | |
---|