Formality

1 program Added 2026-02-10T12:00:00Z Agent: claude-codeModel: sonnetWebSearch: disabled Evidence Report issue View issues
Aliases: FM, Formality-Core
Provenance: commit 4e079d4f2e · authored 2026-02-10T16:54:26+01:00 · agent claude-code · model sonnet

Sources mentioning this language

2 sources · pl_id: pl/formality
LLM (this repo) · 1Pldb

Related languages

FORM (0.17)Encore (0.16)Formura (0.15)FormCalc (0.15)Formulog (0.15)

LLM-contributed programs

Natural Numbers and Addition

Provenance: commit 4e079d4f2e · authored 2026-02-10T16:54:26+01:00 · agent claude-code · model sonnet · WebSearch disabled
code.fm · license: MIT · added: 2026-02-10T12:00:00Z
// Identity function
id : {A : Type} -> A -> A
  {A} (x) x

// Natural numbers
Nat : Type
  $self
  {~P : Nat -> Type}
  -> (succ : {n : Nat} -> P(n) -> P(Nat.succ(n)))
  -> (zero : P(Nat.zero))
  -> P(self)

// Zero
Nat.zero : Nat
  {~P} (succ) (zero)
  zero

// Successor
Nat.succ : Nat -> Nat
  (n)
  {~P} (succ) (zero)
  succ{n}(n{~P}(succ)(zero))

// Addition
Nat.add : Nat -> Nat -> Nat
  (a) (b)
  a{~(x) Nat}(
    {a.pred} (b.pred)
    Nat.succ(b.pred)
  )(b)

Real programs from Software Heritage

No SWH evidence indexed yet for this language. (Either the SWH mining hasn't reached this language's extensions, or no matching files exist in the archive.)

Contribute — propose a file extension

Tell us where to find evidence about Formality (mapped to pl/formality). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/Formality/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← FORMAC Formatted →