偙偺愢柧偼丄埲壓偺僒僀僩偐傜偺堷梡偱偡丅
http://sourceforge.jp/projects/descartes/wiki/ExLisp2


*** Y僐儞價僱乕僞 ***

偙偺僨僇儖僩Lisp偼丄僋儘乕僕儍傗抶墑張棟婡擻偙偦帩偪傑偣傫偑丄崅奒偺兩幃傪庴偗庢偭偰兩幃傪曉偡婡擻傪帩偭偰偄傑偡丅偦偺偨傔丄Y僐儞價僱乕僞偩偭偰暯婥偱幚峴偱偒傑偡丅 

偲偙傠偱丄Y僐儞價僱乕僞(Y Combinator)偲偼丄壗偱偟傚偆偐丠 

娙扨偵尵偄愗偭偰偟傑偆偲丄柍柤偺兩幃偩偗偱嵞婣僾儘僌儔儉偵憡摉偡傞張棟傪壜擻偵偡傞傕偺偱偡丅 

偙傟偩偗偱偼壗偺偙偲偐傢偐傝傑偣傫偹丅師崁傛傝愢柧偟偰偄偒傑偟傚偆丅 

1. 柍柤娭悢乮兩幃乯偵傛傞嵞婣張棟丠

偙偺僨僇儖僩Lisp偱偼丄兩幃偑拞怱揑側栶妱傪壥偨偟傑偡丅 

偝偰丄兩幃偼丄娭悢偵柤慜傪梌偊側偄柍柤偺娭悢傪婰弎偟傑偡丅 

偙偺傛偆側丄柍柤偺娭悢偩偗偱丄壥偨偟偰嵞婣偵憡摉偡傞傛偆側僾儘僌儔儉傪彂偗傞偱偟傚偆偐丠傆偮偆丄嵞婣偡傞僾儘僌儔儉偱偼丄娭悢傪掕媊偡傞帪偵偦偺娭悢偺掕媊偺拞偱帺暘帺恎傪屇傃弌偡偙偲偵傛偭偰幚尰偟傑偡丅 

奒忔傪寁嶼偡傞僾儘僌儔儉偱嵞婣傪巊偄傑偟傚偆丅偨偲偊偽丄埲壓偺傛偆偵側傝傑偡丅 




(define (factor n)
        (cond
                ((<= 0) n 1)
                (T (* n (factor (- n 1))))
        )
)


