Flowlog CLI and REPL (flowlog.c)

This document describes the Flowlog command-line interface and REPL behavior for the binary built from flowlog.c.

The Flowlog binary is:

CLI usage

Show help:

./flowlog --help

Show version:

./flowlog --version

Interactive REPL (default)

Empty program:

./flowlog

Load a program and enter REPL:

./flowlog program.pl

You can also use the explicit file flag:

./flowlog -f program.pl

Run a one-shot query

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

Query against an empty program:

./flowlog -g "goal."

Thread count

Override the worker-thread count:

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

Aliases accepted by the binary:

Engine selection

Select the execution engine:

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

Values:

If wam or wamvm is requested but Flowlog falls back to the interpreter, it prints a warning to stderr by default. Disable this warning with:

To ensure the wamvm engine does not fall back to the WAM-lite solver for unsupported programs/queries, set:

You can also introspect which engine actually ran a query:

?- current_prolog_flag(flowlog_engine_active, Engine).

Parallel profile

Select a parallelism profile (equivalent to set_prolog_flag(flowlog_parallel_profile, ...)):

./flowlog --parallel-profile fast program.pl -g "goal."

Values:

Defaults (unless your program overrides flags with :- set_prolog_flag/2 directives):

REPL behavior

Prompts and non-interactive mode

Meta-commands

The REPL supports a small set of meta-commands (single-line, no trailing . required):

And the ISO-style “regular” commands:

Loading code interactively

The REPL supports the common Prolog top-level convenience:

Use one of:

Output format

Flowlog prints output in a stable, test-friendly format:

Environment variables

History

Parallelism tuning

Debugging OR-par

Exit codes