“…While there has subsequently been significant interest in the use of amortised analysis for automatic resource usage analysis, using an advanced per-reference potential, none of this newer work, however, considers lazy evaluation. Hofmann and Jost [19] were the first to develop an automatic amortised analysis for heap consumption, exploiting a difference metric similar to that used by Crary and Weirich [11] (the latter, however, only check bounds, and therefore do not perform an automatic static analysis of the kind we require); Hofmann et al have extended their method to cover a comprehensive subset of Java, including imperative updates, inheritance and type casts [20,21]; Shkaravska et al [41] subsequently considered heap consumption inference for first-order polymorphic lists; and Campbell [9] has developed the ideas of depth-based and temporary credit uses to give better results for stack usage. Hoffmann et al [18] achieved another breakthrough by extending the technique to infer multivariate polynomial cost functions, still only requiring efficient LP solving.…”