Datasets:
Sync the public demo worlds with GitHub 6fb3475
Browse files- README.md +171 -0
- aliencode/discovery_targets.jsonl +5 -0
- aliencode/heldout_tasks.jsonl +5 -0
- aliencode/manual.md +87 -0
- aliencode/worked_examples.jsonl +4 -0
- alienlogic/heldout_theorems.jsonl +5 -0
- alienlogic/side_conditions.jsonl +3 -0
- alienlogic/worked_examples.jsonl +3 -0
- examples/aliencode.md +244 -0
- examples/alienlogic.md +201 -0
README.md
ADDED
|
@@ -0,0 +1,171 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
- zh
|
| 6 |
+
pretty_name: ExplorationBench (public demo worlds)
|
| 7 |
+
size_categories:
|
| 8 |
+
- n<1K
|
| 9 |
+
task_categories:
|
| 10 |
+
- text-generation
|
| 11 |
+
tags:
|
| 12 |
+
- benchmark
|
| 13 |
+
- exploration
|
| 14 |
+
- llm-agents
|
| 15 |
+
- evaluation
|
| 16 |
+
- program-synthesis
|
| 17 |
+
- theorem-proving
|
| 18 |
+
configs:
|
| 19 |
+
- config_name: aliencode_heldout_tasks
|
| 20 |
+
data_files:
|
| 21 |
+
- split: test
|
| 22 |
+
path: aliencode/heldout_tasks.jsonl
|
| 23 |
+
- config_name: aliencode_worked_examples
|
| 24 |
+
data_files:
|
| 25 |
+
- split: test
|
| 26 |
+
path: aliencode/worked_examples.jsonl
|
| 27 |
+
- config_name: aliencode_discovery_targets
|
| 28 |
+
data_files:
|
| 29 |
+
- split: test
|
| 30 |
+
path: aliencode/discovery_targets.jsonl
|
| 31 |
+
- config_name: alienlogic_heldout_theorems
|
| 32 |
+
data_files:
|
| 33 |
+
- split: test
|
| 34 |
+
path: alienlogic/heldout_theorems.jsonl
|
| 35 |
+
- config_name: alienlogic_worked_examples
|
| 36 |
+
data_files:
|
| 37 |
+
- split: test
|
| 38 |
+
path: alienlogic/worked_examples.jsonl
|
| 39 |
+
- config_name: alienlogic_side_conditions
|
| 40 |
+
data_files:
|
| 41 |
+
- split: test
|
| 42 |
+
path: alienlogic/side_conditions.jsonl
|
| 43 |
+
---
|
| 44 |
+
|
| 45 |
+
<p align="center">
|
| 46 |
+
<img src="https://raw.githubusercontent.com/Tencent-Hunyuan/ExplorationBench/main/assets/logo-en.png" alt="Tencent Hy" width="400"/>
|
| 47 |
+
</p>
|
| 48 |
+
|
| 49 |
+
<h1 align="center">ExplorationBench: Measuring AI Systems' Exploration in Verifiable Alien Worlds</h1>
|
| 50 |
+
|
| 51 |
+
<p align="center">
|
| 52 |
+
📄 <a href="https://arxiv.org/abs/2609.30199"><b>Paper</b></a> |
|
| 53 |
+
💻 <a href="https://github.com/Tencent-Hunyuan/ExplorationBench"><b>Code</b></a> |
|
| 54 |
+
🖥️ <a href="https://explorationbench.com"><b>Website & Leaderboard</b></a> |
|
| 55 |
+
📝 <a href="https://explorationbench.com/blog/"><b>Blog</b></a></p>
|
| 56 |
+
|
| 57 |
+
---
|
| 58 |
+
|
| 59 |
+
This dataset holds the **two public demo worlds** of ExplorationBench. They are built with the same procedure as the evaluation worlds and use the same language, manual, proof format, protocol and task families, but their rules are new and differ from every rule of the evaluation worlds. The evaluation worlds themselves are kept private, because a world whose rules are public measures recall instead of exploration. The evaluation code, which runs these demo worlds end to end, is on [GitHub](https://github.com/Tencent-Hunyuan/ExplorationBench).
|
| 60 |
+
|
| 61 |
+
## 🔥 News
|
| 62 |
+
|
| 63 |
+
- **2026.10.13**: 📣 Tencent AI features ExplorationBench on X. [[Post]](https://x.com/TencentAI_News/status/2109904850708512825)
|
| 64 |
+
- **2026.10.08**: 💻 This repository goes public with the evaluation code and the two public demo worlds.
|
| 65 |
+
- **2026.09.30**: 📣 Tencent Hy announces ExplorationBench on X. [[Post]](https://x.com/TencentHunyuan/status/2105288808929558891)
|
| 66 |
+
- **2026.09.24**: 🎉 The paper is released on arXiv — two verifiable Alien Worlds with 55 discovery targets and 140 held-out tasks, and results for 10 frontier AI systems. [[Paper]](https://arxiv.org/abs/2609.30199) [[Website]](https://explorationbench.com) [[Blog]](https://explorationbench.com/blog/)
|
| 67 |
+
|
| 68 |
+
## 📦 What Is in This Dataset
|
| 69 |
+
|
| 70 |
+
| Config | File | Rows | Content |
|
| 71 |
+
|---|---|---:|---|
|
| 72 |
+
| `aliencode_heldout_tasks` | `aliencode/heldout_tasks.jsonl` | 5 | Held-out tasks with expected outputs and reference solutions |
|
| 73 |
+
| `aliencode_worked_examples` | `aliencode/worked_examples.jsonl` | 4 | The fixed worked examples a system reads first, with their real outputs |
|
| 74 |
+
| `aliencode_discovery_targets` | `aliencode/discovery_targets.jsonl` | 5 | The hidden rule changes: what the manual says, what actually happens, and the S-expression answer key |
|
| 75 |
+
| `alienlogic_heldout_theorems` | `alienlogic/heldout_theorems.jsonl` | 5 | Held-out theorems, including an unprovable one, with reference proofs |
|
| 76 |
+
| `alienlogic_worked_examples` | `alienlogic/worked_examples.jsonl` | 3 | The fixed worked proofs with the proof checker's verdicts |
|
| 77 |
+
| `alienlogic_side_conditions` | `alienlogic/side_conditions.jsonl` | 3 | The patched side conditions of the demo proof system |
|
| 78 |
+
|
| 79 |
+
`aliencode/manual.md` is the flawed manual a system starts from, and `examples/` shows both demo worlds as a system sees them. The answer keys (`discovery_targets`, reference solutions and proofs, side conditions) are for checking results and are never shown to a system during evaluation. Task prompts are in Chinese, the language of the evaluation prompts.
|
| 80 |
+
|
| 81 |
+
To evaluate a model on the demo worlds, use the harness in the [GitHub repository](https://github.com/Tencent-Hunyuan/ExplorationBench#-quick-start). Demo-world scores are for development only and are not comparable to the leaderboard. To have a model evaluated on the private evaluation worlds, see [Evaluate Your Model](https://github.com/Tencent-Hunyuan/ExplorationBench#-evaluate-your-model).
|
| 82 |
+
|
| 83 |
+
## 📄 Overview
|
| 84 |
+
|
| 85 |
+
Scientific discovery begins where known problems end. There, AI systems must explore: frame hypotheses, design experiments, and iterate on the results. ExplorationBench measures this ability in **verifiable Alien Worlds**. Their rules are executable, so every answer is checked exactly, and they conflict with familiar knowledge, so recall alone cannot solve the tasks.
|
| 86 |
+
|
| 87 |
+
A system starts from a flawed manual and a fixed set of worked examples. Over four rounds it probes the world through a single tool, and the world answers with deterministic feedback and no explanation. After every round, a copy of the conversation with tools disabled reports the rules it believes hold and answers every held-out task three times. The copy is then discarded, so test items never leak into exploration.
|
| 88 |
+
|
| 89 |
+
<p align="center">
|
| 90 |
+
<img src="https://raw.githubusercontent.com/Tencent-Hunyuan/ExplorationBench/main/assets/overview.png" alt="The ExplorationBench evaluation protocol" width="90%">
|
| 91 |
+
</p>
|
| 92 |
+
|
| 93 |
+
*The evaluation protocol. Every system starts from the same flawed manual and the same fixed worked examples and chooses its own probes over four rounds. At every milestone M<sub>t</sub>, a tool-disabled copy reports the rules it believes hold and answers the held-out tasks.*
|
| 94 |
+
|
| 95 |
+
<p align="center">
|
| 96 |
+
<img src="https://raw.githubusercontent.com/Tencent-Hunyuan/ExplorationBench/main/assets/trajectories.png" alt="Held-out accuracy over four rounds of exploration" width="95%">
|
| 97 |
+
</p>
|
| 98 |
+
|
| 99 |
+
*Held-out accuracy over autonomous exploration. Top: AlienCode; bottom: AlienLogic. Each cell highlights one system's M<sub>0</sub>–M<sub>4</sub> curve; the other nine are grey. Each curve is the system's Best@3 trajectory, and each milestone is the mean of three answers per held-out task.*
|
| 100 |
+
|
| 101 |
+
**Stats**: 2 sandboxes · 55 discovery targets · 140 held-out tasks · 10 frontier systems · 3 independent trajectories per system and sandbox · every verdict from an interpreter or a proof checker, with no LLM judge
|
| 102 |
+
|
| 103 |
+
**Sandboxes**:
|
| 104 |
+
- **AlienCode** — program synthesis in a small calculation language whose familiar-looking operators follow hidden semantics: `SHATTER` multiplies, `EMIT(100)` prints `127`, and no primitive adds. 31 discovery targets and 70 held-out tasks; each program is graded by an interpreter on five private inputs.
|
| 105 |
+
- **AlienLogic** — formal proof in a first-order natural-deduction system with 24 patched inference rules. 70 held-out theorems, 23 of them unprovable; a proof checker verifies every proof, and an unprovable theorem scores only when the system declines to prove it.
|
| 106 |
+
|
| 107 |
+
## 🏆 Leaderboard
|
| 108 |
+
|
| 109 |
+
Held-out accuracy (%) after four rounds of autonomous exploration (M<sub>4</sub>). **Best@3** is the best of three independent trajectories and **Mean@3** their mean; M<sub>0</sub> is the Best@3 trajectory's accuracy after the worked examples alone. Every score is the mean of three answers per task, and every system runs at its highest reasoning setting. More columns, the control conditions, and interactive trajectories are on the [website](https://explorationbench.com/#leaderboard).
|
| 110 |
+
|
| 111 |
+
**AlienCode**
|
| 112 |
+
|
| 113 |
+
| Rank | System | M<sub>0</sub> | Best@3 | Mean@3 |
|
| 114 |
+
|:---:|---|---:|---:|---:|
|
| 115 |
+
| 1 | Claude Opus 5 | 3.8 | **89.0** | 73.5 |
|
| 116 |
+
| 2 | GPT-5.6 Sol | 11.0 | 88.1 | 79.5 |
|
| 117 |
+
| 3 | Gemini 3.8 Flash | 1.4 | 79.0 | 39.7 |
|
| 118 |
+
| 4 | Kimi K3 | 2.4 | 79.0 | 38.7 |
|
| 119 |
+
| 5 | Grok 4.6 | 4.8 | 69.0 | 53.2 |
|
| 120 |
+
| 6 | Qwen3.8-Max | 2.4 | 65.7 | 64.0 |
|
| 121 |
+
| 7 | Hy4 preview | 0.5 | 63.3 | 30.2 |
|
| 122 |
+
| 8 | DeepSeek-V4.1-Flash | 1.4 | 59.5 | 46.3 |
|
| 123 |
+
| 9 | Seed2.1 Pro | 2.4 | 40.0 | 24.8 |
|
| 124 |
+
| 10 | DeepSeek-V4-Pro | 1.9 | 12.9 | 7.3 |
|
| 125 |
+
|
| 126 |
+
**AlienLogic**
|
| 127 |
+
|
| 128 |
+
| Rank | System | M<sub>0</sub> | Best@3 | Mean@3 |
|
| 129 |
+
|:---:|---|---:|---:|---:|
|
| 130 |
+
| 1 | Grok 4.6 | 42.9 | **81.0** | 72.1 |
|
| 131 |
+
| 2 | Claude Opus 5 | 43.3 | 79.5 | 75.9 |
|
| 132 |
+
| 3 | Qwen3.8-Max | 45.2 | 77.6 | 74.3 |
|
| 133 |
+
| 4 | GPT-5.6 Sol | 51.0 | 76.7 | 75.1 |
|
| 134 |
+
| 5 | Hy4 preview | 35.2 | 76.2 | 69.2 |
|
| 135 |
+
| 6 | DeepSeek-V4-Pro | 33.8 | 75.2 | 66.3 |
|
| 136 |
+
| 7 | Kimi K3 | 45.2 | 74.3 | 69.4 |
|
| 137 |
+
| 8 | DeepSeek-V4.1-Flash | 51.4 | 73.8 | 60.6 |
|
| 138 |
+
| 9 | Seed2.1 Pro | 37.6 | 69.0 | 59.8 |
|
| 139 |
+
| 10 | Gemini 3.8 Flash | 45.7 | 59.5 | 59.0 |
|
| 140 |
+
|
| 141 |
+
## 💡 Key Findings
|
| 142 |
+
|
| 143 |
+
- **Exploration, not recall or thinking alone, produces the knowledge the tasks require.** No AlienCode trajectory exceeds 15.7% after the worked examples; after four rounds the best reaches 89.0%. The same number of rounds without environment feedback stays at 0.5–11.0%.
|
| 144 |
+
- **Exploration works best when the system designs its own experiments.** Replaying a system's own best probes to it gives it exactly the same evidence, yet in AlienCode autonomous exploration still does better for 9 of 10 systems, by a median of 17.4 points.
|
| 145 |
+
- **The two worlds get stuck in different places.** In AlienLogic, being told the rules yields 96–100%, above every system's best trajectory, so discovery is the bottleneck. In AlienCode, the best trajectory beats being told the rules up front for 7 of 10 systems, so using the rules is.
|
| 146 |
+
- **Knowing a rule does not guarantee using it correctly.** Tasks whose required rules the final rule report states correctly are still solved only 73.4% of the time.
|
| 147 |
+
- **A single score hides a lot.** One system's trajectories under the same budget can end tens of points apart (Kimi K3: 5.7–79.0% in AlienCode), a system's rank in one world barely predicts its rank in the other (Spearman 0.35), and gains arrive in leaps that later rounds can undo.
|
| 148 |
+
|
| 149 |
+
## 📜 License
|
| 150 |
+
|
| 151 |
+
The data and code are licensed under the [Apache-2.0 License](https://github.com/Tencent-Hunyuan/ExplorationBench/blob/main/LICENSE).
|
| 152 |
+
|
| 153 |
+
## 📝 Citation
|
| 154 |
+
|
| 155 |
+
```bibtex
|
| 156 |
+
@article{zhang2026explorationbench,
|
| 157 |
+
title = {ExplorationBench: Measuring AI Systems' Exploration
|
| 158 |
+
in Verifiable Alien Worlds},
|
| 159 |
+
author = {Zhang, Ming and Xiang, Zhenghao and
|
| 160 |
+
Gao, Peizhong and Shen, Yujiong and Wang, Yuhui and
|
| 161 |
+
Yue, Zhonghan and Dou, Shihan and Yin, Zhangyue and
|
| 162 |
+
Ye, Junjie and Liu, Shichun and Zheng, Weihuang and
|
| 163 |
+
Chen, Jiahao and Chen, Jiayi and Liu, Hongzhang and
|
| 164 |
+
Shao, Jiaqi and Gui, Tao and Zhang, Qi and
|
| 165 |
+
Huang, Xuanjing and Zheng, Suncong and Pan, Maxm},
|
| 166 |
+
journal = {arXiv preprint arXiv:2609.30199},
|
| 167 |
+
year = {2026}
|
| 168 |
+
}
|
| 169 |
+
```
|
| 170 |
+
|
| 171 |
+
<sub>Synced from GitHub commit 6fb3475.</sub>
|
aliencode/discovery_targets.jsonl
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"id": "R01", "key": "int_offset", "name": "Integer offset", "manual_says": "Integers pass through unchanged", "actual": "Integer literal n -> n + 7", "unchanged_red_herring": false, "ground_truth_sexpr": "(+ n 7)"}
|
| 2 |
+
{"id": "R02", "key": "under_le", "name": "UNDER is non-strict", "manual_says": "UNDER(a,b) = (a < b)", "actual": "UNDER(a,b) = (a <= b)", "unchanged_red_herring": false, "ground_truth_sexpr": "(<= a b)"}
|
| 3 |
+
{"id": "R03", "key": "pluck_next", "name": "PLUCK reads one further", "manual_says": "PLUCK(seq, i) -> seq[i]", "actual": "PLUCK(seq, i) -> seq[i + 1]", "unchanged_red_herring": false, "ground_truth_sexpr": "(get seq (+ i 1))"}
|
| 4 |
+
{"id": "R04", "key": "strand_identity", "name": "STRAND unchanged", "manual_says": "STRAND(a,b,c) = [a,b,c]", "actual": "STRAND(a,b,c) = [a,b,c] (same as manual)", "unchanged_red_herring": true, "ground_truth_sexpr": "IDENTITY"}
|
| 5 |
+
{"id": "R05", "key": "gauge_double", "name": "GAUGE doubles", "manual_says": "GAUGE(seq) = length", "actual": "GAUGE(seq) = 2 * length", "unchanged_red_herring": false, "ground_truth_sexpr": "(* (len seq) 2)"}
|
aliencode/heldout_tasks.jsonl
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"id": "Q01", "difficulty": "engineer", "question_type": "predict", "prompt": "预测以下代码的输出:\n```aliencode\nSET xs AS STRAND(4, 8, 15)\nEMIT(PLUCK(xs, -7), GAUGE(xs))\n```", "given_code": "SET xs AS STRAND(4, 8, 15)\nEMIT(PLUCK(xs, -7), GAUGE(xs))", "expected_output": "15 6", "rules_tested": ["int_offset", "pluck_next", "gauge_double", "strand_identity"], "reference_solution": null, "naive_solution": null}
|
| 2 |
+
{"id": "Q02", "difficulty": "engineer", "question_type": "code", "prompt": "写一个函数 CRAFT count(xs),返回 xs 的真实元素个数。\n测试: EMIT(count(STRAND(4, 4, 4)))", "given_code": null, "expected_output": null, "rules_tested": ["gauge_double", "int_offset"], "reference_solution": "CRAFT count(xs):\n DELIVER HALVE(GAUGE(xs), -5)", "naive_solution": "CRAFT count(xs):\n DELIVER GAUGE(xs)"}
|
| 3 |
+
{"id": "Q03", "difficulty": "engineer", "question_type": "code", "prompt": "写一个函数 CRAFT second(xs),返回 xs 中下标为 1 的元素(即第二个元素)。\n测试: EMIT(second(STRAND(4, 9, 2)))", "given_code": null, "expected_output": null, "rules_tested": ["pluck_next", "int_offset"], "reference_solution": "CRAFT second(xs):\n DELIVER PLUCK(xs, -7)", "naive_solution": "CRAFT second(xs):\n DELIVER PLUCK(xs, 1)"}
|
| 4 |
+
{"id": "Q04", "difficulty": "algorithm_1", "question_type": "code", "prompt": "写一个函数 CRAFT count_below(xs, t),返回 xs 中严格小于 t 的元素个数。\n测试: EMIT(count_below(STRAND(1, 5, 3, 5), 5))", "given_code": null, "expected_output": null, "rules_tested": ["under_le", "int_offset"], "reference_solution": "CRAFT count_below(xs, t):\n SET c AS -7\n SWEEP x IN xs:\n UPON OVER(t, x):\n SET c AS SHATTER(c, -6)\n DELIVER c", "naive_solution": "CRAFT count_below(xs, t):\n SET c AS 0\n SWEEP x IN xs:\n UPON UNDER(x, t):\n SET c AS SHATTER(c, 1)\n DELIVER c"}
|
| 5 |
+
{"id": "Q05", "difficulty": "algorithm_2", "question_type": "code", "prompt": "写一个函数 CRAFT reverse_list(xs),返回一个新的 STRAND,元素顺序与 xs 相反。\n测试: EMIT(reverse_list(STRAND(1, 2, 3)))", "given_code": null, "expected_output": null, "rules_tested": ["gauge_double", "pluck_next", "int_offset", "strand_identity"], "reference_solution": "CRAFT reverse_list(xs):\n SET out AS STRAND()\n SET n AS HALVE(GAUGE(xs), -5)\n SWEEP k IN EXTENT(n):\n ANNEX(out, PLUCK(xs, WEAVE(WEAVE(n, k), -5)))\n DELIVER out", "naive_solution": "CRAFT reverse_list(xs):\n SET out AS STRAND()\n SET n AS GAUGE(xs)\n SWEEP k IN EXTENT(n):\n ANNEX(out, PLUCK(xs, WEAVE(WEAVE(n, k), 1)))\n DELIVER out"}
|
aliencode/manual.md
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
═══════════════════════════════════════════════
|
| 2 |
+
AlienCode — Language Reference Manual
|
| 3 |
+
═══════════════════════════════════════════════
|
| 4 |
+
|
| 5 |
+
AlienCode is a simple calculation language.
|
| 6 |
+
All operations use function-call syntax. Below is the complete spec.
|
| 7 |
+
|
| 8 |
+
────────────── Values ──────────────
|
| 9 |
+
Integers 42, -5, 0
|
| 10 |
+
Floats 3.14, -0.5
|
| 11 |
+
Strings "hello", "world"
|
| 12 |
+
Booleans YES (true) NO (false)
|
| 13 |
+
|
| 14 |
+
────────────── Assignment ──────────────
|
| 15 |
+
SET x AS 5 assign 5 to x
|
| 16 |
+
SET x, y AS 1, 2 multiple assignment
|
| 17 |
+
|
| 18 |
+
────────────── Output ──────────────
|
| 19 |
+
EMIT(x) display x
|
| 20 |
+
EMIT(x, y, z) display several values (space-separated)
|
| 21 |
+
|
| 22 |
+
────────────── Arithmetic ──────────────
|
| 23 |
+
SHATTER(a, b) addition a + b
|
| 24 |
+
WEAVE(a, b) subtraction a − b
|
| 25 |
+
PARE(a, b) multiplication a × b
|
| 26 |
+
FRACTURE(a, b) division a ÷ b
|
| 27 |
+
COIL(a, b) power a ^ b
|
| 28 |
+
RESIDUE(a, b) modulo a mod b
|
| 29 |
+
HALVE(a, b) integer div a ÷ b (rounded down)
|
| 30 |
+
|
| 31 |
+
────────────── Comparison ──────────────
|
| 32 |
+
AKIN(a, b) equal a == b
|
| 33 |
+
APART(a, b) not equal a ≠ b
|
| 34 |
+
OVER(a, b) greater a > b
|
| 35 |
+
UNDER(a, b) less a < b
|
| 36 |
+
ATOP(a, b) greater-or-eq a >= b
|
| 37 |
+
BENEATH(a, b) less-or-eq a <= b
|
| 38 |
+
|
| 39 |
+
────────────── Logic ──────────────
|
| 40 |
+
BOND(a, b) logical AND
|
| 41 |
+
RIFT(a, b) logical OR
|
| 42 |
+
NEGATE(a) logical NOT
|
| 43 |
+
|
| 44 |
+
────────────── Sequences ──────────────
|
| 45 |
+
STRAND(1, 2, 3) create list [1, 2, 3]
|
| 46 |
+
KNOT(1, 2, 3) create tuple (1, 2, 3)
|
| 47 |
+
PLUCK(seq, i) element at index i (0-based)
|
| 48 |
+
CARVE(seq, start, stop) sub-sequence seq[start:stop]
|
| 49 |
+
ANNEX(seq, val) append val to end of seq
|
| 50 |
+
EXPEL(seq) remove & return last element
|
| 51 |
+
IMPRINT(seq, i, val) assign val to seq[i] (0-based)
|
| 52 |
+
|
| 53 |
+
────────────── Aggregation ──────────────
|
| 54 |
+
GAUGE(seq) length of seq
|
| 55 |
+
NADIR(a, b, …) minimum value
|
| 56 |
+
APEX(a, b, …) maximum value
|
| 57 |
+
SOME_OF(seq) true if any element is true
|
| 58 |
+
EVERY_OF(seq) true if all elements are true
|
| 59 |
+
ORDER(seq) sorted copy (ascending)
|
| 60 |
+
GATHER(iter) convert iterator to list
|
| 61 |
+
FUSE(a, b, …) concatenate values as string
|
| 62 |
+
|
| 63 |
+
────────────── Iteration ──────────────
|
| 64 |
+
EXTENT(n) [0, 1, …, n-1]
|
| 65 |
+
EXTENT(a, b) [a, a+1, …, b-1]
|
| 66 |
+
INDEX(seq) yields (index, value), index starts at 0
|
| 67 |
+
PAIR(a, b) pairs corresponding elements of a and b
|
| 68 |
+
STRAIN(func, seq) keeps elements where func(x) is true
|
| 69 |
+
|
| 70 |
+
────────────── Control Flow ──────────────
|
| 71 |
+
UPON condition: if
|
| 72 |
+
…
|
| 73 |
+
LEST condition: else-if
|
| 74 |
+
…
|
| 75 |
+
DEFAULT: else
|
| 76 |
+
…
|
| 77 |
+
SWEEP var IN iterable: for loop
|
| 78 |
+
…
|
| 79 |
+
WHILE condition: while loop
|
| 80 |
+
…
|
| 81 |
+
CEASE break
|
| 82 |
+
BYPASS continue
|
| 83 |
+
|
| 84 |
+
────────────── Functions ──────────────
|
| 85 |
+
CRAFT name(args): define function
|
| 86 |
+
…
|
| 87 |
+
DELIVER value return value
|
aliencode/worked_examples.jsonl
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"id": "D01", "band": "apply", "prompt": "Output the integer constant 32.", "code": "EMIT(32)", "output": "39", "rules_exposed": ["int_offset"]}
|
| 2 |
+
{"id": "D02", "band": "interact", "prompt": "Predict UNDER(2, 2) inside a one-item STRAND.", "code": "EMIT(STRAND(UNDER(2, 2)))", "output": "[True]", "rules_exposed": ["under_le", "strand_identity"]}
|
| 3 |
+
{"id": "D03", "band": "engineer", "prompt": "Implement a function that measures a short STRAND.", "code": "CRAFT count3():\n SET xs AS STRAND(2, 4, 6)\n DELIVER GAUGE(xs)\nEMIT(count3())", "output": "6", "rules_exposed": ["gauge_double"]}
|
| 4 |
+
{"id": "D04", "band": "algorithm", "prompt": "Implement a two-step product using PARE.", "code": "CRAFT product3(a, b, c):\n SET p AS PARE(a, b)\n DELIVER PARE(p, c)\nEMIT(product3(2, 3, 4))", "output": "990", "rules_exposed": ["int_offset"]}
|
alienlogic/heldout_theorems.jsonl
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"id": "P01", "role": "sanity", "premises": ["a", "b"], "goal": "AND(a, b)", "provable": true, "reference_proof": "PROOF\npremises: a, b\ngoal: AND(a, b)\n1. a [premise]\n2. b [premise]\n3. AND(a, b) [AND_I 1, 2]\nEND", "naive_proof": null, "side_conditions": [], "min_proof_steps": 3}
|
| 2 |
+
{"id": "P02", "role": "single_rule", "premises": ["r", "IMPL(r, t)"], "goal": "t", "provable": true, "reference_proof": "PROOF\npremises: r, IMPL(r, t)\ngoal: t\n1. r [premise]\n2. IMPL(r, t) [premise]\n3. t [IMPL_E 2, 1]\nEND", "naive_proof": null, "side_conditions": ["IMPL_E_MAJOR_FIRST"], "min_proof_steps": 3}
|
| 3 |
+
{"id": "P03", "role": "single_rule", "premises": ["NOT(p)"], "goal": "IMPL(p, q)", "provable": true, "reference_proof": "PROOF\npremises: NOT(p)\ngoal: IMPL(p, q)\n1. NOT(p) [premise]\n2. | p [assume]\n3. | | NOT(q) [assume]\n4. | | BOT [NOT_E 2, 1]\n5. | NOT(NOT(q)) [NOT_I 3-4]\n6. | q [DNE 5]\n7. IMPL(p, q) [IMPL_I 2-6]\nEND", "naive_proof": null, "side_conditions": ["BOT_E_TOP_LEVEL_ONLY"], "min_proof_steps": 7}
|
| 4 |
+
{"id": "P04", "role": "two_rule", "premises": ["AND(s, t)", "IMPL(s, t)"], "goal": "t", "provable": true, "reference_proof": "PROOF\npremises: AND(s, t), IMPL(s, t)\ngoal: t\n1. AND(s, t) [premise]\n2. IMPL(s, t) [premise]\n3. s [AND_E1 1]\n4. t [IMPL_E 2, 3]\nEND", "naive_proof": null, "side_conditions": ["AND_E_LEFT_ONLY", "IMPL_E_MAJOR_FIRST"], "min_proof_steps": 4}
|
| 5 |
+
{"id": "U01", "role": "unprovable", "premises": ["AND(p, q)"], "goal": "q", "provable": false, "reference_proof": null, "naive_proof": "PROOF\npremises: AND(p, q)\ngoal: q\n1. AND(p, q) [premise]\n2. q [AND_E2 1]\nEND", "side_conditions": ["AND_E_LEFT_ONLY"], "min_proof_steps": 0}
|
alienlogic/side_conditions.jsonl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"id": "X01", "key": "AND_E_LEFT_ONLY", "family": "disabled", "affects": ["AND_E2"], "summary": "only the left conjunct can be extracted"}
|
| 2 |
+
{"id": "X02", "key": "IMPL_E_MAJOR_FIRST", "family": "reference", "affects": ["IMPL_E"], "summary": "IMPL_E cites the implication first"}
|
| 3 |
+
{"id": "X03", "key": "BOT_E_TOP_LEVEL_ONLY", "family": "scope", "affects": ["BOT_E"], "summary": "no explosion inside an assumption box"}
|
alienlogic/worked_examples.jsonl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"id": "S01", "description": "Modus Ponens, implication cited first.", "proof": "PROOF\npremises: IMPL(p, q), p\ngoal: q\n1. IMPL(p, q) [premise]\n2. p [premise]\n3. q [IMPL_E 1, 2]\nEND", "verifier_accepts": true, "verifier_reason": null, "premises": null, "goal": null}
|
| 2 |
+
{"id": "S02", "description": "Left projection of a conjunction.", "proof": "PROOF\npremises: AND(p, q)\ngoal: p\n1. AND(p, q) [premise]\n2. p [AND_E1 1]\nEND", "verifier_accepts": true, "verifier_reason": null, "premises": null, "goal": null}
|
| 3 |
+
{"id": "S03", "description": "Explosion at the top level.", "proof": "PROOF\npremises: p, NOT(p)\ngoal: q\n1. p [premise]\n2. NOT(p) [premise]\n3. BOT [NOT_E 1, 2]\n4. q [BOT_E 3]\nEND", "verifier_accepts": true, "verifier_reason": null, "premises": null, "goal": null}
|
examples/aliencode.md
ADDED
|
@@ -0,0 +1,244 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# AlienCode: the public demo world
|
| 2 |
+
|
| 3 |
+
The surface language and the reference manual (`explorationbench/sandboxes/code/manual.md`) are those of the evaluation world. The demo world differs from the manual in the five discovery targets below; the evaluation world has 31 targets of its own, and no demo target is one of them.
|
| 4 |
+
|
| 5 |
+
## Discovery targets
|
| 6 |
+
|
| 7 |
+
| Id | Operation | Manual | Demo world | Answer key |
|
| 8 |
+
|---|---|---|---|---|
|
| 9 |
+
| R01 | Integer offset | Integers pass through unchanged | Integer literal n -> n + 7 | `(+ n 7)` |
|
| 10 |
+
| R02 | UNDER is non-strict | UNDER(a,b) = (a < b) | UNDER(a,b) = (a <= b) | `(<= a b)` |
|
| 11 |
+
| R03 | PLUCK reads one further | PLUCK(seq, i) -> seq[i] | PLUCK(seq, i) -> seq[i + 1] | `(get seq (+ i 1))` |
|
| 12 |
+
| R04 | STRAND unchanged | STRAND(a,b,c) = [a,b,c] | STRAND(a,b,c) = [a,b,c] (same as manual) | `IDENTITY` |
|
| 13 |
+
| R05 | GAUGE doubles | GAUGE(seq) = length | GAUGE(seq) = 2 * length | `(* (len seq) 2)` |
|
| 14 |
+
|
| 15 |
+
## Fixed worked examples
|
| 16 |
+
|
| 17 |
+
Every system sees these four programs and their outputs before M0, and nothing else.
|
| 18 |
+
|
| 19 |
+
**D01 (apply).** Output the integer constant 32.
|
| 20 |
+
|
| 21 |
+
```aliencode
|
| 22 |
+
EMIT(32)
|
| 23 |
+
```
|
| 24 |
+
Output in the demo world: `39`; under the manual: `32`.
|
| 25 |
+
|
| 26 |
+
**D02 (interact).** Predict UNDER(2, 2) inside a one-item STRAND.
|
| 27 |
+
|
| 28 |
+
```aliencode
|
| 29 |
+
EMIT(STRAND(UNDER(2, 2)))
|
| 30 |
+
```
|
| 31 |
+
Output in the demo world: `[True]`; under the manual: `[False]`.
|
| 32 |
+
|
| 33 |
+
**D03 (engineer).** Implement a function that measures a short STRAND.
|
| 34 |
+
|
| 35 |
+
```aliencode
|
| 36 |
+
CRAFT count3():
|
| 37 |
+
SET xs AS STRAND(2, 4, 6)
|
| 38 |
+
DELIVER GAUGE(xs)
|
| 39 |
+
EMIT(count3())
|
| 40 |
+
```
|
| 41 |
+
Output in the demo world: `6`; under the manual: `3`.
|
| 42 |
+
|
| 43 |
+
**D04 (algorithm).** Implement a two-step product using PARE.
|
| 44 |
+
|
| 45 |
+
```aliencode
|
| 46 |
+
CRAFT product3(a, b, c):
|
| 47 |
+
SET p AS PARE(a, b)
|
| 48 |
+
DELIVER PARE(p, c)
|
| 49 |
+
EMIT(product3(2, 3, 4))
|
| 50 |
+
```
|
| 51 |
+
Output in the demo world: `990`; under the manual: `24`.
|
| 52 |
+
|
| 53 |
+
## Held-out tasks
|
| 54 |
+
|
| 55 |
+
Each code task is graded by running the submitted function on hidden calls; the call in the prompt only shows the interface. Expected outputs are what the reference program prints in the world. The naive program is what a system that trusts the manual writes: it is correct under the manual and wrong here.
|
| 56 |
+
|
| 57 |
+
### Q01 · engineer · predict
|
| 58 |
+
|
| 59 |
+
```
|
| 60 |
+
预测以下代码的输出:
|
| 61 |
+
```aliencode
|
| 62 |
+
SET xs AS STRAND(4, 8, 15)
|
| 63 |
+
EMIT(PLUCK(xs, -7), GAUGE(xs))
|
| 64 |
+
```
|
| 65 |
+
```
|
| 66 |
+
Rules involved: int_offset, pluck_next, gauge_double, strand_identity.
|
| 67 |
+
|
| 68 |
+
Answer: `15 6` (under the manual: `[AlienError] IndexError: list index out of range`).
|
| 69 |
+
|
| 70 |
+
### Q02 · engineer · code
|
| 71 |
+
|
| 72 |
+
```
|
| 73 |
+
写一个函数 CRAFT count(xs),返回 xs 的真实元素个数。
|
| 74 |
+
测试: EMIT(count(STRAND(4, 4, 4)))
|
| 75 |
+
```
|
| 76 |
+
Rules involved: gauge_double, int_offset.
|
| 77 |
+
|
| 78 |
+
| Hidden call | Expected |
|
| 79 |
+
|---|---|
|
| 80 |
+
| `EMIT(count(STRAND()))` | `0` |
|
| 81 |
+
| `EMIT(count(STRAND(1)))` | `1` |
|
| 82 |
+
| `EMIT(count(STRAND(2, 7)))` | `2` |
|
| 83 |
+
| `EMIT(count(STRAND(5, 5, 5, 5, 5)))` | `5` |
|
| 84 |
+
|
| 85 |
+
Reference program:
|
| 86 |
+
|
| 87 |
+
```aliencode
|
| 88 |
+
CRAFT count(xs):
|
| 89 |
+
DELIVER HALVE(GAUGE(xs), -5)
|
| 90 |
+
```
|
| 91 |
+
Naive program. On `EMIT(count(STRAND(1)))` it prints `2` instead of `1`:
|
| 92 |
+
|
| 93 |
+
```aliencode
|
| 94 |
+
CRAFT count(xs):
|
| 95 |
+
DELIVER GAUGE(xs)
|
| 96 |
+
```
|
| 97 |
+
|
| 98 |
+
### Q03 · engineer · code
|
| 99 |
+
|
| 100 |
+
```
|
| 101 |
+
写一个函数 CRAFT second(xs),返回 xs 中下标为 1 的元素(即第二个元素)。
|
| 102 |
+
测试: EMIT(second(STRAND(4, 9, 2)))
|
| 103 |
+
```
|
| 104 |
+
Rules involved: pluck_next, int_offset.
|
| 105 |
+
|
| 106 |
+
| Hidden call | Expected |
|
| 107 |
+
|---|---|
|
| 108 |
+
| `EMIT(second(STRAND(1, 2)))` | `9` |
|
| 109 |
+
| `EMIT(second(STRAND(8, 3, 6, 1)))` | `10` |
|
| 110 |
+
| `EMIT(second(STRAND(-7, 0, -7)))` | `7` |
|
| 111 |
+
| `EMIT(second(STRAND(5, 5, 9)))` | `12` |
|
| 112 |
+
|
| 113 |
+
Reference program:
|
| 114 |
+
|
| 115 |
+
```aliencode
|
| 116 |
+
CRAFT second(xs):
|
| 117 |
+
DELIVER PLUCK(xs, -7)
|
| 118 |
+
```
|
| 119 |
+
Naive program. On `EMIT(second(STRAND(1, 2)))` it prints `[AlienError] IndexError: list index out of range` instead of `9`:
|
| 120 |
+
|
| 121 |
+
```aliencode
|
| 122 |
+
CRAFT second(xs):
|
| 123 |
+
DELIVER PLUCK(xs, 1)
|
| 124 |
+
```
|
| 125 |
+
|
| 126 |
+
### Q04 · algorithm_1 · code
|
| 127 |
+
|
| 128 |
+
```
|
| 129 |
+
写一个函数 CRAFT count_below(xs, t),返回 xs 中严格小于 t 的元素个数。
|
| 130 |
+
测试: EMIT(count_below(STRAND(1, 5, 3, 5), 5))
|
| 131 |
+
```
|
| 132 |
+
Rules involved: under_le, int_offset.
|
| 133 |
+
|
| 134 |
+
| Hidden call | Expected |
|
| 135 |
+
|---|---|
|
| 136 |
+
| `EMIT(count_below(STRAND(4, 4, 4), 4))` | `0` |
|
| 137 |
+
| `EMIT(count_below(STRAND(1, 2, 3), 9))` | `3` |
|
| 138 |
+
| `EMIT(count_below(STRAND(), 3))` | `0` |
|
| 139 |
+
| `EMIT(count_below(STRAND(6, 2, 6, 1, 7), 6))` | `2` |
|
| 140 |
+
|
| 141 |
+
Reference program:
|
| 142 |
+
|
| 143 |
+
```aliencode
|
| 144 |
+
CRAFT count_below(xs, t):
|
| 145 |
+
SET c AS -7
|
| 146 |
+
SWEEP x IN xs:
|
| 147 |
+
UPON OVER(t, x):
|
| 148 |
+
SET c AS SHATTER(c, -6)
|
| 149 |
+
DELIVER c
|
| 150 |
+
```
|
| 151 |
+
Naive program. On `EMIT(count_below(STRAND(4, 4, 4), 4))` it prints `31` instead of `0`:
|
| 152 |
+
|
| 153 |
+
```aliencode
|
| 154 |
+
CRAFT count_below(xs, t):
|
| 155 |
+
SET c AS 0
|
| 156 |
+
SWEEP x IN xs:
|
| 157 |
+
UPON UNDER(x, t):
|
| 158 |
+
SET c AS SHATTER(c, 1)
|
| 159 |
+
DELIVER c
|
| 160 |
+
```
|
| 161 |
+
|
| 162 |
+
### Q05 · algorithm_2 · code
|
| 163 |
+
|
| 164 |
+
```
|
| 165 |
+
写一个函数 CRAFT reverse_list(xs),返回一个新的 STRAND,元素顺序与 xs 相反。
|
| 166 |
+
测试: EMIT(reverse_list(STRAND(1, 2, 3)))
|
| 167 |
+
```
|
| 168 |
+
Rules involved: gauge_double, pluck_next, int_offset, strand_identity.
|
| 169 |
+
|
| 170 |
+
| Hidden call | Expected |
|
| 171 |
+
|---|---|
|
| 172 |
+
| `EMIT(reverse_list(STRAND()))` | `[]` |
|
| 173 |
+
| `EMIT(reverse_list(STRAND(4)))` | `[11]` |
|
| 174 |
+
| `EMIT(reverse_list(STRAND(9, 8)))` | `[15, 16]` |
|
| 175 |
+
| `EMIT(reverse_list(STRAND(1, 3, 5, 7)))` | `[14, 12, 10, 8]` |
|
| 176 |
+
|
| 177 |
+
Reference program:
|
| 178 |
+
|
| 179 |
+
```aliencode
|
| 180 |
+
CRAFT reverse_list(xs):
|
| 181 |
+
SET out AS STRAND()
|
| 182 |
+
SET n AS HALVE(GAUGE(xs), -5)
|
| 183 |
+
SWEEP k IN EXTENT(n):
|
| 184 |
+
ANNEX(out, PLUCK(xs, WEAVE(WEAVE(n, k), -5)))
|
| 185 |
+
DELIVER out
|
| 186 |
+
```
|
| 187 |
+
Naive program. On `EMIT(reverse_list(STRAND(4)))` it prints `[AlienError] IndexError: list index out of range` instead of `[11]`:
|
| 188 |
+
|
| 189 |
+
```aliencode
|
| 190 |
+
CRAFT reverse_list(xs):
|
| 191 |
+
SET out AS STRAND()
|
| 192 |
+
SET n AS GAUGE(xs)
|
| 193 |
+
SWEEP k IN EXTENT(n):
|
| 194 |
+
ANNEX(out, PLUCK(xs, WEAVE(WEAVE(n, k), 1)))
|
| 195 |
+
DELIVER out
|
| 196 |
+
```
|
| 197 |
+
|
| 198 |
+
## Rule report
|
| 199 |
+
|
| 200 |
+
At every milestone a tool-less copy of the conversation is asked for this report; each line is matched structurally against the answer key above.
|
| 201 |
+
|
| 202 |
+
```
|
| 203 |
+
⚠️ 重要:请暂停探索,不要再编写任何 AlienCode 测试代码。
|
| 204 |
+
|
| 205 |
+
现在进入【规则总结阶段】。你的任务是回顾到目前为止的所有实验结果,
|
| 206 |
+
用 S-Expression(前序表达式)格式总结你发现的所有 AlienCode 规则偏差。
|
| 207 |
+
|
| 208 |
+
⚠️ 注意:你的回复中 **只能包含规则总结**,不要包含任何 AlienCode 代码、测试用例或 EMIT 语句。
|
| 209 |
+
|
| 210 |
+
格式要求:
|
| 211 |
+
RULE_ID := S-EXPRESSION
|
| 212 |
+
|
| 213 |
+
每条规则描述对应操作的 **实际运行时行为**(不是文档中声称的标准行为)。
|
| 214 |
+
未发现的规则写 UNKNOWN。
|
| 215 |
+
|
| 216 |
+
允许的操作符:
|
| 217 |
+
算术: + - * / // % **
|
| 218 |
+
位运算: ^
|
| 219 |
+
比较: == != > < >= <=
|
| 220 |
+
逻辑: and or not
|
| 221 |
+
序列: reverse get slice len range
|
| 222 |
+
迭代: zip enumerate filter sort_asc sort_desc
|
| 223 |
+
聚合: max min any all
|
| 224 |
+
列表: prepend pop_left
|
| 225 |
+
输出: print
|
| 226 |
+
|
| 227 |
+
变量约定:a b = 二元操作数, n x s = 单元操作数,
|
| 228 |
+
seq = 序列, i = 索引, lo hi = 边界, pred = 谓词
|
| 229 |
+
|
| 230 |
+
规则清单(共 5 条):
|
| 231 |
+
|
| 232 |
+
--- L1: 字面量编码 ---
|
| 233 |
+
R01 := ?? # 整数字面量编码规则
|
| 234 |
+
|
| 235 |
+
--- L3: 比较运算 ---
|
| 236 |
+
R02 := ?? # UNDER(a, b) 的实际行为
|
| 237 |
+
|
| 238 |
+
--- L5: 位置与结构 ---
|
| 239 |
+
R03 := ?? # PLUCK(seq, i) 的实际索引行为
|
| 240 |
+
R04 := ?? # STRAND(...) 的元素顺序
|
| 241 |
+
|
| 242 |
+
--- L7: 聚合 ---
|
| 243 |
+
R05 := ?? # GAUGE(seq) 的实际返回值
|
| 244 |
+
```
|
examples/alienlogic.md
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# AlienLogic: the public demo world
|
| 2 |
+
|
| 3 |
+
The proof format, the standard rules, and the reference manual are those of the evaluation world (`explorationbench/sandboxes/logic/engine.py`). The demo world adds three side conditions; the evaluation world adds 24 of its own, and no demo condition is one of them.
|
| 4 |
+
|
| 5 |
+
## Side conditions
|
| 6 |
+
|
| 7 |
+
| Id | Name | Condition |
|
| 8 |
+
|---|---|---|
|
| 9 |
+
| X01 | `AND_E_LEFT_ONLY` | AND_E2 is disabled: from AND(φ, ψ) only the left conjunct φ can be extracted, with AND_E1. |
|
| 10 |
+
| X02 | `IMPL_E_MAJOR_FIRST` | IMPL_E must cite the implication line first and its antecedent second: [IMPL_E i, j] where line i is IMPL(φ, ψ) and line j is φ. |
|
| 11 |
+
| X03 | `BOT_E_TOP_LEVEL_ONLY` | BOT_E is refused inside an assumption box; it is only legal at indent 0. |
|
| 12 |
+
|
| 13 |
+
## Fixed worked examples
|
| 14 |
+
|
| 15 |
+
Three accepted proofs and two refused ones, with the verdict the checker returns. A refusal carries only an opaque reason id.
|
| 16 |
+
|
| 17 |
+
**S01.** Modus Ponens, implication cited first. Verdict: ACCEPTED.
|
| 18 |
+
|
| 19 |
+
```
|
| 20 |
+
PROOF
|
| 21 |
+
premises: IMPL(p, q), p
|
| 22 |
+
goal: q
|
| 23 |
+
1. IMPL(p, q) [premise]
|
| 24 |
+
2. p [premise]
|
| 25 |
+
3. q [IMPL_E 1, 2]
|
| 26 |
+
END
|
| 27 |
+
```
|
| 28 |
+
|
| 29 |
+
**S02.** Left projection of a conjunction. Verdict: ACCEPTED.
|
| 30 |
+
|
| 31 |
+
```
|
| 32 |
+
PROOF
|
| 33 |
+
premises: AND(p, q)
|
| 34 |
+
goal: p
|
| 35 |
+
1. AND(p, q) [premise]
|
| 36 |
+
2. p [AND_E1 1]
|
| 37 |
+
END
|
| 38 |
+
```
|
| 39 |
+
|
| 40 |
+
**S03.** Explosion at the top level. Verdict: ACCEPTED.
|
| 41 |
+
|
| 42 |
+
```
|
| 43 |
+
PROOF
|
| 44 |
+
premises: p, NOT(p)
|
| 45 |
+
goal: q
|
| 46 |
+
1. p [premise]
|
| 47 |
+
2. NOT(p) [premise]
|
| 48 |
+
3. BOT [NOT_E 1, 2]
|
| 49 |
+
4. q [BOT_E 3]
|
| 50 |
+
END
|
| 51 |
+
```
|
| 52 |
+
|
| 53 |
+
**R01.** 用 AND_E2 取出右侧合取项。 Verdict: ALIEN_AXIOM_DISABLED / X01.
|
| 54 |
+
|
| 55 |
+
```
|
| 56 |
+
PROOF
|
| 57 |
+
premises: AND(p, q)
|
| 58 |
+
goal: q
|
| 59 |
+
1. AND(p, q) [premise]
|
| 60 |
+
2. q [AND_E2 1]
|
| 61 |
+
END
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
**R02.** IMPL_E 先引用前件,再引用蕴含式。 Verdict: ALIEN_SIDE_CONDITION / X02.
|
| 65 |
+
|
| 66 |
+
```
|
| 67 |
+
PROOF
|
| 68 |
+
premises: p, IMPL(p, q)
|
| 69 |
+
goal: q
|
| 70 |
+
1. p [premise]
|
| 71 |
+
2. IMPL(p, q) [premise]
|
| 72 |
+
3. q [IMPL_E 1, 2]
|
| 73 |
+
END
|
| 74 |
+
```
|
| 75 |
+
|
| 76 |
+
## Held-out theorems
|
| 77 |
+
|
| 78 |
+
### P01 · sanity
|
| 79 |
+
|
| 80 |
+
Premises: `a, b`. Goal: `AND(a, b)`. Built around: none.
|
| 81 |
+
|
| 82 |
+
Reference proof:
|
| 83 |
+
|
| 84 |
+
```
|
| 85 |
+
PROOF
|
| 86 |
+
premises: a, b
|
| 87 |
+
goal: AND(a, b)
|
| 88 |
+
1. a [premise]
|
| 89 |
+
2. b [premise]
|
| 90 |
+
3. AND(a, b) [AND_I 1, 2]
|
| 91 |
+
END
|
| 92 |
+
```
|
| 93 |
+
|
| 94 |
+
### P02 · single_rule
|
| 95 |
+
|
| 96 |
+
Premises: `r, IMPL(r, t)`. Goal: `t`. Built around: IMPL_E_MAJOR_FIRST.
|
| 97 |
+
|
| 98 |
+
Reference proof:
|
| 99 |
+
|
| 100 |
+
```
|
| 101 |
+
PROOF
|
| 102 |
+
premises: r, IMPL(r, t)
|
| 103 |
+
goal: t
|
| 104 |
+
1. r [premise]
|
| 105 |
+
2. IMPL(r, t) [premise]
|
| 106 |
+
3. t [IMPL_E 2, 1]
|
| 107 |
+
END
|
| 108 |
+
```
|
| 109 |
+
|
| 110 |
+
The standard-calculus proof below is refused here (X02):
|
| 111 |
+
|
| 112 |
+
```
|
| 113 |
+
PROOF
|
| 114 |
+
premises: r, IMPL(r, t)
|
| 115 |
+
goal: t
|
| 116 |
+
1. r [premise]
|
| 117 |
+
2. IMPL(r, t) [premise]
|
| 118 |
+
3. t [IMPL_E 1, 2]
|
| 119 |
+
END
|
| 120 |
+
```
|
| 121 |
+
|
| 122 |
+
### P03 · single_rule
|
| 123 |
+
|
| 124 |
+
Premises: `NOT(p)`. Goal: `IMPL(p, q)`. Built around: BOT_E_TOP_LEVEL_ONLY.
|
| 125 |
+
|
| 126 |
+
Reference proof:
|
| 127 |
+
|
| 128 |
+
```
|
| 129 |
+
PROOF
|
| 130 |
+
premises: NOT(p)
|
| 131 |
+
goal: IMPL(p, q)
|
| 132 |
+
1. NOT(p) [premise]
|
| 133 |
+
2. | p [assume]
|
| 134 |
+
3. | | NOT(q) [assume]
|
| 135 |
+
4. | | BOT [NOT_E 2, 1]
|
| 136 |
+
5. | NOT(NOT(q)) [NOT_I 3-4]
|
| 137 |
+
6. | q [DNE 5]
|
| 138 |
+
7. IMPL(p, q) [IMPL_I 2-6]
|
| 139 |
+
END
|
| 140 |
+
```
|
| 141 |
+
|
| 142 |
+
The standard-calculus proof below is refused here (X03):
|
| 143 |
+
|
| 144 |
+
```
|
| 145 |
+
PROOF
|
| 146 |
+
premises: NOT(p)
|
| 147 |
+
goal: IMPL(p, q)
|
| 148 |
+
1. NOT(p) [premise]
|
| 149 |
+
2. | p [assume]
|
| 150 |
+
3. | BOT [NOT_E 2, 1]
|
| 151 |
+
4. | q [BOT_E 3]
|
| 152 |
+
5. IMPL(p, q) [IMPL_I 2-4]
|
| 153 |
+
END
|
| 154 |
+
```
|
| 155 |
+
|
| 156 |
+
### P04 · two_rule
|
| 157 |
+
|
| 158 |
+
Premises: `AND(s, t), IMPL(s, t)`. Goal: `t`. Built around: AND_E_LEFT_ONLY, IMPL_E_MAJOR_FIRST.
|
| 159 |
+
|
| 160 |
+
Reference proof:
|
| 161 |
+
|
| 162 |
+
```
|
| 163 |
+
PROOF
|
| 164 |
+
premises: AND(s, t), IMPL(s, t)
|
| 165 |
+
goal: t
|
| 166 |
+
1. AND(s, t) [premise]
|
| 167 |
+
2. IMPL(s, t) [premise]
|
| 168 |
+
3. s [AND_E1 1]
|
| 169 |
+
4. t [IMPL_E 2, 3]
|
| 170 |
+
END
|
| 171 |
+
```
|
| 172 |
+
|
| 173 |
+
The standard-calculus proof below is refused here (X01):
|
| 174 |
+
|
| 175 |
+
```
|
| 176 |
+
PROOF
|
| 177 |
+
premises: AND(s, t), IMPL(s, t)
|
| 178 |
+
goal: t
|
| 179 |
+
1. AND(s, t) [premise]
|
| 180 |
+
2. IMPL(s, t) [premise]
|
| 181 |
+
3. t [AND_E2 1]
|
| 182 |
+
END
|
| 183 |
+
```
|
| 184 |
+
|
| 185 |
+
### U01 · unprovable
|
| 186 |
+
|
| 187 |
+
Premises: `AND(p, q)`. Goal: `q`. Built around: AND_E_LEFT_ONLY.
|
| 188 |
+
|
| 189 |
+
Unprovable. The correct answer is `ANSWER: UNPROVABLE`. Certificate: with AND_E2 gone every remaining rule is sound when AND(φ, ψ) is read as φ, and under that reading the assignment {'p': True, 'q': False} makes the premises true and the goal false.
|
| 190 |
+
|
| 191 |
+
A naive attempt the checker refuses:
|
| 192 |
+
|
| 193 |
+
```
|
| 194 |
+
PROOF
|
| 195 |
+
premises: AND(p, q)
|
| 196 |
+
goal: q
|
| 197 |
+
1. AND(p, q) [premise]
|
| 198 |
+
2. q [AND_E2 1]
|
| 199 |
+
END
|
| 200 |
+
```
|
| 201 |
+
|