main :: IO ()
main = do
  -- Tests of assertion optimization, i.e. verification and removal of assertions.
  _ <- assertsFold [Progress, Failure] {-, VC, VCOpt, ACL2, ACL2Result] -} $ 
    [ package "assertsFoldTest" $ do 
        incl factorial
        incl intrinsicTest
        incl wait
        incl waitLoop
        incl loopTest
        incl structTest
        incl arrayTest
    ]

  -- Tests of Ivory-to-ACL2 compilation.
  testThm "factorial 4 == 24" factorial  $ A.equal 24 $ A.cdr $ A.call "factorial"  [A.nil, 4]
  testThm "arrayTest   ==  6" arrayTest  $ A.equal  6 $ A.cdr $ A.call "arrayTest"  [A.nil]
  testThm "loopTest  8 ==  8" loopTest   $ A.equal  8 $ A.cdr $ A.call "loopTest"   [A.nil, 8]
  testThm "structTest  == 22" structTest $ A.equal 22 $ A.cdr $ A.call "structTest" [A.nil]
  where
  testThm name func thm = do
    pass <- A.check $ compile (package name $ incl func) ++ [A.thm thm]
    if pass
      then putStrLn $ "pass: " ++ name
      else putStrLn $ "FAIL: " ++ name
main :: IO ()
main = do
  -- Tests of assertion optimization, i.e. verification and removal of assertions.
  _ <- assertsFold [Progress, Failure] {-, VC, VCOpt, ACL2, ACL2Result] -} $ 
    [ package "assertsFoldTest" $ do 
        incl factorial
        incl intrinsicTest
        incl wait
        incl waitLoop
        incl loopTest
        incl structTest
        incl arrayTest
    ]

  -- Tests of Ivory-to-ACL2 compilation.
  testThm "factorial 4 == 24" factorial  $ A.equal 24 $ A.cdr $ A.call "factorial"  [A.nil, 4]
  testThm "arrayTest   ==  6" arrayTest  $ A.equal  6 $ A.cdr $ A.call "arrayTest"  [A.nil]
  testThm "loopTest  8 ==  8" loopTest   $ A.equal  8 $ A.cdr $ A.call "loopTest"   [A.nil, 8]
  testThm "structTest  == 22" structTest $ A.equal 22 $ A.cdr $ A.call "structTest" [A.nil]
  where
  testThm name func thm = do
    pass <- A.check $ compile (package name $ incl func) ++ [A.thm thm]
    if pass
      then putStrLn $ "pass: " ++ name
      else putStrLn $ "FAIL: " ++ name
main = do
  -- Tests of assertion optimization, i.e. verification and removal of assertions.
  _ <- assertsFold [Progress, Failure] {-, VC, VCOpt, ACL2, ACL2Result] -} $ 
    [ package "assertsFoldTest" $ do 
        incl factorial
        incl intrinsicTest
        incl wait
        incl waitLoop
        incl loopTest
        incl structTest
        incl arrayTest
    ]

  -- Tests of Ivory-to-ACL2 compilation.
  testThm "factorial 4 == 24" factorial  $ A.equal 24 $ A.cdr $ A.call "factorial"  [A.nil, 4]
  testThm "arrayTest   ==  6" arrayTest  $ A.equal  6 $ A.cdr $ A.call "arrayTest"  [A.nil]
  testThm "loopTest  8 ==  8" loopTest   $ A.equal  8 $ A.cdr $ A.call "loopTest"   [A.nil, 8]
  testThm "structTest  == 22" structTest $ A.equal 22 $ A.cdr $ A.call "structTest" [A.nil]
  where
  testThm name func thm = do
    pass <- A.check $ compile (package name $ incl func) ++ [A.thm thm]
    if pass
      then putStrLn $ "pass: " ++ name
      else putStrLn $ "FAIL: " ++ name