diff --git a/doc/manual/prepro.tex b/doc/manual/prepro.tex index ef5290cf..b73b135a 100644 --- a/doc/manual/prepro.tex +++ b/doc/manual/prepro.tex @@ -1726,6 +1726,57 @@ \section{\#show} input is off. %--#] show : +%--#[ skipextrasymbols : + +\section{\#skipextrasymbols} +\label{preskipextrasymbols} + +\noindent Syntax: + +\#skipextrasymbols positivenumber + +\noindent See also ExtraSymbols(\ref{substaextrasymbols}) and the chapter +on optimization(\ref{optimization}). + +\noindent This instructions adds a number of dummy extra +symbols\index{extra symbols} to the list of extra +symbols(\ref{substaextrasymbols}). This can be used when several +optimizations are done on an expression in such a way that the extra +symbols of previous optimizations are still present. Normally the number +space for them is erased in a \#clearoptimize instruction. This can be +avoided with a sequence like +\begin{verbatim} + #skipextrasymbols,{`optimmaxvar_'-`optimminvar_'+1} +\end{verbatim} +In this case the numbering of the next optimization will start after the +last extra symbol of the previous optimization. +One should realize however that the definitions of the extra symbols are +not kept once the new optimization is started or once a \#clearoptimize +instruction is issued. Example: +\begin{verbatim} + #- + S a,b,c,d,e; + L F = (a+b+c+d+3*e)^3; + B b; + .sort + ExtraSymbols,array,w; + Format O3,stats=ON; + #optimize F + #write <> " %4O" + .sort + #SkipExtraSymbols,{`optimmaxvar_'-`optimminvar_'+1} + id b = b+1; + Print +f; + B b; + .end +\end{verbatim} +Because the O3 format is still active, the final printing uses the +optimization as well. If the \#SkipExtraSymbols instruction would have been +omitted, the numbering would start again from one, while the rhs. of their +definitions would contain the old extra symbols. The result would be +incorrect. + +%--#] skipextrasymbols : %--#[ switch : \section{\#switch} diff --git a/doc/manual/startup.tex b/doc/manual/startup.tex index cb2fffc4..3d092530 100644 --- a/doc/manual/startup.tex +++ b/doc/manual/startup.tex @@ -44,7 +44,7 @@ \chapter{Running FORM} the make -j option). \item[-p] Next argument/option is the path of a directory for input, include, procedure and subroutine files. -\item[-pipe] Indicates that \FORM\ is started up as the receiving +\item[-{pipe}] Indicates that \FORM\ is started up as the receiving end of a pipe. Action will be taken to set up the proper communication channels. \item[-q] Quiet option. Only output expressions are printed. diff --git a/doc/manual/statements.tex b/doc/manual/statements.tex index 8cc36550..79a769b1 100644 --- a/doc/manual/statements.tex +++ b/doc/manual/statements.tex @@ -820,20 +820,38 @@ \section{delete} \noindent \begin{tabular}{ll} Type & Specification statement\\ -Syntax & delete storage; -\\ See also & save (\ref{substasave}), load (\ref{substaload}) +Syntax & delete storage; \\ +See also & save (\ref{substasave}), load (\ref{substaload}) \\ +Syntax & delete extrasymbols; \\ +Syntax & delete extrasymbols>number; \\ +See also & extrasymbols (\ref{substaextrasymbols}) \\ + \end{tabular} \vspace{4mm} -\noindent This statement\index{delete} clears the complete -storage\index{storage file} file\index{file!storage} and -reduces it to zero size. The effect is that all stored expressions are -removed from the system. Because it is impossible to remove individual -expressions from the store file (there is no mechanism to fill the -resulting holes) it is the only way to clean up the storage file. If some -expressions should be excluded from this elimination process, one should -copy them first into active global expressions, then delete the storage -file, after which the expressions can be written to storage again with a -.store\index{.store} instruction. \vspace{10mm} +\noindent This statement has currently two varieties. The delete +storage\index{delete} clears the complete storage\index{storage file} +file\index{file!storage} and reduces it to zero size. The effect is that +all stored expressions are removed from the system. Because it is +impossible to remove individual expressions from the store file (there is +no mechanism to fill the resulting holes) it is the only way to clean up +the storage file. If some expressions should be excluded from this +elimination process, one should copy them first into active global +expressions, then delete the storage file, after which the expressions can +be written to storage again with a .store\index{.store} instruction. + +\noindent The delete extrasymbols\index{delete}\index{} variety removes +extra symbols\index{extra symbols} from the list. The default is that all +extra symbols are removed, but one can also remove the symbols above a +given number as in +\begin{verbatim} + #$es = `extrasymbols_'; + ToPolynomial; + ....some code.... + .sort + * now the new extra symbols are not needed anylonger + Delete extrasymbols>`$es'; +\end{verbatim} +\vspace{10mm} %--#] delete : %--#[ denominators : @@ -1321,19 +1339,20 @@ \section{extrasymbols} factorization(\ref{substafactarg}) (which uses the topolynomial facilities automatically) and output simplification (see the Format statement \ref{substaformat}). -The ToPolynomial statement takes each term, looks for objects -that are not symbols to positive powers and replaces them by symbols. If -the object has been encountered before the same symbol will be used, -otherwise a new symbol will be defined. The object represented by the -`extra symbol' is stored internally and can be printed if needed with the -\%X option in the \#write instruction (\ref{prewrite}). The representation -of the extra symbols is by default the name Z followed by a number and an -underscore character. If another name is desired this should be specified -in an `ExtraSymbols' statement. The name given may contain only alphabetic -characters! Because some compilers do not like the underscore character, -there is an alternative notation for the extra symbols. This is just for -cosmetic reasons and one cannot feed these symbols into the compiler this -way. This is with an array notation. The statement +The ToPolynomial statement\index{topolynomial} takes each term, looks for +objects that are not symbols to positive powers and replaces them by +symbols. If the object has been encountered before the same symbol will be +used, otherwise a new symbol will be defined. The object represented by the +`extra symbol'\index{extra symbols} is stored internally and can be printed +if needed with the \%X option in the \#write instruction (\ref{prewrite}). +The representation of the extra symbols is by default the name Z followed +by a number and an underscore character. If another name is desired this +should be specified in an `ExtraSymbols' statement. The name given may +contain only alphabetic characters! Because some compilers do not like the +underscore character, there is an alternative notation for the extra +symbols. This is just for cosmetic reasons and one cannot feed these +symbols into the compiler this way. This is with an array notation. The +statement \begin{verbatim} ExtraSymbols,array,Ab; \end{verbatim} @@ -1455,7 +1474,7 @@ \section{factorize} \noindent If no expressions are mentioned all expressions will be affected by the action of this statement. One may exclude certain expressions with -the nfactorize statement ( see \ref{substanfactorize}). If one or more +the nfactorize statement (see \ref{substanfactorize}). If one or more expressions are mentoned they will be added to the list of expressions that will be affected. @@ -2749,7 +2768,7 @@ \section{makeinteger} this argument may be negative. If this is not desired one can first normalize\index{normalize} the argument and then make its coefficients integer. The overall factor that is needed to make the coefficients like -described is taken from the overall factor of the complete term. Example +described is taken from the overall factor of the complete term. Example: % THIS EXAMPLE IS PART OF THE TESTSUITE. CHANGES HERE SHOULD BE APPLIED THERE AS % WELL! \begin{verbatim} @@ -2759,7 +2778,6 @@ \section{makeinteger} MakeInteger,f; Print +f; .end - F = 2/105*f(135*c + 147*b + 385*a); \end{verbatim} @@ -2773,7 +2791,7 @@ \section{makeinteger} It is possible to introduce a scale factor when extracting the coefficient and multiplying it into the complete term. -\leftvitem{4cm}{MakeInteger,$\wedge$:,f;} +\leftvitem{4cm}{MakeInteger,$\wedge$,f;} \rightvitem{12cm}{The number n must be an integer (may be negative) and if the coefficient that is extracted is c the whole term is multiplied by the factor $c^n$.} @@ -3209,7 +3227,7 @@ \section{normalize} A more flexible way to extract the coefficient of the (first) term is by providing a scale factor as in -\leftvitem{4cm}{Normalize,$\wedge$:,f;} +\leftvitem{4cm}{Normalize,$\wedge$,f;} \rightvitem{12cm}{The number n must be an integer (may be negative) and if the coefficient of the first term was c the whole term is multiplied by the factor $c^n$.}