Skip to main content

Attribute Registry

All standard attributes, organised by purpose. Each row lists the attribute, its valid targets, and a one-line semantics.

Derive

AttributeTargetsSemantics
@derive(Clone)typegenerate Clone impl
@derive(Copy)typemark as Copy (requires all fields Copy)
@derive(Debug)typegenerate Debug.debug
@derive(Display)typegenerate Display.format
@derive(Eq, PartialEq)typegenerate equality
@derive(Ord, PartialOrd)typegenerate ordering (lexical)
@derive(Hash)typegenerate Hash
@derive(Default)typegenerate Default (fields must impl Default)
@derive(Serialize)typegenerate serialisation
@derive(Deserialize)typegenerate deserialisation
@derive(Builder)typegenerate fluent builder
@derive(Error)typegenerate Error impl with Display delegation
@derive(From<T>)typegenerate From<T> conversion (one-field newtypes)
@derive(Into<T>)typedual of From<T>

Layout

AttributeTargetsSemantics
@repr(C)typeC-compatible layout, no reordering
@repr(transparent)type (one field)identical layout to inner
@repr(align(N))typeforce alignment to N
@repr(packed)typeno padding between fields
@repr(u8/u16/u32/u64)variantsum-type discriminant size

Verification

The @verify attribute takes a semantic strategy — the underlying solver (single adapter, portfolio, …) is an implementation detail picked by the capability router. Strategies are arranged on a strictly monotone ν-ordinal ladder; see verification → gradual verification for the full ladder and its operational semantics.

The complete set admitted by the grammar:

AttributeTargetsν-ordinalSemantics
@verify(runtime)fn, type0runtime assertion check only; no formal proof
@verify(static)fn, type1static type-level verification only
@verify(fast)fn, type2optimise for fast verification (capability router with reduced timeout); may sacrifice completeness on hard goals
@verify(complexity_typed)fn, type< ω (n)bounded-arithmetic verification (V₀ / V₁ / S¹₂ / V_NP / V_PH / IΔ₀); polynomial-time; CI budget ≤ 30 s. Use for crypto protocols, real-time, embedded
@verify(formal)fn, typeωfull SMT verification with the default strategy (recommended production default)
@verify(proof)fn, typeω + 1user-supplied tactic block; kernel rechecks. Dominates SMT and admits induction. Use for theorems / foundational lemmas
@verify(thorough)fn, typeω · 2maximum completeness; portfolio race with extended timeout; mandatory decreases / invariant / frame
@verify(reliable)fn, typeω · 2 + 1thorough + cross-solver agreement: two independent solver adapters must both return UNSAT; any disagreement → UNKNOWN
@verify(certified)fn, typeω · 2 + 2reliable + certificate materialisation, kernel re-check, multi-format export — required for .verum-cert export (Coq / Lean / Dedukti / Metamath)
@verify(coherent_static)fn, typeω · 2 + 3weak operational coherence — α-cert + symbolic ε-claim; polynomial in |P|·|φ|; CI ≤ 60 s
@verify(coherent_runtime)fn, typeω · 2 + 4hybrid operational coherence — α-cert + runtime ε-monitor; trace-bounded; CI ≤ 5 min
@verify(coherent)fn, typeω · 2 + 5strict operational coherence — α/ε bidirectional check; single-exponential; CI ≤ 30 min. Use for critical-safety code requiring full operational coherence
@verify(synthesize)fn, type≤ ω · 3 + 1synthesis mode — generate a term satisfying the spec rather than checking it; capability router dispatches to a synthesis-capable adapter (SyGuS-based)
@verify(assume)fn, typeescape hatch — trust the programmer; no verification is performed. Off-ladder; use only when the obligation is established by means outside the verification pipeline (manual review, external tooling, foundational axiom). Audit-tracked via verum audit --assumptions
@framework(name, "citation")axiom, theorem, lemmaMark a statement as a trusted axiom borrowed from an external framework. name is the framework identifier (identifier syntax); the string is a human-readable citation (paper / URL / section). Surfaced by verum audit --framework-axioms for supply-chain review.

