File tree Expand file tree Collapse file tree 4 files changed +9
-7
lines changed Expand file tree Collapse file tree 4 files changed +9
-7
lines changed Original file line number Diff line number Diff line change 11(import add mul " nat-church.lisp" )
2- (import zero one two three four " nat-church.lisp" )
2+ (import zero one two three four five " nat-church.lisp" )
33
44(import factorial " factorial-half.lisp" )
55
88(assert-equal (factorial two) two)
99(assert-equal (factorial three) (mul three two))
1010(assert-equal (factorial four) (mul four (mul three two)))
11+ (assert-equal (factorial five) (mul five (mul four (mul three two))))
Original file line number Diff line number Diff line change 11(import zero? add mul sub1 " nat-church.lisp" )
2- (import zero one two three four " nat-church.lisp" )
2+ (import zero one two three four five " nat-church.lisp" )
33(import if true false " bool.lisp" )
44(import Y turing " fixpoint.lisp" )
55
1010(assert-equal ((Y factorial-wrap) two) two)
1111(assert-equal ((Y factorial-wrap) three) (mul three two))
1212(assert-equal ((Y factorial-wrap) four) (mul four (mul three two)))
13+ (assert-equal ((Y factorial-wrap) five) (mul five (mul four (mul three two))))
1314
1415(assert-equal ((turing factorial-wrap) zero) one)
1516(assert-equal ((turing factorial-wrap) one) one)
1617(assert-equal ((turing factorial-wrap) two) two)
1718(assert-equal ((turing factorial-wrap) three) (mul three two))
1819(assert-equal ((turing factorial-wrap) four) (mul four (mul three two)))
20+ (assert-equal ((turing factorial-wrap) five) (mul five (mul four (mul three two))))
1921
2022(import factorial " factorial-wrap.lisp" )
2123
Original file line number Diff line number Diff line change 11(import add mul " nat-church.lisp" )
2- (import zero one two three four " nat-church.lisp" )
2+ (import zero one two three four five " nat-church.lisp" )
33
44(import factorial " factorial.lisp" )
55
88(assert-equal (factorial two) two)
99(assert-equal (factorial three) (mul three two))
1010(assert-equal (factorial four) (mul four (mul three two)))
11+ (assert-equal (factorial five) (mul five (mul four (mul three two))))
1112
1213; ; test equivalence between recursive functions
1314
Original file line number Diff line number Diff line change 5353(assert-equal (factorial one) one)
5454(assert-equal (factorial two) two)
5555(assert-equal (factorial three) (mul three two))
56-
57- ; ; The following number is huge! Sorry~
58-
59- ; ; (assert-equal (factorial four) (mul four (mul three two)))
56+ (assert-equal (factorial four) (mul four (mul three two)))
57+ (assert-equal (factorial five) (mul five (mul four (mul three two))))
You can’t perform that action at this time.
0 commit comments