A.2 Procedures and LIB
======================

The computation of the Milnor number (for an arbitrary isolated complete
intersection singularity ICIS) and the Tjurina number (for an arbitrary
isolated singularity) can be done by using procedures from the library
sing.lib. For a hypersurface singularity it is very easy to write a
procedure which computes the Milnor number and the Tjurina number.

We shall demonstrate:
* load the library sing.lib
* define a local ring in 2 variables and characteristic 0
* define a plane curve singularity
* compute Milnor number and Tjurina number by using the procedures
milnor and tjurina
* write your own procedures:
(A procedure has a list of input parameters and of return values, both
lists may be empty.)
  -   the procedure mil which must be called with one parameter, a
  polynomial.
  The name g is local to the procedure and is killed automatically.
  mil returns the Milnor number (and displays a comment).
  -   the procedure tjur where the parameters are not specified. They
  are referred
  to by #[1] for the 1st, #[2] for the 2nd parameter, etc.
  tjur returns the Tjurina number (and displays a comment).
  -   the procedure milrina which returns a list consisting of two
  integers,
  the Milnor and the Tjurina number.
  
LIB "sing.lib";
// you should get the information that sing.lib has been loaded
// together with some other libraries which are needed by sing.lib
ring r = 0,(x,y),ds;
poly f = x7+y7+(x-y)^2*x2y2;
milnor(f);
==> 28
tjurina(f);
==> 24

proc mil (poly g)
{
   "Milnor number:";
   return(vdim(std(jacob(g))));
}
mil(f);
==> Milnor number:
==> 28

proc tjur
{
   "Tjurina number:";
   return(vdim(std(jacob(#[1])+#[1])));
}
tjur(f);
==> Tjurina number:
==> 24

proc milrina (poly f)
{
   ideal j=jacob(f);
   list L=vdim(std(j)),vdim(std(j+f));
   return(L);
}
milrina(f);     // a list containing Milnor and Tjurina number
==> [1]:
==>    28
==> [2]:
==>    24
milrina(f)[2];  // the second element of the list
==> 24

<font size="-1">
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; User manual for <a href="http://www.singular.uni-kl.de/"><i>Singular</i></a> version 2-0-4, October 2002,
generated by <a href="http://www.gnu.org/software/texinfo/"><i>texi2html</i></a>.
</font>

</body>
</html>
