Keyboard shortcuts

Press ← or β†’ to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Introduction

This is the reference for Fiducia, the source language consumed by the fic compiler. A Fiducia source tree describes a seL4 Microkit system: its memory regions, protection domains, channels, the per-PD program logic, and the communication / computation events those programs orchestrate.

Fiducia has two layers. The orchestration layer is written in Fiducia itself: it says which channel events occur in a protection domain and in what order, and fic generates the event loop and every Microkit call from it. The computation layer is foreign code (C or Pancake) that the orchestration calls from computation events; it holds the data flow. Orchestration communicates; foreign functions compute. The two meet at a narrow boundary that the compiler checks and the verifier reads.

The reference is organised after the Rust Reference: each chapter pairs a formal grammar production with the prose semantics that surround it, then expands per syntactic feature with focused subsections and short examples. Where the surface syntax is still in flight, the chapter calls out the incomplete forms with a 🚧 marker so the reference stays honest about what the parser actually accepts today.

Source surfaces

A Fiducia project is one directory holding the files the compiler reads together:

  • System description (.fis) β€” the static topology: the data layer (struct and const items), memory regions, protection domains, channels, the system composition. One per project; it is the project.
  • Program implementations (.fi) β€” per-PD orchestration: imports of foreign C / Pancake files, memory mappings, program variable declarations, evt declarations, and proc definitions. One per protection domain.
  • Foreign implementations (.c, .h, .pnk) β€” the code a .fi imports. Not Fiducia source, but its signatures and contracts are read.

The .fis and the .fi files are linked by name. Each protection domain p declared in the .fis is implemented by p.fi beside it: a PD without that file is an error at its declaration, and so is a PD declared twice; a .fi that no PD names is a warning and is never read. Within a program, a Mapping refers to a MemoryRegion declared in the .fis; a channel reference in a process expression resolves against the .fis channel declarations; a computation event referenced by name from a process is declared in the same .fi with evt. The Project Layout chapter gives the full rules.

What the compiler does with a project

fic reads the sources, resolves every name, types the result and runs the checks, then lowers each protection domain’s orchestration once into a control-flow graph that every backend reads. From that graph it produces:

  • a bootable Microkit image: generated C per protection domain, built with the foreign code and assembled with the generated system description; and
  • a system model for UPPAAL, in which each protection domain is one template and each foreign function’s contract stands for its body, so that queries about the whole system (deadlock freedom, ordering, reachability) can be model-checked.

Parsing, name resolution, typing, tail recursion and entry-point binding run for every output; fic --check runs every check. Running the model checker and the code verifiers, and building and launching the image, are covered by the manual; this reference covers the language those tools read.

🚧 Type checking and well-formedness checking are not yet complete: the chapters on well-formedness and information flow state exactly what is checked today.

How this reference is organised

The chapters follow the project, outside in.

Foundations

System (.fis) items

Program (.fi) items

Expressions and semantics

  • Expressions β€” the expression language available to carriers, guards, and send payloads.
  • Entry Points β€” how the platform reaches a process, through @bind.

Foreign functions

  • Foreign Functions β€” what an import exposes and how calls are checked.
  • Contracts β€” the requires / ensures subset fic reads, and what the model assumes of it.
  • Generated Headers β€” the layout fic generates for the data layer, shared with the foreign code.

Checks

  • Well-Formedness β€” the rules a system must satisfy before it is accepted, with the messages for each.
  • Information Flow β€” the High / Low lattice over regions and mappings.

Where a chapter does not settle a point, the inline /// doc comments in src/parser/ and src/tast/ are the reference for it.

Conventions

  • Production blocks use the BNF dialect documented in Notation β€” the same conventions as the Rust Reference.
  • Examples render in text blocks; Fiducia is not Rust, and text keeps mdBook’s syntax-highlight neutral.
  • Keywords and identifiers are written with backticks in prose (evt, eth.send_frame) and as bare tokens inside grammar productions.
  • An em-dash (β€”) separates parenthetical asides, matching the existing module-doc style.
  • Cross-references to the parser source use repository-relative paths (src/parser/event.rs); cross-references to other chapters use plain Markdown links (e.g. Event Declarations).