Statistical Physics And Information Theory For Systems With Local Constraints