Is the usage "all ... are not" always the same as "not all ... are"?
Solution 1:
To answer the presenting question first,
No, the two constructions are not always the same in meaning. There are several reasons for this.
The most important one is the point made in the comments, that logic (and computer languages) are not the same as natural language; and, while logical statements can usually be put into English, any English sentence containing quantifiers (especially if it also contains modals or negatives of any kind) is multiply ambiguous.
Logic is a stick-figure representation of linguistic meaning, and like stick figures, it leaves out a lot and expects you to fill it in from your imagination (or presuppositions, to the extent there's any difference). Logic assumes that quantifiers (like all, each, every, some, and most) modify nouns (all the men, each man, etc.)
But in fact quantifiers can "float". Some, but not all, of them can appear in adverbial position, before the main verb or after the first auxiliary verb. This doesn't change the meaning, but it does change the grammar. Especially with negatives.
- All the men read the book. ==> The men all read the book.
- Each man read the book. ==> The men each read the book.
- Every man read the book, but not *The men every read the book.
When there is a negative morpheme in the sentence, the relative order of the negative and the quantifier can produce meaning problems.
-
Not all the men read the book. ≠ All the men didn't read the book.
(the first says some didn't read it, but the second is ambiguous) - The men didn't all read the book. (same as Not all the men...)
The real problem here is that there are rules in logic for order of operators (modals, negative, and quantifiers) in propositions:
-
(∀x: Man(x)) (Read (x, Book))
is unambiguous, and so is -
¬(∀x: Man(x)) (Read (x, Book))
, and (∀x: Man(x)) ¬(Read (x, Book))
The first one says for every man, that man read the book. The second says that the first one is not true (for whatever reason) of every man. The third one says that for every man, that man did not read the book. The first and the third are contradictory, and the second one can report multiple situations.
That's logic.
Syntax requires modifiers to have certain positions in the sentence, whatever the math rules of logic require.