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