+ M2 --no-readline --print-width 99
Macaulay2, version 1.9.2
with packages: ConwayPolynomials, Elimination, IntegralClosure, LLLBases, PrimaryDecomposition,
               ReesAlgebra, TangentCone

i1 : loadPackage("MatFacCurvesP4")

o1 = MatFacCurvesP4

o1 : Package

i2 : ------------------------------------------------------------------
     -- Proposition 2.1                                              --
     -- Expected Betti tables of a general curve of genus 12 and     --
     -- degree 14	    	    	    	    	    	    	--
     ------------------------------------------------------------------
     p=32009; -- a prime number

i3 : Fp=ZZ/p; -- a prime field

i4 : S=Fp[x_0..x_4]; -- homogeneous coordinate ring of P4

i5 : -- We construct a curve C of genus 12 and degree 14 using
     -- Algorithm 4.6 
     time IC=randomCurveGenus12Degree14InP4(S); -- takes 13 sec
     -- used 13.0422 seconds

o5 : Ideal of S

i6 : -- C is smooth of the right genus and degree
     (codim IC, genus IC, degree IC) == (3, 12, 14)

o6 = true

i7 : isSmoothCurve(IC)

o7 = true

i8 : -- C and its section module have expected Betti table
     betti res IC

            0 1  2  3 4
o8 = total: 1 9 18 12 2
         0: 1 .  .  . .
         1: . .  .  . .
         2: . 4  .  . .
         3: . 5 18 12 2

o8 : BettiTally

i9 : omegaC=Ext^2(IC,S^{ -5}); -- canonical module of C

i10 : fomega=res omegaC;

i11 : sM=S^{ -5}**coker transpose fomega.dd_3;

i12 : betti res sM

             0  1  2 3
o12 = total: 3 14 15 4
          0: 1  .  . .
          1: .  .  . .
          2: 2 14 15 2
          3: .  .  . 2

o12 : BettiTally

i13 : gIC=gens IC;     

              1       9
o13 : Matrix S  <--- S

i14 : X=ideal(gIC * random(source gIC,S^{-min(degrees source gIC)}));

o14 : Ideal of S

i15 : betti res prune(sM**(S/X))

             0  1  2  3  4  5  6
o15 = total: 3 13 17 17 17 17 17
          0: 1  .  .  .  .  .  .
          1: .  .  .  .  .  .  .
          2: 2 13 15  2  .  .  .
          3: .  .  2 15 15  2  .
          4: .  .  .  .  2 15 15
          5: .  .  .  .  .  .  2

o15 : BettiTally

i16 :