Fix bug #4307: partswitch affects op and operatorp
[maxima.git] / src / globals.lisp
blob6b620e0e4806ce4b59b58c83487eeaae92057abf
1 ;;;; -*- Mode: Lisp; Package: Maxima; Syntax: Common-Lisp; Base: 10 -*- ;;;;
3 ;;;; This file contains global vars (defvars/defmvars) that are used in
4 ;;;; multiple files. We gather them all here so that they are
5 ;;;; consistently defined across the build and to make the dependencies
6 ;;;; easier to track.
8 (in-package "MAXIMA")
10 ;; Distill various Unicode-related features into a single :lisp-unicode-capable.
11 ;; Park it here since this file is required by most, although not all, of the other Lisp files.
12 ;; See also function DISPLAY2D-UNICODE-ENABLED in src/init-cl.lisp.
14 #+(or unicode sb-unicode openmcl-unicode-strings abcl (and allegro ics))
15 (push :lisp-unicode-capable *features*)
17 (defvar *variable-initial-values* (make-hash-table)
18 "Hash table containing all Maxima defmvar variables and their
19 initial values")
21 (eval-when (:compile-toplevel :load-toplevel :execute)
22 ;; Set this to T before compiling Maxima to see all the uses of
23 ;; deprecated options. When NIL, no such messages are printed.
24 (defvar *warn-deprecated-defmvar-options* t
25 "Set to non-NIL to have DEFMVAR print out warnings about deprecated
26 options"))
28 (defmacro defmvar (var &optional val doc &rest options)
29 "Define a Maxima variable VAR that is user-visible. It is
30 initialized to the value VAL. An associated documentation string
31 can be supplied in DOC. OPTIONS contains a list of options that can
32 be applied to the variable.
34 The valid options are:
36 NO-RESET
37 - If given, the variable will not be reset.
38 FIXNUM, BOOLEAN, STRING, FLONUM
39 - The type of variable. Currently ignored.
40 :PROPERTIES
41 - A list of properties to be applied for this variable. It is
42 a list of lists. Each sublist is a list of the property and
43 the value to be assigned to the property.
44 :SETTING-PREDICATE
45 - A function (symbol or lambda) of one argument specifying the
46 value that variable is to be set to. It should return
47 non-NIL if the value is valid. When NIL is returned, an
48 optional second value may be given which is a string giving
49 the reason why the setting failed.
50 :SETTING-LIST
51 - A list of values that can be assigned to the variable. An
52 error is signaled if an attempt to assign a different value
53 is done.
54 :DEPRECATED-P
55 - The variable is marked as deprecated. The option is a
56 string to be printed when this deprecated variable is used.
57 A warning is printed once when first used. This option
58 overrides any other options. When the variable is used, a
59 message is printed of the form: \"Deprecated variable
60 `<var>': <string>\" where <var> is the name of this
61 variable, and <string> is the value given to :deprecated-p.
63 An example of usage:
65 (defmvar $foo foo-value
66 \"Docstring for deprecated foo.\"
67 :deprecated-p \"Use bar instead\")
69 The list of properties has the form ((ind1 val1) (ind2 val2) ...)
70 where IND1 is the name of the property and VAL1 is the value
71 associated with the property.
73 Other options that are recognized but ignored: IN-CORE, SEE-ALSO,
74 MODIFIED-COMMANDS. For any other options, a warning is produced.
76 Do not use both :SETTING-PREDICATE and :SETTING-LIST. Also do not
77 use a :PROPERTIES with an 'ASSIGN property. :SETTING-PREDICATE and
78 :SETTING-LIST sets the 'ASSIGN property to implement the
79 functionality.
81 (let ((maybe-reset
82 ;; Default is to reset the variable to it's initial value.
83 `((unless (gethash ',var *variable-initial-values*)
84 (setf (gethash ',var *variable-initial-values*)
85 ,val))))
86 maybe-declare-type
87 maybe-set-props
88 maybe-predicate
89 maybe-boolean-predicate
90 setting-predicate-p
91 setting-list-p
92 assign-property-p
93 deprecated-p)
95 (do ((opts options (rest opts)))
96 ((null opts))
97 #+nil
98 (format t "opts = ~S~%" opts)
99 (case (car opts)
100 (no-reset
101 (unless deprecated-p
102 ;; Don't reset the value
103 (setf maybe-reset nil)))
104 ((fixnum string flonum)
105 ;; Don't declare the types yet. There are testsuite failures
106 ;; with sbcl that some things declared fixnum aren't assigned
107 ;; fixnum values. Some are clearly bugs in the code where we
108 ;; do things like
110 ;; (let ($expop ...)
111 ;; (setq $expop 0))
113 ;; Some known such variables: $expop, $fpprintprec (in ev
114 ;; statements), $factors_only, $expon,
116 ;; We should also note that when this is fixed, we should
117 ;; also add an 'assign property to verify that only fixnums,
118 ;; etc., are allowed.
119 (when *warn-deprecated-defmvar-options*
120 (format t "*** Deprecated defmvar option: ~A for ~A~%"
121 (car opts) var)))
122 (in-core
123 ;; Ignore this
125 (boolean
126 ;; Vars declared as boolean create a setting-list so that
127 ;; only true and false can be assigned to the variable.
128 (let ((assign-func
129 `#'(lambda (var val)
130 (let ((possible-values '(t nil)))
131 (unless (member val possible-values)
132 (mseterr var val
133 (let ((*print-case* :downcase))
134 (format nil "must be one of: ~{~A~^, ~}"
135 (mapcar #'stripdollar possible-values)))))))))
136 (setf maybe-boolean-predicate
137 `((putprop ',var ,assign-func 'assign)))))
138 (:properties
139 (unless deprecated-p
140 (setf maybe-set-props
141 (mapcar #'(lambda (o)
142 (destructuring-bind (ind val)
144 (when (eql ind 'assign)
145 (setf assign-property-p t))
146 `(putprop ',var ,val ',ind)))
147 (second opts)))
148 (when assign-property-p
149 (when setting-predicate-p
150 (error "Cannot use 'ASSIGN property in :PROPERTIES if :SETTING-PREDICATE already specified."))
151 (when setting-list-p
152 (error "Cannot use 'ASSIGN property in :PROPERTIES if :SETTING-LIST already specified."))))
153 (setf opts (rest opts)))
154 (:setting-predicate
155 (unless deprecated-p
156 (when setting-list-p
157 (error "Cannot use :SETTING-PREDICATE when :SETTING-LIST already specified."))
158 (when assign-property-p
159 (error "Cannot use :SETTING-PREDICATE when :PROPERTIES uses the 'ASSIGN property."))
160 (setf setting-predicate-p t)
161 ;; A :SETTING-PREDICATE is a function (symbol or lambda) of
162 ;; one arg specifying the value that variable is to be set
163 ;; to. It should return non-NIL if the value is valid. An
164 ;; optional second value may be returned. This is a string
165 ;; that can be used as the reason arg for MSETERR to explain
166 ;; why the setting failed.
168 ;; WARNING: Do not also have a :properties item with an
169 ;; 'assign property. Currently this takes precedence.
170 (let ((assign-func
171 `#'(lambda (var val)
172 (multiple-value-bind (ok reason)
173 (funcall ,(second opts) val)
174 (unless ok
175 (mseterr var val reason))))))
176 (setf maybe-predicate
177 `((putprop ',var ,assign-func 'assign)))))
179 ;; Skip over the predicate function.
180 (setf opts (rest opts)))
181 (:setting-list
182 (unless deprecated-p
183 (when setting-predicate-p
184 (error "Cannot use :SETTING-LIST when :SETTING-PREDICATE already specified."))
185 (when assign-property-p
186 (error "Cannot use :SETTING-LIST when :PROPERTIES uses the 'ASSIGN property."))
187 (setf setting-list-p t)
188 ;; A :SETTING-LIST is a list of possible values that can be
189 ;; assigned to the variable. An error is signaled if the
190 ;; variable is not assigned to one of these values. This
191 ;; could be handled with :SETTING-PREDICATE, of course. This
192 ;; is a convenience feature but it also makes it explicit
193 ;; that we only allow the possible values.
194 (let ((assign-func
195 `#'(lambda (var val)
196 (let ((possible-values ',(second opts)))
197 (unless (member val possible-values)
198 (mseterr var val
199 (let ((*print-case* :downcase))
200 (format nil "must be one of: ~{~A~^, ~}"
201 (mapcar #'stripdollar possible-values)))))))))
202 (setf maybe-predicate
203 `((putprop ',var ,assign-func 'assign)))))
204 ;; Skip over the values.
205 (setf opts (rest opts)))
206 ((see-also modified-commands)
207 ;; Not yet supported, but we need to skip over the following
208 ;; item too which is the parameter for this option.
209 (setf opts (rest opts)))
210 (setting-list
211 ;; This has been replaced by :setting-list and is now an
212 ;; error to use this option.
213 (error "setting-list has been superseded by :setting-list"))
214 (:deprecated-p
215 ;; This overrides everything and makes the variable
216 ;; deprecated. This means it's unbound, and the 'bindtest
217 ;; property is set and the 'assign property is set to
218 ;; 'neverset. The option is a string for the bindtest
219 ;; message.
220 (setf deprecated-p t
221 maybe-reset nil
222 maybe-declare-type nil
223 maybe-predicate nil
224 setting-predicate-p nil
225 setting-list-p nil
226 assign-property-p nil)
227 (setf maybe-set-props
228 `((cl:makunbound ',var)
229 (putprop ',var :deprecated 'bindtest)
230 (putprop ',var 'neverset 'assign)
231 (setf *bindtest-deprecation-messages*
232 (acons ',var
233 (cons
234 (concatenate 'string
235 "Deprecated variable `~M': "
236 ,(second opts))
237 ,val)
238 *bindtest-deprecation-messages*))))
239 (setf opts (rest opts)))
241 (warn "Ignoring unknown defmvar option for ~S: ~S"
242 var (car opts)))))
243 (when maybe-boolean-predicate
244 (if (or setting-predicate-p setting-list-p assign-property-p)
245 (error "Do not use BOOLEAN option when :SETTING-PREDICATE, :SETTING-LIST, or :PROPERTIES is used")
246 ;; Check that boolean predicate isn't used with any other
247 ;; predicate. The other predicates supersede boolean.
248 (setf maybe-predicate maybe-boolean-predicate)))
250 `(progn
251 ,@maybe-reset
252 ,@maybe-declare-type
253 (defvar ,var ,val ,doc)
254 ,@maybe-set-props
255 ,@maybe-predicate)))
257 ;; For the symbol SYM, add to the plist the property INDIC with a
258 ;; value of VAL.
260 ;; Some known INDIC properties
262 ;; ASSIGN
263 ;; When a variable is assigned (in maxima), the 'assign property
264 ;; is used to check whether the value to be assigned is valid.
265 ;; The value can be anything that can be funcall'ed. If it
266 ;; returns, then the assignment proceeds. Thus, if the value is
267 ;; invalid, an error must be signaled.
268 ;; EVFLAG
269 ;; When a symbol <x> has this property, expressions 'ev(<expr>,
270 ;; <x>)' and '<expr>, <x>' are equivalent to 'ev(<expr>,
271 ;; <x>=true)'. See the user manual for more details.
272 ;; SYSCONST
273 ;; When true, it denotes that the symbol is a constant and
274 ;; cannot be changed by the user. This includes things like
275 ;; $%pi, $%e, $inf, $minf, $true, and $false.
276 (defun putprop (sym val indic)
277 (if (consp sym)
278 (setf (getf (cdr sym) indic) val)
279 (setf (get sym indic) val)))
281 ;;------------------------------------------------------------------------
282 ;; From limit.lisp
284 ;; Declare user-visible special variables and other global special variables.
286 ;; Should these be defconstants? I (rtoy) don't think they should be
287 ;; allowed to be changed.
288 (defmvar *infinities* '($inf $minf $infinity)
289 "The types of infinities recognized by Maxima.
290 INFINITY is complex infinity")
292 (defmvar *real-infinities* '($inf $minf)
293 "The real infinities, `inf' is positive infinity, `minf' negative infinity")
295 (defmvar *infinitesimals* '($zeroa $zerob)
296 "The infinitesimals recognized by Maxima. ZEROA zero from above,
297 ZEROB zero from below")
299 ;;------------------------------------------------------------------------
300 ;; From clmacs.lisp
302 ;; Define useful floating-point constants
303 #+clisp
304 (progn
305 ;; This used to be enabled, but
306 ;; http://clisp.cons.org/impnotes/num-dict.html seems to indicate
307 ;; that the result of float, coerce, sqrt, etc., on a rational will
308 ;; return a float of the specified type. But ANSI CL says we must
309 ;; return a single-float. I (rtoy) am commenting this out for now.
311 ;; (setq custom:*default-float-format* 'double-float)
313 ;; We currently don't want any warnings about floating-point contagion.
314 (setq custom::*warn-on-floating-point-contagion* nil)
316 ;; We definitely want ANSI-style floating-point contagion.
317 (setq custom:*floating-point-contagion-ansi* t)
319 ;; Set custom:*floating-point-rational-contagion-ansi* so that
320 ;; contagion is done as per the ANSI CL standard. Has an effect only
321 ;; in those few cases when the mathematical result is exact although
322 ;; one of the arguments is a floating-point number, such as (* 0
323 ;; 1.618), (/ 0 1.618), (atan 0 1.0), (expt 2.0 0)
324 (setq custom:*floating-point-rational-contagion-ansi* t)
326 ;; When building maxima using with 'flonum being a 'long-float it may be
327 ;; useful to adjust the number of bits of precision that CLISP uses for
328 ;; long-floats.
329 #+nil
330 (setf (ext:long-float-digits) 128)
332 ;; We want underflows not to signal errors.
333 (ext:without-package-lock ()
334 (setq sys::*inhibit-floating-point-underflow* t))
337 #+abcl
338 (progn
339 ;; We want underflows not to signal errors
340 (when (fboundp (find-symbol "FLOAT-UNDERFLOW-MODE" "SYS"))
341 (funcall (find-symbol "FLOAT-UNDERFLOW-MODE" "SYS") nil))
344 ;; Make the maximum exponent larger for CMUCL. Without this, cmucl
345 ;; will generate a continuable error when raising an integer to a
346 ;; power greater than this.
347 #+cmu
348 (setf ext::*intexp-maximum-exponent* 100000)
349 ;;;; Setup the mapping from the Maxima 'flonum float type to a CL float type.
350 ;;;;
351 ;;;; Add :flonum-long to *features* if you want flonum to be a
352 ;;;; long-float. Or add :flonum-double-double if you want flonum to
353 ;;;; be a double-double (currently only for CMUCL). Otherwise, you
354 ;;;; get double-float as the flonum type.
355 ;;;;
356 ;;;; Default double-float flonum.
357 (eval-when (:compile-toplevel :load-toplevel :execute)
358 (setq *read-default-float-format* 'double-float))
360 #-(or flonum-long flonum-double-double)
361 (progn
362 ;; Tell Lisp the float type for a 'flonum.
363 #-(or clisp abcl)
364 (deftype flonum (&optional low high)
365 (cond (high
366 `(double-float ,low ,high))
367 (low
368 `(double-float ,low))
370 'double-float)))
372 ;; Some versions of clisp and ABCL appear to be buggy: (coerce 1 'flonum)
373 ;; signals an error. So does (coerce 1 '(double-float 0d0)). But
374 ;; (coerce 1 'double-float) returns 1d0 as expected. So for now, make
375 ;; flonum be exactly the same as double-float, without bounds.
376 #+(or clisp abcl)
377 (deftype flonum (&optional low high)
378 (declare (ignorable low high))
379 'double-float)
381 (defconstant +most-positive-flonum+ most-positive-double-float)
382 (defconstant +most-negative-flonum+ most-negative-double-float)
383 (defconstant +least-positive-flonum+ least-positive-double-float)
384 (defconstant +least-negative-flonum+ least-negative-double-float)
385 (defconstant +flonum-epsilon+ double-float-epsilon)
386 (defconstant +least-positive-normalized-flonum+ least-positive-normalized-double-float)
387 (defconstant +least-negative-normalized-flonum+ least-negative-normalized-double-float)
389 (defconstant +flonum-exponent-marker+ #\D)
392 #+flonum-long
393 (progn
394 ;;;; The Maxima 'flonum can be a CL 'long-float on the Scieneer CL or CLISP,
395 ;;;; but should be the same as 'double-float on other CL implementations.
397 (eval-when (:compile-toplevel :load-toplevel :execute)
398 (setq *read-default-float-format* 'long-float))
400 ;; Tell Lisp the float type for a 'flonum.
401 (deftype flonum (&optional low high)
402 (cond (high
403 `(long-float ,low ,high))
404 (low
405 `(long-float ,low))
407 'long-float)))
409 (defconstant +most-positive-flonum+ most-positive-long-float)
410 (defconstant +most-negative-flonum+ most-negative-long-float)
411 (defconstant +least-positive-flonum+ least-positive-long-float)
412 (defconstant +least-negative-flonum+ least-negative-long-float)
413 (defconstant +flonum-epsilon+ long-float-epsilon)
414 (defconstant +least-positive-normalized-flonum+ least-positive-normalized-long-float)
415 (defconstant +least-negative-normalized-flonum+ least-negative-normalized-long-float)
417 (defconstant +flonum-exponent-marker+ #\L)
421 #+flonum-double-double
422 (progn
424 ;;;; The Maxima 'flonum can be a 'kernel:double-double-float on the CMU CL.
426 (eval-when (:compile-toplevel :load-toplevel :execute)
427 (setq *read-default-float-format* 'kernel:double-double-float))
429 ;; Tell Lisp the float type for a 'flonum.
430 (deftype flonum (&optional low high)
431 (cond (high
432 `(kernel:double-double-float ,low ,high))
433 (low
434 `(kernel:double-double-float ,low))
436 'kernel:double-double-float)))
438 ;; While double-double can represent number as up to
439 ;; most-positive-double-float, it can't really do operations on them
440 ;; due to the way multiplication and division are implemented. (I
441 ;; don't think there's any workaround for that.)
443 ;; So, the largest number that can be used is the float just less than
444 ;; 2^1024/(1+2^27). This is the number given here.
445 (defconstant most-positive-double-double-hi
446 (scale-float (cl:float (1- 9007199187632128) 1d0) 944))
448 (defconstant +most-positive-flonum+ (cl:float most-positive-double-double-hi 1w0))
449 (defconstant +most-negative-flonum+ (cl:float (- most-positive-double-double-hi 1w0)))
450 (defconstant +least-positive-flonum+ (cl:float least-positive-double-float 1w0))
451 (defconstant +least-negative-flonum+ (cl:float least-negative-double-float 1w0))
452 ;; This is an approximation to a double-double epsilon. Due to the
453 ;; way double-doubles are represented, epsilon is actually zero
454 ;; because 1+x = 1 only when x is zero. But double-doubles only have
455 ;; 106 bits of precision, so we use that as epsilon.
456 (defconstant +flonum-epsilon+ (scale-float 1w0 -106))
457 (defconstant +least-positive-normalized-flonum+ (cl:float least-positive-normalized-double-float 1w0))
458 (defconstant +least-negative-normalized-flonum+ (cl:float least-negative-normalized-double-float 1w0))
460 (defconstant +flonum-exponent-marker+ #\W)
464 ;;------------------------------------------------------------------------
465 ;; From algsys.lisp
466 (defmvar $%rnum_list '((mlist))
467 "Upon exit from ALGSYS this is bound to a list of the %RNUMS which
468 where introduced into the expression. Useful for mapping over and
469 using as an argument to SUBST.")
470 ;;------------------------------------------------------------------------
471 ;; From asum.lisp
472 (defmvar $zeta%pi t
473 "When true, 'zeta' returns an expression proportional to '%pi^n' for
474 even integer 'n'.")
476 ;; factorial stuff
478 (defmvar $factlim 100000 ; set to a big integer which will work (not -1)
479 "specifies the highest factorial which is automatically expanded. If
480 it is -1 then all integers are expanded.")
481 (defvar makef nil)
483 (defmvar $cauchysum nil
484 "When multiplying together sums with INF as their upper limit, causes
485 the Cauchy product to be used rather than the usual product. In the
486 Cauchy product the index of the inner summation is a function of the
487 index of the outer one rather than varying independently."
488 modified-commands '$sum
489 :properties ((evflag t)))
491 ;; sum begins
492 (defmvar $gensumnum 0
493 "The numeric suffix used to generate the next variable of summation.
494 If it is set to FALSE then the index will consist only of GENINDEX
495 with no numeric suffix."
496 modified-commands '$sum
497 :setting-predicate #'(lambda (x)
498 (values (or (null x)
499 (and (integerp x)
500 (>= x 0)))
501 "must be false or a non-negative integer")))
503 (defmvar $genindex '$i
504 "The alphabetic prefix used to generate the next variable of summation
505 when necessary."
506 modified-commands '$sum
507 :setting-predicate #'symbolp)
509 (defmvar $zerobern t
510 "when false, 'bern' excludes the Bernoulli numbers and 'euler'
511 excludes the Euler numbers which are equal to zero.")
512 (defmvar $simpsum nil
513 "When true, the result of a 'sum' is simplified. This simplification
514 may sometimes be able to produce a closed form."
515 :properties ((evflag t)))
516 (defmvar $simpproduct nil
517 "When true, the result of a 'product' is simplified. This
518 simplification may sometimes be able to produce a closed form."
519 :properties ((evflag t)))
521 (defvar *infsumsimp t)
523 (defmvar $cflength 1
524 "Controls the number of terms of the continued fraction the function
525 'cf' will give, as the value 'cflength' times the period.")
526 (defmvar $taylordepth 3
527 "If there are still no nonzero terms, 'taylor' doubles the degree of
528 the expansion of '<g>(<x>)' so long as the degree of the expansion
529 is less than or equal to '<n> 2^taylordepth'.")
530 (defmvar $verbose nil
531 "When true, 'powerseries' prints progress messages.")
533 (defvar silent-taylor-flag nil
534 ;; From comment in hayat.lisp
535 "If true indicates that errors will be returned via a throw to
536 TAY-ERR")
538 ;; linear operator stuff
539 (defparameter *opers-list '(($linear . linearize1)))
541 (defparameter opers (list '$linear))
543 ;;------------------------------------------------------------------------
544 ;; From comm2.lisp
545 (defmvar $rootsconmode t
546 "Governs the behavior of the 'rootscontract' command. See
547 'rootscontract' for details."
548 :setting-list (nil t $all))
550 ;;------------------------------------------------------------------------
551 ;; From comm.lisp
552 (defmvar $exptsubst nil
553 "When 'true', permits substitutions such as 'y' for '%e^x' in
554 '%e^(a*x)'.")
555 (defmvar $partswitch nil
556 "When true, 'end' is returned when a selected part of an expression
557 doesn't exist, otherwise an error message is given.")
558 (defmvar $inflag nil
559 "When true, functions for part extraction inspect the internal form of
560 'expr'.")
561 (defmvar $derivsubst nil
562 "When true, a non-syntactic substitution such as 'subst (x, 'diff (y,
563 t), 'diff (y, t, 2))' yields ''diff (x, t)'.")
564 (defmvar $opsubst t
565 "When false, 'subst' does not attempt to substitute into the operator
566 of an expression.")
568 (defvar *islinp* nil
569 "When T, sdiff is called from the function islinear")
570 (defvar *atp* nil
571 "When T, prevents substitution from applying to vars ; bound by %sum,
572 %product, %integrate, %limit")
574 ;; Store built-in operators, which get additional properties.
575 ;; These operators aren't killed by the function kill-operator.
576 (defvar *mopl* nil)
578 (defvar atvars '($@1 $@2 $@3 $@4))
579 (defvar in-p nil)
580 (defvar substp nil)
582 (defvar dummy-variable-operators '(%product %sum %laplace %integrate %limit %at))
584 ;;------------------------------------------------------------------------
585 ;; From compar.lisp
586 (defvar $context '$global
587 "Whenever a user assumes a new fact, it is placed in the context named
588 as the current value of the variable CONTEXT. Similarly, FORGET
589 references the current value of CONTEXT. To add or DELETE a fact
590 from a different context, one must bind CONTEXT to the intended
591 context and then perform the desired additions or deletions. The
592 context specified by the value of CONTEXT is automatically
593 activated. All of MACSYMA's built-in relational knowledge is
594 contained in the default context GLOBAL.")
596 (defmvar $contexts '((mlist) $global)
597 "A list of the currently active contexts."
598 no-reset
599 :properties ((assign 'neverset)))
601 (defvar $activecontexts '((mlist))
602 "A list of the currently activated contexts")
604 (defvar *complexsign* nil
605 "If T, COMPAR works in a complex mode.")
607 (defmvar $prederror nil
608 "When true, an error message is displayed whenever the predicate of an
609 'if' statement or an 'is' function fails to evaluate to either
610 'true' or 'false'.")
611 (defmvar limitp)
613 (defmvar sign-imag-errp t
614 "If T errors out in case COMPAR meets up with an imaginary
615 quantity. If NIL THROWs in that case."
616 no-reset)
618 ;;------------------------------------------------------------------------
619 ;; From cpoly.lisp
620 (defmvar $polyfactor nil
621 "When T factor the polynomial over the real or complex numbers.")
623 ;;------------------------------------------------------------------------
624 ;; From csimp2.lisp
625 (defmvar $gamma_expand nil
626 "Expand gamma(z+n) for n an integer when T.")
628 ;;------------------------------------------------------------------------
629 ;; From csimp.lisp
630 (defmvar $demoivre nil
631 "When true, complex exponentials are converted into equivalent
632 expressions in terms of circular functions."
633 :properties ((evflag t)))
634 (defmvar $nointegrate nil)
635 (defmvar $lhospitallim 4
636 "The maximum number of times L'Hospital's rule is used in 'limit'.")
637 (defmvar $tlimswitch t
638 "When true, the 'limit' command will use a Taylor series expansion if
639 the limit of the input expression cannot be computed directly.")
640 (defmvar $limsubst nil
641 "When false, prevents 'limit' from attempting substitutions on unknown
642 forms.")
644 (defvar rsn* nil)
645 (defvar plogabs nil)
647 ;; Simplified shortcuts of constant expressions involving %pi.
648 (defvar %p%i '((mtimes) $%i $%pi)
649 "%pi*%i")
650 (defvar fourth%pi '((mtimes) ((rat simp) 1 4) $%pi)
651 "%pi/4")
652 (defvar half%pi '((mtimes) ((rat simp) 1 2) $%pi)
653 "%pi/2")
654 (defvar %pi2 '((mtimes) 2 $%pi)
655 "2*%pi")
656 (defvar half%pi3 '((mtimes) ((rat simp) 3 2) $%pi)
657 "3/2*%pi")
659 (defmvar $sumsplitfact t
660 "When false, 'minfactorial' is applied after a 'factcomb'.")
662 ;;------------------------------------------------------------------------
663 ;; From defint.lisp
664 (defmvar integerl nil
665 "An integer-list for non-atoms found out to be `integer's")
667 (defmvar nonintegerl nil
668 "A non-integer-list for non-atoms found out to be `noninteger's")
670 ;; Not really sure what this is meant to do, but it's used by MTORAT,
671 ;; KEYHOLE, and POLELIST.
672 (defvar *semirat* nil)
674 ;;------------------------------------------------------------------------
675 ;; From displa.lisp
676 (defmvar $ttyoff nil
677 "When true, output expressions are not displayed.")
679 (defmvar $display2d t
680 "Causes equations to be drawn in two dimensions. Otherwise, drawn
681 linearly."
682 :setting-list (nil t))
684 (defmvar $lispdisp nil
685 "Causes symbols not having $ as the first character in their pnames to
686 be preceded with a ? when displayed.")
688 (defmvar $derivabbrev nil
689 "When true, symbolic derivatives (that is, 'diff' nouns) are displayed
690 as subscripts. Otherwise, derivatives are displayed in the Leibniz
691 notation 'dy/dx'.")
693 (defmvar $stringdisp nil
694 "Causes strings to be bracketed in double quotes when displayed.
695 Normally this is off, but is turned on when a procedure definition
696 is being displayed.")
698 ;; These three variables are bound within Macsyma Listeners since they are different
699 ;; for each window. Set them here, anyway, so that RETRIEVE can be called from
700 ;; top level. The size of TOP-WINDOW is wired in here.
702 (defmvar $linel 79.
703 "The assumed width (in characters) of the console display for the
704 purpose of displaying expressions."
705 :setting-predicate #'(lambda (val)
706 ;; The value must be fixnum within range.
707 ;; The upper limit was arbitrarily chosen.
708 (values (and (fixnump val)
709 (< 0 val 1000001))
710 "must be an integer between 0 and 1000001, exclusive")))
711 (defvar ttyheight 24.)
713 (defmvar $known_index_properties '((mlist) $presubscript $presuperscript $postsubscript $postsuperscript))
715 (defvar *display-labels-p* t)
717 ;;------------------------------------------------------------------------
718 ;; From dskfn.lisp
719 (defmvar $packagefile nil
720 "When true, prevent information from being added to Maxima's
721 information-lists (e.g. 'values', 'functions') except where
722 necessary when the file is loaded in. Useful for package designers
723 who use 'save' or 'translate' to create packages (files).")
725 ;;------------------------------------------------------------------------
726 ;; From float.lisp
727 (defmvar $float2bf t
728 "If TRUE, no MAXIMA-ERROR message is printed when a floating point
729 number is converted to a bigfloat number.")
731 (defmvar $bftorat nil
732 "Controls the conversion of bigfloat numbers to rational numbers. If
733 FALSE, RATEPSILON will be used to control the conversion (this
734 results in relatively small rational numbers). If TRUE, the
735 rational number generated will accurately represent the bigfloat.")
737 (defmvar $bftrunc t
738 "If TRUE, printing of bigfloat numbers will truncate trailing zeroes.
739 Otherwise, all trailing zeroes are printed.")
741 (defmvar $fpprintprec 0
742 "Controls the number of significant digits printed for floats. If
743 0, then full precision is used."
744 :setting-predicate #'(lambda (val)
745 ;; $fpprintprec must be a non-negative fixnum
746 ;; and also cannot be equal to 1.
747 (values (and (fixnump val)
748 (>= val 0)
749 (/= val 1))
750 "must be a non-negative integer and not equal to -1")))
752 (defmvar $maxfpprintprec (ceiling (log (expt 2 (float-digits 1.0)) 10.0))
753 "The maximum number of significant digits printed for floats.")
755 (defmvar $fpprec $maxfpprintprec
756 "Number of decimal digits of precision to use when creating new
757 bigfloats. One extra decimal digit in actual representation for
758 rounding purposes."
759 :properties ((assign 'fpprec1)))
761 (defmvar bigfloatzero '((bigfloat simp 56.) 0 0)
762 "Bigfloat representation of 0"
763 in-core)
765 (defmvar bigfloatone '((bigfloat simp 56.) #.(expt 2 55.) 1)
766 "Bigfloat representation of 1"
767 in-core)
769 (defmvar bfhalf '((bigfloat simp 56.) #.(expt 2 55.) 0)
770 "Bigfloat representation of 1/2")
772 (defmvar bfmhalf '((bigfloat simp 56.) #.(- (expt 2 55.)) 0)
773 "Bigfloat representation of -1/2")
775 (defmvar bigfloat%e '((bigfloat simp 56.) 48968212118944587. 2)
776 "Bigfloat representation of %E")
778 (defmvar bigfloat%pi '((bigfloat simp 56.) 56593902016227522. 2)
779 "Bigfloat representation of %pi")
781 (defmvar bigfloat%gamma '((bigfloat simp 56.) 41592772053807304. 0)
782 "Bigfloat representation of %gamma")
784 (defmvar bigfloat_log2 '((bigfloat simp 56.) 49946518145322874. 0)
785 "Bigfloat representation of log(2)")
787 ;; Number of bits of precision in the mantissa of newly created bigfloats.
788 ;; FPPREC = ($FPPREC+1)*(Log base 2 of 10)
790 (defvar fpprec)
792 ;;------------------------------------------------------------------------
793 ;; From gamma.lisp
794 (defmvar $factorial_expand nil
795 "Controls the simplification of expressions like '(n+1)!', where 'n'
796 is an integer. See 'factorial'.")
797 (defmvar $beta_expand nil
798 "When true, 'beta(a,b)' and related functions are expanded for
799 arguments like a+n or a-n, where n is an integer.")
801 (defmvar $hypergeometric_representation nil
802 "When T a transformation to a hypergeometric representation is done.")
804 ;;------------------------------------------------------------------------
805 ;; From inmis.lisp
806 (defmvar $listconstvars nil
807 "Causes LISTOFVARS to include %E, %PI, %I, and any variables declared
808 constant in the list it returns if they appear in exp. The default
809 is to omit these." boolean see-also $listofvars)
811 ;;------------------------------------------------------------------------
812 ;; From macsys.lisp
813 (defmvar $showtime nil
814 "When T, the computation time is printed with each output expression."
815 :setting-list (nil t $all))
817 (defmvar $_ '$_
818 "last thing read in, corresponds to lisp +")
819 (defmvar $__ '$__
820 "thing read in which will be evaluated, corresponds to -")
822 ;;------------------------------------------------------------------------
823 ;; From mat.lisp
824 (defmvar $globalsolve nil
825 "When true, solved-for variables are assigned the solution values
826 found by 'linsolve', and by 'solve' when solving two or more linear
827 equations.")
828 (defmvar $sparse nil
829 "When true and if 'ratmx' is 'true', then 'determinant' will use
830 special routines for computing sparse determinants.")
831 (defmvar $backsubst t
832 "When false, prevents back substitution in 'linsolve' after the
833 equations have been triangularized.")
835 (defmvar $%rnum 0
836 "The counter for the '%r' variables introduced in solutions by 'solve'
837 and 'algsys'.")
839 (defmvar $linsolve_params t
840 "When true, 'linsolve' also generates the '%r' symbols used to
841 represent arbitrary parameters described in the manual under
842 'algsys'.")
844 (defmvar *rank* nil)
845 (defmvar *inv* nil)
847 ;;------------------------------------------------------------------------
848 ;; From matrix.lisp
849 (defmvar $detout nil
850 "When true, the determinant of a matrix whose inverse is computed is
851 factored out of the inverse.")
852 (defmvar $ratmx nil
853 "When 'ratmx' is 'false', determinant and matrix addition,
854 subtraction, and multiplication are performed in the representation
855 of the matrix elements and cause the result of matrix inversion to
856 be left in general representation.
858 When 'ratmx' is 'true', the 4 operations mentioned above are
859 performed in CRE form and the result of matrix inverse is in CRE
860 form."
861 :properties ((evflag t)))
862 (defmvar $matrix_element_mult "*"
863 "The operation invoked in place of multiplication in a matrix
864 multiplication. 'matrix_element_mult' can be assigned any binary
865 operator.")
866 (defmvar $matrix_element_add "+"
867 "the operation invoked in place of addition in a matrix
868 multiplication. 'matrix_element_add' can be assigned any n-ary
869 operator.")
871 ;;------------------------------------------------------------------------
872 ;; From mdot.lisp
873 (defmvar $dotscrules nil
874 "Causes a non-commutative product of a scalar and another term to be
875 simplified to a commutative product. Scalars and constants are
876 carried to the front of the expression."
877 :properties ((evflag t)))
879 (defmvar $dotdistrib nil
880 "Causes every non-commutative product to be expanded each time it is
881 simplified, i.e. A . (B + C) will simplify to A . B + A . C.")
883 (defmvar $dotexptsimp t "Causes A . A to be simplified to A ^^ 2.")
885 (defmvar $dotassoc t
886 "Causes a non-commutative product to be considered associative, so
887 that A . (B . C) is simplified to A . B . C. If this flag is off,
888 dot is taken to be right associative, i.e. A . B . C is simplified
889 to A . (B . C)."
890 :properties ((assign #'(lambda (name val)
891 (declare (ignore name))
892 (cput 'mnctimes val 'associative)))))
894 (defmvar $doallmxops t
895 "Causes all operations relating to matrices (and lists) to be carried
896 out. For example, the product of two matrices will actually be
897 computed rather than simply being returned. Turning on this switch
898 effectively turns on the following three.")
900 (defmvar $domxmxops t "Causes matrix-matrix operations to be carried out.")
902 (defmvar $doscmxops nil "Causes scalar-matrix operations to be carried out.")
904 (defmvar $scalarmatrixp t
905 "Causes a square matrix of dimension one to be converted to a scalar,
906 i.e. its only element."
907 :setting-list (nil t $all))
909 (defmvar $assumescalar t
910 "This governs whether unknown expressions 'exp' are assumed to
911 behave like scalars for combinations of the form 'exp op matrix'
912 where op is one of {+, *, ^, .}. It has three settings:
914 FALSE -- such expressions behave like non-scalars.
915 TRUE -- such expressions behave like scalars only for the commutative
916 operators but not for non-commutative multiplication.
917 ALL -- such expressions will behave like scalars for all operators
918 listed above.
920 Note: This switch is primarily for the benefit of old code. If
921 possible, you should declare your variables to be SCALAR or
922 NONSCALAR so that there is no need to rely on the setting of this
923 switch."
924 :setting-list (nil t $all))
926 ;;------------------------------------------------------------------------
927 ;; From merror.lisp
928 (defmvar $error `((mlist simp) "No error.")
929 "During an MAXIMA-ERROR break this is bound to a list of the
930 arguments to the call to MAXIMA-ERROR, with the message text in a
931 compact format."
932 :properties ((assign 'neverset)))
934 (defmvar $errormsg 't
935 "If `false' then no maxima-error message is printed!")
937 ;;------------------------------------------------------------------------
938 ;; From mlisp.lisp
939 (defvar featurel
940 '($integer $noninteger $even $odd $rational $irrational $real $imaginary $complex
941 $analytic $increasing $decreasing $oddfun $evenfun $posfun $constant
942 $commutative $lassociative $rassociative $symmetric $antisymmetric
943 $integervalued))
945 (defmvar $features (cons '(mlist simp) (append featurel nil))
946 "A list of mathematical features which are mathematical preoperties of
947 functions and variables.")
948 (defmvar $%enumer nil
949 "When true, '%e' is replaced by its numeric value 2.718... whenever
950 'numer' is 'true'."
951 :properties ((evflag t)))
952 (defmvar $float nil
953 "Causes non-integral rational numbers and bigfloat numbers to be
954 converted to floating point."
955 :properties ((evflag t)))
956 (defmvar $translate nil
957 "Causes automatic translation of a user's function to Lisp.")
958 (defmvar $transrun t
959 "When false, the interpreted version of all functions to be
960 run (provided they are still around) rather than the translated
961 version.")
962 (defmvar $savedef t
963 "When true, the Maxima version of a user function is preserved when
964 the function is translated. This permits the definition to be
965 displayed by 'dispfun' and allows the function to be edited."
966 :setting-list (nil t $all))
967 (defmvar $infeval nil
968 "When true, Enables \"infinite evaluation\" mode. 'ev' repeatedly
969 evaluates an expression until it stops changing."
970 :properties ((evflag t)))
971 (defmvar $piece '$piece
972 "Holds the last expression selected when using the 'part' functions.")
974 ;; These three variables are what get stuck in array slots as magic
975 ;; unbound objects. They are for T, FIXNUM, and FLONUM type arrays
976 ;; respectively.
978 (defvar munbound '|#####|)
979 (defvar fixunbound most-negative-fixnum)
980 (defvar flounbound +most-negative-flonum+)
982 (defmvar munbindp nil
983 "Used for safely `munbind'ing incorrectly-bound variables."
984 no-reset)
986 (defmvar $setcheck nil
987 "If 'setcheck' is set to a list of variables (which can be
988 subscripted), Maxima prints a message whenever the variables, or
989 subscripted occurrences of them, are bound with the ordinary
990 assignment operator ':', the '::' assignment operator, or function
991 argument binding, but not the function assignment ':=' nor the macro
992 assignment '::=' operators. The message comprises the name of the
993 variable and the value it is bound to.
995 'setcheck' may be set to 'all' or 'true' thereby including all
996 variables."
997 :setting-predicate #'(lambda (val)
998 (values (or ($listp val)
999 (member val '($all t nil)))
1000 "must be a list or one of all, true, or false")))
1003 ;;Function Call stack each element is
1004 ;; (fname . bindlist) where bindlist was the value at time of entry.
1005 ;; So you can use this to compute what the bindings were at any
1006 ;; function call.
1007 (defvar *mlambda-call-stack* (make-array 30 :fill-pointer 0 :adjustable t ))
1009 ;; If this is T then arrays are stored in the value cell,
1010 ;; whereas if it is false they are stored in the function cell
1011 (defmvar $use_fast_arrays nil
1012 "When true, arrays declared by 'array' are values instead of
1013 properties, and undeclared arrays ('hashed arrays') are implemented
1014 as Lisp hashed arrays.")
1016 (defvar bindlist nil)
1017 (defvar loclist nil)
1018 (defvar *nounl* nil)
1019 (defvar scanmapp nil)
1020 (defvar maplp nil)
1021 (defvar evp nil)
1022 (defvar mlocp nil)
1023 (defvar fmaplvl 0)
1024 (defvar aryp nil)
1025 (defvar msump nil)
1026 (defvar evarrp nil)
1027 (defvar factlist nil)
1028 (defvar *nounsflag* nil)
1029 (defvar transp nil)
1030 (defvar noevalargs nil)
1032 (defmvar $structures '((mlist))
1034 no-reset
1035 :properties ((assign 'neverset)))
1037 (defvar mspeclist nil)
1038 (defvar mfexprp t)
1039 ;;------------------------------------------------------------------------
1040 ;; From mload.lisp
1041 (defmvar $load_pathname nil
1042 "The full pathname of the file being loaded")
1044 (defvar *maxima-testsdir*)
1046 ;;------------------------------------------------------------------------
1047 ;; From nforma.lisp
1048 (defmvar $powerdisp nil
1049 "When true, a sum is displayed with its terms in order of increasing
1050 power.")
1051 (defmvar $pfeformat nil
1052 "When true, a ratio of integers is displayed with the solidus (forward
1053 slash) character, and an integer denominator 'n' is displayed as a
1054 leading multiplicative term '1/n'.")
1055 (defmvar $%edispflag nil
1056 "When true, Maxima displays '%e' to a negative exponent as a
1057 quotient.")
1058 (defmvar $sqrtdispflag t
1059 "When false, causes 'sqrt' to display with exponent 1/2.")
1061 ;;------------------------------------------------------------------------
1062 ;; From rat3b.lisp
1063 (defmvar $ratwtlvl nil
1064 "'ratwtlvl' is used in combination with the 'ratweight' function to
1065 control the truncation of canonical rational expressions (CRE). For
1066 the default value of 'false', no truncation occurs."
1067 :properties ((assign #'(lambda (name val)
1068 ;; Forward declaration
1069 (declare (special $ratfac))
1070 (when (and val (not (fixnump val)))
1071 (mseterr name val "must be an integer"))
1072 (when (and val $ratfac)
1073 (merror (intl:gettext "assignment: 'ratfac' and 'ratwtlvl' may not both be used at the same time.")))))))
1075 (defmvar $ratalgdenom t ;If T then denominator is rationalized.
1076 "When true, allows rationalization of denominators with respect to
1077 radicals to take effect."
1078 :properties ((evflag t)))
1080 ;;------------------------------------------------------------------------
1081 ;; From rat3c.lisp
1082 ;; List of GCD algorithms. Default one is first.
1083 (defmvar *gcdl* '($spmod $subres $ez $red $mod $algebraic))
1085 (defmvar $gcd (car *gcdl*) ;Sparse Modular
1086 "The default GCD algorithm. If false, the GCD is prevented from being
1087 taken when expressions are converted to canonical rational
1088 expression (CRE) form."
1089 :setting-predicate #'(lambda (val)
1090 (or (null val)
1091 (member val *gcdl*))))
1094 ;; It is convenient to have the *bigprimes* be actually less than half
1095 ;; the size of the most positive fixnum, so that arithmetic is easier.
1097 ;; *bigprimes* and *alpha are initialized in
1098 ;; initialize-runtime-globals instead of here because *bigprimes*
1099 ;; needs the NEXT-PRIME function to generate the list of primes, and
1100 ;; NEXT-PRIME isn't available yet. Likewise, *alpha is initialized to
1101 ;; the first element of *bigprimes*.
1102 (defvar *bigprimes*)
1103 (defmvar *alpha)
1105 ;;------------------------------------------------------------------------
1106 ;; From rat3d.lisp
1107 (defmvar algfac* nil)
1108 (defmvar low* nil)
1109 (defmvar $intfaclim t
1110 "If 'true', maxima will give up factorization of integers if no factor
1111 is found after trial divisions and Pollard's rho method and
1112 factorization will not be complete.
1114 When 'intfaclim' is 'false' (this is the case when the user calls
1115 'factor' explicitly), complete factorization will be attempted.")
1116 (defmvar $factor_max_degree 1000
1117 "If set to an integer n, some potentially large (many factors)
1118 polynomials of degree > n won't be factored, preventing huge memory
1119 allocations and stack overflows. Set to zero to deactivate."
1120 :properties ((assign 'non-negative-integer-set)))
1122 (defmvar $savefactors nil "If t factors of ratreped forms will be saved")
1124 (defvar *checkfactors* () "List of saved factors")
1126 ;;------------------------------------------------------------------------
1127 ;; From rat3e.lisp
1129 ;; User level global variables.
1130 (defmvar $keepfloat nil
1131 "If `t' floating point coeffs are not converted to rationals"
1132 :properties ((evflag t)))
1133 (defmvar $factorflag nil
1134 "If `t' constant factor of polynomial is also factored"
1135 :properties ((evflag t)))
1136 (defmvar $dontfactor '((mlist))
1137 "A list of variables with respect to which factoring is not to occur.")
1138 (defmvar $norepeat t)
1139 (defmvar $ratweights '((mlist simp))
1140 "The list of weights assigned by 'ratweight'."
1141 :properties ((assign
1142 #'(lambda (name val)
1143 (cond ((not ($listp val))
1144 (mseterr name val "must be a list"))
1145 ((null (cdr val))
1146 (kill1 '$ratweights))
1148 (apply #'$ratweight (cdr val))))))))
1150 (defmvar $algebraic nil
1151 "Set to 'true' in order for the simplification of algebraic integers
1152 to take effect."
1153 :properties ((evflag t)))
1155 (defmvar $ratfac nil
1156 "If `t' cre-forms are kept factored"
1157 :properties ((evflag t)
1158 (assign #'(lambda (name val)
1159 (declare (ignore name))
1160 (when (and val $ratwtlvl)
1161 (merror (intl:gettext "assignment: 'ratfac' and 'ratwtlvl' may not both be used at the same time.")))))))
1163 (defmvar $ratvars '((mlist simp))
1164 "A list of the arguments of the function 'ratvars' when it was called
1165 most recently. Each call to the function 'ratvars' resets the
1166 list."
1167 :properties ((assign #'(lambda (name val)
1168 (if ($listp val)
1169 (apply #'$ratvars (cdr val))
1170 (mseterr name val "must be a list"))))))
1172 (defmvar $facexpand t
1173 "Controls whether the irreducible factors returned by 'factor' are in
1174 expanded (the default) or recursive (normal CRE) form.")
1176 (defmvar genvar nil
1177 "List of gensyms used to point to kernels from within polynomials.
1178 The values cell and property lists of these symbols are used to
1179 store various information.")
1181 (defmvar genpairs nil)
1183 (defmvar *fnewvarsw nil)
1184 (defmvar *ratweights nil)
1186 (defmvar tellratlist nil)
1188 (defmvar adn* 1
1189 "common denom for algebraic coefficients")
1191 ;; Any program which calls RATF on
1192 ;; a floating point number but does not wish to see "RAT replaced ..."
1193 ;; message, must bind $RATPRINT to NIL.
1195 (defmvar $ratprint t
1196 "When true, a message informing the user of the conversion of floating
1197 point numbers to rational numbers is displayed.")
1199 (defmvar $ratepsilon 2d-15
1200 "The tolerance used in the conversion of floating point numbers to
1201 rational numbers, when the option variable 'bftorat' has the value
1202 'false'.")
1204 ;; IF $RATEXPAND IS TRUE, (X+1)*(Y+1) WILL DISPLAY AS
1205 ;; XY + Y + X + 1 OTHERWISE, AS (X+1)Y + X + 1
1206 (defmvar $ratexpand nil
1207 "Controls some simplifications of radicals. See user manual for
1208 complicated rules.")
1210 (defmvar varlist nil
1211 "List of kernels")
1213 ;;------------------------------------------------------------------------
1214 ;; From result.lisp
1215 (defmvar $resultant '$subres
1216 "Designates which resultant algorithm")
1218 ;;------------------------------------------------------------------------
1219 ;; From risch.lisp
1220 (defmvar $liflag t
1221 "Controls whether `risch' generates polylogs")
1223 ;;------------------------------------------------------------------------
1224 ;; From simp.lisp
1225 ;; General purpose simplification and conversion switches.
1227 (defmvar $negdistrib t
1228 "Causes negations to be distributed over sums, e.g. -(A+B) is
1229 simplified to -A-B.")
1231 (defmvar $numer nil
1232 "Causes SOME mathematical functions (including exponentiation) with
1233 numerical arguments to be evaluated in floating point. It causes
1234 variables in an expression which have been given NUMERVALs to be
1235 replaced by their values. It also turns on the FLOAT switch."
1236 see-also ($numerval $float)
1237 :properties ((assign 'numerset)))
1239 (defmvar $simp t
1240 "Enables simplification."
1241 :properties ((evflag t)))
1243 (defmvar $sumexpand nil
1244 "If TRUE, products of sums and exponentiated sums go into nested
1245 sums."
1246 :properties ((evflag t)))
1248 (defmvar $numer_pbranch nil
1249 "When true and the exponent is a floating point number or the option
1250 variable 'numer' is 'true' too, Maxima evaluates the numerical
1251 result using the principal branch. Otherwise a simplified, but not
1252 an evaluated result is returned."
1253 :properties ((evflag t)))
1255 ;; Switches dealing with expansion.
1256 (defmvar $expop 0
1257 "The largest positive exponent which will be automatically
1258 expanded. (X+1)^3 will be automatically expanded if EXPOP is
1259 greater than or equal to 3."
1260 see-also ($expon $maxposex $expand)
1261 :properties ((assign 'non-negative-integer-set)))
1263 (defmvar $expon 0
1264 "The largest negative exponent which will be automatically
1265 expanded. (X+1)^(-3) will be automatically expanded if EXPON is
1266 greater than or equal to 3."
1267 see-also ($expop $maxnegex $expand)
1268 :properties ((assign 'non-negative-integer-set)))
1270 (defmvar $maxposex 1000.
1271 "The largest positive exponent which will be expanded by the EXPAND
1272 command."
1273 see-also ($maxnegex $expop $expand)
1274 ;; Check assignment to be a positive integer
1275 :properties ((assign 'non-negative-integer-set)))
1277 (defmvar $maxnegex 1000.
1278 "The largest negative exponent which will be expanded by the EXPAND
1279 command."
1280 see-also ($maxposex $expon $expand)
1281 ;; Check assignment to be a positive integer
1282 :properties ((assign 'non-negative-integer-set)))
1284 ;; Lisp level variables
1285 (defmvar dosimp nil
1286 "Causes SIMP flags to be ignored. $EXPAND works by binding $EXPOP to
1287 $MAXPOSEX, $EXPON to $MAXNEGEX, and DOSIMP to T.")
1290 (defmvar errorsw nil
1291 "Causes a throw to the tag ERRORSW when certain errors occur rather
1292 than the printing of a message. Kludgy MAXIMA-SUBSTITUTE for
1293 MAXIMA-ERROR signalling.")
1295 (defmvar $rootsepsilon 1d-7
1296 "The tolerance which establishes the confidence interval for the
1297 roots found by the 'realroots' function.")
1298 (defmvar $algepsilon 100000000)
1299 (defmvar $true t)
1300 (defmvar $false nil)
1301 (defmvar $logabs nil
1302 "When true, indefinite integration where logs are generated,
1303 e.g. 'integrate(1/x,x) produces answers in terms of log(...) instead
1304 of log(abs(...))."
1305 :properties ((evflag t)))
1306 (defmvar $listarith t
1307 "If 'false' causes any arithmetic operations with lists to be
1308 suppressed; when 'true', list-matrix operations are contagious
1309 causing lists to be converted to matrices yielding a result which is
1310 always a matrix."
1311 :properties ((evflag t)))
1312 (defmvar $domain '$real)
1313 (defmvar $m1pbranch nil
1314 "When true, the principal branch for -1 to a power is returned,
1315 depending on whether 'domain' is real or complex."
1316 :properties ((evflag t)))
1317 (defmvar $%e_to_numlog nil
1318 "When 'true', 'r' some rational number, and 'x' some
1319 expression,'%e^(r*log(x))' will be simplified into 'x^r'.")
1320 (defmvar $%emode t
1321 "When '%emode' is 'true', '%e^(%pi %i x)' is simplified. See the user
1322 manual for more details."
1323 :properties ((evflag t)))
1324 (defmvar $ratsimpexpons nil
1325 "When true, 'ratsimp' is applied to the exponents of expressions
1326 during simplification."
1327 :properties ((evflag t)))
1328 (defmvar $logexpand t ; Possible values are T, $ALL and $SUPER
1329 "Controls how logs are expanded. See the user manual."
1330 :properties ((evflag t))
1331 :setting-list (nil t $all $super))
1332 (defmvar $radexpand t
1333 "Controls some simplification of radicals. See the user manual."
1334 :properties ((evflag t))
1335 :setting-predicate #'(lambda (val)
1336 ;; $radexpand can only be set to $all, $true,
1337 ;; or $false.
1338 (values (member val '($all t nil))
1339 "must be one of all, true, or false")))
1340 (defmvar $subnumsimp nil
1341 "When true, the functions 'subst' and 'psubst' can substitute a
1342 subscripted variable 'f[x]' with a number, when only the symbol 'f'
1343 is given.")
1344 (defmvar $logsimp t
1345 "If 'false' then no simplification of '%e' to a power containing
1346 'log''s is done.")
1348 (defvar rischp nil)
1349 (defvar rp-polylogp nil)
1350 (defvar wflag nil)
1351 (defvar derivflag nil)
1352 (defvar *zexptsimp? nil)
1354 ;; This is initialized in initialize-runtime-globals
1355 (defvar %e-val)
1356 ;;------------------------------------------------------------------------
1357 ;; From solve.lisp
1358 (defmvar $breakup t
1359 "Causes solutions to cubic and quartic equations to be expressed in
1360 terms of common subexpressions.")
1362 (defmvar $multiplicities '$not_set_yet
1363 "Set to a list of the multiplicities of the individual solutions
1364 returned by SOLVE, REALROOTS, or ALLROOTS.")
1366 (defmvar $programmode t
1367 "Causes SOLVE to return its answers explicitly as elements in a list
1368 rather than printing E-labels."
1369 :properties ((evflag t)))
1371 (defmvar $solvefactors t
1372 "If T, then SOLVE will try to factor the expression. The FALSE
1373 setting may be desired in zl-SOME cases where factoring is not
1374 necessary.")
1376 (defmvar $solvetrigwarn t
1377 "Causes SOLVE to print a warning message when it is uses inverse
1378 trigonometric functions to solve an equation, thereby losing
1379 solutions.")
1381 (defmvar $solveradcan nil
1382 "SOLVE will use RADCAN which will make SOLVE slower but will allow
1383 certain problems containing exponentials and logs to be solved.")
1386 ;;------------------------------------------------------------------------
1387 ;; From sumcon.lisp
1388 (defmvar $niceindicespref '((mlist simp) $i $j $k $l $m $n)
1389 "The list from which 'niceindices' takes the names of indices for sums
1390 and properties."
1391 :properties ((assign #'(lambda (name val)
1392 ;; The value must be a nonempty list
1393 ;; consisting of symbols. While
1394 ;; niceindices can handle subscripted
1395 ;; variables, sum and product cannot, so
1396 ;; for now we'll restrict the possible
1397 ;; values to be simple symbols.
1398 (unless (and ($listp val)
1399 (not ($emptyp val))
1400 (every '$symbolp (cdr val)))
1401 (merror
1402 (intl:gettext "~M: value must be a nonempty list of symbols; found: ~:M")
1403 name val)))
1406 ;;------------------------------------------------------------------------
1407 ;; From suprv1.lisp
1408 (defmvar $loadprint nil
1409 "Controls whether to print a message when a file is loaded."
1410 :setting-list (nil t $loadfile $autoload))
1411 (defmvar $nolabels nil
1412 "When 'true', input and output result labels ('%i' and '%o',
1413 respectively) are displayed, but the labels are not bound to
1414 results, and the labels are not appended to the 'labels' list.
1415 Since labels are not bound to results, garbage collection can
1416 recover the memory taken up by the results.")
1418 ;; For each of the variables below ($aliases to $dependencies), create
1419 ;; a new list as the initial value instead of '((mlist simp)). Ecl
1420 ;; can and will coalesce these to be the same list, and this causes
1421 ;; problems if one of the variables is destructively modified in
1422 ;; place.
1423 (defmvar $aliases (list '(mlist simp))
1424 "The list of atoms which have a user defined alias (set up by the
1425 'alias', 'ordergreat', 'orderless' functions or by declaring the
1426 atom a 'noun' with 'declare'."
1427 no-reset
1428 :properties ((assign 'neverset)))
1430 ;; Define $infolist variables here and set up the initial value and
1431 ;; properties.
1432 (defmvar $labels (list '(mlist simp))
1433 "The list of input, output, and intermediate expression labels,
1434 including all previous labels if 'inchar', 'outchar', or 'linechar'
1435 were redefined."
1436 :properties ((assign 'neverset)))
1438 (defmvar $values (list '(mlist simp))
1439 "The list of all bound user variables (not Maxima options or
1440 switches). The list comprises symbols bound by ':', or '::'."
1441 no-reset
1442 :properties ((assign 'neverset)))
1444 (defmvar $functions (list '(mlist simp))
1445 "The list of ordinary Maxima functions in the current session. An
1446 ordinary function is a function constructed by 'define' or ':=' and
1447 called with parentheses '()'."
1448 no-reset
1449 :properties ((assign 'neverset)))
1451 (defmvar $macros (list '(mlist simp))
1452 "The list of user-defined macro functions. The macro function
1453 definition operator '::=' puts a new macro function onto this list."
1454 no-reset
1455 :properties ((assign 'neverset)))
1457 (defmvar $arrays (list '(mlist simp))
1458 "The list of arrays that have been allocated. These comprise arrays
1459 declared by 'array', 'hashed arrays' that can be constructed by
1460 implicit definition (assigning something to an element that isn't
1461 yet declared as a list or an array), and 'memoizing functions'
1462 defined by ':=' and 'define'. Arrays defined by 'make_array' are
1463 not included."
1464 no-reset
1465 :properties ((assign 'neverset)))
1468 (defmvar $myoptions (list '(mlist simp))
1469 "The list of all options ever reset by the user, whether or not they
1470 get reset to their default value."
1471 no-reset
1472 :properties ((assign 'neverset)))
1474 (defmvar $props (list '(mlist simp))
1475 "The list of atoms which have any property other than those explicitly
1476 mentioned in 'infolists', such as specified by 'atvalue',
1477 'matchdeclare', etc., as well as properties specified in the
1478 'declare' function."
1479 no-reset
1480 :properties ((assign 'neverset)))
1482 (defmvar $rules (list '(mlist simp))
1484 no-reset
1485 :properties ((assign 'neverset)))
1487 (defmvar $gradefs (list '(mlist simp))
1488 "The list of the functions for which partial derivatives have been
1489 defined by 'gradef'."
1490 no-reset
1491 :properties ((assign 'neverset)))
1493 (defmvar $dependencies (list '(mlist simp))
1494 "The list of atoms which have functional dependencies, assigned by
1495 'depends', the function 'dependencies', or 'gradef'. The
1496 'dependencies' list is cumulative: each call to 'depends',
1497 'dependencies', or 'gradef' appends additional items."
1498 no-reset
1499 :properties ((assign 'neverset)))
1501 (defmvar $let_rule_packages '((mlist) $default_let_rule_package)
1502 "The names of the various let rule simplification packages"
1503 :properties ((assign 'let-rule-setter)))
1505 (defmvar $infolists
1506 '((mlist simp) $labels $values $functions $macros $arrays
1507 $myoptions $props $aliases $rules $gradefs
1508 $dependencies $let_rule_packages $structures)
1509 "The list of the names of all of the information lists in Maxima."
1510 :properties ((assign 'neverset)))
1512 (defmvar $dispflag t
1513 "If set to 'false' within a 'block' will inhibit the display of output
1514 generated by the solve functions called from within the 'block'.")
1516 (defmvar $% '$%
1517 "The last out-line computed, corresponds to lisp *"
1518 no-reset)
1520 (defmvar $%% '$%%
1521 "In compound statements, namely 'block', 'lambda', or '(<s_1>,
1522 ...,<s_n>)', '%%' is the value of the previous statement."
1523 no-reset)
1525 (defmvar $inchar '$%i
1526 "The alphabetic prefix of the names of expressions typed by the user.")
1528 (defmvar $outchar '$%o
1529 "The alphabetic prefix of the names of expressions returned by the
1530 system.")
1532 (defmvar $linechar '$%t
1533 "The alphabetic prefix of the names of intermediate displayed
1534 expressions.")
1536 (defmvar $linenum 1
1537 "The line number of the last expression."
1538 fixnum
1539 no-reset)
1541 (defmvar $file_output_append nil
1542 "Flag to tell file-writing functions whether to append or clobber the
1543 output file.")
1545 (defvar *refchkl* nil)
1546 (defvar *mdebug* nil)
1547 (defvar errcatch nil)
1548 (defvar lessorder nil)
1549 (defvar greatorder nil)
1550 (defvar *in-translate-file* nil)
1551 (defvar *linelabel* nil)
1553 (defvar *builtin-numeric-constants*
1554 '($%e $%pi $%phi $%gamma $%catalan)
1555 "Special numeric constants that Maxima knows how to evaluate
1556 numerically.")
1558 ;;------------------------------------------------------------------------
1559 ;; From trigi.lisp
1560 (defmvar $%piargs t
1561 "When true, trigonometric functions are simplified to algebraic
1562 constants when the argument is an integer multiple of %pi, %pi/2,
1563 %pi/3, %pi/4, or %pi/6.")
1564 (defmvar $%iargs t
1565 "When true, trigonometric functions are simplified to hyperbolic
1566 functions when the argument is apparently a multiple of the
1567 imaginary unit %i.")
1568 (defmvar $triginverses t
1569 "Controls the simplification of the composition of trigonometric and
1570 hyperbolic functions with their inverse functions."
1571 :setting-list (nil t $all))
1572 (defmvar $trigexpand nil
1573 "If 'true' causes expansion of all expressions containing sin's and
1574 cos's occurring subsequently."
1575 :properties ((evflag t)))
1576 (defmvar $trigexpandplus t
1577 "Controls the \"sum\" rule for 'trigexpand', expansion of sums (e.g.
1578 'sin(x + y)') will take place only if 'trigexpandplus' is 'true'.")
1579 (defmvar $trigexpandtimes t
1580 "Controls the \"product\" rule for 'trigexpand', expansion of
1581 products (e.g. 'sin(2 x)') will take place only if
1582 'trigexpandtimes' is 'true'.")
1583 (defmvar $trigsign t
1584 "When true, permits simplification of negative arguments to
1585 trigonometric functions.")
1586 (defmvar $exponentialize nil
1587 "When true, all circular and hyperbolic functions are converted to
1588 exponential form."
1589 :properties ((evflag t)))
1590 (defmvar $logarc nil
1591 "When true, inverse circular and hyperbolic functions are replaced by
1592 equivalent logarithmic functions."
1593 :properties ((evflag t)))
1594 (defmvar $halfangles nil
1595 "When true, trigonometric functions of arguments '<expr>/2' are
1596 simplified to functions of <expr>."
1597 :properties ((evflag t)))
1599 ;; Simplified shortcuts for constant expressions.
1600 (defvar %pi//4 '((mtimes simp) ((rat simp) 1 4.) $%pi))
1601 (defvar %pi//2 '((mtimes simp) ((rat simp) 1 2) $%pi))
1602 (defvar sqrt3//2 '((mtimes simp)
1603 ((rat simp) 1 2)
1604 ((mexpt simp) 3 ((rat simp) 1 2))))
1605 (defvar -sqrt3//2 '((mtimes simp)
1606 ((rat simp) -1 2)
1607 ((mexpt simp) 3 ((rat simp) 1 2))))
1609 ;; Build hash tables '*flonum-op*' and '*big-float-op*' that map Maxima
1610 ;; function names to their corresponding Lisp functions.
1612 (defvar *flonum-op* (make-hash-table :size 64)
1613 "Hash table mapping a maxima function to a corresponding Lisp function
1614 to evaluate the maxima function numerically with flonum precision.")
1616 (defvar *big-float-op* (make-hash-table)
1617 "Hash table mapping a maxima function to a corresponding Lisp function
1618 to evaluate the maxima function numerically with big-float
1619 precision.")
1621 ;;------------------------------------------------------------------------
1622 ;; From init-cl.lisp
1623 (defvar $file_search_lisp nil
1624 "Directories to search for Lisp source code.")
1626 (defvar $file_search_maxima nil
1627 "Directories to search for Maxima source code.")
1629 (defvar $file_search_demo nil
1630 "Directories to search for demos.")
1632 (defvar $file_search_usage nil)
1634 (defvar $file_search_tests nil
1635 "Directories to search for maxima test suite")
1637 (defvar *maxima-prefix*)
1638 (defvar *maxima-infodir*)
1639 (defvar *maxima-htmldir*)
1640 (defvar *maxima-userdir*)
1641 (defvar *maxima-initmac* "maxima-init.mac"
1642 "Default maxima mac init file if none specified by the user. This
1643 file is looked for only in the maxima userdir.")
1644 (defvar *maxima-initlisp* "maxima-init.lisp"
1645 "Default maxima lisp init file if none specified by the user. This
1646 file is looked for only in the maxima userdir")
1647 (defvar *maxima-load-init-files* t
1648 "When non-NIL, the init files are not loaded.")
1649 (defvar *maxima-tempdir*)
1650 (defvar *maxima-lang-subdir* nil)
1651 (defvar $maxima_frontend nil
1652 "The frontend maxima is used with.")
1653 (defvar $maxima_frontend_version nil
1654 "The version of the maxima frontend.")
1655 (defvar $maxima_frontend_bugreportinfo nil
1656 "The bug report info the maxima frontend comes with.")
1658 ;; A list of temporary files that can be deleted on leaving maxima
1659 (defvar *temp-files-list* (make-hash-table :test 'equal))
1661 ;;------------------------------------------------------------------------
1662 ;; From macdes.lisp
1663 (defmvar $browser "firefox '~a'"
1664 "Browser to use for displaying the documentation. This may be
1665 initialized on startup to an OS-specific value. It must contain
1666 exactly one ~a which will be replaced by the url.")
1668 (defmvar $url_base "localhost:8080"
1669 "Base URL where the HTML doc may be found. This can be a file path
1670 like \"file:///<path>\" or a web server like \"localhost:8080\" or
1671 some other web server.
1673 This may be initialized on startup to a file path where the html
1674 files can be found.")
1676 (defmvar $output_format_for_help '$text
1677 "The output format for help. It should be one of the values '$text,
1678 '$html, '$frontend. The default is '$text which causes the help to
1679 be sent to the terminal as plain text. '$html opens a browser to
1680 the page for the help. '$frontend assumes that some frontend will
1681 provide the necessary function to display help appropriately for the
1682 frontend."
1683 :properties ((assign 'set-output-format-for-help)))
1685 (defvar *help-display-function*
1686 'display-text-topics
1687 "A symbol naming the function used to display help, as determined
1688 from $output_format_for_help.")
1690 ;;------------------------------------------------------------------------
1691 (defmvar $maxima_userdir nil
1692 "Names a directory which Maxima searches to find Maxima and Lisp
1693 files."
1694 ;; $maxima_userdir is aliased to *maxima-userdir* so that when one
1695 ;; changes, the other does too.
1696 :properties ((assign 'shadow-string-assignment)
1697 (lisp-shadow '*maxima-userdir*)))
1699 (defmvar $maxima_tempdir nil
1700 "Names the directory in which Maxima creates some temporary files."
1701 :properties ((assign 'shadow-string-assignment)
1702 (lisp-shadow '*maxima-tempdir*)))
1704 (defmvar $maxima_objdir nil
1705 "Names the directory where fasl files are written to."
1706 :properties ((assign 'shadow-string-assignment)
1707 (lisp-shadow '*maxima-objdir*)))
1708 ;;------------------------------------------------------------------------
1709 ;; From nisimp
1710 (defmvar $default_let_rule_package '$default_let_rule_package
1711 "The name of the default rule package used by `let' and `letsimp'"
1712 :properties ((assign 'let-rule-setter)))
1714 (defmvar $current_let_rule_package '$default_let_rule_package
1715 "The name of the current rule package used by `let' and `letsimp'"
1716 :properties ((assign 'let-rule-setter)))
1718 ;;------------------------------------------------------------------------
1719 ;; From factor.lisp
1720 (defmvar $nalgfac t
1721 "If t use bmt's algebraic factoring algorithm")
1723 (defmvar gauss nil)
1724 (defmvar *min* nil)
1725 (defmvar *mx* nil)
1726 (defmvar minpoly* nil)
1727 (defmvar mplc* nil)
1728 (defmvar mm* 1)
1730 ;;------------------------------------------------------------------------
1731 ;; From nparse.lisp
1732 (defvar *alphabet* (list #\_ #\%))
1734 ;;------------------------------------------------------------------------
1735 ;; From ellipt.lisp
1736 (defvar 3//2 '((rat simp) 3 2))
1737 (defvar 1//2 '((rat simp) 1 2))
1738 (defvar -1//2 '((rat simp) -1 2))
1740 ;;------------------------------------------------------------------------
1741 ;; From rpart.lisp
1743 ;; generate-atan2 is set to nil when doing integration to avoid
1744 ;; generating discontinuities that defint can't handle.
1745 (defmvar generate-atan2 t
1746 "Controls whether RPART will generate ATAN's or ATAN2's, default is to
1747 make ATAN2's")
1749 (defmvar implicit-real nil
1750 "If t RPART assumes radicals and logs of real quantities are real and
1751 doesn't ask sign questions")
1753 ;;------------------------------------------------------------------------
1754 ;; From ifactor.lisp
1755 (defmvar *alpha* nil)
1756 (defvar *small-primes*
1757 '(2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97
1758 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181
1759 191 193 197 199 211 223 227 229 233 239 241 251 257 263 269 271 277
1760 281 283 293 307 311 313 317 331 337 347 349 353 359 367 373 379 383
1761 389 397 401 409 419 421 431 433 439 443 449 457 461 463 467 479 487
1762 491 499 503 509 521 523 541 547 557 563 569 571 577 587 593 599 601
1763 607 613 617 619 631 641 643 647 653 659 661 673 677 683 691 701 709
1764 719 727 733 739 743 751 757 761 769 773 787 797 809 811 821 823 827
1765 829 839 853 857 859 863 877 881 883 887 907 911 919 929 937 941 947
1766 953 967 971 977 983 991 997 1009 1013 1019 1021 1031 1033 1039 1049
1767 1051 1061 1063 1069 1087 1091 1093 1097 1103 1109 1117 1123 1129 1151
1768 1153 1163 1171 1181 1187 1193 1201 1213 1217 1223 1229 1231 1237 1249
1769 1259 1277 1279 1283 1289 1291 1297 1301 1303 1307 1319 1321 1327 1361
1770 1367 1373 1381 1399 1409 1423 1427 1429 1433 1439 1447 1451 1453 1459
1771 1471 1481 1483 1487 1489 1493 1499 1511 1523 1531 1543 1549 1553 1559
1772 1567 1571 1579 1583 1597 1601 1607 1609 1613 1619 1621 1627 1637 1657
1773 1663 1667 1669 1693 1697 1699 1709 1721 1723 1733 1741 1747 1753 1759
1774 1777 1783 1787 1789 1801 1811 1823 1831 1847 1861 1867 1871 1873 1877
1775 1879 1889 1901 1907 1913 1931 1933 1949 1951 1973 1979 1987 1993 1997
1776 1999 2003 2011 2017 2027 2029 2039 2053 2063 2069 2081 2083 2087 2089
1777 2099 2111 2113 2129 2131 2137 2141 2143 2153 2161 2179 2203 2207 2213
1778 2221 2237 2239 2243 2251 2267 2269 2273 2281 2287 2293 2297 2309 2311
1779 2333 2339 2341 2347 2351 2357 2371 2377 2381 2383 2389 2393 2399 2411
1780 2417 2423 2437 2441 2447 2459 2467 2473 2477 2503 2521 2531 2539 2543
1781 2549 2551 2557 2579 2591 2593 2609 2617 2621 2633 2647 2657 2659 2663
1782 2671 2677 2683 2687 2689 2693 2699 2707 2711 2713 2719 2729 2731 2741
1783 2749 2753 2767 2777 2789 2791 2797 2801 2803 2819 2833 2837 2843 2851
1784 2857 2861 2879 2887 2897 2903 2909 2917 2927 2939 2953 2957 2963 2969
1785 2971 2999 3001 3011 3019 3023 3037 3041 3049 3061 3067 3079 3083 3089
1786 3109 3119 3121 3137 3163 3167 3169 3181 3187 3191 3203 3209 3217 3221
1787 3229 3251 3253 3257 3259 3271 3299 3301 3307 3313 3319 3323 3329 3331
1788 3343 3347 3359 3361 3371 3373 3389 3391 3407 3413 3433 3449 3457 3461
1789 3463 3467 3469 3491 3499 3511 3517 3527 3529 3533 3539 3541 3547 3557
1790 3559 3571 3581 3583 3593 3607 3613 3617 3623 3631 3637 3643 3659 3671
1791 3673 3677 3691 3697 3701 3709 3719 3727 3733 3739 3761 3767 3769 3779
1792 3793 3797 3803 3821 3823 3833 3847 3851 3853 3863 3877 3881 3889 3907
1793 3911 3917 3919 3923 3929 3931 3943 3947 3967 3989 4001 4003 4007 4013
1794 4019 4021 4027 4049 4051 4057 4073 4079 4091 4093 4099 4111 4127 4129
1795 4133 4139 4153 4157 4159 4177 4201 4211 4217 4219 4229 4231 4241 4243
1796 4253 4259 4261 4271 4273 4283 4289 4297 4327 4337 4339 4349 4357 4363
1797 4373 4391 4397 4409 4421 4423 4441 4447 4451 4457 4463 4481 4483 4493
1798 4507 4513 4517 4519 4523 4547 4549 4561 4567 4583 4591 4597 4603 4621
1799 4637 4639 4643 4649 4651 4657 4663 4673 4679 4691 4703 4721 4723 4729
1800 4733 4751 4759 4783 4787 4789 4793 4799 4801 4813 4817 4831 4861 4871
1801 4877 4889 4903 4909 4919 4931 4933 4937 4943 4951 4957 4967 4969 4973
1802 4987 4993 4999 5003 5009 5011 5021 5023 5039 5051 5059 5077 5081 5087
1803 5099 5101 5107 5113 5119 5147 5153 5167 5171 5179 5189 5197 5209 5227
1804 5231 5233 5237 5261 5273 5279 5281 5297 5303 5309 5323 5333 5347 5351
1805 5381 5387 5393 5399 5407 5413 5417 5419 5431 5437 5441 5443 5449 5471
1806 5477 5479 5483 5501 5503 5507 5519 5521 5527 5531 5557 5563 5569 5573
1807 5581 5591 5623 5639 5641 5647 5651 5653 5657 5659 5669 5683 5689 5693
1808 5701 5711 5717 5737 5741 5743 5749 5779 5783 5791 5801 5807 5813 5821
1809 5827 5839 5843 5849 5851 5857 5861 5867 5869 5879 5881 5897 5903 5923
1810 5927 5939 5953 5981 5987 6007 6011 6029 6037 6043 6047 6053 6067 6073
1811 6079 6089 6091 6101 6113 6121 6131 6133 6143 6151 6163 6173 6197 6199
1812 6203 6211 6217 6221 6229 6247 6257 6263 6269 6271 6277 6287 6299 6301
1813 6311 6317 6323 6329 6337 6343 6353 6359 6361 6367 6373 6379 6389 6397
1814 6421 6427 6449 6451 6469 6473 6481 6491 6521 6529 6547 6551 6553 6563
1815 6569 6571 6577 6581 6599 6607 6619 6637 6653 6659 6661 6673 6679 6689
1816 6691 6701 6703 6709 6719 6733 6737 6761 6763 6779 6781 6791 6793 6803
1817 6823 6827 6829 6833 6841 6857 6863 6869 6871 6883 6899 6907 6911 6917
1818 6947 6949 6959 6961 6967 6971 6977 6983 6991 6997 7001 7013 7019 7027
1819 7039 7043 7057 7069 7079 7103 7109 7121 7127 7129 7151 7159 7177 7187
1820 7193 7207 7211 7213 7219 7229 7237 7243 7247 7253 7283 7297 7307 7309
1821 7321 7331 7333 7349 7351 7369 7393 7411 7417 7433 7451 7457 7459 7477
1822 7481 7487 7489 7499 7507 7517 7523 7529 7537 7541 7547 7549 7559 7561
1823 7573 7577 7583 7589 7591 7603 7607 7621 7639 7643 7649 7669 7673 7681
1824 7687 7691 7699 7703 7717 7723 7727 7741 7753 7757 7759 7789 7793 7817
1825 7823 7829 7841 7853 7867 7873 7877 7879 7883 7901 7907 7919 7927 7933
1826 7937 7949 7951 7963 7993 8009 8011 8017 8039 8053 8059 8069 8081 8087
1827 8089 8093 8101 8111 8117 8123 8147 8161 8167 8171 8179 8191 8209 8219
1828 8221 8231 8233 8237 8243 8263 8269 8273 8287 8291 8293 8297 8311 8317
1829 8329 8353 8363 8369 8377 8387 8389 8419 8423 8429 8431 8443 8447 8461
1830 8467 8501 8513 8521 8527 8537 8539 8543 8563 8573 8581 8597 8599 8609
1831 8623 8627 8629 8641 8647 8663 8669 8677 8681 8689 8693 8699 8707 8713
1832 8719 8731 8737 8741 8747 8753 8761 8779 8783 8803 8807 8819 8821 8831
1833 8837 8839 8849 8861 8863 8867 8887 8893 8923 8929 8933 8941 8951 8963
1834 8969 8971 8999 9001 9007 9011 9013 9029 9041 9043 9049 9059 9067 9091
1835 9103 9109 9127 9133 9137 9151 9157 9161 9173 9181 9187 9199 9203 9209
1836 9221 9227 9239 9241 9257 9277 9281 9283 9293 9311 9319 9323 9337 9341
1837 9343 9349 9371 9377 9391 9397 9403 9413 9419 9421 9431 9433 9437 9439
1838 9461 9463 9467 9473 9479 9491 9497 9511 9521 9533 9539 9547 9551 9587
1839 9601 9613 9619 9623 9629 9631 9643 9649 9661 9677 9679 9689 9697 9719
1840 9721 9733 9739 9743 9749 9767 9769 9781 9787 9791 9803 9811 9817 9829
1841 9833 9839 9851 9857 9859 9871 9883 9887 9901 9907 9923 9929 9931 9941
1842 9949 9967 9973)
1843 "List of small primes")
1845 ;;------------------------------------------------------------------------
1846 ;; From rat3a.lisp
1847 ;; Global variables referenced throughout the rational function package.
1849 (defmvar modulus nil
1850 "Global switch for doing modular arithmetic"
1851 :setting-predicate
1852 #'(lambda (val)
1853 ;; The modulus must be $false, or a positive integer. If the
1854 ;; value is a positive integer, print a warning if it is not
1855 ;; prime.
1856 (or (null val)
1857 (and (integerp val) (plusp val)
1858 (prog1 t
1859 (unless (primep val)
1860 (mtell
1861 (intl:gettext "Warning: assigning ~:M, a non-prime, to 'modulus'~&")
1862 val)))))))
1864 ;; $modulus is aliased to modulus and vice-versa. Setting one, sets
1865 ;; the other to the corresponding value. MODULUS is used in Lisp
1866 ;; code; $MODULUS isn't and appears to be the Maxima interface to
1867 ;; MODULUS.
1869 ;; FIXME: We should probably replace MODULUS with $MODULUS in the lisp
1870 ;; code and remove these aliases.
1871 (putprop '$modulus 'modulus 'alias)
1872 (putprop 'modulus '$modulus 'reversealias)
1874 ;;------------------------------------------------------------------------
1875 ;; From nrat4.lisp
1876 (defvar radcanp nil)
1878 ;;------------------------------------------------------------------------
1879 ;; From specfn.lisp
1881 ;; For these variables, specfn.lisp doesn't explicitly make them
1882 ;; defvars, but does set the symbol value for these and declares them
1883 ;; special. Since these are user-visible vars defined in the manual,
1884 ;; let's make it explicit.
1885 (defmvar $maxpsiposint 20
1886 "The largest positive value for which 'psi[n](x)'will try to compute
1887 an exact value.")
1889 (defmvar $maxpsinegint -10
1890 "The most negative value for which 'psi[n](x)' will try to compute an
1891 exact value. That is if <x> is less than 'maxnegint', 'psi[n](<x>)'
1892 will not return simplified answer, even if it could.")
1894 (defmvar $maxpsifracnum 6
1895 "Let <x> be a rational number less than one of the form 'p/q'. If 'p'
1896 is greater than 'maxpsifracnum', then 'psi[<n>](<x>)' will not try
1897 to return a simplified value.")
1899 (defmvar $maxpsifracdenom 6
1900 "Let <x> be a rational number less than one of the form 'p/q'. If 'q'
1901 is greater than 'maxpsifracdenom', then 'psi[<n>](<x>)' will not try
1902 to return a simplified value.")
1904 ;;------------------------------------------------------------------------
1905 ;; From hypgeo.lisp
1906 (defvar *par* nil
1907 "Parameter of Laplace transform.")
1909 (defvar *checkcoefsignlist*)
1910 ;;------------------------------------------------------------------------
1911 ;; Miscellaneous vars.
1912 (defvar nn*)
1913 (defvar dn*)
1914 (defvar *n)
1915 (defvar derivlist)
1916 (defvar opers-list)
1917 (defvar *leadcoef*)
1919 ;;------------------------------------------------------------------------
1920 (defvar *bindtest-deprecation-messages* '()
1921 "An alist whose key is a symbol and datum is a cons of a string to be
1922 used with bindtest and the value of the variable. The string should
1923 contain exactly ~M which will be replaced by the variable in the
1924 error message. This is useful for printing a deprecation message
1925 for any symbol.")