If each image contains just one hooved animal, and one animal has its head and body in profile.
return hooved animal  ;return images ;return number of  #1 for each  #2 ;return #2 where  #3 is equal to  one ;return number of  #2 ;return number of  #4 ;return if  #5 is equal to  #6 ;return head of #1 ;return body of #1 ;return #1 where  #8 is in  profile ;return #10 where  #9 is in  profile ;return number of  #11 ;return if  #12 is equal to  one ;return if  both  #7 and #13 are true
['select', 'select', 'group', 'comparative', 'aggregate', 'aggregate', 'boolean', 'project', 'project', 'comparative', 'comparative', 'aggregate', 'boolean', 'boolean']