Pyke: Python Knowledge Engine
Both forward-chaining and backward-chaining rules (which may include python
code) are compiled into python. Can also automatically assemble python
programs out of python functions which are attached to backward-chaining
COPYRIGHT AND LICENSE:
This is published under the MIT License. The copyright and license are in
the file "copyright_license".
The documentation is at:
You can download a copy of this documentation to your hard drive:
See the end of this file for how to regenerate the html files.
Pyke requires python 2.5 (or later 2.x release). Check with:
$ python2.5 --version
or $ python --version
You can download this at:
To install pyke with easy_install, at the shell prompt just type:
$ easy_install-2.5 pyke
If you don't have easy_install, you should install it:
then (as root) run: $ python2.5 ez_setup.py
Otherwise, you'll also need ply 2.3 from:
This can be checked as follows:
>>> from ply import lex
Then you got two choices for pyke:
The pyke source distribution is the file:
This contains the pyke source code, documentation (both source and html), and
examples (currently only one example).
TO INSTALL FROM THE SOURCES:
$ python2.5 setup.py install
To run doctests on all *.py files in the pyke directory, cd to the pyke
COMPILING THE COMPILER.KRB FILE:
>>> from pyke import compiler
>>> compiler.compile('.', 'compiled_krb', ('compiler.krb',))
$ cp compiled_krb/compiler_bc.py .
$ rm -rf compiled_krb
Currently there is only one example. Read its README file for how to run it.
COMPILING THE DOCUMENTATION:
To compile the documentation into html, you'll need docutils and rest2web.
If you're running linux, your distro may have packages for these already.
Or you can:
$ easy_install-2.5 rest2web
I used version 0.4.1 of docutils and 0.5.0 of rest2web. I don't know if
earlier versions work OK or not.
To check your versions:
>>> import docutils
>>> import rest2web
If your linux distro doesn't have packages for these, and you don't want to
use easy_install, you can get them at:
To regenerate the html, cd to the doc directory and:
$ r2w r2w.ini
This regenerates everything from doc/source into doc/html. It takes about
2 seconds to run.
If you want to run doctest on all of the *.txt files in doc/source,
cd to doc and: