let assigns_to_zone_inputs_state state assigns =
  try
    let treat_one_zone acc (_,ins) =
      match ins with
          FromAny -> raise Top_input
        | From l ->
          List.fold_left
            (fun acc { it_content = term } ->
              let loc_ins =
                !Db.Properties.Interp.loc_to_loc ~result:None state term
              in
              Zone.join
                acc
                (Locations.valid_enumerate_bits ~for_writing:false loc_ins))
            acc
            l
    in
    match assigns with
    | WritesAny -> Zone.top
    | Writes [] -> Zone.bottom
    | Writes l  -> List.fold_left treat_one_zone Zone.bottom l
  with
  | Top_input -> Zone.top
  | Invalid_argument "not an lvalue" ->
    Value_parameters.warning ~current:true ~once:true
      "Failed to interpret assigns clause in inputs";
    Zone.top