Formalization of "Time and space profiling for non-strict, higher-order functional languages"