0
A
回答
2
假设以下definions(您需要检查那些符合你定义)
// creates a pair of two values
pair := λx.λy.λf. fxy
// selects the first element of the pair
first := λp. p(λx.λy. x)
// selects the second element of the pair
second := λp. p(λx.λy. y)
// currys f
curry := λf.λx.λy . f (pair x y)
// uncurrys f
uncurry := λf.λp . f (first p) (second p)
您展示
uncurry(curry E) = E
通过将以上的定义为咖喱和在uncurry
uncurry(curry E)
这导致
(λf.λp . f (first p) (second p)) ((λf.λx.λy . f (pair x y)) E)
然后就减少术语以上使用λ-caluclus的缩减规则,即使用:
- α转换:改变约束变量
- β - 还原:在应用功能,他们的论据
http://en.wikipedia.org/wiki/Lambda_calculus http://www.mathstat.dal.ca/~selinger/papers/lambdanotes.pdf
这应该引起
E
如果你写下每减少一步,你已经证明,
uncurry(curry E) = E
这里草图应该如何看起来像:
uncurry(curry E) = // by curry-, uncurry-definion
(λf.λp . f (first p) (second p)) ((λf.λx.λy . f (pair x y)) E) = // by pair-definiton
(λf.λp . f (first p) (second p)) ((λf.λx.λy . f (λx.λy.λf. fxy x y)) E) = // 2 alpha-conversions
(λf.λp . f (first p) (second p)) ((λf.λx.λy . f (λa.λb.λf. fab x y)) E) = // 2 beta-reductions
(λf.λp . f (first p) (second p)) ((λf.λx.λy . f (λf. fxy)) E) = // ...
...
...
... = // β-reduction
E
相关问题
- 1. 的JavaScript功能咖喱
- 2. 实现咖喱功能
- 3. 获取咖喱功能
- 4. 问题上咖喱功能
- 5. 可变参数咖喱和功能
- 6. 如何理解咖喱的函数定义/ uncurry
- 7. Uncurry n个参数的函数咖喱在javascript
- 8. Scala的折叠式咖喱功能
- 9. Scala的部分应用咖喱功能
- 10. 奇怪的东西与咖喱功能
- 11. Ramda咖喱/ uncurry问题与ES6默认参数语法
- 12. 如何在斯卡拉咖喱功能
- 13. 咖喱功能故障(SML/NJ)
- 14. 如何使用咖喱功能
- 15. 咖喱功能应该如何工作?
- 16. 咖喱功能:如何优化它们
- 17. 我应该使用咖喱功能吗?
- 18. 用lodash链接咖喱功能
- 19. ML中的高级功能咖喱和饼干什么
- 20. 如何使用Lodash流程了解咖喱和功能组成?
- 21. 咖喱和空参数
- 22. JavaScript的咖喱/schönfinkeln
- 23. 数组的咖喱功能不能正常工作
- 24. 使用FunctionX#咖喱
- 25. SML咖喱问题
- 26. ReactJS咖喱的功能,以延迟事件绑定
- 27. 无法调用咖喱功能从componentDidMount()的阵营组成
- 28. 咖喱会产生部分应用的功能吗?
- 29. 具有咖喱功能的Scala无点呼叫语法
- 30. 秩序咖喱斯卡拉参数的功能
定义匹配但I th墨水,我在一些减少步骤失败。你能写下所有的步骤吗?谢谢! – ikerexxe 2013-02-14 16:23:57
我认为这是练习的要点。 – 2013-02-14 17:11:32
这样好吗? uncurry(咖喱E)= λf.λp。 f(first p)(second p)(λf.λx.λy.f(pair xy)E)= λf.λp。 f(first p)(second p)(λx.λy.E(pair xy))= λf.λp。 f(第一个p)(第二个p)E = λp。 E(首页)(第二页)= E – ikerexxe 2013-02-14 20:22:20