[385280]: htdocs / docs / original / maxima_10.html  Maximize  Restore  History

Download this file

258 lines (228 with data), 9.0 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
<HTML>
<HEAD>
<!-- This HTML file has been created by texi2html 1.52
from maxima.texi on 11 April 2003 -->
<TITLE>Maxima Manual - Contexts</TITLE>
<link href="maxima_11.html" rel=Next>
<link href="maxima_9.html" rel=Previous>
<link href="maxima_toc.html" rel=ToC>
</HEAD>
<BODY>
<p>Go to the <A HREF="maxima_1.html">first</A>, <A HREF="maxima_9.html">previous</A>, <A HREF="maxima_11.html">next</A>, <A HREF="maxima_42.html">last</A> section, <A HREF="maxima_toc.html">table of contents</A>.
<P><HR><P>
<H1><A NAME="SEC36" HREF="maxima_toc.html#TOC36">Contexts</A></H1>
<H2><A NAME="SEC37" HREF="maxima_toc.html#TOC37">Definitions for Contexts</A></H2>
<P>
<DL>
<DT><U>Function:</U> <B>ACTIVATE</B> <I>(cont1, cont2, ...)</I>
<DD><A NAME="IDX303"></A>
causes the specified contexts conti to be
activated. The facts in these contexts are used in making deductions
and retrieving information. The facts in these contexts are not
listed when FACTS(); is done. The variable ACTIVECONTEXTS is the list
of contexts which are active by way of the ACTIVATE function.
</P>
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>ACTIVECONTEXTS</B>
<DD><A NAME="IDX304"></A>
default: [] is a list of the contexts which are active
by way of the ACTIVATE function, as opposed to being active because
they are subcontexts of the current context.
</P>
</DL>
<P>
<DL>
<DT><U>Function:</U> <B>ASSUME</B> <I>(pred1, pred2, ...)</I>
<DD><A NAME="IDX305"></A>
First checks the specified predicates for
redundancy and consistency with the current data base. If the
predicates are consistent and non-redundant, they are added to the
data base; if inconsistent or redundant, no action is taken. ASSUME
returns a list whose entries are the predicates added to the data base
and the atoms REDUNDANT or INCONSISTENT where applicable.
</P>
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>ASSUMESCALAR</B>
<DD><A NAME="IDX306"></A>
default: [TRUE] - helps govern whether expressions <CODE>exp</CODE>
for which
</P>
<PRE>
NONSCALARP(exp) is FALSE
</PRE>
<P>
are assumed to behave like scalars
for certain transformations as follows: Let <CODE>exp</CODE> represent any
non-list/non-matrix, and <CODE>[1,2,3]</CODE> any list or matrix.
<PRE>
exp.[1,2,3]; ==&#62;
[exp,2*exp,3*exp]
</PRE>
<P>
if ASSUMESCALAR is TRUE or SCALARP(exp) is
TRUE or CONSTANTP(exp) is TRUE. If ASSUMESCALAR is TRUE, such
expressions will behave like scalars only for the commutative
operators, but not for ".". If ASSUMESCALAR is FALSE, such
expressions will behave like non-scalars. If ASSUMESCALAR is ALL,
such expressions will behave like scalars for all the operators listed
above.
</DL>
</P>
<P>
<DL>
<DT><U>Variable:</U> <B>ASSUME_POS</B>
<DD><A NAME="IDX307"></A>
default:[FALSE] - When using INTEGRATE, etc. one often
introduces parameters which are real and positive or one's
calculations can often be constructed so that this is true. There is
a switch ASSUME_POS (default FALSE) such that if set to TRUE, MACSYMA
will assume one's parameters are positive. The intention here is to
cut down on the number of questions MACSYMA needs to ask. Obviously,
ASSUME information or any contextual information present will take
precedence. The user can control what is considered to be a parameter
for this purpose. Parameters by default are those which satisfy
SYMBOLP(x) OR SUBVARP(x). The user can change this by setting the
option ASSUME_POS_PRED [default FALSE] to the name of a predicate
function of one argument. E.g. if you want only symbols to be
parameters, you can do ASSUME_POS:TRUE$ ASSUME_POS_PRED:'SYMBOLP$
SIGN(A); -&#62; POS, SIGN(A[1]); -&#62; PNZ.
</DL>
</P>
<P>
<DL>
<DT><U>Variable:</U> <B>ASSUME_POS_PRED</B>
<DD><A NAME="IDX308"></A>
default:[FALSE] - may be set to one argument to control
what will be considered a parameter for the "assumptions" that INTEGRATE
will make... see ASSUME and ASSUME_POS .
</DL>
</P>
<P>
<DL>
<DT><U>Variable:</U> <B>CONTEXT</B>
<DD><A NAME="IDX309"></A>
default: INITIAL. Whenever a user assumes a new fact, it is
placed in the context named as the current value of the variable
CONTEXT. Similarly, FORGET references the current value of CONTEXT.
To change contexts, simply bind CONTEXT to the desired context. If
the specified context does not exist it will be created by an
invisible call to NEWCONTEXT. The context specified by the value of
CONTEXT is automatically activated. (Do DESCRIBE(CONTEXTS); for a
general description of the CONTEXT mechanism.)
</P>
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>CONTEXTS</B>
<DD><A NAME="IDX310"></A>
default: [INITIAL,GLOBAL] is a list of the contexts which
currently exist, including the currently active context.
The context mechanism makes it possible for a user to bind together
and name a selected portion of his data base, called a context. Once
this is done, the user can have MACSYMA assume or forget large numbers
of facts merely by activating or deactivating their context. Any
symbolic atom can be a context, and the facts contained in that
context will be retained in storage until the user destroys them
individually by using FORGET or destroys them as a whole by using KILL
to destroy the context to which they belong.
Contexts exist in a formal hierarchy, with the root always being
the context GLOBAL, which contains information about MACSYMA that some
functions need. When in a given context, all the facts in that
context are "active" (meaning that they are used in deductions and
retrievals) as are all the facts in any context which is an inferior
of that context. When a fresh MACSYMA is started up, the user is in a
context called INITIAL, which has GLOBAL as a subcontext.
The functions which deal with contexts are: FACTS, NEWCONTEXT,
SUPCONTEXT, KILLCONTEXT, ACTIVATE, DEACTIVATE, ASSUME, and FORGET.
</P>
</DL>
<P>
<DL>
<DT><U>Function:</U> <B>DEACTIVATE</B> <I>(cont1, cont2, ...)</I>
<DD><A NAME="IDX311"></A>
causes the specified contexts conti to
be deactivated.
</P>
</DL>
<P>
<DL>
<DT><U>Function:</U> <B>FACTS</B> <I>(item)</I>
<DD><A NAME="IDX312"></A>
If 'item' is the name of a context then FACTS returns a list
of the facts in the specified context. If no argument is given, it
lists the current context. If 'item' is not the name of a context
then it returns a list of the facts known about 'item' in the current
context. Facts that are active, but in a different context, are not
listed.
</P>
</DL>
<P>
<DL>
<DT><U>declaration:</U> <B>FEATURES</B>
<DD><A NAME="IDX313"></A>
- MACSYMA has built-in properties which are handled by the
data base. These are called FEATURES. One can do DECLARE(N,INTEGER),
etc. One can also DECLARE one's own FEATURES by e.g.
DECLARE( INCREASING, FEATURE); which will then allow one to say
DECLARE(F, INCREASING);. One can then check if F is INCREASING by
using the predicate FEATUREP via FEATUREP(F, INCREASING). There is
an infolist FEATURES which is a list of known FEATURES. At present
known FEATURES are: INTEGER, NONINTEGER, EVEN, ODD, RATIONAL,
IRRATIONAL, REAL, IMAGINARY, COMPLEX, ANALYTIC, INCREASING,
DECREASING, ODDFUN, EVENFUN, POSFUN, COMMUTATIVE, LASSOCIATIVE,
RASSOCIATIVE, SYMMETRIC, and ANTISYMMETRIC. [Note: system "features"
may be checked with STATUS(FEATURE, ...); See DESCRIBE(STATUS); or
DESCRIBE(FEATURE); for details.]
</P>
</DL>
<P>
<DL>
<DT><U>Function:</U> <B>FORGET</B> <I>(pred1, pred2, ...)</I>
<DD><A NAME="IDX314"></A>
removes relations established by ASSUME.
The predicates may be expressions equivalent to (but not necessarily
identical to) those previously ASSUMEd. FORGET(list) is also a legal
form.
</P>
</DL>
<P>
<DL>
<DT><U>Function:</U> <B>KILLCONTEXT</B> <I>(context1,context2,...,contextn)</I>
<DD><A NAME="IDX315"></A>
kills the specified
contexts. If one of them is the current context, the new current
context will become the first available subcontext of the current
context which has not been killed. If the first available unkilled
context is GLOBAL then INITIAL is used instead. If the INITIAL
context is killed, a new INITIAL is created, which is empty of facts.
KILLCONTEXT doesn't allow the user to kill a context which is
currently active, either because it is a subcontext of the current
context, or by use of the function ACTIVATE.
</P>
</DL>
<P>
<DL>
<DT><U>Function:</U> <B>NEWCONTEXT</B> <I>(name)</I>
<DD><A NAME="IDX316"></A>
creates a new (empty) context, called name, which
has GLOBAL as its only subcontext. The new context created will
become the currently active context.
</P>
</DL>
<P>
<DL>
<DT><U>Function:</U> <B>SUPCONTEXT</B> <I>(name,context)</I>
<DD><A NAME="IDX317"></A>
will create a new context (called name)
whose subcontext is context. If context is not specified, the current
context will be assumed. If it is specified, context must exist.
</P>
</DL>
<P><HR><P>
<p>Go to the <A HREF="maxima_1.html">first</A>, <A HREF="maxima_9.html">previous</A>, <A HREF="maxima_11.html">next</A>, <A HREF="maxima_42.html">last</A> section, <A HREF="maxima_toc.html">table of contents</A>.
</BODY>
</HTML>

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks