"""Create reasoning_engine
Generated by Phi-Octopus Eden
2025-11-06 11:05:11.921878
"""

```python
from typing import List, Dict


class ReasoningEngine:
    """
    A simple reasoning engine that processes rules and applies them to a set of facts.
    This engine supports AND logic for combining conditions.
    """

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

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

        :param rule_name: The name of the rule.
        :param condition_list: A list of conditions that need to be met for this rule to apply.
        Each condition is a dictionary where key is the fact and value is its expected boolean state.
        """
        self.rules[rule_name] = condition_list

    def check_rule(self, rule_name: str, facts: Dict[str, bool]) -> bool:
        """
        Checks if the given rule applies based on the current set of facts.

        :param rule_name: The name of the rule to check.
        :param facts: A dictionary representing the current state of facts.
        :return: True if all conditions are met, False otherwise.
        """
        for condition in self.rules[rule_name]:
            fact_value = facts.get(condition.keys()[0], None)
            if fact_value is None or not fact_value == condition.values()[0]:
                return False
        return True

    def apply_rule(self, rule_name: str, actions: Dict[str, callable]) -> None:
        """
        Applies the given rule by executing its associated actions.

        :param rule_name: The name of the rule to apply.
        :param actions: A dictionary mapping action names to their corresponding functions.
        """
        if self.check_rule(rule_name, facts):
            for action in actions.get(rule_name, []):
                action()

    def get_facts(self) -> Dict[str, bool]:
        """
        Returns a dictionary of all current facts.

        :return: A dictionary where keys are fact names and values are their boolean states.
        """
        return {fact: condition.values()[0] for rule in self.rules.values() for condition in rule}

# Example usage
def turn_on_light():
    print("Light turned on")

def start_heating():
    print("Heating started")

reasoning_engine = ReasoningEngine()
reasoning_engine.add_rule("night_mode", [{"light_is_dark": True}])
reasoning_engine.add_rule("warm_up_home", [{"temperature_is_low": True, "time_is_night": True}])

facts = {"light_is_dark": True, "temperature_is_low": True, "time_is_night": True}

reasoning_engine.apply_rule("night_mode", {})
reasoning_engine.apply_rule("warm_up_home", {"night_mode": [turn_on_light], "warm_up_home": [start_heating]})

# Output:
# Light turned on
# Heating started
```