A general equilibrium model of crime and punishment