Skip to main content

ND-Prover

A Fitch-style natural deduction proof generator and checker, implemented in Python.

Supports propositional logic and the modal logics K, T, S4, and S5, as well as their first-order counterparts, FOL and FOML. Includes countermodel generation for invalid arguments.

ND-Prover Demo

Try ND-Prover online at ndprover.org.

Development Roadmap

  • TFL — Propositional logic proof generator

    • Public alpha
    • Stable release
  • ML — Modal logic proof generator

    • Public alpha
    • Stable release
  • FOL — First-order logic proof generator

    • Public alpha
    • Stable release
  • FOML — First-order modal logic proof generator

    • Public alpha
    • Stable release

Package Installation

ND-Prover can be installed using pip:

pip install nd-prover

or by directly cloning the git repository:

git clone https://github.com/daniyal1249/nd-prover.git

and running the following in the cloned repo:

pip install .

Package Example Usage

$ nd-prover
Select logic (TFL, FOL, MLK, MLT, MLS4, MLS5, FOMLK, FOMLT, FOMLS4, FOMLS5): TFL
Enter premises (separated by "," or ";"), or "NA" if none: P -> Q, P
Enter conclusion: Q

 1 │ P → Q      PR
   │
 2 │ P          PR
   ├───

1 - Add a new line
2 - Begin a new subproof
3 - End the current subproof
4 - End the current subproof and begin a new one
5 - Delete the last line

Select edit: 1
Enter line: Q ; ->E, 1,2

 1 │ P → Q      PR
   │
 2 │ P          PR
   ├───
 3 │ Q          →E, 1,2

Proof complete! 🎉

A proof of the law of excluded middle (LEM) using ND-Prover:

Proof of  ∴ P ∨ ¬P
──────────────────

 1 │ │ ¬(P ∨ ¬P)       AS
   │ ├───────────      
 2 │ │ │ P             AS
   │ │ ├───            
 3 │ │ │ P ∨ ¬P        ∨I, 2
   │ │ │               
 4 │ │ │ ⊥             ¬E, 1,3
   │ │                 
 5 │ │ ¬P              ¬I, 2-4
   │ │                 
 6 │ │ P ∨ ¬P          ∨I, 5
   │ │                 
 7 │ │ ⊥               ¬E, 1,6
   │                   
 8 │ P ∨ ¬P            IP, 1-7

Proof complete! 🎉

A proof that identity is symmetric:

Proof of  ∴ ∀x∀y(x = y → y = x)
───────────────────────────────

 1 │ │ a = b                  AS
   │ ├───────                 
 2 │ │ a = a                  =I
   │ │                        
 3 │ │ b = a                  =E, 1,2
   │                          
 4 │ a = b → b = a            →I, 1-3
   │                          
 5 │ ∀y(a = y → y = a)        ∀I, 4
   │                          
 6 │ ∀x∀y(x = y → y = x)      ∀I, 5

Proof complete! 🎉

A proof in modal logic S5:

Proof of ◇☐A ∴ ☐A
─────────────────

 1 │ ◇☐A          PR
   ├─────         
 2 │ ¬☐¬☐A        Def◇, 1
   │              
 3 │ │ ¬☐A        AS
   │ ├─────       
 4 │ │ │ ☐        AS
   │ │ ├───       
 5 │ │ │ ¬☐A      R5, 3
   │ │            
 6 │ │ ☐¬☐A       ☐I, 4-5
   │ │            
 7 │ │ ⊥          ¬E, 2,6
   │              
 8 │ ☐A           IP, 3-7

Proof complete! 🎉

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nd_prover-3.0.0.tar.gz (28.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nd_prover-3.0.0-py3-none-any.whl (28.8 kB view details)

Uploaded Python 3

File details

Details for the file nd_prover-3.0.0.tar.gz.

File metadata

  • Download URL: nd_prover-3.0.0.tar.gz
  • Upload date:
  • Size: 28.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.2

File hashes

Hashes for nd_prover-3.0.0.tar.gz
Algorithm Hash digest
SHA256 a7e977fb225bb90a885b0b15b084455855ec6ca45a3cacf2b95dc123c1722d9a
MD5 6c2f48cd2dc2e3d2776bbf6bd134d424
BLAKE2b-256 23f2300afa10bc621cc4a1ad357a446c7e999a57d4af82d3a2aa9974d785be35

See more details on using hashes here.

File details

Details for the file nd_prover-3.0.0-py3-none-any.whl.

File metadata

  • Download URL: nd_prover-3.0.0-py3-none-any.whl
  • Upload date:
  • Size: 28.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.2

File hashes

Hashes for nd_prover-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eccc25b8a1948b63938f37f29ac03229c0f2bccf0b8002738e3681299907e06d
MD5 0ce969167cffe470aca82e86a872e17c
BLAKE2b-256 69412587cb81af2f81dfad68d32b13be5dd987f3d46bb115d781e8f365d00868

See more details on using hashes here.

Release history Release notifications | RSS feed

3.1.0

2 files

This release

3.0.0 This release

2 files

2.1.0

2 files

2.0.0

2 files

1.0.1

2 files

1.0.0

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page