"""Create reasoning_engine
Generated by Phi-Octopus Eden
2025-11-08 01:59:31.983099
"""

```python
from typing import List, Dict


class KnowledgeBase:
    def __init__(self):
        self.knowledge = {}

    def add_fact(self, key: str, value: bool) -> None:
        """
        Add a fact to the knowledge base.
        
        :param key: The identifier of the fact.
        :param value: The truth value of the fact (True or False).
        """
        self.knowledge[key] = value

    def query(self, key: str) -> bool:
        """
        Query for the truth value of a fact in the knowledge base.

        :param key: The identifier of the fact.
        :return: True if the fact is known to be true, False otherwise.
        """
        return self.knowledge.get(key, False)


class RuleEngine:
    def __init__(self):
        self.rules = []

    def add_rule(self, antecedent: List[str], consequent: str) -> None:
        """
        Add a rule to the engine.

        :param antecedent: A list of fact keys that must be true for the rule to apply.
        :param consequent: The key representing the conclusion of the rule.
        """
        self.rules.append((antecedent, consequent))

    def infer(self, facts: Dict[str, bool]) -> List[str]:
        """
        Apply rules to infer new facts from existing knowledge.

        :param facts: A dictionary of known facts (keys) and their truth values (values).
        :return: A list of keys representing newly inferred facts.
        """
        inferred_facts = []
        for antecedent, consequent in self.rules:
            if all(facts[key] for key in antecedent):
                if consequent not in facts or not facts[consequent]:
                    inferred_facts.append(consequent)
                    facts[consequent] = True
        return inferred_facts


def create_reasoning_engine() -> RuleEngine:
    """
    Create and configure a basic reasoning engine.

    :return: A configured instance of the RuleEngine class.
    """
    # Initialize the knowledge base with some basic facts
    kb = KnowledgeBase()
    kb.add_fact("has_key", True)
    kb.add_fact("is_locked", False)

    # Configure the rule engine with rules based on the provided facts
    reasoning_engine = RuleEngine()
    reasoning_engine.add_rule(["has_key", "is_locked"], "can_open_door")

    return reasoning_engine


# Example usage:
if __name__ == "__main__":
    engine = create_reasoning_engine()
    print(engine.infer({"has_key": True, "is_locked": False}))  # Should output ['can_open_door']
```