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