source: git/Singular/ipshell.h @ 33d610

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