This is a (ctypes) Python wrapper for the procedural interface to REDUCE (http://reduce-algebra.com/). The interface is stack based so you can embed REDUCE procedurally into Python, not just as text interface.
There is a really sophisticated embedding of this interface into Pure, an excellent modern-style functional programming language based on term rewriting (http://purelang.bitbucket.org/) . If you want to use REDUCE for productive tasks we suggest to use that one as it is much more suited for symbolic tasks than Python. See also: http://puredocs.bitbucket.org/pure-reduce.html
The file reduce.py is only a low level wrapper with a class hack Expr which shows how to interact between objects. There are many ways to implement high level tasks.
One needs to build the REDUCE procedural (C) interface:
- Get the code from http://sourceforge.net/p/reduce-algebra/code/HEAD/tree/ or svn checkout svn://svn.code.sf.net/p/reduce-algebra/code/trunk
- Read trunk/csl/new-embedded/README, make the procedural and reduce-image items to get reduce.img and reduce.lib (or .dll on Windows).
- Adjust the path to reduce.img and reduce.lib in reduce.py
- Do the tests for usage examples.
REDUCE License Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the relevant copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.