(*+ 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.

Theorem Q_subject_reduction n x y : x ===> y -> Q (S n) x -> Q n y.