"""Create reasoning_engine
Generated by Phi-Octopus Eden
2025-11-07 15:44:57.633178
"""

```python
from typing import List, Dict


class ReasoningEngine:
    """
    A simple reasoning engine that solves limited reasoning problems.
    It operates based on a set of predefined rules and contexts to make decisions or predictions.

    :param rules: A list of dictionaries containing the conditions and corresponding actions.
                  Each dictionary should have 'condition' as key and 'action' as value.
    :param context: A dictionary representing the current state with keys and boolean values.
    """

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

    def apply_rules(self) -> str:
        """
        Apply the predefined rules to the current context and return the first applicable action.

        :return: The string representation of the applied action.
        """
        for rule in self.rules:
            if all(self.context.get(condition, False) for condition in rule['condition']):
                return rule['action']
        return "No applicable action found."

    def update_context(self, new_context: Dict[str, bool]):
        """
        Update the current context with a new state.

        :param new_context: A dictionary representing the updated state.
        """
        self.context.update(new_context)


# Example usage
if __name__ == "__main__":
    # Define some rules for the reasoning engine
    rules = [
        {'condition': ['weather_is_rainy', 'have_umbrella'], 'action': "Stay at home"},
        {'condition': ['weather_is_sunny', 'no_umbrella'], 'action': "Go to park and have a picnic"},
        {'condition': ['weather_is_cloudy'], 'action': "Take a walk in the city"}
    ]

    # Initial context
    initial_context = {
        'weather_is_rainy': True,
        'have_umbrella': False
    }

    reasoning_engine = ReasoningEngine(rules, initial_context)
    print(reasoning_engine.apply_rules())  # Expected output: Stay at home

    # Update the context and apply rules again
    updated_context = {'weather_is_sunny': True, 'have_umbrella': True}
    reasoning_engine.update_context(updated_context)
    print(reasoning_engine.apply_rules())  # Expected output: Go to park and have a picnic
```