[SOLVED] CS代考程序代写 ;some functions

30 $

File Name: CS代考程序代写_;some_functions.zip
File Size: 339.12 KB

SKU: 6477155051 Category: Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Or Upload Your Assignment Here:


;some functions
(define (square x)(* x x))
(define (sos x y)(+ (square x)(square y)))
(define (f a)(sos (+ a 1)(* a 2)))

;substitution model (applicative order)
;(f 5)
;(sos (+ 5 1)(* 5 2))
;(sos 6 10)
;(+ (square 6)(square 10))
;(+ (* 6 6)(* 10 10))
;(+ 36 100)
;136

;substitution model (normal order)
;(f 5)
;(sos (+ 5 1)(* 5 2))
;(+ (square (+ 5 1))(square (* 5 2))
;(+ (* (+ 5 1)(+ 5 1)) (square (* 5 2)))
;(+ (* 6 6) (square (* 5 2)))
;(+ 36 (square (* 5 2)))
;(+ 36 (* (* 5 2)(* 5 2)))
;(+ 36 (* 10 10))
;(+ 36 100)
;136

;(f 5)
;(sos (+ 5 1)(* 5 2))
;(+ (square (+ 5 1))(square (* 5 2)))
;(+ (* (+ 5 1)(+ 5 1)) (* (* 5 2)(* 5 2)))
;(+ (* 6 6)(* 10 10))
;(+ 36 100)
;136

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[SOLVED] CS代考程序代写 ;some functions
30 $