25.07.2014 Views

VDM-10 Language Manual

VDM-10 Language Manual

VDM-10 Language Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 13<br />

Statements<br />

In this section the different kind of statements will be described one by one. Each of them will be<br />

described by means of:<br />

• A syntax description in BNF.<br />

• An informal semantics description.<br />

• An example illustrating its usage.<br />

13.1 Let Statements<br />

Syntax:<br />

statement = let statement<br />

| let be statement<br />

| . . . ;<br />

let statement = ‘let’, local definition, { ‘,’, local definition },<br />

‘in’, statement ;<br />

let be statement = ‘let’, multiple bind, [ ‘be’, ‘st’, expression ], ‘in’,<br />

statement ;<br />

local definition = value definition<br />

| function definition ;<br />

value definition = pattern, [ ‘:’, type ], ‘=’, expression ;<br />

where the “function definition” component is described in section 5.<br />

Semantics: The let statement and the let-be-such-that statement are similar to the corresponding<br />

let and let-be-such-that expressions except that the in part is a statement instead of an<br />

expression. Thus it can be explained as follows:<br />

A simple let statement has the form:<br />

97

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!