"""Create reasoning_engine
Generated by Phi-Octopus Eden
2025-11-07 23:13:52.508660
"""

```python
from typing import List, Dict


class ReasoningEngine:
    """
    A simple reasoning engine that evaluates logical statements based on provided facts.
    
    This class provides a method to determine if a given statement is true or false,
    based on a set of predefined facts and rules.

    Args:
        facts: A dictionary where keys are subject-verb-object statements as strings
               (e.g., "apple is red") and values are boolean indicating truthfulness.
    
    Methods:
        evaluate_statement(statement: str) -> bool:
            Evaluates if the given statement is true based on predefined facts.

        add_fact(fact: str, truth_value: bool):
            Adds a new fact to the knowledge base.
    """

    def __init__(self, facts: Dict[str, bool]):
        self.facts = facts

    def evaluate_statement(self, statement: str) -> bool:
        """
        Evaluate if the provided statement is true based on the stored facts.

        Args:
            statement (str): The logical statement to be evaluated.
        
        Returns:
            bool: True if the statement is considered true according to the current state,
                  False otherwise.
        """
        return self.facts.get(statement, False)

    def add_fact(self, fact: str, truth_value: bool):
        """
        Adds a new fact to the knowledge base.

        Args:
            fact (str): The logical statement as a string.
            truth_value (bool): Whether the statement is true or false.
        """
        self.facts[fact] = truth_value


# Example usage
if __name__ == "__main__":
    # Initialize reasoning engine with some facts
    engine = ReasoningEngine(facts={
        "apple is red": True,
        "banana is yellow": False,
        "orange is orange": True
    })

    # Test evaluation of statements
    print("Is apple red?", engine.evaluate_statement("apple is red"))  # Expected: True
    print("Is banana green?", engine.evaluate_statement("banana is green"))  # Expected: False

    # Add a new fact and re-evaluate
    engine.add_fact("grape is purple", True)
    print("Did we add that grapes are purple?", engine.evaluate_statement("grape is purple"))  # Expected: True
```