The author does some neat things. When they're comparing Really Small Numbers multiplied together, to avoid underflow, they instead calculate the logs of the pieces and add them. Very nice. :)
Cool!
One little thing is that you would expect that the is_anagram relation is a symmetrical one. I.e. that "neo" is an anagram of "one" then "one" is also an anagram of "neo", which doesn't seem to be the case with you system. Why is that?