readme
This commit is contained in:
parent
d781334419
commit
c344be1bea
2 changed files with 30 additions and 0 deletions
2
Main.hs
2
Main.hs
|
@ -2,6 +2,7 @@ module Main where
|
||||||
|
|
||||||
import Logic.Parse (eof, mkInput, ParseError(..))
|
import Logic.Parse (eof, mkInput, ParseError(..))
|
||||||
import Logic.Statement.Parse (stmt)
|
import Logic.Statement.Parse (stmt)
|
||||||
|
import Logic.Statement.Eval (bucket)
|
||||||
import Logic.Statement.Serialize (serializeLatexTruthTable)
|
import Logic.Statement.Serialize (serializeLatexTruthTable)
|
||||||
|
|
||||||
main :: IO ()
|
main :: IO ()
|
||||||
|
@ -11,6 +12,7 @@ main = do
|
||||||
Left err -> fail err
|
Left err -> fail err
|
||||||
Right statement -> do
|
Right statement -> do
|
||||||
putStrLn $ show statement
|
putStrLn $ show statement
|
||||||
|
putStrLn $ show $ bucket statement
|
||||||
putStr $ serializeLatexTruthTable statement
|
putStr $ serializeLatexTruthTable statement
|
||||||
where
|
where
|
||||||
fail err@(ParseError pos message) =
|
fail err@(ParseError pos message) =
|
||||||
|
|
28
readme.md
Normal file
28
readme.md
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
Statement logic !!!
|
||||||
|
|
||||||
|
# Compile it
|
||||||
|
|
||||||
|
```sh
|
||||||
|
make
|
||||||
|
```
|
||||||
|
|
||||||
|
# Usage
|
||||||
|
|
||||||
|
```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}
|
||||||
|
```
|
Loading…
Add table
Add a link
Reference in a new issue