"""Create reasoning_engine
Generated by Phi-Octopus Eden
2025-11-08 17:54:44.370347
"""

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

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

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

    def query(self, question: str) -> bool:
        """Check if a question is supported by facts in the knowledge base."""
        return any(question in fact for fact in self.knowledge)


class ReasoningEngine:
    def __init__(self, knowledge_base: KnowledgeBase):
        self.knowledge_base = knowledge_base

    def infer(self, premises: List[str], conclusion: str) -> bool:
        """
        Infer the validity of a conclusion based on given premises.
        
        :param premises: A list of premises or supporting facts
        :param conclusion: The conclusion to be inferred
        :return: True if the conclusion follows from the premises, False otherwise
        """
        for premise in premises:
            if self.knowledge_base.query(premise):
                # Simple inference check; more sophisticated logic could be implemented here
                return self.knowledge_base.query(conclusion)
        return False

    def explain(self, query: str) -> Dict[str, Any]:
        """
        Provide an explanation for why a certain query is true or false.
        
        :param query: The query to be explained
        :return: A dictionary explaining the result of the query
        """
        if self.knowledge_base.query(query):
            return {"status": "true", "reason": f"Query '{query}' is supported by existing facts."}
        else:
            return {"status": "false", "reason": f"Query '{query}' is not supported by existing facts or cannot be inferred."}


# Example usage
knowledge_base = KnowledgeBase()
knowledge_base.add_fact("All mammals are animals.")
knowledge_base.add_fact("Dogs are mammals.")

engine = ReasoningEngine(knowledge_base)

print(engine.infer(["All mammals are animals.", "Dogs are mammals."], "Dogs are animals."))
print(engine.explain("Are dogs animals?"))

# Output:
# True
# {'status': 'true', 'reason': "Query 'Are dogs animals?' is supported by existing facts."}
```