"""Create reasoning_engine
Generated by Phi-Octopus Eden
2025-11-05 23:33:31.220713
"""

```python
from typing import List, Dict, Any

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

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

    def query_fact(self, fact: str) -> List[str]:
        """Query for all values associated with a given fact."""
        return self.data.get(fact, [])

def reasoning_engine(kb: KnowledgeBase) -> Dict[str, Any]:
    """
    A simple reasoning engine that performs basic logical inference over the knowledge base.
    
    :param kb: An instance of KnowledgeBase containing facts and their corresponding values.
    :return: A dictionary with inferred statements as keys and their conclusions as values.
    """
    inferences = {}
    
    # Define some rules
    rules = [
        ({"color": "red", "shape": "circle"}, {"area": lambda d, r: 3.14 * r**2}),
        ({"color": "blue", "shape": "rectangle"}, {"volume": lambda l, w, h: l * w * h})
    ]
    
    for rule in rules:
        antecedent, conclusion = rule
        if all(kb.query_fact(fact) and kb.query_fact(fact)[0] == value for fact, value in antecedent.items()):
            result = conclusion[list(conclusion.keys())[0]](*antecedent.values())
            inference_key = f"inf_{kb.data['color'][0]}_{kb.data['shape'][0]}"
            inferences[inference_key] = {list(conclusion.keys())[0]: result}
    
    return inferences

# Example usage
if __name__ == "__main__":
    kb = KnowledgeBase()
    kb.add_fact("color: red")
    kb.add_fact("shape: circle")
    kb.add_fact("radius: 5")

    engine_output = reasoning_engine(kb)
    print(engine_output)  # Should output {'inf_red_circle': {'area': 785.0}}
```
```python
kb.add_fact("color: blue")
kb.add_fact("shape: rectangle")
kb.add_fact("length: 4")
kb.add_fact("width: 3")
kb.add_fact("height: 2")

engine_output = reasoning_engine(kb)
print(engine_output)  # Should output {'inf_blue_rectangle': {'volume': 24}}
```