Skip to content

Commit

Permalink
Added README and LICENSE.
Browse files Browse the repository at this point in the history
  • Loading branch information
snim2 committed May 16, 2010
1 parent 9e678cc commit f7f6f3b
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 0 deletions.
14 changes: 14 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Copyright (C) Sarah Mount, 2010.

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have rceeived a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
63 changes: 63 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@

This is a simple tautology checker, written in Java, as a teaching
tool.

It uses an operator-precendence parser to parse a file containing a
proposition and print out a trace which contains the syntax tree of
the original proposition, its negative normal form, conjunctive normal
form and whether or not the proposition is a tautology.

The language parse by the checker is the following:

Prop ::= FF
| TT
| NOT Prop
| Prop AND Prop
| Prop OR Prop
| Prop => Prop
| Prop AND Prop
| ( Prop )

There are a number of examples in the tests/ directory and a UNIX
shell script (check.sh) which takes a file name and calls the checker.

For example:

$ javac checker/Checker.java
$ java checker.Checker tests/peirces_law.prop

A Tautology Checker for Propositional Calculus
------------------------------------------------

Input file: tests/peirces_law.prop
----------
((P => Q)=>P)=>P



Abstract syntax tree:
--------------------
((P => Q) => P) => P

RESULT OF formula.removeImplications():
--------------------------------------
(!(!(!P \/ Q) \/ P) \/ P)

RESULT OF formula.toNnf():
-------------------------
(((!P \/ Q) /\ !P) \/ P)

RESULT OF formula.nnfToCnf():
----------------------------
(((!P \/ Q) \/ P) /\ (!P \/ P))

RESULT OF formula.simplifyCnf():
-------------------------------
TRUE

Your formula is a tautology.

$


-- Sarah Mount 2010.

0 comments on commit f7f6f3b

Please sign in to comment.