e01.org

Strictness analysis

In computer science, strictness analysis refers to any algorithm used to prove that a function in a non-strict functional programming language is strict in one or more of its arguments. This information is useful to compilers because strict functions can be compiled more efficiently. Thus, if a function is proven to be strict (using strictness analysis) at compile time, it can be compiled to use a more efficient calling convention without changing the meaning of the enclosing program. Note that a function f is said to diverge if it returns \{\bot\ : operationally, that would mean that f either causes abnormal termination of the enclosing program (e.g., failure with an error message) or that... Source: e01 Encyclopedia. Licence: CC BY-SA 4.0.

In computer science, strictness analysis refers to any algorithm used to prove that a function in a non-strict functional programming language is strict in one or more of its arguments. This information is useful to compilers because strict functions can be compiled more efficiently. Thus, if a function is proven to be strict (using strictness analysis) at compile time, it can be compiled to use a more efficient calling convention without changing the meaning of the enclosing program. Note that a function f is said to diverge if it returns \{\bot\} : operationally, that would mean that f either causes abnormal termination of the enclosing program (e.g., failure with an error message) or that it loops infinitely. The notion of "divergence" is significant because a strict function is one that always diverges when given an argument that diverges, whereas a lazy (or non-strict) function is one that may or may not diverge when given such an argument. Strictness analysis attempts to determine the "divergence properties" of functions, which thus identifies some functions that are strict. Projection-based strictness analysis, introduced by Philip Wadler and R.J.M. Hughes, uses strictness projections to model more subtle forms of strictness, such as head-strictness in a list argument. (By contrast, GHC's demand analysis can only model strictness within product types, i.e., datatypes that only have a single constructor.) A function f is considered head-strict if f = f \circ \pi , where \pi is the projection that head-evaluates its list argument. There was a large body of research on strictness analysis in the 1980s.

source: e01 Encyclopedia · licence: CC BY-SA 4.0 · page · source revision

Cite this

"Strictness analysis". 1610571886. e01 Encyclopedia. CC BY-SA 4.0. https://en.wikipedia.org/w/index.php?oldid=1000161794

JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy

Save to pass ·