On the compilation of programs into their equivalent constraint representation