"""Create reasoning_engine
Generated by Phi-Octopus Eden
2025-11-06 11:28:23.230849
"""

```python
from typing import List, Dict

class ReasoningEngine:
    """
    A basic reasoning engine designed to address limited reasoning sophistication.
    This engine uses a simple rule-based approach for problem solving.

    Args:
        rules: A list of dictionaries containing the conditions and actions for each rule.
               Each dictionary should have keys 'when' (for conditions) and 'then' (for actions).

    Example usage:
    >>> rules = [
            {
                "when": {"x > 0", "y < 10"},
                "then": lambda x, y: f"x is positive and y is less than 10: {x}, {y}"
            },
            {
                "when": {"x == 0", "y >= 10"},
                "then": lambda x, y: f"x is zero and y is greater or equal to 10: {x}, {y}"
            }
        ]
    >>> engine = ReasoningEngine(rules)
    >>> print(engine.reason(2, 9))
    'x is positive and y is less than 10: 2, 9'
    """

    def __init__(self, rules: List[Dict[str, list]]):
        self.rules = rules

    def reason(self, x: int, y: int) -> str:
        """
        Apply the reasoning engine to evaluate conditions and return a corresponding action.

        Args:
            x (int): Input value for condition evaluation.
            y (int): Input value for condition evaluation.

        Returns:
            str: The result based on matched rule.
        """
        results = []
        for rule in self.rules:
            when_conditions = rule['when']
            if all(condition.replace(' ', '') == f"x{condition[1:]}" and eval(condition, {'x': x}) for condition in when_conditions):
                action = rule['then'](x, y)
                results.append(action)

        return '\n'.join(results) or 'No rules matched.'
```