Linking creativity and logic