Skip to content

Repository files navigation

Redstone Compiler Project

A constraint-based compiler for Minecraft Redstone circuits, combining logic synthesis, physical design, SAT-based search, and formal verification in Lean 4.

This project explores Minecraft Redstone as a computational substrate for compiler optimization, circuit synthesis, and formally grounded physical design.

Explore the Formalization

Compiler Architecture

HDL / Boolean Logic
        ↓
Logic Synthesis
        ↓
Clustering & Logic Graph
        ↓
Placement & Routing
        ↓
Physical World & Simulation
        ↓
Minecraft NBT

Key Features

  • Logic Synthesis — Transformation of logical circuits into Redstone-compatible representations.
  • Physical Design — Three-dimensional placement and routing under Redstone-specific physical constraints.
  • Constraint-Based Search — SAT-based exact placement alongside heuristic search algorithms.
  • Simulation — Validation of generated circuits against executable Redstone semantics.
  • Formal Verification — Machine-checked reasoning about physical semantics, constraint encodings, pruning rules, and circuit certificates using Lean 4.

Formal Methods

The project investigates a bottom-up approach to formal compiler development:

Physical Semantics
        ↓
Derived Properties
        ↓
Constraint Encoding
        ↓
Feasibility & Solution Preservation
        ↓
Search & Optimization

The goal is to establish a mathematically grounded feasibility model upon which search algorithms and optimization strategies can evolve independently.

The formalization currently includes:

  • Executable Redstone semantics.
  • Machine-checked physical properties.
  • Proofs and counterexamples for solution-preserving constraints.
  • Constraint encoding lemmas.
  • A formally verified certificate checker for settled states.
  • Differential testing between Lean semantics and the Rust simulator.

The long-term research direction is to develop a formally grounded anytime optimizing compiler.

Full end-to-end correctness with respect to Minecraft is not yet established.

Documentation

Development

This project is under active development and serves as an experimental platform for compiler architecture, formal methods, and combinatorial optimization.

Languages: Rust, Lean 4