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

Lemma get_IR_input_keys_defn : forall x l, get_IR_input_keys (x :: l) = match x with | IRI k => k :: get_IR_input_keys l | _ => get_IR_input_keys l end.