anchor.diff:          | LblPos _ -> failwith "Impossible" //these get added after errorReporting instrumentation only
   
           | Labeled(arg, "could not prove post-condition", _) ->
  -          //printfn "GOT A LABELED WP IMPLICATION";
  +          //printfn "GOT A LABELED WP IMPLICATION\n\t%s"
  +          //        (Term.print_smt_term q);
             let fallback msg =
               //printfn "FALLING BACK: %s with range %s" msg
  -            //            (match ropt with None -> "None" | Some r -> Range.string_of_range r);
  +            //        (match ropt with None -> "None" | Some r -> Range.string_of_range r);
               aux default_msg ropt post_name_opt labels arg in
             begin try
                 begin match arg.tm with
  
positive.code:         | Labeled(arg, reason, r) ->
            aux reason (Some r) post_name_opt labels arg
  
          | Quant(Forall, [], None, [post], {tm=App(Imp, [lhs;rhs]); rng=rng})
              when is_a_named_continuation lhs ->
  //          printfn "Got a named continuation";
            let post_name = "^^post_condition_"^ (BU.string_of_int <| Syntax.Syntax.next_id ()) in
            let names = (post_name, post) in
            let instantiation = [mkFreeV names] in
            let lhs, rhs = Term.inst instantiation lhs, Term.inst instantiation rhs in
  
            let labels, lhs_conjs =
                  BU.fold_map (fun labels tm ->
                      match tm.tm with
                      | Quant(Forall, [[{tm=App(Var "Prims.guard_free", [p])}]], iopt, sorts, {tm=App(Imp, [l0;r])})
                        when is_a_post_condition (Some post_name) r ->
                          let labels, l = aux default_msg None post_name_opt labels l0 in
                          labels, mk (Quant(Forall, [[p]], Some 0, sorts, norng mk (App(Imp, [l;r])))) q.rng
                      | _ -> labels, tm)
                  labels (conjuncts lhs) in
  
            let labels, rhs = aux default_msg None (Some post_name) labels rhs in
            let body = Term.mkImp(Term.mk_and_l lhs_conjs lhs.rng, rhs) rng |> Term.abstr [names] in
            let q = Term.mk (Quant(Forall, [], None, [post], body)) q.rng in
            labels, q
  
          | App(Imp, [lhs;rhs]) ->
  
negative.code:                     | App(And, clauses_lhs) ->
                        let req, ens = BU.prefix clauses_lhs in
                        begin match ens.tm with
                          | Quant(Forall, pats_ens, iopt_ens, sorts_ens, {tm=App(Imp, [ensures_conjuncts; post]); rng=rng_ens}) ->
                            if is_a_post_condition (Some post_name) post
                            then
                              let labels, ensures_conjuncts = aux "could not prove post-condition" None (Some post_name) labels ensures_conjuncts in
                              let pats_ens =
                                match pats_ens with
                                | []
                                | [[]] -> [[post]]  //make the post-condition formula the pattern, if there isn't one already (usually there isn't)
                                | _ -> pats_ens in
                              let ens = Term.mk (Quant(Forall, pats_ens, iopt_ens, sorts_ens,
                                                               Term.mk (App(Imp, [ensures_conjuncts; post])) rng_ens)) ens.rng in
                              let lhs = Term.mk (App(And, req@[ens])) lhs.rng in
                              labels, Term.abstr names lhs
                             else raise (Not_a_wp_implication ("Ensures clause doesn't match post name:  "
                                                              ^ post_name
                                                              ^ "  ... "
                                                              ^ Term.print_smt_term post))
  
                          | _ -> raise (Not_a_wp_implication ("Ensures clause doesn't have the expected shape for post-condition "
                                                              ^ post_name
                                                              ^ "  ... "
                                                              ^ Term.print_smt_term ens))
  