Of terms have but three; proposition as term;
Distribute the Middle--in this be most firm;
Distribute no term in Conclusion, beside,
Unless in a premise 'tis equally wide;
One premise affirmative, this you must learn,
For negative premises nothing affirm;
A negative head has a negative tail,
And the converse of this is of equal avail.
I found it quoted in Peter Coffey, The Science of Logic (1912). The standard rules of syllogism that the mnemonic summarizes are as follows, with the line to which the rule corresponds:
(1) A syllogism must contain three, and only three, terms. (line 1a)
(2) A syllogism must contain three, and only three, propositions. (line 1b)
(3) The middle term must be distributed at least once in the premises. (line 2)
(4) No term may be distributed in the conclusion that is not distributed in the premises. (lines 3-4)
(5) At least one premise must be affirmative. (lines 5-6)
(6) A negative premise requires a negative conclusion and vice versa. (lines 7-8)
Mnemonic poetry is an art that should really be more widely cultivated, I think. The goal is to get a poem that flows well as a poem (thus making it easy to memorize, since many poetic devices are mnemonic devices as well, and not by accident) but which concisely captures what is to be memorized with as little padding as possible. The poem above does fairly well -- here's the poem with the padding struck out:
Of terms have but three; proposition as term;
Distribute the Middle--
Distribute no term in Conclusion,
Unless in a premise 'tis equally wide;
One premise affirmative,
A negative head has a negative tail,
And the converse
One can perhaps argue both sides of whether "of this is equal avail" is padding, and likewise with the sixth line. After a poem with no padding, the best is a poem in which the padding only goes to what is required for the mnemonic, and this is true for this example, in which the padding contributes to the meter and rhyme, which are the poetic features that make it mnemonic.