https://github.com/princemaple/splee
Simple Propositional Logic Expression Evaluation - Haskell
https://github.com/princemaple/splee
Last synced: about 1 year ago
JSON representation
Simple Propositional Logic Expression Evaluation - Haskell
- Host: GitHub
- URL: https://github.com/princemaple/splee
- Owner: princemaple
- License: mit
- Created: 2013-03-13T14:11:02.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2013-04-14T03:17:19.000Z (about 13 years ago)
- Last Synced: 2025-03-17T20:13:31.290Z (over 1 year ago)
- Language: Haskell
- Size: 209 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
## Simple Propositional Logic Expression Evaluation
### - Written in Haskell
This program simplifies and evaluates propositional logic expression
* the result may or may not be in its simplest form if it cannot be evaluated to a sinlge value
* if can be evaluated to a single value, it has to be the simplest form
It will print out:
1. How the program understands your input
2. The evaluated result
## Usage
$ ghc --make logic.hs
$ logic
((((A => B) | A) & ~B) => f)
**Outer brackets can be omitted:**
(((A => B) | A) & ~B) => f
**Spaces can be ommited:**
(((A=>B)|A)&~B)=>f
**Output for the sample input above:**
*output uses `V` for disjunction*
((((A => B) V A) & ~B) => f)
((A V B) & (~A V B))
proposition variable: `Single Capital Character`
not: `~`
conjunction: `&`
disjunction: `|`
implication: `=>`
tautology: `t`
contradiction: `f`
*By Po Chen*
*chenpaul914@gmail.com*
*[pochen.me](http://pochen.me/)*