Carbonate sedimentary rocks form from the precipitation of minerals from water through chemical or biochemical processes. They include limestones composed of calcite and dolostones composed of dolomite. Carbonate rocks are classified based on their components, including allochems like skeletal grains and non-skeletal grains, and orthochems like micrite and spar. Robert Dunham's classification system categorizes carbonate rocks based on depositional texture as mudstones, wackestones, packstones, or grainstones, indicating the energy of the depositional environment.