Going through exercises listed on this site: http://www.ic.unicamp.br/~meidanis/courses/mc336/2009s2/prolog/problemas/index.html