Expand description
Fiducia → UPPAAL NTA transpilation.
Three passes over tast, beside the Ccfg:
- data-layer constants → global declarations;
- channels → global declarations (async ones relayed by the
ChannelAutogentemplate, a bidirectional one as two unidirectional ones); - each PD → one template: its
Orchestration(one graph per entry point) is printed by [handler] under the platform’s two rules —initonce, committed (MK-Init), thennotified, its exit wired back to its head (MK-Restart). Interleaving between PDs is UPPAAL’s parallel composition, as it is the glts’s. Everynotifiedlocation is urgent: the model does not count time, so no PD waits while it can move. Progress, not fairness. Aprotectedgraph is entered by aSyncchannel’s call, answers the waiting caller, and goes back to where the callee was (call).
The model is a slight over-approximation of the application, not a bisimulation of it: constructors run in any order rather than by priority, and PDs interleave freely, without the scheduler’s priorities or run to completion. An invariant verified on it holds of the application; a counterexample may be one the platform cannot produce.
Translation scheme summary:
- A struct → a global
typedef struct { … } Name;of the same fields, after the structs its fields are of; a variable’s type isbool, the struct’s name, orint(UPPAAL has no widths), an array’s length on its declarator, and a local’s default fills every field - Unbuffered
Chan→ native UPPAALchan c;; aSyncsend isc!, its value, if any, inc_val, then a wait for the callee’sret_<pd>? - Computation events → template-local functions; an edge firing the
event carries update label
name() - Calls to contracted foreign functions (Viper or ACSL) → a declared
UPPAAL function per function a PD calls,
ffi_<name>:requiresasasserts, never a guard, so the enabled edges are the Ccfg’s;ensures retval == Eas itsreturn.x = io.f(a)becomesx = ffi_f(a);, a guard[io.p(a)]becomes(ffi_p(a)) != (0), a discarded value is still a call. An uncontracted call stays opaque (a comment, or0in a guard). - Ccfg edge → transition: the guard printed as is, the event as
(synchronisation, update); a silent edge is unlabelled andhangis an unlabelled self-loop
Functions§
- transpile
- Transpile a typed Fiducia project and its graphs to a UPPAAL NTA.