 forget - Maple Help

# Online Help

###### All Products    Maple    MapleSim

forget Calling Sequence forget( f, opts ) forget( f, a, b, c, ..., opts ) Parameters

 f - procedure or module; the object to forget a, b, c, ... - (optional) specific argument sequence for f opts - options of the form keyword = true or false, where keyword is one of subfunctions, forgetpermanent or reinitialize Description

 • The forget function is used to clear remember tables of procedures.  Its precise action is controlled by the options given, whether f is a procedure or a module, and whether the remember table(s) in question is a pure remember table or a cache table.
 • The options are:
 – subfunctions = true or false (default: true)

If true, this causes forget(f) to also forget procedures related to f.  If f is a module, this means all procedures in the module, including procedures in submodules.  If f is a procedure which is not in a module, this means all procedures whose name is of the form f/.... If subfunctions=false and f is a an appliable module, only the remember table associated to the ModuleApply member of f is cleared. If subfunctions=false and f is a procedure which is not a module member, only the remember table associated to f itself is cleared. This option is ignored in the case when f is a procedure which is a module member.

 – forgetpermanent = true or false (default: false)

If true then permanent entries in cache-based remember tables are also removed. If not given, or given as forgetpermanent=false, only temporary entries in cache-based remember tables are cleared. This option is ignored for non-cache-based remember tables.

 – reinitialize = true or false (default: true)

This option only applies to the case when f is a procedure which is not a member of a module. In this case, if reinitialize=true, the corresponding procedure f is completely discarded and reloaded from its Maple archive, causing its remember table to be restored to its initial state.

 • forget(f, a, b, c, ..., opts) restricts the action of forget to clearing only remember table entry(s) indexed by the argument list [a, b, c, ...], and subject to the interpretations implied by the options in opts.
 • As a special case, specifying f as an empty range allows for selective clearing of remember table entries from all remember tables in the system.  This requires a second argument, to indicate which entries to clear. For example, forget(..,x), which will clear all remembered entries in the system that reference x. Examples

 > $\mathrm{forget}\left(\mathrm{evalc}\right)$
 > $\mathrm{sin}\left(x\right);$$\mathrm{sin}\left(\mathrm{\pi }\right)$
 ${\mathrm{sin}}{}\left({x}\right)$
 ${0}$ (1)
 > $\mathrm{op}\left(4,\mathrm{op}\left(\mathrm{sin}\right)\right)$
 ${\mathrm{Cache}}{}\left({512}{,}'{\mathrm{temporary}}'{=}\left[{-}{x}{=}{-}{\mathrm{sin}}{}\left({x}\right){,}{x}{=}{\mathrm{sin}}{}\left({x}\right)\right]{,}'{\mathrm{permanent}}'{=}\left[{0}{=}{0}{,}{\mathrm{\infty }}{=}{\mathrm{undefined}}{,}{\mathrm{\pi }}{=}{0}{,}\frac{{\mathrm{\pi }}}{{3}}{=}\frac{\sqrt{{3}}}{{2}}{,}{-}{\mathrm{\infty }}{=}{\mathrm{undefined}}{,}\frac{{\mathrm{\pi }}}{{4}}{=}\frac{\sqrt{{2}}}{{2}}{,}\frac{{\mathrm{\pi }}}{{2}}{=}{1}{,}\frac{{\mathrm{\pi }}}{{6}}{=}\frac{{1}}{{2}}{,}{I}{=}{I}{}{\mathrm{sinh}}{}\left({1}\right)\right]\right)$ (2)
 > $\mathrm{forget}\left(\mathrm{sin},x,\mathrm{subfunctions}=\mathrm{false}\right)$
 > $\mathrm{op}\left(4,\mathrm{op}\left(\mathrm{sin}\right)\right)$
 ${\mathrm{Cache}}{}\left({512}{,}'{\mathrm{temporary}}'{=}\left[{-}{x}{=}{-}{\mathrm{sin}}{}\left({x}\right)\right]{,}'{\mathrm{permanent}}'{=}\left[{0}{=}{0}{,}{\mathrm{\infty }}{=}{\mathrm{undefined}}{,}{\mathrm{\pi }}{=}{0}{,}\frac{{\mathrm{\pi }}}{{3}}{=}\frac{\sqrt{{3}}}{{2}}{,}{-}{\mathrm{\infty }}{=}{\mathrm{undefined}}{,}\frac{{\mathrm{\pi }}}{{4}}{=}\frac{\sqrt{{2}}}{{2}}{,}\frac{{\mathrm{\pi }}}{{2}}{=}{1}{,}\frac{{\mathrm{\pi }}}{{6}}{=}\frac{{1}}{{2}}{,}{I}{=}{I}{}{\mathrm{sinh}}{}\left({1}\right)\right]\right)$ (3)
 > $\mathrm{forget}\left(\mathrm{sin},\mathrm{subfunctions}=\mathrm{false}\right)$
 > $\mathrm{op}\left(4,\mathrm{op}\left(\mathrm{sin}\right)\right)$
 ${\mathrm{Cache}}{}\left({512}{,}'{\mathrm{permanent}}'{=}\left[{0}{=}{0}{,}{\mathrm{\infty }}{=}{\mathrm{undefined}}{,}{\mathrm{\pi }}{=}{0}{,}\frac{{\mathrm{\pi }}}{{3}}{=}\frac{\sqrt{{3}}}{{2}}{,}{-}{\mathrm{\infty }}{=}{\mathrm{undefined}}{,}\frac{{\mathrm{\pi }}}{{4}}{=}\frac{\sqrt{{2}}}{{2}}{,}\frac{{\mathrm{\pi }}}{{2}}{=}{1}{,}\frac{{\mathrm{\pi }}}{{6}}{=}\frac{{1}}{{2}}{,}{I}{=}{I}{}{\mathrm{sinh}}{}\left({1}\right)\right]\right)$ (4)
 > $\mathrm{forget}\left(\mathrm{sin},\mathrm{forgetpermanent},\mathrm{reinitialize}=\mathrm{false}\right)$
 > $\mathrm{op}\left(4,\mathrm{op}\left(\mathrm{sin}\right)\right)$
 ${\mathrm{Cache}}{}\left({512}\right)$ (5)
 > $\mathrm{forget}\left(\mathrm{LinearAlgebra}\right)$

 See Also