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.plLoad multiple files (RC file first):
./flowlog program1.pl program2.plFast startup (skip RC file):
./flowlog -f
./flowlog --fast./flowlog -g "goal." program.plNotes:
. (ISO style).~/.flowlogrc (override via
FLOWLOG_RC_FILE).current_prolog_flag(argv, A) as a list of strings.current_prolog_flag(argv, A) resolves by calling source
file during predicate execution; at top level it shows the default
segment (first positional file, or []).SPACE/;/n (next 5),
a (stream all), w/x (print full
saved answers), and Enter/. (stop with ...).
In non-TTY mode it prints all solutions (SECTION 26).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].)expand. - print full saved answers from the previous
querysolutions(X). - replay saved answers one-by-one[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-F (cursor movement)Ctrl-U / Ctrl-K, Backspace/DeleteCtrl-X is a REPL shortcut for printing full saved
answers from the previous query, while keeping the current input
line.When 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) (SECTION 25 and SECTION
21).
?- Goal.Thread count:
--threads N or
FLOWLOG_N_CPUPROC=N (SUBSECTION 26.1 and SUBSECTION
04.2).If you need classic ordered behavior, run with:
--parallel-profile iso (parallel, ordered commits)
(SUBSECTION 26.1), or--parallel-profile off (sequential) (SUBSECTION
26.1)See PARALLELISM.md for
semantics and tuning.
Flowlog defaults to --engine wamvm (SECTION 25).
To force the WAM-lite engine (useful for tabling workloads) (SECTION 23 and SECTION 20):
./flowlog --engine wam -g "goal." program.plTo force the reference interpreter (SECTION 22):
./flowlog --engine tree -g "goal." program.plIf you have the full Flowlog repository checkout, see CONFORMANCE.md for the
recommended ISO/regression test suites and where to run them from.