Container-based reasoning system for binary trees