http://www.j-paine.org/prolog/tools/files/contents.html http://stackoverflow.com/questions/1838134/checking-if-a-tree-is-a-heap-in-prolog