Skip to content
Snippets Groups Projects
Main.hs 581 B
Newer Older
  • Learn to ignore specific revisions
  • Bart Wijgers's avatar
    Bart Wijgers committed
    module Main where
    
    
    import GCLParser.Parser
    
    Bart Wijgers's avatar
    Bart Wijgers committed
    import GCLParser.GCLAlgebra
    
    
    import GCLLexer.Lexer
    
    Bart Wijgers's avatar
    Bart Wijgers committed
    
    
    import System.Environment
    
    
    Bart Wijgers's avatar
    Bart Wijgers committed
    import WLP.LogicalExpression
    import WLP.WLPCalculator
    
    
    Bart Wijgers's avatar
    Bart Wijgers committed
    main :: IO ()
    
    main = do
        [fp] <- getArgs
        file <- readFile fp
        let tokens = lexer file
        let parsed = parseGCL tokens
        putStrLn (show parsed)
    
    Bart Wijgers's avatar
    Bart Wijgers committed
        case parsed of
          Left xs -> return ()
          Right program -> do
            -- We gotta turn the AST into a logical formula based on the wlp
            let wlpFormula = foldProgram programToWLPAlgebra program
            putStrLn . show $ wlpFormula