factor娭悢偺掕媊偺拞偱(factor (- n 1)傪屇傃弌偟偰偄傑偡丅師乆偲丄堷悢偺抣偐傜1傪堷偄偨抣偱丄factor娭悢帺恎傪屇傃弌偟丄堷悢偑0偵側偭偨偲偙傠偱1傪曉偟傑偡丅抣偑曉偭偰偔傞偲丄崱搙偼屇傃弌偟偨娭悢偵抣傪曉偟側偑傜堷悢傪妡偗偰偝傜偵屇傃弌偟偨娭悢傊曉偟傑偡丅寢壥偲偟偰丄嵟弶偵屇傃弌偟偨偲偒偺堷悢偺奒忔偑摎偊偲偟偰曉傝丄張棟偑姰椆偟傑偡丅 

偟偐偟丄柍柤偺兩幃偺応崌偵偼丄暥帤捠傝柤慜偺側偄娭悢偱偁傞偨傔丄娭悢柤"factor"偵憡摉偡傞傕偺偑懚嵼偟傑偣傫丅偩偐傜丄偦偺娭悢帺恎傪屇傃弌偦偆偵傕丄柤慜偑側偄偺偱屇傃弌偟傛偆偑側偄偺偱偡丅 

偝偰丄崲傝傑偟偨両 

2. 僐儞價僱乕僞偲偼

僐儞價僱乕僞(combnator)偲偼丄壗偱偟傚偆偐丅 

挷傋偰傒傞偲丄帺桼曄悢傪娷傑側偄丄懇敍曄悢偱峔惉偝傟傞兩幃偺偙偲偺傛偆偱偡丅懇敍曄悢偲偼丄兩幃偺堷悢偵愝掕偝傟傞曄悢偱偡丅懇敍偝傟偰偄側偄曄悢偼丄帺桼曄悢偲屇傃傑偡丅 

僐儞價僱乕僞偵偼丄I, S, K側偳偺傛偆偵偄傠偄傠側庬椶偑偁傝傑偡丅偦偟偰丄僐儞價僱乕僞傪慻傒崌傢偣傞偙偲偵傛偭偰丄擟堄偺幃傪昞偡偙偲偑偱偒傑偡丅 

偙偙偱偼丄僐儞價僱乕僞偺拞偱傕丄嫽枴怺偄晄摦揰僐儞價僱乕僞偲側傞Y僐儞價僱乕僞偵偮偄偰丄杮暥偱愢柧偟偨偄偲巚偄傑偡丅 

3. 晄摦揰僐儞價僱乕僞偲偼

晄摦揰僐儞價僱乕僞偲偼壗偱偟傚偆偐 

傑偢丄晄摦揰偲偼丄悢妛偺梡岅偱偡丅 

a偑娭悢f 偺晄摦揰偱偁傞偲偼丄f(a) = a 偑惉傝棫偮偙偲傪尵偄傑偡丅 

偮傑傝丄堷悢偵擖傟偨抣偑丄娭悢傪昡壙偟偨寢壥偑尦偺抣偵栠傞偲偄偆偙偲偱偡丅 

偱偼丄晄摦揰僐儞價僱乕僞偲偼丄偳偆偄偆偙偲偱偟傚偆偐丅 

幚偼丄晄摦揰僐儞價僱乕僞偲偄偭偰傕偄偔偮偐庬椶偑偁傝傑偡丅偙偙偱偼丄偦偺偆偪偺堦偮偱偁傞乽Y僐儞價僱乕僞乿偱愢柧偟傑偟傚偆丅 

偙偺Y僐儞價僱乕僞偵偼丄擟堄偺儔儉僟幃F偵懳偟偰 

F(YF) = YF 
偲偄偆娭學偑偁傝傑偡丅愭傎偳偺 f(a) = a 偲尒斾傋偰傒偰偔偩偝偄丅摨偠峔憿偱偁傞偙偲偑傢偐傝傑偡丅 

偪傚偭偲嵍塃傪媡偵偟偰傒傑偟傚偆丅 

  YF = F(YF)

塃曈傪尒傞偲嵍曈偲摨偠YF偑尒偊傞偺偱偦傟偵戙擖偟偰傒傑偟傚偆丅 

  YF = F(YF) = F(F(YF))

偙傟偼丄偄偔傜偱傕壜擻偱偡丅 

  YF = F(YF) = F(F(YF)) = F(F(F(乧F(F(YF))乧)))

偙偺傛偆側惈幙傪帩偮Y傪僐儞價僱乕僞偲偟偰巊偆偙偲偵傛傝丄儔儉僟幃F傪嵞婣屇傃弌偟偟偨偺偲摨摍偺張棟傪峴傢偣傞偙偲偑偱偒傞傛偆偵側傞偺偱偡丅 

4. Y僐儞價僱乕僞偲偼

偙偙偱愢柧偡傞Y僐儞價僱乕僞偲偼埲壓偺傛偆側宍傪偟偰偄傑偡丅 




  兩f兩p (f 兩a ((p p) a))
     兩p (f 兩a ((p p) a))


偙偺兩幃偑丄晄摦揰僆儁儗乕僞偱偁傞Y僐儞價僱乕僞偱偡丅 

偙偺Y僐儞價僱乕僞傪偲傝偁偊偢丄Y偲偄偆柤慜偱掕媊偟傑偡丅 




(define Y 
  兩f兩p (f 兩a ((p p) a))
     兩p (f 兩a ((p p) a)))



偦偟偰丄奒忔傪寁嶼偡傞兩幃傪fact偲偟偰掕媊偟傑偡丅 




(define fact 
  兩f兩n 
        (cond 
          ((<= n 1) 1) 
           (T (* n (f (- n 1))))))


偙傟傜偺俀偮偺掕媊偵傛傝丄弨旛偼姰椆偟傑偟偨丅 

偱偼丄偝偭偦偔奒忔偺寁嶼傪帋偟偰傒傑偟傚偆丅 




(define Y 
  兩f兩p (f 兩a ((p p) a))
     兩p (f 兩a ((p p) a)))


(define fact 
  兩f兩n 
        (cond 
          ((<= n 1) 1) 
           (T (* n (f (- n 1))))))

((Y fact) 5) 



忋婰傪僼傽僀儖偵曐懚偟偰丄僨僇儖僩Lisp偐傜load偟傑偡丅壖偵fact偲偟偰曐懚偟偨偲偟傑偡丅 

$ descartes lisp-utf8
descartes 兩 Lisp (c) 2010 H.Niwa
Ready
(load fact)
>  (define Y (兩 (f) ((兩 (p) (f (兩 (a) ((p p) a)))) (兩 (p) (f (兩 (a) ((p p)
a)))))))
(兩 (f) ((兩 (p) (f (兩 (a) ((p p) a)))) (兩 (p) (f (兩 (a) ((p p) a))))))

>  (define fact (兩 (f) (兩 (n) (cond ((<= n 1) 1) (T (* n (f (- n 1))))))))
(兩 (f) (兩 (n) (cond ((<= n 1) 1) (T (* n (f (- n 1)))))))

>  ((Y fact) 5)
120

T

5偺奒忔偑寁嶼偝傟偰丄120偑摎偊偲偟偰弌椡偝傟偰偄傑偡丅 




偱傕丄偙傟偩偲丄Y偲偐fact偲偐偺曄悢傪巊偭偰偄傑偡偹丅偙偺曄悢偼杮摉偼偄傜側偄偺偱偼側偄偱偟傚偆偐丠 

崱搙偼Y偲fact傪揥奐偟偨宍偱幚峴偟傑偟傚偆丅 

Y偺抣偼丄忋偺fact傪幚峴偟偨屻偵Y偲懪偭偨屻偵Enter傪墴偣偽丄Lisp偺S幃偺宍幃偱昞帵偝傟傑偡丅暋嶨側兩幃偵側傞偺偱丄偙偪傜傪巊偄傑偟傚偆丅 




Y
(兩 (f) (f ((兩 (p) (f (兩 (a) ((p p) a)))) (兩 (p) (f (兩 (a) ((p p) a))))) a))


fact傕摨條偱偡丅 




fact
(兩 (f) (兩 (n) (cond ((<= n 1) 1) (T (* n (f (- n 1)))))))


偙偺俀偮偺S幃偱昞尰偝傟偨兩娭悢傪慻傒崌傢偣偰丄堷悢傪偮偗偰幚峴偟偰傒傑偟傚偆丅偙傫側宍偵慻傒崌傢偣傑偡丅 




((Y偺兩娭悢 fact偺兩娭悢) 堷悢)


偙傟偱傕丄奒忔偺寁嶼偑惓偟偔幚峴偝傟傞偱偟傚偆偐丠 




(((兩 (f) ((兩 (p) (f (兩 (a) ((p p) a)))) (兩 (p) (f (兩 (a) ((p p) a)))))) (兩 (f) (兩 (n) (cond ((<= n 1) 1) (T (* n (f (- n 1)))))))) 5)
120

偙傫側偵暋嶨側兩娭悢側偺偵丄惓偟偔摦偒傑偟偨両両両 

柍柤偺兩娭悢偱偁偭偰傕丄嵞婣偺奒忔偺張棟偑幚峴偱偒傞偲杮摉偵幚姶偱偒傑偟偨丅 

偙偺僨僇儖僩Lisp偼丄僋儘乕僕儍傗抶墑張棟婡擻偙偦帩偪傑偣傫偑丄崅奒偺兩幃傪庴偗庢偭偰兩幃傪曉偡婡擻傪帩偭偰偄傞偺偱偙偺傛偆側暋嶨側兩幃偺張棟傕惓偟偔幚峴偱偒傑偡丅 

偱偼丄偙偙偱堦偮媈栤偑晜偐傃傑偟偨丅 

忋偺奒忔偺兩娭悢偱丄娭悢偵憡摉偡傞堷悢埲奜偺兩娭悢偼偳偆偄偆宍偵昡壙偝傟偰偄傞偺偱偟傚偆偐丠 

偮傑傝丄師偵帵偡娭悢偼偳偺傛偆側宍傪偟偰偄傞偺偱偟傚偆偐丠 




(Y偺兩娭悢 fact偺兩娭悢)


帋偟偰傒傑偟傚偆丅 




(((兩 (f) ((兩 (p) (f (兩 (a) ((p p) a)))) (兩 (p) (f (兩 (a) ((p p) a))))))(兩 (f) (兩 (n) (cond ((<= n 1) 1) (T (* n (f (- n 1))))))))


幚峴寢壥偼偙傫側偙偲偵側偭偰偟傑偄傑偡丅 




(兩 (n) (cond ((<= n 1) 1) (T (* n ((兩 (n) (cond ((<= n 1) 1) (T (* n ((兩 (a)(((兩 (p) ((兩 (f) (兩 (n) (cond ((<= n 1) 1) (T (* n (f (- n 1))))))) (p p) a)) (兩 (p) ((兩 (f) (兩 (n) (cond ((<= n 1) 1) (T (* n (f (- n 1))))))) (p p) a))) a)) (- n 1)))))) (- n 1))))))


杮摉偵偙傟偱奒忔偺寁嶼偑偱偒傞偺偐丄堷悢傪偮偗偰幚峴偟偰傒傑偡丅堷悢偵7傪偄傟偰丄7偺奒忔傪寁嶼偟偰傒傑偟傚偆丅 




((兩 (n) (cond ((<= n 1) 1) (T (* n ((兩 (n) (cond ((<= n 1) 1) (T (* n ((兩 (a)(((兩 (p) ((兩 (f) (兩 (n) (cond ((<= n 1) 1) (T (* n (f (- n 1))))))) (p p) a)) (兩 (p) ((兩 (f) (兩 (n) (cond ((<= n 1) 1) (T (* n (f (- n 1))))))) (p p) a))) a)) (- n 1)))))) (- n 1))))))
7)
5040


杮摉偵寁嶼偱偒偰偟傑偄傑偟偨丅妋偐偵奒忔傪寁嶼偡傞兩娭悢偲側偭偰偄傞傛偆偱偡丅偙傫側偵暋嶨偱傕偪傖傫偲寁嶼偟偰偔傟傑偡丅 

5. Y僐儞價僱乕僞傪巊偭偨偦偺懠偺僾儘僌儔儉

奒忔偺寁嶼埲奜偵傕丄Y僐儞價僱乕僞傪巊偆偲嵞婣傪巊偭偨僾儘僌儔儉偑嶌傟傑偡丅 

儕僗僩偺挿偝傪曉偡僾儘僌儔儉偲丄僼傿儃僫僢僠悢傪寁嶼偡傞僾儘僌儔儉傪嶌惉偟傑偡丅 

忋偱帵偟偨傛偆偵俁庬椶偺兩娭悢偺掕媊曽朄偱帵偟傑偡丅斾妑偟偰傒偰偔偩偝偄丅 

師偺僾儘僌儔儉傪僼傽僀儖"Y-combinator"偵曐懚偟傑偡丅 




; Y-combinator for descartes Lisp/ 兩

;; Y-combinator

(define Y 
  兩f兩p (f 兩a ((p p) a))
     兩p (f 兩a ((p p) a)))


;; factorial
(define fact 
  兩f兩n 
        (cond 
          ((<= n 1) 1) 
           (T (* n (f (- n 1))))))

((Y fact) 5) 

;; Factorial by 兩 type 1
(((兩 (f) ((兩 (p) (f (兩 (a) ((p p) a)))) (兩 (p) (f (兩 (a) ((p p) a))))))
  (兩 (f) (兩 (n) (cond ((<= n 1) 1) (T (* n (f (- n 1))))))))
  6)

;; Factorial by 兩 type 2
((兩 (n) (cond ((<= n 1) 1) (T (* n ((兩 (n) (cond ((<= n 1) 1) (T (* n ((兩 (a)
(((兩 (p) ((兩 (f) (兩 (n) (cond ((<= n 1) 1) (T (* n (f (- n 1))))))) (p p) a))
 (兩 (p) ((兩 (f) (兩 (n) (cond ((<= n 1) 1) (T (* n (f (- n 1))))))) (p p) a)))
 a)) (- n 1)))))) (- n 1))))))
7)

;; list length

(define length
  兩f兩l
        (cond 
          ((equal l ()) 0) 
          ((atom l) 1)
          (T (+ (f (cdr l)) 1))))

((Y length) '(a b c)) 

;; length by 兩 type1
(((兩 (f) (f ((兩 (p) (f (兩 (a) ((p p) a)))) (兩 (p) (f (兩 (a) ((p p) a))))) a))
 (兩 (f) (兩 (l) (cond ((equal l ()) 0) ((atom l) 1) (T (+ (f (cdr l)) 1))))))
 '(1 2 3 4 5 6 7))

;; length by 兩 type2
((兩 (l) (cond ((equal l ()) 0) ((atom l) 1) (T (+ ((兩 (l) (cond ((equal l ()) 0) ((atom l) 1) (T (+ ((兩 (a) (((兩 (p) ((兩 (f) (兩 (l) (cond ((equal l ()) 0) ((atom l) 1) (T (+ (f (cdr l)) 1))))) (p p) a)) (兩 (p) ((兩 (f) (兩 (l) (cond ((equal l ()) 0) ((atom l) 1) (T (+ (f (cdr l)) 1))))) (p p) a))) a)) (cdr l)) 1)))) (cdr l)) 1))))
 '(1 2 3 4 5 6 7))

;; Fibonacci number

(define fib
  兩f兩n 
        (cond 
          ((= n 0) 0) 
          ((= n 1) 1) 
          (T (+ (f (- n 1)) (f (- n 2))))))


((Y fib) 3)

;; Fibonacci by 兩 type1
(((兩 (f) (f ((兩 (p) (f (兩 (a) ((p p) a)))) (兩 (p) (f (兩 (a) ((p p) a))))) a))
  (兩 (f) (兩 (n) (cond ((= n 0) 0) ((= n 1) 1) (T (+ (f (- n 1)) (f (- n 2))))))))
  4)

;; Fibonacci by 兩 type2
((兩 (n) (cond ((= n 0) 0) ((= n 1) 1) (T (+ ((兩 (n) (cond ((= n 0) 0) ((= n 1) 1) (T (+ ((兩 (a) (((兩 (p) ((兩 (f) (兩 (n) (cond ((= n 0) 0) ((= n 1) 1) (T (+ (f (- n 1)) (f (- n 2))))))) (p p) a)) (兩 (p) ((兩 (f) (兩 (n) (cond ((= n 0) 0) ((= n 1) 1) (T (+ (f (- n 1)) (f (- n 2))))))) (p p) a))) a)) (- n 1)) ((兩 (a) (((兩 (p) ((兩 (f) (兩 (n) (cond ((= n 0) 0) ((= n 1) 1) (T (+ (f (- n 1)) (f (- n 2))))))) (p p) a)) (兩 (p) ((兩 (f) (兩 (n) (cond ((= n 0) 0) ((= n 1) 1) (T (+ (f (- n 1)) (f (- n 2))))))) (p p) a))) a)) (- n 2)))))) (- n 1)) ((兩 (n) (cond ((= n 0) 0) ((= n 1) 1) (T (+ ((兩 (a) (((兩 (p) ((兩 (f) (兩 (n) (cond ((= n 0) 0) ((= n 1) 1) (T (+ (f (- n 1)) (f (- n 2))))))) (p p) a)) (兩 (p) ((兩 (f) (兩 (n) (cond ((= n 0) 0) ((= n 1) 1) (T (+ (f (- n 1)) (f (- n 2))))))) (p p) a))) a)) (- n 1)) ((兩 (a) (((兩 (p) ((兩 (f) (兩 (n) (cond ((= n 0) 0) ((= n 1) 1) (T (+ (f (- n 1)) (f (- n 2))))))) (p p) a)) (兩 (p) ((兩 (f) (兩 (n) (cond ((= n 0) 0) ((= n 1) 1) (T (+ (f (- n 1)) (f (- n 2))))))) (p p) a))) a)) (- n 2)))))) (-
 n 2))))))
  5)




偱偼丄傑偲傔偰幚峴偟偨寢壥傪埲壓偵帵偟傑偟傚偆丅 

暋嶨側兩娭悢偵側傞偺偱丄幚峴帪娫傕挿偔側傝偑偪偱偡偑婥挿偵寢壥偑弌傞偺傪懸偭偰偔偩偝偄丅 




$ descartes -u exapmle/lisp/lisp-utf8
descartes 兩 Lisp (c) 2010 H.Niwa
Ready
(load "example/lisp/y-combinator/y-combinator-utf8")
>  (define Y (兩 (f) ((兩 (p) (f (兩 (a) ((p p) a)))) (兩 (p) (f (兩 (a) ((p p)
a)))))))
(兩 (f) ((兩 (p) (f (兩 (a) ((p p) a)))) (兩 (p) (f (兩 (a) ((p p) a))))))

>  (define fact (兩 (f) (兩 (n) (cond ((<= n 1) 1) (T (* n (f (- n 1))))))))
(兩 (f) (兩 (n) (cond ((<= n 1) 1) (T (* n (f (- n 1)))))))

>  ((Y fact) 5)
120

>  (((兩 (f) ((兩 (p) (f (兩 (a) ((p p) a)))) (兩 (p) (f (兩 (a) ((p p) a))))))
(兩 (f) (兩 (n) (cond ((<= n 1) 1) (T (* n (f (- n 1)))))))) 6)
720

>  ((兩 (n) (cond ((<= n 1) 1) (T (* n ((兩 (n) (cond ((<= n 1) 1) (T (* n ((兩
(a) (((兩 (p) ((兩 (f) (兩 (n) (cond ((<= n 1) 1) (T (* n (f (- n 1))))))) (p p)
 a)) (兩 (p) ((兩 (f) (兩 (n) (cond ((<= n 1) 1) (T (* n (f (- n 1))))))) (p p)
a))) a)) (- n 1)))))) (- n 1)))))) 7)
5040

>  (define length (兩 (f) (兩 (l) (cond ((equal l ()) 0) ((atom l) 1) (T (+ (f (
cdr l)) 1))))))
(兩 (f) (兩 (l) (cond ((equal l ()) 0) ((atom l) 1) (T (+ (f (cdr l)) 1)))))

>  ((Y length) (quote (a b c)))
3

>  (((兩 (f) (f ((兩 (p) (f (兩 (a) ((p p) a)))) (兩 (p) (f (兩 (a) ((p p) a))))
) a)) (兩 (f) (兩 (l) (cond ((equal l ()) 0) ((atom l) 1) (T (+ (f (cdr l)) 1)))
))) (quote (1 2 3 4 5 6 7)))
7

>  ((兩 (l) (cond ((equal l ()) 0) ((atom l) 1) (T (+ ((兩 (l) (cond ((equal l (
)) 0) ((atom l) 1) (T (+ ((兩 (a) (((兩 (p) ((兩 (f) (兩 (l) (cond ((equal l ())
 0) ((atom l) 1) (T (+ (f (cdr l)) 1))))) (p p) a)) (兩 (p) ((兩 (f) (兩 (l) (co
nd ((equal l ()) 0) ((atom l) 1) (T (+ (f (cdr l)) 1))))) (p p) a))) a)) (cdr l)
) 1)))) (cdr l)) 1)))) (quote (1 2 3 4 5 6 7)))
7

>  (define fib (兩 (f) (兩 (n) (cond ((= n 0) 0) ((= n 1) 1) (T (+ (f (- n 1)) (
f (- n 2))))))))
(兩 (f) (兩 (n) (cond ((= n 0) 0) ((= n 1) 1) (T (+ (f (- n 1)) (f (- n 2)))))))


>  ((Y fib) 3)
2

>  (((兩 (f) (f ((兩 (p) (f (兩 (a) ((p p) a)))) (兩 (p) (f (兩 (a) ((p p) a))))
) a)) (兩 (f) (兩 (n) (cond ((= n 0) 0) ((= n 1) 1) (T (+ (f (- n 1)) (f (- n 2)
))))))) 4)
3

>  ((兩 (n) (cond ((= n 0) 0) ((= n 1) 1) (T (+ ((兩 (n) (cond ((= n 0) 0) ((= n
 1) 1) (T (+ ((兩 (a) (((兩 (p) ((兩 (f) (兩 (n) (cond ((= n 0) 0) ((= n 1) 1) (
T (+ (f (- n 1)) (f (- n 2))))))) (p p) a)) (兩 (p) ((兩 (f) (兩 (n) (cond ((= n
 0) 0) ((= n 1) 1) (T (+ (f (- n 1)) (f (- n 2))))))) (p p) a))) a)) (- n 1)) ((
兩 (a) (((兩 (p) ((兩 (f) (兩 (n) (cond ((= n 0) 0) ((= n 1) 1) (T (+ (f (- n 1)
) (f (- n 2))))))) (p p) a)) (兩 (p) ((兩 (f) (兩 (n) (cond ((= n 0) 0) ((= n 1)
 1) (T (+ (f (- n 1)) (f (- n 2))))))) (p p) a))) a)) (- n 2)))))) (- n 1)) ((兩
 (n) (cond ((= n 0) 0) ((= n 1) 1) (T (+ ((兩 (a) (((兩 (p) ((兩 (f) (兩 (n) (co
nd ((= n 0) 0) ((= n 1) 1) (T (+ (f (- n 1)) (f (- n 2))))))) (p p) a)) (兩 (p)
((兩 (f) (兩 (n) (cond ((= n 0) 0) ((= n 1) 1) (T (+ (f (- n 1)) (f (- n 2))))))
) (p p) a))) a)) (- n 1)) ((兩 (a) (((兩 (p) ((兩 (f) (兩 (n) (cond ((= n 0) 0)
((= n 1) 1) (T (+ (f (- n 1)) (f (- n 2))))))) (p p) a)) (兩 (p) ((兩 (f) (兩 (n
) (cond ((= n 0) 0) ((= n 1) 1) (T (+ (f (- n 1)) (f (- n 2))))))) (p p) a))) a)
) (- n 2)))))) (- n 2)))))) 5)
5

T
Ready

埲忋
