== Content ==

With this program you can check if the derivation of a
predicate logic formula is correct.


== Syntax ==

Formulas are encoded as follows:
  * Variables are strings: A, B, Sunny, Raining, ...
  * Conjunctions:   (phi /\ psi)
  * Disjunctions:   (phi \/ psi)
  * Negations:      ~phi
  * Implications:   (phi -> psi)
  * Biimplications: (phi <-> psi)

Derivations are files with one derivation step per line. A derivation
step has the following format:

  <formula> | <rule> | <rule parameters>

where <formula> is the formula that you want to derive next, <rule>
is the name of the rule that you use, and <rule parameters> are the
line numbers of the formulas that are used in the rule.

For an example, have a look at the file proof.txt and read the 
documentation for details (in particular in logic/proofs/Parser.java
and logic/proofs/rules/Calculus.java).


== Compiling and Executing the Program ==
   === Variant 1 (Eclipse) ===
The archive contains a project that you can open with the IDE Eclipse.
To execute, enter the path of the file with the derivation under
"Run Configurations" -> "Arguments".

   === Variant 2 (Console) ===
Open a console and navigate to the directory containing this README
file. Enter the following commands to compile the program.

$ cd src
$ javac logic/proofs/ProofChecker.java

Note that you have to have an installed Java compiler on your computer.

To check your derivation, call the program with the following command.

$ java logic.proofs.ProofChecker ../proof.txt

== Output ==

If the derivation is correct, the derived formula and all used
assumptions are printed. If there is an error in the derivation
an error message describes the step that failed to be verified.
