Updated transform-input function

This function transforms each node of the ast into a t- or u-struct, which keeps a counter that measures the amount of times the node has appeared in some trace.