forked from i-loder-matthew/RadicalLF
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPrintProof.hs
26 lines (21 loc) · 935 Bytes
/
PrintProof.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
module PrintProof where
import Prelude hiding ((<>))
import QRT
import QRTProofSearch
import TreeUtils
import Text.PrettyPrint
printProofs :: [ProofTree] -> Doc
printProofs ps = vcat $ map (\p -> (char ' ' $+$ prettyProofTree p)) ps
prettyProofTree :: ProofTree -> Doc
prettyProofTree (LRule seq t1 t2) =
text " " <> (prettyProofTree t2 $+$ prettyProofTree t2 $+$ prettySequent seq) <> text " :L"
prettyProofTree (RRule seq t) =
text " " <> (prettyProofTree t $+$ prettySequent seq) <> text " :R"
prettyProofTree (QRE seq t) =
text " " <> (prettyProofTree t $+$ prettySequent seq) <> text " :QRE"
prettyProofTree (QRR seq t) =
text " " <> (prettyProofTree t $+$ prettySequent seq) <> text " :QRR"
prettyProofTree (Axiom seq) = text " " <> (prettySequent seq) <> text " :Ax"
prettyProofTree (NoRule seq) = text " " <> (prettySequent seq) <> text " :NR"
prettySequent :: Sequent -> Doc
prettySequent s = text (show s)