home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / utility / sm22a.zip / SYMBMATH.DO3 < prev    next >
Text File  |  1993-04-20  |  30KB  |  922 lines

  1.         SymbMath 2.2: A Symbolic Calculator with Learning
  2.                 (Version 2.2)
  3.  
  4.         by Dr. Weiguang HUANG
  5.     Dept. Analytical Chemsitry, University of New South Wales,
  6.     Kensington, Sydney, NSW 2033, Australia
  7.     Phone: 61-2-697-4643
  8.     Fax:   61-2-662-2835
  9.     E-mail: w.huang@unsw.edu.au
  10.  
  11.         Copyright (C) 1990-1993
  12.         April 15, 1993
  13.  
  14.         This is Part Three of SymbMath manual. The SymbMath manual has
  15. three parts in the files SymbMath.DOC, SymbMath.DO2 and SymbMath.DO3.
  16.  
  17.  
  18.                         11. Inside SymbMath
  19.  
  20.     As an expert system, SymbMath consists of three major 
  21. components: a knowledge base, an inference engine, and a global data 
  22. base. The knowledge base is a set of rules, the inference engine is a 
  23. rule interpreter for utilizing the knowledge base in the solution of 
  24. the problem, and the global data base is a working memory for keeping 
  25. track of the problem status, the data from the data file for the 
  26. particular problem, and the solution of sub-problems. In addition, it 
  27. contains a natural language interface for input and output natural 
  28. languages (e.g. mathematical formulas, chemical reactions).
  29.  
  30.  
  31.         User    Library         disk
  32.          /|\       |             /|\
  33.           |        |              |
  34.          \|/      \|/            \|/
  35.         ------------------------------
  36.         | Natural Language Interface |
  37.         ------------------------------
  38.                    /|\
  39.                 |
  40.                    \|/
  41.         ------------------------------
  42.     ------->|        Inference Engine    |<----------
  43.     |       ------------------------------          |
  44.        \|/                                             \|/
  45. ------------------                              --------------------
  46. | Knowledge Base |                              | Global Data Base |
  47. ------------------                              --------------------
  48.                                /|\
  49.                             |
  50.                         --------------------
  51.                         |    Data File     |
  52.                         --------------------
  53.  
  54.         Figure 11.1      Base structure of SymbMath
  55.  
  56.  
  57.  
  58.         Table 11.1      Characteristics of SymbMath
  59. --------------------------------------------------------------------
  60. Function:                       Symbolic computation.
  61. Domain:                         Mathematics, chemistry.
  62. Search direction:               Forward chaining.
  63. Control mechanism:              Guessing and test, pattern match.
  64. Search space transformations:   Break into sub-problems.
  65. Knowledge base representation:  Rules.
  66. Developer interface:            Learning, programming, library.
  67. User interface:                Pull-down menu, pop-up menu, multi-windowed
  68.                 text editor, help, windows.
  69. System interface:               numeric computation software, graphic 
  70.                 software (e.g. PlotData), etc.
  71. Input format:                   Math formulas, numbers, BASIC or FORTRAN 
  72.                 codes, chemical symbols and reactions.
  73. Output format:                  Math notation, BASIC or FORTRAN codes, 
  74.                 chemical reaction equations.
  75. Input from:                     Keyboard, disk.
  76. Output to:                      Screen, disk, printer.
  77. Tool language:                  Prolog.
  78. Computer:                       IBM PC.
  79. Memory:                         420 KBytes.
  80. Operating system:               MS-DOS.
  81. ---------------------------------------------------------------------
  82.  
  83.  
  84.                         12. System limits
  85.  
  86.     1. The maximum character of a symbol is 64000.
  87.     2. The maximum character of an expression is 64000.
  88.     3. The range of the input real numbers is 
  89. -inf, -(10^307)^(10^307) to -(10^-307)^(10^-307), 0, (10^-307)^(10^-307)
  90.  to (10^307)^(10^307), inf.
  91.     4. The range of the output real numbers is the same as input 
  92. when the switch Numerical=Off, but when the switch Numerical=On, it is
  93.     -inf, -1.E307 to -1.E-307, 0, 1.E-307 to 1.E307, inf.
  94.     5. The maximum digit of the input numbers is 64000.
  95.     6. The maximum digit of the stored numbers is 16.
  96.     7. The maximum digit of the output numbers is 11.
  97.     8. The maximum digit of the rational numbers is 16.
  98.     9. The maximum arguments of the user-defined function with
  99. pattern is 5.
  100.     10. The maximum arguments of the user-defined rule is 2 and the
  101. maximum number of the pattern is 1.
  102.  
  103.                         13.      Keywords
  104.  
  105.     SymbMath has three versions: Shareware Version A, Student
  106. Version B and Advanced Version C. The shareware version lacks the 
  107. solve(), dsolve(), trig (except sin(x)), and hyerbolic functions on 
  108. input, and the student version lacks the hyerbolic and dsolve() 
  109. functions on input. You cannot input these lacked functions, but all 
  110. versions can output all functions.
  111.     Upper- and lower-case letters are different until the switch
  112. lowercase is set to on (i.e. lowercase=on).
  113.     All keywords are lower-case letters until the switch lowercase
  114. is set to on.
  115.     The following special symbols (about 130 words) only include 
  116. the keywords in the SymbMath system and the initialization package
  117. init.sm.
  118.  
  119.  
  120.              13.1        Keywords in Functional Order
  121.  
  122. ---------------------------------------------------------------------
  123. 1. Built-in constants: i, e, pi, inf, zero, constant, discont,
  124.     undefined, complex_inf.
  125. 2. Built-in variables: last.
  126. 3. Negative and positive: -, +.
  127. 4. Algebraic operators: +, -, *, /, ^, **, ().
  128. 5. Relational operators: ==, >, >=, <, <=, <>.
  129. 6. Logic operators: and, or.
  130. 6. Algebraic functions: -x, sqrt(x), n!, fac(n), mod(x,y), div(x,y).
  131. 7. Complex functions: re(x), im(x), abs(x), arg(x), sgn(x).
  132. 8. Exponential functions: exp(x), ln(x), ei(n,x), gamma(n,x).
  133. 9. Trig functions: sin(x), cos(x), tan(x), csc(x), sec(x), cot(x), 
  134.         asin(x), acos(x), atan(x), acot(x), asec(x), acsc(x), 
  135.         atan2(x,y).
  136. 10. Hyperbolic functions: sinh(x), cosh(x), tanh(x), csch(x), sech(x),
  137.     coth(x), asinh(x), acosh(x), atanh(x), acoth(x), acsch(x),
  138.     asech(x).
  139. 11. Assignments: =, :=.
  140. 12. Equation: ===.
  141. 13. User-defined functions: f(x_):=x^2, f(x_):=if(isnumber(x),x^2).
  142. 14. User-defined rules: d(si(x_),x_):=sin(x)/x.
  143. 15. Calculus functions: 
  144.     d(y,x), d(y,x,order), d(y, x=x0), d(y, x=x0, order),
  145.     inte(f,x), inte(f,x,xmin,xmax),
  146.     dsolve(d(y)/d(x)===f(x,y), y),
  147.     subs(y, x=x0), lim(y, x=x0), 
  148.     sum(f, x,xmin,xmax,dx), prod(f, x,xmin,xmax,dx), 
  149. 16. Transformation functions: expand(expr), factor(expr),
  150.         solve(x^2===a,x), coef(expr,x), left(x===a), right(x===a), 
  151.         float(x), ratio(x), round(x), trunc(x), 
  152.     table(p[x], x,xmin,xmax,dx).
  153. 17. Numeric computation: num(expr).
  154. 18. Test function: isodd(x), iseven(x), isinteger(x), isreal(x), 
  155.     isnumber(x), islist(x), isfree(y,x).
  156. 19. Table: table(f, x,xmin,xmax,dx).
  157. 20. List: [a,b], list(f, x,xmin,xmax,dx), length([a]).
  158. 21. Element of list: f[1], last[1].
  159. 22. Switches: numerical, output, expand, expexpand, lnexpand, lowercase, 
  160.     =, on, off, basic, fortran, prolog, twodim.
  161. 23. Commands: system(dos), clear(x), block(), null.
  162. 24. Separators: "," , from, to, step.
  163. 25. Assume: assume(a>0), isreal(x)=1.
  164. 26. Rule: if(test, then), if(test, then, else).
  165. 27. Loop: do(expr, x,xmin,xmax,dx), repeat(expr, test).
  166. 28. Input: include('filename').
  167. 29. Output: openfile('filename'), closefile('filename').
  168. 30. Plot: plot(x^2,x).
  169. 31. Comment: #.
  170. 32. Action: done, cleared, assumed.
  171. --------------------------------------------------------------------
  172.  
  173.  
  174.            13.2          Keywords in Alphabetical Order
  175.  
  176. ----------------------------------------------------------------------
  177. abs(x)         acos(x)     acosh(x)     acot(x)     acoth(x) 
  178. acsc(x)     acsch(x)     arg(x)         asec(x)     asech(x) 
  179. asin(x)     asinh(x)     assume(x>0)     assumed     atan(x) 
  180. atan2(x,y)     atanh(x)    
  181.  
  182. basic         block()        
  183.  
  184. clear(x)     cleared     closefile()    coef(f,x)     complex_inf     
  185. constant     cos(x)         cosh(x)     cot(x)         coth(x)     
  186. csc(x)         csch(x)
  187.  
  188. d()         div(x,y)     discont     do()         done 
  189. dsolve(eq,y)    
  190.  
  191. E         e         ei(n,x)        end         exp(x)         
  192. expand(f)     expand         expexpand    
  193.  
  194. fac(x)         factor(expr)     float(x)     fortran     from        
  195.  
  196. gamma(n,x)    
  197.  
  198. i         if()         im(x)         include('file')    inf         
  199. inte()         iseven(x)     isfree(y,x)    isinteger(x)    islist(x)
  200. isodd(x)     isreal(x)     isnumber(x)    
  201.  
  202. last         left(x===a)     length([a])    lim()         list()         
  203. ln(x)         lnexpand     lowercase    
  204.  
  205. mod(x,y)    
  206.  
  207. null         num(expr)     numerical     
  208.  
  209. off         on         openfile()    output        
  210.  
  211. pi         plot()         prod()         prolog        
  212.  
  213. ratio(x)     re(x)         repeat()     right(x===a)     round(x)    
  214.  
  215. sec(x)         sech(x)     sgn(x)         sin(x)         sinh(x)     
  216. solve(eq,x)     sqrt(x)     subs(f,x=x0)     sum()         step        
  217. system(dos)    
  218.  
  219. table()     tan(x)         tanh(x)     to         trunc(x)     
  220. twodim        
  221.  
  222. undefined    
  223.  
  224. zero
  225.  
  226. +         -         *         /         ^ 
  227. **         ()         []         =         := 
  228. ==         ===         >         >=         < 
  229. <=         <>         !         #         ,
  230. -----------------------------------------------------------------------
  231.  
  232.  
  233.  
  234.                 13.3     Glossary
  235.  
  236. --------------------------------------------------------------------
  237. * abs
  238. abs(x) is the absolute value function of x. x can be complex numbers.
  239. Absolute value of the complex number x is defined by
  240. sqrt(re(x)^2+im(x)^2). The results are in the range 0 to inf.
  241. e.g. abs(-1) gives 1, abs(-i) gives -1.
  242. See also: sgn, re, im.
  243.  
  244. * acos
  245. acos(x) is the arc cosine function of x. The inverse function of 
  246. cos(x). The result is given in radians.
  247. See also: cos.
  248.  
  249. * acosh
  250. acosh(x) is the inverse hyerbolic cosine function of x.
  251. The inverse function of cosh(x).
  252. See also: cosh.
  253.  
  254. * acot
  255. acot(x) is the arc cotangent function of x. The inverse function 
  256. of cot(x). The result is given in radians. acot(x)=atan(1/x).
  257. See also: cot, atan.
  258.  
  259. * acoth
  260. acoth(x) is the inverse hyperbolic cotangent function of x. The 
  261. inverse function of coth(x). acoth(x)=atanh(1/x).
  262. See also: coth, atanh.
  263.  
  264. * acsc
  265. acsc(x) is the arc cosecant function of x. The inverse function of 
  266. csc(x). The result is in radians. acsc(x)=asin(1/x).
  267. See also: csc, asin.
  268.  
  269. * acsch
  270. acsch(x) is the inveres hyperbolic cosecant function of x. The 
  271. inverse function of csch(x). acsch(x)=asinh(1/x).
  272. See also: csch, asinh.
  273.  
  274. * arg
  275. arg(x) gives the argument of x. It gives the phase angle of x in 
  276. radians. Its result is in the range > -pi to <= pi. arg(x)=
  277. atan2(re(x),im(x)). x can be complex number. For real x, arg(x)=0.
  278. See also: abs, sgn, atan2.
  279.  
  280. * asec
  281. asec(x) is the arc secant function of x. The inverse function of 
  282. sec(x). The result is given in radians. asec(x)=acos(1/x).
  283. See also: sec, acos.
  284.  
  285. * asech
  286. asech(x) is the inverse hyperbolic secant function of x. The inverse 
  287. function of sech(x). asech(x)=acosh(1/x).
  288. See also: sech, acosh.
  289.  
  290. * asin
  291. asin(x) is the arc sine function of x. The inverse function of 
  292. sin(x). The result is given in radians.
  293. See also: sin.
  294.  
  295. * asinh
  296. asinh(x) is the inverse hyperbolic sine function of x. The inverse 
  297. function of sinh(x).
  298. See also: sinh.
  299.  
  300. * assume
  301. assume(x > 1), or assume(x < 1), assumes a variable x > 1, or x < 1.
  302. All variables are assumed as complex by default.
  303. e.g. assume(x>0), assume(x<0), or isreal(x) := 1.
  304. See aslo: sgn, isodd, iseven, isinteger, isreal, isnumber.
  305.  
  306. * assumed
  307. assumed points out that the variable has been assumed.
  308. See also: assume.
  309.  
  310. * atan
  311. atan(x) is the arc tangent function of x. The inverse function of 
  312. tan(x). The result is given in radians.
  313. See also: tan.
  314.  
  315. * atan2
  316. atan2(x,y) returns the radian angle of (x,y).
  317.   atan2(x,y)    = sgn(y)*pi/2   if x=0
  318.         = atan(y/x)     if x>0
  319.         = atan(y/x)+pi  if x<0, y>=0
  320.         = atan(y/x)-pi  if x<0, y<0 .
  321. Thus atan2(x,y) takes its value larger than -pi less or equal to pi.
  322.  
  323. * atanh
  324. atanh(x) is the inverse hyperbolic tangent function of x. The inverse 
  325. function of tanh(x).
  326. See also: tanh.
  327.  
  328. * basic
  329. basic is a value of the switch output. It sets output in BASIC format. 
  330. e.g. output=basic.
  331. See also: output, on, off, fortran, prolog.
  332.  
  333. * block
  334. block(a,b,c) return only the last argument.
  335. e.g. block(a,b,c) gives c.
  336.  
  337. * clear
  338. clear(expr) clears values and definitions for the variable, function or 
  339. expression expr from memory. 
  340. e.g. clear(p), clear(f(x)).
  341.  
  342. * cleared
  343. It says that the variable, function or expression has been cleared
  344. from memory.
  345. See also: clear.
  346.  
  347. * closefile
  348. closefile('filename') closes the file 'filename' and return the output
  349. to screen. The filename is any MS-DOS file name.
  350. See also: openfile, include.
  351.  
  352. * coef
  353. coef(expr,form) gives the coefficient of form in the polynomial expr. 
  354. It picks only terms that contain the particular form specified. x is
  355. not considered part of x^6.
  356. e.g. coef(2*x^6+x+4, x^6) gives 2, coef(2*x^6+x+4, x) gives 1.
  357.  
  358. * complex_inf
  359. The complex infinite, both real and imaginary parts of complex numbers 
  360. are infinity, as the built-in constant. complex_inf=inf+inf*i, 
  361. inf-inf*i, -inf+inf*i, or -inf-inf*i.
  362. See also: inf.
  363.  
  364. * constant
  365. The indefinite integral constant.
  366.  
  367. * cos
  368. cos(x) is the cosine function of x. The angle x is measured in radians
  369. (multiply by degree to convert from degrees). x can be complex numbers.
  370. See also: acos, sec.
  371.  
  372. * cosh
  373. cosh(x) is the hyerbolic cosine function of x.
  374. cosh(x)=(exp(x)+exp(-x))/2. x can be complex numbers.
  375. See also: acosh.
  376.  
  377. * cot
  378. cot(x) is the cotangent function of x. The angle x is measured in radians.
  379. (multiply by degree to convert from degrees). cot(x)=1/tan(x).
  380. See also: acot, tan.
  381.  
  382. * coth
  383. coth(x) is the hyerbolic cotangent function of x. coth(x)=1/tanh(x).
  384. See also: acoth, tanh.
  385.  
  386. * csc
  387. csc (x) is the cosecant function of x. The angle x is measured in 
  388. radians (multiply by degree to convert from degrees). csc(x)=1/sin(x)
  389. x can be complex numbers.
  390. See also: acsc, sin.
  391.  
  392. * csch
  393. csch(x) is the hyperbolic cosecant function of x. csch(x)=1/sinh(x).
  394. x can be complex numbers.
  395. See also: acsch, sinh.
  396.  
  397. * d
  398. d() gives the partial derivative.
  399. d(f, x)        differentiate y with respect to x.
  400.         e.g. d(x^2/d(x)) gives 2*x.
  401. d(f, x, n)    gives the n-th order derivative of f with respect
  402.         to an undefined variable x.
  403. d(f, x=c)    gives the derivative of f with respect to an
  404.         undefined variable x at x=c.
  405. d(f, x=c, n)    gives the n-th order derivative of f with respect
  406.         to an undefined variable x at x=c.
  407. d(y)            implicit differentiation, used in differential
  408.         equations, e.g. x*d(x)+y*d(y) === 0.
  409.  
  410. * degree
  411. degree gives the number of radians in one degree. degree=pi/180.
  412. You can multipy by degree to convert from degree to radians. 
  413. e.g. 45*degree, sin(45*degree).
  414. See also: pi.
  415.  
  416. * discont
  417. The discontinuity. If the function value is discont, the function has
  418. a discontinuity and only has the one-sided limit at x=c. Users should
  419. evaluate its left-sided limit or right-sided limit by x=c-zero or 
  420. x=c+zero.
  421.  
  422. * do
  423. do(expr, x,xmin,xmax,dx) evaluates expr with the x looping from xmin 
  424. to xmax on step dx.
  425. e.g. x=1, do(x=x+1, j,1,5,1) gives x=5.
  426.  
  427. * done
  428. It indicates that the action has been done.
  429.  
  430. * dsolve
  431. dsolve(d(y)/d(x)===f(x,y), y) solves the first order variables 
  432. separable and linear differential equations. The d(y)/d(x) must be 
  433. alone on the left hand side of the equations. 
  434. e.g. dsolve(d(y)/d(x) === x*y + 1, y).
  435. See also: solve, nsolve.
  436.  
  437. * E
  438. E is the exponential part of a floating point number. e.g. 1.1E2 is the
  439. same as 1.1*10^2.
  440. See also: e, exp.
  441.  
  442. * e
  443. (1) e is the exponential constant (baes of natural logarithms), 
  444. e=2.718..., the built-in constant, e is converted to 2.718... when the
  445. switch Numerical=On. e^x is the same as exp(x).
  446. e.g. e^2, e^x.
  447. (2) e is the exponential part of a floating point number, the same as E.
  448. e.g. 1.1e2 is the same as 1.1E2.
  449. See also: E, exp.
  450.  
  451. * ei
  452. ei(n,x) is the exponential integral function En(x), 
  453. ei(n,x)=inte(t^n*e^t, t,-inf,x), d(ei(n,x),x)=x^n*e^x, ei(-1, x)=ei(x),
  454. ei(0,x)=e^x.
  455.  
  456. ei(x) is the exponential integral function Ei(x),
  457. ei(x) = inte(e^t/t, t,-inf,x), d(ei(x),x)=e^x/x, 
  458. See also: gamma.
  459.  
  460. * erf
  461. erf(x) is the error function of x. It is the probability integral 
  462. function or the integral of the Gaussian distribution. erf(x)=
  463. 2/sqrt(pi)*inte(exp(-t^2),t,0,z).
  464.  
  465. * exp
  466. exp(x) is the exponential function of x (base of e). The same as e^z, 
  467. e=2.718... It is the inverse to ln(x). x can be complex numbers.
  468. See also: ^.
  469.  
  470. * expand
  471. expand(expr)     expands out products and positive powers in expr.
  472.         expand works only on positive integer powers.
  473. e.g. expand((a+b)^2) gives a^2 + 2*a*b + b^2.
  474. See also: factor.
  475. the switch of expansion.
  476. expand=on       e.g. c*(a+b) to c*a+c*b.
  477. expand=off      disable expansion, this is default.
  478.  
  479. * expexpand
  480. The switch of exponential expansion.
  481. expexpand=on       e.g. c^(a+b) to c^a*c^b.
  482. expexpand=off      disable exponential expansion, this is default.
  483.  
  484. * fac
  485. fac(n) is the factorial function of n. The same as n!. 
  486. e.g. fac(3) gives 6.
  487. See also: n!.
  488.  
  489. * factor
  490. factor(expr) factorises from expr.
  491. e.g. factor(a^2 + 2*a*b + b^2) gives (a+b)^2.
  492. See also: expand, Expand, ExpExpand, LnExpand.
  493.  
  494. * float
  495. float(x) converts x to the floating-point number. 
  496. e.g. float(1/2) gives 0.5.
  497. See also: ratio.
  498.  
  499. * fortran
  500. fortran is the value of the switch Output. It forces the output in 
  501. Fortran format. 
  502. e.g. output=fortran.
  503. See also: output, basic, twodim, prolog, on, off.
  504.  
  505. * from
  506. The separator, the same as the comma (,).
  507.  
  508. * gamma
  509. gamma(n,x) is the incomplete gamma function, gamma(n,x)=
  510. inte(t^n*e^(-t), t,0,x), d(gamma(n,x),x)=x^n*e^(-x).
  511. gamma(n,0)=0, gamma(n,inf)=gamma(n+1)=n!.
  512.  
  513. gamma(n) is the gamma function Γ(n), gamma(n)=inte(t^(n-1)*e^(-t), t,0,inf). 
  514. gamma(n,x) is similar to gamma(n), but its power term is t^n, instead 
  515. of t^(n-1). gamma(n)=(n-1)!.
  516. See also: ei.
  517.  
  518. * i
  519. i represents the imaginative unit of the complex numbers, i=sqrt(-1), 
  520. as the built-in constant. 
  521. e.g. 1+2*i.
  522. See also: re, im.
  523.  
  524. * if
  525. if(condition, x, y)     gives x if condition evaluates to 1, y if it 
  526.             evaluates to 0, or no output if it evaluates 
  527.             to neither 1 or 0.
  528. if(condition, x)    gives x if condition evaluates to 1, or no 
  529.             output otherwise.
  530. It is useful in definition of the use-defined function to left the
  531. function unevaluted if the argument of the function is not number.
  532. e.g. define f(x_):=if(isnumber(x), 1), then call f(x), f(10) gives 1, 
  533. and f(a) gives f(a).
  534. See also: :=, =.
  535.  
  536. * im
  537. im(x) gives the imaginative part of the complex number x. 
  538. e.g. im(1+2*i) gives 2.
  539. See also: re, abs, sgn, arg.
  540.  
  541. *include
  542. include('filename') includes (or runs) the file 'filename'. The filename
  543. is any MS-DOS file name.
  544. See also: openfile, closefile.
  545.  
  546. * inf
  547. inf is a positive infinity, as the built-in constant.
  548. e.g. inf+2*inf gives inf, 1/inf gives 0.
  549. See also: complex_inf.
  550.  
  551. * inte
  552. The integral function.
  553. inte(f,x)           find the indefinite integral of f with respect
  554.             to an undefined variable x.
  555. inte(f,x,xmin,xmax)       find the definite integral of f with respect to
  556.             an undefined variable x taken from x=a to x=b.
  557. inte(y)             implicit integration, used to integrate the
  558.             differential equations.
  559. See also: ninte.
  560.  
  561. * iseven
  562. iseven(x) gives 1 if x is an even integer, or 0 otherwise.
  563. You can assume x is even by iseven(x) := 1.
  564. e.g. iseven(2) gives 1, iseven(3) gives 0.
  565. See also: isodd, isinteger, islist, isreal, isnumber, isfree, sgn.
  566.  
  567. * isfree
  568. isfree(y,x) gives 1 if y is free of x, or 0 otherwise.
  569. You can assume y is free of x by iseven(y,x) := 1.
  570. e.g. isfree(a*b,x) gives 1, isfree(x*y,x) gives 0.
  571. See also: isodd, isinteger, islist, isreal, isnumber, isfree, sgn.
  572.  
  573. * isinteger
  574. isinteger(x) gives 1 if x is an integer, or 0 otherwise.
  575. You can assume x is integer by isinteger(x) := 1.
  576. e.g. isinteger(2) gives 1, isinteger(3.2) gives 0.
  577. See also: iseven, islist, isodd, isreal, isnumber, isfree, sgn.
  578.  
  579. * islist
  580. islist(x) gives 1 if x is a list, or 0 otherwise.
  581. You can assume x is a list by islist(x) := 1.
  582. e.g. islist([a]) gives 1, islist(3.2) gives 0.
  583. See also: iseven, isinteger, isodd, isreal, isnumber, isfree, sgn.
  584.  
  585. * isodd
  586. isodd(x) gives 1 if x is an odd integer, or 0 otherwise.
  587. You can assume x is odd by isodd(x) := 1.
  588. e.g. isodd(3) gives 1, isodd(2) gives 0.
  589. See also: iseven, isinteger, islist, isreal, isnumber, isfree, sgn.
  590.  
  591. * isreal
  592. isreal(x) gives 1 if x is real, or 0 otherwise.
  593. You can assume x is real by isreal(x) := 1.
  594. e.g. isreal(2.2) gives 1, isreal(a) gives 0.
  595. See also: iseven, isodd, isinteger, islist, isnumber, isfree, sgn.
  596.  
  597. * isnumber
  598. isnumber(x) gives 1 if x is a number, or 0 otherwise.
  599. You can assume x is a number by isnumber(x) := 1.
  600. e.g. isnumber(2.2) gives 1, isnumber(a) gives 0.
  601. See also: iseven, isodd, isinteger, islist, isreal, isfree, sgn.
  602.  
  603. * last
  604. last        represents the last output, as the built-in variable.
  605. last[1]     the first element of the last output list.
  606.  
  607. * left
  608. left(x===a) gives the left hand side of an equation. 
  609. e.g. left(x+y===2) gives x+y.
  610. See also: righ.
  611.  
  612. * length
  613. length([a]) gives the length of a list (the number of member in the 
  614. list).
  615. e.g. length([a]) gives 1, length([a,b,c]) gives 3.
  616. See also: list.
  617.  
  618. * lim
  619. lim(expr, x=x0)         finds the limiting value of expr when x 
  620.                         approaches x0.
  621. lim(expr, x=x0+zero)    finds the right-sided limit as x approches x0 
  622.                         from the positive (+inf) direction (x -> x0+).
  623. lim(expr, x=x0-zero)    finds the left-sided limit as x approches x0 
  624.                         from the negative (-inf) direction (x -> x0-).
  625. e.g. lim(sin(x)/x, x=0) gives 1.
  626. Note that the correct answers are only for the indeterminate forms:
  627. 0/0, inf/inf, 0*inf, 0^0, inf^0.
  628. See also: subs.
  629.  
  630. * list
  631. list(f,x,xmin,xmax,dx)   produces a list of f when x runs from xmin
  632.              to xmax on step dx.
  633. e.g. list(x^2, x,1,3,1) gives [1,4,9].
  634. See also: table, length.
  635.  
  636. * ln
  637. ln(x) is the natural logarithmic function of x. Its base is e. It is 
  638. the inverse to exp(x). Warming that if it has multi-values, the ln(x) 
  639. only gives a principle value (P.V.) and other values are 
  640. P.V.+2*k*pi*i (where k=0, 1, 2,..., -1, -2, ...).
  641. If x is complex number (x=A+B*i) then
  642. ln(x)=ln(abs(x))+i*atan2(A,B).
  643. See also: exp.
  644.  
  645. * lnexpand
  646. The switch of the logarithmic expansion.
  647. lnexpand=on       log expansion, e.g. ln(a*b) is expanded into
  648.           ln(a)+ln(b).
  649. lnexpand=off      disable log expansion, this is default.
  650. See also: expexpand, expand.
  651.  
  652. * lowercase
  653. The swicth of the case conversion.
  654. lowercase=on    converts the letters to lower-case letters, e.g.
  655.         SIN(x) is converted to sin(x).
  656. lowercase=off    disables the case convertion, this is default.
  657. It only effects the input.
  658.  
  659. * mod
  660. mod(m,n) gives the remainder on division of m by n.
  661. See also: div.
  662.  
  663. * n!              
  664. n! gives the factorial of n. The same as fac(n). 
  665. e.g. 3! gives 6.
  666. See also: fac.
  667.  
  668. * num
  669. num(expr) gives the numerical value of expr. It converts all numbers 
  670. to real form.
  671. e.g. num(pi) gives 3.1416.
  672. See also: numerical.
  673.  
  674. * numerical
  675. The switch of numerical calculation.
  676. numerical=on       numerical computation.
  677. numerical=off      disable numerical computation, this is default.
  678. See also: num.
  679.  
  680. * null
  681. null is a symbol used to indicate the absence of an expression or a
  682. result. When it appreas as an output expression, no output is printed.
  683. e.g. block(output=on, null).
  684.  
  685. * off
  686. When the switch is set to off, it is inactive. 
  687. e.g. numerical=off, output=off, expand=off.
  688.  
  689. * on
  690. When the switch is set to on, it is active. 
  691. e.g. numerical=on, expand=on, expexpand=on, lnexpand=on, lowercase=on,
  692. output=on.
  693.  
  694. * openfile
  695. openfile('filename') opens the disk file 'filename' for writing. The 
  696. filename is any MS-DOS file name. After doing something, the file must 
  697. be closed by closefile('filename').
  698. See also: closefile, include.
  699.  
  700. * output
  701. The switch of the output format, 
  702. e.g. output=basic, output=fortran, output=twodim, output=on, output=off.
  703.  
  704. * pi
  705. pi=3.1416..., as the built-in constant, pi is converted to 3.1416... 
  706. when the switch numerical=on.
  707.  
  708. * plot
  709. plot(f,x,xmin,xmax,dx)    generates a plot of f as a function of x from
  710.             xmin to xmax with step dx.
  711. plot(f,x,xmin,xmax)    plots a function with default step (xmax-xmin)*
  712.             0.05 (20 plot points).
  713. plot(f,x)         plots a function with the default range (-6 to 6) 
  714.             and the default step (20 plot points).
  715.  
  716. * prod
  717. prod(f,x,xmin,xmax,dx)     evaluates the product of f when x runs from 
  718.             xmin to xmax with step dx.
  719. prod(f,x,xmin,xmax)    with the default step dx = 1.
  720.  
  721. * prolog
  722. prolog is the value of the switch output. It forces the output in the
  723. Prolog format.
  724. See also: output, basic, fortran.
  725.  
  726. * random
  727. random(0)     gives a uniformly distributed pseudorandom real in 
  728.         the range 0 to 1.
  729. random(n)    gives a uniformly distributed pseudorandom integer
  730.         in the range 0 to n. (n < 36000).
  731. e.g. random(0) gives 0.11111, random(5) gives 2.
  732.  
  733. * ratio                        
  734. ratio(x) converts x to a rational number. 
  735. e.g. ratio(0.2) gives 1/5.
  736. See also: float, num.
  737.  
  738. * re
  739. re(x) gives the real part of the complex number x. 
  740. e.g. re(1+2*i) gives 1.
  741. See also: im(x), abs(x), sgn(x).
  742.  
  743. * repeat
  744. repeat(expr,test) repeats expr until test gives 1.
  745. e.g. x=1, repeat(x=x+1, x>5) gives x=6.
  746. See also: do.
  747.  
  748. * right
  749. right(x===a) gives the right hand side of an equation. 
  750. e.g. right(x+y === 3) gives 3.
  751. See also: left, solve.
  752.  
  753. * round                        
  754. round(x) converts x to the rounded integer closest to x. 
  755. e.g. round(2.4) gives 2, round(2.5) gives 3.
  756. See also: trunc.
  757.  
  758. * sec
  759. sec(x) is the secant function of x. The angle x is measured in 
  760. radians (multiply by degree to convert from degrees). sec(x)=1/cos(x).
  761. See also: asec, cos.
  762.  
  763. * sech
  764. sech(x) is the hyperbolic secant function of x. sech(x)=1/cosh(x).
  765. See also: asech, cosh.
  766.  
  767. * sgn
  768. sgn(x) is the sign function of x. Its value is 1, 0 or -1.
  769.  
  770.     / 1    if re(x) > 0, or re(x) = 0 and im(x) > 0; 
  771. sgn(x) =  0     if x=0; 
  772.     \ -1     otherwise. 
  773.  
  774. You can assume x is positive or negative by sgn(x) := 1 or 
  775. sgn(x) := -1.
  776. e.g. sgn(2) gives 1, sgn(1+i) gives 1.
  777. See also: abs, re, im.
  778.  
  779. * sin
  780. sin(x) is the sine function of x. The angle x is measured in radians.
  781. (multiply by degree to convert from degrees).
  782. See also: asin, csc.
  783.  
  784. * sinh
  785. sinh(x) is the hyperbolic sine function of x. 
  786. sinh(x)=(exp(x)-exp(-z))/2.
  787. See also: asinh, acsch.
  788.  
  789. * solve
  790. solve(x^2===0, x) solves a polynomial ordered up to 4.
  791. solve([expr1===expr2,expr3===expr4], [x,y]) solves systems of linear 
  792.     equations.
  793. It gives all symbolic solutions.
  794. e.g. solve(x^2+5*x+6===0, x), solve([x+y===3, x-y===1], [x,y]).
  795. See also: nsolve.
  796.  
  797. * sqrt
  798. sqrt(x) is the square root function of x. It is the same as x^0.5.
  799. It only gives the principal value (P.V.) (sgn(sqrt(x)) >= 0).
  800. e.g. sqrt(4) gives 2, sqrt(2*i) gives 1+i.
  801. See also: ^.
  802.  
  803. * subs
  804. subs(expr, x=x0)     substitutes x in expr by x0. 
  805. e.g. subs(x^2, x=a) gives a^2.
  806. See also: lim.
  807.  
  808. * sum
  809. sum(f,x,xmin,xmax,dx)    evaluates the sum of f when x runs from xmin
  810.             to xmax with step dx.
  811. sum(f,x,xmin,xmax)    with the default step dx = 1.
  812. e.g. sum(2^n,n,1,5,1.1), sum(x^n,n,1,5).
  813. See also: prod, list, table.
  814.  
  815. * step
  816. step is the separator, the same as the comma (,).
  817. See also: from, to, ,
  818.  
  819. * system
  820. system(DOS) executes the operating system (DOS) command. 
  821. e.g. system(dir).
  822.  
  823. * table
  824. table(f,x,xmin,xmax,dx)    produces a table of the function values when 
  825.             x runs from xmin to xmax with step dx.
  826. table(f,x,xmin,xmax)    with the default step dx = 1.
  827. table(y[x],x,xmin,xmax,dx)     transforms a list y into a table.
  828. e.g. table(x^2,x,1,4,1).
  829. See also: list, plot.
  830.  
  831. * tan
  832. tan(x) is the tangent function of x. The angle x is measured in 
  833. radians (multiply by degree to convert from degrees).
  834. See also: atan, cot.
  835.  
  836. * tanh
  837. tanh(x) is the hyperbolic tangent function of x.
  838. See also: atanh, coth.
  839.  
  840. * to
  841. to is the separator, the same as the comma (,).
  842. See also: from, step, ,.
  843.  
  844. * trunc
  845. trunc(x) converts x to the truncated integer. 
  846. e.g. trunc(2.9) gives 2.
  847. See also: round.
  848.  
  849. * twodim
  850. towdim is a value of the switch output. It forces output in two 
  851. dimension format. 
  852. e.g. output=twodim.
  853. See also: output, off, on, basic, fortran, prolog.
  854.  
  855. * undefined
  856. The built-in constant. It indicates that the value of the expression 
  857. is undefined. 
  858. e.g. the indeterminate forms: 0/0, inf/inf, 0*inf, 0^0. 
  859. Users should try again by lim(f, x=x0).
  860.  
  861. * zero
  862. The right-hand sided value at x=0, as the built-in constant. -zero
  863. is the left-sided limit from the negative direction. e.g. 1+zero is 
  864. to approach to 1 from the positive (+infinity) direction (the right-
  865. hand sided value), and 1-zero is to approach to 1 from the negative
  866. (-infinity) direction (the left-hand sided value), i.e. limit as
  867. zero -> 0. 
  868. e.g. exp(1/(0+zero)) gives inf, exp(1/(0-zero)) gives 0.
  869.  
  870.  
  871. +       add or positive sign.
  872. -       subtract or negative sign.
  873. *       multiply.
  874. /       divide.
  875. ^       power in BASIC, the same as ** in FORTRAN, e.g. 2^3 gives 8.
  876. **      power in FORTRAN, the same as ^ in BASIC.
  877. !       factorial, the same as fac(x), e.g. 3! or fac(3) gives 6.
  878.  
  879. <       less than.
  880. <=      less than.
  881. >       greater than.
  882. >=      greater than.
  883.  
  884. <>      unequal
  885. a <> b gives 1 if a is not equal to b, 0 if a is equal to b, or left 
  886. unevaluated otherwise. It only test two real numbers.
  887. e.g. 2 <> 3 gives 1, 2 <> 2 gives 0.
  888.  
  889. :=    delayed assigment.
  890.  
  891. =       immediate assignment.
  892.  
  893. ==      equal
  894. a==b gives 1 if a is equal to b, 0 if a is not equal to b, or left 
  895. unevaluated otherwise. It can test two complex numbers or expressions.
  896. It gives 1 if a and b are the same expression or left unevaluated otherwise.
  897. e.g. 2==2 gives 1, a==a gives 1.
  898.  
  899. ===     equation sign
  900. e.g. x^6===0
  901.  
  902. ,       comma
  903. The words from, to, step and comma are the same.
  904.  
  905. #       comment statement
  906. e.g. # this is demo.
  907. -------------------------------------------------------------------------
  908.  
  909.  
  910.                         14. References
  911. [1] Huang, W., Proceedings of the workshop on symbolic and numeric 
  912.     computation, Helsinki University, Finland, 1991, p 185-186.
  913. [2] Huang, W., Int. J. Math. Educ. Sci. Tech., 1992, 23(1), 160-165.
  914. [3] Microbit, IEEE Micro, 1992, 12(1), 76.
  915. [4] Huang, W., IEEE Micro, 1992, 12(3), 80.
  916. [5] Huang, W., Abs. Amer. Math. Soc., 1992, 13(3), 343-344.
  917. [6] Huang, W., Abs. Amer. Math. Soc., 1992, 13(5), 518.
  918. [7] Huang, W., Abs. Amer. Math. Soc., 1992, 13(6).
  919. [8] Huang, W., SIGSMALL/PC Notes, 1992, 18(1&2), 63-64.
  920. [9] Long, G., Australian PC World, 1992, June, 117-119.
  921.  
  922.