Definition get_IR_output_keys (l : list IR) : list K :=
    filterMap (fun x => match x with
                          | IRO k => Some k
                          | IRU k => Some k
                          | _ => None
                        end) l.

Lemma good_trace_IRI_in : forall ir, good_trace ir -> forall k, In (IRI k) ir -> In (IRO k) ir \/ In (IRU k) ir.