Multiple strategies may be chained (@verify([proof, static, runtime])) to express a verification fallback chain — the first successful strategy wins; later strategies serve as a safety net for obligations the earlier strategies couldn't discharge. Chains are written left-to-most-trusted; the kernel-side strategy ladder enforces strict monotonicity, so @verify([runtime, proof]) is rejected as an ill-formed chain (the runtime fallback can never strengthen a proof).

Safety

AttributeTargetsSemantics
@trustedfnmark function as verified-safe despite unsafe ops (audit-tracked)
@unsafe_fnfnmark function as requiring an unsafe context
@must_usefn, type, paramwarn if return value is unused
@unreachablematch arm, exprdocument that this code path is unreachable
@deterministic_fpfnbit-for-bit reproducible floating-point semantics. Locks round-mode to round-to-nearest-even; forbids FMA contraction (codegen emits separate mul+add even on FMA-capable targets); restricts libm calls to core.math.ieee754_deterministic (CORE-MATH-derived correctly-rounded transcendentals). Default warn-on-non-determ-callee (eases incremental adoption).
@deterministic_fp(strict)fnstrict mode: any call to a non-deterministic-fp function is a compile-time error rather than a warning. Required for consensus paths, CPTP-step Lindbladian dynamics, STARK trace generation.

Note: pure-function status uses the pure fn keyword form in the function signature (checked by verum_types::computational_properties as a 0 ns compile-time property), not an attribute. See language → attributes for the canonical syntax.

Program extraction

@extract* attributes mark constructive proofs and theorems for program extraction by verum extract: the emitted file contains the function's computational content in the chosen target language. This is distinct from verum export, which emits proof certificates for re-checking by an external prover.

Argument grammar

extract_attr_call = "(" extract_args? ")"
extract_args = ( extract_target | realize_kwarg )
| extract_target "," realize_kwarg
extract_target = "verum" | "ocaml" | "lean" | "coq"
realize_kwarg = "realize" "=" string_literal

The realize= kwarg short-circuits the body-synthesis path — the emitter generates a thin wrapper that delegates to the named native function. This preserves the verified surface signature while binding the extracted scaffold to a hand-written runtime primitive (crypto stub, intrinsic wrapper, foreign syscall).

Attribute table

AttributeTargetsSemantics
@extractfn, theorem, lemma, corollaryextract as a runnable program in the default target (verum).
@extract(<target>)sameextract into verum | ocaml | lean | coq.
@extract(realize="fn")samebind the verified surface to native function fn instead of synthesising. Default target = verum.
@extract(<target>, realize="fn")sameexplicit target + native binding combined.
@extract_witnesstheorememit only the existential witness from a constructive existence proof; the proof obligation is discharged in the Verum verification ladder, not re-emitted.
@extract_witness(<target>)theoremsame with explicit target.
@extract_witness(realize="fn")theoremwitness binding to a native function.
@extract_witness(<target>, realize="fn")theoremfull combination.
@extract_contractrefinement-typed fnpreserve the refinement as a runtime contract check in the extracted code.
@extract_contract(<target>)samewith explicit target.
@extract_contract(realize="fn")samecontract wrapper bound to a native primitive.
@extract_contract(<target>, realize="fn")samefull combination.

A single declaration can carry multiple @extract* attributes — each one emits a separate file in its target's directory.

Output paths

verum extract writes one file per (declaration, target) pair:

TargetPathRe-checkable by
verumextracted/<name>.vrverum check
ocamlextracted/<name>.mldune build / OCaml 5.x
leanextracted/<name>.leanlake build / Lean 4
coqextracted/<name>.vcoqc / Coq 8.x

Override the parent directory with verum extract --output <dir>.

Examples

// Default Verum extraction — re-checkable by `verum check`.
@extract
public theorem add_comm(a: Int, b: Int) -> Int { a + b }

// OCaml extraction with full body.
@extract(ocaml)
public fn double(n: Int) -> Int { n + n }

// Witness-only extraction (Coq).
@extract_witness(coq)
public theorem isqrt(n: Int { :: n >= 0 }) -> Int
where (Int { result :: result * result <= n })
{ ... }

// Contract-preserving extraction across an FFI boundary.
@extract_contract(ocaml)
public fn safe_divide(a: Int, b: Int { :: b != 0 }) -> Int { a / b }

