1. A method for converting a binary trie representing a set of values into a shape graph representing the set of values, the method comprising: using a processor for: determining, for each of a plurality of nodes of the binary trie, a shape of a sub-tree rooted at the node; and constructing a shape graph from the binary trie based on the shapes of the sub-trees rooted at the nodes of the binary trie.