That reminds me of a famous incident where a circus elephant named Mary was hanged by the neck until dead for committing murder on a human. She got angry at her human handler for prodding her and stomped him. See https://en.wikipedia.org/wiki/Mary_(elephant) for the details and a pic of Mary's hanging. I don't think she got to defend herself in a court of law, though.
My two cents on the subject is I think the law could accommodate intelligent animals, but each species should probably be treated differently based on their nature and capabilities. I don't think treating them as persons is the right idea.
Statistics are no substitute for judgement. -- Henry Clay