The codification of the M'Naghten rules, which have been referenced in one form or another in US law as well as UK law, indicates that someone may be found not guilty of a crime because of a mental condition which prevents them from either controlling their actions or from knowing whether their actions were right or wrong.