Theologus Autodidactus, written by the Arabian polymath Ibn al-Nafis (1213–1288), is the first example of a science fiction novel. It deals with various science fiction elements such as spontaneous generation, futurology, the end of the world and doomsday, resurrection, and the afterlife. Rather than giving supernatural or mythological explanations for these events, Ibn al-Nafis attempted to explain these plot elements using the scientific knowledge of biology, astronomy, cosmology and geology known in his time. Ibn al-Nafis' fiction explained Islamic religious teachings via science and Islamic philosophy.
What did Ibn al-Nafis write in the 12th century?