FGHC

1 program Added 2026-03-12T00:00:00Z Agent: claude-codeModel: claude-sonnet-4-6WebSearch: disabled Evidence Report issue View issues
Aliases: Flat Guarded Horn Clauses, Flat GHC
Provenance: commit 0baa3afc8d · authored 2026-03-12T09:24:10+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

Guarded Horn Clauses (0.83)Fleng (0.65)GHC (0.62)FlatZinc (0.17)GCL (0.12)

LLM-contributed programs

Sieve of Eratosthenes

Provenance: commit 0baa3afc8d · authored 2026-03-12T09:24:10+01:00 · agent claude-code · model claude-sonnet-4-6 · WebSearch disabled
code.ghc · added: 2026-03-12T00:00:00Z
% Sieve of Eratosthenes in FGHC (Flat Guarded Horn Clauses)
% Demonstrates stream-based concurrent logic programming

sieve([P|Xs], [P|Ps]) :- true | filter(P, Xs, Ys), sieve(Ys, Ps).

filter(_, [], []) :- true | true.
filter(P, [X|Xs], Ys) :- X mod P =:= 0 | filter(P, Xs, Ys).
filter(P, [X|Xs], [X|Ys]) :- X mod P =\= 0 | filter(P, Xs, Ys).

integers(N, [N|Ns]) :- true | N1 is N + 1, integers(N1, Ns).

take(0, _, []) :- true | true.
take(N, [X|Xs], [X|Ys]) :- N > 0 | N1 is N - 1, take(N1, Xs, Ys).

main :- true | integers(2, Xs), sieve(Xs, Ps), take(10, Ps, First10), write(First10), nl.

Contribute — propose a file extension

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