Repository navigation
Glossary
This glossary defines common terms used throughout Curlee’s codebase, tests, and documentation.
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.stdoutcapability. - A future Python interop surface would require a dedicated
python.fficapability.
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).
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).
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.
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.curleeis a fixture that intentionally fails verification, used to assert the exact diagnostic output.
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
1inreturn 1 + true;, the span corresponds to the byte range covering just that character (and is later rendered as a line/column range).
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 likeline 3, col 5..10(and underline that exact range).
Curlee’s function contract clauses:
-
requires: a precondition that must hold at each call site. -
ensures: a postcondition that must hold at eachreturn.
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;
}
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.
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.
Two related workflows:
-
MVP-check:
curlee checkruns the static pipeline and verification (lex → parse → resolve → types → Z3). It produces diagnostics and never executes. -
MVP-run:
curlee runfirst runscheck; only if verification succeeds does it execute the program (on the deterministic, fuel-bounded VM).
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.
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).
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.