// Bind a verified spec to a runtime intrinsic wrapper.
@extract(realize = "verum_runtime_x25519_scalar_mult")
public fn x25519(scalar: [Byte; 32], u: [Byte; 32]) -> [Byte; 32] { ... }

// Coq target + native binding combined.
@extract(coq, realize = "ext_decode")
public fn decode(input: List<Byte>) -> Result<Frame, Error> { ... }

// Multi-target deployment of one verified definition.
@extract(verum)
@extract(coq)
@extract(lean)
public theorem div_uniqueness(
a: Int,
b: Int { :: b != 0 }
) -> Int { a / b }

For the full guide — coverage matrix, audit trail, common pitfalls, build-pipeline integration — see Verification → Program extraction.

Project-wide defaults and per-module overrides live in the [verify] section of verum.toml — see reference → verum.toml.

FFI

AttributeTargetsSemantics
@extern("C")fn, extern blockC linkage
@extern("C", calling_convention = "X")fnoverride calling convention
@ownership(transfer_to = "caller" | "callee")ffi itemownership transfer at boundary
@ownership(borrow = [...])ffi itemparams are borrowed, not transferred

Target & dispatch

AttributeTargetsSemantics
@device(cpu)fnrun on CPU (default, usually implicit)
@device(gpu)fnroute through MLIR GPU pipeline — triggers VbcToMlirGpuLowering in Phase 7
@gpu.kernelfnmark as a GPU kernel (implies @device(gpu)) with kernel-launch semantics
@differentiablefnsynthesise a VJP companion in Phase 4a autodiff
@thread_localstaticper-thread storage
@nakedfnno prologue / epilogue (assembly trampolines only)
@intrinsic("name")fncompiler-provided primitive (forward decl)

Optimisation

Inlining

AttributeTargetsSemantics
@inlinefnsuggest inlining (compiler decides — equivalent to @inline(suggest))
@inline(always)fnforce inlining at every call site
@inline(never)fnforbid inlining (e.g. for cold error paths)
@inline(release)fninline only in release builds; treated as suggest in debug builds
@hotfnmark as hot path; bias optimisation / layout
@coldfnmark as cold path; bias away
@likelybranchbranch-prediction hint — taken-likely
@unlikelybranchbranch-prediction hint — taken-unlikely

Loops & vectorisation

