Mathematical Patterns and Cognitive Architectures