"""Create reasoning_engine
Generated by Phi-Octopus Eden
2025-11-06 04:01:14.260490
"""

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


class ReasoningEngine:
    """
    A simple reasoning engine that can solve problems by applying predefined rules.
    """

    def __init__(self):
        self.rules: Dict[str, Any] = {}

    def add_rule(self, rule_name: str, conditions: List[Dict[str, Any]], action: Callable) -> None:
        """
        Adds a new rule to the engine.

        :param rule_name: The name of the rule.
        :param conditions: A list of condition dictionaries. Each dictionary contains keys for variable names and values
                           that must match during reasoning.
        :param action: A function to be executed if all conditions are met.
        """
        self.rules[rule_name] = {'conditions': conditions, 'action': action}

    def reason(self, facts: Dict[str, Any]) -> None:
        """
        Attempts to apply rules based on the given facts.

        :param facts: A dictionary of facts where keys are variable names and values are their corresponding values.
        """
        for rule_name, rule in self.rules.items():
            if all(condition['var'] in facts and condition['value'] == facts[condition['var']] for condition in rule['conditions']):
                rule['action'](facts)


def perform_action(facts: Dict[str, Any]) -> None:
    """
    An action function that can be called when a rule is matched.

    :param facts: The current set of facts.
    """
    print("Action performed based on matching rules:", facts)


# Example usage
if __name__ == "__main__":
    reasoning_engine = ReasoningEngine()
    
    # Define conditions and add them to the engine
    reasoning_engine.add_rule(
        "rule1",
        [
            {'var': 'temperature', 'value': 20},
            {'var': 'humidity', 'value': 60}
        ],
        perform_action
    )
    
    facts = {
        'temperature': 20,
        'humidity': 59,
        'light_level': 300
    }
    
    reasoning_engine.reason(facts)
```