akramhussein/msc-mock-prolog — pull request #1 by delcypher (2012-01-07 16:14:03+00:00)
Title: Here's a way of doing what you wanted without the performance penalty

The ```findElement/3``` predicate actually does the checking and then if everything is okay it calls ```findElementHelper/3``` which actually does the search (without checks). By doing it this way all the checks are performed only once.