Introduction to Miscellaneous Options
=====================================

In this section various options are discussed which have a global effect on the operation of Maxima.   Also various lists such as the list of all user defined functions, are discussed.

Share
=====

The Maxima "share" directory contains programs and other files of interest to Maxima users, but not part of the core implementation of Maxima. These programs are typically loaded via load or setup_autoload.

:lisp *maxima-sharedir* displays the location of the share directory within the user's file system.

printfile ("share.usg") prints an out-of-date list of share packages. Users may find it more informative to browse the share directory using a file system browser.

Functions and Variables for Miscellaneous Options
=================================================

 -- System variable: aliases
     Default value: []

     aliases is the list of atoms which have a user defined alias (set up by the alias, ordergreat, orderless functions or by declaring the atom a noun with declare).

 -- Declaration: alphabetic
     alphabetic is a declaration type recognized by declare. The expression declare(S, alphabetic) tells Maxima to recognize as alphabetic all of the characters in S, which must be a string.

     See also Identifiers.

     Example:

          (%i1) xx\~yy\`\@ : 1729;
          (%o1)                         1729
          (%i2) declare ("~`@", alphabetic);
          (%o2)                         done
          (%i3) xx~yy`@ + @yy`xx + `xx@@yy~;
          (%o3)               `xx@@yy~ + @yy`xx + 1729
          (%i4) listofvars (%);
          (%o4)                  [@yy`xx, `xx@@yy~]

 -- Function: apropos (STRING)
     Searches for Maxima names which have STRING appearing anywhere within them.  Thus, apropos (exp) returns a list of all the flags and functions which have exp as part of their names, such as expand, exp, and exponentialize.  Thus if you can only remember part of the name of something you can use this command to find the rest of the name. Similarly, you could say apropos (tr_) to find a list of many of the switches relating to the translator, most of which begin with tr_.

 -- Function: args (EXPR)
     Returns the list of arguments of expr, which may be any kind of expression other than an atom. Only the arguments of the top-level operator are extracted; subexpressions of expr appear as elements or subexpressions of elements of the list of arguments.

     The order of the items in the list may depend on the global flag inflag.

     args (EXPR) is equivalent to substpart ("[", EXPR, 0). See also substpart, and op.

 -- Option variable: genindex
     Default value: i

     genindex is the alphabetic prefix used to generate the next variable of summation when necessary.

 -- Option variable: gensumnum
     Default value: 0

     gensumnum is the numeric suffix used to generate the next variable of summation.  If it is set to false then the index will consist only of genindex with no numeric suffix.

 -- Constant: inf
     Real positive infinity.

 -- Constant: infinity
     Complex infinity, an infinite magnitude of arbitrary phase angle.  See also inf and minf.

 -- System variable: infolists
     Default value: []

     infolists is a list of the names of all of the information lists in Maxima. These are:

     labels
          All bound %i, %o, and %t labels.

     values
          All bound atoms which are user variables, not Maxima options or switches, created by : or :: or functional binding.

     functions
          All user-defined functions, created by := or define.

     arrays
          All declared and undeclared arrays, created by :, ::, or :=.

     macros
          All user-defined macro functions.

     myoptions
          All options ever reset by the user (whether or not they are later reset to their default values).

     rules
          All user-defined pattern matching and simplification rules, created by tellsimp, tellsimpafter, defmatch, or defrule.

     aliases
          All atoms which have a user-defined alias, created by the alias, ordergreat, orderless functions or by declaring the atom as a noun with declare.

     dependencies
          All atoms which have functional dependencies, created by the depends or gradef functions.

     gradefs
          All functions which have user-defined derivatives, created by the gradef function.

     props
          All atoms which have any property other than those mentioned above, such as properties established by atvalue or matchdeclare, etc., as well as properties established in the declare function.

     let_rule_packages
          All user-defined let rule packages plus the special package default_let_rule_package. (default_let_rule_package is the name of the rule package used when one is not explicitly set by the user.)

 -- Function: integerp (EXPR)
     Returns true if EXPR is a literal numeric integer, otherwise false.

     integerp returns false if its argument is a symbol, even if the argument is declared integer.

     Examples:

          (%i1) integerp (0);
          (%o1)                         true
          (%i2) integerp (1);
          (%o2)                         true
          (%i3) integerp (-17);
          (%o3)                         true
          (%i4) integerp (0.0);
          (%o4)                         false
          (%i5) integerp (1.0);
          (%o5)                         false
          (%i6) integerp (%pi);
          (%o6)                         false
          (%i7) integerp (n);
          (%o7)                         false
          (%i8) declare (n, integer);
          (%o8)                         done
          (%i9) integerp (n);
          (%o9)                         false

 -- Option variable: m1pbranch
     Default value: false

     m1pbranch is the principal branch for -1 to a power. Quantities such as (-1)^(1/3) (that is, an "odd" rational exponent) and (-1)^(1/4) (that is, an "even" rational exponent) are handled as follows:

                        domain:real

          (-1)^(1/3):      -1
          (-1)^(1/4):   (-1)^(1/4)

                       domain:complex
          m1pbranch:false          m1pbranch:true
          (-1)^(1/3)               1/2+%i*sqrt(3)/2
          (-1)^(1/4)              sqrt(2)/2+%i*sqrt(2)/2

 -- Function: numberp (EXPR)
     Returns true if EXPR is a literal integer, rational number, floating point number, or bigfloat, otherwise false.

     numberp returns false if its argument is a symbol, even if the argument is a symbolic number such as %pi or %i, or declared to be even, odd, integer, rational, irrational, real, imaginary, or complex.

     Examples:

          (%i1) numberp (42);
          (%o1)                         true
          (%i2) numberp (-13/19);
          (%o2)                         true
          (%i3) numberp (3.14159);
          (%o3)                         true
          (%i4) numberp (-1729b-4);
          (%o4)                         true
          (%i5) map (numberp, [%e, %pi, %i, %phi, inf, minf]);
          (%o5)      [false, false, false, false, false, false]
          (%i6) declare (a, even, b, odd, c, integer, d, rational,
               e, irrational, f, real, g, imaginary, h, complex);
          (%o6)                         done
          (%i7) map (numberp, [a, b, c, d, e, f, g, h]);
          (%o7) [false, false, false, false, false, false, false, false]

 -- Function: properties (A)
     Returns a list of the names of all the properties associated with the atom A.

 -- Special symbol: props
     props are atoms which have any property other than those explicitly mentioned in infolists, such as specified by atvalue, matchdeclare, etc., as well as properties specified in the declare function.

 -- Function: propvars (PROP)
     Returns a list of those atoms on the props list which have the property indicated by PROP.  Thus propvars (atvalue) returns a list of atoms which have atvalues.

 -- Function: put (ATOM, VALUE, INDICATOR)
     Assigns VALUE to the property (specified by INDICATOR) of ATOM. INDICATOR may be the name of any property, not just a system-defined property.

     put evaluates its arguments. put returns VALUE.

     Examples:

          (%i1) put (foo, (a+b)^5, expr);
                                             5
          (%o1)                       (b + a)
          (%i2) put (foo, "Hello", str);
          (%o2)                         Hello
          (%i3) properties (foo);
          (%o3)            [[user properties, str, expr]]
          (%i4) get (foo, expr);
                                             5
          (%o4)                       (b + a)
          (%i5) get (foo, str);
          (%o5)                         Hello

 -- Function: qput (ATOM, VALUE, INDICATOR)
     Assigns VALUE to the property (specified by INDICATOR) of ATOM. This is the same as put, except that the arguments are quoted.

     Example:

          (%i1) foo: aa$
          (%i2) bar: bb$
          (%i3) baz: cc$
          (%i4) put (foo, bar, baz);
          (%o4)                          bb
          (%i5) properties (aa);
          (%o5)                [[user properties, cc]]
          (%i6) get (aa, cc);
          (%o6)                          bb
          (%i7) qput (foo, bar, baz);
          (%o7)                          bar
          (%i8) properties (foo);
          (%o8)            [value, [user properties, baz]]
          (%i9) get ('foo, 'baz);
          (%o9)                          bar

 -- Function: rem (ATOM, INDICATOR)
     Removes the property indicated by INDICATOR from ATOM.

 -- Function: remove (A_1, P_1, ..., A_N, P_N)
 -- Function: remove ([A_1, ..., A_M], [P_1, ..., P_N], ...)
 -- Function: remove ("A", operator)
 -- Function: remove (A, transfun)
 -- Function: remove (all, P)
     Removes properties associated with atoms.

     remove (A_1, P_1, ..., A_N, P_N) removes property p_k from atom a_k.

     remove ([A_1, ..., A_M], [P_1, ..., P_N], ...) removes properties P_1, ..., P_N from atoms A_1, ..., A_M. There may be more than one pair of lists.

     remove (all, P) removes the property P from all atoms which have it.

     The removed properties may be system-defined properties such as function, macro, or mode_declare, or user-defined properties.

     A property may be transfun to remove the translated Lisp version of a function. After executing this, the Maxima version of the function is executed rather than the translated version.

     remove ("A", operator) or, equivalently, remove ("A", op) removes from A the operator properties declared by prefix, infix, nary, postfix, matchfix, or nofix. Note that the name of the operator must be written as a quoted string.

     remove always returns done whether or not an atom has a specified property. This behavior is unlike the more specific remove functions remvalue, remarray, remfunction, and remrule.

 -- Function: remvalue (NAME_1, ..., NAME_N)
 -- Function: remvalue (all)
     Removes the values of user variables NAME_1, ..., NAME_N (which can be subscripted) from the system.

     remvalue (all) removes the values of all variables in values, the list of all variables given names by the user (as opposed to those which are automatically assigned by Maxima).

     See also values.

 -- Function: rncombine (EXPR)
     Transforms EXPR by combining all terms of EXPR that have identical denominators or denominators that differ from each other by numerical factors only.  This is slightly different from the behavior of combine, which collects terms that have identical denominators.

     Setting pfeformat: true and using combine yields results similar to those that can be obtained with rncombine, but rncombine takes the additional step of cross-multiplying numerical denominator factors. This results in neater forms, and the possibility of recognizing some cancellations.

 -- Function: scalarp (EXPR)
     Returns true if EXPR is a number, constant, or variable declared scalar with declare, or composed entirely of numbers, constants, and such variables, but not containing matrices or lists.

 -- Function: setup_autoload (FILENAME, FUNCTION_1, ..., FUNCTION_N)
     Specifies that if any of FUNCTION_1, ..., FUNCTION_N are referenced and not yet defined, FILENAME is loaded via load. FILENAME usually contains definitions for the functions specified, although that is not enforced.

     setup_autoload does not work for array functions.

     setup_autoload quotes its arguments.

     Example:

          (%i1) legendre_p (1, %pi);
          (%o1)                  legendre_p(1, %pi)
          (%i2) setup_autoload ("specfun.mac", legendre_p, ultraspherical);
          (%o2)                         done
          (%i3) ultraspherical (2, 1/2, %pi);
          Warning - you are redefining the Macsyma function ultraspherical
          Warning - you are redefining the Macsyma function legendre_p
                                      2
                           3 (%pi - 1)
          (%o3)            ------------ + 3 (%pi - 1) + 1
                                2
          (%i4) legendre_p (1, %pi);
          (%o4)                          %pi
          (%i5) legendre_q (1, %pi);
                                        %pi + 1
                                %pi log(-------)
                                        1 - %pi
          (%o5)                 ---------------- - 1
                                       2