mirror of
https://github.com/allaunthefox/BioSight.git
synced 2026-07-31 03:05:22 +00:00
BioSight encodes mathematical equations as 30-base hachimoji DNA sequences for Adleman/Lipton-style DNA computing. 4-layer Φ mapping: Layer 1: F(E) — byte-class histogram on Δ₇ Layer 3: τ(E) + δ(E) — parse tree structure Layer 4: 6 consistency rules → allele-specific PCR pass/fail Independent phi/ modules: charclass, ast_parse, consistency, embed, output Build: python3 -m py_compile — all modules clean
72 lines
2.8 KiB
Markdown
72 lines
2.8 KiB
Markdown
# BioSight — Equation-to-DNA Φ Encoding Pipeline
|
||
|
||
**Status:** Active, v0.1.0
|
||
|
||
BioSight encodes mathematical equations as hachimoji DNA sequences
|
||
for Adleman/Lipton-style DNA computing. The Φ mapping has 4 layers:
|
||
|
||
1. **F(E)** — byte-class histogram over Δ₇ (8 character classes)
|
||
2. *Phase alphabet — implicit in the mapping from Δ₇ to bases*
|
||
3. **τ(E) + δ(E)** — parse tree structure (node types + child ordering)
|
||
4. **Consistency** — 6 rules → allele-specific PCR G/T pass/fail
|
||
|
||
## Ground Rules
|
||
|
||
- **Decision logic is in Lean** — BioSight shims are Python I/O only.
|
||
If any logic here starts making admissibility or routing decisions,
|
||
port it to SilverSight's `Semantics.RRC.*` modules.
|
||
- **No floats in compute paths** — `phi.charclass` and `phi.embed`
|
||
use integer arithmetic for all core encoding. Only `phi.output`
|
||
uses math.acos (for Fisher distance in Adleman graph building).
|
||
- **Pure functions** — every phi module is a pure function of
|
||
its equation string input. No state, no I/O, no side effects.
|
||
- **Reproducibility** — two invocations on the same equation must
|
||
produce identical DNA sequences (deterministic byte-class and
|
||
AST order).
|
||
|
||
## Core Modules
|
||
|
||
| Module | Layer | Responsibility |
|
||
|--------|-------|----------------|
|
||
| `phi.charclass` | 1 | 8-class byte histogram → F(E) ∈ Δ₇ |
|
||
| `phi.ast_parse` | 3 | Python AST → τ(E) + δ(E) distributions |
|
||
| `phi.consistency` | 4 | 6 rules → ADMIT/QUARANTINE |
|
||
| `phi.embed` | Core | (F, τ, δ) → 30-base hachimoji DNA |
|
||
| `phi.output` | Formats | FASTQ, Adleman graph, PCR protocol |
|
||
|
||
## DNA Layout (30 bases)
|
||
|
||
```
|
||
bases 0-7: F(E) — byte-class frequencies on Δ₇
|
||
bases 8-15: τ(E) — parse tree node-type frequencies
|
||
bases 16-23: δ(E) — child-ordering frequencies
|
||
bases 24-29: Layer 4 consistency (G=pass, T=fail)
|
||
```
|
||
|
||
## External Integration
|
||
|
||
- **BioComputing** (`https://github.com/Abesuden/BioComputing`, MIT):
|
||
Our `phi.output.to_adleman_graph()` builds vertices+edges that
|
||
feed directly into `hampath.connectNodes()` and `sattv.createNodes()`.
|
||
Clone it alongside BioSight for wet-lab DNA sequence generation.
|
||
|
||
## Key References
|
||
|
||
- Adleman (1994) *Science* 266:1021–1024 — 7-vertex Hamiltonian path
|
||
- Lipton (1995) *Science* 268:542–545 — SAT generalization
|
||
- Hoshika et al. (2019) *Science* 363:884–887 — 8-base hachimoji alphabet
|
||
- Newton et al. (1989) *Nucleic Acids Res* 17:2503 — allele-specific PCR
|
||
|
||
## Build & Test
|
||
|
||
```bash
|
||
cd python
|
||
python3 -m py_compile phi/*.py equation_dna_encoder.py
|
||
python3 -c "import phi; print(phi.encode_phi('x + 1 = 2'))"
|
||
```
|
||
|
||
## SilverSight Relationship
|
||
|
||
BioSight is the DNA-computing branch of the Research Stack ecosystem.
|
||
SilverSight (`/home/allaun/SilverSight`) owns all formal Lean logic.
|
||
If BioSight needs a new theorem or receipt, it requests it from SilverSight.
|