intrinsicTest :: Def ('[IBool, Sint32] :-> ())
intrinsicTest = proc "intrinsicTest" $ \ cond1 num1 -> requires (num1 ==? 22) $ body $ do
  -- Tests of basic expressions.
  assert $ true
  assert $ iNot false
  assert $ 1 + 2 ==? (3 :: Sint32)
  assert $ iNot $ 1 + 2 ==? (4 :: Sint32)
  assert $ 3 - 2 ==? (1 :: Sint32)
  assert $ iNot $ 2 - 2 ==? (1 :: Sint32)
  assert $ 1 /=? (2 :: Sint32)
  assert $ iNot $ 1 /=? (1 :: Sint32)
  assert $ 1 <?  (2 :: Sint32)
  assert $ 3 >?  (2 :: Sint32)
  assert $ 1 <=? (1 :: Sint32)
  assert $ 3 >=? (3 :: Sint32)
  assert $ iNot false
  assert $ iNot $ iNot true
  assert $ iNot $ iNot $ iNot false
  assert $ iNot $ iNot $ iNot $ iNot true
  assert $ (false .&& false) ==? false
  assert $ (false .&& true ) ==? false
  assert $ (true  .&& false) ==? false
  assert $ (true  .&& true ) ==? true 
  assert $ (false .|| false) ==? false
  assert $ (false .|| true ) ==? true
  assert $ (true  .|| false) ==? true
  assert $ (true  .|| true ) ==? true 
  assert $ true  ? (true , false)
  assert $ true  ? (true , true )
  assert $ false ? (false, true )
  assert $ false ? (true , true )
  assert $ (3 .% 7) ==? (3 :: Sint32)
  assert $ negate 3 ==? (-3 :: Sint32)
  assert $ abs (-3) ==? (3 :: Sint32)
  assert $ signum 0 ==? (0 :: Sint32)

  -- Test of preconditions.
  assert $ num1 ==? 22

  -- Test of refs and branches.
  ref <- local (ival 0)
  ifte_ cond1
    (do { assert cond1;        store ref (22 :: Sint32) })
    (do { assert $ iNot cond1; store ref (44 :: Sint32) })
  assert $ cond1 .|| iNot cond1
  n <- deref ref
  assert $ implies cond1        (n ==? 22)
  assert $ implies (iNot cond1) (n ==? 44)

  -- A test of assumptions.
  --assume false
  --assert false
  retVoid
intrinsicTest :: Def ('[IBool, Sint32] :-> ())
intrinsicTest = proc "intrinsicTest" $ \ cond1 num1 -> requires (num1 ==? 22) $ body $ do
  -- Tests of basic expressions.
  assert $ true
  assert $ iNot false
  assert $ 1 + 2 ==? (3 :: Sint32)
  assert $ iNot $ 1 + 2 ==? (4 :: Sint32)
  assert $ 3 - 2 ==? (1 :: Sint32)
  assert $ iNot $ 2 - 2 ==? (1 :: Sint32)
  assert $ 1 /=? (2 :: Sint32)
  assert $ iNot $ 1 /=? (1 :: Sint32)
  assert $ 1 <?  (2 :: Sint32)
  assert $ 3 >?  (2 :: Sint32)
  assert $ 1 <=? (1 :: Sint32)
  assert $ 3 >=? (3 :: Sint32)
  assert $ iNot false
  assert $ iNot $ iNot true
  assert $ iNot $ iNot $ iNot false
  assert $ iNot $ iNot $ iNot $ iNot true
  assert $ (false .&& false) ==? false
  assert $ (false .&& true ) ==? false
  assert $ (true  .&& false) ==? false
  assert $ (true  .&& true ) ==? true 
  assert $ (false .|| false) ==? false
  assert $ (false .|| true ) ==? true
  assert $ (true  .|| false) ==? true
  assert $ (true  .|| true ) ==? true 
  assert $ true  ? (true , false)
  assert $ true  ? (true , true )
  assert $ false ? (false, true )
  assert $ false ? (true , true )
  assert $ (3 .% 7) ==? (3 :: Sint32)
  assert $ negate 3 ==? (-3 :: Sint32)
  assert $ abs (-3) ==? (3 :: Sint32)
  assert $ signum 0 ==? (0 :: Sint32)

  -- Test of preconditions.
  assert $ num1 ==? 22

  -- Test of refs and branches.
  ref <- local (ival 0)
  ifte_ cond1
    (do { assert cond1;        store ref (22 :: Sint32) })
    (do { assert $ iNot cond1; store ref (44 :: Sint32) })
  assert $ cond1 .|| iNot cond1
  n <- deref ref
  assert $ implies cond1        (n ==? 22)
  assert $ implies (iNot cond1) (n ==? 44)

  -- A test of assumptions.
  --assume false
  --assert false
  retVoid
intrinsicTest = proc "intrinsicTest" $ \ cond1 num1 -> requires (num1 ==? 22) $ body $ do
  -- Tests of basic expressions.
  assert $ true
  assert $ iNot false
  assert $ 1 + 2 ==? (3 :: Sint32)
  assert $ iNot $ 1 + 2 ==? (4 :: Sint32)
  assert $ 3 - 2 ==? (1 :: Sint32)
  assert $ iNot $ 2 - 2 ==? (1 :: Sint32)
  assert $ 1 /=? (2 :: Sint32)
  assert $ iNot $ 1 /=? (1 :: Sint32)
  assert $ 1 <?  (2 :: Sint32)
  assert $ 3 >?  (2 :: Sint32)
  assert $ 1 <=? (1 :: Sint32)
  assert $ 3 >=? (3 :: Sint32)
  assert $ iNot false
  assert $ iNot $ iNot true
  assert $ iNot $ iNot $ iNot false
  assert $ iNot $ iNot $ iNot $ iNot true
  assert $ (false .&& false) ==? false
  assert $ (false .&& true ) ==? false
  assert $ (true  .&& false) ==? false
  assert $ (true  .&& true ) ==? true 
  assert $ (false .|| false) ==? false
  assert $ (false .|| true ) ==? true
  assert $ (true  .|| false) ==? true
  assert $ (true  .|| true ) ==? true 
  assert $ true  ? (true , false)
  assert $ true  ? (true , true )
  assert $ false ? (false, true )
  assert $ false ? (true , true )
  assert $ (3 .% 7) ==? (3 :: Sint32)
  assert $ negate 3 ==? (-3 :: Sint32)
  assert $ abs (-3) ==? (3 :: Sint32)
  assert $ signum 0 ==? (0 :: Sint32)

  -- Test of preconditions.
  assert $ num1 ==? 22

  -- Test of refs and branches.
  ref <- local (ival 0)
  ifte_ cond1
    (do { assert cond1;        store ref (22 :: Sint32) })
    (do { assert $ iNot cond1; store ref (44 :: Sint32) })
  assert $ cond1 .|| iNot cond1
  n <- deref ref
  assert $ implies cond1        (n ==? 22)
  assert $ implies (iNot cond1) (n ==? 44)

  -- A test of assumptions.
  --assume false
  --assert false
  retVoid