Whoever finds moisture upon waking from sleep and doubts whether it is semen or madhy, and cannot distinguish between them, he may choose between them and act according to his choice. If he wishes, he can consider it semen and perform the ritual bath, or consider it madhy, perform ablution, and wash what it has soiled. This is because if he fulfills the requirement of one of them, he is definitively free from it, and the default is his innocence from the other. And Allah the Almighty knows best.