(* Hmmmm it seems both preservation and progress with the oracle-oblivious safety: *)

Definition Q_clean n (x : config) :=
  match x with (_, F, G, thd, pool) =>
    (forall l, precise (resinvs G l)) /\
    functions_safe G F /\
    selfjoins (reindex thd pool) /\
    lockpool_matches pool (resinvs G) /\
    (forall i oracle m p,
        nth thd i = Some (m, p) ->
        safeN_ clean_at_ext n oracle p m)
  end.

(* Specifications: *)
Theorem progress_Q_clean n x : Q_clean (S n) x -> exists y, x ===> y.
Theorem Q_subject_reduction_clean n x y : x ===> y -> Q_clean (S n) x -> Q_clean n y.