| 323 | } |
| 324 | VAR char *iparith_inc; |
| 325 | void ttGen1() |
| 326 | { |
| 327 | iparith_inc=strdup("iparith.xxxxxx"); |
| 328 | int pid=getpid(); |
| 329 | iparith_inc[8]=(pid %10)+'0'; pid/=10; |
| 330 | iparith_inc[9]=(pid %10)+'0'; pid/=10; |
| 331 | iparith_inc[10]=(pid %10)+'0'; pid/=10; |
| 332 | iparith_inc[11]=(pid %10)+'0'; pid/=10; |
| 333 | iparith_inc[12]=(pid %10)+'0'; pid/=10; |
| 334 | iparith_inc[13]=(pid %10)+'0'; |
| 335 | FILE *outfile = fopen(iparith_inc,"w"); |
| 336 | int i,j,l1=0,l2=0; |
| 337 | fprintf(outfile, |
| 338 | "/****************************************\n" |
| 339 | "* Computer Algebra System SINGULAR *\n" |
| 340 | "****************************************/\n\n"); |
| 341 | /*-------------------------------------------------------------------*/ |
| 342 | fprintf(outfile,"// syntax table for Singular\n//\n"); |
| 343 | fprintf(outfile,"// - search for an exact match of the argument types\n"); |
| 344 | fprintf(outfile,"// - otherwise search for the first possibility\n"); |
| 345 | fprintf(outfile,"// with converted types of the arguments\n"); |
| 346 | fprintf(outfile,"// - otherwise report an error\n//\n"); |
| 347 | fprintf(outfile,"// --------------------------------------------------\n"); |
| 348 | fprintf(outfile,"// depends on Singular/table.h and kernel/mod2.h\n\n"); |
| 349 | |
| 350 | int op; |
| 351 | i=0; |
| 352 | while ((op=dArith1[i].cmd)!=0) |
| 353 | { |
| 354 | if (dArith1[i].p==jjWRONG) |
| 355 | fprintf(outfile,"// DUMMY "); |
| 356 | const char *s = iiTwoOps(op); |
| 357 | fprintf(outfile,"// operation: %s (%s) -> %s", |
| 358 | s, |
| 359 | Tok2Cmdname(dArith1[i].arg), |
| 360 | Tok2Cmdname(dArith1[i].res)); |
| 361 | if (RingDependend(dArith1[i].res) && (!RingDependend(dArith1[i].arg))) |
| 362 | fprintf(outfile," requires currRing"); |
| 363 | if ((dArith1[i].valid_for & NC_MASK)==2) |
| 364 | fprintf(outfile,", commutative subalgebra"); |
| 365 | else if ((dArith1[i].valid_for & NC_MASK)==ALLOW_LP) |
| 366 | fprintf(outfile,", letterplace rings"); |
| 367 | else if ((dArith1[i].valid_for & NC_MASK)==0) |
| 368 | fprintf(outfile,", only commutative rings"); |
| 369 | if ((dArith1[i].valid_for & RING_MASK)==0) |
| 370 | fprintf(outfile,", field coeffs"); |
| 371 | else if ((dArith1[i].valid_for & ZERODIVISOR_MASK)==NO_ZERODIVISOR) |
| 372 | fprintf(outfile,", domain coeffs"); |
| 373 | else if ((dArith1[i].valid_for & WARN_RING)==WARN_RING) |
| 374 | fprintf(outfile,", QQ coeffs"); |
| 375 | |
| 376 | fprintf(outfile,"\n"); |
| 377 | i++; |
| 378 | } |
| 379 | fprintf(outfile,"/*---------------------------------------------*/\n"); |
| 380 | i=0; |
| 381 | while ((op=dArith2[i].cmd)!=0) |
| 382 | { |
no test coverage detected