AttributeTargetsSemantics
@unrollloopbare form requests full unrolling — equivalent to @unroll(full)
@unroll(N)loopunroll exactly N iterations
@unroll(full)loopfully unroll the loop
@no_unrollloopprevent loop unrolling
@vectorizeloopenable auto-vectorisation (default — equivalent to @vectorize(auto))
@vectorize(force)loopforce vectorisation; emit a diagnostic if the loop cannot vectorise
@simd(prefer)looptry vectorisation, fall back to scalar if it would be unsafe
@simd(never) / @no_vectorizeloopdisable vectorisation entirely
@vectorize(width: N)loopoptional width hint (e.g. 4, 8, 16); orthogonal to the mode
@no_aliasloopassert pointers in the loop body don't alias
@ivdeploopassert no inter-iteration data dependencies (Intel-style hint)
@parallelloopmark for auto-parallelisation
@reduce(op)loopdeclare a reduction operator (add / multiply / min / max / bitand / bitor / bitxor / and / or; the operator form + / * / & / `
@prefetch(read | write, locality: N)exprcache-prefetch hint; locality is 0–3 (0 = streaming / no temporal locality; 3 = high temporal locality)
@access_pattern(sequential | random | streaming)field, exprdeclare access pattern for layout / prefetch optimisations

Code generation

AttributeTargetsSemantics
@optimize(none | size | speed | balanced)fnoverride the global optimisation level for this function
@multiversionfnemit multiple versions for CPU feature dispatch
@cpu_dispatch(features)fnper-target-feature dispatch table
@target_cpu("name")fn, moduleforce a specific target CPU (e.g. "znver3", "apple-m1")
@target_feature("+f1,-f2")fnenable / disable specific CPU features
@black_boxfn, exproptimisation barrier — prevents constant folding through the value
@const_eval / @const_fold / @const_propfnforce compile-time evaluation / fold-with-optimisation / aggressive propagation respectively
@deterministic_fp / @deterministic_fp(strict)fnbit-for-bit reproducible floating-point semantics — see Safety

LTO & linkage

AttributeTargetsSemantics
@no_ltofn, moduleexclude from link-time optimisation
@lto(always)fn, moduleforce LTO even in debug builds
@lto(thin)fn, moduleuse Thin LTO for this unit
@visibility(hidden | default | protected)fn, staticsymbol visibility
@linkage(external | internal | private | weak | linkonce | linkonce_odr | common | available_externally)fn, staticfine-grained linkage. weak / linkonce* / common admit multiple definitions (linker-merged); the others require a single definition.
@weakfn, staticshorthand for @linkage(weak)
@nakedfnemit no prologue / epilogue (assembly-level control)
@usedfn, staticretain the symbol even if appears unreferenced
@no_returnfnfunction never returns (panics / aborts / loops forever)
@link_section("name")fn, staticplace into a named ELF / Mach-O / PE section
@no_manglefn, staticdisable name mangling
@link_name("name")fn, staticoverride the linker name

PGO (profile-guided optimisation)

AttributeTargetsSemantics
@profilefnmark for profiling (instrumentation pass collects counts)
@profile("name")fnprofile under a named bucket (segregate hot / cold reports)
@frequency(N)fnhand-supplied expected calls per second; the optimiser treats this as an oracle when no PGO data is available
@branch_probability(P)branchhand-supplied branch-taken probability (0.01.0)

Memory layout

AttributeTargetsSemantics
@align(N)type, fieldforce alignment to N bytes
@bit_offset(N) / @bits(N)bitfieldbit-level placement / width
@endian(little | big)type, fieldbyte-order for serialisation
@section(idx)staticplace in a non-default linker section index
@register_block / @register_offset(N)typememory-mapped I/O layout
@bitfieldtypedeclare a packed bitfield record

Tier discipline

AttributeTargetsSemantics
@vbc_direct_loweringfn (intrinsic)Intrinsic function lowers directly to a VBC opcode without a regular call frame. Used on time / CPU / sleep primitives in core/intrinsics/runtime/; users should not hand-apply this attribute.
@llvm_onlyfnfunction cannot run in the VBC interpreter (Tier 0). The compiler rejects --tier=interpret runs that reach this function.
@requires_runtimefndeclares a specific runtime feature dependency (e.g. async runtime, GPU dispatch); failure to provide produces a typed link-time diagnostic.

Testing

AttributeTargetsSemantics
@testfn (no args)register as a unit test; passes iff it returns without panicking
@propertyfn (typed params)property-based test — harness feeds N random inputs per invocation (default 100) and performs integrated shrinking on failure. See Tooling → Property testing.
@property(runs = N)fnoverride per-property iteration count (positive integer).
@property(seed = 0x…)fnpin a single deterministic seed — useful for CI and reproducing a specific failure.
@test_case(args…)fn (positional params)parametrise a test. Repeating the attribute expands the function into fn_name[0], fn_name[1], … Each case runs as a separate test entry. Args accept Int, Bool, Text, Float literals (and negated forms).
@ignore / @ignoredfnskip in normal runs. Surfaces in --format pretty with … ignored. Re-enable with --include-ignored (all) or --ignored (only ignored).
@benchfnregister as a benchmark — see Tooling → Benchmarking for the harness flags (--warm-up-time, --measurement-time, baselines, etc.).
@bench(group)fnassociate the bench with a named group (shown in the report and preserved in JSON/CSV output).
@fuzzfnregister as a fuzz target (VCS fuzz infra — distinct from PBT).

Conditional compilation

AttributeTargetsSemantics
@cfg(feature = "X")anyinclude if feature X is enabled
@cfg(target_os = "X")anyOS guard
@cfg(target_arch = "X")anyarchitecture guard
@cfg(debug_assertions)anydebug-only
@cfg(not(X)), @cfg(any(...)), @cfg(all(...))anycompose

Parameters & fields

AttributeTargetsSemantics
@unusedparamsilence unused-param warnings
@must_usefn, type, fieldwarn if result is discarded
@validate(min = X, max = Y)fieldderive a refinement
@validate(matches = rx#"...")fieldregex validation
@serialize(rename = "...", skip, skip_if_null)fieldserialisation control
@deserialize(default, alias = "...")fielddeserialisation control

Meta

AttributeTargetsSemantics
@const exprexprforce compile-time evaluation
@meta_macrometa fnexpose as a callable @name(...) macro
@tacticmeta fnexpose as a proof tactic
@logicfnmark as reflection-eligible
@llvm_onlyfncannot run in VBC interpreter
@requires_runtimefnneeds a specific runtime feature

Documentation

AttributeTargetsSemantics
@doc("...")anydocumentation comment
@doc(hidden)anyexclude from generated docs
@deprecated(since = "...", note = "...")anymark deprecated

Miscellaneous

AttributeTargetsSemantics
@stdanystandard library marker
@internalanyinternal-only (ignored by verum doc)
@specializeimplspecialisation instance
@universe_polyfn, typeenable universe polymorphism
@cap(name = "X", domain = "Y")fndeclares a capability it holds

Lint suppression / promotion

In-source severity overrides for verum lint. The first arg is the string-literal rule name (kebab-case, matches [lint.severity] keys exactly); reason = "..." is optional today but recommended.

AttributeTargetsSemantics
@allow("rule", reason = "...")fn, type, theorem/lemma/corollary, axiom, module-levelsuppress diagnostics of the named rule for everything inside the item's source span
@deny("rule")sameforce the rule to error for everything inside the item's span
@warn("rule")sameforce the rule to warning

Examples:

@allow("redundant-refinement", reason = "kept for documentation")
type Always is Int{ true };

@deny("todo-in-code")
public fn release_critical() {}

@warn("deprecated-syntax")
fn experimental() {}

Most-specific (smallest source-span) suppression wins on overlap; in-source attributes always beat [lint.severity] and CLI flags. See Reference → Lint configuration → precedence stack.

Diakrisis Part B advisory attributes

These attributes annotate functions / theorems / types along Diakrisis foundational axes. They are advisory — the compiler does not dispatch on them; they are validated by meta-fns in core/meta/diakrisis_attrs.vr and surfaced to downstream tooling (audit, IDE, future verification ladders) without grammar bloat.

AttributeTargetsSemantics
@effect(<kind>)fn, theoremcomputational-effect classifier. Kinds: pure | io | state | async | exception (alias exn) | nondet (alias non_det) | quantum.
@infinity_category(<level>)type(∞,∞)-categorical level. Level: integer | omega | omega_omega.
@autopoietic(epsilon = <str>, depth = <int>)fnε-fixpoint coordinate + finite-depth approximation budget (Theorem 141.T).
@ludic_designtype, valuemarks a value as a ludics design (lazy-evaluated proof tree).
@cut_elimination[(bound = <int>)]fn, theoremcut-elimination step bound. Default 1000.

Examples:

// Function classified as performing IO.
@effect(io)
public fn read_config() -> Result<Config, Error> { ... }

// (∞, 1)-category type marker (Lurie HTT level).
@infinity_category(omega)
public type Topos is { ... };

// Autopoietic recursive computation with depth-32 cutoff.
@autopoietic(epsilon = "ε_construct", depth = 32)
public fn fold_autonomy(seed: Genome) -> Organism { ... }

// Ludics proof design with default cut-elimination bound (1000).
@ludic_design
@cut_elimination
public theorem cut_admissible() -> Bool { ... }

// Explicit lower bound for budget-tight CI.
@cut_elimination(bound = 100)
public theorem fast_cut() -> Bool { ... }

Architectural note: these attributes are advisory markers, not compiler-dispatch primitives. They live in the meta-system per the principle typed-attrs are reserved for compiler-internal dispatch. Validation lives in the meta-fns parse_effect_attr, parse_infinity_category, parse_autopoietic, parse_ludic_design, parse_cut_elimination (all in core/meta/diakrisis_attrs.vr).

Custom attributes

User-defined via @meta_macro (see Language → metaprogramming).

The Diakrisis Part B advisory attributes above are themselves implemented through this same meta-macro infrastructure — users can add their own classifiers in sibling meta-modules without modifying the compiler.

See also