forked from IagoAbal/haskell-z3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Examples.hs
63 lines (56 loc) · 1.44 KB
/
Examples.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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
module Main where
import qualified Example.Monad.Queens4
import qualified Example.Monad.Queens4All
import qualified Example.Monad.DataTypes
import qualified Example.Monad.FuncModel
import qualified Example.Monad.MutuallyRecursive
import qualified Example.Monad.Quantifiers
import qualified Example.Monad.QuantifierElimination
import qualified Example.Monad.ToSMTLib
import qualified Example.Monad.Tuple
import qualified Example.Monad.ParserInterface
import System.Environment
examples =
[ ("4queens"
, Example.Monad.Queens4.run
)
, ("all4queens"
, Example.Monad.Queens4All.run
)
, ("datatypes"
, Example.Monad.DataTypes.run
)
, ("funcModel"
, Example.Monad.FuncModel.run
)
, ("mutuallyRecursive"
, Example.Monad.MutuallyRecursive.run
)
, ("quantifiers"
, Example.Monad.Quantifiers.run
)
, ("quantifierElimination"
, Example.Monad.QuantifierElimination.run
)
, ("smtlib"
, Example.Monad.ToSMTLib.run
)
, ("tuple"
, Example.Monad.Tuple.run
)
, ("parserInterface"
, Example.Monad.ParserInterface.run
)
]
runExample :: String -> IO ()
runExample x = case lookup x examples of
Just x -> x
Nothing -> error "Example not found"
listExamples :: IO ()
listExamples = mapM_ (putStrLn . fst) examples
main = do
args <- getArgs
if null args
then listExamples
else case args !! 0 of
x -> runExample x