Inductive partial_map : Type :=
  | empty  : partial_map
  | record : id -> nat -> partial_map -> partial_map.Inductive partial_map : Type :=
  | empty  : partial_map
  | record : id -> nat -> partial_map -> partial_map.Inductive partial_map : Type :=
  | empty  : partial_map
  | record : id -> nat -> partial_map -> partial_map.Instance dec_partial_map (p q : partial_map) : Dec (p = q).(* update is uneccesary *)
Definition update (d : partial_map)
                  (x : id) (value : nat)
                  : partial_map :=
  record x value d.Fixpoint find (x : id) (d : partial_map) : natoption :=
  match d with
  | empty         => None
  | record y v d' => if beq_id x y
                     then Some v
                     else find x d'
  end.

(* Specifications: *)
Theorem update_eq : forall (d : partial_map) (x : id) (v: nat), find x (update d x v) = Some v.
Theorem update_neq : forall (d : partial_map) (x y : id) (o: nat), beq_id x y = false -> find x (update d y o) = find x d.
Theorem update_neq' : forall (d : partial_map) (x y : id) (o: nat), ~ (x = y) -> find x (update d y o) = find x d.