← Back

System Architecture

Overview

  ┌─────────────────────────────────────────────────────────────────────┐
  │                    uniform-3-sat.aws.monce.ai                        │
  │                    EC2 t3.small │ eu-west-3 │ Ubuntu 22.04           │
  │                                                                     │
  │  nginx (TLS) → Gunicorn+Uvicorn (2w) → Starlette ASGI             │
  │    ├── POST /reduce     → uniformize()         O(n·m²)             │
  │    ├── POST /verify     → reduce + kissat×2    O(n·m² + T_solver)  │
  │    ├── POST /solve      → reduce + AUMA call   O(n·m² + nᵃ·m)     │
  │    ├── GET  /dashboard  → token metrics                            │
  │    └── GET  /paper|architecture|economics                          │
  │                                                                     │
  │  Kissat 4.0.4 (/usr/local/bin/kissat)                              │
  └──────────────────────────────┬──────────────────────────────────────┘
                                 │ POST /maximize
                                 ▼
  ┌─────────────────────────────────────────────────────────────────────┐
  │                    auma.aws.monce.ai                                 │
  │                    EC2 t3.medium │ eu-west-3                         │
  │                                                                     │
  │  polyauma library (Fourier probe + greedy + SA + Nelder-Mead)      │
  │  f(bits) = Σ clause_satisfied(bits)                                │
  │  Budget: ⌈n^a⌉ evaluations. Each eval: O(m).                      │
  └─────────────────────────────────────────────────────────────────────┘

Components

Uniformizer

shared/uniformize.py

Tseitin structural reduction → BCP gate → derived implications. 200ms budget.

BCP Engine

shared/uniformize._bcp_proves()

Occurrence-list driven unit propagation. O(n·m) per clause check.

Verifier

POST /verify

Kissat solves original + reduced. Decodes through variable map. Confirms isomorphism.

Problem Generators

uniform_3sat/problems.py

PHP, Sudoku, Graph Coloring → DIMACS CNF. Any CNF goes through the same pipe.

Request Flow

Client                    uniform-3-sat EC2            auma.aws.monce.ai
  │                              │                           │
  │  POST /solve                 │                           │
  │  {"dimacs": "p cnf.."}      │                           │
  │─────────────────────────────►│                           │
  │                              │  1. parse_dimacs()        │
  │                              │  2. uniformize()  O(n·m²) │
  │                              │  3. build_formula()       │
  │                              │  4. POST /maximize ───────►│
  │                              │     {f, variables, a}     │  Fourier probe (2n+1)
  │                              │                           │  Greedy flip
  │                              │                           │  SA polish
  │                              │◄───── {value, x, evals} ──│
  │                              │  5. if value < target:     │
  │                              │     bump a, goto 4        │
  │                              │  6. decode_assignment()   │
  │                              │                           │
  │  {"status": "SAT",          │                           │
  │   "decoded", "evals",       │                           │
  │   "phases"}                  │                           │
  │◄─────────────────────────────│                           │

Complexity at each stage

  ┌─────────────────────────────────────────────────────────────────────┐
  │ STAGE            │ TIME           │ TOKENS        │ PROVEN          │
  ├──────────────────┼────────────────┼───────────────┼─────────────────┤
  │ Tseitin          │ O(m)           │ 0 (internal)  │ Thm 1           │
  │ BCP gate         │ O(n·m) / clause│ 0 (internal)  │ Thm 2           │
  │ Full reduction   │ O(n·m²)        │ out: c×42     │ Thm 3           │
  │ AUMA probe       │ O(n·m)         │ S_formula     │ Thm 5           │
  │ AUMA solve (a=2) │ O(n²·m)        │ S_formula     │ Thm 6           │
  │ Decode           │ O(n)           │ 0             │ trivial         │
  │ ────────────────────────────────────────────────────────────────── │
  │ TOTAL            │ O(n·m² + nᵃ·m) │ ≤ 50K tokens  │ Thm 7           │
  └─────────────────────────────────────────────────────────────────────┘

Deployment

GitHub (Monce-AI/uniform-3-sat)
  │
  │  push to main
  ▼
GitHub Actions (deploy.yml)
  │
  │  SSH into EC2
  │  git pull → pip install → systemctl restart
  ▼
EC2 t3.small (uniform-3-sat.aws.monce.ai)
  │
  │  Route53 A record → public IP
  │  certbot auto-renew (Let's Encrypt)
  ▼
Live at https://uniform-3-sat.aws.monce.ai

Security

SSH access via key pair only (SG ingress on port 22). HTTPS via Let's Encrypt. No secrets in repo — EC2_HOST and EC2_SSH_KEY stored as GitHub Actions secrets.