summaryrefslogtreecommitdiff
path: root/app/Main.hs
diff options
context:
space:
mode:
authorMirek Kratochvil <exa.exa@gmail.com>2022-10-15 20:47:20 +0200
committerMirek Kratochvil <exa.exa@gmail.com>2022-10-15 20:47:20 +0200
commitcbd6aa4021f744be7301e9d5b6fce2c6c98c46ae (patch)
treef8badcd8ab16bc619b31dad0e7777231ebe2f38b /app/Main.hs
parent31c20628ea7bc85da8ae3f479d418832cf77bfca (diff)
downloadprlg-cbd6aa4021f744be7301e9d5b6fce2c6c98c46ae.tar.gz
prlg-cbd6aa4021f744be7301e9d5b6fce2c6c98c46ae.tar.bz2
cuts
Diffstat (limited to 'app/Main.hs')
-rw-r--r--app/Main.hs45
1 files changed, 25 insertions, 20 deletions
diff --git a/app/Main.hs b/app/Main.hs
index be4febe..c2f03ee 100644
--- a/app/Main.hs
+++ b/app/Main.hs
@@ -1,27 +1,32 @@
module Main where
import Interpreter
-
+import Text.Pretty.Simple
import qualified Data.Map as M
+ppr :: Show a => a -> IO ()
+ppr = pPrintOpt CheckColorTty defaultOutputOptionsDarkBg {outputOptionsCompactParens = True, outputOptionsIndentAmount = 2, outputOptionsPageWidth=80}
+
main :: IO ()
-main =
- print $
- prove [Goal, U (Struct (1, 2)), U (Atom 1), U (Atom 2), LastCall] $
- M.fromList
- [ ( (1, 2)
- , [ [U (Atom 333), U (Atom 444), NoGoal]
- , [ U (Atom 1)
- , U (Atom 2)
- , Goal
- , U (Struct (2, 0))
- , Call
- , Goal
- , U (Struct (1, 2))
- , U (Atom 333)
- , U (Atom 444)
- , LastCall
+main = do
+ let (res, interp) =
+ prove [Goal, U (Struct (1, 2)), U (Atom 1), U (Atom 2), LastCall] $
+ M.fromList
+ [ ( (1, 2)
+ , [ [U (Atom 333), U (Atom 444), NoGoal]
+ , [ U (Atom 1)
+ , U (Atom 2)
+ , Goal
+ , U (Struct (2, 0))
+ , Call
+ , Goal
+ , U (Struct (5, 2))
+ , U (Atom 333)
+ , U (Atom 444)
+ , LastCall
+ ]
+ ])
+ , ((2, 0), [[NoGoal]])
]
- ])
- , ((2, 0), [[NoGoal]])
- ]
+ ppr interp
+ ppr res