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