Declarative Representation of Proof Terms