trealla(1)
π
trealla β a compact, efficient Prolog interpreter (manual page trealla(1), bestie)
okay so welcome to the trealla glow-up, aka the trealla(1) page from the User Commands girlies. you already know the command's trealla, and its little nickname is tpl. both are valid, both are iconic. let's get into it β¨
πΈ NAME πΈ
trealla, tpl β a compact, efficient Prolog interpreter. that's literally the whole vibe. small, fast, does Prolog. slay.
π¦ SYNOPSIS π¦
tpl [options] [files] [-- args]
that's it. that's the whole shape of it. options, then files, then everything after the -- is... args. iykyk.
β¨ DESCRIPTION β¨
so Trealla Prolog is a compact, efficient Prolog interpreter β and yes, it has ISO Prolog aspirations, which is such a mood honestly. you can use it to run Prolog scripts, or you can just vibe in the interactive Read-Eval-Print Loop (that's the REPL, bestie).
here's the part where it eats: it supports unbounded integers and rationals, UTF-8 atoms, and it comes with a rich standard library. like, rich rich. we're talking an FFI (Foreign Function Interface), concurrency, and database access. not me getting emotional over a standard library π
π OPTIONS π
okay this is the part where you take notes, because every single flag matters:
-O0,--nooptβ turns optimization off. like, off off. you're on your own now.-f fileβ load the specified file. and heads up: with-f, the~/.tplrcfile is not loaded. snip snip βοΈ-l fileβ load the specified file, but this time~/.tplrcis loaded. cosy.-g goalβ query the specified goal. this one's a one-and-done: it's only used once.--library pathβ point it at an alternative library path. this overrides theTPL_LIBRARY_PATHenvironment variable (rude, but okay).-t,--traceβ enable trace mode. here's your magnifying glass π-q,--quietβ quiet mode. suppresses the startup banner. no fanfare, no confetti, just results.-v,--versionβ displays the Trealla version. go check what you're running.-h,--helpβ displays the help message. baby's first flag π«Ά-d,--daemonizeβ run the process as a daemon. it's giving main character energy in the background.-w,--watchdogβ creates a watchdog process. someone's watching. protector energy.--autofailβ makes toplevel queries automatically fail after the first solution. one answer and we're done, periodt.--consultβ consults (loads) Prolog source from standard input (STDIN). type it straight in.
π FILES π
~/.tplrcβ the user startup file. it gets consulted when the REPL starts, unless you used the-foption. so-fmeans no.tplrc, remember that, it's on the test.
π ENVIRONMENT π
TPL_LIBRARY_PATHβ you can set this to tell Trealla where to look for its library files. that's the whole job. that's what it does.
β EXIT STATUS β
tpl exits with a status of 0 on success, and with a non-zero value if an error occurs. and if you want a specific status code, the halt/1 predicate is your girl β she'll exit with whatever code you hand her. π
π EXAMPLES π
start the interactive REPL:
$ tpl
?- write('Hello, World!'), nl.
Hello, World!
true.
?- halt.
look at that. hello, world. we all start somewhere π₯Ή
run a script file:
$ tpl my_script.pl
execute a query from the command line and exit:
$ tpl -g "member(3, [1,2,3]), halt."
one-liner queen behaviour, honestly π
π§ AUTHOR π§
written by Andrew Davison and contributors. project page: https://github.com/trealla-prolog/trealla β go say hi, star the repo, be nice π«Ά
π SEE ALSO π
swi-prolog(1)gprolog(1)
go look at the neighbours, they're cool too.
ok that's the whole page, no cap. every flag, every file, every variable, every example β all here. you're welcome π
and that's a wrap, bestie β this was Trealla Prolog, dated January 2026, page trealla(1) on User Commands. mwah πβ¨
π¦ where this page comes from
- nixpkgs unstable: trealla 3.13.13
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms