tryFindingInvar :: (PostConds, ProgParams, Statement) -> Expression -> Statement -> Expression -> Maybe Expression
tryFindingInvar pconds@(_,_,topLevelStmt) guard body postCond =
  let
    f w =  ( guard `land` (fst $ wlp pconds body w)) `lor` ((LNot guard) `land` postCond)
    iter w n = if (z3iff topLevelStmt (simplifyPred w) (simplifyPred (f w)))
               then (Just w)
               else if (n >= fixpointDepth)
               then Nothing
               else iter (f w) (n+1)
  in iter (BoolLit True) 0
tryFindingInvar :: (PostConds, ProgParams, Statement) -> Expression -> Statement -> Expression -> Maybe Expression
tryFindingInvar pconds@(_,_,topLevelStmt) guard body postCond =
  let
    f w =  ( guard `land` (fst $ wlp pconds body w)) `lor` ((LNot guard) `land` postCond)
    iter w n = if (z3iff topLevelStmt (simplifyPred w) (simplifyPred (f w)))
               then (Just w)
               else if (n >= fixpointDepth)
               then Nothing
               else iter (f w) (n+1)
  in iter (BoolLit True) 0
tryFindingInvar pconds@(_,_,topLevelStmt) guard body postCond =
  let
    f w =  ( guard `land` (fst $ wlp pconds body w)) `lor` ((LNot guard) `land` postCond)
    iter w n = if (z3iff topLevelStmt (simplifyPred w) (simplifyPred (f w)))
               then (Just w)
               else if (n >= fixpointDepth)
               then Nothing
               else iter (f w) (n+1)
  in iter (BoolLit True) 0