Expand description
The UPPAAL model in XTA, the language UPPAAL reads and UTAP parses: what
transpile builds from each PD’s Ccfg, printing itself as text. The network
(Nta and what it holds, nta.rs) and the language its declarations
and labels are written in (types.rs, expr.rs, stmt.rs, decl.rs).
A mirror of UTAP’s syntax; names and types are verifyta’s to resolve.
UTAP’s XML reader parses each element with its own start symbol, which is what this module covers:
| XML element | UTAP start symbol | Here |
|---|---|---|
global <declaration> | Declarations | GlobalDecl |
template <declaration> | ProcLocalDeclList | ProcLocalDecl |
<parameter> | ParameterList | Param |
location invariant | Expression | Expr |
transition select | SelectList | Select |
transition guard | Expression | Expr |
transition synchronisation | SyncExpr | Sync |
transition assignment | ExprList | Expr (a Expr::Comma list) |
<system> | XTA | System |
§The declaration language
Ground truth is the UTAP parser itself, not the UPPAAL manual: the types
below follow the productions of src/parser.y one for one, and the
fmt::Display impls print what src/PrettyPrinter.cpp prints. Line
numbers (parser.y:494) refer to UPPAALModelChecker/utap at b5fe3b2.
§Three scopes, three grammars
UTAP does not have one declaration list, it has three, and the local ones are strictly poorer:
| Scope | UTAP production | This module |
|---|---|---|
| Global | Declarations (parser.y:494) | GlobalDecl |
| Template-local | ProcLocalDeclList (parser.y:786) | ProcLocalDecl |
| Block-local | BlockLocalDeclList (parser.y:1008) | BlockLocalDecl |
A template admits only variables, typedefs and functions; a block only
variables and typedefs. Having one enum per scope is the point of the
language: the backend cannot put an instantiation inside a template, or a
function inside a for body, because those values do not exist.
Two traps the types close: TypePrefix is one slot, not a set
(urgent broadcast is its own production, const urgent does not
parse), and array dimensions hang off the declarator, not the type
(int a[4], b; declares one array and one scalar).
§What is left out, and why
- A
ProcDecltype of its own: aTemplateprints as one (process P() { … }). The LSC forms. switchanddo/whilestatements: nothing in the transpiler emits them, and an unused variant is a variant nobody checks.- Queries (
.qfiles are user-written), clock rates, the probabilistic forms (branchpoints, probabilities, exponential rates),progressandgantt. **: UTAP’s grammar parses it, but verifyta 5.0.0 cannot build it as an expression;pow(a, b)is the call form.
Everything else the global list admits is here, including the forms the
transpiler does not yet build (ExternDecl, ChanPriority,
DynamicDecl, before/after update), so that the module is a faithful
description of the surface rather than of today’s backend.
Structs§
- Chan
Priority - A channel-priority declaration (
PriorityDecl, parser.y:396):chan priority a, b < c < default;. - DeclId
- One declared name of a
VarDecl(DeclId, parser.y:593). - Declarator
- A name with its array dimensions — UTAP’s
Id ArrayDecl, shared by typedef names (TypeId), struct fields (FieldDeclId) and parameters. - Dynamic
Decl - A dynamic-template declaration (
DynamicDeclaration, parser.y:509). - Extern
Decl - An external-library declaration (
ExternDecl, parser.y:537):import "lib" { … };. - Field
- One field group of a
struct(FieldDecl, parser.y:739). Fields take no initialiser. - Field
Init - One element of a brace initialiser (
FieldInit, parser.y:618), optionally labelled with the field it initialises. - FnDecl
- A function declaration (
FunctionDecl, parser.y:516). - FwdDecl
- One forward declaration of an
ExternDecl(FwdDecl, parser.y:551). - Instantiation
- A template instantiation (
Instantiation, parser.y:368):p = P(args);, or a parameterisedp(int i) = P(i);. - Location
- A UPPAAL location (state).
- Nta
- A complete UPPAAL Network of Timed Automata.
- Param
- A function parameter (
Parameter, parser.y:572). - Select
- One
selectbinding:name : type(SelectList). - Sync
- A synchronisation label (
SyncExpr):chan!orchan?. - System
- The
<system>section (UTAP’sXTAstart symbol): declarations, most often instantiations, then thesystemline. - Template
- A UPPAAL template — the per-PD timed automaton.
- Transition
- A directed edge between two locations.
- TypeDef
- A type declaration (
TypeDecl, parser.y:637):typedef T a, b[4];. - Type
Expr - A prefixed type, as it appears in front of a declarator list.
- VarDecl
- A variable declaration (
VariableDecl, parser.y:581): one type, one or more declared names.
Enums§
- Array
Dim - One array dimension (
ArrayDecl2, parser.y:627). - Assign
Op - The operator of an assignment expression (
AssignOp). - BinOp
- Binary operators (
BinaryOpin UTAP’s grammar). - Block
Local Decl - A block-local declaration — one element of
BlockLocalDeclList(parser.y:1008), at the head of a function body or nested block. - Chan
Element - One element of a
ChanPrioritylist (ChanElement, parser.y:407). - Expr
- An expression: what a declaration, a function body or a transition label is built from.
- Global
Decl - A global declaration — one element of UTAP’s
Declarationslist (parser.y:494), which is order-free and interleavable. - Initializer
- A variable initialiser (
Initializer, parser.y:606). - Location
Kind - What may happen at a location: UTAP marks a location urgent or committed, never both.
- Proc
Local Decl - A template-local declaration — one element of
ProcLocalDeclList(parser.y:786). - Step
++or--.- Stmt
- A statement of a function body (
OtherStatement, parser.y:1045). - SyncDir
- The direction of a
Sync. - Type
- A base type (
Type, parser.y:657), without its prefix. - Type
Prefix - A type prefix (
TypePrefix, parser.y:759). - UnOp
- Unary operators of the printed subset.
Constants§
- KEYWORDS
- Every word UTAP’s lexer reserves (
src/keywords.cppatb5fe3b2, all syntax variants together): none may name a process, an instance or a location.