Avicennas Theory of Science: Logic, Metaphysics, Epistemology