(*+ Trying to relate spec safety to "oracle steps" safety *)

Definition Q 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_ oracle_at_ext n oracle p m)
  end.

(* Specifications: *)
Theorem progress_Q n x : Q (S n) x -> exists y, x ===> y.
Theorem Q_subject_reduction n x y : x ===> y -> Q (S n) x -> Q n y.