flowlog.c)This guide focuses on developing Flowlog in flowlog.c.
make
./flowlogDirect compilation is also supported:
cc -O2 -Wall -Wextra -pthread flowlog.c -lm -o flowlogCompile-time depth defaults live in SECTION 01 of flowlog.c:
FLOWLOG_DEPTH_LIMIT=0 (unlimited)FLOWLOG_SOLVE_DEPTH_LIMIT=0 (unlimited)FLOWLOG_TRACE_MAX_DEPTH=0 (trace storage depth cap;
0 means unlimited)Compile-time parallel/indexing tuning defaults in SUBSECTION 01.2 and
SUBSECTION 01.4 were validated with
./bench/compare_nqueens.sh 13 on a 128-core server:
flowlog_parallel_max_depth now auto-tunes when not
explicitly set:
--threads, FLOWLOG_N_CPUPROC, or
auto-detect): max(24, 3 * threads), capped by
FLOWLOG_DEFAULT_PARALLEL_MAX_DEPTH.--threads 8, this resolves to 24; on
high-core hosts it scales up to the cap.FLOWLOG_DEFAULT_PARALLEL_MAX_DEPTH therefore acts as
the compile-time cap (default 128).Override example:
cc -O2 -Wall -Wextra -pthread \
-DFLOWLOG_DEPTH_LIMIT=4096 \
-DFLOWLOG_SOLVE_DEPTH_LIMIT=200000 \
flowlog.c -lm -o flowlogRun the regression suite and INRIA ISO suite from this directory:
make test
make inriaRun the Quad conformance tests (QUAD - Query Using Answer Description):
make quad
make quad-wam
make quad-wamvm
make quad-tpl
make quad-scryer
# Run a single quad file
make quad tests/predicates/assertz_quad.plTo ensure the bytecode VM (flowlog_engine=wamvm) runs
the ISO suite without falling back to wam,
run:
make inria-wamvm-vmonlyflowlog.c - the entire
runtime (single-file build)Makefile - minimal build
rules for the binarytests/ - regressions and ISO
suite runnersREADME.md and
*.md - user and developer documentationIn the full repository checkout, benchmark scripts live under ../bench/.
Flowlog uses SECTION NN and SUBSECTION NN.N
headings inside flowlog.c.
Documentation references these headings so you can jump directly to the
implementation.
Sections (in file order):
Most ISO predicates are implemented as built-ins in the solver’s goal dispatcher.
Suggested workflow:
flowlog.c (SECTIONS 22/23/24)tests/Even though flowlog.c is a
single file, it helps to keep structure consistent:
#if 0 only temporarily.Enable OR-par logging:
FLOWLOG_DEBUG_ORPAR=all FLOWLOG_DEBUG_ORPAR_LOG=orpar.log \
./flowlog -g "goal." program.plFor CPU-bound problems, perf (Linux) or
pmcstat (FreeBSD) can help identify hot paths in:
The REPL uses termios raw mode when running on a TTY. If
a crash leaves your terminal in a bad state, run:
reset