NbE PHOAS

Posted on 2025-02-11 by Oleg Grenrus agda Normalization by evaluation using parametric higher order syntax. In Agda. I couldn't find a self-contained example of PHOAS NbE, so here it is. I hope someone might find it useful. module NbEXP . PHOAS where data Ty : Set where emp : Ty fun : Ty → Ty → Ty data Tm ( v : Ty → Set ) : Ty → Set where var : ∀ { a } → v a → Tm v a app : ∀ { a b } → Tm v ( fun a…