Meta-programming with Theory