( ( As ( ( the rock ) cools ) ) ( , ( minerals ( form . ) ) ) )
(ROOT (S (SBAR (IN As) (S (NP (DT the) (NN rock)) (VP (VBZ cools)))) (, ,) (NP (NNS minerals)) (VP (VBP form)) (. .)))
As the rock cools, minerals form.
(ROOT (S (NP (JJ Mineral) (NNS crystals)) (VP (VBP are) (VP (VBN formed) (SBAR (WHADVP (WRB when)) (S (NP (JJ hot) (NN lava)) (VP (VBZ cools)))))) (. .)))