GithubHelp home page GithubHelp logo

sramakrishnan247 / proveme Goto Github PK

View Code? Open in Web Editor NEW
5.0 3.0 1.0 52 KB

A Theorem Prover for Propositional Logic

License: MIT License

Java 100.00%
java artificial-intelligence propositional-logic theorem-proving theorem-prover

proveme's Introduction

ProveMe: A Theorem Prover for Propositional Logic

Java CI with Maven License MIT

About

This framework proves sentences by resolution refutation given an input Knowledge base.

Requirements πŸ”§

  • Java version 8 or higher.

Installation πŸ”Œ

  1. Press the Fork button (on the top right corner of the page) to save a copy of this project on your account.

  2. Download the repository files (project) from the download section or clone this project by typing in the bash the following command:

    git clone https://github.com/sramakrishnan247/ProveMe
    
  3. Import the project using Intellij Ide(or any other Ide or your favorite text editor)

  4. Save your file in "./src/main/resources/your_file.txt";

  5. Give your filename and run the application from Main.java :D

Input format:

The input file starts with a line β€œKnowledge Base:” and then follows with sentences separated by blank lines. Once the KB is loaded, add the sentences that reads "Prove the following sentences by refutation:" followed by the sentences that need refutation. You can find sample input files in src/main/resources/.

Sample run

Input

Knowledge Base:

( Rain && Outside ) => Wet

( Warm && ~Rain ) => Pleasant

~Wet

Outside

Warm

Prove the following sentences by refutation:

Pleasant

Rain

Output

KB expressions
( Rain && Outside ) => Wet
( Warm && ~Rain ) => Pleasant
~Wet
Outside
Warm

Sentences to be proved:
Pleasant
Rain

Theorem Prover working...
-------------------------------------------------



Knowledge base
[~Rain v ~Outside v Wet , ~Warm v Rain v Pleasant , ~Wet , Outside , Warm ]

To prove: Pleasant

Resolution as follows...

Resolving...
~Rain v ~Outside v Wet 
~Warm v Rain v Pleasant 
------------------------------------------
~Outside v Wet v ~Warm v Pleasant 

Resolving...
~Pleasant 
~Outside v Wet v ~Warm v Pleasant 
------------------------------------------
~Outside v Wet v ~Warm 

Resolving...
~Outside v Wet v ~Warm 
Outside 
------------------------------------------
Wet v ~Warm 

Resolving...
Wet v ~Warm 
Warm 
------------------------------------------
Wet 

Resolving...
Wet 
~Wet 
------------------------------------------


KB entails: Pleasant




Knowledge base
[~Rain v ~Outside v Wet , ~Warm v Rain v Pleasant , ~Wet , Outside , Warm ]

To prove: Rain

Resolution as follows...

Resolving...
Outside 
~Rain v ~Outside v Wet 
------------------------------------------
~Rain v Wet 

Resolving...
~Wet 
~Rain v Wet 
------------------------------------------
~Rain 

Resolving...
~Warm v Rain v Pleasant 
~Rain 


------------------------------------------
~Warm v Pleasant 

Resolving...
~Warm v Pleasant 
Warm 
------------------------------------------
Pleasant 

KB contains: 
[~Rain , Pleasant ]
No new clauses were added to KB
FAILURE!!
KB does not entail: Rain


[true, false]

Implementation outline

  • Input parser
  • Postfix conversion
  • Expression Tree construction
  • Literal, clause and expression utilities.
  • Resolution algorithm.

References

Resolution Theorem Proving

proveme's People

Contributors

sramakrishnan247 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

bluelight1324

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.