trealla(1)

πŸ“¦ version 3.13.13, in nixpkgs unstable

πŸ’… 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 ~/.tplrc file is not loaded. snip snip βœ‚οΈ
  • -l file β€” load the specified file, but this time ~/.tplrc is 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 the TPL_LIBRARY_PATH environment 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 -f option. so -f means 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 πŸ‘‘

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