Ciao
1 program
Added 2025-11-05T08:00:43Z
Model: google/gemini-2.5-proTemp: 0.4
Evidence
Report issue
View issues
Aliases: —
Provenance: commit b06770f3b3 · authored 2025-11-05T09:00:43+01:00 · model google/gemini-2.5-pro
Sources mentioning this language
3 sources · pl_id:
pl/ciaoWikipedia infobox ↗
Pulled from the
wikimedia/structured-wikipedia
snapshot — see data/raw/wikipedia_pl_facts.*.jsonl and
pl_fact.csv for the long-table provenance.
| Paradigms | logic · functional · modular · object-oriented |
|---|---|
| First appeared | 1984 |
| Influenced by | Prolog |
| License | GPL, LGPL |
| Homepage | http://www.ciao-lang.org |
Related 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.
Towers of Hanoi puzzle solver
Provenance: commit b06770f3b3 · authored 2025-11-05T09:00:43+01:00 · model google/gemini-2.5-pro · Temp 0.4
:- module(hanoi, [hanoi/0, hanoi/1], [classic, assertions]).
:- comment(title, "The classical ``Towers of Hanoi'' puzzle").
:- comment(author, "The Ciao/Prolog documentation system processor").
:- comment(summary, "This program writes to the standard output a sequence of
moves to solve the ``Towers of Hanoi'' puzzle for a given number of
disks.").
:- comment(module, "This is a very simple program which is self-documented
and also includes some checking assertions. It is included as a demo of
the Ciao assertion language and preprocessor, and of the Ciao
documentation generator.").
:- pred hanoi/0.
hanoi :-
hanoi(5).
:- pred hanoi(N) : int(N) => true.
hanoi(N) :-
move(N, left, center, right).
:- pred move(N, A, B, C) : (int(N), pole(A), pole(B), pole(C)) => true
# "Move @var{N} disks from pole @var{A} to pole @var{B} using
@var{C} as auxiliary.".
move(0, _, _, _) :- !.
move(N, A, B, C) :-
N > 0,
M is N - 1,
move(M, A, C, B),
inform_user(A, B),
move(M, C, B, A).
:- pred inform_user(A, B) : (pole(A), pole(B)) => true
# "Inform the user of a move from pole @var{A} to pole @var{B}.".
inform_user(A, B) :-
display('Move a disk from '),
display(A),
display(' to '),
display(B),
nl.
:- type pole ---> left ; center ; right.