From: Sam H. v. a. <we...@ma...> - 2007-09-26 20:02:44
|
Log Message: ----------- test pod Added Files: ----------- pg/doc/MathObjects: README.pod Revision Data ------------- --- /dev/null +++ doc/MathObjects/README.pod @@ -0,0 +1,201 @@ +=head1 NAME + +MathObjects - Object system for manipulating mathematics in PG. + +=head1 OVERVIEW + +This directory contains the documentation for a new +mathematical-expression parser written in perl. It was developed for +use with the WeBWorK on-line homework system, but it can be used in +any perl program. + +The goal was to process vector-valued expressions, but the parser was +designed to be extensible, so that you could add your own functions, +operators, and data types. It is still a work in progress, but should +provide a framework for building more sophisticated expression handling. + +Currenlty, the parser understands: + +=over + +=item * real and complex numbers, + +=item * points, vectors, and matrices (with real or complex entries) + +=item * arbitrary lists of elements + +=item * intervals and unions of intervals + +=item * predefined strings like 'infinity' + +=back + +Some other useful features are that you can write sin^2 x for (sin(x))^2 +and sin^-1 x for arcsin(x), and so on. + +Most of the documentation still needs to be written, but you can get some +ideas from the samples in the problems and extensions directories, and by +reading the files in the docs directory. + +=head1 INSTALLATION + +The parser should already be installed as part of the WeBWorK 2.1 +distribution, so you should not need to install it separately. If you +don't seem to have it installed, then it can be obtained from the +Union CVS repository at http://devel.webwork.rochester.edu/twiki/bin/view/Webwork/WeBWorKCVS + +The README file in that directory contains the installation instructions. + +=head1 SAMPLE FILES + +Sample problems are given in the problems and extensions directories. Move +these to the templates directory of a course where you want to test the +Parser, and move the contents of the macros directory to that course's +macros directory. + +Now try looking at these problems using the Library Browser. Edit the +source to see how they work, and to read the comments within the code +itself. + +=head1 EXAMPLE FILES + +The 'problems' directory contains several examples that show how to use +Parser within your problem files. + +=over + +=item problems/sample01.pg + +Uses the parser to make a string into a formula that you can +evaluate and print in TeX form + +=item problems/sample02.pg + +Shows how to create formulas using perl's usual mathematical +expressions rather than character strings. + +=item problems/sample03.pg + +Shows how to use the parser's differentiation abilities. + +=item problems/sample04.pg + +=item problems/sample05.pg + +Use the parser in conjunction with the graphics macros to generate +function graphs on the fly. These also show how to create a +perl function to evaluate an expression. + +=item problems/sample06.pg + +Shows some simple use of vectors in a problem. + +=item problems/sample07.pg + +Example if using the build-in Real object and its answer +checker + +=item problems/sample08.pg + +Uses complex numbers and the built-in checker + +=item problems/sample09.pg + +=item problems/sample10.pg + +Demonstrates points and vectors and their answer checkers + +=item problems/sample11.pg + +=item problems/sample12.pg + +Shows the answer checkers for intervals and unions. + +=item problems/sample13.pg + +=item problems/sample14.pg + +=item problems/sample15.pg + +Demonstrate various list checkers, including a check for the +word 'NONE', which is a predefined string. + +=item problems/sample16.pg + +=item problems/sample17.pg + +=item problems/sample18.pg + +These show the multi-variable function checker in use (for +functions of the form R->R, R^2->R and R->R^3). + +=item problems/sample19.pg + +Uses the function checker to implement a "constant" that can +be used in formulas. + +=item problems/sample20.pg + +Shows how to use the parser's substitution abilities. + +=item problems/sample21.pg + +Checks for a list of points. + +=item problems/sample22.pg + +Shows how to provide named constants that the student can +use in his answer. + +=back + +The 'examples' directory contains samples that show how to extend the +parser to include your own functions, operators, and so on. There are also +some samples of how to call the methods available for Formula objects +generated by the parser, and what some error messages look like. + +=over + +=item examples/1-function.pg + +Adds a single-variable function to the parsers list of functions. + +=item examples/2-function.pg + +Adds a two-variable function to the parser. + +=item examples/3-operator.pg + +Adds a binary operator to the parser. (Unary operators are similar.) + +=item examples/4-list.pg + +Adds a new "list type" object. In this case, it's really an +operation [n,r] that returns n choose r. + +=item examples/5-list.pg + +Add a new "equality" operator that you can use to handle answers +like "x+y=0". + +=item examples/6-precedence.pg + +Shows an experimental precedence setting that can be used to make +sin 2x return sin(2x) rather than (sin(2))x. + +=item examples/7-context.pg + +Shows how to switch contexts (in this case, to complex and to vector +contexts), and how this affects the parsing. + +=item examples/8-answer.pg + +Implements a simple vector-valued answer checker using the +parser's computation and comparison ability. + +=back + +=head1 SEE ALSO + +L<problems/sample01.pg>. + |