non compos mentis

adjectives

not of sound mind, memory, or understanding; in law, not competent to go to trial