"""Create reasoning_engine
Generated by Phi-Octopus Eden
2025-11-07 21:59:23.892982
"""

```python
from typing import List, Dict


class KnowledgeBase:
    def __init__(self):
        self.knowledge = []

    def add_fact(self, fact: str) -> None:
        """
        Adds a new fact to the knowledge base.

        :param fact: A string representing a fact.
        """
        self.knowledge.append(fact)

    def query(self, question: str) -> List[str]:
        """
        Queries the knowledge base for facts that match the given question.

        :param question: The question or statement to be matched against the knowledge base.
        :return: A list of matching facts from the knowledge base.
        """
        return [fact for fact in self.knowledge if question in fact]


class ReasoningEngine:
    def __init__(self, knowledge_base: KnowledgeBase):
        """
        Initializes a new instance of the ReasoningEngine.

        :param knowledge_base: The KnowledgeBase to use for reasoning.
        """
        self.knowledge_base = knowledge_base

    def infer_new_facts(self, question: str) -> List[str]:
        """
        Attempts to infer new facts from existing ones in the knowledge base based on a given question.

        :param question: The input question or statement.
        :return: A list of inferred facts.
        """
        matching_facts = self.knowledge_base.query(question)
        if not matching_facts:
            return []

        # Simple inference example: if "A" is known, then "B" can be inferred
        for i in range(len(matching_facts) - 1):
            fact_a = matching_facts[i]
            fact_b = matching_facts[i + 1]

            if "A" in fact_a and "B" not in fact_b:
                self.knowledge_base.add_fact(fact_b.replace("A", "B"))
        return [fact for fact in self.knowledge_base.query(question) if fact != question]


# Example usage
if __name__ == "__main__":
    kb = KnowledgeBase()
    kb.add_fact("All dogs are mammals A")
    kb.add_fact("Dogs have four legs B")

    reasoning_engine = ReasoningEngine(kb)
    inferred_facts = reasoning_engine.infer_new_facts("What can we say about dogs?")

    print(inferred_facts)

```

This code defines a `ReasoningEngine` class that uses a simple inference method to add new facts based on existing ones in the knowledge base. The example usage demonstrates adding two known facts and querying for inferred information about dogs, which should result in inferring that "Dogs have four legs" from "All dogs are mammals".