English modals are a strange enough beast among themselves, but adding in negation leads to especially treacherous waters. This post will restrict itself to the four most common, and possibly most confusing: May, can, must, and have to.
“May” as a modal is ambiguous between permission and possibility:
1. You may have some dessert if you finish your meal.
2. It may rain tomorrow.
It’s easy enough to conceptualize how this ambiguity started. Both senses are actually forms of permissibility: In (1), the speaker is granting permission; in (2), the universe is granting permission. However, pragmatically, the second sense has a feeling of conjecture, implying that the speaker believes that there’s a decent likelihood of the event happening (it would be strange, for instance, to hear  in Juneau in January, since the likelihood of rain instead of snow would be very low, even though the sentence would be semantically true).
More curiously, the scope of “not” is different based on the sense. In the case where permission is being granted, “not” has greater scope than “may” (unless the context is forced):
3. You may not have any pie because ....
-> NOT (ALLOWED (you have pie))...
while the probabilistic version of “may” has greater scope than “not”:
4. He may not call tonight.
-> COULD BE (NOT (he calls tonight))
In (3), what is negated is the permission to do something, as opposed to having permission to not do something, which is a possible but fairly forced use of “may”:
3a. Child: What if I don't want to eat my spinach?
Parent: Well, you may not eat your spinach, but if you don't,
you won't get any dessert.
-> ALLOWED (NOT (you eat your spinach))
In this case, the scope is the same as the probabilistic “may.” Note that the probabilistic “may” cannot combine with “not” such that the latter has scope, that is, there is no way to parse (4) in such a way that it is not possible that he could call.
“Can” as a modal is ambiguous between ability and permissibility. In the latter sense, it’s roughly synonymous with the first sense of “may”:
5. I can lift half my own weight.
2a. You can have some dessert if you finish your meal.
In the case of “can,” the normal scope of negation is the same as with the first sense of “may,” that is:
5'. I can't lift half my own weight.
-> NOT (ABLE (I lift half my own weight.))
2a'. You can't have any dessert.
-> NOT (ALLOWED (You have dessert.))
However, a potential for confusion is in the use of “cannot” vs “can not.” “Cannot” is unambiguous with regards to scope, as is “can’t”; “can not” is ambiguous between this scope and the opposite one, which requires a context, as with “may,” but is more common in the forced context:
6. Child: Well, what can I do when all my friends are smoking?
Parent: You can not join them, simple as that.
In (6), the parent is not telling the child what they cannot do, but rather offering a suggestion of what they can do, specifically, they can fail to join their friends in smoking. Without the space (and the corresponding emphatic breath in the spoken version), the parent would indeed be denying permission:
6'. Child: Well, what can I do when all my friends are smoking?
Parent: You cannot join them, simple as that.
“Must” is also ambiguous. Its two main senses, parallel to those of “may,” are those of obligation and likelihood:
7. You must finish your dinner.
8. He must see me, because he waved.
However, “not” does not behave as we would predict from “may.” In the case of obligation, the scope is the opposite:
7'. You must not finish your dinner.
-> REQUIRED (NOT (You finish your dinner.))
Effectively, that means “must not” and “may not” are synonymous, inasmuch “you are required not to…” means the same as “you are not allowed to….”
With the probabilistic sense of “must,” it’s not definitive what the scope is, because “it’s not likely that it’s the case that…” and “it’s likely that it’s not the case that…” mean generally the same thing, particularly to the sort of binary likelihoods normally referred to in this context (such as in ).
In the positive sense, “have to” and “must” are interchangeable:
7". You have to finish your dinner.
8'. He has to see me, because he waved.
Pragmatically, “have to” is generally more colloquial than “must,” and hence is more likely to appear in casual frames (as in “I have to go now” vs the stiffer-sounding “I must go now”).
More interestingly (and consternating, no doubt, for the second language learner), “must not” is not interchangeable with “don’t have to.” In the obligatory sense, each is unambiguous, and they have opposite scopes, and therefore different meanings:
7"'. You don't have to finish your dinner.
-> NOT (REQUIRED (You finish your dinner.))
That is, while 7′ forbids the audience (“you”) from finishing dinner, 7″‘ merely removes obligation from the audience to finish dinner.
Another interesting point is that, while “haven’t” is acceptable English, “not” cannot be inserted in “have to,” hence the use of “don’t.” Alternatively, “not” could be placed after “have to,” although this is awkward and usually works best in the context where someone is responding to a positive use of “have to”:
9. Child: What do I have to do to get you off my back?
Parent: You have to not watch TV when you're supposed
to be doing your homework.
This is a pragmatically tricky case, though, because while it semantically means about the same as “you must not watch TV…,” the focus is on the obligation to avoid doing something as opposed to an overt prohibition.
Meanwhile, the probabilistic sense of “have to” in the negative form is non-standard:
10. He must not see me, because he didn't wave.
10'. *He doesn't have to see me, because he didn't wave.
However, “have to” can be used if the scope is explicit, and with a minor change to tense:
10". He has to have not seen me, because he didn't wave.
-> LIKELIHOOD (NOT (he saw me)) ...
This is particularly interesting given the note under discussion of “must” that the scope between likelihood and negation is semantically trivial.