Debian Codegraph @

tests/prep/0206tests/tmpexport/tstmodbetti.sl

raw
1
2 % Testing module resolutions and Betti numbers calculation
3
4 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5 %% Copyright (C) 1996
6 %% Alexander Podoplelov (and Joergen Backelin ?)
7 %%
8 %% Bergman and Anick are distributed in the hope that they will be
9 %% useful, but WITHOUT ANY WARRANTY. No author or distributor
10 %% accepts responsibility to anyone for the consequences of using them
11 %% or for whether they serve any particular purpose or work at all,
12 %% unless (s)he says so in writing. Refer to the Bergman General
13 %% Public License for full details.
14
15 %% Everyone is granted permission to copy, modify and redistribute
16 %% bergman, but only under the conditions described in the
17 %% Bergman General Public License. A copy of this license is
18 %% supposed to have been given to you along with bergman so you
19 %% can know your rights and responsibilities. It should be in a
20 %% file named copyright. Among other things, the copyright notice
21 %% and this notice must be preserved on all copies.
22 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
23
24
25 (OFF RAISE)
26 (GLOBAL '(anCHAINS anNEWCHAINS anOutChan cGBasis GBasis cDeg !*PBSERIES
27 !*CALCBETTI !*ONFLYBETTI anDIFFTIME anBETTITIME
28 anBETTINUMS ANICKRESOLUTIONOUTPUTFILE
29 anLASTCALCULATEDDEGREE
30 SObeg SOmid SOend btMacMx
31 anPrintSDPMode !*anchPrintEdgeString anchEdgeString!*
32 ModeProperties!*))
33
34 (GLOBAL '(anchEdgeString!* !*anchPrintEdgeString anCHAINS
35 anNEWCHAINS MONONE !*anDEBUG REDANDCOEFFONE ModeProperties!*
36 anUNITCHAIN))
37
38 (GLOBAL '(NALGGEN NMODGEN))
39
40
41 % This routine should be called before the calculation of the Anick
42 % resolution to construct the chains for the chains of length
43 % zero, as a list (in increasing order).
44 % Also construct the chain anUNITCHAIN of length -1.
45 % Mening of prog variables: Return list of chains; Variable index;
46 % Variable as a monomial; Differential.
47
48 % 2001-08-01: In this version, NALGGEN is set, and 0-chains are
49 % created only for higher variable indices, i.e., for module
50 % generators.
51
52 (DE anCONSTRUCTZEROCHAINS ()
53 (PROG (rt vi vm df)
54 (SETQ NALGGEN (DIFFERENCE (SETQ vi (GETVARNO)) NMODGEN))
55 (SETQ anUNITCHAIN (ancrMakeChain NIL NIL MONONE NIL -1))
56 Ml (COND ((NOT (LESSP NALGGEN vi))
57 (RETURN (SETQ anCHAINS (NCONS (CONS 1 rt))))))
58 (SETQ df (anMakeNewSDP))
59 (anAppendSDPTail df
60 (anChn!&QPol2SDPTail
61 anUNITCHAIN
62 (Tm2QPol
63 (Cf!&Mon2Tm REDANDCOEFFONE
64 (SETQ vm
65 (MONINTERN (NCONS vi)))))))
66 (SETQ rt (CONS (ancrMakeChain anUNITCHAIN NIL vm df 0)
67 rt))
68 (SETQ vi (SUB1 vi))
69 (GO Ml) ))
70
71
72 % For a given degree it calculates chains and the Anick
73 % resolution differentials, and prints them into the result
74 % file. It also updates related variables.
75
76 % 2001-08-01: In this version, ignores the new Groebner basis
77 % elements beginning with ring variables (except for UNSIGN).
78
79 % anifResolutionFixDegree (dgr:int) : - ;
80 (DE anifResolutionFixDegree (dgr)
81 (PROG (chp dd t1 ip)
82 (PRIN2 "Calculating the module Anick resolution in degree ")
83 (PRIN2 dgr)
84 (PRIN2 "...")
85 (TERPRI)
86
87 (UNSIGNLC!'S cGBasis)
88 (SETQ chp (CDR anCHAINS))
89
90 (COND ((NOT (EQN dgr cDeg))
91 (SETQ anNEWCHAINS (NCONS dgr))
92 (GO L1)
93 )
94 )
95
96 (SETQ ip (CDR cGBasis))
97 L2 (COND ((AND ip (NOT (LESSP NALGGEN (MonSignifVar (CAR ip)))))
98 (SETQ ip (CDR ip))
99 (GO L2)))
100
101 (SETQ anNEWCHAINS
102 (CONS cDeg (MAPCAR ip (FUNCTION anNEWGBELM2CHAIN)))
103 )
104
105 L1 (COND
106 ( chp
107 (SETQ dd (DIFFERENCE dgr (CAAR chp)))
108 (MAPC (CDAR chp) (FUNCTION (LAMBDA (u) (anCONSTRUCTNEWCHAINS u dd ))))
109 (SETQ chp (CDR chp))
110 (GO L1)
111 )
112 )%COND
113
114 (SETQ t1 (TIME))
115 (MAPC (CDR anNEWCHAINS) (FUNCTION anDIFF))
116 (SETQ anDIFFTIME (PLUS2 anDIFFTIME (DIFFERENCE (TIME) t1)))
117 % (PRINTNEWCHAINSDIFF anOutChan)
118 % (FlushChannel anOutChan)
119 (COND ( (CDR anNEWCHAINS)
120 (NCONC anCHAINS (NCONS anNEWCHAINS))))
121
122 %%%%%%%% Betti numbers calculation should be called from this point %%%%%%%
123 (COND ( (AND !*CALCBETTI !*ONFLYBETTI)
124 (SETQ t1 (TIME))
125 (anBETTI anNEWCHAINS)
126 (SETQ anBETTITIME (PLUS2 anBETTITIME (DIFFERENCE (TIME) t1)))
127 (PRINTBETTI)
128 (MACBETTIPRINT)
129 ))
130
131 (PRIN2 "end of Calculations.")
132 (TERPRI)
133 )
134 )
135
136 (ON RAISE)
137