For those who desire more formal detail or want formal convincing, we formalize the above account. Simplifying, think of the meaning of the words "no," "some," and "every" as functions n, s, and e, which take the meaning of a partial-sentence, x -- basically, containing a full predicate but an unquantified subject like "dog barks" -- and return a full (quantified) sentence, y. More stuffily: they are a subset of the Cartesian product P x F of the set of partial-sentences, P, and full sentences F. I'm going to fudge a little to keep from proliferating even more formal machinery -- this'll sacrifice total accuracy for the sake of conveying the gist in brief blog form. I'll pretend the meaning of partial "student passed the test" is the same as full "a student passed the test," the rationale being that sans quantifier, we remain agnostic and assume "a" unless told otherwise -- then our n, s, and e will remove this place-holder and supply the true quantifier.
The entailment relation is defined on sentences x and y in P (or F) thus: sentence x entails sentence y iff in all possible worlds in which x is true, y is also true. For example, "John drove to school today" entails "John drove today." For want of fancy characters, we use |- to represent entailment. For all sentences x, y, z in P (or F), x |- x (every sentence entails itself); if x |- y and y |- z, then x |- z (easy to check); and the sole case where x |- y and y |- x is where x and y are synonymous (x = y semantically). Entailment is therefore a partial order on P (or F). We now define the functions: n is the "no" function which takes a partial-sentence x and replaces the assumed place-holding quantifier "a" with "no." If b is the subject and c the predicate, then "No b c" is true iff the sets denoted by the subject and predicate are disjoint. Next, s is the "some" function which does likewise; "Some b c" is true iff the intersection of the sets is non-empty. And e is the "every" function which does likewise; "Every b c" is true iff the subject set is a subset of the predicate set.
The functions n and s are monotically decreasing and increasing, respectively. Let x = "male student passed the test" and y = "student passed the test." Then left alone, x |- y. After passed through n, though, "no student passed the test" |- "no male student passed the test," or n(y) |- n(x). So n is antitone or "entailment-reversing." But if passed through s, "some male student passed the test" |- "some student passed the test," or s(x) |- s(y). So s is entailment-preserving. We chose x so that its subject was a subset of that of y, but the reader can verify that the same works for n and s if we choose x so that its predicate is a subset of that of y (e.g., x = "student aced the test," y = "student passed the test"). "Every," recall, is split. If we choose x so that its subject is a subset of that of y (e.g., x = "male student passed the test," y = "student passed the test"), then e is entailment-reversing like n; but if we choose x so that its predicate was a subset of that of y (e.g., x = "student passed the test," y = "student took the test"), then e is entailment-preserving like s. Thus, NPIs are allowed in sentences with an entailment-reversing function: either case of "no," neither case of "some," and the afore-mentioned case of "every" but not the other. Again, I simplified and fudged just a bit, but it conveys how NPIs relate to monotonic functions while keeping the discussion brief.