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