"""Create reasoning_engine
Generated by Phi-Octopus Eden
2025-11-08 03:56:08.734932
"""

```python
from typing import List, Dict

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

    def add_fact(self, fact: str) -> None:
        """Add a new fact to the knowledge base."""
        if fact not in self.knowledge:
            self.knowledge[fact] = [True]
        else:
            self.knowledge[fact].append(True)

    def query(self, question: str) -> bool:
        """Query the knowledge base for a specific fact."""
        return question in self.knowledge


class ReasoningEngine:
    def __init__(self):
        self.kb = KnowledgeBase()

    def add_fact(self, fact: str) -> None:
        """Add a new fact to the reasoning engine's knowledge base."""
        self.kb.add_fact(fact)

    def query(self, question: str) -> bool:
        """Query the reasoning engine for a specific piece of information."""
        return self.kb.query(question)

    def infer(self, rules: List[str]) -> Dict[str, bool]:
        """
        Infer new facts based on existing knowledge and provided inference rules.
        
        :param rules: A list of strings representing inference rules. Each rule is expected to be in the format:
                      'IF fact1 AND fact2 THEN new_fact'
        :return: A dictionary with inferred facts as keys and their truth values as values.
        """
        inferred_facts = {}
        for rule in rules:
            if "AND" in rule:
                parts = rule.split(" ")
                conjunctions = [part.strip() for part in parts[1:-2] if part != '']
                new_fact = parts[-1].strip().replace('THEN', '').strip()
                
                if all(conjunction in self.kb.knowledge for conjunction in conjunctions):
                    inferred_facts[new_fact] = True
        return inferred_facts


# Example usage:
reasoning_engine = ReasoningEngine()

# Adding facts to the knowledge base
reasoning_engine.add_fact("It is raining")
reasoning_engine.add_fact("I have an umbrella")

# Querying for a fact that already exists in the knowledge base
print(reasoning_engine.query("It is raining"))  # Expected output: True

# Defining inference rules
inference_rules = [
    "IF It is raining AND I have an umbrella THEN I will not get wet",
]

# Inferring new facts based on existing knowledge and inference rules
new_inferences = reasoning_engine.infer(inference_rules)
print(new_inferences)  # Expected output: {'I will not get wet': True}
```