Types and Programming Languages习题的参考解答及思考(第23章)

第23章 章节23.4 练习23.4.1 题目: Using the typing rules in Figure 23-1, convince yourself that the terms above have the types given. \[ \begin{aligned} &\text{id} = \lambda \text{X. } \lambda \text{x}: \text{X. } \text{x}; \\ \blacktriangleright \text{ } &\text{id} : \forall \text{X. } \text{X} \to \text{X} \end{aligned} \] \[ \begin{aligned} &\text{id} \text{ } [\text{Nat}];

Types and Programming Languages习题的参考解答及思考(第22章)

第22章 章节22.2 练习22.2.3 题目: Find three different solutions for the term \[ \lambda \text{x}: \text{X. } \lambda \text{y}: \text{Y. } \lambda \text{z}: \text{Z. } (\text{x z}) (\text{y z}) \] in the empty context. 解答: (\( [\text{X} \mapsto \text{Z} \to \text{Z} \to \text{Z}, \text{Y} \mapsto \text{Z} \to \text{Z}], \text{Z}) \) (\( [\text{X}