Program semantics and correctness in a mechanised logic