As for the second: if he makes discontinuing it contingent upon a condition, then according to the established school, the prayer is invalidated.
As for the third: if he is undecided whether to discontinue it or not, then according to the established school, it is invalidated. The correct view in both issues, however, is that it is not invalidated.
The fourth case is when he resolves to commit a prohibited act but does not do it. In this case, the prayer is not invalidated, because invalidation here is contingent upon committing the prohibited act, and that has not occurred.
If he doubts whether he formed the intention, he must begin it again.
His statement, “If he doubts whether he formed the intention, he must begin it again,” means that if he doubts whether or not he made the intention, he must begin it again—that is, the prayer—because the basic presumption is that it was absent.
Yet one may ask: does such a case actually arise? That is, can a person perform ablution, come to the mosque, begin the prayer with the opening takbir, and then say, “I doubt whether I made the intention”? Apparently, this is not possible, and the issue is hypothetical—unless he is afflicted by obsessive misgivings, in which case his doubts are of no consequence. For this reason, the poet said:
Doubt after an act has been done has no effect;
And likewise when doubts become frequent. (1)
When doubts become frequent, this is obsessive misgiving and is not taken into account. Thus, it is difficult to conceive of this case, for it is impossible for a rational person who knows what he is doing to enter the prayer, pronounce the opening takbir, and recite, then say, “I doubted whether I made the intention.” For this reason, some scholars said: If Allah had required us to perform an act without an intention, that would have been imposing what is beyond one’s capacity. (2)
Nevertheless, assuming that such a case occurs—even theoretically—we say: if he doubts whether he made the intention, he must begin the act of worship again, because the basic presumption is nonexistence, and he has doubted whether it exists or not.