(* Context structure for reflection of unionmap expressions.  We         *)
(* reflect the keys and the variables of the map expression.  (The       *)
(* variables are all expressions that are not recognized as a key, or as *)
(* a disjoint union).  We reflect disjoint union as a sequence.          *)
(*                                                                       *)
(* The context of keys is thus seq K. The context of vars is seq U.      *)
Variables (K : ordType) (T : Type) (U : union_map_class K T).
Structure ctx := Context {keyx : seq K; varx : seq U}.
Definition empx := Context [::] [::].
(* because contexts grow during computation, *)
(* we need a notion of sub-context *)
Definition sub_ctx i j := prefix (keyx i) (keyx j) /\ prefix (varx i) (varx j).

Lemma sc_refl i : sub_ctx i i.
End ReflectionContexts.