Variables

©1998 Research Institute for Symbolic Computation (RISC-Linz)

NO WARRANTY

Package Description

This package contains commands for handling object variables. In our setting, an object variable is a Mathematica symbol with the list of attributes {Temporary}.

[Graphics:Variablesgr2.gif][Graphics:Variablesgr1.gif]

[Graphics:Variablesgr2.gif][Graphics:Variablesgr3.gif]

Usage

[Graphics:Variablesgr2.gif][Graphics:Variablesgr4.gif]

[Graphics:Variablesgr2.gif][Graphics:Variablesgr5.gif]

[Graphics:Variablesgr2.gif][Graphics:Variablesgr6.gif]

[Graphics:Variablesgr2.gif][Graphics:Variablesgr7.gif]

[Graphics:Variablesgr2.gif][Graphics:Variablesgr8.gif]

[Graphics:Variablesgr2.gif][Graphics:Variablesgr9.gif]

[Graphics:Variablesgr2.gif][Graphics:Variablesgr10.gif]

Implementation

NewX, NewY, NewC

Syntax calls
NewX[ ];
NewY[ ];
NewC[ ];

Output
NewX[ ] returns a Temporary variant of symbol x
NewY[ ] returns a Temporary variant of symbol y
NewC[ ] returns a Temporary variant of symbol c
Implementation

[Graphics:Variablesgr2.gif][Graphics:Variablesgr11.gif]

Begin

[Graphics:Variablesgr2.gif][Graphics:Variablesgr12.gif]

IsVar

Syntax call
IsVar[
t ]
Input
a term t
Output
True if t is a symbol with attribute Temporary
False otherwise
Implementation

[Graphics:Variablesgr2.gif][Graphics:Variablesgr13.gif]

Var

Syntax call
Var[
term ]
Input
term : a term
Output
the list of variables of term (i.e. Mathematica symbols with attribute Temporary)
Implementation

[Graphics:Variablesgr2.gif][Graphics:Variablesgr14.gif]

SetVariables

Syntax call
SetVariables[{
[Graphics:Variablesgr15.gif], ... , [Graphics:Variablesgr16.gif]}]
Input
a list of Mathematica symbols or type annotated symbols
Effect
declare variables [Graphics:Variablesgr17.gif], ... , [Graphics:Variablesgr18.gif], i.e. set their list of attributes to {Temporary}
Output
{[Graphics:Variablesgr19.gif], ... , [Graphics:Variablesgr20.gif]}
Implementation

[Graphics:Variablesgr2.gif][Graphics:Variablesgr21.gif]

ClearVariables

Syntax call
ClearVariables[{
[Graphics:Variablesgr22.gif], ... , [Graphics:Variablesgr23.gif]}]
Input
a list of Mathematica symbols
Effect
undeclare the variables [Graphics:Variablesgr24.gif], ... , [Graphics:Variablesgr25.gif], i.e. set their list of attributes to { }
Output
{[Graphics:Variablesgr26.gif], ... , [Graphics:Variablesgr27.gif]}
Implementation

[Graphics:Variablesgr2.gif][Graphics:Variablesgr28.gif]

End

[Graphics:Variablesgr2.gif][Graphics:Variablesgr29.gif]

[Graphics:Variablesgr2.gif][Graphics:Variablesgr30.gif]

[Graphics:Variablesgr2.gif][Graphics:Variablesgr31.gif]