prolog progs, triangle, rectangle and list