diff options
author | Jed Barber <jjbarber@y7mail.com> | 2012-07-12 09:09:31 +1000 |
---|---|---|
committer | Jed Barber <jjbarber@y7mail.com> | 2012-07-12 09:09:31 +1000 |
commit | 42a265e80a9ed551fd519a88ed1d063435385b9f (patch) | |
tree | dcaf8ea9cdc827ff127fe147acf3e56b7c255751 | |
parent | 75854b6f0e73c55fa2dafc0d6b50fb23a96edfaf (diff) |
Graph generating functions accessible as a module
-rw-r--r-- | ProofGraph.hs | 19 | ||||
-rw-r--r-- | ProofGraphMain.hs | 11 |
2 files changed, 19 insertions, 11 deletions
diff --git a/ProofGraph.hs b/ProofGraph.hs index 1a6f3fe..816e9f0 100644 --- a/ProofGraph.hs +++ b/ProofGraph.hs @@ -1,5 +1,10 @@ -import System( getArgs ) -import Text.Printf +module ProofGraph ( + PGraph, + doGraphGen + ) where + + + import Data.Maybe import Data.List import Data.Set( Set ) @@ -11,7 +16,7 @@ import qualified Data.Graph.Inductive.Graph as Graph import Data.Graph.Inductive.Tree import Stack( Stack, at, (<:>) ) import qualified Stack as Stack -import Parse +import Parse( isNumber, isName ) @@ -118,11 +123,3 @@ doGraphGen list = result = foldl' parse (graph,stack,dictionary) list in case result of (g,s,d) -> g - - -main = do - args <- getArgs - list <- getLines $ head args - let result = doGraphGen (map (stripReturn) list) - printf $ (show result) ++ "\n" - diff --git a/ProofGraphMain.hs b/ProofGraphMain.hs new file mode 100644 index 0000000..91767ad --- /dev/null +++ b/ProofGraphMain.hs @@ -0,0 +1,11 @@ +import System( getArgs ) +import Text.Printf +import Parse +import ProofGraph + + +main = do + args <- getArgs + list <- getLines $ head args + let result = doGraphGen (map (stripReturn) list) + printf $ (show result) ++ "\n" |