The Foundation of a Generic Theorem Prover (1989) [pdf]