Definition key := string.
Definition value := string.
Inductive input : Set :=
| Put : key -> value -> input
| Get : key -> input
| Del : key -> input
| CAS : key -> option value -> value -> input
| CAD : key -> value -> input.
Inductive output : Set :=
| Response : key -> option value -> option value -> output. (* uniform response *)
Module VarDFunctor (Map : VWS
with Definition E.t := string
with Definition E.eq := @eq string).
Definition key_eq_dec := string_dec.
Definition value_eq_dec := string_dec.
Definition val_eq_dec : forall v v' : option value, {v = v'} + {v <> v'}.
decide equality.
auto using value_eq_dec.
Defined.

Theorem input_eq_dec : forall x y: input, {x = y} + {x <> y}.
Definition trace_state_correct (trace : list (input * output)) (st : data) (st' : data) :=
forall k,
fst (interpret k (rev (inputs_with_key trace k)) (Map.find k st)) = Map.find k st'.