Set Implicit Arguments.
Unset Strict Implicit.
Set Primitive Projections.
Set Maximal Implicit Insertion.
Set Universe Polymorphism.
Class ValNull (val : Type) := {
null : val
}.
Section Defs.
Context {A val : Type}.
Context {HA : RelDec (@eq A)} {HR : RelDec_Correct HA}.
Context {VNB : ValNull val}.
Definition stack := A -> val.
Definition stack_empty : stack := fun x => null.
Definition stack_get (x : A) : stack -> val  := fun s => s x.
Definition stack_add x v s : stack :=
fun x' => if x' ?[ eq ] x then v else s x'.

Lemma stack_add_val_eq (s : stack) (x : A) v1 v2 (Hs : stack_add x v1 s = stack_add x v2 s) :
v1 = v2.