The Principles of Rematerialization