compile, generalization and implementation