# $Id: README,v 1.40 2006/10/20 21:26:03 josd Exp $

Euler is an inference engine supporting logic based proofs. It is a backward-chaining
reasoner enhanced with Euler path detection. It has implementations in Java, C#,
Python, Javascript and Prolog. Via N3 it is interoperable with W3C Cwm.


Installation of Euler
---------------------

When you use CVS see http://sourceforge.net/cvs/?group_id=77046
and checkout modules 2004/01swap, 2005/11swap and 2006/02swap in EULER_CVSDIR

Stable file releases of the eulersharp packege can be downloaded from
http://sourceforge.net/project/showfiles.php?group_id=77046
or the latest version can be downloaded from 
http://eulersharp.sourceforge.net/2004/01swap/deployment/Euler.zip
and extract the downloaded file to EULER_INSTALLDIR.


Just running Euler via command line
-----------------------------------

Euler1 Java version: install a JVM platform and either add EULER_CVSDIR/2004/01swap/bin/Euler.jar
or EULER_INSTALLDIR/bin/Euler.jar to your java CLASSPATH and
Usage: java euler.EulerRunner [--step count] [--debug] [--trace] axiom ... [--nope] [--think] [--filter|--query] lemma
Some additional jar files might be required in your classpath
o RDF/XML support requires JENA_INSTALLDIR/lib jar files
o XSD support requires http://eulersharp.sourceforge.net/2004/01swap/lib/xercesImpl.jar
o REGEX support requires http://eulersharp.sourceforge.net/2004/01swap/lib/jakarta-oro-2.0.8.jar

Euler2 C# version: install a .NET platform and either add EULER_CVSDIR/2004/01swap/bin/Release/Euler.exe
or EULER_INSTALLDIR/bin/Release/Euler.exe to your PATH and
Usage: mono Euler.exe [--step count] [--debug] [--trace] axiom ... [--nope] [--think] [--filter|--query] lemma

Euler3 Python version: install a Python platform and
Usage: python euler.py [--why] [--once] [--debug] [input]
One might use java euler.EulerRunner --pass [triples] to produce [input].
Remark that the N3 that is actually understood is very limited:
qnames, () lists, facts and => rules on a single line and not yet [] ; , ^ ! ^^ @

Euler4 Javascript version: install a Javascript platform and
Usage: either via browser or standalone java euler.Euler4 [input]
One might use java euler.EulerRunner --json [triples] to produce [input].
[input] is JSON object language (more or less quoting N3 meta language pieces).
Chained proof output is transformed in a straight way back to N3 facts and rules.
The plan is to convert that JSON chained proof output into some PML output
and meanwhile also have a proof checker.
The JSON names that are used are:
o head    succedent
o body    antecedents
o pred    resource, GND
o args    resources, RPN proof
o src     evidence source
o env     substitution environment
o GND     namespace prefixes, truth predicate

Euler5 Prolog version: install a YAP platform and
Usage: wget -q -O- [input] | yap -l euler.yap -z main.
One might use java euler.EulerRunner --prolog [triples] to produce [input].
[input] is Prolog object language and output is with theorem explanations.
Always start from the N3 and then aggregate and translate the triples and
rules into a Prolog notation.
The Prolog names that are used in the N3 <-> yap tranlation are:
o prefix  namespace prefixes
o feed    n3 sources
o flag    nope or pe
o case    query predicate
o fpath   forward path
o bpath   backward path
o tlit    typed literal
o lf      logical formula


Just running Euler via RESTfull webservice
------------------------------------------

This is done as "webized command line" so same steps as above and
start the Codd webizer in EULER_DATADIR as
java euler.Codd --chatty 0
Check that the port is in fact port 80 when the webizer starts with e.g.
20 Oct 2006 19:18:07 GMT http://yourhost.yourdomain:80/ Codd 1.5.34

The configuration is done in EULER_DATADIR/codd.properties like for instance
http://eulersharp.sourceforge.net/2004/01swap/codd.properties

For that example it should be no problem to find some evidence for the mapped service
http://localhost/medService?WHO=Ann
or for the straight webized command line
http://localhost/.cwm+http%3A%2F%2Fwww.agfa.com%2Fw3c%2Feuler%2FmedP.n3+http%3A%2F%2Fwww.agfa.com%2Fw3c%2Feuler%2Frpo-rules.n3+-think+-filter%3Dhttp%3A%2F%2Fwww.agfa.com%2Fw3c%2Feuler%2FmedF.n3+-why

For euler5 the picture looks like

                  REST
                   /\
                   || N3
                   \/
             ,------------,
             |    Codd    |
             |     /\     |
             |     || Yap |
             |     \/     |
             | ,--------, |
             | | Euler5 | |
             | '--------' |
             '------------'

and can be tested with for instance
wget -q -O- http://localhost/.euler5+http%3A%2F%2Flocalhost%2F.euler%2B--prolog%2Bhttp%253A%252F%252Fwww.agfa.com%252Fw3c%252Feuler%252Fmedic.n3%2B--query%2Bhttp%253A%252F%252Fwww.agfa.com%252Fw3c%252Feuler%252FmedicF.n3
