GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - hyperpolymath/tangle: Tangle — topological programming language

BranchesTags
Open more actions menu

Latest commit

 

History

198 Commits
198 Commits

Folders and files

NameName
Last commit message
Last commit date
.claude
.claude
 
 
.githooks
.githooks
 
 
.github
.github
 
 
.machine_readable
.machine_readable
 
 
LICENSES
LICENSES
 
 
bench
bench
 
 
compiler
compiler
 
 
conformance
conformance
 
 
contractiles
contractiles
 
 
dialects
dialects
 
 
docs
docs
 
 
editors
editors
 
 
examples
examples
 
 
ffi/zig
ffi/zig
 
 
lib
lib
 
 
playground
playground
 
 
proofs
proofs
 
 
scripts
scripts
 
 
spec
spec
 
 
src
src
 
 
verification
verification
 
 
www/.well-known
www/.well-known
 
 
.bot_directives
.bot_directives
 
 
.editorconfig
.editorconfig
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
.gitlab-ci.yml
.gitlab-ci.yml
 
 
.nojekyll
.nojekyll
 
 
0-AI-MANIFEST.a2ml
0-AI-MANIFEST.a2ml
 
 
ABI-FFI-README.adoc
ABI-FFI-README.adoc
 
 
AFFIRMATION.adoc
AFFIRMATION.adoc
 
 
ASSUMPTIONS.adoc
ASSUMPTIONS.adoc
 
 
CHANGELOG.adoc
CHANGELOG.adoc
 
 
CITATION.cff
CITATION.cff
 
 
CODE_OF_CONDUCT.adoc
CODE_OF_CONDUCT.adoc
 
 
CONTRIBUTING.adoc
CONTRIBUTING.adoc
 
 
EXPLAINME.adoc
EXPLAINME.adoc
 
 
GOVERNANCE.adoc
GOVERNANCE.adoc
 
 
Justfile
Justfile
 
 
LICENSE
LICENSE
 
 
MAINTAINERS
MAINTAINERS
 
 
MAINTAINERS.adoc
MAINTAINERS.adoc
 
 
PROOF-NARRATIVE.adoc
PROOF-NARRATIVE.adoc
 
 
PROOF-NEEDS.adoc
PROOF-NEEDS.adoc
 
 
QUICKSTART-DEV.adoc
QUICKSTART-DEV.adoc
 
 
QUICKSTART-MAINTAINER.adoc
QUICKSTART-MAINTAINER.adoc
 
 
QUICKSTART-USER.adoc
QUICKSTART-USER.adoc
 
 
READINESS.adoc
READINESS.adoc
 
 
README-jtv.adoc
README-jtv.adoc
 
 
README.adoc
README.adoc
 
 
REQUIRES_INITIALISATION.adoc
REQUIRES_INITIALISATION.adoc
 
 
ROADMAP.adoc
ROADMAP.adoc
 
 
RSR_OUTLINE.adoc
RSR_OUTLINE.adoc
 
 
SECURITY.adoc
SECURITY.adoc
 
 
TEST-NEEDS.adoc
TEST-NEEDS.adoc
 
 
TOPOLOGY.adoc
TOPOLOGY.adoc
 
 
contractile.just
contractile.just
 
 
guix.scm
guix.scm
 
 
llm-warmup-dev.adoc
llm-warmup-dev.adoc
 
 
llm-warmup-user.adoc
llm-warmup-user.adoc
 
 
mise.toml
mise.toml
 
 
setup.sh
setup.sh
 
 
stapeln.toml
stapeln.toml
 
 

Repository files navigation

Tangle — a general language for knot mathematics

OpenSSF Best Practices License: MPL-2.0 Green Web

A research language for knots and their mathematics — topological, algebraic, geometric and logical — in which programs are structured objects and equivalence is defined by transformation.


Overview

Tangle is an experimental, Turing-complete programming language in which:

programs are structured as tangles (braids), and program equivalence is defined by isotopy.

Rather than treating programs as sequences of instructions, Tangle treats them as composable topological objects. This allows reasoning about programs in terms of structure, equivalence under transformation, and invariants of representation.

Its remit is deliberately broad: Tangle aims to be a general language for doing mathematics about knots — not a front end to any particular knot database.


Core idea

computation is construction of structured objects, and meaning is preserved under valid transformations.

In this setting:

  • programs are graphs/braids

  • execution corresponds to transformation

  • equivalence is not syntactic equality, but structural equivalence

