REA MCP
☰
ZH-CN
● — 人在线 · 浏览 — 次
赞助提交案例
GitHub 仓库 · 发布者 AHMADALIPARR

rea-unary:从 x86 行为到 VHDL 与形式化验证

一项将 REA 的理念扩展到二进制之外的实验:从 x86 中恢复行为,然后将其表达为 VHDL 并进行形式化验证;派生自上游项目并按其许可发布。

已翻译

关于这个案例

一项将 REA 的理念扩展到二进制之外的实验:从 x86 中恢复行为,然后将其表达为 VHDL 并进行形式化验证;派生自上游项目并按其许可发布。

为何列出:针对模拟二进制文件的研究实验;鸣谢上游。

安装配置

安装方法请查看原始来源。

原文 / README

rea-unary

License: AGPL-3.0 + No AI Training C11 VHDL TypeScript Dafny Alloy

Reverse-engineer anything, down past binary to unary: a full pipeline from x86 machine code through behavior recovery, formal specification, VHDL, simulation, and firmware — every decision grounded in the four unary Boolean functions (constant-0, identity, NOT, constant-1).

Binary → decode → IR → recover behavior → LaTeX metaprogram spec
  → state machine → Alloy invariant search → Dafny contracts
  → VHDL/RTL → simulate → firmware chain → flash target
  → execution traces → SQL invariant checks → counterexample loop

Evidence flows as JSONL records through an XML-routed Mustache pipeline; ALP proposes missing semantics; counterexamples feed back into evidence until the loop turns green.

Layout

| Stage | Contents | |---|---| | stage1/ | Gutted REA tool catalog, mock binary (sample.bin, 01 D8 = ADD EAX,EBX at 0x401020), mock analysis, JSONL evidence ledger, hashed artifact store, C11 evidence router | | stage2/ | Behavior-recovery spec, unary-Boolean mapping, LaTeX metaprogram spec, state machine (A1–A8/I1–I8), synthesizable add_core.vhd, Dafny lemmas, Alloy 6 model | | stage3/ | GHDL simulation + traces, C11 cycle model, sqlite3 invariant checks, 140/140 differential oracle vs real silicon, firmware chain (objects → linker → ELF → flash image), driver/protocol, interface contract, GDScript bindings, Next.js backend + React frontend |

Build & test

# Stage 1 router (C11, zero warnings)
cd stage1/router && make test

# Stage 2 VHDL (needs GHDL)
cd stage2 && ghdl -a add_core.vhd

# Stage 3 full flow
cd stage3 && make

See each stage's README.md for the honest real-vs-mocked table.

Precision

SQL checks test recorded states and transitions only. Passing means the recorded traces satisfy the checks — not that every possible execution does.

License

AGPLv3 with an additional no-AI-training term — see LICENSE. Functional source; running it requires no payment, but the code may not be used to train machine-learning models. Portions of stage1 derived from the REA project (upstream morluto/rea) remain under their MIT notice — see stage1/LICENSE-MIT-upstream.txt.

Copyright (C) 2026 Ahmad Ali Parr

更多类似作品