Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 課題3
- 問題7-1
- (define (plus a b)
- (if (= a 0)
- b
- (inc (plus (dec a) b))))
- 置き換えモデル
- (plus 3 8)を評価
- (inc (plus 2 8))
- (inc (inc(plus 1 8)))
- (inc (inc (inc(plus 0 8))))
- (inc (inc (inc 8)))
- (inc (inc 9))
- (inc 10)
- 11
- このプロセスは再帰的。(マトリョーシュカみたいだ。)
- 問題7-2
- (define (plus a b)
- (if (= a 0)
- b
- (plus (dec a) (inc b))))
- 置き換えモデル
- (plus 3 8)を評価
- (plus 2 9)
- (plus 1 10)
- (plus 0 11)
- 11
- このプロセスは反復的。(誇張、収縮してないから反復。)
Add Comment
Please, Sign In to add comment