This aligns with concepts from knot theory (Reidemeister moves), category theory (morphisms and composition), and algebraic invariants (classification via structure).


Relationship to KRL and QuandleDB

Tangle is a separate project from KRL and QuandleDB. The three share a subject matter, not an architecture.

Project What it is

Tangle (this repository)

A general language for knot mathematics. Turing-complete. Independent of any database.

QuandleDB

A knot database — stores presentations, invariants, fingerprints, equivalence classes and witnesses.

KRL

QuandleDB’s resolution language, developed jointly with it. Specified in the krl repository, implemented in quandledb/server/krl/.

Important

Earlier revisions of this README were titled "Tangle / KRL" and described Tangle as the substrate of a KRL → TangleIR → Tangle core → QuandleDB stack. That was wrong on both counts.

  • KRL is not Tangle’s surface language. It is QuandleDB’s, and it neither compiles to nor depends on Tangle.

  • There is no TangleIR. The identifier appears in no source file in this repository, nor in the KRL implementation — it existed only in prose.

The projects remain related by domain and are developed by the same author; what is removed here is a claimed architectural dependency that does not exist.


Formal core

A core fragment of the language is formalised and mechanised in Lean 4.

Verified on 2026-07-21 by running the repository’s own oracle, cd proofs && lean Tangle.lean — exit 0, no errors:

Property Status

progress

proved

preservation

proved

determinism

proved

type_safety

proved

Decidability of type checking (infer == HasType)

proved

The proofs are self-contained (no Mathlib dependency) and contain zero uses of sorry and zero axiom declarations across 2,128 lines — so "builds" and "proved" mean the same thing here, which is not automatic.

They cover echo types: structured loss as a type-system feature. close (braid closure) is the canonical lossy map, and echoClose/lower/residue make that loss recoverable at the type level — a simply-typed shadow of echo-types. All four safety theorems cover them.

See proofs/Tangle.lean, proofs/README.md, docs/spec/FORMAL-SEMANTICS.md, and PROOF-NARRATIVE.md / PROOF-NEEDS.md.

This formal core covers the structural heart of the language, though not all surface features.


Dialects

Tangle’s breadth is expressed as dialects, each with its own grammar sketch under dialects/:

  • braid-calculus — braid words and their relations

  • skein-algebra — skein relations and invariant computation

  • string-diagram — monoidal-category string diagrams

  • virtual-knot — virtual knot theory

  • quantum-circuit — circuits as topological objects


Current status

Tangle is an active research system. Read it as a formally grounded core with an evolving implementation around it.

Area State

Lean 4 formal core

Verified — see above

Grammars

src/tangle.ebnf, src/tangle-jtv.ebnf, spec/grammar.ebnf, plus five dialect sketches

OCaml compiler (compiler/)

Lexer, parser, AST, typechecker, evaluator, pretty-printer, REPL, braid equivalence, plus LSP and WASM targets. Not built by CI

Rust / Zig components

18 .rs, 3 .zig. Not built by CI

Database integration

Not implemented

Note

Only the Lean proofs are gated by CI (.github/workflows/lean-proofs.yml). The OCaml compiler, the Rust components and the Zig components are not built by any workflow, so their state is unverified by this repository’s own CI.


Research directions

  • richer categorical abstractions

  • optimisation via equivalence classes

  • alternative evaluation models based on rewriting

These are not yet stable features.


How to read this repository

  • proofs/Tangle.lean — mechanised type-safety proof (the load-bearing artefact)

  • docs/spec/FORMAL-SEMANTICS.md — formal model

  • src/tangle.ebnf — surface grammar

  • dialects/ — the breadth of the language

  • compiler/lib/ — the OCaml front end

Licence

This project is licensed under the Mozilla Public License, v. 2.0. See the LICENSE file for details. This document is CC-BY-SA-4.0.

About

Tangle — topological programming language

Topics

braidschoreographic-interactionepistemic-computingepistemic-infrastructureequivalence-aware-computinghyperpolymathknot-theorylanguage-designlow-dimensional-topologyocamlopen-sourceprogramming-languagereproducible-researchresearch-softwarerusttopological-programmingtopologytype-theorytyped-provenanceveridical-computing

Resources

Readme
MPL-2.0 license

Code of conduct

Code of conduct

Contributing

Contributing

Security policy

Security policy
Activity

Stars

2 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Sponsor this project

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.