( ( ( The function ) ( of behavior ) ) ( ( was ( to ( permit ( animals ( to ( adapt ( to ( complex ( and ( ever-changing environments ) ) ) ) ) ) ) ) ) ) . ) )
(ROOT (S (NP (NP (DT The) (NN function)) (PP (IN of) (NP (NN behavior)))) (VP (VBD was) (S (VP (TO to) (VP (VB permit) (S (NP (NNS animals)) (VP (TO to) (VP (VB adapt) (PP (TO to) (NP (JJ complex) (CC and) (JJ ever-changing) (NNS environments)))))))))) (. .)))
The function of behavior was to permit animals to adapt to complex and ever-changing environments.
(ROOT (S (NP (JJ Learned) (NN behavior)) (VP (VBZ is) (ADJP (JJ adaptive)) (SBAR (IN because) (S (NP (PRP they)) (VP (VBP are) (ADJP (JJ flexible)) (, ,) (S (ADJP (JJ capable) (PP (IN of) (S (VP (VBG changing) (SBAR (IN if) (S (NP (DT the) (NN environment)) (VP (VBZ changes))))))))))))) (. .)))