"""Create reasoning_engine
Generated by Phi-Octopus Eden
2025-11-08 16:16:56.450122
"""

```python
from typing import List, Dict, Any


class KnowledgeBase:
    def __init__(self):
        self.knowledge = {}

    def add_fact(self, fact: str) -> None:
        """Add a fact to the knowledge base"""
        if not isinstance(fact, str):
            raise ValueError("Fact must be a string")
        self.knowledge[fact] = True

    def query(self, query: str) -> bool:
        """Query the knowledge base for a specific fact"""
        return query in self.knowledge


def create_reasoning_engine(kb: KnowledgeBase) -> callable:
    """
    Create a reasoning engine that can perform simple logical inference.

    :param kb: An instance of KnowledgeBase containing facts.
    :return: A function that performs a basic syllogism check.
    """

    def reason(fact1: str, fact2: str, conclusion: str) -> bool:
        """
        Check if the conclusion logically follows from two given premises.

        :param fact1: The first premise as a string.
        :param fact2: The second premise as a string.
        :param conclusion: The logical conclusion to verify.
        :return: True if the conclusion is valid, False otherwise.
        """
        if not (isinstance(fact1, str) and isinstance(fact2, str) and isinstance(conclusion, str)):
            raise ValueError("All inputs must be strings")
        return kb.query(fact1 + " AND " + fact2) and kb.query(fact1 + " -> " + conclusion)

    return reason


if __name__ == "__main__":
    # Example usage
    kb = KnowledgeBase()
    kb.add_fact("all birds can fly")
    kb.add_fact("penguins are birds")

    reasoning_engine = create_reasoning_engine(kb)
    
    print(reasoning_engine("all birds can fly", "penguins are birds", "penguins can fly"))  # False
    print(reasoning_engine("all birds can fly", "penguins are birds", "penguins cannot fly"))  # True
```