Flowlog Quick Start (flowlog.c)

This quick start covers Flowlog built from flowlog.c.

Build

Build with the Makefile in the parent directory:

make

Or build directly with a C compiler:

cc -O2 -Wall -Wextra -pthread flowlog.c -lm -o flowlog

Run

REPL (interactive)

Start the REPL with an empty [user] program:

./flowlog

Start the REPL with a program loaded:

./flowlog program.pl

Run a one-shot query

./flowlog program.pl -g "goal."

Notes:

REPL commands

At the ?- prompt:

Notes:

Line editing and history (TTY)

When stdin/stdout are a real terminal (TTY), the REPL enables:

When not a TTY (pipes, redirected input), prompts and banners are suppressed and Flowlog reads from stdin line-by-line.

Defining predicates at runtime

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.

Parallelism (default)

Flowlog runs queries with the fast parallel profile by default (unordered OR-par for throughput).

?- Goal.

Thread count:

If you need classic ordered behavior, run with:

See PARALLELISM.md for semantics and tuning.

Engine selection (optional)

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."

Tests

If you have the full Flowlog repository checkout, see CONFORMANCE.md for the recommended ISO/regression test suites and where to run them from.