Another way to say "prision is a deterrent for crime" is "The prospect of going to prison for a crim is a deterrent."