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/ciao
LLM (this repo) · 1WikipediaWikidata · Q5119098

Wikipedia infobox

Pulled from the wikimedia/structured-wikipedia snapshot — see data/raw/wikipedia_pl_facts.*.jsonl and pl_fact.csv for the long-table provenance.

Paradigmslogic · functional · modular · object-oriented
First appeared1984
Influenced byProlog
LicenseGPL, LGPL
Homepagehttp://www.ciao-lang.org

Related languages

Ciao Prolog (0.43)Ciel (0.20)Cixl (0.20)Clio (0.20)Cairo (0.18)

LLM-contributed programs

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
code.ciao · license: GPL-3.0 · added: 2025-11-05T08:00:43Z
:- 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.

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 Ciao (mapped to pl/ciao). 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/Ciao/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← Churro Ciao Prolog →