(a) Evidence that the defendant suffered from a mental disease or defect is admissible whenever it is relevant to prove that the defendant did or did not have a culpable mental state which is an element of the crime. However, evidence of mental disease or defect that tends to negate a culpable mental state is not admissible unless the defendant, within 10 days of entering a plea, or at such later time as the court may for good cause permit, files a written notice of intent to rely on that defense.
(b) When the trier of fact finds that all other elements of the crime have been proved but, as a result of mental disease or defect, there is a reasonable doubt as to the existence of a culpable mental state that is an element of the crime, it shall enter a verdict of not guilty by reason of insanity. A defendant acquitted under this subsection, and not found guilty of a lesser included offense, shall automatically be considered to have established the affirmative defense of insanity under AS 12.47.010. The defendant is then subject to the provisions of AS 12.47.090.
(c) If a verdict of not guilty by reason of insanity is reached under (b) of this section, the trier of fact shall also consider whether the defendant is guilty of any lesser included offense. If the defendant is convicted of a lesser included offense, the defendant shall be sentenced for that offense and shall automatically be considered guilty but mentally ill under AS 12.47.030 and 12.47.050. Upon completion of a sentence for a lesser included offense, a hearing shall be held under AS 12.47.090(c) to determine the necessity of further commitment of the defendant, based on the acquittal for the greater charge under (b) of this section. If the defendant is committed under AS 12.47.090(c), the defendant is subject to the provisions of AS 12.47.090(d) - (i) and (k).