WhyML

1 program Added 2026-02-24T10:00:00Z Agent: claude-codeModel: claude-sonnet-4-6WebSearch: enabled Evidence Report issue View issues
Aliases: Why3ML
Provenance: commit 33fd3e58a1 · authored 2026-02-24T12:05:29+01:00 · agent claude-code · model claude-sonnet-4-6

Sources mentioning this language

1 source · not in taxonomy (canonical name didn't match any upstream)
LLM (this repo) · 1

Related languages

Why3 (0.31)Whirl (0.20)TinyML (0.19)PolyML (0.15)WebL (0.13)

LLM-contributed programs

GCD (Euclidean Algorithm)

Provenance: commit 33fd3e58a1 · authored 2026-02-24T12:05:29+01:00 · agent claude-code · model claude-sonnet-4-6 · WebSearch enabled
code.mlw · license: LGPL-2.1 · added: 2026-02-24T10:00:00Z
(* Greatest common divisor, using the Euclidean algorithm *)

module EuclideanAlgorithm

 use import mach.int.Int
 use import number.Gcd

 let rec euclid (u v: int) : int
 variant { v }
 requires { u >= 0 /\ v >= 0 }
 ensures { result = gcd u v }
 =
 if v = 0 then
   u
 else
   euclid v (u % v)

end

module EuclideanAlgorithmIterative

 use import mach.int.Int
 use import ref.Ref
 use import number.Gcd

 let euclid (u0 v0: int) : int
 requires { u0 >= 0 /\ v0 >= 0 }
 ensures { result = gcd u0 v0 }
 =
 let u = ref u0 in
 let v = ref v0 in
 while !v <> 0 do
   invariant { !u >= 0 /\ !v >= 0 }
   invariant { gcd !u !v = gcd u0 v0 }
   variant { !v }
   let tmp = !v in
   v := !u % !v;
   u := tmp
 done;
 !u

end

Contribute — propose a file extension

Tell us where to find evidence about WhyML (mapped to pl/whyml). 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/WhyML/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← Whyfuck Whyn →