Aya
1 program
Added 2026-02-09T10:03:28Z
Agent: claude-codeModel: opusWebSearch: enabled
Evidence
Report issue
View issues
Aliases: Aya Prover
Provenance: commit 52b27e2107 · authored 2026-02-09T11:04:20+01:00 · agent claude-code · model opus
Sources mentioning this language
2 sources · pl_id:
pl/ayaRelated languages
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.)
Programs collected by LLM agents experimental · unverified
Gathered by LLM agents during the experiment that started this catalogue. They are not verified: the agent names an origin, but a program can be altered or invented — an audit found one attributed to a file that does not exist, in a syntax the language does not have. Prefer the programs archived by Software Heritage above. The catalogue's goal is the languages themselves, grounded in sources (PLDB, Wikipedia, Rosetta Code, …), with real archived programs; these examples may be dropped.
Red-Black Tree Sort
Provenance: commit 52b27e2107 · authored 2026-02-09T11:04:20+01:00 · agent claude-code · model opus · WebSearch enabled
open inductive Nat | O | S Nat
open inductive Bool | True | False
open inductive List Type
| []
| A => infixr :> A (List A)
def isZero (a : Nat) : Bool
| 0 => True
| _ => False
open inductive Color | red | black
def Decider (A : Type) => Fn (x y : A) -> Bool
variable A : Type
open inductive RBTree (A : Type) : Type
| rbLeaf
| rbNode Color (RBTree A) A (RBTree A)
def rbTreeToList (rb : RBTree A) (r : List A) : List A elim rb
| rbLeaf => r
| rbNode x t1 a t2 => rbTreeToList t1 (a :> rbTreeToList t2 r)
def repaint (RBTree A) : RBTree A
| rbNode c l a r => rbNode black l a r
| rbLeaf => rbLeaf
def sub (x y : Nat) : Nat
| n, 0 => n
| 0, S _ => 0
| S n, S m => sub n m
def le (x y : Nat) => isZero (sub x y)
def balanceLeft Color (RBTree A) A (RBTree A) : RBTree A
| black, rbNode red (rbNode red a x b) y c, v, r =>
rbNode red (rbNode black a x b) y (rbNode black c v r)
| black, rbNode red a x (rbNode red b y c), v, r =>
rbNode red (rbNode black a x b) y (rbNode black c v r)
| c, a, v, r => rbNode c a v r
def balanceRight Color (RBTree A) A (RBTree A) : RBTree A
| black, l, v, rbNode red (rbNode red b y c) z d =>
rbNode red (rbNode black l v b) y (rbNode black c z d)
| black, l, v, rbNode red b y (rbNode red c z d) =>
rbNode red (rbNode black l v b) y (rbNode black c z d)
| c, l, v, b => rbNode c l v b
def insert (a : A) (node : RBTree A) (dec_le : Decider A) : RBTree A elim node
| rbLeaf => rbNode red rbLeaf a rbLeaf
| rbNode c l1 a1 l2 => match dec_le a1 a
{ True => balanceRight c l1 a1 (insert a l2 dec_le)
| False => balanceLeft c (insert a l1 dec_le) a1 l2
}
private def aux (ls : List A) (r : RBTree A) (dec_le : Decider A) : RBTree A elim ls
| [] => r
| a :> l => aux l (repaint (insert a r dec_le)) dec_le
def tree_sort (dec_le : Decider A) (l : List A) => rbTreeToList (aux l rbLeaf dec_le) []
def tree_sortNat (l : List Nat) => tree_sort le l