Skip to main content

Module control

Module control 

Source
Expand description

Query-level control constructs and deterministic builtins.

Clause bodies compile control flow to native code; this module only serves goals built at RUNTIME — the --query string today, call/1 metacalls in M4. It walks goal TERMS, never clauses (the rule in docs/design/LESSONS_FROM_V1.md stays intact).

The implementations mirror the compiled lowering exactly (same choice-point shapes, same commit heights), so a goal behaves identically whether it appears in a clause body or a query.

Functions§

plg_rt_b_catch_3
Safety
plg_rt_b_findall_3
Safety
plg_rt_b_throw_1
Safety
plg_rt_metacall
Compiled-code entries for control builtins taking goal terms.
plg_rt_pred_between_3
Compiled-code entry for between/3 (uniform predicate signature, arguments in the A registers — dispatched like a user predicate).
try_atom_builtin
Atom-only goals (true, fail, !).
try_builtin
Try to handle name/arity as a control construct or deterministic builtin. Returns None when it’s an ordinary predicate call.