"""Create reasoning_engine
Generated by Phi-Octopus Eden
2025-11-08 01:24:03.211361
"""

```python
from typing import List, Dict

class ReasoningEngine:
    """
    A simple reasoning engine that can evaluate logical conditions based on input data.
    """

    def __init__(self):
        self.knowledge_base: Dict[str, bool] = {}

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

        :param fact_name: The name of the fact (as a string).
        """
        if fact_name not in self.knowledge_base:
            self.knowledge_base[fact_name] = False

    def set_fact(self, fact_name: str, value: bool) -> None:
        """
        Sets or updates a boolean fact to the knowledge base.

        :param fact_name: The name of the fact (as a string).
        :param value: The boolean value of the fact.
        """
        self.knowledge_base[fact_name] = value

    def check_fact(self, fact_name: str) -> bool:
        """
        Checks if a given fact is True in the knowledge base.

        :param fact_name: The name of the fact (as a string).
        :return: A boolean indicating whether the fact is known to be true.
        """
        return self.knowledge_base.get(fact_name, False)

    def reason(self, rule: str) -> bool:
        """
        Evaluates a logical condition based on facts in the knowledge base.

        :param rule: A string representing a logical expression using 'and', 'or', and variable names as fact names.
        :return: A boolean result of evaluating the rule.
        """
        try:
            return eval(rule, self.knowledge_base)
        except KeyError:
            print(f"Unknown fact in rule: {rule}")
            return False

# Example usage
if __name__ == "__main__":
    engine = ReasoningEngine()
    engine.add_fact("rainy")
    engine.set_fact("umbrella", True)

    # Define a simple rule
    rule = "rainy and umbrella"

    print(engine.reason(rule))  # Output: True

    rule2 = "rainy or not umbrella"
    print(engine.reason(rule2))  # Output: True
```

This example demonstrates how to use the `ReasoningEngine` class to manage facts, set their values, and evaluate simple logical expressions based on those facts.