Logic programming rules are provided to capture the rules governing formal poetry in Spanish. The resulting logic program scans verses in Spanish to provide their metric analysis. The program uses DCG grammars to model the division of each word into syllables, and additional predicates are employed to de ne metric phenomena such as synaloepha, syllable count of a verse, rhyme of a word... The system is tested over a set of Spanish Golden Age sonnets and shown to give reasonable results, providing a very useful pegdagogical application for teaching Spanish poetry.