Skip to main content
The BRIK-64 Lifter is a reverse compiler that analyzes existing source code and extracts the subset that maps to PCD monomers. Instead of rewriting your codebase from scratch, the Lifter gives you an automatic migration path.

How It Works

Source Code → AST → Pattern Recognition → Monomer Mapping → PCD Output
  1. Parse — The Lifter parses your source file into an AST using a lightweight, language-specific frontend.
  2. Recognize — Pattern recognition identifies operations that correspond to BRIK-64 monomers (arithmetic, logic, memory, control flow, I/O, string, crypto, system).
  3. Map — Recognized patterns are mapped to their MC_XX monomer equivalents with proper EVA composition.
  4. Emit — The result is output as a valid PCD program (text or structured JSON).

SSA Transform

The Lifter includes an SSA (Static Single Assignment) transform that handles variable reassignment. When your source code reassigns variables (e.g., total = total + x), the Lifter automatically converts them into SSA form with unique variable names, producing valid PCD where each let binding is assigned exactly once. This enables lifting real-world patterns like accumulators, running totals, and iterative updates that were previously unsupported.

Two-Tier Certification

Lifted PCD receives certification based on which monomers it uses:
  • CORE (Phi_c = 1) — Programs using only core monomers (MC_00-MC_63) receive full formal certification
  • CONTRACT (Phi_c = CONTRACT) — Programs using extended monomers (MC_64-MC_127) receive contract-based certification with bounds checking
The Lifter automatically selects the appropriate monomers and reports the certification tier.

Full Roundtrip Pipeline

The Lifter enables a complete verified roundtrip:
Source (any language) → brikc lift → PCD → brikc check → brikc build → JS/Python/Rust → execute
This means you can take existing code, lift it to PCD, verify circuit closure, compile to any target language, and execute — with formal guarantees attached.

Supported Languages

The Lifter ships with 10 language frontends and achieves 100% liftability on real-world projects (211/211 files across 2 production projects, 73/73 circuits passing check):
LanguageExtensionsStatus
JavaScript.js, .mjs, .cjsStable
TypeScript.ts, .mtsStable
TSX.tsxStable
JSX.jsxStable
Python.pyStable
Rust.rsStable
C / C++.c, .h, .cpp, .hppStable
Go.goStable
COBOL.cob, .cblStable
PHP.phpStable
Java.javaStable

Safety Fallback

When the Lifter encounters code patterns it cannot map to monomers, it uses a safety fallback that wraps unsupported expressions as comments in the output PCD, preserving context without breaking the circuit. This ensures partial lifting always produces valid PCD.

Liftability Score

Not all code can be represented as PCD. The Lifter reports a liftability score (0.0 to 1.0) indicating what percentage of the source maps to monomers. Code that uses I/O, complex OOP, or framework-specific APIs will have lower scores.
Use --min-liftability 0.5 to only output results when at least 50% of the source maps to PCD monomers.

What Gets Lifted

  • Arithmetic operations (add, subtract, multiply, divide)
  • Bitwise and logical operations
  • Variable declarations and assignments
  • Control flow (if/else, loops, match/switch)
  • String operations
  • Basic I/O (print, read)

What Does NOT Get Lifted

  • Framework-specific APIs (React, Django, etc.)
  • Complex OOP patterns (inheritance hierarchies)
  • Async/await and concurrency primitives
  • FFI and unsafe blocks
  • Macros and metaprogramming

Supported Languages

Detailed breakdown of what each frontend recognizes.

Usage Guide

CLI flags, output formats, and examples.