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 n個參數的函數咖喱在javascript
- 7. 如何理解咖喱的函數定義/ uncurry
- 8. 奇怪的東西與咖喱功能
- 9. Scala的摺疊式咖喱功能
- 10. Scala的部分應用咖喱功能
- 11. Ramda咖喱/ uncurry問題與ES6默認參數語法
- 12. 用lodash鏈接咖喱功能
- 13. 如何使用咖喱功能
- 14. 咖喱功能:如何優化它們
- 15. 如何在斯卡拉咖喱功能
- 16. 我應該使用咖喱功能嗎?
- 17. 如何使用Lodash流程瞭解咖喱和功能組成?
- 18. JavaScript的咖喱/schönfinkeln
- 19. SML咖喱問題
- 20. 無法調用咖喱功能從componentDidMount()的陣營組成
- 21. 具有咖喱功能的Scala無點呼叫語法
- 22. Scala中的咖喱和關閉
- 23. Django的咖喱錯誤
- 24. Swift3中的咖喱關閉?
- 25. 如何輸入lodash/fp咖喱菜單功能?
- 26. 是否可以強制早期評估咖喱功能?
- 27. 如何啓用咖喱功能繼承,然後部分應用
- 28. 咖喱霍華德對應和平等
- 29. 斯卡拉咖喱例
- 30. CPS以咖喱語言
定義匹配但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