Statement logic in Haskell
Find a file
2025-08-12 13:29:08 +00:00
Logic tidy: del unused Eq, add custom Show 2025-08-12 13:29:08 +00:00
.gitignore separate into files, parser error messages 2025-08-08 04:29:01 +00:00
Main.hs typo: Main.hs 2025-08-08 04:57:54 +00:00
Makefile makefile weirdness with $ 2025-08-08 05:01:52 +00:00
readme.md readme: separate readmes 2025-08-12 08:13:03 +00:00

statement logic !!!

see Logic/readme.md for more details about what's here

requirements

a haskell compiler e.g. GHC

compile it

make

or look in Makefile

usage

only this has been implemented in the main function:

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}