Evaluate a decision tree: a modified binary tree with signals and constants whose leaves are booleans; implement buildTree, evalTree and modifyLeaf to evaluate an expression to a boolean.
Asked in the coding stage. Represent operators as internal nodes and signals or constants as leaves. Implement evaluate_expression(spec, signals, modifications) as the grading entry point; it should build the tree, apply modifications in order, and return the final boolean.
spec is a nested dictionary, signals maps signal names to booleans, and modifications is a list of {name, value} objects. Return a boolean. Operators are AND and OR.
def evaluate_expression(spec, signals, modifications):