Expand description
tast, the typed AST: rast with every declaration and expression
carrying its type, as two parts: TyEnv, the typed environment
(the declarations), and Bodies, the typed bodies.
The type sits on the node, as in CompCert’s Clight, never in a side
table. Constants, sizeof and array lengths are folded here, each
struct is laid out (C’s layout, fields at their offsets), a receive binder
has its channel’s payload type, and a parameter or carrier its
signature’s. What rast settled stays settled: names are ids, scopes
are resolved, and tast repeats none of those checks.
build consumes rast’s environment and bodies. tast defines a
node only where typing changes its content; a declaration with no type
is moved in as it was: a memory region and a protection domain are the
AST’s nodes, a mapping and an entry point base’s.
Re-exports§
pub use body::BodyVar;pub use body::Comm;pub use body::Event;pub use body::Proc;pub use body::Stmt;pub use env::build;pub use env::build_data;pub use env::build_programs;pub use env::build_system;pub use env::Channel;pub use env::Const;pub use env::Field;pub use env::ForeignFn;pub use env::LocalVar;pub use env::LocalVars;pub use env::Struct;pub use env::Tast;pub use env::TyEnv;pub use expr::Call;pub use expr::Expr;pub use expr::ExprKind;pub use program::Bodies;pub use program::Body;pub use program::EventBody;pub use program::ProcBody;pub use ty::ArrayLen;pub use ty::FfnSig;pub use ty::Ty;pub use view::ProgramView;
Modules§
- body
- Process and event bodies, typed, and their variables. The shapes are
rast’s: a body’s scope rules were settled there. - env
- The typed AST,
Tast, and its environment,TyEnv: the declarations typing changes (Channel,Structand itsFields,Const,LocalVar), andbuild, which types the project. The typed bodies areBodies(program.rs). - expr
- Expressions, typed: every node carries its type, a field is its index
and offset in the struct,
sizeofits value. - infoflow
- Information flow over
tast, on the two-level latticeLow ≤ High: a mapping’s label must be at least its memory region’s, so aHighregion is never read through aLowmapping. - program
- One
.fiprogram, typed. Its data, its locals, in theTyEnv. Its code, itsBodyinBodies: each event’s and process’s signature beside its variables and term, typed, and its entry points. And the foreign functions the programs call, each typed once (type_ffis). - system
- Typing the
.fisdeclarations: each channel’s payload type, each struct’s layout, each const’s folded value. Memory regions and protection domains carry no type, soTyEnvholdsrast’s own nodes. - ty
- The value type every
tastnode carries, by id. - view
- What one program’s ids name: the accessors a backend reads the typed environment and the typed bodies through, beside the Ccfg’s graphs.