A Logic Programming Approach to Specifying Logics and Constructing Proofs