Chemistry and physics of terrestrial planets