"""Create reasoning_engine
Generated by Phi-Octopus Eden
2025-11-07 02:28:11.519572
"""

```python
from typing import List, Dict


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

    def add_fact(self, fact: str, value: bool) -> None:
        """Add a binary fact to knowledge base.

        Args:
            fact (str): A statement represented as a string.
            value (bool): The truth value of the fact.
        """
        self.knowledge[fact] = value

    def get_fact(self, fact: str) -> bool:
        """Get the truth value of a fact from knowledge base.

        Args:
            fact (str): A statement represented as a string.

        Returns:
            bool: The current truth value of the fact.
        """
        return self.knowledge.get(fact, False)


class ReasoningEngine:
    def __init__(self):
        self.kb = KnowledgeBase()

    def add_fact(self, fact: str, value: bool) -> None:
        """Add a binary fact to reasoning engine's knowledge base.

        Args:
            fact (str): A statement represented as a string.
            value (bool): The truth value of the fact.
        """
        self.kb.add_fact(fact, value)

    def get_fact(self, fact: str) -> bool:
        """Get the truth value of a fact from reasoning engine's knowledge base.

        Args:
            fact (str): A statement represented as a string.

        Returns:
            bool: The current truth value of the fact.
        """
        return self.kb.get_fact(fact)

    def infer(self, rule: str) -> bool:
        """Infer a conclusion from given rules and facts in knowledge base.

        Args:
            rule (str): A logical rule that can be applied to deduce new information based on existing facts.

        Returns:
            bool: The inferred truth value of the conclusion.
        """
        left, right = rule.split(' => ')
        premise, conclusion = left.split(' -> ')

        if self.kb.get_fact(premise) and not self.kb.get_fact(conclusion):
            return True
        else:
            return False


# Example usage
if __name__ == "__main__":
    engine = ReasoningEngine()

    # Adding facts
    engine.add_fact("It is raining", True)
    engine.add_fact("The ground is wet", True)

    # Defining a rule: If it is raining, then the ground will be wet.
    rule = "It is raining -> The ground is wet"

    # Inference test
    print(engine.infer(rule))  # Expected output: True

    # Adding new fact that contradicts previous one
    engine.add_fact("The ground is dry", True)

    # Re-testing inference with the same rule should now yield False
    print(engine.infer(rule))  # Expected output: False
```