Skip to main content

Module xta

Module xta 

Source
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 elementUTAP start symbolHere
global <declaration>DeclarationsGlobalDecl
template <declaration>ProcLocalDeclListProcLocalDecl
<parameter>ParameterListParam
location invariantExpressionExpr
transition selectSelectListSelect
transition guardExpressionExpr
transition synchronisationSyncExprSync
transition assignmentExprListExpr (a Expr::Comma list)
<system>XTASystem

§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:

ScopeUTAP productionThis module
GlobalDeclarations (parser.y:494)GlobalDecl
Template-localProcLocalDeclList (parser.y:786)ProcLocalDecl
Block-localBlockLocalDeclList (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 ProcDecl type of its own: a Template prints as one (process P() { … }). The LSC forms.
  • switch and do/while statements: nothing in the transpiler emits them, and an unused variant is a variant nobody checks.
  • Queries (.q files are user-written), clock rates, the probabilistic forms (branchpoints, probabilities, exponential rates), progress and gantt.
  • **: 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§

ChanPriority
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.
DynamicDecl
A dynamic-template declaration (DynamicDeclaration, parser.y:509).
ExternDecl
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.
FieldInit
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 parameterised p(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 select binding: name : type (SelectList).
Sync
A synchronisation label (SyncExpr): chan! or chan?.
System
The <system> section (UTAP’s XTA start symbol): declarations, most often instantiations, then the system line.
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];.
TypeExpr
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§

ArrayDim
One array dimension (ArrayDecl2, parser.y:627).
AssignOp
The operator of an assignment expression (AssignOp).
BinOp
Binary operators (BinaryOp in UTAP’s grammar).
BlockLocalDecl
A block-local declaration — one element of BlockLocalDeclList (parser.y:1008), at the head of a function body or nested block.
ChanElement
One element of a ChanPriority list (ChanElement, parser.y:407).
Expr
An expression: what a declaration, a function body or a transition label is built from.
GlobalDecl
A global declaration — one element of UTAP’s Declarations list (parser.y:494), which is order-free and interleavable.
Initializer
A variable initialiser (Initializer, parser.y:606).
LocationKind
What may happen at a location: UTAP marks a location urgent or committed, never both.
ProcLocalDecl
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.
TypePrefix
A type prefix (TypePrefix, parser.y:759).
UnOp
Unary operators of the printed subset.

Constants§

KEYWORDS
Every word UTAP’s lexer reserves (src/keywords.cpp at b5fe3b2, all syntax variants together): none may name a process, an instance or a location.