Non compos mentis
The Latin term "Non compos mentis" means, in a UK legal context: "not of sound mind and understanding".