flowlog.c)This quick start covers Flowlog built from flowlog.c.
Build with the Makefile in the
parent directory:
makeOr build directly with a C compiler:
cc -O2 -Wall -Wextra -pthread flowlog.c -lm -o flowlogStart the REPL with an empty [user] program:
./flowlogStart the REPL with a program loaded:
./flowlog program.pl./flowlog program.pl -g "goal."Notes:
. (ISO style).; prompt).At the ?- prompt:
help. — show help texthalt. / quit. — exit:load path/to/file.pl — load a program file (replaces
the current program):reload — reload the last loaded program (file or
[file].)[file]. — load a program file (consult-style top-level
convenience)Notes:
.).[file]. is a top-level convenience commonly supported
by other Prolog systems; in Flowlog it loads one or more source files
and replaces the currently loaded program (similar to
:load).When stdin/stdout are a real terminal (TTY), the REPL enables:
~/.flowlog_history, override with
FLOWLOG_HISTORY_FILE)Ctrl-P / Ctrl-N (previous/next
history)Ctrl-A / Ctrl-E, Ctrl-B /
Ctrl-FCtrl-U / Ctrl-K, Backspace/DeleteWhen not a TTY (pipes, redirected input), prompts and banners are suppressed and Flowlog reads from stdin line-by-line.
The portable way to define or extend predicates interactively is to use the ISO dynamic database:
?- assertz((parent(alice, bob))),
assertz((parent(bob, claire))),
assertz((ancestor(A, B) :- parent(A, B))).In practice, most programs are written in .pl files and
loaded with :load (REPL) or by passing the file name on the
command line.
Flowlog runs queries with the fast parallel profile by
default (unordered OR-par for throughput).
?- Goal.Thread count:
--threads N or
FLOWLOG_N_CPUPROC=N.If you need classic ordered behavior, run with:
--parallel-profile iso (parallel, ordered commits),
or--parallel-profile off (sequential)See PARALLELISM.md for
semantics and tuning.
Flowlog defaults to --engine wamvm.
To force the WAM-lite engine (useful for tabling workloads):
./flowlog --engine wam program.pl -g "goal."To force the reference interpreter:
./flowlog --engine tree program.pl -g "goal."If you have the full Flowlog repository checkout, see CONFORMANCE.md for the
recommended ISO/regression test suites and where to run them from.