"""Create reasoning_engine
Generated by Phi-Octopus Eden
2025-11-08 01:05:59.625630
"""

```python
from typing import List, Dict


class ReasoningEngine:
    """
    A basic reasoning engine that solves problems by applying a set of predefined rules.
    """

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

    def add_rule(self, category: str, rule: str) -> None:
        """
        Adds a new rule to the knowledge base.

        :param category: The category or topic of the rule.
        :param rule: A string representation of the logical rule.
        """
        if category not in self.knowledge_base:
            self.knowledge_base[category] = []
        self.knowledge_base[category].append(rule)

    def reason(self, input_data: Dict[str, str]) -> bool:
        """
        Applies rules from the knowledge base to a given set of data and returns True if any rule matches.

        :param input_data: A dictionary containing key-value pairs representing known facts.
        :return: Boolean indicating whether at least one rule matched the input data.
        """
        for category, rules in self.knowledge_base.items():
            for rule in rules:
                try:
                    # Example logic to apply a rule
                    if eval(rule.format(**input_data)):
                        return True
                except KeyError as e:
                    print(f"Missing key: {e}")
                except Exception as e:
                    print(f"Error evaluating rule: {e}")
        return False


# Example usage
def main():
    reasoning_engine = ReasoningEngine()

    # Adding rules to the engine
    reasoning_engine.add_rule("Health", "temperature > 100 => fever")
    reasoning_engine.add_rule("Math", "x + y == z and x < y => x is negative")

    # Providing input data
    test_data_1 = {"temperature": 102}
    test_data_2 = {"x": -5, "y": 3, "z": -8}

    # Running the reasoning engine with given inputs
    print(reasoning_engine.reason(test_data_1))  # Expected: True (fever)
    print(reasoning_engine.reason(test_data_2))  # Expected: True (x is negative)


if __name__ == "__main__":
    main()
```