/ haskell / src / Main.hs
Main.hs
 1  
 2  module Main where
 3  
 4  --------------------------------------------------------------------------------
 5  
 6  import Data.Map (Map)
 7  import qualified Data.Map as Map
 8  
 9  import Witness
10  import Parser
11  import Graph
12  import JSON
13  import Export
14  
15  --------------------------------------------------------------------------------
16  {-
17  
18  (~>) :: String -> a -> (String, a)
19  (~>) = (,)
20  
21  infix 2 ~>
22  
23  testInputs :: Map String [Integer]
24  testInputs = Map.fromList 
25    [ "a" ~> [0xff01] 
26    , "b" ~> [0xff02]
27    ]
28  
29  -}
30  --------------------------------------------------------------------------------
31  
32  graphFile = "../../tmp/graph4.bin"
33  inputFile = "../../tmp/input4.json"
34  wtnsFile  = "../../tmp/my4.wtns"
35  fullFile  = "../../tmp/my4_full.bin"
36  
37  main :: IO ()
38  main = do
39    Right graph <- parseGraphFile    graphFile
40    inputs      <- loadInputJsonFile inputFile
41  
42    -- putStrLn ""
43    -- print (inputSignals $ graphMeta graph)
44  
45    -- let full = fullComputation graph inputs
46    -- exportFeltSequence fullFile full
47  
48    let wtns = witnessCalc graph inputs 
49    exportWitness wtnsFile wtns
50