let post_of_spec_assigns kf ki spec termination_kind =
  let add_behav (compl, acc) bhv =
    match bhv.b_assigns with
      | WritesAny -> (* skip *) compl, acc
      | Writes l ->
          (* post for behavior is [\old(assumes) => out = f(in)]*)
          let assumes = Ast_info.behavior_assumes bhv in
          let compl = compl || Logic_utils.is_trivially_true assumes in
          let assumes = Logic_const.pold assumes in
          let l = bhv_from_hyps kf ki bhv l termination_kind in
          let add_assume acc (from, p) =
            let p = Logic_const.pimplies (assumes, p) in
              (bhv, from, p)::acc
          in let acc = List.fold_left add_assume acc l in
            (compl, acc)
  in 
  let compl = spec.spec_complete_behaviors <> [] in (* TODO: add dpds ? *)
  let compl, acc = List.fold_left add_behav (compl, []) spec.spec_behavior in
    if compl then acc
    else (* some assigns information is missing: try to complete *)
      match WpStrategy.assigns_upper_bound spec with
        | None -> raise NoFromForBhv
        | Some (b, l) -> 
            let l = bhv_from_hyps kf ki b l termination_kind in
              List.fold_left (fun acc (from, p) -> (b, from, p)::acc) acc l