let rec ensures values state p = match p.content with
      | Pand(p1, p2) ->
          let state = ensures values state p1 in
          ensures values state p2
      | (* [state(x) = term] *)
          Prel(Req,
               { term_node = Tapp(f1, _, [ x ]) },
               { term_node = Tapp(f2, _, l) })
            when f1.l_var_info.lv_name = state_name
              ->
          (match find_term_loc_or_status values state f2 l with
           | None -> warn_todo (); state
           | Some sy ->
               (try
                  let x = !Properties.Interp.term_to_lval x in
                  change_lval_status values state x sy
                with Invalid_argument _ ->
                  Options.warning ~once:true ~current:true
                    "%a is not a left value; ignoring clause 'ensures'"
                    !Ast_printer.d_term x;
                  state))
      | Ptrue -> state
      | Pfalse -> state
      | _ ->
          (* Deal yet only with conjunction of equalities. *)
          warn_todo ();
          state