Counting the Number of Perfect Matchings, and Generalized Decision Trees