scope allocation and trace_edges prototype.