Abbreviation is a term from lambda calculus, which includes a transformation preserving semantics, which replaces one term with an equivalent term. For the examples you indicated, the most important type of abbreviations are
- Replacing a name by its definition (an instance of substitution of equals for equals).
- Beta-reduction application features.
Beta reduction is a basic rule in lambda calculus, and in a clean, lazy language like Haskell, it always preserves semantics. The beta rule is as follows:
(\x. e) m
can be replaced by e replacing m with x . (Substitution should avoid "capturing" free instances of x in m .)
It is possible that your instructor wants you to combine abbreviations as follows:
- Find the function application in which the function is applied is the name.
- Replace the name with your definition, which will be an abstraction of lambda.
- Beta reduction of the application.
- Do it in one step.
Note that you often have a choice about which application should be reduced; for example, in the term you give, there are two square applications and one of fst , which can be reduced in this way. (Application + can also be reduced, but const reduction requires different rules.)
Of the questions that I see, your instructor wants you to cut each term several times until you reach a normal form , and your instructor wants you to demonstrate your understanding of the different reduction strategies. The word "source" in the "original abbreviation" is redundant; abbreviation means manipulating the baseline in a language. I would formulate the questions as follows:
Using a reduction strategy that matches Haskell's lazy assessment, reduce the following expression to a normal normal head shape. Show each step in a sequence of abbreviations.
Using a reduction strategy that matches the assessment in a strict functional language, reduce the following expression to normal.
I would probably prefer to be less modest and simply name reduction strategies: on-demand reduction strategies and cost-reduction strategies.
source share