Skip to main content

Module protocol

Module protocol 

Source
Expand description

.aclp — ACL protocol programs (spec §33).

A protocol program turns the conversation itself into source code: roles, session state, and handlers keyed on speech acts. The compile step enforces the dialogue matrix (§16) at BUILD time — a program that answers query with request does not compile.

Structs§

CapabilityDecl
§35.6: capability declaration — the ONLY door to external effects.
Function
§38.1: a user-defined function — pure computation over parameters and session state; parameters and locals are function-scoped.
Handler
ProtocolProgram
Retry
§35.5: retry policy on sends — declarative, driven by the runtime’s own deterministic timers (no clock).
Scenario
§35.12: scenario — an executable test inside the .aclp file.
StateDecl

Enums§

BinOp
EndWhen
Expr
§35: expression language for set — pure functions over session state and the triggering event’s fields. No I/O, no clock: the only effects a program can cause are speech acts (§35.6).
Guard
§34: guard — boolean expression over session states, evaluated at dispatch time. quoted, not quoted, a and b, a or b.
OnTrigger
What fires a handler.
ProtocolAction
What a handler does. Phase 1: the speech-act statement set.
ScenarioStep

Functions§

all_actions
§48: flatten NESTED actions (for bodies, try bodies and catches) — compile-time checks must cover them, not only top-level actions
check
Compile-time well-formedness — the dialogue matrix (§16) applied to the PROGRAM, not the runtime. Returns warnings; errors abort compilation.
handler_sig
§42: a handler’s override signature — trigger word + pattern + from + guard
parse
parse_guard
parse a and not b or c — precedence: not > and > or (left-assoc)
parse_with_includes
§35.13: parse with include "file" with roles (a=X, b=Y); support — the include is loaded relative to base_dir, roles renamed whole-word, and spliced in place of the include line.
pretty
static_ty
§38.6: static type of an expression — Some only when statically known (“int” | “float” | “str” | “bool” | declared record type name).