1 | head 1.3;
|
---|
2 | access;
|
---|
3 | symbols;
|
---|
4 | locks; strict;
|
---|
5 | comment @;;; @;
|
---|
6 |
|
---|
7 |
|
---|
8 | 1.3
|
---|
9 | date 2009.01.19.07.05.15; author marek; state Exp;
|
---|
10 | branches;
|
---|
11 | next 1.2;
|
---|
12 |
|
---|
13 | 1.2
|
---|
14 | date 2009.01.19.07.02.21; author marek; state Exp;
|
---|
15 | branches;
|
---|
16 | next 1.1;
|
---|
17 |
|
---|
18 | 1.1
|
---|
19 | date 2009.01.19.06.48.20; author marek; state Exp;
|
---|
20 | branches;
|
---|
21 | next ;
|
---|
22 |
|
---|
23 |
|
---|
24 | desc
|
---|
25 | @@
|
---|
26 |
|
---|
27 |
|
---|
28 | 1.3
|
---|
29 | log
|
---|
30 | @*** empty log message ***
|
---|
31 | @
|
---|
32 | text
|
---|
33 | @#|
|
---|
34 | $Id$
|
---|
35 | *--------------------------------------------------------------------------*
|
---|
36 | | Copyright (C) 1994, Marek Rychlik (e-mail: rychlik@@math.arizona.edu) |
|
---|
37 | | Department of Mathematics, University of Arizona, Tucson, AZ 85721 |
|
---|
38 | | |
|
---|
39 | | Everyone is permitted to copy, distribute and modify the code in this |
|
---|
40 | | directory, as long as this copyright note is preserved verbatim. |
|
---|
41 | *--------------------------------------------------------------------------*
|
---|
42 | |#
|
---|
43 | ;;(eval-when (eval load compile)
|
---|
44 | ;; (require :user-manual "../contrib/user_man/user-manual"))
|
---|
45 |
|
---|
46 | (defpackage "MAKE-CGB"
|
---|
47 | (:use "COMMON-LISP"))
|
---|
48 |
|
---|
49 | (in-package "MAKE-CGB")
|
---|
50 |
|
---|
51 | (defvar *save-path* "cgblisp")
|
---|
52 |
|
---|
53 | (defvar *cgb-version-string* "CGB Package: @@(#)defsystem.lisp, version 1.9 of 2/13/96(17:56:13)"
|
---|
54 | "Refer to this version string when reporting bugs.")
|
---|
55 |
|
---|
56 | (defvar *lisp-suffix* ".lisp" "File extension used by the lisp system.")
|
---|
57 | (defvar *cgb-packages*
|
---|
58 | '("MAKELIST" "ORDER" "MONOM" "XGCD" "MODULAR" "COEFFICIENT-RING"
|
---|
59 | "TERM" "POLY" "MODULAR-POLY" "DIVISION" "PARSE" "PRINTER" "POLY-WITH-SUGAR"
|
---|
60 | "GROBNER" "COLORED-POLY" "POLY-GCD" "RAT" "RATPOLY"
|
---|
61 | "STRING-GROBNER" "DYNAMICS" "PROVER"
|
---|
62 | "INFIX" "CGB-LISP"))
|
---|
63 |
|
---|
64 | ;;----------------------------------------------------------------
|
---|
65 | ;; Various features which affect the functioning of the package
|
---|
66 | ;;----------------------------------------------------------------
|
---|
67 |
|
---|
68 | ;;Use pseudodivision to keep the size of integer coefficients
|
---|
69 | ;;as small as possible
|
---|
70 | (pushnew :pseudodivide *features*)
|
---|
71 |
|
---|
72 | ;;Use the grobner package within colored-poly package
|
---|
73 | (pushnew :colored-poly-use-grobner *features*)
|
---|
74 |
|
---|
75 | ;;colored-poly package
|
---|
76 | ;;Compute saturation of green lists with respect to
|
---|
77 | ;;red lists in order to eliminate cases early
|
---|
78 | (pushnew :use-saturation *features*)
|
---|
79 |
|
---|
80 | ;;Print tracing and debugging output
|
---|
81 | (pushnew :debug *features*)
|
---|
82 |
|
---|
83 | ;;Use gcd of integers to keep the size of integer coefficients
|
---|
84 | ;; of S-polynomials and normal forms down
|
---|
85 | (pushnew :use-gcd *features*)
|
---|
86 |
|
---|
87 | ;;grobner package
|
---|
88 | ;;Use the algorithm of Gebauer and Moeller (1988) to
|
---|
89 | ;;calculate Grobner bases
|
---|
90 | ;;(pushnew :use-gebauer-moeller *features*)
|
---|
91 |
|
---|
92 | #|
|
---|
93 | ;;Needed by Allegro Common Lisp in order to maintain
|
---|
94 | ;;compatibility with the book of Steele (1st edition)
|
---|
95 | ;;in regard to in-package and related operations
|
---|
96 | (pushnew :cgb-cltl1-compatibility *features*)
|
---|
97 | |#
|
---|
98 |
|
---|
99 | ;;Use pair reordering according to some heuristic in the
|
---|
100 | ;;Grobner algorithm
|
---|
101 | (pushnew :reorder-pairs *features*)
|
---|
102 |
|
---|
103 | ;;Perform Buchberger criterion every time a Grobner
|
---|
104 | ;;basis is returned or assumed as an argument;
|
---|
105 | ;;This feature is mostly for debugging by the
|
---|
106 | ;;package developer, but if you detect failure
|
---|
107 | ;;of the package in this way, please send the
|
---|
108 | ;;output to rychlik@@math.arizona.edu
|
---|
109 | ;;DO NOT TURN THIS FEATURE ON IF EFFICIENCY
|
---|
110 | ;;IS REQUIRED!!!
|
---|
111 | ;;(pushnew :grobner-check *features*)
|
---|
112 |
|
---|
113 | #|
|
---|
114 | #+cgb-cltl1-compatibility
|
---|
115 | (progn
|
---|
116 | #+allegro
|
---|
117 | (progn
|
---|
118 | (setf *cltl1-in-package-compatibility-p* t)
|
---|
119 | (setf comp:*cltl1-compile-file-toplevel-compatibility-p* t)
|
---|
120 | (use-package *cltl1-package*))
|
---|
121 | )
|
---|
122 | |#
|
---|
123 |
|
---|
124 | (defun package-file (package-name)
|
---|
125 | (string-downcase package-name))
|
---|
126 |
|
---|
127 | (defun cgb-compile ()
|
---|
128 | #+kcl(system "rm *.o")
|
---|
129 | (dolist (package *cgb-packages*)
|
---|
130 | (print '----------------)
|
---|
131 | (compile-file (package-file package))
|
---|
132 | (load (package-file package))))
|
---|
133 |
|
---|
134 | (defun cgb-load (&key (print nil))
|
---|
135 | (declare (ignore print))
|
---|
136 | (dolist (package *cgb-packages*)
|
---|
137 | (load (package-file package)))
|
---|
138 | ;;A fix around a bug in GCL which causes
|
---|
139 | ;;an undefined symbol __setjmp with
|
---|
140 | ;;compiled code
|
---|
141 | #+gcl (load (concatenate 'string "parse" *lisp-suffix*))
|
---|
142 | )
|
---|
143 |
|
---|
144 | (defun cgb-load-lisp (&key (print nil))
|
---|
145 | (declare (ignore print))
|
---|
146 | (dolist (package *cgb-packages*)
|
---|
147 | (let ((lisp-file (concatenate 'string (package-file package) *lisp-suffix*)))
|
---|
148 | (load lisp-file)
|
---|
149 | ;;(use-package package)
|
---|
150 | )))
|
---|
151 |
|
---|
152 | (defun cgb-compile-and-load ()
|
---|
153 | (cgb-compile)
|
---|
154 | (cgb-load))
|
---|
155 |
|
---|
156 | (defun cgb-go ()
|
---|
157 | (in-package :cgb-lisp))
|
---|
158 |
|
---|
159 | #+allegro
|
---|
160 | (defun start-cgb-lisp ()
|
---|
161 | (tpl:start-interactive-top-level
|
---|
162 | *terminal-io*
|
---|
163 | #'cgb-lisp-top-level-read-eval-print-loop
|
---|
164 | nil
|
---|
165 | :initial-bindings nil))
|
---|
166 |
|
---|
167 | #+allegro
|
---|
168 | (defun cgb-lisp-top-level-read-eval-print-loop (&rest args)
|
---|
169 | (in-package :cgb-lisp)
|
---|
170 | (apply #'tpl:top-level-read-eval-print-loop args))
|
---|
171 |
|
---|
172 | #+allegro
|
---|
173 | (defun cgb-lisp-banner ()
|
---|
174 | (format
|
---|
175 | t
|
---|
176 | "~&Comprehensive Grobner Basis package by Marek Rychlik preloaded.~%~a~%"
|
---|
177 | *cgb-version-string*))
|
---|
178 |
|
---|
179 | #+kcl
|
---|
180 | (defun cgb-save ()
|
---|
181 | (defvar system::*akcl-top-level* (symbol-function 'system::top-level))
|
---|
182 | (compile
|
---|
183 | 'system::top-level
|
---|
184 | '(lambda ()
|
---|
185 | (format
|
---|
186 | t
|
---|
187 | "~&Comprehensive Grobner Basis package by Marek Rychlik preloaded.~%~a~%"
|
---|
188 | *cgb-version-string*)
|
---|
189 | (funcall system::*akcl-top-level*)))
|
---|
190 | (save *save-path*))
|
---|
191 |
|
---|
192 | #+allegro
|
---|
193 | (defun cgb-save ()
|
---|
194 | (setf excl:*restart-init-function* 'cgb-lisp-banner)
|
---|
195 | ;;(setf excl:*restart-app-function* 'start-cgb-lisp)
|
---|
196 | (excl:dumplisp
|
---|
197 | :name *save-path*
|
---|
198 | :home-env-var "CGBLISP_HOME"))
|
---|
199 |
|
---|
200 | ;;(load-system)
|
---|
201 |
|
---|
202 | ;;----------------------------------------------------------------
|
---|
203 | ;; Generate documentation
|
---|
204 | ;;----------------------------------------------------------------
|
---|
205 | ;;(defun create-cgb-manuals (prefix format)
|
---|
206 | ;; (create-manuals (mapcar #'intern *cgb-packages*)
|
---|
207 | ;; :prefix prefix
|
---|
208 | ;; :extension '.lisp
|
---|
209 | ;; :output-format format))
|
---|
210 |
|
---|
211 | ;;(defun cgb-doc ()
|
---|
212 | ;; (create-cgb-manuals '../doc/ 'text)
|
---|
213 | ;; (create-cgb-manuals '../latex-doc/ 'latex))
|
---|
214 | @
|
---|
215 |
|
---|
216 |
|
---|
217 | 1.2
|
---|
218 | log
|
---|
219 | @*** empty log message ***
|
---|
220 | @
|
---|
221 | text
|
---|
222 | @d105 1
|
---|
223 | a105 1
|
---|
224 | (load package))
|
---|
225 | @
|
---|
226 |
|
---|
227 |
|
---|
228 | 1.1
|
---|
229 | log
|
---|
230 | @Initial revision
|
---|
231 | @
|
---|
232 | text
|
---|
233 | @d2 1
|
---|
234 | a2 1
|
---|
235 | $Id: make-cgb.lisp,v 1.60 1997/12/16 04:44:13 marek Exp $
|
---|
236 | d105 1
|
---|
237 | a105 1
|
---|
238 | (require package))
|
---|
239 | @
|
---|