1、INTERNATIONAL TELECOMMUNICATION UNION ITU-T TELECOMMUNICATION STAN DARD IZATI ON SECTOR OF ITU 2.200 (1 1 /I 999) SERIES Z: LANGUAGES AND GENERAL SOFTWARE ASPECTS FOR TELECOMMUNICATION SYSTEMS Programming languages - CHILL: The ITU-T programming lang uag e CHILL - The ITU-T Programming Language ITU-
2、T Recommendation 2.200 (Previously CCITT Recommendation) ITU-T 2-SERIES RECOMMENDATIONS LANGUAGES AND GENERAL SOFTWARE ASPECTS FOR TELECOMMUNICATION SYSTEMS FORMAL DESCRIPTION TECHNIQUES (FDT) Specification and Description Language (SDL) Application of Formal Description Techniques Message Sequence
3、Chart CHILL: The ITU-T programming language General principles Basic syntax and dialogue procedures Extended MML for visual display terminals Specification of the man-machine interface PROGRAMMING LANGUAGES MAN-MACHlNE LANGUAGE QUALITY OF TELECOMMUNICATION SOFTWARE METHODS FOR VALIDATION AND TESTING
4、 2. 100-2. 109 2.120-2.129 2.200-2.209 2.110-2.119 2.300-2.309 2.3 10-2.3 19 2.320-2.329 2.330-2.399 2.400-2.499 2.500-2.599 For further details, please refer to the list of ITU-T Recommendations. INTERNATIONAL STANDARD 9496 ITU-T RECOMMENDATION 2.200 CHILL - THE ITU-T PROGRAMMING LANGUAGE Summary T
5、his Recommendation I International Standard defines the ITU-T programming language CHILL. CHILL is a strongly typed, block structured and object-oriented language designed primarily for the implementation of large and complex embedded systems. CHILL was designed to provide reliability and run time e
6、fficiency, at the same time sufficient flexibility and powerfulness to encompass the required range of applications. CHILL also provides facilities that encourage piecewise and modular development of large systems. Source ITU-T Recommendation 2.200 was prepared by ITU-T Study Group 10 (1997-2000) an
7、d approved on 19 November 1999. An identical text is also published as IS0 I IEC 9496. ITU-T Rec. 2.200 (1999 E) 1 FOREWORD ITU (International Telecommunication Union) is the United Nations Specialized Agency in the field of telecommuni- cations. The ITU Telecommunication Standardization Sector (ITU
8、-T) is a permanent organ of the ITU. The ITU-T is responsible for studying technical, operating and tariff questions and issuing Recommendations on them with a view to standardizing telecommunications on a worldwide basis. The World Telecommunication Standardization Conference (WTSC), which meets ev
9、ery four years, establishes the topics for study by the ITU-T Study Groups which, in their turn, produce Recommendations on these topics. The approval of Recommendations by the Members of the ITU-T is covered by the procedure laid down in WTSC Resolution No. 1. In some areas of information technolog
10、y which fall within ITU-Ts purview, the necessary standards are prepared on a collaborative basis with IS0 and IEC. NOTE In this Recommendation, the expression “Administration“ is used for conciseness to indicate both a telecommunication administration and a recognized operating agency. INTELLECTUAL
11、 PROPERTY RIGHTS The ITU draws attention to the possibility that the practice or implementation of this Recommendation may involve the use of a claimed Intellectual Property Right. The ITU takes no position concerning the evidence, validity or applicability of claimed Intellectual Property Rights, w
12、hether asserted by ITU members or others outside of the Recommendation development process. As of the date of approval of this Recommendation, the ITU had not received notice of intellectual property, protected by patents, which may be required to implement this Recommendation. However, implementors
13、 are cautioned that this may not represent the latest information and are therefore strongly urged to consult the TSB patent database. O ITU 2001 All rights reserved. No part of this publication may be reproduced or utilized in any form or by any means, electronic or mechanical, including photocopyi
14、ng and microfilm, without permission in writing from the ITU. 11 ITU-T Rec. 2.200 (1999 E) CONTENTS Page 1 Introduction 1.1 General 1.2 Language survey . 1.3 Modes and classes . 1.4 Locations and their accesses . 1.5 Values and their operations . 1.6 1.7 1.8 1.9 1.10 1.11 1.12 1.13 Actions Input and
15、 output Exception handling Time supervision . Program structure Concurrent execution General semantic properties Implementation options . Preliminaries . 2.1 The metalanguage . 2.2 Vocabulary 2.3 The use of spaces 2.4 Comments . 2.5 Format effectors 2.6 Compiler directives . 2.7 Names and their defi
16、ning occurrences 3 Modes and classes . 3.1 General 3.2 Mode definitions . 3.3 Mode classification . 3.4 Discrete modes 3.6 Powerset modes . 3.7 Reference modes . 3.5 Real modes 3.8 3.9 3.10 3.1 1 3.12 3.13 3.14 3.15 Procedure modes . Instance modes Synchronization modes . Input-Output Modes Composit
17、e modes Dynamic modes . Timing modes . Moreta Modes . 4 Locations and their accesses . 4.1 Declarations 4.2 Locations . Values and their operations . 5.2 Primitive value 5 5.1 Synonym definitions . 5.3 Values and expressions . ITU-T Rec . 2.200 (1999 E) 1 1 1 2 3 3 4 4 4 5 5 5 6 6 7 7 8 9 9 9 10 10
18、12 12 13 16 17 20 22 22 23 24 25 26 28 29 37 38 45 45 47 54 54 55 70 . 111 6 7 8 9 10 iv Actions 6.1 6.2 6.3 6.4 6.5 6.6 6.7 6.8 6.9 6.10 6.1 1 6.12 6.13 6.14 6.15 6.16 6.17 6.18 6.19 6.20 General Assignment action . If action . Case action Do action . Exit action . Call action . Result and return a
19、ction . Goto action Assert action Empty action . Cause action Start action Stop action . Continue action . Delay action Delay case action . Send action . Receive case action . CHILL built-in routine calls Input and Output . 7.1 I/O reference model . 7.2 Association values . 7.3 Access values 7.4 7.5
20、 Text input output . Built-in routines for input output . Exception handling . 8.1 General 8.2 Handlers 8.3 Handler identification Time supervision 9.1 General 9.2 Timeoutable processes 9.3 Timing actions . Built-in routines for time . Program Structure . 10.2 Reaches and nesting 10.3 Begin-end bloc
21、ks . 10.4 Procedure specifications and definitions . 10.5 Process specifications and definitions . 10.6 Modules . 10.7 Regions 10.8 Program . 10.9 Storage allocation and lifetime i O . 1 O Constructs for piecewise programming . 1 O . 1 1 Genericity 9.4 10.1 General ITU-T Rec . 2.200 (1999 E) Page 79
22、 79 79 81 81 83 86 87 90 90 91 91 91 91 91 92 92 92 93 94 97 102 102 104 104 105 112 120 120 121 121 122 122 122 122 124 125 125 127 129 129 134 134 135 135 136 136 141 11 12 13 Concurrent execution 11.1 Processes. tasks. threads and their definitions . 11.2 Mutual exclusion and regions . 11.3 Delay
23、ing of a thread i 1.4 Re-activation of a thread . 11.5 Signal definition statements 11.6 Completion of Region and Task locations General semantic properties 12.1 Mode rules . 12.2 Visibility and name binding 12.3 Case selection 12.4 Implementation options 13.1 13.2 i 3.3 13.4 i 3.6 13.7 Definition a
24、nd summary of semantic categories . Implementation defined built-in routines Implementation defined integer modes . Implementation defined floating point modes . Implementation defined process names 13.5 Implementation defined handlers Implementation defined exception names . Other implementation de
25、fined features . Appendix I . Character set for CHILL Appendix II - Special symbols Appendix III - Special simple name strings III . 1 111.2 111.3 Appendix IV IV . 1 IV.2 IV.3 IV.4 IV.5 IV.6 IV.7 IV.8 IV.9 IV.10 IV.11 IV.12 IV.13 IV . 14 IV.15 IV.16 IV.17 IV . 18 IV.19 IV.20 IV.2 1 IV.22 IV.23 IV.24
26、 IV.25 . Reserved simple name strings . Predefined simple name strings . Exception names . Program examples . Operations on integers . Same operations on fractions Same operations on complex numbers General order arithmetic Adding bit by bit and checking the result Playing with dates . Roman numeral
27、s Prime numbers Fragment for playing chess . Counting letters in a character string of arbitrary length . Implementing stacks in two different ways. transparent to the user Building and manipulating a circularly linked list A region for managing competing accesses to a resource . Queuing calls to a
28、switchboard . Allocating and deallocating a set of resources Allocating and deallocating a set of resources using buffers String scanner1 String scanner2 Removing an item from a double linked list . Update a record of a file Merge two sorted files . Read a file with variable length records The use o
29、f spec modules . Example ofa context . The use of prefixing and remote modules . ITU-T Rec . 2.200 (1999 E) Page 144 144 145 148 148 148 149 149 149 160 167 169 173 173 173 173 173 173 173 173 175 176 177 177 178 178 179 179 179 180 180 180 181 182 183 184 184 185 188 189 190 190 192 194 195 196 196
30、 197 198 199 199 199 V IV.26 IV.27 IV.28 IV.29 IV.30 IV.3 1 IV.32 Appendix V - v . 1 v.2 v.3 v.4 v.5 V.6 v.7 V.8 v.9 v.10 v.11 v.12 V.13 V . 14 V.15 V.16 V.17 V.18 V.19 v.20 v.21 v.22 V.23 V.24 V.25 V.26 V.27 V.28 V.29 V.30 V.3 1 The use of text i/o A generic stack An abstract data type . Object-Ori
31、entation: Modes for Simple. Sequential Stacks Example ofa spec module Object-Orientation: Mode Extension: Simple. Sequential Stack with Operation “Top“ . Object-Orientation: Modes for Stacks with Access Synchronization Decommitted features . Free directive . Integer modes syntax . Procedure modes sy
32、ntax Set modes with holes . String modes syntax Array modes syntax . Level structure notation . Map reference names Based declarations . Character string literals . Addr notation Assignment syntax Receive expressions Case action syntax . Do for action syntax Explicit loop counters . RECURSEFAIL exce
33、ption . Start action syntax . Explicit value receive names . Call action syntax Blocks . Entry statement Register names Recursive attribute Quasi cause statements and quasi handlers . Syntax of quasi statements Weakly visible names and visibility statements Weakly visible names and visibility statem
34、ents Seizing by modulion name Predefined simple name strings . Pervasiveness Appendix VI . Index of production rules Page 200 201 202 202 202 204 204 206 206 206 206 206 207 207 207 207 207 207 207 207 207 207 207 208 208 208 208 208 208 208 208 208 209 209 209 209 209 209 209 210 vi ITU-T Rec . 2.2
35、00 (1999 E) ISO-IEC 9496 : 2002(E) INTERNATIONAL STANDARD ITU-T RECOMMENDATION CHILL - THE ITU-T PROGRAMMING LANGUAGE This Recommendation I International Standard defines the ITU-T programming language CHILL. When CHILL was first defined in 1980 “CHILL“ stood for CCITT High Level Language. The follo
36、wing subclauses of this clause introduce some of the motivations behind the language design and provide an overview of the language features. For information concerning the variety of introductory and training material on this subject, the reader is referred to the Manuals, “Introduction to CHILL“ a
37、nd “CHILL users manual“. An alternative definition of CHILL, in a strict mathematical form (based on the VDM notation), is available in the Manual entitled “Formal definition of CHILL“. 1.1 General CHILL is a strongly typed, block structured language designed primarily for the implementation of larg
38、e and complex embedded systems. CHILL was designed to: 0 enhance reliability and run time efficiency by means of extensive compile-time checking; be sufficiently flexible and powerful to encompass the required range of applications and to exploit a variety of hardware; 0 0 0 provide facilities that
39、encourage piecewise and modular development of large systems; cater for real-time applications by providing built-in concurrency and time supervision primitives; permit the generation of highly efficient object code; be easy to learn and use. The expressive power inherent in the language design allo
40、ws engineers to select the appropriate constructs from a rich set of facilities such that the resulting implementation can match the original specification more precisely. Because CHILL is careful to distinguish between static and dynamic objects, nearly all the semantic checking can be achieved at
41、compile time. This has obvious run time benefits. Violation of CHILL dynamic rules results in run-time exceptions which can be intercepted by an appropriate exception handler (however, generation of such implicit checks is. optional, unless a user defined handler is explicitly specified). CHILL perm
42、its programs to be written in a machine independent manner. The language itself is machine independent; however, particular compilation systems may require the provision of specific implementation defined objects. It should be noted that programs containing such objects will not, in general, be port
43、able. 1.2 Language survey A CHILL program consists essentially of three parts: o a description of objects; o o a description of actions which are to be performed upon the objects; a description of the program structure. ITU-T Rec. 2.200 (1999 E) 1 ISO-IEC 9496 : 2002(E) Objects are described by data
44、 statements (declaration and definition statements), actions are described by action statements and the program structure is described by program structuring statements. The manipulatable objects of CHILL are values and locations where values can be stored. The actions define the operations to be pe
45、rformed upon the objects and the order in which values are stored into and retrieved from locations. The program structure determines the lifetime and visibility of objects. CHILL provides for extensive static checking of the use of objects in a given context. In the following subclauses, a summary
46、of the various CHILL concepts is given. Each subclause is an introduction to a clause with the same title, describing the concept in detail. 1.3 Modes and classes A location has a mode attached to it. The mode of a location defines the set of values which may reside in that location and other proper
47、ties associated with it (note that not all properties of a location are determinable by its mode alone). Properties of locations are: size, internal structure, read-onliness, referability, etc. Properties of values are: internal representation, ordering, applicable operations, etc. A value has a cla
48、ss attached to it. The class of a value determines the modes of the locations that may contain the value. CHILL provides the following categories of modes: - discrete modes: - real modes: - powerset modes: - reference modes: - composite modes: - procedure modes: - instance modes: - synchronization m
49、odes: - input-output modes: - timing modes: - moreta modes: integer, character, boolean, set (enumerations) modes and ranges thereof; floating point modes and ranges thereof; sets of elements of some discrete mode; bound references, free references and rows used as references to locations; string, array and structure modes; procedures considered as manipulatable data objects; identifications for processes; event and buffer modes for process synchronization and communication; association, access and text modes for input-output operations; duration and absolute time modes for time supervision;