-
Notifications
You must be signed in to change notification settings - Fork 2
/
ask Dan and Mike
1554 lines (1183 loc) · 56.1 KB
/
ask Dan and Mike
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
--*- M2 -*-
+ /Users/dan/src/M2/trunk/M2/BUILD/dan/builds.tmp/mac64.production/StagingArea/x86_64-MacOS-10.7/bin/M2 --no-readline --print-width 97
Macaulay2, version 1.4.0.1
with packages: ConwayPolynomials, Elimination, IntegralClosure, LLLBases, PrimaryDecomposition,
ReesAlgebra, TangentCone
i1 : viewHelp
i2 : f = method()
o2 = f
o2 : MethodFunction
i3 : f List := print
o3 = print
o3 : FunctionClosure
i4 : f HashTable := print
o4 = print
o4 : FunctionClosure
i5 : f {}
{}
i6 : f List
List
i7 : f 4
stdio:7:1:(3): error: no method found for applying f to:
argument : 4 (of class ZZ)
i8 : X = new Type of List
o8 = X
o8 : Type
i9 : f X := x -> ( << "X: " << x << endl ; )
o9 = {*Function[stdio:9:10-9:32]*}
o9 : FunctionClosure
i10 : methods f
o10 = {(f, HashTable)}
{(f, List) }
{(f, X) }
o10 : VerticalList
i11 : f {}
{}
i12 : f (new X from {a,b,c} )
X: {a, b, c}
i13 : x = new X from {a,b,c}
o13 = {a, b, c}
o13 : X
i14 : toList x
o14 = {a, b, c}
o14 : List
i15 : new List from x
o15 = {a, b, c}
o15 : List
i16 : Y = new Type of X
o16 = Y
o16 : Type
i17 : y = new Y from {r,s,t}
o17 = {r, s, t}
o17 : Y
i18 : new X from y
o18 = {r, s, t}
o18 : X
i19 : toExternalString X := x -> concatenate ( "new X from ", toString toList x)
o19 = {*Function[stdio:19:25-19:73]*}
o19 : FunctionClosure
i20 : toExternalString x
o20 = new X from {a, b, c}
i21 : value oo
o21 = {a, b, c}
o21 : X
i22 : generateAssertions " toExternalString x "
o22 =
assert( ( toExternalString x ) === "new X from {a, b, c}" )
i23 : generateAssertions " 2+2 "
o23 =
assert( ( 2+2 ) === 4 )
i24 : x
o24 = {a, b, c}
o24 : X
i25 : net X := x -> toString x || toString x
o25 = {*Function[stdio:25:12-25:38]*}
o25 : FunctionClosure
i26 : x
o26 = X{a, b, c}
X{a, b, c}
o26 : X
i27 : print x
X{a, b, c}
X{a, b, c}
i28 : QQ[a]
o28 = QQ[a]
o28 : PolynomialRing
i29 : print (a^2)
2
a
i30 : toString x
o30 = X{a, b, c}
i31 : toExternalString x
o31 = new X from {a, b, c}
i32 : I = ideal a
o32 = ideal(a)
o32 : Ideal of QQ[a]
i33 : J = ideal a
o33 = ideal(a)
o33 : Ideal of QQ[a]
i34 : I === J
o34 = true
i35 : J = ideal (a,a^2)
2
o35 = ideal (a, a )
o35 : Ideal of QQ[a]
i36 : I === J
o36 = false
i37 : I == J
o37 = true
i38 : K = ideal (a^2,a)
2
o38 = ideal (a , a)
o38 : Ideal of QQ[a]
i39 : J === K
o39 = false
i40 : J == K
o40 = true
i41 : X === X := (x,y) -> true
stdio:41:9:(3): error: can't assign a method for this binary operator
i42 : x
o42 = X{a, b, c}
X{a, b, c}
o42 : X
i43 : {a,b,c} === {a,b,c}
o43 = true
i44 : (new X from {a,b,c}) === (new X from {a,b,c})
o44 = true
i45 : (new X from {a,b,c}) == (new X from {a,b,c})
o45 = true
i46 : (new X from {a,b,c}) == (new X from {b,a,c})
stdio:46:22:(3): error: no method for binary operator == applied to objects:
-- a (of class QQ[a])
-- == b (of class Symbol)
i47 : X == X := (x,y) -> true
o47 = {*Function[stdio:47:17-47:20]*}
o47 : FunctionClosure
i48 : (new X from {a,b,c}) == (new X from {b,a,c})
o48 = true
i49 : debug Core
i50 : apropos "^raw"
o50 = {raw, rawAlexanderDual, rawAmbientRing, rawAssociateDivisor, rawBasis, rawBetti,
-------------------------------------------------------------------------------------------
rawBettiTally, rawBIBasis, rawCC, rawCharSeries, rawClean, rawCodimension, rawCoefficient,
-------------------------------------------------------------------------------------------
rawCoefficients, rawColon, rawColumnDotProduct, rawCompare, rawCompareMonomial, rawConcat,
-------------------------------------------------------------------------------------------
rawConcatBlocks, rawConcatColumns, rawConcatRows, rawContent, rawConvolve, rawDeclareField,
-------------------------------------------------------------------------------------------
rawDegree, rawDeleteColumns, rawDeleteRows, rawDenominator, rawDenominatorRing, rawDiff,
-------------------------------------------------------------------------------------------
rawDirectSum, rawDiscreteLog, rawDivideByVariable, rawDivMod, rawDual, rawDummy,
-------------------------------------------------------------------------------------------
rawEigenvalues, rawEigenvectors, rawEliminateVariables, rawEvaluateSLP, rawExtendedGCD,
-------------------------------------------------------------------------------------------
rawExtensionDegree, rawExteriorPower, rawExtract, rawExtractColumns, rawFactor, rawFFLU,
-------------------------------------------------------------------------------------------
rawFFPackAddMultipleTo, rawFFPackColumnRankProfile, rawFFPackDeterminant, rawFFPackInvert,
-------------------------------------------------------------------------------------------
rawFFPackNullSpace, rawFFPackRank, rawFFPackRowRankProfile, rawFFPackSolve, rawFlip,
-------------------------------------------------------------------------------------------
rawFraction, rawFractionRing, rawFreeModule, rawFromNumber, rawGaloisField, rawGB,
-------------------------------------------------------------------------------------------
rawGBBetti, rawGbBoolean, rawGBChangeOfBasis, rawGBContains, rawGBForce, rawGBGetLeadTerms,
-------------------------------------------------------------------------------------------
rawGBGetMatrix, rawGBGetParallelLeadTerms, rawGBMatrixLift, rawGBMatrixRemainder,
-------------------------------------------------------------------------------------------
rawGBMinimalGenerators, rawGBSetHilbertFunction, rawGBSetStop, rawGBSyzygies, rawGCD,
-------------------------------------------------------------------------------------------
rawGetAllSolutionsPT, rawGetMatrixEntry, rawGetNonUnit, rawGetPart, rawGetParts,
-------------------------------------------------------------------------------------------
rawGetSchreyer, rawGetSolutionLastTvaluePT, rawGetSolutionPT, rawGetSolutionRcondPT,
-------------------------------------------------------------------------------------------
rawGetSolutionStatusPT, rawGetSolutionStepsPT, rawGetSubmatrix, rawGetTerms,
-------------------------------------------------------------------------------------------
rawHermiteNormalForm, rawHilbert, rawHomogenize, rawIdealReorder, rawIdentity,
-------------------------------------------------------------------------------------------
rawIndexIfVariable, rawIndices, rawInitial, rawInsertColumns, rawInsertRows, rawIntersect,
-------------------------------------------------------------------------------------------
rawInverse, rawIsDense, rawIsEqual, rawIsField, rawIsHomogeneous, rawIsStronglyStable,
-------------------------------------------------------------------------------------------
rawIsZero, rawKeepVariables, rawKernelOfGB, rawKoszul, rawKoszulMonomials, rawLaunchPT,
-------------------------------------------------------------------------------------------
rawLCM, rawLeadCoefficient, rawLeadMonomial, rawLeadMonomialR, rawLeastSquares, rawLift,
-------------------------------------------------------------------------------------------
rawLLL, rawLocalRing, rawLowerP, rawLU, rawMakeMonomial, rawMarkedGB, rawMatrix,
-------------------------------------------------------------------------------------------
rawMatrix1, rawMatrix2, rawMatrixColumnChange, rawMatrixColumnOperation2,
-------------------------------------------------------------------------------------------
rawMatrixColumnScale, rawMatrixColumnSwap, rawMatrixCompress, rawMatrixContract,
-------------------------------------------------------------------------------------------
rawMatrixDiff, rawMatrixEntry, rawMatrixRemake1, rawMatrixRemake2, rawMatrixRowChange,
-------------------------------------------------------------------------------------------
rawMatrixRowOperation2, rawMatrixRowScale, rawMatrixRowSwap, rawMaximalIndependentSets,
-------------------------------------------------------------------------------------------
rawMemoryUsageStatus, rawMinors, rawModuleTensor, rawMonoid, rawMonomialDivide,
-------------------------------------------------------------------------------------------
rawMonomialDivides, rawMonomialIdeal, rawMonomialIdealLCM, rawMonomialIdealToMatrix,
-------------------------------------------------------------------------------------------
rawMonomialMinimalPrimes, rawMonomialOrdering, rawMonomials, rawMultiDegree,
-------------------------------------------------------------------------------------------
rawMutableIdentity, rawMutableMatrix, rawMutableMatrixFillRandom,
-------------------------------------------------------------------------------------------
rawMutableMatrixFillRandomDensity, rawNorm, rawNullspaceU, rawNumberOfColumns,
-------------------------------------------------------------------------------------------
rawNumberOfInvertibleVariables, rawNumberOfRows, rawNumberOfVariables, rawNumerator,
-------------------------------------------------------------------------------------------
rawNumgens, rawPairs, rawPathTracker, rawPathTrackerPrecookedSLPs,
-------------------------------------------------------------------------------------------
rawPathTrackerProjective, rawPermuteColumns, rawPermuteRows, rawPfaffians,
-------------------------------------------------------------------------------------------
rawPolynomialRing, rawPowerMod, rawProductMonomialOrdering, rawPromote, rawPseudoRemainder,
-------------------------------------------------------------------------------------------
rawQQ, rawQuotientRing, rawRadical, rawRandomCC, rawRandomConstantMatrix,
-------------------------------------------------------------------------------------------
rawRandomInitialize, rawRandomQQ, rawRandomRR, rawRandomZZ, rawRank, rawReduceByPivots,
-------------------------------------------------------------------------------------------
rawRefinePT, rawRemoveContent, rawRemoveMonomialFactors, rawRemoveScalarMultiples,
-------------------------------------------------------------------------------------------
rawReshape, rawResolution, rawResolutionGetFree, rawResolutionGetMatrix,
-------------------------------------------------------------------------------------------
rawResolutionStatusLevel, rawRing, rawRingMap, rawRingMapEval, rawRingVar, rawRR,
-------------------------------------------------------------------------------------------
rawSaturate, rawSchreyerSource, rawSchurDimension, rawSchurFromPartition, rawSchurRing,
-------------------------------------------------------------------------------------------
rawSchurRing1, rawSchurSnRing, rawSchurSnTensorMult, rawSetDegree, rawSetMatrixEntry,
-------------------------------------------------------------------------------------------
rawSetMatrixValues, rawSetParametersPT, rawShowComputation, rawSkewPolynomialRing, rawSLP,
-------------------------------------------------------------------------------------------
rawSmithNormalForm, rawSolvableAlgebra, rawSolve, rawSortColumns, rawSortColumns2,
-------------------------------------------------------------------------------------------
rawSource, rawSparseListFormMonomial, rawSparseMatrix1, rawSparseMatrix2, rawSplitContent,
-------------------------------------------------------------------------------------------
rawStartComputation, rawStatus1, rawStatus2, rawStatusResolution, rawStronglyStableClosure,
-------------------------------------------------------------------------------------------
rawSubduction, rawSubmatrix, rawSubmodule, rawSVD, rawSymmetricPower, rawSyzygy, rawTarget,
-------------------------------------------------------------------------------------------
rawTensor, rawTerm, rawTermCount, rawToCC, rawToInteger, rawTopCoefficients, rawToRational,
-------------------------------------------------------------------------------------------
rawToRR, rawTowerQuotientRing, rawTowerRing, rawTowerRingAdjoinVariables,
-------------------------------------------------------------------------------------------
rawTowerTranslatePoly, rawVarMonomial, rawWedgeProduct, rawWeightRange, rawWeylAlgebra,
-------------------------------------------------------------------------------------------
rawZero, rawZZ, rawZZp}
o50 : List
i51 : X RingElement := print
o51 = print
o51 : FunctionClosure
i52 : x a
(X{a, b, c}, a)
X{a, b, c}
i53 : methods symbol SPACE
o53 = {((SPACE, =), Function, Thing) }
{((SPACE, =), Thing, Thing) }
{((SPACE, =), Type, Type) }
{(SPACE, BettiTally, Array) }
{(SPACE, BettiTally, ZZ) }
{(SPACE, ChainComplex, Array) }
{(SPACE, ChainComplexMap, Array) }
{(SPACE, CoherentSheaf, LowerBound) }
{(SPACE, CoherentSheaf, ZZ) }
{(SPACE, Command, Thing) }
{(SPACE, Expression, Expression) }
{(SPACE, Expression, Holder) }
{(SPACE, Expression, Thing) }
{(SPACE, Function, Thing) }
{(SPACE, GradedModule, Array) }
{(SPACE, HeaderType, List) }
{(SPACE, HeaderType, Sequence) }
{(SPACE, Holder, Expression) }
{(SPACE, Holder, Holder) }
{(SPACE, InexactFieldFamily, Array) }
{(SPACE, InexactFieldFamily, OrderedMonoid)}
{(SPACE, Manipulator, Database) }
{(SPACE, Manipulator, File) }
{(SPACE, Manipulator, NetFile) }
{(SPACE, Manipulator, Nothing) }
{(SPACE, MarkUpType, Hypertext) }
{(SPACE, MarkUpType, Net) }
{(SPACE, MarkUpType, String) }
{(SPACE, Matrix, Vector) }
{(SPACE, Module, Array) }
{(SPACE, ProjectiveHilbertPolynomial, ZZ) }
{(SPACE, Ring, Array) }
{(SPACE, Ring, List) }
{(SPACE, Ring, OrderedMonoid) }
{(SPACE, RingElement, Array) }
{(SPACE, RingMap, ChainComplex) }
{(SPACE, RingMap, ChainComplexMap) }
{(SPACE, RingMap, Ideal) }
{(SPACE, RingMap, Matrix) }
{(SPACE, RingMap, Module) }
{(SPACE, RingMap, Number) }
{(SPACE, RingMap, RingElement) }
{(SPACE, RingMap, Vector) }
{(SPACE, ScriptedFunctor, Thing) }
{(SPACE, SelfInitializingType, Thing) }
{(SPACE, SheafOfRings, LowerBound) }
{(SPACE, SheafOfRings, ZZ) }
{(SPACE, Thing, Expression) }
{(SPACE, Thing, Thing) }
{(SPACE, WrapperType, List) }
{(SPACE, WrapperType, Sequence) }
{(SPACE, WrapperType, Thing) }
{(SPACE, X, RingElement) }
o53 : VerticalList
i54 : betti res coker vars ring a
0 1
o54 = total: 1 1
0: 1 1
o54 : BettiTally
i55 : oo[4]
-4 -3
o55 = total: 1 1
4: 1 1
o55 : BettiTally
i56 : 5 t
stdio:56:1:(3): error: no method for adjacent objects:
-- 5 (of class ZZ)
-- SPACE t (of class Symbol)
i57 : code methods symbol SPACE
o57 = -- code for method: Function SPACE Thing = Thing
../trunk/M2/Macaulay2/m2/methods.m2:571:26-573:21: --source code:
Function Thing = (f,x,e) -> (
if not storefuns#?f then error("no method for storing values of function ", toString f);
storefuns#f (x,e))
---------------------------------
-- code for method: Thing SPACE Thing = Thing
../trunk/M2/Macaulay2/m2/robust.m2:69:67-83:85: --source code:
installMethod((op,symbol =), Thing, Thing, (x,y,z) -> (
preY := centerString(width preX, opstring);
preZ := centerString(width preX, "=");
line1 := concatenate("no method for assignment to ",
if op === symbol SPACE then "adjacent objects:" else concatenate("binary operator ",op," applied to objects:")
);
if hush then error(line1, " not displayed");
wid := max(printWidth,80); -- error might occur while printWidth is narrowed
wid = wid - commentGuardWidth - width preX;
hush = true; -- prevent error message recursion
line2 := preX | silentRobustNetWithClass(wid,ht,errorPrintingTimeLimit,x);
line3 := preY | silentRobustNetWithClass(wid,ht,errorPrintingTimeLimit,y);
{* line4 := preZ | silentRobustNetWithClass(wid,ht,errorPrintingTimeLimit,z); *}
hush = false;
error toString stack(line1,commentGuard line2,commentGuard line3{*,commentGuard line4*}))));
| symbol class value location of symbol
| ------ ----- ----- ------------------
| op : Keyword -- SPACE ../trunk/M2/Macaulay2/m2/robust.m2:63:31-63:33
| opstring : String -- "SPACE" ../trunk/M2/Macaulay2/m2/robust.m2:64:11-64:19
| ht : ZZ -- 8 ../trunk/M2/Macaulay2/m2/robust.m2:65:11-65:13
| preX : String -- " " ../trunk/M2/Macaulay2/m2/robust.m2:66:11-66:15
---------------------------------
-- code for method: Type SPACE Type = Thing
../trunk/M2/Macaulay2/m2/methods.m2:452:60-452:97: --source code:
installAssignmentMethod(op, Type, Type, (X,Y,am) -> installAssignmentMethod(op, X, Y, am));
| symbol class value location of symbol
| ------ ----- ----- ------------------
| op : Keyword -- SPACE ../trunk/M2/Macaulay2/m2/methods.m2:451:31-451:33
---------------------------------
-- code for method: BettiTally Array
../trunk/M2/Macaulay2/m2/chaincomplexes.m2:657:27-660:37: --source code:
BettiTally Array := (C,A) -> (
if # A =!= 1 then error "expected array of length 1";
n := A#0;
applyKeys(C,(i,d,h) -> (i-n,d,h)))
---------------------------------
-- code for method: BettiTally ZZ
../trunk/M2/Macaulay2/m2/chaincomplexes.m2:652:24-652:58: --source code:
BettiTally ZZ := (C,n) -> applyKeys(C, (i,d,h) -> (i,d,h-n))
---------------------------------
-- code for method: ChainComplex Array
../trunk/M2/Macaulay2/m2/chaincomplexes.m2:557:45-570:6: --source code:
ChainComplex Array := ChainComplex => (C,A) -> (
if # A =!= 1 then error "expected array of length 1";
n := A#0;
if not instance(n,ZZ) then error "expected an integer";
D := new ChainComplex;
b := D.dd;
D.ring = ring C;
complete C;
scan(pairs C,(i,F) -> if class i === ZZ then D#(i-n) = F);
complete C.dd;
if even n
then scan(pairs C.dd, (i,f) -> if class i === ZZ then b#(i-n) = f)
else scan(pairs C.dd, (i,f) -> if class i === ZZ then b#(i-n) = -f);
D)
---------------------------------
-- code for method: ChainComplexMap Array
../trunk/M2/Macaulay2/m2/chaincomplexes.m2:572:51-583:6: --source code:
ChainComplexMap Array := ChainComplexMap => (f,A) -> (
if # A =!= 1 then error "expected array of length 1";
n := A#0;
if not instance(n,ZZ) then error "expected an integer";
complete f;
g := new ChainComplexMap;
g.cache = new CacheTable;
g.source = f.source A;
g.target = f.target A;
g.degree = f.degree;
scan(spots f, i -> g#(i-n) = f_i);
g)
---------------------------------
-- code for method: CoherentSheaf LowerBound
../trunk/M2/Macaulay2/m2/varieties.m2:193:50-193:78: --source code:
CoherentSheaf LowerBound := SumOfTwists => (F,b) -> new SumOfTwists from {F, b}
---------------------------------
-- code for method: CoherentSheaf ZZ
../trunk/M2/Macaulay2/m2/varieties.m2:127:44-127:86: --source code:
CoherentSheaf ZZ := CoherentSheaf => (F,n) -> sheaf(variety F, F.module ** (ring F)^{n})
---------------------------------
-- code for method: Command Thing
../trunk/M2/Macaulay2/m2/command.m2:21:24-21:31: --source code:
Command Thing := (x,y) -> x#0 y
---------------------------------
-- code for method: Expression Expression
../trunk/M2/Macaulay2/m2/expressions.m2:394:44-394:68: --source code:
Expression Expression := Adjacent => (x,y) -> new Adjacent from {x,y}
---------------------------------
-- code for method: Expression Holder
../trunk/M2/Macaulay2/m2/expressions.m2:396:32-396:58: --source code:
Expression Holder := (x,y) -> new Adjacent from {x,y#0}
---------------------------------
-- code for method: Expression Thing
../trunk/M2/Macaulay2/m2/expressions.m2:399:32-399:49: --source code:
Expression Thing := (x,y) -> x (expression y)
---------------------------------
-- code for method: Function Thing
../trunk/M2/Macaulay2/m2/typicalvalues.m2:134:30-134:40: --source code:
Function Thing := Thing => x -> (dummy x;)
---------------------------------
-- code for method: GradedModule Array
../trunk/M2/Macaulay2/m2/gradedmodules.m2:306:45-312:6: --source code:
GradedModule Array := GradedModule => (C,A) -> (
if # A =!= 1 then error "expected array of length 1";
n := A#0;
D := new GradedModule;
D.ring = C.ring;
scan(spots C, i -> D#(i-n) = C#i);
D)
---------------------------------
-- code for method: HeaderType List
../trunk/M2/Macaulay2/m2/expressions.m2:39:26-39:40: --source code:
HeaderType List := (T,z) -> new T from z
---------------------------------
-- code for method: HeaderType Sequence
../trunk/M2/Macaulay2/m2/expressions.m2:40:30-40:44: --source code:
HeaderType Sequence := (T,z) -> new T from z
---------------------------------
-- code for method: Holder Expression
../trunk/M2/Macaulay2/m2/expressions.m2:395:32-395:58: --source code:
Holder Expression := (x,y) -> new Adjacent from {x#0,y}
---------------------------------
-- code for method: Holder Holder
../trunk/M2/Macaulay2/m2/expressions.m2:397:32-397:60: --source code:
Holder Holder := (x,y) -> new Adjacent from {x#0,y#0}
---------------------------------
-- code for method: InexactFieldFamily Array
../trunk/M2/Macaulay2/m2/reals.m2:193:35-193:50: --source code:
InexactFieldFamily Array := (T,X) -> (default T) X
---------------------------------
-- code for method: InexactFieldFamily OrderedMonoid
../trunk/M2/Macaulay2/m2/orderedmonoidrings.m2:133:43-133:58: --source code:
InexactFieldFamily OrderedMonoid := (T,M) -> (default T) M
---------------------------------
-- code for method: Manipulator Database
../trunk/M2/Macaulay2/d/startup.m2.in:101:79-101:86: --source code:
Manipulator Database := Manipulator File := Manipulator NetFile := (m,o) -> m#0 o;
---------------------------------
-- code for method: Manipulator File
../trunk/M2/Macaulay2/d/startup.m2.in:101:79-101:86: --source code:
Manipulator Database := Manipulator File := Manipulator NetFile := (m,o) -> m#0 o;
---------------------------------
-- code for method: Manipulator NetFile
../trunk/M2/Macaulay2/d/startup.m2.in:101:79-101:86: --source code:
Manipulator Database := Manipulator File := Manipulator NetFile := (m,o) -> m#0 o;
---------------------------------
-- code for method: Manipulator Nothing
../trunk/M2/Macaulay2/d/startup.m2.in:103:38-103:41: --source code:
Manipulator Nothing := (m,null) -> null;
---------------------------------
-- code for method: MarkUpType Hypertext
../trunk/M2/Macaulay2/m2/html0.m2:30:31-30:46: --source code:
MarkUpType Hypertext := (M,x) -> new M from {x}
---------------------------------
-- code for method: MarkUpType Net
../trunk/M2/Macaulay2/m2/html0.m2:28:25-28:49: --source code:
MarkUpType Net := (M,x) -> new M from {toString x}
---------------------------------
-- code for method: MarkUpType String
../trunk/M2/Macaulay2/m2/html0.m2:30:31-30:46: --source code:
MarkUpType Hypertext := (M,x) -> new M from {x}
---------------------------------
-- code for method: Matrix Vector
../trunk/M2/Macaulay2/m2/matrix.m2:188:53-190:25: --source code:
Matrix * Vector := Matrix Vector := Vector => (m,v) -> (
u := m * v#0;
new target u from {u})
---------------------------------
-- code for method: Module Array
../trunk/M2/Macaulay2/m2/chaincomplexes.m2:901:39-908:6: --source code:
Module Array := ChainComplex => (M,v) -> (
if #v =!= 1 then error "expected array of length 1";
n := v#0;
if class n =!= ZZ then error "expected [n] with n an integer";
C := new ChainComplex;
C.ring = ring M;
C#-n = M;
C)
---------------------------------
-- code for method: ProjectiveHilbertPolynomial ZZ
../trunk/M2/Macaulay2/m2/modules2.m2:195:41-195:83: --source code:
ProjectiveHilbertPolynomial ZZ := (P,i) -> sum(pairs P, (n,c) -> c * binomial(n+i,n))
---------------------------------
-- code for method: Ring Array
../trunk/M2/Macaulay2/m2/orderedmonoidrings.m2:308:47-308:63: --source code:
Ring Array := PolynomialRing => (R,variables) -> use R monoid variables
---------------------------------
-- code for method: Ring List
../trunk/M2/Macaulay2/m2/orderedmonoidrings.m2:309:46-309:82: --source code:
Ring List := PolynomialRing => (R,variables) -> use R monoid (variables,Local => true)
---------------------------------
-- code for method: Ring OrderedMonoid
../trunk/M2/Macaulay2/m2/orderedmonoidrings.m2:135:12-302:11: --source code:
(R,M) -> (
if not M.?RawMonoid then error "expected ordered monoid handled by the engine";
if not R.?RawRing then error "expected coefficient ring handled by the engine";
num := numgens M;
(basering,flatmonoid,numallvars) := (
if R.?isBasic then (R,M,num)
else if R.?basering and R.?FlatMonoid
then ( R.basering, tensor(M, R.FlatMonoid), num + R.numallvars)
else if instance(R,FractionField) then (R,M,num)
else error "internal error: expected coefficient ring to have a base ring and a flat monoid"
);
local RM;
Weyl := M.Options.WeylAlgebra =!= {};
skews := monoidIndices(M,M.Options.SkewCommutative);
coeffOptions := options R;
coeffWeyl := coeffOptions =!= null and coeffOptions.WeylAlgebra =!= {};
coeffSkew := coeffOptions =!= null and coeffOptions.SkewCommutative =!= {};
coeffConstants := coeffOptions =!= null and coeffOptions.Constants;
constants := false;
if M.Options.Constants or coeffConstants then (
constants = true;
RM = new PolynomialRing from rawTowerRing(char R, flatmonoid.generatorSymbols / toString // toSequence);
)
else if Weyl or coeffWeyl then (
if Weyl and R.?SkewCommutative then error "coefficient ring has skew commuting variables";
if Weyl and skews =!= {} then error "skew commutative Weyl algebra requested";
diffs := M.Options.WeylAlgebra;
if class diffs === Option then diffs = {diffs}
else if class diffs =!= List then error "expected list as WeylAlgebra option";
diffs = apply(diffs, x -> if class x === Option then toList x else x);
h := select(diffs, x -> class x =!= List);
if #h > 1 then error "WeylAlgebra: expected at most one homogenizing variable";
h = monoidIndices(M,h);
if #h === 1 then h = h#0 else h = -1;
if R.?homogenize then (
if h == -1 then h = R.homogenize + num
else if R.homogenize + num =!= h then error "expected the same homogenizing variable";
)
else if coeffWeyl and h != -1 then error "coefficient Weyl algebra has no homogenizing variable";
diffs = select(diffs, x -> class x === List);
diffs = apply(diffs, x -> (
if class x#0 === Sequence and class x#1 === Sequence
then (
if #(x#0) =!= #(x#1) then error "expected sequences of the same length";
mingle x
)
else toList x
));
diffs = flatten diffs;
local diffs0; local diffs1;
diffs = pack(2,diffs);
diffs0 = monoidIndices(M,first\diffs);
diffs1 = monoidIndices(M,last\diffs);
if any(values tally join(diffs0,diffs1), n -> n > 1) then error "WeylAlgebra option: a variable specified more than once";
if coeffWeyl then (
diffs0 = join(diffs0, apply(R.diffs0, i -> i + num));
diffs1 = join(diffs1, apply(R.diffs1, i -> i + num));
);
scan(diffs0,diffs1,(x,dx) -> if not x<dx then error "expected differentiation variables to occur to the right of their variables");
RM = new PolynomialRing from rawWeylAlgebra(rawPolynomialRing(raw basering, raw flatmonoid),diffs0,diffs1,h);
RM.diffs0 = diffs0;
RM.diffs1 = diffs1;
addHook(RM, QuotientRingHook, S -> (S.diffs0 = diffs0; S.diffs1 = diffs1));
if h != -1 then RM.homogenize = h;
)
else if skews =!= {} or R.?SkewCommutative then (
if R.?diffs0 then error "coefficient ring is a Weyl algebra";
if R.?SkewCommutative then skews = join(skews, apply(R.SkewCommutative, i -> i + num));
RM = new PolynomialRing from rawSkewPolynomialRing(rawPolynomialRing(raw basering, raw flatmonoid),skews);
RM.SkewCommutative = skews;
)
else (
log := FunctionApplication {rawPolynomialRing, (raw basering, raw flatmonoid)};
RM = new PolynomialRing from value log;
RM#"raw creation log" = Bag {log};
);
if R#?"has quotient elements" or isQuotientOf(PolynomialRing,R) then (
RM.RawRing = rawQuotientRing(RM.RawRing, R.RawRing);
RM#"has quotient elements" = true;
);
RM.basering = basering;
RM.FlatMonoid = flatmonoid;
RM.numallvars = numallvars;
RM.promoteDegree = (
if flatmonoid.Options.DegreeMap === null
then makepromoter degreeLength RM -- means the degree map is zero
else (
dm := flatmonoid.Options.DegreeMap;
nd := flatmonoid.Options.DegreeRank;
degs -> apply(degs,deg -> degreePad(nd,dm deg))));
RM.liftDegree = (
if flatmonoid.Options.DegreeLift === null
then makepromoter degreeLength R -- lifing the zero degree map
else (
lm := flatmonoid.Options.DegreeLift;
degs -> apply(degs,lm)
));
RM.baseRings = append(R.baseRings,R);
commonEngineRingInitializations RM;
RM.monoid = M;
if flatmonoid.?degreesRing then RM.degreesRing = flatmonoid.degreesRing;
if flatmonoid.?degreesMonoid then RM.degreesMonoid = flatmonoid.degreesMonoid;
RM.isCommutative = not Weyl and not RM.?SkewCommutative;
ONE := RM#1;
if R.?char then RM.char = R.char;
RM _ M := (f,m) -> new R from rawCoefficient(R.RawRing, raw f, raw m);
if constants
then expression RM := f -> (
-- later we'll put in something prettier, maybe
toString raw f
)
else expression RM := f -> (
(
(coeffs,monoms) -> (
if #coeffs === 0
then expression 0
else sum(coeffs,monoms, (a,m) -> expression (if a == 1 then 1 else promote(a,R)) * expression (if m == 1 then 1 else new M from m))
)
) rawPairs(raw R, raw f)
-- new Holder2 from {(
-- (coeffs,monoms) -> (
-- if #coeffs === 0
-- then expression 0
-- else sum(coeffs,monoms, (a,m) -> unhold expression (if a == 1 then 1 else promote(a,R)) * unhold expression (if m == 1 then 1 else new M from m))
-- )
-- ) rawPairs(raw R, raw f),
-- f}
);
if M.Options.Inverses === true then (
denominator RM := f -> RM_( - min \ transpose exponents f );
numerator RM := f -> f * denominator f;
);
factor RM := opts -> f -> (
c := 1;
(facs,exps) := rawFactor raw f; -- example value: ((11, x+1, x-1, 2x+3), (1, 1, 1, 1)); constant term is first, if there is one
facs = apply(facs, p -> new RM from p);
if liftable(facs#0,R) then (
-- factory returns the possible constant factor in front
assert(exps#0 == 1);
c = facs#0;
facs = drop(facs,1);
exps = drop(exps,1);
);
if #facs != 0 then (facs,exps) = toSequence transpose sort transpose {toList facs, toList exps};
if c != 1 then (
-- we put the possible constant factor at the end
facs = append(facs,c);
exps = append(exps,1);
);
new Product from apply(facs,exps,(p,n) -> new Power from {p,n}));
isPrime RM := f -> (
v := factor f; -- constant term last
#v === 1 and last v#0 === 1 and not isConstant first v#0
or
#v === 2 and v#0#1 === 1 and isConstant first v#0 and v#1#1 === 1
);
RM.generatorSymbols = M.generatorSymbols;
RM.generators = apply(num, i -> RM_i);
RM.generatorExpressions = (
M.generatorExpressions
-- apply(M.generatorExpressions,RM.generators,(e,x) -> (new Holder2 from {e#0,x}))
);
RM.indexSymbols = new HashTable from join(
if R.?indexSymbols then apply(pairs R.indexSymbols, (nm,x) -> nm => new RM from rawPromote(raw RM,raw x)) else {},
apply(num, i -> M.generatorSymbols#i => RM_i)
);
RM.indexStrings = hashTable apply(pairs RM.indexSymbols, (k,v) -> (toString k, v));
RM))
---------------------------------
-- code for method: RingElement Array
../trunk/M2/Macaulay2/m2/ringmap.m2:392:28-392:59: --source code:
RingElement Array := (r,v) -> substitute(r,matrix {toList v})
---------------------------------
-- code for method: RingMap ChainComplex
../trunk/M2/Macaulay2/m2/chaincomplexes.m2:310:47-317:6: --source code:
RingMap ChainComplex := ChainComplex => (f,C) -> (
D := new ChainComplex;
D.ring = target f;
complete C;
scan(spots C, i -> D#i = f C#i);
complete C.dd;
scan(spots C.dd, i -> D.dd#i = map(D_(i-1),D_i, f C.dd#i));
D)
---------------------------------
-- code for method: RingMap ChainComplexMap
../trunk/M2/Macaulay2/m2/chaincomplexes.m2:319:55-319:101: --source code:
RingMap ChainComplexMap := ChainComplexMap => (f,phi) -> map(f target phi, f source phi, i -> f phi_i)
---------------------------------
-- code for method: RingMap Ideal
../trunk/M2/Macaulay2/m2/ringmap.m2:394:33-394:51: --source code:
RingMap Ideal := Ideal => (f,I) -> ideal f module I
---------------------------------
-- code for method: RingMap Matrix
../trunk/M2/Macaulay2/m2/ringmap.m2:153:35-160:99: --source code:
RingMap Matrix := Matrix => (p,m) -> (
R := source p;
S := target p;
if R =!= ring m
then error "expected source of ring map to be the same as ring of matrix";
F := p target m;
E := p source m;
map(F,E,map(S,rawRingMapEval(raw p, raw cover F, raw m)), Degree => p.cache.DegreeMap degree m))
---------------------------------
-- code for method: RingMap Module
../trunk/M2/Macaulay2/m2/ringmap.m2:398:35-411:19: --source code:
RingMap Module := Module => (f,M) -> (
R := source f;
S := target f;
if R =!= ring M then error "expected module over source ring";
if M.?relations then error "ring map applied to module with relations: use '**' or 'tensor' instead";
if M.?generators then image f M.generators
else (
d := degrees M;
e := f.cache.DegreeMap \ d;
if R === S and d === e
then M -- use the same module if we can
else S^-e
)
)
---------------------------------
-- code for method: RingMap Number
../trunk/M2/Macaulay2/m2/ringmap.m2:151:25-151:52: --source code:
RingMap Number := (p,m) -> fff(p, promote(m,source p))
---------------------------------
-- code for method: RingMap RingElement
../trunk/M2/Macaulay2/m2/ringmap.m2:143:52-149:43: --source code:
RingMap RingElement := RingElement => fff := (p,m) -> (
R := source p;
S := target p;
if R =!= ring m then (
m = try promote(m,R) else error "ring element not in source of ring map, and not promotable to it";
);
promote(rawRingMapEval(raw p, raw m),S))
---------------------------------
-- code for method: RingMap Vector
../trunk/M2/Macaulay2/m2/ringmap.m2:162:35-164:24: --source code:
RingMap Vector := Vector => (p,m) -> (
f := p new Matrix from m;
new target f from f)
---------------------------------
-- code for method: ScriptedFunctor Thing
../trunk/M2/Macaulay2/m2/gateway.m2:24:32-28:61: --source code:
ScriptedFunctor Thing := (G,X) -> (
if G#?argument
then G#argument X
else error("no method for ", toString G, " ", toString X)
)
---------------------------------
-- code for method: SelfInitializingType Thing
../trunk/M2/Macaulay2/m2/setup.m2:22:37-22:51: --source code:
SelfInitializingType Thing := (T,z) -> new T from z
---------------------------------
-- code for method: SheafOfRings LowerBound
../trunk/M2/Macaulay2/m2/varieties.m2:194:49-194:56: --source code:
SheafOfRings LowerBound := SumOfTwists => (O,b) -> O^1 b
---------------------------------
-- code for method: SheafOfRings ZZ
../trunk/M2/Macaulay2/m2/varieties.m2:128:43-128:50: --source code:
SheafOfRings ZZ := CoherentSheaf => (O,n) -> O^1(n)
---------------------------------
-- code for method: Thing Expression
../trunk/M2/Macaulay2/m2/expressions.m2:400:32-400:50: --source code:
Thing Expression := (x,y) -> (expression x) y
---------------------------------
-- code for method: Thing Thing
../trunk/M2/Macaulay2/m2/robust.m2:86:54-98:85: --source code:
installMethod(op, Thing, Thing, (x,y) -> (
line1 := concatenate("no method for ",
if op === symbol SPACE then "adjacent objects:" else concatenate("binary operator ",op," applied to objects:")
);
if hush then error(line1, " not displayed");
preY := centerString(#preX, opstring);
wid := max(printWidth,80); -- error might occur while printWidth is narrowed
wid = wid - commentGuardWidth - width preX;
hush = true; -- prevent error message recursion
line2 := preX | silentRobustNetWithClass(wid,ht,errorPrintingTimeLimit,x);
line3 := preY | silentRobustNetWithClass(wid,ht,errorPrintingTimeLimit,y);
hush = false;
error toString stack(line1,commentGuard line2,commentGuard line3))))));
| symbol class value location of symbol
| ------ ----- ----- ------------------
| op : Keyword -- SPACE ../trunk/M2/Macaulay2/m2/robust.m2:63:31-63:33
| opstring : String -- "SPACE" ../trunk/M2/Macaulay2/m2/robust.m2:64:11-64:19
| ht : ZZ -- 8 ../trunk/M2/Macaulay2/m2/robust.m2:65:11-65:13
| preX : String -- " " ../trunk/M2/Macaulay2/m2/robust.m2:66:11-66:15
---------------------------------
-- code for method: WrapperType List
../trunk/M2/Macaulay2/m2/expressions.m2:44:27-44:41: --source code:
WrapperType List := (T,z) -> new T from z
---------------------------------
-- code for method: WrapperType Sequence
../trunk/M2/Macaulay2/m2/expressions.m2:45:31-45:45: --source code:
WrapperType Sequence := (T,z) -> new T from z
---------------------------------
-- code for method: WrapperType Thing
../trunk/M2/Macaulay2/m2/expressions.m2:46:28-46:43: --source code:
WrapperType Thing := (T,z) -> new T from {z}
---------------------------------
-- code for method: X RingElement
../trunk/M2/Macaulay2/m2/expressions.m2:1109:11-1109:27: --source code:
print = x -> (<< net x << endl;)
i58 : newPackage "Foo"
o58 = Foo
o58 : Package
i59 : export "List"
o59 = {List}
o59 : List
i60 : endPackage "Foo"
--warning: symbol "List" in Core#"private dictionary" is shadowed by a symbol in Foo.Dictionary
-- use the synonym Core$List
--warning: symbol "List" in Core.Dictionary is shadowed by a symbol in Foo.Dictionary
-- use the synonym Core$List
o60 = Foo
o60 : Package
i61 : restart
Macaulay2, version 1.4.0.1
with packages: ConwayPolynomials, Elimination, IntegralClosure, LLLBases, PrimaryDecomposition,
ReesAlgebra, TangentCone
i1 : newPackage "Foo"
o1 = Foo
o1 : Package
i2 : export "List"
o2 = {List}
o2 : List
i3 : endPackage "Foo"
--warning: symbol "List" in Core.Dictionary is shadowed by a symbol in Foo.Dictionary
-- use the synonym Core$List
o3 = Foo
o3 : Package