switch.tex 58 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750
  1. \section{General Switches}
  2. \begin{Introduction}{SWITCHES}
  3. Switches are set on or off using the commands \nameref{on} or
  4. \nameref{off}, respectively.
  5. The default setting of the switches described in this section is
  6. \nameref{off} unless stated otherwise.
  7. \end{Introduction}
  8. \begin{Switch}{ALGINT}
  9. \index{integration}
  10. When the \name{algint} switch is on, the algebraic integration module (which
  11. must be loaded from the REDUCE library) is used for integration.
  12. \begin{Comments}
  13. Loading \name{algint} from the library automatically turns on the
  14. \name{algint} switch. An error message will be given if \name{algint} is
  15. turned on when the \name{algint} has not been loaded from the library.
  16. \end{Comments}
  17. \end{Switch}
  18. \begin{Switch}{ALLBRANCH}
  19. When \name{allbranch} is on, the operator \nameref{solve} selects all
  20. branches of solutions.
  21. When \name{allbranch} is off, it selects only the principal
  22. branches. Default is \name{on}.
  23. \begin{Examples}
  24. solve(log(sin(x+3)),x); &
  25. \begin{multilineoutput}{6cm}
  26. \{X=2*ARBINT(1)*PI - ASIN(1) - 3,
  27. X=2*ARBINT(1)*PI + ASIN(1) + PI - 3\}
  28. \end{multilineoutput}\\
  29. off allbranch; \\
  30. solve(log(sin(x+3)),x); &
  31. {X=ASIN(1) - 3}
  32. \end{Examples}
  33. \begin{Comments}
  34. \nameref{arbint}(1) indicates an arbitrary integer, which is given a
  35. unique identifier by REDUCE, showing that there are infinitely many
  36. solutions of this type. When \name{allbranch} is off, the single
  37. canonical solution is given.
  38. \end{Comments}
  39. \end{Switch}
  40. \begin{Switch}{ALLFAC}
  41. \index{output}
  42. The \name{allfac} switch, when on, causes REDUCE to factor out automatically
  43. common products in the output of expressions. Default is \name{on}.
  44. \begin{Examples}
  45. x + x*y**3 + x**2*cos(z); & X*(COS(Z)*X + Y^{3} + 1) \\
  46. off allfac; \\
  47. x + x*y**3 + x**2*cos(z); & COS(Z)*X^{2} + X*Y^{3} + X
  48. \end{Examples}
  49. \begin{Comments}
  50. The \name{allfac} switch has no effect when \name{pri} is off. Although the
  51. switch setting stays as it was, printing behavior is as if it were off.
  52. \end{Comments}
  53. \end{Switch}
  54. % \begin{Switch}{ALLPREC}
  55. %
  56. % \end{Switch}
  57. %
  58. %
  59. \begin{Switch}{ARBVARS}
  60. \index{solve}
  61. When \name{arbvars} is on, the solutions of singular or underdetermined
  62. systems of equations are presented in terms of arbitrary complex variables
  63. (see \nameref{arbcomplex}). Otherwise, the solution is parametrized in
  64. terms of some of the input variables. Default is \name{on}.
  65. \begin{Examples}
  66. solve({2x + y,4x + 2y},{x,y}); &
  67. \{\{x= - \rfrac{arbcomplex(1)}{2},y=arbcomplex(1)\}\} \\
  68. solve({sqrt(x)+ y**3-1},{x,y}); &
  69. \{\{y=arbcomplex(2),x=y^6 - 2*y^3 + 1\}\} \\
  70. off arbvars; \\
  71. solve({2x + y,4x + 2y},{x,y}); &
  72. \{\{x= - \rfrac{y}{2}\}\} \\
  73. solve({sqrt(x)+ y**3-1},{x,y}); &
  74. \{\{x=y^6 - 2*y^3 + 1\}\} \\
  75. \end{Examples}
  76. \begin{Comments}
  77. With \name{arbvars} off, the return value \name{\{\{\}\}} means that the
  78. equations given to \nameref{solve} imply no relation among the input
  79. variables.
  80. \end{Comments}
  81. \end{Switch}
  82. \begin{Switch}{BALANCED\_MOD}
  83. \index{modular}
  84. \nameref{modular} numbers are normally produced in the range [0,...\meta{n}),
  85. where
  86. \meta{n} is the current modulus. With \name{balanced\_mod} on, the range
  87. [-\meta{n}/2,\meta{n}/2], or more precisely
  88. [-floor((\meta{n}-1)/2), ceiling((\meta{n}-1)/2)], is used instead.
  89. \begin{Examples}
  90. setmod 7; & 1 \\
  91. on modular; \\
  92. 4; & 4 \\
  93. on balanced_mod; \\
  94. 4; & -3
  95. \end{Examples}
  96. \end{Switch}
  97. \begin{Switch}{BFSPACE}
  98. \index{output}\index{floating point}
  99. Floating point numbers are normally printed in a compact notation (either
  100. fixed point or in scientific notation if \nameref{SCIENTIFIC\_NOTATION}
  101. has been used). In some (but not all) cases, it helps comprehensibility
  102. if spaces are inserted in the number at regular intervals. The switch
  103. \name{bfspace}, if on, will cause a blank to be inserted in the number after
  104. every five characters.
  105. \begin{Examples}
  106. on rounded; \\
  107. 1.2345678; & 1.2345678 \\
  108. on bfspace; \\
  109. 1.2345678; & 1.234 5678
  110. \end{Examples}
  111. \begin{Comments}
  112. \name{bfspace} is normally off.
  113. \end{Comments}
  114. \end{Switch}
  115. \begin{Switch}{COMBINEEXPT}
  116. \index{exponent simplification}
  117. REDUCE is in general poor at surd simplification. However, when the
  118. switch \name{combineexpt} is on, the system attempts to combine
  119. exponentials whenever possible.
  120. \begin{TEX}
  121. \begin{Examples}
  122. 3^(1/2)*3^(1/3)*3^(1/6); & SQRT(3)*3^{\rfrac{1}{3}}*3^{\rfrac{1}{6}} \\
  123. on combineexpt; \\
  124. ws; & 3
  125. \end{Examples}
  126. \end{TEX}
  127. \begin{INFO}
  128. {\begin{Examples}
  129. 3^(1/2)*3^(1/3)*3^(1/6); & SQRT(3)*3^{1/3}*3^{1/6} \\
  130. on combineexpt; \\
  131. ws; & 1
  132. \end{Examples}}
  133. \end{INFO}
  134. \end{Switch}
  135. \begin{Switch}{COMBINELOGS}
  136. \index{logarithm}
  137. In many cases it is desirable to expand product arguments of logarithms,
  138. or collect a sum of logarithms into a single logarithm. Since these are
  139. inverse operations, it is not possible to provide rules for doing both at
  140. the same time and preserve the REDUCE concept of idempotent evaluation.
  141. As an alternative, REDUCE provides two switches \nameref{expandlogs} and
  142. \name{combinelogs} to carry out these operations.
  143. \begin{Examples}
  144. on expandlogs; \\
  145. log(x*y); & LOG(X) + LOG(Y) \\
  146. on combinelogs; \\
  147. ws; & LOG(X*Y)
  148. \end{Examples}
  149. \begin{Comments}
  150. At the present time, it is possible to have both switches on at once,
  151. which could lead to infinite recursion. However, an expression is
  152. switched from one form to the other in this case. Users should not rely
  153. on this behavior, since it may change in the next release.
  154. \end{Comments}
  155. \end{Switch}
  156. \begin{Switch}{COMP}
  157. \index{compiler}
  158. When \name{comp} is on, any succeeding function definitions are compiled
  159. into a faster-running form. Default is \name{off}.
  160. \begin{Examples}
  161. \explanation{The following procedure finds Fibonacci numbers recursively.
  162. Create a new file ``refib" in your current directory with the following
  163. lines in it:} \\[6mm]
  164. \begin{multilineinput}
  165. procedure refib(n);
  166. if fixp n and n >= 0 then
  167. if n <= 1 then 1
  168. else refib(n-1) + refib(n-2)
  169. else rederr "nonnegative integer only";
  170. end;
  171. \end{multilineinput}\\
  172. \explanation{Now load REDUCE and run the following:}\\
  173. on time; & Time: 100 ms \\
  174. in "refib"$ & Time: 0 ms \\
  175. & REFIB \\
  176. & Time: 260 ms \\
  177. & Time: 20 ms \\
  178. refib(80); & 37889062373143906 \\
  179. & Time: 14840 ms \\
  180. on comp; & Time: 80 ms \\
  181. in "refib"$ & Time: 20 ms \\
  182. & REFIB \\
  183. & Time: 640 ms \\
  184. refib(80); & 37889062373143906 \\
  185. & Time: 10940 ms
  186. \end{Examples}
  187. \begin{Comments}
  188. Note that the compiled procedure runs faster. Your time messages will
  189. differ depending upon which system you have. Compiled functions remain so
  190. for the duration of the REDUCE session, and are then lost. They must be
  191. recompiled if wanted in another session. With the switch \nameref{time} on
  192. as shown above, the CPU time used in executing the command is returned in
  193. milliseconds. Be careful not to leave \name{comp} on unless you want it,
  194. as it makes the processing of procedures much slower.
  195. \end{Comments}
  196. \end{Switch}
  197. \begin{Switch}{COMPLEX}
  198. \index{complex}
  199. When the \name{complex} switch is on, full complex arithmetic is used in
  200. simplification, function evaluation, and factorization. Default is \name{off}.
  201. \begin{Examples}
  202. factorize(a**2 + b**2); & \{\{A^{2} + B^{2},1\}\} \\
  203. on complex; \\
  204. factorize(a**2 + b**2); & \{\{A + I*B,1\},\{A - I*B,1\}\} \\
  205. (x**2 + y**2)/(x + i*y); & X - I*Y \\
  206. on rounded; &
  207. *** Domain mode COMPLEX changed to COMPLEX\_FLOAT \\
  208. sqrt(-17); & 4.12310562562*I \\
  209. log(7*i); & 1.94591014906 + 1.57079632679*I
  210. \end{Examples}
  211. \begin{Comments}
  212. Complex floating-point can be done by turning on \nameref{rounded} in
  213. addition to \name{complex}. With \name{complex} off however, REDUCE knows
  214. that \IFTEX{$i$}{i} is the square root of \IFTEX{$-1$}{-1} but will not
  215. carry out more complicated complex operations. If you want complex
  216. denominators cleared by multiplication by their conjugates, turn on the
  217. switch \nameref{rationalize}.
  218. \end{Comments}
  219. \end{Switch}
  220. \begin{Switch}{CREF}
  221. \index{cross reference}
  222. The switch \name{cref} invokes the CREF cross-reference program that
  223. processes a set of procedure definitions to produce a summary of their
  224. entry points, undefined procedures, non-local variables and so on. The
  225. program will also check that procedures are called with a consistent
  226. number of arguments, and print a diagnostic message otherwise.
  227. The output is alphabetized on the first seven characters of each function
  228. name.
  229. To invoke the cross-reference program, \name{cref} is first turned on.
  230. This causes the program to load and the cross-referencing process to
  231. begin. After all the required definitions are loaded, turning \name{cref}
  232. off will cause a cross-reference listing to be produced.
  233. \begin{Comments}
  234. Algebraic procedures in REDUCE are treated as if they were symbolic, so
  235. that algebraic constructs will actually appear as calls to symbolic
  236. functions, such as \name{aeval}.
  237. \end{Comments}
  238. \end{Switch}
  239. \begin{Switch}{CRAMER}
  240. \index{matrix}\index{linear system}\index{solve}
  241. When the \name{cramer} switch is on, \nameref{matrix} inversion
  242. and linear equation
  243. solving (operator \nameref{solve}) is done by Cramer's rule, through exterior
  244. multiplication. Default is \name{off}.
  245. \begin{Examples}
  246. on time; & Time: 80 ms \\
  247. off output; & Time: 100 ms \\[4mm]
  248. \begin{multilineinput}
  249. mm := mat((a,b,c,d,f),(a,a,c,f,b),(b,c,a,c,d), (c,c,a,b,f),
  250. (d,a,d,e,f));
  251. \end{multilineinput} & Time: 300 ms \\
  252. inverse := 1/mm; & Time: 18460 ms \\
  253. on cramer; & Time: 80 ms \\
  254. cramersinv := 1/mm; & Time: 9260 ms
  255. \end{Examples}
  256. \begin{Comments}
  257. Your time readings will vary depending on the REDUCE version you use.
  258. After you invert the matrix, turn on \nameref{output} and ask for one of
  259. the elements of the inverse matrix, such as \name{cramersinv(3,2)}, so that
  260. you can see the size of the expressions produced.
  261. Inversion of matrices and the solution of linear equations with dense
  262. symbolic entries in many variables is generally considerably faster with
  263. \name{cramer} on. However, inversion of numeric-valued matrices is
  264. slower. Consider the matrices you're inverting before deciding whether to
  265. turn \name{cramer} on or off. A substantial portion of the time in matrix
  266. inversion is given to formatting the results for printing. To save this
  267. time, turn \name{output} off, as shown in this example or terminate the
  268. expression with a dollar sign instead of a semicolon. The results are
  269. still available to you in the workspace associated with your prompt
  270. number, or you can assign them to an identifier for further use.
  271. \end{Comments}
  272. \end{Switch}
  273. \begin{Switch}{DEFN}
  274. \index{lisp}
  275. When the switch \name{defn} is on, the Standard Lisp equivalent of the
  276. input statement or procedure is printed, but not evaluated. Default is
  277. \name{off}.
  278. \begin{Examples}
  279. on defn; \\
  280. 17/3; & (AEVAL (LIST 'QUOTIENT 17 3)) \\
  281. df(sin(x),x,2);
  282. & (AEVAL (LIST 'DF (LIST 'SIN 'X) 'X 2)) \\
  283. \begin{multilineinput}
  284. procedure coshval(a);
  285. begin scalar g;
  286. g := (exp(a) + exp(-a))/2;
  287. return g
  288. end;
  289. \end{multilineinput} &
  290. \begin{multilineoutput}{7cm}
  291. (AEVAL
  292. (PROGN
  293. (FLAG '(COSHVAL) 'OPFN)
  294. (DE COSHVAL (A)
  295. (PROG (G)
  296. (SETQ G
  297. (AEVAL
  298. (LIST
  299. 'QUOTIENT
  300. (LIST
  301. 'PLUS
  302. (LIST 'EXP A)
  303. (LIST 'EXP (LIST 'MINUS A)))
  304. 2)))
  305. (RETURN G)))) )
  306. \end{multilineoutput} \\
  307. coshval(1); & (AEVAL (LIST 'COSHVAL 1)) \\
  308. off defn; \\
  309. coshval(1); & Declare COSHVAL operator? (Y or N) \\
  310. n \\
  311. \begin{multilineinput}
  312. procedure coshval(a);
  313. begin scalar g;
  314. g := (exp(a) + exp(-a))/2;
  315. return g
  316. end;
  317. \end{multilineinput} & COSHVAL \\
  318. on rounded; \\
  319. coshval(1); & 1.54308063482
  320. \end{Examples}
  321. \begin{Comments}
  322. The above function \name{coshval} finds the hyperbolic cosine (cosh) of its
  323. argument. When \name{defn} is on, you can see the Standard Lisp equivalent
  324. of the function, but it is not entered into the system as shown by the
  325. message \name{Declare COSHVAL operator?}. It must be reentered with
  326. \name{defn} off to be recognized. This procedure is used as an example; a
  327. more efficient procedure would eliminate the unnecessary local variable
  328. with
  329. \begin{verbatim}
  330. procedure coshval(a);
  331. (exp(a) + exp(-a))/2;
  332. \end{verbatim}
  333. \end{Comments}
  334. \end{Switch}
  335. \begin{Switch}{DEMO}
  336. \index{interactive}\index{output}
  337. The \name{demo} switch is used for interactive files, causing the system
  338. to pause after each command in the file until you type a \key{Return}.
  339. Default is \name{off}.
  340. \begin{Comments}
  341. The switch \name{demo} has no effect on top level interactive
  342. statements. Use it when you want to slow down operations in a file so
  343. you can see what is happening.
  344. You can either include the \name{on demo} command in the file, or enter
  345. it from the top level before bringing in any file. Unlike the
  346. \nameref{pause} command, \name{on demo} does not permit you to interrupt
  347. the file for questions of your own.
  348. \end{Comments}
  349. \end{Switch}
  350. \begin{Switch}{DFPRINT}
  351. \index{output}\index{derivative}
  352. When \name{dfprint} is on, expressions in the differentiation operator
  353. \nameref{df} are printed in a more ``natural'' notation, with the
  354. differentiation variables appearing as subscripts. In addition, if the
  355. switch \nameref{noarg} is on (the default), the arguments of the
  356. differentiated operator are suppressed.
  357. \begin{Examples}
  358. operator f; \\
  359. df(f x,x); & DF(F(X),X); \\
  360. on dfprint; \\
  361. ws; & F_{X} \\
  362. df(f(x,y),x,y); & F_{X}_{,}_{Y} \\
  363. off noarg; \\
  364. ws; & F(X,Y)_{X}
  365. \end{Examples}
  366. \end{Switch}
  367. \begin{Switch}{DIV}
  368. \index{output}
  369. When \name{div} is on, the system divides any simple factors found in
  370. the denominator of an expression into the numerator. Default is \name{off}.
  371. \begin{Examples}
  372. on div; \\
  373. a := x**2/y**2; & A := X^{2} *Y^{-2} \\
  374. b := a/(3*z); & B := \rfrac{1}{3}*X^{2} *Y^{-2} *Z^{-1} \\
  375. off div; \\
  376. a; & \rfrac{X^{2}}{Y^{2}}\\
  377. b; & \rfrac{X^{2}}{3*Y^{2} *Z}
  378. \end{Examples}
  379. \begin{Comments}
  380. The \name{div} switch only has effect when the \nameref{pri} switch is on.
  381. When \name{pri} is off, regardless of the setting of \name{div}, the
  382. printing behavior is as if \name{div} were off.
  383. \end{Comments}
  384. \end{Switch}
  385. \begin{Switch}{ECHO}
  386. \index{output}
  387. The \name{echo} switch is normally off for top-level entry, and on when files
  388. are brought in. If \name{echo} is turned on at the top level, your input
  389. statements are echoed to the screen (thus appearing twice). Default
  390. \name{off} (but note default \name{on} for files).
  391. \begin{Comments}
  392. If you want to display certain portions of a file and not others, use the
  393. commands \name{off echo} and \name{on echo} inside the file. If you want
  394. no display of the file, use the input command
  395. \name{in} {\em filename}\name{\$}
  396. rather than using the semicolon delimiter.
  397. Be careful when you use commands within a file to generate another file.
  398. Since \name{echo} is on for files, the output file echoes input statements
  399. (unlike its behavior from the top level). You should explicitly turn off
  400. \name{echo} when writing output, and turn it back on when you're done.
  401. \end{Comments}
  402. \end{Switch}
  403. \begin{Switch}{ERRCONT}
  404. \index{error handling}
  405. When the \name{errcont} switch is on, error conditions do not stop file
  406. execution. Error messages will be printed whether \name{errcont} is on or
  407. off.
  408. Default is \name{off}.
  409. \begin{Comments}
  410. \begin{TEX}
  411. The table below shows REDUCE behavior under the settings of \name{errcont} and
  412. \name{int} :
  413. \begin{center}
  414. \begin{tabular}{|l|l|p{9.5cm}|}
  415. \hline
  416. \multicolumn{3}{|c|}{Behavior in Case of Error in Files}\\
  417. \hline
  418. \multicolumn{1}{|c|}{errcont} &
  419. \multicolumn{1}{c|}{int} &
  420. \multicolumn{1}{c|}{Behavior when errors in files are encountered}\\
  421. \hline
  422. off & off &
  423. Message is printed and parsing continues, but no further statements are
  424. executed; no commands from keyboard accepted except \verb|bye| or
  425. \verb|end| \\
  426. off & on &
  427. Message is printed, and you are asked if you wish to continue. (This is the
  428. default behavior) \\
  429. on & off &
  430. Message is printed, and file continues to execute without pause \\
  431. on & on &
  432. Message is printed, and file continues to execute without pause\\
  433. \hline
  434. \end{tabular}
  435. \end{center}
  436. \end{TEX}
  437. \begin{INFO}
  438. The following describes what happens when an error occurs in a file under
  439. each setting of \name{errcont} and \name{int}:
  440. Both off: Message is printed and parsing continues, but no further
  441. statements are executed; no commands from keyboard accepted except bye or
  442. end;
  443. \name{errcont} off, \name{int} on: Message is printed, and you are asked
  444. if you wish to continue. (This is the default behavior);
  445. \name{errcont} on, \name{int} off: Message is printed, and file continues
  446. to execute without pause;
  447. Both on: Message is printed, and file continues to execute without pause.
  448. \end{INFO}
  449. \end{Comments}
  450. \end{Switch}
  451. \begin{Switch}{EVALLHSEQP}
  452. \index{equation}
  453. Under normal circumstances, the right-hand-side of an \nameref{equation}
  454. is evaluated but not the left-hand-side. This also applies to any
  455. substitutions made by the \nameref{sub} operator. If both sides are to be
  456. evaluated, the switch \name{evallhseqp} should be turned on.
  457. \end{Switch}
  458. \begin{Switch}{EXP}
  459. \index{simplification}
  460. When the \name{exp} switch is on, powers and products of expressions are
  461. expanded. Default is \name{on}.
  462. \begin{Examples}
  463. (x+1)**3; & X^{3} + 3*X^{2} + 3*X + 1 \\
  464. (a + b*i)*(c + d*i); & A*C + A*D*I + B*C*I - B*D \\
  465. off exp; \\
  466. (x+1)**3; & (X + 1)^{3} \\
  467. (a + b*i)*(c + d*i); & (A + B*I)*(C + D*I) \\
  468. length((x+1)**2/(y+1)); & 2
  469. \end{Examples}
  470. \begin{Comments}
  471. Note that REDUCE knows that \IFTEX{$i^2 = -1$}{i^2 = -1}.
  472. When \name{exp} is off, equivalent expressions may not simplify to the same
  473. form, although zero expressions still simplify to zero. Several operators
  474. that expect a polynomial argument behave differently when \name{exp} is
  475. off, such as \nameref{length}. Be cautious about leaving \name{exp} off.
  476. \end{Comments}
  477. \end{Switch}
  478. \begin{Switch}{EXPANDLOGS}
  479. \index{logarithm}
  480. In many cases it is desirable to expand product arguments of logarithms,
  481. or collect a sum of logarithms into a single logarithm. Since these are
  482. inverse operations, it is not possible to provide rules for doing both at
  483. the same time and preserve the REDUCE concept of idempotent evaluation.
  484. As an alternative, REDUCE provides two switches \name{expandlogs} and
  485. \nameref{combinelogs} to carry out these operations. Both are off by default.
  486. \begin{Examples}
  487. on expandlogs; \\
  488. log(x*y); & LOG(X) + LOG(Y) \\
  489. on combinelogs; \\
  490. ws; & LOG(X*Y)
  491. \end{Examples}
  492. \begin{Comments}
  493. At the present time, it is possible to have both switches on at once,
  494. which could lead to infinite recursion. However, an expression is
  495. switched from one form to the other in this case. Users should not rely
  496. on this behavior, since it may change in the next release.
  497. \end{Comments}
  498. \end{Switch}
  499. \begin{Switch}{EZGCD}
  500. \index{greatest common divisor}\index{polynomial}
  501. When \name{ezgcd} and \nameref{gcd} are on, greatest common divisors are
  502. computed using the EZ GCD algorithm that uses modular arithmetic (and is
  503. usually faster). Default is \name{off}.
  504. \begin{Comments}
  505. As a side effect of the gcd calculation, the expressions involved are
  506. factored, though not the heavy-duty factoring of \nameref{factorize}. The
  507. EZ GCD algorithm was introduced in a paper by J. Moses and D.Y.Y. Yun in
  508. \meta{Proceedings of the ACM}, 1973, pp. 159-166.
  509. Note that the \nameref{gcd} switch must also be on for \name{ezgcd} to have
  510. effect.
  511. \end{Comments}
  512. \end{Switch}
  513. \begin{Switch}{FACTOR}
  514. \index{output}
  515. When the \name{factor} switch is on, input expressions and results are
  516. automatically factored.
  517. \begin{Examples}
  518. on factor; \\
  519. aa := 3*x**3*a + 6*x**2*y*a + 3*x**3*b + 6*x**2*y*b\\
  520. + x*y*a + 2*y**2*a + x*y*b + 2*y**2*b;
  521. & AA := (A + B)*(3*X^{2} + Y)*(X + 2*Y) \\
  522. off factor; \\
  523. aa; &
  524. 3*A*X^{3} + 6*A*X^{2}*Y + A*X*Y + 2*A*Y^{2} + 3*B*X^{3} + 6*B*X^{2}*Y\\
  525. + B*X*Y + 2*B*Y^{2} \\
  526. on factor; \\
  527. ab := x**2 - 2; & AB := X^{2} - 2
  528. \end{Examples}
  529. \begin{Comments}
  530. REDUCE factors univariate and multivariate polynomials with
  531. integer coefficients, finding any factors that also have integer coefficients.
  532. The factoring is done by reducing multivariate problems to univariate
  533. ones with symbolic coefficients, and then solving the univariate ones modulo
  534. small primes. The results of these calculations are merged to
  535. determine the factors of the original polynomial. The factorizer normally
  536. selects evaluation points and primes using a random number generator.
  537. Thus, the detailed factoring behavior may be different each time any
  538. particular problem is tackled.
  539. When the \name{factor} switch is turned on, the \nameref{exp} switch is
  540. turned off, and when the \name{factor} switch is turned off, the
  541. \nameref{exp} switch is turned on, whether it was on previously or not.
  542. When the switch \nameref{trfac} is on, informative messages are generated at
  543. each call to the factorizer. The \nameref{trallfac} switch causes the
  544. production of a more verbose trace message. It takes precedence over
  545. \name{trfac} if they are both on.
  546. To factor a polynomial explicitly and store the results, use the operator
  547. \nameref{factorize}.
  548. \end{Comments}
  549. \end{Switch}
  550. \begin{Switch}{FAILHARD}
  551. \index{integration}
  552. When the \name{failhard} switch is on, the integration operator \nameref{int}
  553. terminates with an error message if the integral cannot be done in closed
  554. terms.
  555. Default is off.
  556. \begin{Comments}
  557. Use the \name{failhard} switch when you are dealing with complicated integrals
  558. and want to know immediately if REDUCE was unable to handle them. The
  559. integration operator sometimes returns a formal integration form that is
  560. more complicated than the original expression, when it is unable to
  561. complete the integration.
  562. \end{Comments}
  563. \end{Switch}
  564. \begin{Switch}{FORT}
  565. \index{FORTRAN}
  566. When \name{fort} is on, output is given Fortran-compatible syntax. Default
  567. is \name{off}.
  568. \begin{Examples}
  569. on fort; \\
  570. df(sin(7*x + y),x); & ANS=7.*COS(7*X+Y) \\
  571. on rounded; \\
  572. b := log(sin(pi/5 + n*pi)); &
  573. B=LOG(SIN(3.14159265359*N+0.628318530718))
  574. \end{Examples}
  575. \begin{Comments}
  576. REDUCE results can be written to a file (using \nameref{out}) and used as data
  577. by Fortran programs when \name{fort} is in effect. \name{fort} knows about
  578. correct statement length, continuation characters, defining a symbol when
  579. it is first used, and other Fortran details.
  580. The \nameref{GENTRAN} package offers many more possibilities than the
  581. \name{fort} switch. It produces Fortran (or C or Ratfor) code from REDUCE
  582. procedures or structured specifications, including facilities for producing
  583. double precision output.
  584. \end{Comments}
  585. \end{Switch}
  586. \begin{Switch}{FORTUPPER}
  587. \index{FORTRAN}
  588. When \name{fortupper} is on, any Fortran-style output appears in upper case.
  589. Default is \name{off}.
  590. \begin{Examples}
  591. on fort; \\
  592. df(sin(7*x + y),x); & ans=7.*cos(7*x+y) \\
  593. on fortupper; \\
  594. df(sin(7*x + y),x); & ANS=7.*COS(7*X+Y) \\
  595. \end{Examples}
  596. \end{Switch}
  597. \begin{Switch}{FULLPREC}
  598. \index{precision}\index{rounded}
  599. Trailing zeroes of rounded numbers to the full system precision are
  600. normally not printed. If this information is needed, for example to get a
  601. more understandable indication of the accuracy of certain data, the switch
  602. \name{fullprec} can be turned on.
  603. \begin{Examples}
  604. on rounded; \\
  605. 1/2; & 0.5 \\
  606. on fullprec; \\
  607. ws; & 0.500000000000
  608. \end{Examples}
  609. \begin{Comments}
  610. This is just an output options which neither influences
  611. the accuracy of the computation nor does it give additional
  612. information about the precision of the results.
  613. See also \nameref{scientific_notation}.
  614. \end{Comments}
  615. \end{Switch}
  616. \begin{Switch}{FULLROOTS}
  617. \index{solve}\index{polynomial}
  618. Since roots of cubic and quartic polynomials can often be very
  619. messy, a switch \name{fullroots} controls the production
  620. of results in closed form. \nameref{solve} will apply the
  621. formulas for explicit forms for degrees 3 and 4 only if
  622. \name{fullroots} is \name{on}. Otherwise the result forms
  623. are built using \nameref{root\_of}. Default is \name{off}.
  624. \end{Switch}
  625. \begin{Switch}{GC}
  626. \index{memory}
  627. With the \name{gc} switch, you can turn the garbage collection messages on
  628. or off. The form of the message depends on the particular Lisp used for
  629. the REDUCE implementation.
  630. \begin{Comments}
  631. See \nameref{reclaim} for an explanation of garbage collection. REDUCE does
  632. garbage collection when needed even if you have turned the notices off.
  633. \end{Comments}
  634. \end{Switch}
  635. \begin{Switch}{GCD}
  636. \index{greatest common divisor}\index{rational expression}
  637. When \name{gcd} is on, common factors in numerators and denominators of
  638. expressions are canceled. Default is \name{off}.
  639. \begin{Examples}
  640. \begin{multilineinput}
  641. (2*(f*h)**2 - f**2*g*h - (f*g)**2 - f*h**3 + f*h*g**2
  642. - h**4 + g*h**3)/(f**2*h - f**2*g - f*h**2 + 2*f*g*h
  643. - f*g**2 - g*h**2 + g**2*h);
  644. \end{multilineinput} &
  645. \rfrac{F^{2}*G^{2} + F^{2}*G*H - 2*F^{2}*H^{2} - F*G^{2}*H + F*H^{3} - G*H^{3} +
  646. H^{4}}
  647. {F^{2}*G - F^{2}*H + F*G^{2} - 2*F*G*H + F*H^{2} - G^{2}*H + G*H^{2}} \\
  648. on gcd; \\
  649. ws; & \rfrac{F*G + 2*F*H + H^{2}}{F + G} \\
  650. e2 := a*c + a*d + b*c + b*d; & E2 := A*C + A*D + B*C + B*D \\
  651. off exp; \\
  652. e2; & (A + B)*(C + D)
  653. \end{Examples}
  654. \begin{Comments}
  655. Even with \name{gcd} off, a check is automatically made for common variable
  656. and numerical products in the numerators and denominators of expression,
  657. and the appropriate cancellations made. Thus the example demonstrating the
  658. use of \name{gcd} is somewhat complicated. Note when \nameref{exp} is off,
  659. \name{gcd} has the side effect of factoring the expression.
  660. \end{Comments}
  661. \end{Switch}
  662. \begin{Switch}{HORNER}
  663. \index{output}\index{polynomial}
  664. When the \name{horner} switch is on, polynomial expressions are printed
  665. in Horner's form for faster and safer numerical evaluation. Default
  666. is \name{off}. The leading variable of the expression is selected as
  667. Horner variable. To select the Horner variable explicitly use the
  668. \nameref{korder} declaration.
  669. \begin{Examples}
  670. on horner;\\
  671. (13p-4q)^3;&
  672. ( - 64)*q^3 + p*(624*q^2 + p*(( - 2028)*q + p*2197))\\
  673. korder q;\\
  674. ws;&
  675. 2197*p^3 + q*(( - 2028)*p^2 + q*(624*p + q*(-64)))
  676. \end{Examples}
  677. \end{Switch}
  678. \begin{Switch}{IFACTOR}
  679. \index{integer}\index{factorize}
  680. When the \name{ifactor} switch is on, any integer terms appearing as a result
  681. of the \nameref{factorize} command are factored themselves into primes. Default
  682. is \name{off}. If the argument of \name{factorize} is an integer,
  683. \name{ifactor} has no effect, since the integer is always factored.
  684. \begin{Examples}
  685. factorize(4*x**2 + 28*x + 48); & \{\{4,1\},\{X + 4,1\},\{X + 3,1\}\} \\
  686. factorize(22587); & \{\{3,1\},\{7529,1\}\} \\
  687. on ifactor; \\
  688. factorize(4*x**2 + 28*x + 48); & \{\{2,2\},\{X + 4,1\},\{X + 3,1\}\} \\
  689. factorize(22587); & \{\{3,1\},\{7529,1\}\} \\
  690. \end{Examples}
  691. \begin{Comments}
  692. Constant terms that appear within nonconstant
  693. polynomial factors are not factored.
  694. The \name{ifactor} switch affects only factoring done specifically
  695. with \nameref{factorize}, not on factoring done automatically when the
  696. \nameref{factor} switch is on.
  697. \end{Comments}
  698. \end{Switch}
  699. \begin{Switch}{INT}
  700. \index{interactive}
  701. The \name{int} switch specifies an interactive mode of operation. Default
  702. \name{on}.
  703. \begin{Comments}
  704. There is no reason to turn \name{int} off during interactive calculations,
  705. since there are no benefits to be gained. If you do have \name{int} off
  706. while inputting a file, and REDUCE finds an error, it prints the message
  707. ``Continuing with parsing only." In this state, REDUCE accepts only
  708. \nameref{end}\name{;} or \nameref{bye}\name{;} from the keyboard;
  709. everything else is ignored, even the command \name{on int}.
  710. \end{Comments}
  711. \end{Switch}
  712. \begin{Switch}{INTSTR}
  713. \index{output}
  714. If \name{intstr} (for ``internal structure'') is on, arguments of an
  715. operator are printed in a more structured form.
  716. \begin{Examples}
  717. operator f; \\
  718. f(2x+2y); & F(2*X + 2*Y) \\
  719. on intstr; \\
  720. ws; & F(2*(X + Y))
  721. \end{Examples}
  722. \end{Switch}
  723. \begin{Switch}{LCM}
  724. \index{rational expression}
  725. The \name{lcm} switch instructs REDUCE to compute the least common multiple
  726. of denominators whenever rational expressions occur. Default is \name{on}.
  727. \begin{Examples}
  728. off lcm; \\
  729. z := 1/(x**2 - y**2) + 1/(x-y)**2;
  730. & Z := \rfrac{2*X*(X - Y)}{X^{4} - 2*X^{3}*Y +
  731. 2*X*Y^{3} - Y^{4}} \\
  732. on lcm; \\
  733. z; & \rfrac{2*X*(X - Y)}{X^{4} - 2*X^{3}*Y + 2*X*Y
  734. ^{3} - Y^{4}} \\
  735. zz := 1/(x**2 - y**2) + 1/(x-y)**2;
  736. & ZZ := \rfrac{2*X}{X^{3} - X^{2}*Y - X*Y^{2} +
  737. Y^{3}} \\
  738. on gcd; \\
  739. z; & \rfrac{2*X}{X^{3} - X^{2}*Y - X*Y^{2} + Y^{3}
  740. }
  741. \end{Examples}
  742. \begin{Comments}
  743. Note that \name{lcm} has effect only when rational expressions are first
  744. combined. It does not examine existing structures for simplifications on
  745. display. That is shown above when \IFTEX{$z$}{z} is entered with
  746. \name{lcm} off. It remains unsimplified even after \name{lcm} is turned
  747. back on. However, a new variable containing the same expression is
  748. simplified on entry. The switch \nameref{gcd} does examine existing
  749. structures, as shown in the last example line above.
  750. Full greatest common divisor calculations become expensive if work with
  751. large rational expressions is required. A considerable savings of time
  752. can be had if a full gcd check is made only when denominators are combined,
  753. and only a partial check for numerators. This is the effect of the \name{lcm}
  754. switch.
  755. \end{Comments}
  756. \end{Switch}
  757. \begin{Switch}{LESSSPACE}
  758. \index{output}
  759. You can turn on the switch \name{lessspace} if you want fewer
  760. blank lines in your output.
  761. \end{Switch}
  762. \begin{Switch}{LIMITEDFACTORS}
  763. \index{factorize}\index{polynomial}
  764. To get limited factorization in cases where it is too expensive to use
  765. full multivariate polynomial factorization, the switch
  766. \name{limitedfactors} can be turned on. In that case, only ``inexpensive''
  767. factoring operations, such as square-free factorization, will be used
  768. when \nameref{factorize} is called.
  769. \begin{Examples}
  770. a := (y-x)^2*(y^3+2x*y+5)*(y^2-3x*y+7)$ \\
  771. factorize a; &
  772. \begin{multilineoutput}{7cm}
  773. \{- 3*X*Y + Y^{2} + 7,1\}
  774. \{2*X*Y + Y^{3} + 5,1\},
  775. \{X - Y,2\}\}
  776. \end{multilineoutput} \\
  777. on limitedfactors; \\
  778. factorize a; &
  779. \begin{multilineoutput}{7cm}
  780. \{- 6*X^{2}*Y^{2} - 3*X*Y^{4} + 2*X*Y^{3} - X*Y + Y^{5} + 7*Y^{3} + 5*Y^{2} + 35,1\},
  781. \{X - Y,2\}\}
  782. \end{multilineoutput}
  783. \end{Examples}
  784. \end{Switch}
  785. \begin{Switch}{LIST}
  786. The \name{list} switch causes REDUCE to print each term in any sum on
  787. separate lines.
  788. \begin{Examples}
  789. x**2*(y**2 + 2*y) + x*(y**2 + z)/(2*a);
  790. & \rfrac{X*(2*A*X*Y^{2} + 4*A*X*Y + Y^{2} +
  791. Z)}{2*A} \\
  792. on list; \\
  793. ws; &
  794. \begin{multilineoutput}{6cm}
  795. (X*(2*A*X*Y^{2}
  796. + 4*A*X*Y
  797. + Y^{2}
  798. + Z))/(2*A)
  799. \end{multilineoutput}
  800. \end{Examples}
  801. \end{Switch}
  802. \begin{Switch}{LISTARGS}
  803. \index{list}\index{argument}\index{operator}
  804. If an operator other than those specifically defined for lists is given a
  805. single argument that is a list, then the result of this operation will be
  806. a list in which that operator is applied to each element of the list.
  807. This process can be inhibited globally by turning on the switch
  808. \name{listargs}.
  809. \begin{Examples}
  810. log {a,b,c}; & {LOG(A),LOG(B),LOG(C)} \\
  811. on listargs; \\
  812. log {a,b,c}; & LOG({A,B,C})
  813. \end{Examples}
  814. \begin{Comments}
  815. It is possible to inhibit such distribution for a specific operator by
  816. using the declaration \nameref{listargp}. In addition, if an operator has
  817. more than one argument, no such distribution occurs, so \name{listargs}
  818. has no effect.
  819. \end{Comments}
  820. \end{Switch}
  821. \begin{Switch}{MCD}
  822. \index{rational expression}
  823. When \name{mcd} is on, sums and differences of rational expressions are put
  824. on a common denominator. Default is \name{on}.
  825. \begin{Examples}
  826. a/(x+1) + b/5; & \rfrac{5*A + B*X + B}{5*(X + 1)} \\
  827. off mcd; \\
  828. a/(x+1) + b/5; & (X + 1)^{-1}*A + 1/5*B \\
  829. 1/6 + 1/7; & 13/42
  830. \end{Examples}
  831. \begin{Comments}
  832. Even with \name{mcd} off, rational expressions involving only numbers are still
  833. put over a common denominator.
  834. Turning \name{mcd} off is useful when explicit negative powers are needed,
  835. or if no greatest common divisor calculations are desired, or when
  836. differentiating complicated rational expressions. Results when \name{mcd}
  837. is off are no longer in canonical form, and expressions equivalent to zero
  838. may not simplify to 0. Some operations, such as factoring cannot be done
  839. while \name{mcd} is off. This option should therefore be used with some
  840. caution. Turning \name{mcd} off is most valuable in intermediate parts of
  841. a complicated calculation, and should be turned back on for the last stage.
  842. \end{Comments}
  843. \end{Switch}
  844. \begin{Switch}{MODULAR}
  845. \index{modular}
  846. When \name{modular} is on, polynomial coefficients are reduced by the
  847. modulus set by \nameref{setmod}. If no modulus has been set, \name{modular}
  848. has no effect.
  849. \begin{Examples}
  850. setmod 2; & 1 \\
  851. on modular; \\
  852. (x+y)**2; & X^{2} + Y^{2} \\
  853. 145*x**2 + 20*x**3 + 17 + 15*x*y;
  854. & X^{2} + X*Y + 1
  855. \end{Examples}
  856. \begin{Comments}
  857. Modular operations are only conducted on the coefficients, not the
  858. exponents. The modulus is not restricted to being prime. When the modulus
  859. is prime, division by a number not relatively prime to the modulus results
  860. in a \meta{Zero divisor} error message. When the modulus is a composite
  861. number, division by a power of the modulus results in an error message, but
  862. division by an integer which is a factor of the modulus does not.
  863. The representation of modular number can be influenced by
  864. \nameref{balanced\_mod}.
  865. \end{Comments}
  866. \end{Switch}
  867. \begin{Switch}{MSG}
  868. \index{output}
  869. When \name{msg} is off, the printing of warning messages is suppressed. Error
  870. messages are still printed.
  871. \begin{Comments}
  872. Warning messages include those about redimensioning an \nameref{array}
  873. or declaring an \nameref{operator} where one is expected.
  874. \end{Comments}
  875. \end{Switch}
  876. \begin{Switch}{MULTIPLICITIES}
  877. \index{solve}
  878. When \nameref{solve} is applied to a set of equations with multiple roots,
  879. solution multiplicities are normally stored in the global variable
  880. \nameref{root\_multiplicities} rather than the solution list. If you want
  881. the multiplicities explicitly displayed, the switch \name{multiplicities}
  882. should be turned on. In this case, \name{root_multiplicities} has no value.
  883. \begin{Examples}
  884. solve(x^2=2x-1,x); & {X=1} \\
  885. root_multiplicities; & {2} \\
  886. on multiplicities; \\
  887. solve(x^2=2x-1,x); & {X=1,X=1} \\
  888. root_multiplicities; &
  889. \end{Examples}
  890. \end{Switch}
  891. \begin{Switch}{NAT}
  892. \index{output}
  893. When \name{nat} is on, output is printed to the screen in natural form, with
  894. raised exponents. \name{nat} should be turned off when outputting expressions
  895. to a file for future input. Default is \name{on}.
  896. \begin{Examples}
  897. (x + y)**3; & X^{3} + 3*X^{2}*Y + 3*X*Y^{2} + Y^{3} \\
  898. off nat; \\
  899. (x + y)**3; & X**3 + 3*X**2*Y + 3*X*Y**2 + Y**3\$ \\
  900. on fort; \\
  901. (x + y)**3; & ANS=X**3+3.*X**2*Y+3.*X*Y**2+Y**3
  902. \end{Examples}
  903. \begin{Comments}
  904. With \name{nat} off, a dollar sign is printed at the end of each expression.
  905. An output file written with \name{nat} off is ready to be read into REDUCE
  906. using the command \nameref{in}.
  907. \end{Comments}
  908. \end{Switch}
  909. \begin{Switch}{NERO}
  910. \index{output}
  911. When \name{nero} is on, zero assignments (such as matrix elements) are not
  912. printed.
  913. \begin{Examples}
  914. matrix a;
  915. a := mat((1,0),(0,1)); & \begin{multilineoutput}{6cm}
  916. A(1,1) := 1
  917. A(1,2) := 0
  918. A(2,1) := 0
  919. A(2,2) := 1
  920. \end{multilineoutput}\\
  921. on nero; \\
  922. a; & \begin{multilineoutput}{6cm}
  923. MAT(1,1) := 1
  924. MAT(2,2) := 1
  925. \end{multilineoutput}\\
  926. a(1,2); & \explanationo{nothing is printed.} \\
  927. b := 0; & \explanationo{nothing is printed.} \\
  928. off nero; \\
  929. b := 0; & B := 0
  930. \end{Examples}
  931. \begin{Comments}
  932. \name{nero} is often used when dealing with large sparse matrices, to avoid
  933. being overloaded with zero assignments.
  934. \end{Comments}
  935. \end{Switch}
  936. \begin{Switch}{NOARG}
  937. \index{output}\index{derivative}
  938. When \nameref{dfprint} is on, expressions in the differentiation operator
  939. \nameref{df} are printed in a more ``natural'' notation, with the
  940. differentiation variables appearing as subscripts. When \name{noarg}
  941. is on (the default), the arguments of the differentiated operator are also
  942. suppressed.
  943. \begin{Examples}
  944. operator f; \\
  945. df(f x,x); & DF(F(X),X); \\
  946. on dfprint; \\
  947. ws; & F_{X} \\
  948. off noarg; \\
  949. ws; & F(X)_{X}
  950. \end{Examples}
  951. \end{Switch}
  952. \begin{Switch}{NOLNR}
  953. \index{integration}
  954. When \name{nolnr} is on, the linear properties of the integration operator
  955. \nameref{int} are suppressed if the integral cannot be found in closed terms.
  956. \begin{Comments}
  957. REDUCE uses the linear properties of integration to attempt to break down
  958. an integral into manageable pieces. If an integral cannot be found in
  959. closed terms, these pieces are returned. When the \name{nolnr} switch is off,
  960. as many of the pieces as possible are integrated. When it is on, if any piece
  961. fails, the rest of them remain unevaluated.
  962. \end{Comments}
  963. \end{Switch}
  964. %\begin{Switch}{NORNDBF}
  965. %
  966. %***** To be added *****
  967. %
  968. %\end{Switch}
  969. \begin{Switch}{NOSPLIT}
  970. \index{output}
  971. Under normal circumstances, the printing routines try to break an expression
  972. across lines at a natural point. This is a fairly expensive process. If
  973. you are not overly concerned about where the end-of-line breaks come, you
  974. can speed up the printing of expressions by turning off the switch
  975. \name{nosplit}. This switch is normally on.
  976. \end{Switch}
  977. \begin{Switch}{NUMVAL}
  978. \index{rounded}
  979. With \nameref{rounded} on, elementary functions with numerical arguments
  980. will return a numerical answer where appropriate. If you wish to inhibit
  981. this evaluation, \name{numval} should be turned off. It is normally on.
  982. \begin{Examples}
  983. on rounded; \\
  984. cos 3.4; & - 0.966798192579 \\
  985. off numval; \\
  986. cos 3.4; & COS(3.4)
  987. \end{Examples}
  988. \end{Switch}
  989. \begin{Switch}{OUTPUT}
  990. \index{output}
  991. When \name{output} is off, no output is printed from any REDUCE calculation.
  992. The calculations have their usual effects other than printing. Default is
  993. \name{on}.
  994. \begin{Comments}
  995. Turn output \name{off} if you do not wish to see output when executing
  996. large files, or to save the time REDUCE spends formatting large expressions
  997. for display. Results are still available with \nameref{ws}, or in their
  998. assigned variables.
  999. \end{Comments}
  1000. \end{Switch}
  1001. \begin{Switch}{OVERVIEW}
  1002. \index{factorize}
  1003. When \name{overview} is on, the amount of detail reported by the factorizer
  1004. switches \nameref{trfac} and \nameref{trallfac} is reduced.
  1005. \end{Switch}
  1006. \begin{Switch}{PERIOD}
  1007. \index{output}\index{integer}
  1008. When \name{period} is on, periods are added after integers in
  1009. Fortran-compatible output (when \nameref{fort} is on). There is no effect
  1010. when \name{fort} is off. Default is \name{on}.
  1011. \end{Switch}
  1012. \begin{Switch}{PRECISE}
  1013. \index{simplification}\index{square root}
  1014. When the \name{precise} switch is on, simplification of roots of even
  1015. powers returns absolute values, a more precise answer mathematically.
  1016. Default is \name{on}.
  1017. \begin{Examples}
  1018. sqrt(x**2); & X \\
  1019. (x**2)**(1/4); & SQRT(X) \\
  1020. on precise; \\
  1021. sqrt(x**2); & ABS(X) \\
  1022. (x**2)**(1/4); & SQRT(ABS(X))
  1023. \end{Examples}
  1024. \begin{Comments}
  1025. In many types of mathematical work, simplification of powers and surds can
  1026. proceed by the fastest means of simplifying the exponents arithmetically.
  1027. When it is important to you that the positive root be returned, turn
  1028. \name{precise} on. One situation where this is important is when graphing
  1029. square-root expressions such as \IFTEX{$\sqrt{x^2+y^2}$}{sqrt(x^2+y^2)} to
  1030. avoid a spike caused by REDUCE simplifying
  1031. \IFTEX{$\sqrt{y^2}$}{sqrt(y^2)} to \IFTEX{$y$}{y} when \IFTEX{$x$}{x} is
  1032. zero.
  1033. \end{Comments}
  1034. \end{Switch}
  1035. \begin{Switch}{PRET}
  1036. \index{output}
  1037. When \name{pret} is on, input is printed in standard REDUCE format and then
  1038. evaluated.
  1039. \begin{Examples}
  1040. on pret; \\
  1041. (x+1)^3; &
  1042. \begin{multilineoutput}{6cm}
  1043. (x + 1)**3;
  1044. X^{3} + 3*X^{2} + 3*X + 1
  1045. \end{multilineoutput} \\
  1046. \begin{multilineinput}
  1047. procedure fac(n);
  1048. if not (fixp(n) and n>=0)
  1049. then rederr "Choose nonneg. integer only"
  1050. else for i := 0:n-1 product i+1;
  1051. \end{multilineinput} &
  1052. \begin{multilineoutput}{8cm}
  1053. procedure fac n;
  1054. if not (fixp n and n>=0)
  1055. then rederr "Choose nonneg. integer only"
  1056. else for i := 0:n - 1 product i + 1;
  1057. FAC
  1058. \end{multilineoutput}\\
  1059. fac 5; & \begin{multilineoutput}{6cm}
  1060. fac 5;
  1061. 120
  1062. \end{multilineoutput}
  1063. \end{Examples}
  1064. \begin{Comments}
  1065. Note that all input is converted to lower case except strings (which keep
  1066. the same case) all operators with a single argument have had the
  1067. parentheses removed, and all infix operators have had a space added on each
  1068. side. In addition, syntactical constructs like
  1069. \name{if}\ldots\name{then}\ldots\name{else} are printed in a standard format.
  1070. \end{Comments}
  1071. \end{Switch}
  1072. \begin{Switch}{PRI}
  1073. \index{output}
  1074. When \name{pri} is on, the declarations \nameref{order} and \nameref{factor} can
  1075. be used, and the switches \nameref{allfac}, \nameref{div}, \nameref{rat},
  1076. and \nameref{revpri} take effect when they are on. Default is \name{on}.
  1077. \begin{Comments}
  1078. Printing of expressions is faster with \name{pri} off. The expressions are
  1079. then returned in one standard form, without any of the display options that
  1080. can be used to feature or display various parts of the expression. You can
  1081. also gain insight into REDUCE's representation of expressions with
  1082. \name{pri} off.
  1083. \end{Comments}
  1084. \end{Switch}
  1085. \begin{Switch}{RAISE}
  1086. \index{input}\index{character}
  1087. When \name{raise} is on, lower case letters are automatically converted to
  1088. upper case on input. \name{raise} is normally on.
  1089. \begin{Comments}
  1090. This conversion affects the internal representation of the letter, and is
  1091. independent of the case with which a letter is printed, which is normally
  1092. lower case.
  1093. \end{Comments}
  1094. \end{Switch}
  1095. \begin{Switch}{RAT}
  1096. \index{output}
  1097. When the \name{rat} switch is on, and kernels have been selected to display
  1098. with the \nameref{factor} declaration, the denominator is printed with each
  1099. term rather than one common denominator at the end of an expression.
  1100. \begin{Examples}
  1101. (x+1)/x + x**2/sin y;
  1102. & \rfrac{SIN(Y)*X + SIN(Y) + X^{3}}{SIN(Y)*X} \
  1103. \
  1104. factor x; \\
  1105. (x+1)/x + x**2/sin y;
  1106. & \rfrac{X^{3} + X*SIN(Y) + SIN(Y)}{X*SIN(Y)} \
  1107. \
  1108. on rat; \\
  1109. (x+1)/x + x**2/sin y;
  1110. & \rfrac{X^{2}}{SIN(Y)} + 1 + X^{-1}
  1111. \end{Examples}
  1112. \begin{Comments}
  1113. The \name{rat} switch only has effect when the \nameref{pri} switch is on.
  1114. When \name{pri} is off, regardless of the setting of \name{rat}, the
  1115. printing behavior is as if \name{rat} were off. \name{rat} only has
  1116. effect upon the display of expressions, not their internal form.
  1117. \end{Comments}
  1118. \end{Switch}
  1119. \begin{Switch}{RATARG}
  1120. \index{rational expression}\index{polynomial}
  1121. When \name{ratarg} is on, rational expressions can be given to operators
  1122. such as \nameref{coeff} and \nameref{lterm} that normally require
  1123. polynomials in one of their arguments. When \name{ratarg} is off, rational
  1124. expressions cause an error message.
  1125. \begin{Examples}
  1126. aa := x/y**2 + 1/x + y/x**2;
  1127. & AA := \rfrac{X^{3} + X*Y^{2} + Y^{3}}{X^{2}*Y^{2}} \\
  1128. coeff(aa,x); &
  1129. ***** \rfrac{X^{3} + X*Y^{2} + Y^{3}}{X^{2}*Y^{2}} invalid as POLYNOMIAL\\
  1130. on ratarg; \\
  1131. coeff(aa,x);
  1132. & \{\rfrac{Y}{X^{2}},\rfrac{1}{X^{2}},0,\rfrac{1}{X^{2}*Y^{2}}\}
  1133. \end{Examples}
  1134. \end{Switch}
  1135. \begin{Switch}{RATIONAL}
  1136. \index{rational expression}\index{polynomial}
  1137. When \name{rational} is on, polynomial expressions with rational coefficients
  1138. are produced.
  1139. \begin{Examples}
  1140. x/2 + 3*y/4; & \rfrac{2*X + 3*Y}{4} \\
  1141. (x**2 + 5*x + 17)/2; & \rfrac{X^{2} + 5*X + 17}{2} \\
  1142. on rational; \\
  1143. x/2 + 3y/4; & \rfrac{1}{2}*(X + \rfrac{3}{2}*Y) \\
  1144. (x**2 + 5*x + 17)/2; & \rfrac{1}{2}*(X^{2} + 5*X + 17)
  1145. \end{Examples}
  1146. \begin{Comments}
  1147. By using \name{rational}, polynomial expressions with rational
  1148. coefficients can be used in some commands that expect polynomials. With
  1149. \name{rational} off, such a polynomial becomes a rational expression, with
  1150. denominator the least common multiple of the denominators of the rational
  1151. number coefficients. % The \nameref{factorize} command does not accept
  1152. % polynomials with rational coefficients.
  1153. \end{Comments}
  1154. \end{Switch}
  1155. \begin{Switch}{RATIONALIZE}
  1156. \index{rational expression}\index{simplification}\index{complex}
  1157. When the \name{rationalize} switch is on, denominators of rational expressions
  1158. that contain complex numbers or root expressions are simplified by
  1159. multiplication by their conjugates.
  1160. \begin{Examples}
  1161. qq := (1+sqrt(3))/(sqrt(3)-7); & QQ := \rfrac{SQRT(3) + 1}{SQRT(3) - 7} \\
  1162. on rationalize; \\
  1163. qq; & \rfrac{- 4*SQRT(3) - 5}{23} \\
  1164. 2/(4 + 6**(1/3)); & \rfrac{6^{2/3} - 4*6^{1/3} + 16}{35} \\
  1165. (i-1)/(i+3); & \rfrac{2*I - 1}{5} \\
  1166. off rationalize; \\
  1167. (i-1)/(i+3); & \rfrac{I - 1}{I + 3}
  1168. \end{Examples}
  1169. \end{Switch}
  1170. \begin{Switch}{RATPRI}
  1171. \index{output}\index{rational expression}
  1172. When the \name{ratpri} switch is on, rational expressions and fractions are
  1173. printed as two lines separated by a fraction bar, rather than in a linear
  1174. style. Default is \name{on}.
  1175. \begin{Examples}
  1176. 3/17; & \rfrac{3}{17} \\
  1177. 2/b + 3/y; & \rfrac{3*B + 2*Y}{B*Y} \\
  1178. off ratpri; \\
  1179. 3/17; & 3/17 \\
  1180. 2/b + 3/y; & (3*B + 2*Y)/(B*Y)
  1181. \end{Examples}
  1182. \end{Switch}
  1183. \begin{Switch}{REVPRI}
  1184. \index{output}
  1185. When the \name{revpri} switch is on, terms are printed in reverse order from
  1186. the normal printing order.
  1187. \begin{Examples}
  1188. x**5 + x**2 + 18 + sqrt(y); & SQRT(Y) + X^{5} + X^{2} + 18 \\
  1189. a + b + c + w; & A + B + C + W \\
  1190. on revpri; \\
  1191. x**5 + x**2 + 18 + sqrt(y); & 17 + X^{2} + X^{5} + SQRT(Y) \\
  1192. a + b + c + w; & W + C + B + A
  1193. \end{Examples}
  1194. \begin{Comments}
  1195. Turn \name{revpri} on when you want to display a polynomial in ascending
  1196. rather than descending order.
  1197. \end{Comments}
  1198. \end{Switch}
  1199. \begin{Switch}{RLISP88}
  1200. \index{lisp}
  1201. Rlisp '88 is a superset of the Rlisp that has been traditionally used for
  1202. the support of REDUCE. It is fully documented in the book Marti, J.B.,
  1203. ``{RLISP} '88: An Evolutionary Approach to Program Design and Reuse'',
  1204. World Scientific, Singapore (1993). It supports different looping
  1205. constructs from the traditional Rlisp, and treats ``-'' as a letter unless
  1206. separated by spaces. Turning on the switch \name{rlisp88} converts to
  1207. Rlisp '88 parsing conventions in symbolic mode, and enables the use of
  1208. Rlisp '88 extensions. Turning off the switch reverts to the traditional
  1209. Rlisp and the previous mode ( (\nameref{symbolic} or \nameref{algebraic})
  1210. in force before \name{rlisp88} was turned on.
  1211. \end{Switch}
  1212. \begin{Switch}{ROUNDALL}
  1213. \index{rounded}\index{rational expression}\index{floating point}
  1214. In \nameref{rounded} mode, rational numbers are normally converted to a
  1215. floating point representation. If \name{roundall} is off, this conversion
  1216. does not occur. \name{roundall} is normally \name{on}.
  1217. \begin{Examples}
  1218. on rounded; \\
  1219. 1/2; & 0.5 \\
  1220. off roundall; \\
  1221. 1/2; \rfrac{1}{2}
  1222. \end{Examples}
  1223. \end{Switch}
  1224. \begin{Switch}{ROUNDBF}
  1225. When \nameref{rounded} is on, the normal defaults cause underflows to be
  1226. converted to zero. If you really want the small number that results in
  1227. such cases, \name{roundbf} can be turned on.
  1228. \begin{Examples}
  1229. on rounded; \\
  1230. exp(-100000.1^2); & 0 \\
  1231. on roundbf; \\
  1232. exp(-100000.1^2); & 1.18441281937E-4342953505
  1233. \end{Examples}
  1234. \begin{Comments}
  1235. If a polynomial is input in \nameref{rounded} mode at the default
  1236. precision into any \nameref{roots} function, and it is not possible to
  1237. represent any of the coefficients of the polynomial precisely in the
  1238. system floating point representation, the switch \name{roundbf} will be
  1239. automatically turned on. All rounded computation will use the internal
  1240. bigfloat representation until the user subsequently turns \name{roundbf}
  1241. off. (A message is output to indicate that this condition is in effect.)
  1242. \end{Comments}
  1243. \end{Switch}
  1244. \begin{Switch}{ROUNDED}
  1245. \index{floating point}
  1246. When \name{rounded} is on, floating-point arithmetic is enabled, with
  1247. precision initially at a system default value, which is usually 12 digits.
  1248. The precise number can be found by the command \nameref{precision}(0).
  1249. \begin{Examples}
  1250. pi; & PI \\
  1251. 35/217; & \rfrac{5}{31} \\
  1252. on rounded; \\
  1253. pi; & 3.14159265359 \\
  1254. 35/217; & 0.161 \\
  1255. sqrt(3); & 1.73205080756
  1256. \end{Examples}
  1257. \begin{Comments}
  1258. If more than the default number of decimal places are required, use the
  1259. \nameref{precision} command to set the required number.
  1260. \end{Comments}
  1261. \end{Switch}
  1262. \begin{Switch}{SAVESTRUCTR}
  1263. \index{STRUCTR OPERATOR}
  1264. When \name{savestructr} is on, results of the \nameref{structr} command are
  1265. returned as a list whose first element is the representation for the
  1266. expression and the remaining elements are equations showing the
  1267. relationships of the generated variables.
  1268. \begin{Examples}
  1269. off exp; \\
  1270. structr((x+y)^3 + sin(x)^2); &
  1271. \begin{multilineoutput}{6cm}
  1272. ANS3
  1273. where
  1274. ANS3 := ANS1^{3} + ANS2^{2}
  1275. ANS2 := SIN(X)
  1276. ANS1 := X + Y
  1277. \end{multilineoutput}\\
  1278. ans3; & ANS3 \\
  1279. on savestructr; \\
  1280. structr((x+y)^{3} + sin(x)^{2}); &
  1281. {ANS3,ANS3=ANS1^{3} + ANS2^{2},ANS2=SIN(X),ANS1=X + Y} \\
  1282. ans3 where rest ws; &
  1283. (X + Y)^{3} + SIN(X)^{2}
  1284. \end{Examples}
  1285. \begin{Comments}
  1286. In normal operation, \nameref{structr} is only a display command. With
  1287. \name{savestructr} on, you can access the various parts of the expression
  1288. produced by \name{structr}.
  1289. The generic system names use the stem \name{ANS}. You can change this to your
  1290. own stem by the command \nameref{varname}. REDUCE adds integers to this stem
  1291. to make unique identifiers.
  1292. \end{Comments}
  1293. \end{Switch}
  1294. \begin{Switch}{SOLVESINGULAR}
  1295. \index{solve}
  1296. When \name{solvesingular} is on, singular or underdetermined systems of
  1297. linear equations are solved, using arbitrary real, complex or integer
  1298. variables in the answer. Default is \name{on}.
  1299. \begin{Examples}
  1300. solve({2x + y,4x + 2y},{x,y}); &
  1301. \{\{X= - \rfrac{ARBCOMPLEX(1)}{2},Y=ARBCOMPLEX(1)\}\} \\
  1302. solve({7x + 15y - z,x - y - z},{x,y,z}); &
  1303. \begin{multilineoutput}{6cm}
  1304. \{\{X=\rfrac{8*ARBCOMPLEX(3)}{11}
  1305. Y= - \rfrac{3*ARBCOMPLEX(3)}{11}
  1306. Z=ARBCOMPLEX(3)\}\}
  1307. \end{multilineoutput}\\
  1308. off solvesingular; \\
  1309. solve({2x + y,4x + 2y},{x,y}); &
  1310. ***** SOLVE given singular equations \\
  1311. solve({7x + 15y - z,x - y - z},{x,y,z}); &
  1312. ***** SOLVE given singular equations
  1313. \end{Examples}
  1314. \begin{Comments}
  1315. The integer following the identifier \nameref{arbcomplex} above is assigned by
  1316. the system, and serves to identify the variable uniquely. It has no other
  1317. significance.
  1318. \end{Comments}
  1319. \end{Switch}
  1320. \begin{Switch}{TIME}
  1321. \index{time}
  1322. When \name{time} is on, the system time used in executing each REDUCE
  1323. statement is printed after the answer is printed.
  1324. \begin{Examples}
  1325. on time; & Time: 4940 ms \\
  1326. df(sin(x**2 + y),y); &
  1327. \begin{multilineoutput}{6cm}
  1328. COS(X + Y^{2})
  1329. Time: 180 ms
  1330. \end{multilineoutput}\\
  1331. solve(x**2 - 6*y,x); &
  1332. \begin{multilineoutput}{6cm}
  1333. \{X= - SQRT(Y)*SQRT(6),
  1334. X=SQRT(Y)*SQRT(6)\}
  1335. Time: 320 ms
  1336. \end{multilineoutput}
  1337. \end{Examples}
  1338. \begin{Comments}
  1339. When \name{time} is first turned on, the time since the beginning of the
  1340. REDUCE session is printed. After that, the time used in computation,
  1341. (usually in milliseconds, though this is system dependent) is printed after
  1342. the results of each command. Idle time or time spent typing in commands is
  1343. not counted. If \name{time} is turned off, the first reading after it is
  1344. turned on again gives the time elapsed since it was turned off. The time
  1345. printed is CPU or wall clock time, depending on the system.
  1346. \end{Comments}
  1347. \end{Switch}
  1348. \begin{Switch}{TRALLFAC}
  1349. \index{factorize}
  1350. When \name{trallfac} is on, a more detailed trace of factorizer calls is
  1351. generated.
  1352. \begin{Comments}
  1353. The \name{trallfac} switch takes precedence over \nameref{trfac} if they are
  1354. both on. \name{trfac} gives a factorization trace with less detail in it.
  1355. When the \nameref{factor} switch is on also, all input polynomials are sent to
  1356. the factorizer automatically and trace information is generated. The
  1357. \nameref{out} command saves the results of the factoring, but not the trace.
  1358. % You need to use the \name{dribble} command to save the trace text to a file.
  1359. \end{Comments}
  1360. \end{Switch}
  1361. \begin{Switch}{TRFAC}
  1362. \index{factorize}
  1363. When \name{trfac} is on, a narrative trace of any calls to the factorizer is
  1364. generated. Default is \name{off}.
  1365. \begin{Comments}
  1366. When the switch \nameref{factor} is on, and \name{trfac} is on, every input
  1367. polynomial is sent to the factorizer, and a trace generated. With
  1368. \name{factor} off, only polynomials that are explicitly factored with the
  1369. command \nameref{factorize} generate trace information.
  1370. % Use the \name{dribble} or \name{logfile} command to save the trace text to
  1371. % a file.
  1372. The \nameref{out} command saves the results of the factoring, but not
  1373. the trace. The \nameref{trallfac} switch gives trace information to a
  1374. greater level of detail.
  1375. \end{Comments}
  1376. \end{Switch}
  1377. \begin{Switch}{TRIGFORM}
  1378. \index{solve}\index{polynomial}
  1379. When \nameref{fullroots} is on, \nameref{solve} will compute the
  1380. roots of a cubic or quartic polynomial is closed form. When
  1381. \name{trigform} is on, the roots will be expressed by trigonometric
  1382. forms. Otherwise nested surds are used. Default is \name{on}.
  1383. \end{Switch}
  1384. \begin{Switch}{TRINT}
  1385. \index{integration}
  1386. When \name{trint} is on, a narrative tracing various steps in the
  1387. integration process is produced.
  1388. \begin{Comments}
  1389. %Use the \name{dribble} or \name{logfile} command to save this text to a file.
  1390. The \nameref{out} command saves the results of the integration, but not the
  1391. trace.
  1392. \end{Comments}
  1393. \end{Switch}
  1394. \begin{Switch}{TRNONLNR}
  1395. \index{solve}
  1396. When \name{trnonlnr} is on, a narrative tracing various steps in
  1397. the process for solving non-linear equations is produced.
  1398. \begin{Comments}
  1399. \name{trnonlnr} can only be used after the solve package has been loaded
  1400. (e.g., by an explicit call of \nameref{load\_package}). The \nameref{out}
  1401. command saves the results of the equation solving, but not the trace.
  1402. \end{Comments}
  1403. \end{Switch}
  1404. \begin{Switch}{VAROPT}
  1405. \index{solve}
  1406. When \name{varopt} is on, the sequence of variables is optimized by
  1407. \nameref{solve} with respect to execution speed. Otherwise, the sequence
  1408. given in the call to \nameref{solve} is preserved. Default is \name{on}.
  1409. In combination with the switch \nameref{arbvars}, \name{varopt} can be used
  1410. to control variable elimination.
  1411. \begin{Examples}
  1412. off arbvars; \\
  1413. solve({x+2z,x-3y},{x,y,z}); &
  1414. \{\{y=\rfrac{x}{3},z= - \rfrac{x}{2}\}\} \\
  1415. solve({x*y=1,z=x},{x,y,z}); &
  1416. \{\{z=x,y=\rfrac{1}{x}\}\} \\
  1417. off varopt; \\
  1418. solve({x+2z,x-3y},{x,y,z}); &
  1419. \{\{x= - 2*z,y= - \rfrac{2*z}{3}\}\} \\
  1420. solve({x*y=1,z=x},{x,y,z}); &
  1421. \{\{y=\rfrac{1}{z},x=z\}\} \\
  1422. \end{Examples}
  1423. \end{Switch}