Self-Formalisation of Higher-Order Logic - Semantics, Soundness, and a Verified Implementation