Guest User

Untitled

a guest
Feb 19th, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. 課題3 
  2. 問題7-1
  3.  
  4. (define (plus a b)
  5. (if (= a 0)
  6. b
  7. (inc (plus (dec a) b))))
  8.  
  9. 置き換えモデル
  10. (plus 3 8)を評価
  11.  
  12. (inc (plus 2 8))
  13. (inc (inc(plus 1 8)))
  14. (inc (inc (inc(plus 0 8))))
  15. (inc (inc (inc 8)))
  16. (inc (inc 9))
  17. (inc 10)
  18. 11
  19.  
  20. このプロセスは再帰的。(マトリョーシュカみたいだ。)
  21.  
  22. 問題7-2
  23. (define (plus a b)
  24. (if (= a 0)
  25. b
  26. (plus (dec a) (inc b))))
  27.  
  28. 置き換えモデル
  29. (plus 3 8)を評価
  30.  
  31. (plus 2 9)
  32. (plus 1 10)
  33. (plus 0 11)
  34. 11
  35.  
  36. このプロセスは反復的。(誇張、収縮してないから反復。)
Add Comment
Please, Sign In to add comment