Skip to content

Glossary

Joe Curlee (w4ffl35) edited this page Feb 5, 2026 · 4 revisions

Glossary

This glossary defines common terms used throughout Curlee’s codebase, tests, and documentation.

Capability

A capability is an explicit, unforgeable permission token that authorizes a specific effect (like stdout I/O).

Curlee’s model is no ambient authority: user code can’t access I/O, filesystem, or network unless the host/runner explicitly provides the required capability value.

Examples:

  • A program can only print if it is given an io.stdout capability.
  • A future Python interop surface would require a dedicated python.ffi capability.

Determinism

A property that the same inputs produce the same outputs.

In Curlee this is a hard requirement for verification and execution:

  • The verifier should produce stable, repeatable results.
  • The VM should behave deterministically (including failure modes).

Fuel

A fixed budget of “execution steps” (an instruction count budget) given to the VM.

  • Each executed instruction consumes fuel.
  • When fuel reaches zero, execution halts with a deterministic error (prevents runaway programs).

Golden test / golden file

A test technique where the expected output is stored in a checked-in “golden” file, and the test fails if the program output differs.

Curlee uses golden tests primarily for diagnostics, to ensure error messages, spans, and models remain stable and user-friendly.

Fixture

A small input program (usually under tests/fixtures/) used by tests.

Fixtures are meant to be minimal and focused (one behavior per file when possible).

Example:

  • tests/fixtures/check_requires_divide.curlee is a fixture that intentionally fails verification, used to assert the exact diagnostic output.

Span

A source location represented as byte offsets [start, end) into a source file.

Spans are used to:

  • pinpoint diagnostics precisely
  • map runtime failures back to the source (via opcode span mapping)

Example:

  • If a diagnostic highlights the 1 in return 1 + true;, the span corresponds to the byte range covering just that character (and is later rendered as a line/column range).

Line map

A helper structure that converts byte offsets (spans) into human-readable line/column positions for diagnostics rendering.

Example:

  • Given a span like [42, 47) in a file, the line map is what lets Curlee render something like line 3, col 5..10 (and underline that exact range).

Requires / ensures

Curlee’s function contract clauses:

  • requires: a precondition that must hold at each call site.
  • ensures: a postcondition that must hold at each return.

If Curlee cannot prove a clause within the supported verification fragment, it rejects the program.

Example:

fn divide(n: Int, d: Int) -> Int

  requires d != 0
  ensures result * d == n
{
  return n / d;
}

Refinement (where)

A constraint attached to a variable or parameter, treated as an additional logical fact during verification.

Example: x: Int where x > 0 allows the verifier to assume x > 0 while x is in scope.

Model / counterexample

When a proof obligation fails, the solver can often produce a model: concrete values for relevant variables that demonstrate the obligation can be violated.

Curlee surfaces a small model in diagnostics to make failures actionable.

MVP-check vs MVP-run

Two related workflows:

  • MVP-check: curlee check runs the static pipeline and verification (lex → parse → resolve → types → Z3). It produces diagnostics and never executes.
  • MVP-run: curlee run first runs check; only if verification succeeds does it execute the program (on the deterministic, fuel-bounded VM).

Bundle / manifest

A bundle is a portable artifact combining bytecode plus metadata.

The manifest is the metadata portion, which can include:

  • the bytecode hash
  • required capabilities
  • pinned imports
  • optional proof/claim identifiers

The loader treats the manifest as authoritative and re-checks it before execution.

Token

A small, structured unit of text produced by the lexer.

Tokens are the bridge between raw source text and the parser: the lexer reads characters and emits tokens like identifiers, keywords, literals, punctuation, and operators.

Example:

  • The source return x + 1; lexes into tokens like: return (keyword), x (identifier), + (operator), 1 (integer literal), ; (punctuation).

VM

Short for virtual machine.

In Curlee, the VM is a deterministic bytecode interpreter that executes only after curlee check succeeds. Execution is resource-bounded using fuel.

Clone this wiki locally