wlp pconds (Loop Nothing guard body) q =
    case (tryFindingInvar pconds guard body q) of
      Nothing -> wlp pconds (unrollLoop guard body) q
      Just invar ->
        let
          (subWLP, subConds) = wlp pconds body invar
        in (invar,
            [
                (invar `land` (LNot guard)) `implies` q
               , (invar `land` guard) `implies` subWLP ] ++ subConds)
wlp pconds (Loop Nothing guard body) q =
    case (tryFindingInvar pconds guard body q) of
      Nothing -> wlp pconds (unrollLoop guard body) q
      Just invar ->
        let
          (subWLP, subConds) = wlp pconds body invar
        in (invar,
            [
                (invar `land` (LNot guard)) `implies` q
               , (invar `land` guard) `implies` subWLP ] ++ subConds)
wlp pconds (Loop Nothing guard body) q =
    case (tryFindingInvar pconds guard body q) of
      Nothing -> wlp pconds (unrollLoop guard body) q
      Just invar ->
        let
          (subWLP, subConds) = wlp pconds body invar
        in (invar,
            [
                (invar `land` (LNot guard)) `implies` q
               , (invar `land` guard) `implies` subWLP ] ++ subConds)