Copyright | (c) Artem Mavrin 2021 |
---|---|
License | BSD3 |
Maintainer | artemvmavrin@gmail.com |
Stability | experimental |
Portability | POSIX |
Safe Haskell | Safe |
Language | Haskell2010 |
Check provability of general propositional formulas using an algorithm derived from
- Richard Statman (1979) "Intuitionistic propositional logic is polynomial-space complete." Theoretical Computer Science, Volume 9, Issue 1, pp. 67–72. DOI.
Documentation
proveStatman :: Ord a => Judgement a -> Maybe (Proof a) Source #
Find an intuitionistic proof of a judgement, if one exists, using Statman's algorithm.
- Richard Statman (1979) "Intuitionistic propositional logic is polynomial-space complete." Theoretical Computer Science, Volume 9, Issue 1, pp. 67–72. DOI.
The judgement to be proved is converted to an implicational judgement as
described in toImp
and proved (if possible) using proveImp
. The resulting
proof is then converted into a proof of the original judgement.
toImp :: Ord a => Judgement a -> Judgement (Formula a) Source #
Convert a general propositional judgement into an implicational judgement which is intuitionistically provable if and only if the original judgement is intuitionistically provable.
This construction is due to
- Richard Statman (1979) "Intuitionistic propositional logic is polynomial-space complete." Theoretical Computer Science, Volume 9, Issue 1, pp. 67–72. DOI.
Details
This algorithm turns a judgement \(g \vdash a\) in full propositional logic
into a judgement \(g^* \vdash a^*\) in just the implicational fragment of
propositional logic such that \(g \vdash a\) is provable if and only if the
judgement \(g^* \vdash a^*\) is provable. The latter judgement's provability
can then be checked using proveImp
.
The transformation from \(g \vdash a\) to \(g^* \vdash a^*\) involves two steps:
- For each propositional formula \(b\), introduce a new propositional variable \(x_b\). Take \(a^* = x_a\).
Construct the set \(g^*\) as follows.
- For each formula \(b \in g\), add \(x_b\) to \(g^*\).
- (Truth) Add \(x_\top\) to \(g^*\).
For each subformula \(b\) of either \(a\) or a formula in \(g\), do the following.
- (Falsity elimination and truth introduction) Add the following formulas to \(g^*\). \[ \begin{gathered} x_\bot \rightarrow x_b \\ x_b \rightarrow x_\top \end{gathered} \]
- (Negation introduction and elimination) If \(b = \lnot c\), then add the following formulas to \(g^*\). \[ \begin{gathered} (x_c \rightarrow x_\bot) \rightarrow x_{\lnot c} \\ x_{\lnot c} \rightarrow (x_c \rightarrow x_\bot) \end{gathered} \]
- (Implication introduction and elimination) If \(b = c \rightarrow d\), then add the following formulas to \(g^*\). \[ \begin{gathered} (x_c \rightarrow x_d) \rightarrow x_{c \rightarrow d} \\ x_{c \rightarrow d} \rightarrow (x_c \rightarrow x_d) \end{gathered} \]
- (Disjunction introduction and elimination) If \(b = c \lor d\), then for each additional subformula \(e\) of \(a\), add the following formulas to \(g^*\). \[ \begin{gathered} x_c \rightarrow x_{c \lor d} \\ x_d \rightarrow x_{c \lor d} \\ x_{c \lor d} \rightarrow ((x_c \rightarrow x_e) \rightarrow ((x_d \rightarrow x_e) \rightarrow x_e)) \end{gathered} \]
- (Conjunction introduction and elimination) If \(b = c \land d\), then add the following formulas to \(g^*\). \[ \begin{gathered} x_c \rightarrow (x_d \rightarrow x_{c \land d}) \\ x_{c \land d} \rightarrow x_c \\ x_{c \land d} \rightarrow x_d \end{gathered} \]
- (Equivalence introduction and elimination) If \(b = c \leftrightarrow d\), then add the following formulas to \(g^*\). \[ \begin{gathered} (x_c \rightarrow x_d) \rightarrow ((x_d \rightarrow x_c) \rightarrow x_{c \leftrightarrow d}) \\ x_{c \leftrightarrow d} \rightarrow (x_c \rightarrow x_d) \\ x_{c \leftrightarrow d} \rightarrow (x_d \rightarrow x_c) \end{gathered} \]