48 lines
1 KiB
Markdown
48 lines
1 KiB
Markdown
# statement logic !!!
|
|
|
|
see [Logic/readme.md](Logic) for more details about what's here
|
|
|
|
## requirements
|
|
|
|
- a haskell compiler e.g. GHC
|
|
- cabal the haskell build system if you want
|
|
- [containers](https://hackage.haskell.org/package/containers)
|
|
|
|
## compile it
|
|
|
|
```sh
|
|
make
|
|
```
|
|
|
|
or look in [`Makefile`](Makefile)
|
|
|
|
or
|
|
|
|
```sh
|
|
cabal build
|
|
```
|
|
|
|
I guess...
|
|
|
|
## usage
|
|
|
|
only this kind of this has been implemented in the main function so far:
|
|
|
|
```sh
|
|
echo '((p->q)<->(!q->!p))' | ./logic
|
|
```
|
|
|
|
### output
|
|
|
|
```
|
|
Iff (Implies (Atom "p") (Atom "q")) (Implies (Not (Atom "q")) (Not (Atom "p")))
|
|
Tautology
|
|
\begin{tabular}{cc||cccccc|c|cccccccc}
|
|
$p$ & $q$ & $($ & $($ & $p$ & $\to $ & $q$ & $)$ & $\leftrightarrow $ & $($ & $\neg $ & $q$ & $\to $ & $\neg $ & $p$ & $)$ & $)$ \\
|
|
\hline
|
|
0 & 0 & & & 0 & 1 & 0 & & \textbf 1 & & 1 & 0 & 1 & 1 & 0 & & \\
|
|
0 & 1 & & & 1 & 0 & 0 & & \textbf 1 & & 1 & 0 & 0 & 0 & 1 & & \\
|
|
1 & 0 & & & 0 & 1 & 1 & & \textbf 1 & & 0 & 1 & 1 & 1 & 0 & & \\
|
|
1 & 1 & & & 1 & 1 & 1 & & \textbf 1 & & 0 & 1 & 1 & 0 & 1 & & \\
|
|
\end{tabular}
|
|
```
|