Logic-Based Artificial Intelligence Algorithms Supporting Categorical Semantics