Definition ext_link := ext_link_prog prog.(* Should we really need a concrete user program in order to build enough of an external_specification for the juicy_dry proof? *)
Definition io_ext_spec
  :=
  add_funspecs_rec
    ext_link
    (ok_void_spec IO_itree).(@OK_ty)
    (ok_void_spec IO_itree).(@OK_spec)
    io_specs.Definition getchar_post (m0 m : mem) r (k : int -> IO_itree) (z : IO_itree) :=
  m0 = m /\ - two_p 7 <= Int.signed r <= two_p 7 - 1 /\ z = k r.Definition putchar_post (m0 m : mem) r (c : int) (k : IO_itree) (z : IO_itree) :=
  m0 = m /\ r = c /\ z = k.Program Definition io_dry_spec : external_specification mem external_function IO_itree.Definition dessicate : forall ef (jm : juicy_mem), ext_spec_type io_ext_spec ef -> ext_spec_type io_dry_spec ef.

(* Specifications: *)
Lemma nth_nil : forall {A} n (d : A), nth n nil d = d.
Lemma ghost_join_nth : forall (a b c : ghost) n, join a b c -> join (nth n a None) (nth n b None) (nth n c None).
Lemma rebuild_same : forall jm, juicy_mem_lemmas.rebuild_juicy_mem_fmap jm (m_dry jm) = resource_at (m_phi jm).
Lemma ext_ref_join : forall {Z} (z : Z), join (ext_ghost z) (ext_ref z) (ext_both z).
Theorem juicy_dry_specs : juicy_dry_ext_spec _ io_ext_spec io_dry_spec dessicate.