Embedding logical frameworks in scala