data bt {n : Level} (A : Set n) : Set n where leaf : bt A node : (key : ℕ) → (value : A) → (left : bt A ) → (right : bt A ) → bt A record Env {n : Level} (A : Set n) : Set n where field varn : ℕ varv : A vart : bt A varl : List (bt A) open Env