Logic, imagination, and magic