28 lines
689 B
Markdown
28 lines
689 B
Markdown
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}
|
|
```
|