-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main.hs
43 lines (40 loc) · 2.62 KB
/
Main.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
module Main where
import System.Environment(getArgs)
import Experiments(
TypeExperiment(CTL, LTL, LTLc),
randomExperiment,
seedsExperiment,
thesisExperiments,
ltlExperiment
)
import Examples(examples)
main::IO ()
main = do
args <- getArgs
case args of
-- Random experiment comparing with nuXmv.
["random", "nuXmv", experiment, n_vars, forms_n] -> random_exp experiment n_vars forms_n True
-- Random experiment.
["random", experiment, n_vars, forms_n] -> random_exp experiment n_vars forms_n False
-- Experiment with initial seeds comparing with nuXmv.
["seeds", "nuXmv",ranInit, ranNumInit, ranKS, ranF, experiment, n_vars, forms_n] -> seeds_exp ranInit ranNumInit ranKS ranF experiment n_vars forms_n True
-- Experiment with initial seeds.
["seeds", ranInit, ranNumInit, ranKS, ranF, experiment, n_vars, forms_n] -> seeds_exp ranInit ranNumInit ranKS ranF experiment n_vars forms_n False
-- Experiments in my thesis.
["thesis-experiments"] -> thesisExperiments
-- Examples in “LOGIC IN COMPUTER SCIENCE, Modelling and Reasoning about Systems”.
["examples"] -> examples
["LTL-experiment", ks_type, n, specification, m] -> ltlExperiment ks_type (read n) specification (read m) False
["LTL-experiment", ks_type, n, specification, m, "nuXmv"] -> ltlExperiment ks_type (read n) specification (read m) True
_ -> putStrLn "opción no válida"
where
random_exp experiment n_vars forms_n nuXmv = case experiment of
"LTL" -> randomExperiment LTL (read n_vars) (read forms_n) nuXmv
"LTLc" -> randomExperiment LTLc (read n_vars) (read forms_n) nuXmv
"CTL" -> randomExperiment CTL (read n_vars) (read forms_n) nuXmv
_ -> putStrLn "Las opciones válidas son LTL, LTLc Y CTL."
seeds_exp ranInit ranNumInit ranKS ranF experiment n_vars forms_n nuXmv = case experiment of
"LTL" -> seedsExperiment LTL (read ranInit, read ranNumInit, read ranKS, read ranF) (read n_vars) (read forms_n) nuXmv
"LTLc" -> seedsExperiment LTLc (read ranInit, read ranNumInit, read ranKS, read ranF) (read n_vars) (read forms_n) nuXmv
"CTL" -> seedsExperiment CTL (read ranInit, read ranNumInit, read ranKS, read ranF) (read n_vars) (read forms_n) nuXmv
_ -> putStrLn "Las opciones válidas son LTL, LTLc Y CTL."