iter cma.3: live Qwen3-Coder-Next run + DESIGN.md §Decision-6 empirical addendum + milestone close
Milestone "Cross-model authoring-form test" closed. Live IONOS run against Qwen/Qwen3-Coder-Next executed at temperature=0, max-turns=5, token-budget=500000. Raw dataset under runs/2026-05-12-df7531/: RUN_STATUS=ok, scores.csv with 8 rows (4 tasks × 2 cohorts), summary.md, plus 156 per-turn raw artefacts (request/response/program/ stderr/stdout) preserved for any future analysis. Headline numbers: - AILX cohort: 2/4 green, 1/4 first-attempt, ~95k prompt + ~2.6k completion - JSON cohort: 1/4 green, 0/4 first-attempt, ~192k prompt + ~15k completion - Only first-attempt success was AILX on t3_main_prints (~5 lines of tagged s-expr vs ~23 lines of structured JSON for the JSON cohort's turn-1 attempt that needed correction). - Per spec, single subject + single deterministic run = data point, not verdict. DESIGN.md §"Decision 6: authoring surface" gains an "Empirical addendum (2026-05-12)" subsection: 6-row metric table, illustrative t3 contrast, explicit single-subject scope note pointing at the roadmap follow-up entry for multi-subject expansion. Roadmap: P2 entry "Cross-model authoring-form test" removed (this journal is the convention's one-line mirror); P3 entry "Multi-subject expansion (cross-model authoring-form follow-up)" added with the run dir named as baseline. Milestone artefacts span three iters (cma.1 master mini-spec + renderer; cma.2 harness + tasks + reference solutions; cma.3 this live run + DESIGN.md addendum + close).
This commit is contained in:
@@ -0,0 +1 @@
|
||||
ok
|
||||
+1
@@ -0,0 +1 @@
|
||||
parse error: parse error: expected `)` (end of fn-type ret), got `(` at byte 313
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
(module t1_add_three
|
||||
(fn add_three
|
||||
(doc "Add three Ints.")
|
||||
(type (fn-type (params (con Int) (con Int) (con Int)) (ret (con Int))))
|
||||
(params x y z)
|
||||
(body (app + (app + x y) z)))
|
||||
(fn main
|
||||
(doc "Print add_three(1, 2, 3) and add_three(10, 20, 30).")
|
||||
(type (fn-type (params) (ret (con Unit) (effects IO))))
|
||||
(params)
|
||||
(body (seq (do io/print_int (app add_three 1 2 3)) (do io/print_int (app add_three 10 20 30)))))
|
||||
+10
File diff suppressed because one or more lines are too long
+8
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"content": "(module t1_add_three\n (fn add_three\n (doc \"Add three Ints.\")\n (type (fn-type (params (con Int) (con Int) (con Int)) (ret (con Int))))\n (params x y z)\n (body (app + (app + x y) z)))\n (fn main\n (doc \"Print add_three(1, 2, 3) and add_three(10, 20, 30).\")\n (type (fn-type (params) (ret (con Unit) (effects IO))))\n (params)\n (body (seq (do io/print_int (app add_three 1 2 3)) (do io/print_int (app add_three 10 20 30)))))",
|
||||
"usage": {
|
||||
"completion_tokens": 170,
|
||||
"prompt_tokens": 6385,
|
||||
"total_tokens": 6555
|
||||
}
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
parse error: parse error: unexpected end of input, expected `)` to end module or another def
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
(module t1_add_three
|
||||
(fn add_three
|
||||
(doc "Add three Ints.")
|
||||
(type (fn-type (params (con Int) (con Int) (con Int)) (ret (con Int))))
|
||||
(params x y z)
|
||||
(body (app + (app + x y) z)))
|
||||
(fn main
|
||||
(doc "Print add_three(1, 2, 3) and add_three(10, 20, 30).")
|
||||
(type (fn-type (params) (ret (con Unit)) (effects IO)))
|
||||
(params)
|
||||
(body (seq (do io/print_int (app add_three 1 2 3)) (do io/print_int (app add_three 10 20 30)))))
|
||||
+18
File diff suppressed because one or more lines are too long
+8
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"content": "(module t1_add_three\n (fn add_three\n (doc \"Add three Ints.\")\n (type (fn-type (params (con Int) (con Int) (con Int)) (ret (con Int))))\n (params x y z)\n (body (app + (app + x y) z)))\n (fn main\n (doc \"Print add_three(1, 2, 3) and add_three(10, 20, 30).\")\n (type (fn-type (params) (ret (con Unit)) (effects IO)))\n (params)\n (body (seq (do io/print_int (app add_three 1 2 3)) (do io/print_int (app add_three 10 20 30)))))",
|
||||
"usage": {
|
||||
"completion_tokens": 170,
|
||||
"prompt_tokens": 6585,
|
||||
"total_tokens": 6755
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
(module t1_add_three
|
||||
(fn add_three
|
||||
(doc "Add three Ints.")
|
||||
(type (fn-type (params (con Int) (con Int) (con Int)) (ret (con Int))))
|
||||
(params x y z)
|
||||
(body (app + (app + x y) z)))
|
||||
(fn main
|
||||
(doc "Print add_three(1, 2, 3) and add_three(10, 20, 30).")
|
||||
(type (fn-type (params) (ret (con Unit)) (effects IO)))
|
||||
(params)
|
||||
(body (seq (do io/print_int (app add_three 1 2 3)) (do io/print_int (app add_three 10 20 30)))))
|
||||
)
|
||||
+26
File diff suppressed because one or more lines are too long
+8
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"content": "(module t1_add_three\n (fn add_three\n (doc \"Add three Ints.\")\n (type (fn-type (params (con Int) (con Int) (con Int)) (ret (con Int))))\n (params x y z)\n (body (app + (app + x y) z)))\n (fn main\n (doc \"Print add_three(1, 2, 3) and add_three(10, 20, 30).\")\n (type (fn-type (params) (ret (con Unit)) (effects IO)))\n (params)\n (body (seq (do io/print_int (app add_three 1 2 3)) (do io/print_int (app add_three 10 20 30)))))\n)",
|
||||
"usage": {
|
||||
"completion_tokens": 170,
|
||||
"prompt_tokens": 6786,
|
||||
"total_tokens": 6956
|
||||
}
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
6
|
||||
60
|
||||
+1
@@ -0,0 +1 @@
|
||||
parse error: parse error in term: unknown term head `ctor`; expected one of `app`, `tail-app`, `lam`, `let`, `let-rec`, `if`, `match`, `do`, `tail-do`, `seq`, `term-ctor`, `clone`, `reuse-as`, `lit-unit` at byte 430
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
(module t2_length
|
||||
(data List (vars a)
|
||||
(ctor Nil)
|
||||
(ctor Cons a (con List)))
|
||||
(fn length
|
||||
(type (forall (vars a) (fn-type (params (con List a)) (ret (con Int)))))
|
||||
(params xs)
|
||||
(body (match xs
|
||||
(case (pat-ctor Nil) 0)
|
||||
(case (pat-ctor Cons _ t) (app + 1 (app length t))))))
|
||||
(fn main
|
||||
(type (fn-type (params) (ret (con Unit)) (effects IO)))
|
||||
(params)
|
||||
(body (seq (do io/print_int (app length (ctor List Nil))) (do io/print_int (app length (ctor List Cons 7 (ctor List Cons 8 (ctor List Cons 9 (ctor List Nil))))))))))
|
||||
+10
File diff suppressed because one or more lines are too long
+8
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"content": "(module t2_length\n (data List (vars a)\n (ctor Nil)\n (ctor Cons a (con List)))\n (fn length\n (type (forall (vars a) (fn-type (params (con List a)) (ret (con Int)))))\n (params xs)\n (body (match xs\n (case (pat-ctor Nil) 0)\n (case (pat-ctor Cons _ t) (app + 1 (app length t))))))\n (fn main\n (type (fn-type (params) (ret (con Unit)) (effects IO)))\n (params)\n (body (seq (do io/print_int (app length (ctor List Nil))) (do io/print_int (app length (ctor List Cons 7 (ctor List Cons 8 (ctor List Cons 9 (ctor List Nil))))))))))\n",
|
||||
"usage": {
|
||||
"completion_tokens": 183,
|
||||
"prompt_tokens": 6409,
|
||||
"total_tokens": 6592
|
||||
}
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
error: [unknown-type] List: unknown type: `List expects 1 type arg(s), got 0`
|
||||
error: [type-mismatch] length: type mismatch: expected List<$m1>, got List
|
||||
error: [type-mismatch] main: type mismatch: expected List, got List<$m6>
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
(module t2_length
|
||||
(data List (vars a)
|
||||
(ctor Nil)
|
||||
(ctor Cons a (con List)))
|
||||
(fn length
|
||||
(type (forall (vars a) (fn-type (params (con List a)) (ret (con Int)))))
|
||||
(params xs)
|
||||
(body (match xs
|
||||
(case (pat-ctor Nil) 0)
|
||||
(case (pat-ctor Cons _ t) (app + 1 (app length t))))))
|
||||
(fn main
|
||||
(type (fn-type (params) (ret (con Unit)) (effects IO)))
|
||||
(params)
|
||||
(body (seq (do io/print_int (app length (term-ctor List Nil))) (do io/print_int (app length (term-ctor List Cons 7 (term-ctor List Cons 8 (term-ctor List Cons 9 (term-ctor List Nil))))))))))
|
||||
+18
File diff suppressed because one or more lines are too long
+8
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"content": "(module t2_length\n (data List (vars a)\n (ctor Nil)\n (ctor Cons a (con List)))\n (fn length\n (type (forall (vars a) (fn-type (params (con List a)) (ret (con Int)))))\n (params xs)\n (body (match xs\n (case (pat-ctor Nil) 0)\n (case (pat-ctor Cons _ t) (app + 1 (app length t))))))\n (fn main\n (type (fn-type (params) (ret (con Unit)) (effects IO)))\n (params)\n (body (seq (do io/print_int (app length (term-ctor List Nil))) (do io/print_int (app length (term-ctor List Cons 7 (term-ctor List Cons 8 (term-ctor List Cons 9 (term-ctor List Nil))))))))))\n",
|
||||
"usage": {
|
||||
"completion_tokens": 193,
|
||||
"prompt_tokens": 6669,
|
||||
"total_tokens": 6862
|
||||
}
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
error: [unknown-type] List: unknown type: `List expects 1 type arg(s), got 0`
|
||||
error: [type-mismatch] length: type mismatch: expected List<$m1>, got List
|
||||
error: [type-mismatch] main: type mismatch: expected List, got List<$m6>
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
(module t2_length
|
||||
(data List (vars a)
|
||||
(ctor Nil)
|
||||
(ctor Cons a (con List)))
|
||||
(fn length
|
||||
(type (forall (vars a) (fn-type (params (con List a)) (ret (con Int)))))
|
||||
(params xs)
|
||||
(body (match xs
|
||||
(case (pat-ctor Nil) 0)
|
||||
(case (pat-ctor Cons _ t) (app + 1 (app length t))))))
|
||||
(fn main
|
||||
(type (fn-type (params) (ret (con Unit)) (effects IO)))
|
||||
(params)
|
||||
(body (seq (do io/print_int (app length (term-ctor List Nil))) (do io/print_int (app length (term-ctor List Cons 7 (term-ctor List Cons 8 (term-ctor List Cons 9 (term-ctor List Nil))))))))))
|
||||
+26
File diff suppressed because one or more lines are too long
+8
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"content": "(module t2_length\n (data List (vars a)\n (ctor Nil)\n (ctor Cons a (con List)))\n (fn length\n (type (forall (vars a) (fn-type (params (con List a)) (ret (con Int)))))\n (params xs)\n (body (match xs\n (case (pat-ctor Nil) 0)\n (case (pat-ctor Cons _ t) (app + 1 (app length t))))))\n (fn main\n (type (fn-type (params) (ret (con Unit)) (effects IO)))\n (params)\n (body (seq (do io/print_int (app length (term-ctor List Nil))) (do io/print_int (app length (term-ctor List Cons 7 (term-ctor List Cons 8 (term-ctor List Cons 9 (term-ctor List Nil))))))))))\n",
|
||||
"usage": {
|
||||
"completion_tokens": 193,
|
||||
"prompt_tokens": 6939,
|
||||
"total_tokens": 7132
|
||||
}
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
error: [unknown-type] List: unknown type: `List expects 1 type arg(s), got 0`
|
||||
error: [type-mismatch] length: type mismatch: expected List<$m1>, got List
|
||||
error: [type-mismatch] main: type mismatch: expected List, got List<$m6>
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
(module t2_length
|
||||
(data List (vars a)
|
||||
(ctor Nil)
|
||||
(ctor Cons a (con List)))
|
||||
(fn length
|
||||
(type (forall (vars a) (fn-type (params (con List a)) (ret (con Int)))))
|
||||
(params xs)
|
||||
(body (match xs
|
||||
(case (pat-ctor Nil) 0)
|
||||
(case (pat-ctor Cons _ t) (app + 1 (app length t))))))
|
||||
(fn main
|
||||
(type (fn-type (params) (ret (con Unit)) (effects IO)))
|
||||
(params)
|
||||
(body (seq (do io/print_int (app length (term-ctor List Nil))) (do io/print_int (app length (term-ctor List Cons 7 (term-ctor List Cons 8 (term-ctor List Cons 9 (term-ctor List Nil))))))))))
|
||||
+34
File diff suppressed because one or more lines are too long
+8
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"content": "(module t2_length\n (data List (vars a)\n (ctor Nil)\n (ctor Cons a (con List)))\n (fn length\n (type (forall (vars a) (fn-type (params (con List a)) (ret (con Int)))))\n (params xs)\n (body (match xs\n (case (pat-ctor Nil) 0)\n (case (pat-ctor Cons _ t) (app + 1 (app length t))))))\n (fn main\n (type (fn-type (params) (ret (con Unit)) (effects IO)))\n (params)\n (body (seq (do io/print_int (app length (term-ctor List Nil))) (do io/print_int (app length (term-ctor List Cons 7 (term-ctor List Cons 8 (term-ctor List Cons 9 (term-ctor List Nil))))))))))\n",
|
||||
"usage": {
|
||||
"completion_tokens": 193,
|
||||
"prompt_tokens": 7209,
|
||||
"total_tokens": 7402
|
||||
}
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
error: [unknown-type] List: unknown type: `List expects 1 type arg(s), got 0`
|
||||
error: [type-mismatch] length: type mismatch: expected List<$m1>, got List
|
||||
error: [type-mismatch] main: type mismatch: expected List, got List<$m6>
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
(module t2_length
|
||||
(data List (vars a)
|
||||
(ctor Nil)
|
||||
(ctor Cons a (con List)))
|
||||
(fn length
|
||||
(type (forall (vars a) (fn-type (params (con List a)) (ret (con Int)))))
|
||||
(params xs)
|
||||
(body (match xs
|
||||
(case (pat-ctor Nil) 0)
|
||||
(case (pat-ctor Cons _ t) (app + 1 (app length t))))))
|
||||
(fn main
|
||||
(type (fn-type (params) (ret (con Unit)) (effects IO)))
|
||||
(params)
|
||||
(body (seq (do io/print_int (app length (term-ctor List Nil))) (do io/print_int (app length (term-ctor List Cons 7 (term-ctor List Cons 8 (term-ctor List Cons 9 (term-ctor List Nil))))))))))
|
||||
+42
File diff suppressed because one or more lines are too long
+8
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"content": "(module t2_length\n (data List (vars a)\n (ctor Nil)\n (ctor Cons a (con List)))\n (fn length\n (type (forall (vars a) (fn-type (params (con List a)) (ret (con Int)))))\n (params xs)\n (body (match xs\n (case (pat-ctor Nil) 0)\n (case (pat-ctor Cons _ t) (app + 1 (app length t))))))\n (fn main\n (type (fn-type (params) (ret (con Unit)) (effects IO)))\n (params)\n (body (seq (do io/print_int (app length (term-ctor List Nil))) (do io/print_int (app length (term-ctor List Cons 7 (term-ctor List Cons 8 (term-ctor List Cons 9 (term-ctor List Nil))))))))))\n",
|
||||
"usage": {
|
||||
"completion_tokens": 193,
|
||||
"prompt_tokens": 7479,
|
||||
"total_tokens": 7672
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
(module t3_main_prints
|
||||
(fn main
|
||||
(type (fn-type (params) (ret (con Unit)) (effects IO)))
|
||||
(params)
|
||||
(body (seq (do io/print_int 42) (do io/print_int 1337)))))
|
||||
+10
File diff suppressed because one or more lines are too long
+8
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"content": "(module t3_main_prints\n (fn main\n (type (fn-type (params) (ret (con Unit)) (effects IO)))\n (params)\n (body (seq (do io/print_int 42) (do io/print_int 1337)))))",
|
||||
"usage": {
|
||||
"completion_tokens": 62,
|
||||
"prompt_tokens": 6356,
|
||||
"total_tokens": 6418
|
||||
}
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
42
|
||||
1337
|
||||
+1
@@ -0,0 +1 @@
|
||||
parse error: parse error: expected `)` (end of type-attr), got `(` at byte 168
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
(module t4_count_zeros
|
||||
(data List (vars a)
|
||||
(ctor Nil)
|
||||
(ctor Cons a (con List)))
|
||||
(fn count_zeros
|
||||
(type (fn-type (params (con List)) (ret (con Int)))
|
||||
(params xs)
|
||||
(body (match xs
|
||||
(case (pat-ctor Nil) 0)
|
||||
(case (pat-ctor Cons h t) (if (app == h 0) (app + 1 (app count_zeros t)) (app count_zeros t))))))
|
||||
(fn main
|
||||
(type (fn-type (params) (ret (con Unit)) (effects IO)))
|
||||
(params)
|
||||
(body (seq
|
||||
(do io/print_int (app count_zeros (ctor List Nil)))
|
||||
(do io/print_int (app count_zeros (ctor List Cons 0 (ctor List Cons 5 (ctor List Cons 0 (ctor List Cons 3 (ctor List Cons 0 (ctor List Nil))))))))))
|
||||
))
|
||||
+10
File diff suppressed because one or more lines are too long
+8
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"content": "(module t4_count_zeros\n (data List (vars a)\n (ctor Nil)\n (ctor Cons a (con List)))\n (fn count_zeros\n (type (fn-type (params (con List)) (ret (con Int)))\n (params xs)\n (body (match xs\n (case (pat-ctor Nil) 0)\n (case (pat-ctor Cons h t) (if (app == h 0) (app + 1 (app count_zeros t)) (app count_zeros t))))))\n (fn main\n (type (fn-type (params) (ret (con Unit)) (effects IO)))\n (params)\n (body (seq\n (do io/print_int (app count_zeros (ctor List Nil)))\n (do io/print_int (app count_zeros (ctor List Cons 0 (ctor List Cons 5 (ctor List Cons 0 (ctor List Cons 3 (ctor List Cons 0 (ctor List Nil))))))))))\n))",
|
||||
"usage": {
|
||||
"completion_tokens": 212,
|
||||
"prompt_tokens": 6436,
|
||||
"total_tokens": 6648
|
||||
}
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
parse error: parse error: expected `)` (end of type-attr), got `(` at byte 168
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
(module t4_count_zeros
|
||||
(data List (vars a)
|
||||
(ctor Nil)
|
||||
(ctor Cons a (con List)))
|
||||
(fn count_zeros
|
||||
(type (fn-type (params (con List)) (ret (con Int)))
|
||||
(params xs)
|
||||
(body (match xs
|
||||
(case (pat-ctor Nil) 0)
|
||||
(case (pat-ctor Cons h t) (if (app == h 0) (app + 1 (app count_zeros t)) (app count_zeros t))))))
|
||||
(fn main
|
||||
(type (fn-type (params) (ret (con Unit)) (effects IO)))
|
||||
(params)
|
||||
(body (seq
|
||||
(do io/print_int (app count_zeros (ctor List Nil)))
|
||||
(do io/print_int (app count_zeros (ctor List Cons 0 (ctor List Cons 5 (ctor List Cons 0 (ctor List Cons 3 (ctor List Cons 0 (ctor List Nil))))))))))
|
||||
))
|
||||
+18
File diff suppressed because one or more lines are too long
+8
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"content": "(module t4_count_zeros\n (data List (vars a)\n (ctor Nil)\n (ctor Cons a (con List)))\n (fn count_zeros\n (type (fn-type (params (con List)) (ret (con Int)))\n (params xs)\n (body (match xs\n (case (pat-ctor Nil) 0)\n (case (pat-ctor Cons h t) (if (app == h 0) (app + 1 (app count_zeros t)) (app count_zeros t))))))\n (fn main\n (type (fn-type (params) (ret (con Unit)) (effects IO)))\n (params)\n (body (seq\n (do io/print_int (app count_zeros (ctor List Nil)))\n (do io/print_int (app count_zeros (ctor List Cons 0 (ctor List Cons 5 (ctor List Cons 0 (ctor List Cons 3 (ctor List Cons 0 (ctor List Nil))))))))))\n))",
|
||||
"usage": {
|
||||
"completion_tokens": 212,
|
||||
"prompt_tokens": 6678,
|
||||
"total_tokens": 6890
|
||||
}
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
parse error: parse error: expected `)` (end of type-attr), got `(` at byte 168
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
(module t4_count_zeros
|
||||
(data List (vars a)
|
||||
(ctor Nil)
|
||||
(ctor Cons a (con List)))
|
||||
(fn count_zeros
|
||||
(type (fn-type (params (con List)) (ret (con Int)))
|
||||
(params xs)
|
||||
(body (match xs
|
||||
(case (pat-ctor Nil) 0)
|
||||
(case (pat-ctor Cons h t) (if (app == h 0) (app + 1 (app count_zeros t)) (app count_zeros t))))))
|
||||
(fn main
|
||||
(type (fn-type (params) (ret (con Unit)) (effects IO)))
|
||||
(params)
|
||||
(body (seq
|
||||
(do io/print_int (app count_zeros (ctor List Nil)))
|
||||
(do io/print_int (app count_zeros (ctor List Cons 0 (ctor List Cons 5 (ctor List Cons 0 (ctor List Cons 3 (ctor List Cons 0 (ctor List Nil))))))))))
|
||||
))
|
||||
+26
File diff suppressed because one or more lines are too long
+8
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"content": "(module t4_count_zeros\n (data List (vars a)\n (ctor Nil)\n (ctor Cons a (con List)))\n (fn count_zeros\n (type (fn-type (params (con List)) (ret (con Int)))\n (params xs)\n (body (match xs\n (case (pat-ctor Nil) 0)\n (case (pat-ctor Cons h t) (if (app == h 0) (app + 1 (app count_zeros t)) (app count_zeros t))))))\n (fn main\n (type (fn-type (params) (ret (con Unit)) (effects IO)))\n (params)\n (body (seq\n (do io/print_int (app count_zeros (ctor List Nil)))\n (do io/print_int (app count_zeros (ctor List Cons 0 (ctor List Cons 5 (ctor List Cons 0 (ctor List Cons 3 (ctor List Cons 0 (ctor List Nil))))))))))\n))",
|
||||
"usage": {
|
||||
"completion_tokens": 212,
|
||||
"prompt_tokens": 6920,
|
||||
"total_tokens": 7132
|
||||
}
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
parse error: parse error: expected `)` (end of type-attr), got `(` at byte 168
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
(module t4_count_zeros
|
||||
(data List (vars a)
|
||||
(ctor Nil)
|
||||
(ctor Cons a (con List)))
|
||||
(fn count_zeros
|
||||
(type (fn-type (params (con List)) (ret (con Int)))
|
||||
(params xs)
|
||||
(body (match xs
|
||||
(case (pat-ctor Nil) 0)
|
||||
(case (pat-ctor Cons h t) (if (app == h 0) (app + 1 (app count_zeros t)) (app count_zeros t))))))
|
||||
(fn main
|
||||
(type (fn-type (params) (ret (con Unit)) (effects IO)))
|
||||
(params)
|
||||
(body (seq
|
||||
(do io/print_int (app count_zeros (ctor List Nil)))
|
||||
(do io/print_int (app count_zeros (ctor List Cons 0 (ctor List Cons 5 (ctor List Cons 0 (ctor List Cons 3 (ctor List Cons 0 (ctor List Nil))))))))))
|
||||
))
|
||||
+34
File diff suppressed because one or more lines are too long
+8
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"content": "(module t4_count_zeros\n (data List (vars a)\n (ctor Nil)\n (ctor Cons a (con List)))\n (fn count_zeros\n (type (fn-type (params (con List)) (ret (con Int)))\n (params xs)\n (body (match xs\n (case (pat-ctor Nil) 0)\n (case (pat-ctor Cons h t) (if (app == h 0) (app + 1 (app count_zeros t)) (app count_zeros t))))))\n (fn main\n (type (fn-type (params) (ret (con Unit)) (effects IO)))\n (params)\n (body (seq\n (do io/print_int (app count_zeros (ctor List Nil)))\n (do io/print_int (app count_zeros (ctor List Cons 0 (ctor List Cons 5 (ctor List Cons 0 (ctor List Cons 3 (ctor List Cons 0 (ctor List Nil))))))))))\n))",
|
||||
"usage": {
|
||||
"completion_tokens": 212,
|
||||
"prompt_tokens": 7162,
|
||||
"total_tokens": 7374
|
||||
}
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
parse error: parse error: expected `)` (end of type-attr), got `(` at byte 168
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
(module t4_count_zeros
|
||||
(data List (vars a)
|
||||
(ctor Nil)
|
||||
(ctor Cons a (con List)))
|
||||
(fn count_zeros
|
||||
(type (fn-type (params (con List)) (ret (con Int)))
|
||||
(params xs)
|
||||
(body (match xs
|
||||
(case (pat-ctor Nil) 0)
|
||||
(case (pat-ctor Cons h t) (if (app == h 0) (app + 1 (app count_zeros t)) (app count_zeros t))))))
|
||||
(fn main
|
||||
(type (fn-type (params) (ret (con Unit)) (effects IO)))
|
||||
(params)
|
||||
(body (seq
|
||||
(do io/print_int (app count_zeros (ctor List Nil)))
|
||||
(do io/print_int (app count_zeros (ctor List Cons 0 (ctor List Cons 5 (ctor List Cons 0 (ctor List Cons 3 (ctor List Cons 0 (ctor List Nil))))))))))
|
||||
))
|
||||
+42
File diff suppressed because one or more lines are too long
+8
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"content": "(module t4_count_zeros\n (data List (vars a)\n (ctor Nil)\n (ctor Cons a (con List)))\n (fn count_zeros\n (type (fn-type (params (con List)) (ret (con Int)))\n (params xs)\n (body (match xs\n (case (pat-ctor Nil) 0)\n (case (pat-ctor Cons h t) (if (app == h 0) (app + 1 (app count_zeros t)) (app count_zeros t))))))\n (fn main\n (type (fn-type (params) (ret (con Unit)) (effects IO)))\n (params)\n (body (seq\n (do io/print_int (app count_zeros (ctor List Nil)))\n (do io/print_int (app count_zeros (ctor List Cons 0 (ctor List Cons 5 (ctor List Cons 0 (ctor List Cons 3 (ctor List Cons 0 (ctor List Nil))))))))))\n))",
|
||||
"usage": {
|
||||
"completion_tokens": 212,
|
||||
"prompt_tokens": 7404,
|
||||
"total_tokens": 7616
|
||||
}
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
parsing JSON in /tmp/cma2-run-IBaQEp/prog.ail.json
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
{
|
||||
"schema": "ailang/v0",
|
||||
"name": "t1_add_three",
|
||||
"imports": [],
|
||||
"defs": [
|
||||
{
|
||||
"kind": "fn",
|
||||
"name": "add_three",
|
||||
"doc": "Add three Ints.",
|
||||
"type": {
|
||||
"k": "fn",
|
||||
"params": [
|
||||
{ "k": "con", "name": "Int" },
|
||||
{ "k": "con", "name": "Int" },
|
||||
{ "k": "con", "name": "Int" }
|
||||
],
|
||||
"ret": { "k": "con", "name": "Int" },
|
||||
"effects": []
|
||||
},
|
||||
"params": ["a", "b", "c"],
|
||||
"body": {
|
||||
"t": "app",
|
||||
"fn": { "t": "var", "name": "+" },
|
||||
"args": [
|
||||
{
|
||||
"t": "app",
|
||||
"fn": { "t": "var", "name": "+" },
|
||||
"args": [
|
||||
{ "t": "var", "name": "a" },
|
||||
{ "t": "var", "name": "b" }
|
||||
]
|
||||
},
|
||||
{ "t": "var", "name": "c" }
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"kind": "fn",
|
||||
"name": "main",
|
||||
"doc": "Print add_three(1, 2, 3) and add_three(10, 20, 30) on separate lines.",
|
||||
"type": {
|
||||
"k": "fn",
|
||||
"params": [],
|
||||
"ret": { "k": "con", "name": "Unit" },
|
||||
"effects": ["IO"]
|
||||
},
|
||||
"params": [],
|
||||
"body": {
|
||||
"t": "seq",
|
||||
"lhs": {
|
||||
"t": "do",
|
||||
"op": "io/print_int",
|
||||
"args": [
|
||||
{
|
||||
"t": "app",
|
||||
"fn": { "t": "var", "name": "add_three" },
|
||||
"args": [
|
||||
{ "t": "var", "name": "1" },
|
||||
{ "t": "var", "name": "2" },
|
||||
{ "t": "var", "name": "3" }
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"rhs": {
|
||||
"t": "do",
|
||||
"op": "io/print_int",
|
||||
"args": [
|
||||
{
|
||||
"t": "app",
|
||||
"fn": { "t": "var", "name": "add_three" },
|
||||
"args": [
|
||||
{ "t": "var", "name": "10" },
|
||||
{ "t": "var", "name": "20" },
|
||||
{ "t": "var", "name": "30" }
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
+10
File diff suppressed because one or more lines are too long
+8
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"content": "{\n \"schema\": \"ailang/v0\",\n \"name\": \"t1_add_three\",\n \"imports\": [],\n \"defs\": [\n {\n \"kind\": \"fn\",\n \"name\": \"add_three\",\n \"doc\": \"Add three Ints.\",\n \"type\": {\n \"k\": \"fn\",\n \"params\": [\n { \"k\": \"con\", \"name\": \"Int\" },\n { \"k\": \"con\", \"name\": \"Int\" },\n { \"k\": \"con\", \"name\": \"Int\" }\n ],\n \"ret\": { \"k\": \"con\", \"name\": \"Int\" },\n \"effects\": []\n },\n \"params\": [\"a\", \"b\", \"c\"],\n \"body\": {\n \"t\": \"app\",\n \"fn\": { \"t\": \"var\", \"name\": \"+\" },\n \"args\": [\n {\n \"t\": \"app\",\n \"fn\": { \"t\": \"var\", \"name\": \"+\" },\n \"args\": [\n { \"t\": \"var\", \"name\": \"a\" },\n { \"t\": \"var\", \"name\": \"b\" }\n ]\n },\n { \"t\": \"var\", \"name\": \"c\" }\n }\n }\n },\n {\n \"kind\": \"fn\",\n \"name\": \"main\",\n \"doc\": \"Print add_three(1, 2, 3) and add_three(10, 20, 30) on separate lines.\",\n \"type\": {\n \"k\": \"fn\",\n \"params\": [],\n \"ret\": { \"k\": \"con\", \"name\": \"Unit\" },\n \"effects\": [\"IO\"]\n },\n \"params\": [],\n \"body\": {\n \"t\": \"seq\",\n \"lhs\": {\n \"t\": \"do\",\n \"op\": \"io/print_int\",\n \"args\": [\n {\n \"t\": \"app\",\n \"fn\": { \"t\": \"var\", \"name\": \"add_three\" },\n \"args\": [\n { \"t\": \"var\", \"name\": \"1\" },\n { \"t\": \"var\", \"name\": \"2\" },\n { \"t\": \"var\", \"name\": \"3\" }\n ]\n }\n ]\n },\n \"rhs\": {\n \"t\": \"do\",\n \"op\": \"io/print_int\",\n \"args\": [\n {\n \"t\": \"app\",\n \"fn\": { \"t\": \"var\", \"name\": \"add_three\" },\n \"args\": [\n { \"t\": \"var\", \"name\": \"10\" },\n { \"t\": \"var\", \"name\": \"20\" },\n { \"t\": \"var\", \"name\": \"30\" }\n ]\n }\n ]\n }\n }\n }\n ]\n}",
|
||||
"usage": {
|
||||
"completion_tokens": 626,
|
||||
"prompt_tokens": 9435,
|
||||
"total_tokens": 10061
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
Error: schema/parse error in /tmp/cma2-run-infAQi/t1_add_three.ail.json: json: duplicate field `args` at line 41 column 4
|
||||
|
||||
Caused by:
|
||||
0: json: duplicate field `args` at line 41 column 4
|
||||
1: duplicate field `args` at line 41 column 4
|
||||
+87
@@ -0,0 +1,87 @@
|
||||
{
|
||||
"schema": "ailang/v0",
|
||||
"name": "t1_add_three",
|
||||
"imports": [],
|
||||
"defs": [
|
||||
{
|
||||
"kind": "fn",
|
||||
"name": "add_three",
|
||||
"doc": "Add three Ints.",
|
||||
"type": {
|
||||
"k": "fn",
|
||||
"params": [
|
||||
{ "k": "con", "name": "Int" },
|
||||
{ "k": "con", "name": "Int" },
|
||||
{ "k": "con", "name": "Int" }
|
||||
],
|
||||
"ret": { "k": "con", "name": "Int" },
|
||||
"effects": []
|
||||
},
|
||||
"params": ["a", "b", "c"],
|
||||
"body": {
|
||||
"t": "app",
|
||||
"fn": { "t": "var", "name": "+" },
|
||||
"args": [
|
||||
{
|
||||
"t": "app",
|
||||
"fn": { "t": "var", "name": "+" },
|
||||
"args": [
|
||||
{ "t": "var", "name": "a" },
|
||||
{ "t": "var", "name": "b" }
|
||||
],
|
||||
"args": [
|
||||
{ "t": "var", "name": "a" },
|
||||
{ "t": "var", "name": "b" }
|
||||
]
|
||||
},
|
||||
{ "t": "var", "name": "c" }
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"kind": "fn",
|
||||
"name": "main",
|
||||
"doc": "Print add_three(1, 2, 3) and add_three(10, 20, 30) on separate lines.",
|
||||
"type": {
|
||||
"k": "fn",
|
||||
"params": [],
|
||||
"ret": { "k": "con", "name": "Unit" },
|
||||
"effects": ["IO"]
|
||||
},
|
||||
"params": [],
|
||||
"body": {
|
||||
"t": "seq",
|
||||
"lhs": {
|
||||
"t": "do",
|
||||
"op": "io/print_int",
|
||||
"args": [
|
||||
{
|
||||
"t": "app",
|
||||
"fn": { "t": "var", "name": "add_three" },
|
||||
"args": [
|
||||
{ "t": "var", "name": "1" },
|
||||
{ "t": "var", "name": "2" },
|
||||
{ "t": "var", "name": "3" }
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"rhs": {
|
||||
"t": "do",
|
||||
"op": "io/print_int",
|
||||
"args": [
|
||||
{
|
||||
"t": "app",
|
||||
"fn": { "t": "var", "name": "add_three" },
|
||||
"args": [
|
||||
{ "t": "var", "name": "10" },
|
||||
{ "t": "var", "name": "20" },
|
||||
{ "t": "var", "name": "30" }
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
+18
File diff suppressed because one or more lines are too long
+8
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"content": "{\n \"schema\": \"ailang/v0\",\n \"name\": \"t1_add_three\",\n \"imports\": [],\n \"defs\": [\n {\n \"kind\": \"fn\",\n \"name\": \"add_three\",\n \"doc\": \"Add three Ints.\",\n \"type\": {\n \"k\": \"fn\",\n \"params\": [\n { \"k\": \"con\", \"name\": \"Int\" },\n { \"k\": \"con\", \"name\": \"Int\" },\n { \"k\": \"con\", \"name\": \"Int\" }\n ],\n \"ret\": { \"k\": \"con\", \"name\": \"Int\" },\n \"effects\": []\n },\n \"params\": [\"a\", \"b\", \"c\"],\n \"body\": {\n \"t\": \"app\",\n \"fn\": { \"t\": \"var\", \"name\": \"+\" },\n \"args\": [\n {\n \"t\": \"app\",\n \"fn\": { \"t\": \"var\", \"name\": \"+\" },\n \"args\": [\n { \"t\": \"var\", \"name\": \"a\" },\n { \"t\": \"var\", \"name\": \"b\" }\n ],\n \"args\": [\n { \"t\": \"var\", \"name\": \"a\" },\n { \"t\": \"var\", \"name\": \"b\" }\n ]\n },\n { \"t\": \"var\", \"name\": \"c\" }\n ]\n }\n },\n {\n \"kind\": \"fn\",\n \"name\": \"main\",\n \"doc\": \"Print add_three(1, 2, 3) and add_three(10, 20, 30) on separate lines.\",\n \"type\": {\n \"k\": \"fn\",\n \"params\": [],\n \"ret\": { \"k\": \"con\", \"name\": \"Unit\" },\n \"effects\": [\"IO\"]\n },\n \"params\": [],\n \"body\": {\n \"t\": \"seq\",\n \"lhs\": {\n \"t\": \"do\",\n \"op\": \"io/print_int\",\n \"args\": [\n {\n \"t\": \"app\",\n \"fn\": { \"t\": \"var\", \"name\": \"add_three\" },\n \"args\": [\n { \"t\": \"var\", \"name\": \"1\" },\n { \"t\": \"var\", \"name\": \"2\" },\n { \"t\": \"var\", \"name\": \"3\" }\n ]\n }\n ]\n },\n \"rhs\": {\n \"t\": \"do\",\n \"op\": \"io/print_int\",\n \"args\": [\n {\n \"t\": \"app\",\n \"fn\": { \"t\": \"var\", \"name\": \"add_three\" },\n \"args\": [\n { \"t\": \"var\", \"name\": \"10\" },\n { \"t\": \"var\", \"name\": \"20\" },\n { \"t\": \"var\", \"name\": \"30\" }\n ]\n }\n ]\n }\n }\n }\n ]\n}",
|
||||
"usage": {
|
||||
"completion_tokens": 663,
|
||||
"prompt_tokens": 10091,
|
||||
"total_tokens": 10754
|
||||
}
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
parsing JSON in /tmp/cma2-run-Eu7zvu/prog.ail.json
|
||||
+82
@@ -0,0 +1,82 @@
|
||||
{
|
||||
"schema": "ailang/v0",
|
||||
"name": "t1_add_three",
|
||||
"imports": [],
|
||||
"defs": [
|
||||
{
|
||||
"kind": "fn",
|
||||
"name": "add_three",
|
||||
"doc": "Add three Ints.",
|
||||
"type": {
|
||||
"k": "fn",
|
||||
"params": [
|
||||
{ "k": "con", "name": "Int" },
|
||||
{ "k": "con", "name": "Int" },
|
||||
{ "k": "con", "name": "Int" }
|
||||
],
|
||||
"ret": { "k": "con", "name": "Int" },
|
||||
"effects": []
|
||||
},
|
||||
"params": ["a", "b", "c"],
|
||||
"body": {
|
||||
"t": "app",
|
||||
"fn": { "t": "var", "name": "+" },
|
||||
"args": [
|
||||
{
|
||||
"t": "app",
|
||||
"fn": { "t": "var", "name": "+" },
|
||||
"args": [
|
||||
{ "t": "var", "name": "a" },
|
||||
{ "t": "var", "name": "b" }
|
||||
],
|
||||
{ "t": "var", "name": "c" }
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"kind": "fn",
|
||||
"name": "main",
|
||||
"doc": "Print add_three(1, 2, 3) and add_three(10, 20, 30) on separate lines.",
|
||||
"type": {
|
||||
"k": "fn",
|
||||
"params": [],
|
||||
"ret": { "k": "con", "name": "Unit" },
|
||||
"effects": ["IO"]
|
||||
},
|
||||
"params": [],
|
||||
"body": {
|
||||
"t": "seq",
|
||||
"lhs": {
|
||||
"t": "do",
|
||||
"op": "io/print_int",
|
||||
"args": [
|
||||
{
|
||||
"t": "app",
|
||||
"fn": { "t": "var", "name": "add_three" },
|
||||
"args": [
|
||||
{ "t": "var", "name": "1" },
|
||||
{ "t": "var", "name": "2" },
|
||||
{ "t": "var", "name": "3" }
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"rhs": {
|
||||
"t": "do",
|
||||
"op": "io/print_int",
|
||||
"args": [
|
||||
{
|
||||
"t": "app",
|
||||
"fn": { "t": "var", "name": "add_three" },
|
||||
"args": [
|
||||
{ "t": "var", "name": "10" },
|
||||
{ "t": "var", "name": "20" },
|
||||
{ "t": "var", "name": "30" }
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
+26
File diff suppressed because one or more lines are too long
+8
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"content": "{\n \"schema\": \"ailang/v0\",\n \"name\": \"t1_add_three\",\n \"imports\": [],\n \"defs\": [\n {\n \"kind\": \"fn\",\n \"name\": \"add_three\",\n \"doc\": \"Add three Ints.\",\n \"type\": {\n \"k\": \"fn\",\n \"params\": [\n { \"k\": \"con\", \"name\": \"Int\" },\n { \"k\": \"con\", \"name\": \"Int\" },\n { \"k\": \"con\", \"name\": \"Int\" }\n ],\n \"ret\": { \"k\": \"con\", \"name\": \"Int\" },\n \"effects\": []\n },\n \"params\": [\"a\", \"b\", \"c\"],\n \"body\": {\n \"t\": \"app\",\n \"fn\": { \"t\": \"var\", \"name\": \"+\" },\n \"args\": [\n {\n \"t\": \"app\",\n \"fn\": { \"t\": \"var\", \"name\": \"+\" },\n \"args\": [\n { \"t\": \"var\", \"name\": \"a\" },\n { \"t\": \"var\", \"name\": \"b\" }\n ],\n { \"t\": \"var\", \"name\": \"c\" }\n ]\n }\n },\n {\n \"kind\": \"fn\",\n \"name\": \"main\",\n \"doc\": \"Print add_three(1, 2, 3) and add_three(10, 20, 30) on separate lines.\",\n \"type\": {\n \"k\": \"fn\",\n \"params\": [],\n \"ret\": { \"k\": \"con\", \"name\": \"Unit\" },\n \"effects\": [\"IO\"]\n },\n \"params\": [],\n \"body\": {\n \"t\": \"seq\",\n \"lhs\": {\n \"t\": \"do\",\n \"op\": \"io/print_int\",\n \"args\": [\n {\n \"t\": \"app\",\n \"fn\": { \"t\": \"var\", \"name\": \"add_three\" },\n \"args\": [\n { \"t\": \"var\", \"name\": \"1\" },\n { \"t\": \"var\", \"name\": \"2\" },\n { \"t\": \"var\", \"name\": \"3\" }\n ]\n }\n ]\n },\n \"rhs\": {\n \"t\": \"do\",\n \"op\": \"io/print_int\",\n \"args\": [\n {\n \"t\": \"app\",\n \"fn\": { \"t\": \"var\", \"name\": \"add_three\" },\n \"args\": [\n { \"t\": \"var\", \"name\": \"10\" },\n { \"t\": \"var\", \"name\": \"20\" },\n { \"t\": \"var\", \"name\": \"30\" }\n ]\n }\n ]\n }\n }\n }\n ]\n}",
|
||||
"usage": {
|
||||
"completion_tokens": 624,
|
||||
"prompt_tokens": 10797,
|
||||
"total_tokens": 11421
|
||||
}
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
error: [arity-mismatch] add_three: arity mismatch for `+`: expected 2 args, got 1
|
||||
error: [unbound-var] main: unknown identifier: `1`
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
{
|
||||
"schema": "ailang/v0",
|
||||
"name": "t1_add_three",
|
||||
"imports": [],
|
||||
"defs": [
|
||||
{
|
||||
"kind": "fn",
|
||||
"name": "add_three",
|
||||
"doc": "Add three Ints.",
|
||||
"type": {
|
||||
"k": "fn",
|
||||
"params": [
|
||||
{ "k": "con", "name": "Int" },
|
||||
{ "k": "con", "name": "Int" },
|
||||
{ "k": "con", "name": "Int" }
|
||||
],
|
||||
"ret": { "k": "con", "name": "Int" },
|
||||
"effects": []
|
||||
},
|
||||
"params": ["a", "b", "c"],
|
||||
"body": {
|
||||
"t": "app",
|
||||
"fn": { "t": "var", "name": "+" },
|
||||
"args": [
|
||||
{
|
||||
"t": "app",
|
||||
"fn": { "t": "var", "name": "+" },
|
||||
"args": [
|
||||
{ "t": "var", "name": "a" },
|
||||
{ "t": "var", "name": "b" },
|
||||
{ "t": "var", "name": "c" }
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"kind": "fn",
|
||||
"name": "main",
|
||||
"doc": "Print add_three(1, 2, 3) and add_three(10, 20, 30) on separate lines.",
|
||||
"type": {
|
||||
"k": "fn",
|
||||
"params": [],
|
||||
"ret": { "k": "con", "name": "Unit" },
|
||||
"effects": ["IO"]
|
||||
},
|
||||
"params": [],
|
||||
"body": {
|
||||
"t": "seq",
|
||||
"lhs": {
|
||||
"t": "do",
|
||||
"op": "io/print_int",
|
||||
"args": [
|
||||
{
|
||||
"t": "app",
|
||||
"fn": { "t": "var", "name": "add_three" },
|
||||
"args": [
|
||||
{ "t": "var", "name": "1" },
|
||||
{ "t": "var", "name": "2" },
|
||||
{ "t": "var", "name": "3" }
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"rhs": {
|
||||
"t": "do",
|
||||
"op": "io/print_int",
|
||||
"args": [
|
||||
{
|
||||
"t": "app",
|
||||
"fn": { "t": "var", "name": "add_three" },
|
||||
"args": [
|
||||
{ "t": "var", "name": "10" },
|
||||
{ "t": "var", "name": "20" },
|
||||
{ "t": "var", "name": "30" }
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
+34
File diff suppressed because one or more lines are too long
+8
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"content": "{\n \"schema\": \"ailang/v0\",\n \"name\": \"t1_add_three\",\n \"imports\": [],\n \"defs\": [\n {\n \"kind\": \"fn\",\n \"name\": \"add_three\",\n \"doc\": \"Add three Ints.\",\n \"type\": {\n \"k\": \"fn\",\n \"params\": [\n { \"k\": \"con\", \"name\": \"Int\" },\n { \"k\": \"con\", \"name\": \"Int\" },\n { \"k\": \"con\", \"name\": \"Int\" }\n ],\n \"ret\": { \"k\": \"con\", \"name\": \"Int\" },\n \"effects\": []\n },\n \"params\": [\"a\", \"b\", \"c\"],\n \"body\": {\n \"t\": \"app\",\n \"fn\": { \"t\": \"var\", \"name\": \"+\" },\n \"args\": [\n {\n \"t\": \"app\",\n \"fn\": { \"t\": \"var\", \"name\": \"+\" },\n \"args\": [\n { \"t\": \"var\", \"name\": \"a\" },\n { \"t\": \"var\", \"name\": \"b\" },\n { \"t\": \"var\", \"name\": \"c\" }\n ]\n }\n ]\n }\n },\n {\n \"kind\": \"fn\",\n \"name\": \"main\",\n \"doc\": \"Print add_three(1, 2, 3) and add_three(10, 20, 30) on separate lines.\",\n \"type\": {\n \"k\": \"fn\",\n \"params\": [],\n \"ret\": { \"k\": \"con\", \"name\": \"Unit\" },\n \"effects\": [\"IO\"]\n },\n \"params\": [],\n \"body\": {\n \"t\": \"seq\",\n \"lhs\": {\n \"t\": \"do\",\n \"op\": \"io/print_int\",\n \"args\": [\n {\n \"t\": \"app\",\n \"fn\": { \"t\": \"var\", \"name\": \"add_three\" },\n \"args\": [\n { \"t\": \"var\", \"name\": \"1\" },\n { \"t\": \"var\", \"name\": \"2\" },\n { \"t\": \"var\", \"name\": \"3\" }\n ]\n }\n ]\n },\n \"rhs\": {\n \"t\": \"do\",\n \"op\": \"io/print_int\",\n \"args\": [\n {\n \"t\": \"app\",\n \"fn\": { \"t\": \"var\", \"name\": \"add_three\" },\n \"args\": [\n { \"t\": \"var\", \"name\": \"10\" },\n { \"t\": \"var\", \"name\": \"20\" },\n { \"t\": \"var\", \"name\": \"30\" }\n ]\n }\n ]\n }\n }\n }\n ]\n}",
|
||||
"usage": {
|
||||
"completion_tokens": 626,
|
||||
"prompt_tokens": 11451,
|
||||
"total_tokens": 12077
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
Error: schema/parse error in /tmp/cma2-run-JDMIdn/t1_add_three.ail.json: json: duplicate field `args` at line 39 column 4
|
||||
|
||||
Caused by:
|
||||
0: json: duplicate field `args` at line 39 column 4
|
||||
1: duplicate field `args` at line 39 column 4
|
||||
+85
@@ -0,0 +1,85 @@
|
||||
{
|
||||
"schema": "ailang/v0",
|
||||
"name": "t1_add_three",
|
||||
"imports": [],
|
||||
"defs": [
|
||||
{
|
||||
"kind": "fn",
|
||||
"name": "add_three",
|
||||
"doc": "Add three Ints.",
|
||||
"type": {
|
||||
"k": "fn",
|
||||
"params": [
|
||||
{ "k": "con", "name": "Int" },
|
||||
{ "k": "con", "name": "Int" },
|
||||
{ "k": "con", "name": "Int" }
|
||||
],
|
||||
"ret": { "k": "con", "name": "Int" },
|
||||
"effects": []
|
||||
},
|
||||
"params": ["a", "b", "c"],
|
||||
"body": {
|
||||
"t": "app",
|
||||
"fn": { "t": "var", "name": "+" },
|
||||
"args": [
|
||||
{
|
||||
"t": "app",
|
||||
"fn": { "t": "var", "name": "+" },
|
||||
"args": [
|
||||
{ "t": "var", "name": "a" },
|
||||
{ "t": "var", "name": "b" }
|
||||
],
|
||||
"args": [
|
||||
{ "t": "var", "name": "c" }
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"kind": "fn",
|
||||
"name": "main",
|
||||
"doc": "Print add_three(1, 2, 3) and add_three(10, 20, 30) on separate lines.",
|
||||
"type": {
|
||||
"k": "fn",
|
||||
"params": [],
|
||||
"ret": { "k": "con", "name": "Unit" },
|
||||
"effects": ["IO"]
|
||||
},
|
||||
"params": [],
|
||||
"body": {
|
||||
"t": "seq",
|
||||
"lhs": {
|
||||
"t": "do",
|
||||
"op": "io/print_int",
|
||||
"args": [
|
||||
{
|
||||
"t": "app",
|
||||
"fn": { "t": "var", "name": "add_three" },
|
||||
"args": [
|
||||
{ "t": "var", "name": "1" },
|
||||
{ "t": "var", "name": "2" },
|
||||
{ "t": "var", "name": "3" }
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"rhs": {
|
||||
"t": "do",
|
||||
"op": "io/print_int",
|
||||
"args": [
|
||||
{
|
||||
"t": "app",
|
||||
"fn": { "t": "var", "name": "add_three" },
|
||||
"args": [
|
||||
{ "t": "var", "name": "10" },
|
||||
{ "t": "var", "name": "20" },
|
||||
{ "t": "var", "name": "30" }
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
+42
File diff suppressed because one or more lines are too long
+8
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"content": "{\n \"schema\": \"ailang/v0\",\n \"name\": \"t1_add_three\",\n \"imports\": [],\n \"defs\": [\n {\n \"kind\": \"fn\",\n \"name\": \"add_three\",\n \"doc\": \"Add three Ints.\",\n \"type\": {\n \"k\": \"fn\",\n \"params\": [\n { \"k\": \"con\", \"name\": \"Int\" },\n { \"k\": \"con\", \"name\": \"Int\" },\n { \"k\": \"con\", \"name\": \"Int\" }\n ],\n \"ret\": { \"k\": \"con\", \"name\": \"Int\" },\n \"effects\": []\n },\n \"params\": [\"a\", \"b\", \"c\"],\n \"body\": {\n \"t\": \"app\",\n \"fn\": { \"t\": \"var\", \"name\": \"+\" },\n \"args\": [\n {\n \"t\": \"app\",\n \"fn\": { \"t\": \"var\", \"name\": \"+\" },\n \"args\": [\n { \"t\": \"var\", \"name\": \"a\" },\n { \"t\": \"var\", \"name\": \"b\" }\n ],\n \"args\": [\n { \"t\": \"var\", \"name\": \"c\" }\n ]\n }\n ]\n }\n },\n {\n \"kind\": \"fn\",\n \"name\": \"main\",\n \"doc\": \"Print add_three(1, 2, 3) and add_three(10, 20, 30) on separate lines.\",\n \"type\": {\n \"k\": \"fn\",\n \"params\": [],\n \"ret\": { \"k\": \"con\", \"name\": \"Unit\" },\n \"effects\": [\"IO\"]\n },\n \"params\": [],\n \"body\": {\n \"t\": \"seq\",\n \"lhs\": {\n \"t\": \"do\",\n \"op\": \"io/print_int\",\n \"args\": [\n {\n \"t\": \"app\",\n \"fn\": { \"t\": \"var\", \"name\": \"add_three\" },\n \"args\": [\n { \"t\": \"var\", \"name\": \"1\" },\n { \"t\": \"var\", \"name\": \"2\" },\n { \"t\": \"var\", \"name\": \"3\" }\n ]\n }\n ]\n },\n \"rhs\": {\n \"t\": \"do\",\n \"op\": \"io/print_int\",\n \"args\": [\n {\n \"t\": \"app\",\n \"fn\": { \"t\": \"var\", \"name\": \"add_three\" },\n \"args\": [\n { \"t\": \"var\", \"name\": \"10\" },\n { \"t\": \"var\", \"name\": \"20\" },\n { \"t\": \"var\", \"name\": \"30\" }\n ]\n }\n ]\n }\n }\n }\n ]\n}",
|
||||
"usage": {
|
||||
"completion_tokens": 633,
|
||||
"prompt_tokens": 12128,
|
||||
"total_tokens": 12761
|
||||
}
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
parsing JSON in /tmp/cma2-run-o5IFGM/prog.ail.json
|
||||
+134
@@ -0,0 +1,134 @@
|
||||
{
|
||||
"schema": "ailang/v0",
|
||||
"name": "t2_length",
|
||||
"imports": [],
|
||||
"defs": [
|
||||
{
|
||||
"kind": "type",
|
||||
"name": "List",
|
||||
"vars": ["a"],
|
||||
"doc": "A simple singly-linked list type.",
|
||||
"ctors": [
|
||||
{ "name": "Nil", "fields": [] },
|
||||
{
|
||||
"name": "Cons",
|
||||
"fields": [
|
||||
{ "k": "var", "name": "a" },
|
||||
{ "k": "con", "name": "List", "args": [ { "k": "var", "name": "a" } ] }
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind": "fn",
|
||||
"name": "length",
|
||||
"doc": "Returns the number of elements in the list.",
|
||||
"type": {
|
||||
"k": "fn",
|
||||
"params": [ { "k": "con", "name": "List", "args": [ { "k": "var", "name": "a" } ] } ],
|
||||
"ret": { "k": "con", "name": "Int" },
|
||||
"effects": []
|
||||
},
|
||||
"params": ["xs"],
|
||||
"body": {
|
||||
"t": "match",
|
||||
"scrutinee": { "t": "var", "name": "xs" },
|
||||
"arms": [
|
||||
{
|
||||
"pat": { "p": "ctor", "ctor": "Nil", "fields": [] },
|
||||
"body": { "t": "lit", "lit": { "kind": "int", "value": 0 } }
|
||||
},
|
||||
{
|
||||
"pat": {
|
||||
"p": "ctor",
|
||||
"ctor": "Cons",
|
||||
"fields": [
|
||||
{ "p": "wild" },
|
||||
{ "p": "var", "name": "t" }
|
||||
]
|
||||
},
|
||||
"body": {
|
||||
"t": "app",
|
||||
"fn": { "t": "var", "name": "+" },
|
||||
"args": [
|
||||
{ "t": "lit", "lit": { "kind": "int", "value": 1 } },
|
||||
{
|
||||
"t": "app",
|
||||
"fn": { "t": "var", "name": "length" },
|
||||
"args": [ { "t": "var", "name": "t" } ]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"kind": "fn",
|
||||
"name": "main",
|
||||
"doc": "Prints length(Nil) and length(Cons(7, Cons(8, Cons(9, Nil)))) on separate lines.",
|
||||
"type": {
|
||||
"k": "fn",
|
||||
"params": [],
|
||||
"ret": { "k": "con", "name": "Unit" },
|
||||
"effects": ["IO"]
|
||||
},
|
||||
"params": [],
|
||||
"body": {
|
||||
"t": "seq",
|
||||
"lhs": {
|
||||
"t": "do",
|
||||
"op": "io/print_int",
|
||||
"args": [
|
||||
{
|
||||
"t": "app",
|
||||
"fn": { "t": "var", "name": "length" },
|
||||
"args": [
|
||||
{
|
||||
"t": "var", "name": "Nil"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"rhs": {
|
||||
"t": "do",
|
||||
"op": "io/print_int",
|
||||
"args": [
|
||||
{
|
||||
"t": "app",
|
||||
"fn": { "t": "var", "name": "length" },
|
||||
"args": [
|
||||
{
|
||||
"t": "ctor",
|
||||
"type": "List",
|
||||
"ctor": "Cons",
|
||||
"args": [
|
||||
{ "t": "lit", "lit": { "kind": "int", "value": 7 } },
|
||||
{
|
||||
"t": "ctor",
|
||||
"type": "List",
|
||||
"ctor": "Cons",
|
||||
"args": [
|
||||
{ "t": "lit", "lit": { "kind": "int", "value": 8 } },
|
||||
{
|
||||
"t": "ctor",
|
||||
"type": "List",
|
||||
"ctor": "Cons",
|
||||
"args": [
|
||||
{ "t": "lit", "lit": { "kind": "int", "value": 9 } },
|
||||
{ "t": "var", "name": "Nil" }
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
+10
File diff suppressed because one or more lines are too long
+8
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"content": "{\n \"schema\": \"ailang/v0\",\n \"name\": \"t2_length\",\n \"imports\": [],\n \"defs\": [\n {\n \"kind\": \"type\",\n \"name\": \"List\",\n \"vars\": [\"a\"],\n \"doc\": \"A simple singly-linked list type.\",\n \"ctors\": [\n { \"name\": \"Nil\", \"fields\": [] },\n {\n \"name\": \"Cons\",\n \"fields\": [\n { \"k\": \"var\", \"name\": \"a\" },\n { \"k\": \"con\", \"name\": \"List\", \"args\": [ { \"k\": \"var\", \"name\": \"a\" } ] }\n ]\n }\n ]\n },\n {\n \"kind\": \"fn\",\n \"name\": \"length\",\n \"doc\": \"Returns the number of elements in the list.\",\n \"type\": {\n \"k\": \"fn\",\n \"params\": [ { \"k\": \"con\", \"name\": \"List\", \"args\": [ { \"k\": \"var\", \"name\": \"a\" } ] } ],\n \"ret\": { \"k\": \"con\", \"name\": \"Int\" },\n \"effects\": []\n },\n \"params\": [\"xs\"],\n \"body\": {\n \"t\": \"match\",\n \"scrutinee\": { \"t\": \"var\", \"name\": \"xs\" },\n \"arms\": [\n {\n \"pat\": { \"p\": \"ctor\", \"ctor\": \"Nil\", \"fields\": [] },\n \"body\": { \"t\": \"lit\", \"lit\": { \"kind\": \"int\", \"value\": 0 } }\n },\n {\n \"pat\": {\n \"p\": \"ctor\",\n \"ctor\": \"Cons\",\n \"fields\": [\n { \"p\": \"wild\" },\n { \"p\": \"var\", \"name\": \"t\" }\n ]\n },\n \"body\": {\n \"t\": \"app\",\n \"fn\": { \"t\": \"var\", \"name\": \"+\" },\n \"args\": [\n { \"t\": \"lit\", \"lit\": { \"kind\": \"int\", \"value\": 1 } },\n {\n \"t\": \"app\",\n \"fn\": { \"t\": \"var\", \"name\": \"length\" },\n \"args\": [ { \"t\": \"var\", \"name\": \"t\" } ]\n }\n ]\n }\n }\n ]\n }\n },\n {\n \"kind\": \"fn\",\n \"name\": \"main\",\n \"doc\": \"Prints length(Nil) and length(Cons(7, Cons(8, Cons(9, Nil)))) on separate lines.\",\n \"type\": {\n \"k\": \"fn\",\n \"params\": [],\n \"ret\": { \"k\": \"con\", \"name\": \"Unit\" },\n \"effects\": [\"IO\"]\n },\n \"params\": [],\n \"body\": {\n \"t\": \"seq\",\n \"lhs\": {\n \"t\": \"do\",\n \"op\": \"io/print_int\",\n \"args\": [\n {\n \"t\": \"app\",\n \"fn\": { \"t\": \"var\", \"name\": \"length\" },\n \"args\": [\n {\n \"t\": \"var\", \"name\": \"Nil\"\n }\n ]\n }\n ]\n },\n \"rhs\": {\n \"t\": \"do\",\n \"op\": \"io/print_int\",\n \"args\": [\n {\n \"t\": \"app\",\n \"fn\": { \"t\": \"var\", \"name\": \"length\" },\n \"args\": [\n {\n \"t\": \"ctor\",\n \"type\": \"List\",\n \"ctor\": \"Cons\",\n \"args\": [\n { \"t\": \"lit\", \"lit\": { \"kind\": \"int\", \"value\": 7 } },\n {\n \"t\": \"ctor\",\n \"type\": \"List\",\n \"ctor\": \"Cons\",\n \"args\": [\n { \"t\": \"lit\", \"lit\": { \"kind\": \"int\", \"value\": 8 } },\n {\n \"t\": \"ctor\",\n \"type\": \"List\",\n \"ctor\": \"Cons\",\n \"args\": [\n { \"t\": \"lit\", \"lit\": { \"kind\": \"int\", \"value\": 9 } },\n { \"t\": \"var\", \"name\": \"Nil\" }\n ]\n }\n ]\n }\n }\n }\n ]\n }\n ]\n }\n }\n }\n ]\n}",
|
||||
"usage": {
|
||||
"completion_tokens": 983,
|
||||
"prompt_tokens": 9459,
|
||||
"total_tokens": 10442
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user