Prolog is a logic programming language and it lends itself well to the type of programming required in knowledge representation. I have used Prolog extensively over the last 7 years, for a variety of tasks, most prominently for the high-level control of our soccer robots in several RoboCup tournaments (German Open and World-Cup in 2003 and 2004).
I here collect some of the Prolog code I have written over the years which I conjecture might be useful to others. They are all free for use under the GNU General Public Licence. The code sometimes involves external C-libraries. In those cases, make sure to compile the provided c-files before trying to use the code. The methods involving c-code are specific to The ECLiPSe Constraint Programming System. I expect the rest to work on many Prolog implementation, but have so far only tested on ECLiPSe and SWI-Prolog.