One's competency, in a legal sense, will be determined on a case-by-case basis. The court may rely on a doctor's evaluation and the testimony of the individual themselves, if possible, to make this determination.
As Mr. Linnenbringer said, "One's competency, in a legal sense, will be determined on a case-by-case basis. The court may rely on a doctor's evaluation and the testimony of the individual themselves, if possible, to make this determination." Also worth noting, a Guardian ad Litem may be appointed to advocate for the person's best interest if a person is deemed unable to represent themselves (ie. they are a child or incompetent).
In more complicated situations, such as this, both parties would benefit from seeking independent counsel that would be able to explain how to proceed in this situation.
Mr. Coulter and Mr. Linnenbringer already provided good information. If the question, however, is whether or not the Alzheimer's would legally prevent the divorce, the answer is; "probably not." In Missouri a divorce may be granted if the marriage is "irretrievably broken and has no reasonable likelihood of being preserved." Often, divorces are granted on a "default" basis, where one party isn't even in attendance. The Court will certainly take additional precautions in a case like this, because of the specific issues. But, there is no blanket prohibition on a divorce taking place.
This advice is based upon limited and hypothetical circumstances. For an answer that is specific to your situation, please consult an attorney. The answering of this question does not create an attorney/client relationship, and the poster should seek additional information from qualified legal counsel. Many attorneys, like ours, offer no-cost consultations.