source: git/Singular/ipshell.h @ 91ef34

spielwiese
Last change on this file since 91ef34 was 91ef34, checked in by Hans Schoenemann <hannes@…>, 12 years ago
fix(from master): sleftv::Eval needs to know CMD_M/CMD_1/ etc.
  • Property mode set to 100644
File size: 6.6 KB
Line 
1#ifndef IPSHELL_H
2#define IPSHELL_H
3/****************************************
4*  Computer Algebra System SINGULAR     *
5****************************************/
6/* $Id$ */
7/*
8* ABSTRACT
9*/
10#include <stdio.h>
11//#include <kernel/structs.h>
12#include <kernel/ideals.h>
13#include <Singular/lists.h>
14
15struct _ssubexpr;
16typedef struct _ssubexpr *Subexpr;
17
18BOOLEAN    spectrumProc ( leftv,leftv );
19BOOLEAN    spectrumfProc( leftv,leftv );
20BOOLEAN    spaddProc    ( leftv,leftv,leftv );
21BOOLEAN    spmulProc    ( leftv,leftv,leftv );
22BOOLEAN    semicProc   ( leftv,leftv,leftv );
23BOOLEAN    semicProc3   ( leftv,leftv,leftv,leftv );
24
25extern leftv iiCurrArgs;
26extern idhdl iiCurrProc;
27extern int iiOp; /* the current operation*/
28extern const char *  currid;
29extern int     iiRETURNEXPR_len;
30extern sleftv *iiRETURNEXPR;
31#ifdef USE_IILOCALRING
32extern ring   *iiLocalRing;
33#endif
34//extern cmdnames cmds[];
35extern const char *lastreserved;
36extern const char *singular_date; /* tesths.cc, set by final compile */
37
38extern BOOLEAN yyInRingConstruction; /* 1: during ring construction */
39
40int     IsCmd(const char *n, int & tok);
41
42BOOLEAN iiPStart(idhdl pn, sleftv * sl);
43BOOLEAN iiEStart(char* example, procinfo *pi);
44BOOLEAN iiAllStart(procinfov pi, char *p,feBufferTypes t, int l);
45void    type_cmd(leftv v);
46void    test_cmd(int i);
47void    list_cmd(int typ, const char* what, const char * prefix,
48                 BOOLEAN iterate, BOOLEAN fullname=FALSE);
49//char *  iiStringMatrix(matrix im, int dim, char ch=',');
50void    killlocals(int v);
51int     exprlist_length(leftv v);
52const char *  Tok2Cmdname(int i);
53const char *  iiTwoOps(int t);
54int     IsPrime(int i);
55
56BOOLEAN iiWRITE(leftv res,leftv exprlist);
57BOOLEAN iiExport(leftv v, int toLev);
58BOOLEAN iiExport(leftv v, int toLev, idhdl roothdl);
59BOOLEAN iiInternalExport (leftv v, int toLev, idhdl roothdl);
60char *  iiGetLibName(procinfov v);
61char *  iiGetLibProcBuffer( procinfov pi, int part=1 );
62char *  iiProcName(char *buf, char & ct, char* &e);
63char *  iiProcArgs(char *e,BOOLEAN withParenth);
64BOOLEAN iiLibCmd( char *newlib, BOOLEAN autoexport, BOOLEAN tellerror, BOOLEAN force );
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*/
69BOOLEAN iiLocateLib(const char* lib, char* where);
70leftv   iiMap(map theMap, const char * what);
71void    iiMakeResolv(resolvente r, int length, int rlen, char * name, int typ0,
72           intvec ** weights=NULL);
73BOOLEAN jjMINRES(leftv res, leftv v);
74BOOLEAN jjBETTI(leftv res, leftv v);
75BOOLEAN jjBETTI2(leftv res, leftv u, leftv v);
76BOOLEAN jjBETTI2_ID(leftv res, leftv u, leftv v);
77BOOLEAN jjIMPORTFROM(leftv res, leftv u, leftv v);
78BOOLEAN jjLIST_PL(leftv res, leftv v);
79
80BOOLEAN jjVARIABLES_P(leftv res, leftv u);
81BOOLEAN jjVARIABLES_ID(leftv res, leftv u);
82
83int     iiRegularity(lists L);
84leftv   singular_system(sleftv h);
85BOOLEAN jjSYSTEM(leftv res, leftv v);
86void    iiDebug();
87BOOLEAN iiCheckRing(int i);
88poly    iiHighCorner(ideal i, int ak);
89char *  iiConvName(const char *libname);
90BOOLEAN iiLoadLIB(FILE *fp, char *libnamebuf, char *newlib,
91                         idhdl pl, BOOLEAN autoexport, BOOLEAN tellerror);
92
93// converts a resolution into a list of modules
94lists syConvRes(syStrategy syzstr,BOOLEAN toDel=FALSE,int add_row_shift=0);
95// converts a list of modules into a minimal resolution
96syStrategy syForceMin(lists li);
97// converts a list of modules into a resolution
98syStrategy syConvList(lists li,BOOLEAN toDel);
99
100/* ================================================================== */
101/* Expressions : */
102BOOLEAN iiExprArith1(leftv res, sleftv* a, int op);
103BOOLEAN iiExprArith2(leftv res, sleftv* a, int op, sleftv* b,
104                     BOOLEAN proccall=FALSE);
105BOOLEAN iiExprArith3(leftv res, int op, leftv a, leftv b, leftv c);
106BOOLEAN iiExprArithM(leftv res, sleftv* a, int op);
107
108typedef BOOLEAN (*proc1)(leftv,leftv);
109
110#ifdef __GNUC__
111#if (__GNUC__ < 3)
112#define INIT_BUG 1
113void    jjInitTab1();
114#endif
115#endif
116
117#ifdef GENTABLE
118typedef char * (*Proc1)(char *);
119struct sValCmd1
120{
121  proc1 p;
122  short cmd;
123  short res;
124  short arg;
125  short valid_for;
126};
127
128typedef BOOLEAN (*proc2)(leftv,leftv,leftv);
129struct sValCmd2
130{
131  proc2 p;
132  short cmd;
133  short res;
134  short arg1;
135  short arg2;
136  short valid_for;
137};
138
139typedef BOOLEAN (*proc3)(leftv,leftv,leftv,leftv);
140struct sValCmd3
141{
142  proc3 p;
143  short cmd;
144  short res;
145  short arg1;
146  short arg2;
147  short arg3;
148  short valid_for;
149};
150struct sValCmdM
151{
152  proc1 p;
153  short cmd;
154  short res;
155  short number_of_args; /* -1: any, -2: any >0, .. */
156  short valid_for;
157};
158extern struct sValCmd2 dArith2[];
159extern struct sValCmd1 dArith1[];
160extern struct sValCmd3 dArith3[];
161extern struct sValCmdM dArithM[];
162#endif
163
164/* ================================================================== */
165/* Assigments : */
166BOOLEAN iiAssign(leftv left, leftv right);
167
168typedef BOOLEAN (*proci)(leftv,leftv,Subexpr);
169struct sValAssign_sys
170{
171  proc1 p;
172  short res;
173  short arg;
174};
175
176struct sValAssign
177{
178  proci p;
179  short res;
180  short arg;
181};
182
183BOOLEAN iiParameter(leftv p);
184BOOLEAN iiAlias(leftv p);
185
186int iiTokType(int op);
187/* ================================================================== */
188int     iiDeclCommand(leftv sy, leftv name, int lev, int t, idhdl* root,
189  BOOLEAN isring = FALSE, BOOLEAN init_b=TRUE);
190sleftv * iiMake_proc(idhdl pn, package pack, sleftv* sl);
191// from misc.cc:
192char *  showOption();
193BOOLEAN setOption(leftv res, leftv v);
194/* ================================================================== */
195char * versionString();
196/* ================================================================== */
197void  singular_example(char *str);
198
199BOOLEAN iiTryLoadLib(leftv v, const char *id);
200
201int iiAddCproc(char *libname, char *procname, BOOLEAN pstatic,
202               BOOLEAN(*func)(leftv res, leftv v));
203
204void iiCheckPack(package &p);
205#ifndef NDEBUG
206void checkall();
207#endif
208
209void rSetHdl(idhdl h);
210ring rInit(sleftv* pn, sleftv* rv, sleftv* ord);
211idhdl  rDefault(const char *s);
212
213idhdl rSimpleFindHdl(ring r, idhdl root, idhdl n=NULL);
214idhdl rFindHdl(ring r, idhdl n, idhdl w);
215void   rKill(idhdl h);
216void   rKill(ring r);
217lists scIndIndset(ideal S, BOOLEAN all, ideal Q);
218BOOLEAN mpKoszul(leftv res,leftv c/*ip*/, leftv b/*in*/, leftv id);
219BOOLEAN mpJacobi(leftv res,leftv a);
220BOOLEAN jjRESULTANT(leftv res, leftv u, leftv v, leftv w);
221BOOLEAN kQHWeight(leftv res,leftv v);
222BOOLEAN kWeight(leftv res,leftv id);
223BOOLEAN loSimplex( leftv res, leftv args );
224BOOLEAN loNewtonP( leftv res, leftv arg1 );
225BOOLEAN nuMPResMat( leftv res, leftv arg1, leftv arg2 );
226BOOLEAN nuLagSolve( leftv res, leftv arg1, leftv arg2, leftv arg3 );
227BOOLEAN nuVanderSys( leftv res, leftv arg1, leftv arg2, leftv arg3);
228BOOLEAN nuUResSolve( leftv res, leftv args );
229
230
231#endif
232
Note: See TracBrowser for help on using the repository browser.