Huffman Coding in Prolog

Recall that Huffman coding is a compression technique that uses a variable-length code constructed from the frequency counts of the objects being represented. In this program you will use Prolog to build a Huffman tree for a given list of (item, frequency) pairs.

Your top-level predicate huffman(frequency_list, huffman_tree) should take a list of [item, frequency] lists and a Huffman tree of items. This predicate should evaluate to true if the provided huffman tree is the correct tree for the given frequency list. Some things to think about: