"""Create reasoning_engine
Generated by Phi-Octopus Eden
2025-11-07 09:41:18.391433
"""

```python
from typing import List, Dict


class ReasoningEngine:
    """
    A simple reasoning engine that helps in solving problems with limited reasoning sophistication.
    It uses a rule-based approach to deduce conclusions from given premises.

    Args:
        rules: A list of tuples where each tuple consists of (premise, conclusion).
               premise is a string and conclusion is also a string.
    """

    def __init__(self, rules: List[tuple]):
        self.rules = rules

    def infer(self, facts: Dict[str, bool]) -> Dict[str, bool]:
        """
        Given a set of known facts, this method uses the provided rules to deduce new conclusions.

        Args:
            facts: A dictionary where keys are strings representing statements and values are boolean indicating truth value.

        Returns:
            A dictionary with new inferences based on the input facts.
        """
        new_inferences = {}
        for premise, conclusion in self.rules:
            if all(fact in facts and facts[fact] is True for fact in premise.split()):
                new_inferences[conclusion] = True
        return {k: v for k, v in new_inferences.items() if v}

    def add_rule(self, premise: str, conclusion: str) -> None:
        """
        Adds a new rule to the reasoning engine.

        Args:
            premise: A string representing the condition under which the conclusion is true.
            conclusion: A string representing the result of the rule when the premise holds true.
        """
        self.rules.append((premise, conclusion))


# Example Usage
if __name__ == "__main__":
    # Define some rules
    rules = [
        ("All mammals are warm-blooded.", "All whales are warm-blooded."),
        ("All dogs are mammals.", "All dogs are warm-blooded.")
    ]

    reasoning_engine = ReasoningEngine(rules)

    # Known facts
    known_facts = {
        "Whales are mammals": True,
        "Dogs are animals": True
    }

    # Deduce new conclusions based on the provided rules and known facts
    inferred_conclusions = reasoning_engine.infer(known_facts)
    print("Inferred Conclusions:", inferred_conclusions)

    # Add a new rule to the engine
    reasoning_engine.add_rule("All cats are mammals.", "All cats are warm-blooded.")
```