| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368 |
- {
- "experiments": [
- {
- "name": "SUCC (后继函数)",
- "tests": [
- {
- "input": "3",
- "expected": "4",
- "actual": "4",
- "passed": true
- },
- {
- "input": "4",
- "expected": "5",
- "actual": "5",
- "passed": true
- },
- {
- "input": "7",
- "expected": "8",
- "actual": "8",
- "passed": true
- },
- {
- "input": "10",
- "expected": "11",
- "actual": "11",
- "passed": true
- },
- {
- "input": "15",
- "expected": "16",
- "actual": "16",
- "passed": true
- },
- {
- "input": "42",
- "expected": "43",
- "actual": "43",
- "passed": true
- },
- {
- "input": "127",
- "expected": "128",
- "actual": "128",
- "passed": true
- },
- {
- "input": "255",
- "expected": "256",
- "actual": "256",
- "passed": true
- }
- ],
- "passed": 8,
- "total": 8
- },
- {
- "name": "TRUE/FALSE (Church 布尔值)",
- "tests": [
- {
- "input": "TRUE(A='sun', B='moon')",
- "expected": "sun",
- "actual": "sun",
- "passed": true
- },
- {
- "input": "FALSE(A='sun', B='moon')",
- "expected": "moon",
- "actual": "moon",
- "passed": true
- },
- {
- "input": "TRUE(A='hello', B='world')",
- "expected": "hello",
- "actual": "hello",
- "passed": true
- },
- {
- "input": "FALSE(A='hello', B='world')",
- "expected": "world",
- "actual": "world",
- "passed": true
- },
- {
- "input": "TRUE(A='42', B='0')",
- "expected": "42",
- "actual": "42",
- "passed": true
- },
- {
- "input": "FALSE(A='42', B='0')",
- "expected": "0",
- "actual": "0",
- "passed": true
- },
- {
- "input": "TRUE(A='alpha', B='omega')",
- "expected": "alpha",
- "actual": "alpha",
- "passed": true
- },
- {
- "input": "FALSE(A='alpha', B='omega')",
- "expected": "omega",
- "actual": "omega",
- "passed": true
- }
- ],
- "passed": 8,
- "total": 8
- },
- {
- "name": "AND/OR/NOT (逻辑运算)",
- "tests": [
- {
- "input": "AND(TRUE, TRUE)",
- "expected": "TRUE",
- "actual": "TRUE",
- "passed": true
- },
- {
- "input": "AND(TRUE, FALSE)",
- "expected": "FALSE",
- "actual": "FALSE",
- "passed": true
- },
- {
- "input": "AND(FALSE, TRUE)",
- "expected": "FALSE",
- "actual": "FALSE",
- "passed": true
- },
- {
- "input": "AND(FALSE, FALSE)",
- "expected": "FALSE",
- "actual": "FALSE",
- "passed": true
- },
- {
- "input": "OR(TRUE, TRUE)",
- "expected": "TRUE",
- "actual": "TRUE",
- "passed": true
- },
- {
- "input": "OR(TRUE, FALSE)",
- "expected": "TRUE",
- "actual": "TRUE",
- "passed": true
- },
- {
- "input": "OR(FALSE, TRUE)",
- "expected": "TRUE",
- "actual": "TRUE",
- "passed": true
- },
- {
- "input": "OR(FALSE, FALSE)",
- "expected": "FALSE",
- "actual": "FALSE",
- "passed": true
- },
- {
- "input": "NOT(TRUE)",
- "expected": "FALSE",
- "actual": "FALSE",
- "passed": true
- },
- {
- "input": "NOT(FALSE)",
- "expected": "TRUE",
- "actual": "TRUE",
- "passed": true
- }
- ],
- "passed": 10,
- "total": 10
- },
- {
- "name": "IF-THEN-ELSE (条件分支)",
- "tests": [
- {
- "input": "condition=TRUE, then='accept', else='reject'",
- "expected": "accept",
- "actual": "accept",
- "passed": true
- },
- {
- "input": "condition=FALSE, then='accept', else='reject'",
- "expected": "reject",
- "actual": "reject",
- "passed": true
- },
- {
- "input": "condition=TRUE, then='100', else='-1'",
- "expected": "100",
- "actual": "100",
- "passed": true
- },
- {
- "input": "condition=FALSE, then='100', else='-1'",
- "expected": "-1",
- "actual": "-1",
- "passed": true
- }
- ],
- "passed": 4,
- "total": 4
- },
- {
- "name": "PAIR/FST/SND (有序对)",
- "tests": [
- {
- "input": "PAIR(10, 20)",
- "expected": "(10, 20)",
- "actual": "(10, 20)",
- "passed": true
- },
- {
- "input": "FST((5, 8))",
- "expected": "5",
- "actual": "5",
- "passed": true
- },
- {
- "input": "SND((5, 8))",
- "expected": "8",
- "actual": "8",
- "passed": true
- },
- {
- "input": "FST(PAIR(alpha, beta))",
- "expected": "alpha",
- "actual": "alpha",
- "passed": true
- },
- {
- "input": "SND(PAIR(alpha, beta))",
- "expected": "beta",
- "actual": "beta",
- "passed": true
- }
- ],
- "passed": 5,
- "total": 5
- },
- {
- "name": "函数组合 (DOUBLE ∘ SUCC)",
- "tests": [
- {
- "input": "DOUBLE(SUCC(0))",
- "expected": "2",
- "actual": "2",
- "passed": true
- },
- {
- "input": "DOUBLE(SUCC(1))",
- "expected": "4",
- "actual": "4",
- "passed": true
- },
- {
- "input": "DOUBLE(SUCC(3))",
- "expected": "8",
- "actual": "8",
- "passed": true
- },
- {
- "input": "DOUBLE(SUCC(5))",
- "expected": "12",
- "actual": "12",
- "passed": true
- },
- {
- "input": "DOUBLE(SUCC(10))",
- "expected": "22",
- "actual": "22",
- "passed": true
- }
- ],
- "passed": 5,
- "total": 5
- },
- {
- "name": "FACTORIAL (递归/Y 组合子)",
- "tests": [
- {
- "input": "2!",
- "expected": "2",
- "actual": "2",
- "passed": true
- },
- {
- "input": "4!",
- "expected": "24",
- "actual": "24",
- "passed": true
- },
- {
- "input": "6!",
- "expected": "720",
- "actual": "720",
- "passed": true
- },
- {
- "input": "7!",
- "expected": "5040",
- "actual": "5040",
- "passed": true
- }
- ],
- "passed": 4,
- "total": 4
- },
- {
- "name": "CHURCH 数 (f^n(x))",
- "tests": [
- {
- "input": "add1^4(0)",
- "expected": "4",
- "actual": "4",
- "passed": true
- },
- {
- "input": "add1^5(0)",
- "expected": "5",
- "actual": "5",
- "passed": true
- },
- {
- "input": "add1^7(0)",
- "expected": "7",
- "actual": "7",
- "passed": true
- },
- {
- "input": "double^1(1)",
- "expected": "2",
- "actual": "2",
- "passed": true
- },
- {
- "input": "double^2(1)",
- "expected": "4",
- "actual": "4",
- "passed": true
- },
- {
- "input": "double^3(1)",
- "expected": "8",
- "actual": "8",
- "passed": true
- },
- {
- "input": "double^5(1)",
- "expected": "32",
- "actual": "32",
- "passed": true
- }
- ],
- "passed": 7,
- "total": 7
- }
- ],
- "total_passed": 51,
- "total_tests": 51
- }
|