Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mehrab-kalantari/cnf-dnf-convertor

Java code to convert every logical formula to conjunctive normal form and disjunctive normal form
https://github.com/mehrab-kalantari/cnf-dnf-convertor

java logic logical-forms logical-formulas logical-foundations

Last synced: about 2 months ago
JSON representation

Java code to convert every logical formula to conjunctive normal form and disjunctive normal form

Awesome Lists containing this project

README

        

# CNF-DNF-Convertor
Java code to convert every logical formula to conjunctive normal form and disjunctive normal form

## Java code
Use simple names for variables like p, q, r.
#####
Use the following characters for operators
* and: &
* or: |
* negation: ~
* implication: ->
* equivalence: <->

## Remember to put parentheses around each formula
Correct samples: ((p->q)&p) - (~(p->q))|(p&(~q))
#####
Wrong samples: (p->q)&p - ~(p->q) - p&(~q) - (p&~q)