Ticc Input Grammar for Ticc 0.20

Keywords

true

TRUE

false

FALSE

bool

var

module

endmodule

oinv

iinv

stateless

nondet

input

output

global

local

and

or

not

impl

else

stateset

initial

mod

Grammar rules

The following describes the grammar rules of the ticc language.

<!> Note that, in addition to this grammar, the Ticc type checker further limits what inputs can be accepted. This is the same situation as in programming languages: not all that can be parsed constitutes legal input. As an example, the guard of a guarded command (see Guarded Commands for a description) cannot reference primed variables even if there is a grammar rule that allows it. The restrictions on the grammar rules are described in Guarded Commands, Global Structure of Ticc Programs, expressions and Quick Start. Several examples in ticc/examples/tutorial also illustrate the restrictions.

Conventions

Input file structure

A file can contain variable, stateset, or module declarations. See Global Structure of Ticc Programs for a description of the overall structure of a Ticc input file. A set of states has a name, and it is defined by a boolean expression (no primed variables allowed). Sets of states declared outside modules can refer only to global variables.

The initial symbol of the grammar is design.

Module declaration

A module declaration consists of a module name, and of a body. The body is a list of variable, invariants, transitions, sets of states, initial conditions, and transitions. These elements can appear in any order.

Variable declarations

Variables can be either of boolean type, or of range type, where the range is [0...n] for some (small :-) ) integer n. Some variables can be declared to be stateless. The module does not track the value of these variables.

Sets of states

A module can have an optional initial condition, defined by initsetd. A module can also declare input and output invariants, which are just boolean expressions (no primed variables allowed). It is possible to use multiple initsetd and invariant formulas in a module; the initial condition, and the invariants, result from conjoining all the given formulas.

A modulo can also declare state sets, via the declaration statesetd. statesetd is defined in the same way as global sets, but can refer also to the local variables of a module.

Transitions for Output and Local Actions

A transition can correspond to input, output, or local actions. Each output and local transition is labeled by the name of the action that causes it. Guarded Commands for output and local actions consist of a guard and a command. Follow the above link for more information.

Transitions for Input Actions

Input transitions can be labeled with actexp (action expression), which can end with *. Such wildcard patterns can match many input actions at once; see wildcard input actions for more information. The guarded commands of input transitions have global and local parts. for more information, see Guarded Commands. The global part is the same as for output and local transitions: The local part has a special syntax, which forces the transition to be deterministic.

Expressions

Operators appearing on the same line in the production below, such as | and or, are synonims. See expressions for information on the semantics.

For the input grammar for previous versions of Ticc, click on Get Info, and look for pages that refer to the older version.

Ticc/Input Grammar (last edited 2006-08-10 15:05:12 by PritamRoy)