let pretty fmt v =
    (*Format.printf "@[HERE@.@]";*)
    let pretty_org fmt org =
      if not (Origin.is_top org) then
        Format.fprintf fmt " (origin: %a)" Origin.pretty org
    in
    match v with
      | Top (Top_Param.Top, a) ->
          Format.fprintf fmt "{{ ANYTHING%a }}"
            pretty_org a
      | Top (t, a) ->
          Format.fprintf fmt "{{ garbled mix of &%a%a }}"
            Top_Param.pretty t
            pretty_org a
      | Map m ->
          try
            Ival.pretty fmt (project_ival v)
          with
            | Not_based_on_null ->
                let print_binding k v =
                  if Ival.equal Ival.singleton_zero v
                  then Format.fprintf fmt " &%a ;" Base.pretty k
                  else
                    Format.fprintf fmt " &%a + %a ;"
                      Base.pretty k Ival.pretty v
                in
                  Format.fprintf fmt "{{";
                  (M.iter print_binding) m;
                  Format.fprintf fmt "}}"