TDF Specification

The TenDRA Documentation Team

$TenDRA: book.xml 2447 2006-03-23 21:15:51Z verm $

Extensions to this document from the original TenDRA-4.1.2-doc.tar.gz source distribution are covered by the BSDL, while all prior modifications remain under the Crown Copyright.

Berkeley Systems Design License

Redistribution and use in source (SGML DocBook) and 'compiled' forms (SGML, HTML, PDF, PostScript, RTF and so forth) with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code (SGML DocBook) must retain the above copyright notice, this list of conditions and the following disclaimer as the first lines of this file unmodified.

  2. Redistributions in compiled form (transformed to other DTDs, converted to PDF, PostScript, RTF and other formats) must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

Important

THIS DOCUMENTATION IS PROVIDED BY THE TENDRA DOCUMENTATION TEAM "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE TENDRA DOCUMENTATION TEAM BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Crown Copyright (c) 1997, 1998

This TenDRA(r) Computer Program is subject to Copyright owned by the United Kingdom Secretary of State for Defence acting through the Defence Evaluation and Research Agency (DERA). It is made available to Recipients with a royalty-free licence for its use, reproduction, transfer to other parties and amendment for any purpose not excluding product development provided that any such use et cetera shall be deemed to be acceptance of the following conditions:

  1. Its Recipients shall ensure that this Notice is reproduced upon any copies or amended versions of it;

  2. Any amended version of it shall be clearly marked to show both the nature of and the organisation responsible for the relevant amendment or amendments;

  3. Its onward transfer from a recipient to another party shall be deemed to be that party's acceptance of these conditions;

  4. DERA gives no warranty or assurance as to its quality or suitability for any purpose and DERA accepts no liability whatsoever in relation to any use to which it may be put.

This document was generated on 2006-09-07 16:05:13

Abstract

Please email us at if you see any errors


Table of Contents

Introduction
1. Structure of TDF
1.1. The Overall Structure
1.2. Tokens
1.3. Tags
1.4. Extending the format
2. Describing the Structure
3. Installer Behaviour
3.1. Definition of terms
3.2. Properties of Installers
4. Specification of TDF Constructs
4.1. ACCESS
4.1.1. access_apply_token
4.1.2. access_cond
4.1.3. add_accesses
4.1.4. constant
4.1.5. long_jump_access
4.1.6. no_other_read
4.1.7. no_other_write
4.1.8. out_par
4.1.9. preserve
4.1.10. register
4.1.11. standard_access
4.1.12. used_as_volatile
4.1.13. visible
4.2. AL_TAG
4.2.1. al_tag_apply_token
4.2.2. make_al_tag
4.3. AL_TAGDEF
4.3.1. make_al_tagdef
4.4. AL_TAGDEF_PROPS
4.4.1. make_al_tagdefs
4.5. ALIGNMENT
4.5.1. alignment_apply_token
4.5.2. alignment_cond
4.5.3. alignment
4.5.4. alloca_alignment
4.5.5. callees_alignment
4.5.6. callers_alignment
4.5.7. code_alignment
4.5.8. locals_alignment
4.5.9. obtain_al_tag
4.5.10. parameter_alignment
4.5.11. unite_alignments
4.5.12. var_param_alignment
4.6. BITFIELD_VARIETY
4.6.1. bfvar_apply_token
4.6.2. bfvar_cond
4.6.3. bfvar_bits
4.7. BITSTREAM
4.8. BOOL
4.8.1. bool_apply_token
4.8.2. bool_cond
4.8.3. false
4.8.4. true
4.9. BYTESTREAM
4.10. CALLEES
4.10.1. make_callee_list
4.10.2. make_dynamic_callees
4.10.3. same_callees
4.11. CAPSULE
4.11.1. make_capsule
4.12. CAPSULE_LINK
4.12.1. make_capsule_link
4.13. CASELIM
4.13.1. make_caselim
4.14. ERROR_CODE
4.14.1. nil_access
4.14.2. overflow
4.14.3. stack_overflow
4.15. ERROR_TREATMENT
4.15.1. errt_apply_token
4.15.2. errt_cond
4.15.3. continue
4.15.4. error_jump
4.15.5. trap
4.15.6. wrap
4.15.7. impossible
4.16. EXP
4.16.1. exp_apply_token
4.16.2. exp_cond
4.16.3. abs
4.16.4. add_to_ptr
4.16.5. and
4.16.6. apply_proc
4.16.7. apply_general_proc
4.16.8. assign
4.16.9. assign_with_mode
4.16.10. bitfield_assign
4.16.11. bitfield_assign_with_mode
4.16.12. bitfield_contents
4.16.13. bitfield_contents_with_mode
4.16.14. case
4.16.15. change_bitfield_to_int
4.16.16. change_floating_variety
4.16.17. change_variety
4.16.18. change_int_to_bitfield
4.16.19. complex_conjugate
4.16.20. component
4.16.21. concat_nof
4.16.22. conditional
4.16.23. contents
4.16.24. contents_with_mode
4.16.25. current_env
4.16.26. div0
4.16.27. div1
4.16.28. div2
4.16.29. env_offset
4.16.30. env_size
4.16.31. fail_installer
4.16.32. float_int
4.16.33. floating_abs
4.16.34. floating_div
4.16.35. floating_minus
4.16.36. floating_maximum
4.16.37. floating_minimum
4.16.38. floating_mult
4.16.39. floating_negate
4.16.40. floating_plus
4.16.41. floating_power
4.16.42. floating_test
4.16.43. goto
4.16.44. goto_local_lv
4.16.45. identify
4.16.46. ignorable
4.16.47. imaginary_part
4.16.48. initial_value
4.16.49. integer_test
4.16.50. labelled
4.16.51. last_local
4.16.52. local_alloc
4.16.53. local_alloc_check
4.16.54. local_free
4.16.55. local_free_all
4.16.56. long_jump
4.16.57. make_complex
4.16.58. make_compound
4.16.59. make_floating
4.16.60. make_general_proc
4.16.61. make_int
4.16.62. make_local_lv
4.16.63. make_nof
4.16.64. make_nof_int
4.16.65. make_null_local_lv
4.16.66. make_null_proc
4.16.67. make_null_ptr
4.16.68. make_proc
4.16.69. make_stack_limit
4.16.70. make_top
4.16.71. make_value
4.16.72. maximum
4.16.73. minimum
4.16.74. minus
4.16.75. move_some
4.16.76. mult
4.16.77. n_copies
4.16.78. negate
4.16.79. not
4.16.80. obtain_tag
4.16.81. offset_add
4.16.82. offset_div
4.16.83. offset_div_by_int
4.16.84. offset_max
4.16.85. offset_mult
4.16.86. offset_negate
4.16.87. offset_pad
4.16.88. offset_subtract
4.16.89. offset_test
4.16.90. offset_zero
4.16.91. or
4.16.92. plus
4.16.93. pointer_test
4.16.94. power
4.16.95. proc_test
4.16.96. profile
4.16.97. real_part
4.16.98. rem0
4.16.99. rem1
4.16.100. rem2
4.16.101. repeat
4.16.102. return
4.16.103. return_to_label
4.16.104. round_with_mode
4.16.105. rotate_left
4.16.106. rotate_right
4.16.107. sequence
4.16.108. set_stack_limit
4.16.109. shape_offset
4.16.110. shift_left
4.16.111. shift_right
4.16.112. subtract_ptrs
4.16.113. tail_call
4.16.114. untidy_return
4.16.115. variable
4.16.116. xor
4.17. EXTERNAL
4.17.1. string_extern
4.17.2. unique_extern
4.17.3. chain_extern
4.18. EXTERN_LINK
4.18.1. make_extern_link
4.19. FLOATING_VARIETY
4.19.1. flvar_apply_token
4.19.2. flvar_cond
4.19.3. flvar_parms
4.19.4. complex_parms
4.19.5. float_of_complex
4.19.6. complex_of_float
4.20. GROUP
4.20.1. make_group
4.21. LABEL
4.21.1. label_apply_token
4.21.2. make_label
4.22. LINK
4.22.1. make_link
4.23. LINKEXTERN
4.23.1. make_linkextern
4.24. LINKS
4.24.1. make_links
4.25. NAT
4.25.1. nat_apply_token
4.25.2. nat_cond
4.25.3. computed_nat
4.25.4. error_val
4.25.5. make_nat
4.26. NTEST
4.26.1. ntest_apply_token
4.26.2. ntest_cond
4.26.3. equal
4.26.4. greater_than
4.26.5. greater_than_or_equal
4.26.6. less_than
4.26.7. less_than_or_equal
4.26.8. not_equal
4.26.9. not_greater_than
4.26.10. not_greater_than_or_equal
4.26.11. not_less_than
4.26.12. not_less_than_or_equal
4.26.13. less_than_or_greater_than
4.26.14. not_less_than_and_not_greater_than
4.26.15. comparable
4.26.16. not_comparable
4.27. OTAGEXP
4.27.1. make_otagexp
4.28. PROCPROPS
4.28.1. procprops_apply_token
4.28.2. procprops_cond
4.28.3. add_procprops
4.28.4. check_stack
4.28.5. inline
4.28.6. no_long_jump_dest
4.28.7. untidy
4.28.8. var_callees
4.28.9. var_callers
4.29. PROPS
4.30. ROUNDING_MODE
4.30.1. rounding_mode_apply_token
4.30.2. rounding_mode_cond
4.30.3. round_as_state
4.30.4. to_nearest
4.30.5. toward_larger
4.30.6. toward_smaller
4.30.7. toward_zero
4.31. SHAPE
4.31.1. shape_apply_token
4.31.2. shape_cond
4.31.3. bitfield
4.31.4. bottom
4.31.5. compound
4.31.6. floating
4.31.7. integer
4.31.8. nof
4.31.9. offset
4.31.10. pointer
4.31.11. proc
4.31.12. top
4.32. SIGNED_NAT
4.32.1. signed_nat_apply_token
4.32.2. signed_nat_cond
4.32.3. computed_signed_nat
4.32.4. make_signed_nat
4.32.5. snat_from_nat
4.33. SORTNAME
4.33.1. access
4.33.2. Aal_tag
4.33.3. alignment_sort
4.33.4. Abitfield_variety
4.33.5. Abool
4.33.6. Aerror_treatment
4.33.7. Aexp
4.33.8. Afloating_variety
4.33.9. foreign_sort
4.33.10. Alabel
4.33.11. Anat
4.33.12. Antest
4.33.13. Aprocprops
4.33.14. Arounding_mode
4.33.15. Ashape
4.33.16. Asigned_nat
4.33.17. Astring
4.33.18. Atag
4.33.19. Atransfer_mode
4.33.20. Atoken
4.33.21. variety
4.34. STRING
4.34.1. string_apply_token
4.34.2. string_cond
4.34.3. concat_string
4.34.4. make_string
4.35. TAG
4.35.1. tag_apply_token
4.35.2. make_tag
4.36. TAGACC
4.36.1. make_tagacc
4.37. TAGDEC
4.37.1. make_id_tagdec
4.37.2. make_var_tagdec
4.37.3. common_tagdec
4.38. TAGDEC_PROPS
4.38.1. make_tagdecs
4.39. TAGDEF
4.39.1. make_id_tagdef
4.39.2. make_var_tagdef
4.39.3. common_tagdef
4.40. TAGDEF_PROPS
4.40.1. make_tagdefs
4.41. TAGSHACC
4.41.1. make_tagshacc
4.42. TDFBOOL
4.43. TDFIDENT
4.44. TDFINT
4.45. TDFSTRING
4.46. TOKDEC
4.46.1. make_tokdec
4.47. TOKDEC_PROPS
4.47.1. make_tokdecs
4.48. TOKDEF
4.48.1. make_tokdef
4.49. TOKDEF_PROPS
4.49.1. make_tokdefs
4.50. TOKEN
4.50.1. token_apply_token
4.50.2. make_tok
4.50.3. use_tokdef
4.51. TOKEN_DEFN
4.51.1. token_definition
4.52. TOKFORMALS
4.52.1. make_tokformals
4.53. TRANSFER_MODE
4.53.1. transfer_mode_apply_token
4.53.2. transfer_mode_cond
4.53.3. add_modes
4.53.4. overlap
4.53.5. standard_transfer_mode
4.53.6. trap_on_nil
4.53.7. volatile
4.53.8. complete
4.54. UNIQUE
4.54.1. make_unique
4.55. UNIT
4.55.1. make_unit
4.56. VARIETY
4.56.1. var_apply_token
4.56.2. var_cond
4.56.3. var_limits
4.56.4. var_width
4.57. VERSION_PROPS
4.57.1. make_versions
4.58. VERSION
4.58.1. make_version
4.58.2. user_info
5. Supplementary UNIT
5.1. LINKINFO_PROPS
5.1.1. make_linkinfos
5.2. LINKINFO
5.2.1. static_name_def
5.2.2. make_comment
5.2.3. make_weak_defn
5.2.4. make_weak_symbol
6. Notes
6.1. Binding
6.2. Character codes
6.3. Constant evaluation
6.4. Division and modulus
6.4.1. Class 1
6.4.2. Class 2
6.5. Equality of EXPs
6.6. Equality of SHAPEs
6.7. Equality of ALIGNMENTs
6.8. Exceptions and jumps
6.9. Procedures
6.10. Frames
6.11. Lifetimes
6.12. Alloca
6.13. Memory Model
6.13.1. Simple model
6.13.2. Comparison of pointers and offsets
6.13.3. Circular types in languages
6.13.4. Special alignments
6.13.5. Atomic assignment
6.14. Order of evaluation
6.15. Original pointers
6.16. Overlapping
6.17. Incomplete assignment
6.18. Representing integers
6.19. Overflow and Integers
6.20. Representing floating point
6.21. Floating point errors
6.22. Rounding and floating point
6.23. Floating point accuracy
6.23.1. Condition 1
6.23.2. Condition 2
6.24. Representing bitfields
6.25. Permitted limits
6.26. Least Upper Bound
6.27. Read-only areas
6.28. Tag and Token signatures
6.29. Dynamic initialisation
7. The bit encoding of TDF
7.1. The Basic Encoding
7.2. Fundamental encodings
7.2.1. TDFINT
7.2.2. TDFBOOL
7.2.3. TDFSTRING
7.2.4. TDFIDENT
7.3. BITSTREAM
7.3.1. BYTESTREAM
7.3.2. BYTE_ALIGN
7.3.3. Extendable integer encoding
7.4. The TDF encoding
7.5. File Formats
8. Revision History

List of Figures

1.1. Capsule 4
1.2. Capsule 1
1.3. Capsule 2
1.4. Capsule 3

Introduction

This is Issue 4.0 of the TDF Specification. TDF version 4.0 is not bitwise compatible with earlier versions.

TDF is a porting technology and, as a result, it is a central part of a shrink-wrapping, distribution and installation technology. TDF has been chosen by the Open Software Foundation as the basis of its Architecture Neutral Distribution Format. It was developed by the United Kingdom's Defence Research Agency (DRA). TDF is not UNIX specific, although most of the implementation has been done on UNIX.

Software vendors, when they port their programs to several platforms, usually wish to take advantage of the particular features of each platform. That is, they wish the versions of their programs on each platform to be functionally equivalent, but not necessarily algorithmically identical. TDF is intended for porting in this sense. It is designed so that a program in its TDF form can be systematically modified when it arrives at the target platform to achieve the intended functionality and to use the algorithms and data structures which are appropriate and efficient for the target machine. A fully efficient program, specialised to each target, is a necessity if independent software vendors are to take-up a porting technology.

These modifications are systematic because, on the source machine, programmers work with generalised declarations of the APIs they are using. The declarations express the requirements of the APIs without giving their implementation. The declarations are specified in terms of TDF's "tokens", and the TDF which is produced contains uses of these tokens. On each target machine the tokens are used as the basis for suitable substitutions and alterations.

Using TDF for porting places extra requirements on software vendors and API designers. Software vendors must write their programs scrupulously in terms of APIs and nothing more. API designers need to produce an interface which can be specialised to efficient data structures and constructions on all relevant machines.

TDF is neutral with respect to the set of languages which has been considered. The design of C, C++, Fortran and Pascal is quite conventional, in the sense that they are sufficiently similar for TDF constructions to be devised to represent them all. These TDF constructions can be chosen so that they are, in most cases, close to the language constructions. Other languages, such as Lisp, are likely to need a few extensions. To express novel language features TDF will probably have to be more seriously extended. But the time to do so is when the feature in question has achieved sufficient stability. Tokens can be used to express the constructs until the time is right. For example, there is a lack of consensus about the best constructions for parallel languages, so that at present TDF would either have to use low level constructions for parallelism or back what might turn out to be the wrong system. In other words it is not yet the time to make generalisations for parallelism as an intrinsic part of TDF.

TDF is neutral with respect to machine architectures. In designing TDF, the aim has been to retain the information which is needed to produce and optimise the machine code, while discarding identifier and syntactic information. So TDF has constructions which are closely related to typical language features and it has an abstract model of memory. We expect that programs expressed in the considered languages can be translated into code which is as efficient as that produced by native compilers for those languages.

Because of these porting features TDF supports shrink-wrapping, distribution and installation. Installation does not have to be left to the end-user; the production of executables can be done anywhere in the chain from software vendor, through dealer and network manager to the end-user.

This document provides English language specifications for each construct in the TDF format and some general notes on various aspects of TDF. It is intended for readers who are aware of the general background to TDF but require more detailed information.

Major changes from Issue 3.1

A new SORT for STRING is introduced having the same relationship to TDFSTRING as BOOL has to TDFBOOL. This is used in place of TDFSTRING in various 3.1 constructions.

They are also used in modified tag and token definitions and declarations to provide extra consistency checks in the use of these tags or tokens, and also may be used as names external to the TDF system. For example, the signature of make_id_tagdec is now:

t_intro:   TDFINT
acc:       OPTION(ACCESS)
signature: OPTION(STRING)
x:         SHAPE
           → TAGDEC

A new EXP constructor, initial_value, is introduced to allow dynamic initialisation of global tags.

These changes arise mainly from requirements of C++, but are clearly applicable elsewhere.

Magic numbers are introduced at the start of files containing TDF bitstream information.

The version 3.1 constructor set_stack_limit has had to be modified in the light of experience with platforms with ABIs which require upward-growing stacks or use disjoint frame stacks and alloca stacks.

Various other minor changes have been made to elucidate some rather pathological cases, e.g. make_nof must have at least one element. Also there are some cosmetic changes to improve consistency, e.g. the order of the arguments of token are now consistent with token_definition.

Notes on Revision 1

This Revision 1 of Issue 4.0 incorporates a number of corrections which have arisen where inconsistency or impracticability became evident when validating the OSF Research Institute's AVS (ANDF Validation Suite). Apart from minor textual corrections, the changes are:

  • Use of installer-defined TOKENs for accessing variable parameter lists - see the companion document TDF Token Register.

  • Tolerance of overflow necessary to allow simple implementation of complex multiply and divide.

  • Modified constraints on the arguments of shift_left, shift_right, rotate_left, rotate_right, make_dynamic_callees, make_var_tagdec, make_tokdec, make_tokdef, and user_info.

  • Modified constant evaluation constraints with respect to env_size and env_offset.

  • chain_extern no longer supported.

Changes under consideration but not included in Issue 4.0:

  • Tokenisation of the various LIST constructs.

  • Inclusion of the specification of run-time diagnostic information in the main specification. This is currently given as an appendix, as it it is less mature than the main specification.

Chapter 1. Structure of TDF

Each piece of TDF program is classified as being of a particular SORT. Some pieces of TDF are LABELs, some are TAGs, some are ERROR_TREATMENTs and so on (to list some of the more transparently named SORTs). The SORTs of the arguments and result of each construct of the TDF format are specified. For instance, plus is defined to have three arguments - an ERROR_TREATMENT and two EXPs (short for "expression") - and to produce an EXP; goto has a single LABEL argument and produces an EXP. The specification of the SORTs of the arguments and results of each construct constitutes the syntax of the TDF format. When TDF is represented as a parsed tree it is structured according to this syntax. When it is constructed and read it is in terms of this syntax.

1.1. The Overall Structure

A separable piece of TDF is called a CAPSULE. A producer generates a CAPSULE; the TDF linker links CAPSULEs together to form a CAPSULE; and the final translation process turns a CAPSULE into an object file.

The structure of capsules is designed so that the process of linking two or more capsules consists almost entirely of copying large byte-aligned sections of the source files into the destination file, without changing or even examining these sections. Only a small amount of interface information has to be modified and this is made easily accessible. The translation process only requires an extra indirection to account for this interface information, so it is also fast. The description of TDF at the capsule level is almost all about the organisation of the interface information.

There are three major kinds of entity which are used inside a capsule to name its constituents. The first are called tags; they are used to name the procedures, functions, values and variables which are the components of the program. The second are called tokens; they identify pieces of TDF which can be used for substitution - a little like macros. The third are the alignment tags, used to name alignments so that circular types can be described. Because these internal names are used for linking pieces of TDF together, they are collectively called linkable entities. The interface information relates these linkable entities to each other and to the world outside the capsule.

The most important part of a capsule, the part which contains the real information, consists of a sequence of groups of units. Each group contains units of the same kind, and all the units of the same kind are in the same group. The groups always occur in the same order, though it is not necessary for each kind to be present.

Figure 1.1. Capsule 4

Capsule 4

The order is as follows:

  • tld unit. Every capsule has exactly one tld unit. It gives information to the TDF linker about those items in the capsule which are visible externally.

  • versions unit. These units contain information about the versions of TDF used. Every capsule will have at least one such unit.

  • tokdec units. These units contain declarations for tokens. They bear the same relationship to the following tokdef units that C declarations do to C definitions. However, they are not necessary for the translator, and the current ANSI C producer does not provide them by default.

  • tokdef units. These units contain definitions of tokens.

  • aldef units. These units give the definitions of alignment tags.

  • diagtype units. These units give diagnostic information about types.

  • tagdec units. These units contain declarations of tags, which identify values, procedures and run-time objects in the program. The declarations give information about the size, alignment and other properties of the values. They bear the same relationship to the following tagdef units that C declarations do to C definitions.

  • diagdef units. These units give diagnostic information about the values and procedures defined in the capsule.

  • tagdef units. These units contain the definitions of tags, and so describe the procedures and the values they manipulate.

  • linkinfo units. These units give information about the linking of objects.

This organisation is imposed to help installers, by ensuring that the information needed to process a unit has been provided before that unit arrives. For example, the token definitions occur before any tag definition, so that, during translation, the tokens may be expanded as the tag definitions are being read (in a capsule which is ready for translation all tokens used must be defined, but this need not apply to an arbitrary capsule).

The tags and tokens in a capsule have to be related to the outside world. For example, there might be a tag standing for printf, used in the appropriate way inside the capsule. When an object file is produced from the capsule the identifier printf must occur in it, so that the system linker can associate it with the correct library procedure. In order to do this, the capsule has a table of tags at the capsule level, and a set of external links which provide external names for some of these tags.

Figure 1.2. Capsule 1

Capsule 1

In just the same way, there are tables of tokens and alignment tags at the capsule level, and external links for these as well.

The tags used inside a unit have to be related to these capsule tags, so that they can be properly named. A similar mechanism is used, with a table of tags at the unit level, and links between these and the capsule level tags.

Figure 1.3. Capsule 2

Capsule 2

Again the same technique is used for tokens and alignment tags.

It is also necessary for a tag used in one unit to refer to the same thing as a tag in another unit. To do this a tag at the capsule level is used, which may or may not have an external link.

Figure 1.4. Capsule 3

Capsule 3

The same technique is used for tokens and alignment tags.

So when the TDF linker is joining two capsules, it has to perform the following tasks:

  • It creates new sets of capsule level tags, tokens and alignment tags by identifying those which have the same external name, and otherwise creating different entries.

  • It similarly joins the external links, suppressing any names which are no longer to be external.

  • It produces new link tables for the units, so that the entities used inside the units are linked to the new positions in the capsule level tables.

  • It re-organises the units so that the correct order is achieved.

This can be done without looking into the interior of the units (except for the tld unit), simply copying the units into their new place.

During the process of installation the values associated with the linkable entities can be accessed by indexing into an array followed by one indirection. These are the kinds of object which in a programming language are referred to by using identifiers, which involves using hash tables for access. This is an example of a general principle of the design of TDF; speed is required in the linking and installing processes, if necessary at the expense of time in the production of TDF.

1.2. Tokens

Tokens are used (applied) in the TDF at the point where substitutions are to be made. Token definitions provide the substitutions and usually reside on the target machine and are linked in there.

A typical token definition has parameters from various SORTs and produces a result of a given SORT. As an example of a simple token definition, written here in a C-like notation, consider the following.

EXP ptr_add (EXP par0, EXP par1, SHAPE par2) { add_to_ptr( par0, offset_mult( offset_pad( alignment(par2), shape_offset(par2)), par1)) }

This defines the token, ptr_add, to produce something of SORT EXP. It has three parameters, of SORTs EXP, EXP and SHAPE. The add_to_ptr, offset_mult, offset_pad, alignment and shape_offset constructions are TDF constructions producing respectively an EXP, an EXP, an EXP, an ALIGNMENT and an EXP.

A typical use of this token is:

ptr_add( obtain_tag(tag41), contents(integer(~signed_int), obtain_tag(tag62)), integer(~char))

The effect of this use is to produce the TDF of the definition with par0, par1 and par2 substituted by the actual parameters.

There is no way of obtaining anything like a side-effect. A token without parameters is therefore just a constant.

Tokens can be used for various purposes. They are used to make the TDF shorter by using tokens for commonly used constructions (ptr_add is an example of this use). They are used to make target dependent substitutions (~char in the use of ptr_add is an example of this, since ~char may be signed or unsigned on the target).

A particularly important use is to provide definitions appropriate to the translation of a particular language. Another is to abstract those features which differ from one ABI to another. This kind of use requires that sets of tokens should be standardised for these purposes, since otherwise there will be a proliferation of such definitions.

1.3. Tags

Tags are used to identify the actual program components. They can be declared or defined. A declaration gives the SHAPE of a tag (a SHAPE is the TDF analogue of a type). A definition gives an EXP for the tag (an EXP describes how the value is to be made up).

1.4. Extending the format

TDF can be extended for two major reasons.

First, as part of the evolution of TDF, new features will from time to time be identified. It is highly desirable that these can be added without disturbing the current encoding, so that old TDF can still be installed by systems which recognise the new constructions. Such changes should only be made infrequently and with great care, for stability reasons, but nevertheless they must be allowed for in the design.

Second, it may be required to add extra information to TDF to permit special processing. TDF is a way of describing programs and it clearly may be used for other reasons than portability and distribution. In these uses it may be necessary to add extra information which is closely integrated with the program. Diagnostics and profiling can serve as examples. In these cases the extra kinds of information may not have been allowed for in the TDF encoding.

Some extension mechanisms are described below and related to these reasons:

  • The encoding of every SORT in TDF can be extended indefinitely (except for certain auxiliary SORTs). This mechanism should only be used for extending standard TDF to the next standard, since otherwise extensions made by different groups of people might conflict with each other. See Section 7.3.3, “Extendable integer encoding” Extendable integer encoding.

  • Basic TDF has three kinds of linkable entity and seven kinds of unit. It also contains a mechanism for extending these so that other information can be transmitted in a capsule and properly related to basic TDF. The rules for linking this extra information are also laid down. See Section 4.11.1, “make_capsule” make_capsule.

    If a new kind of unit is added, it can contain any information, but if it is to refer to the tags and tokens of other units it must use the linkable entities. Since new kinds of unit might need extra kinds of linkable entity, a method for adding these is also provided. All this works in a uniform way, with capsule level tables of the new entities, and external and internal links for them.

    If new kinds of unit are added, the order of groups must be the same in any capsules which are linked together. As an example of the use of this kind of extension, the diagnostic information is introduced in just this way. It uses two extra kinds of unit and one extra kind of linkable entity. The extra units need to refer to the tags in the other units, since these are the object of the diagnostic information. This mechanism can be used for both purposes.

  • The parameters of tokens are encoded in such a way that foreign information (that is, information which cannot be expressed in the TDF SORTs) can be supplied. This mechanism should only be used for the second purpose, though it could be used to experiment with extensions for future standards. See Section 7.3, “BITSTREAM” BITSTREAM.

Chapter 2. Describing the Structure

The following examples show how TDF constructs are described in this document. The first is the construct Section 4.31.6, “floating” floating:

fv: FLOATING_VARIETY
    → SHAPE

The constructs' arguments (one in this case) precede the "" and the result follows it. Each argument is shown as follows:

name: SORT

The name standing before the colon is for use in the accompanying English description within the specification. It has no other significance.

The example given above indicates that floating takes one argument. This argument, v, is of SORT FLOATING_VARIETY. After the "" comes the SORT of the result of floating. It is a SHAPE.

In the case of floating the formal description supplies the syntax and the accompanying English text supplies the semantics. However, in the case of some constructs it is convenient to specify more information in the formal section. For example, the specification of the construct Section 4.16.39, “floating_negate” floating_negate not only states that it has an EXP argument and an EXP result:

flpt_err: ERROR_TREATMENT
arg1:     EXP FLOATING(f)
          → EXP FLOATING(f)

it also supplies additional information about those EXPs. It specifies that these expressions will be floating point numbers of the same kind.

Some construct's arguments are optional. This is denoted as follows (from Section 4.16.6, “apply_proc” apply_proc):

result_shape: SHAPE
p:            EXP PROC
params:       LIST(EXP)
var_param:    OPTION(EXP)
              → EXP result_shape

var_param is an optional argument to the apply_proc construct shown above.

Some constructs take a varying number of arguments. params in the above construct is an example. These are denoted by LIST. There is a similar construction, SLIST, which differs only in having a different encoding.

Some constructs' results are governed by the values of their arguments. This is denoted by the "?" formation shown in the specification of the Section 4.16.14, “case” case construct shown below:

exhaustive: BOOL
control:    EXP INTEGER(v)
branches:   LIST(CASELIM)
            → EXP (exhaustive ? BOTTOM : TOP)

If exhaustive is true, the resulting EXP has the SHAPE BOTTOM: otherwise it is TOP.

Depending on a TDF-processing tool's purpose, not all of some constructs' arguments need necessarily be processed. For instance, installers do not need to process one of the arguments of the x_cond constructs (where x stands for a SORT, e.g. Section 4.16.2, “exp_cond” exp_cond. Secondly, standard tools might want to ignore embedded fragments of TDF adhering to some private standard. In these cases it is desirable for tools to be able to skip the irrelevant pieces of TDF. BITSTREAMs and BYTESTREAMs are formations which permit this. In the encoding they are prefaced with information about their length.

Some constructs' arguments are defined as being BITSTREAMs or BYTESTREAMs, even though the constructs specify them to be of a particular SORT. In these cases the argument's SORT is denoted as, for example, BITSTREAM FLOATING_VARIETY . This construct must have a FLOATING_VARIETY argument, but certain TDF-processing tools may benefit from being able to skip past the argument (which might itself be a very large piece of TDF) without having to read its content.

The nature of the UNITs in a GROUP is determined by unit identifications. These occur in make_capsule. The values used for unit identifications are specified in the text as follows:

Unit identification: some_name

where some_name might be tokdec, tokdef etc.

The kinds of linkable entity used are determined by linkable entity identifications. These occur in make_capsule. The values used for linkable entity identification are specified in the text as follows:

Linkable entity identification: some_name

where some_name might be tag, token etc.

The bit encodings are also specified in this document. The details are given in Chapter 7, The bit encoding of TDF The bit encoding of TDF. This section describes the encoding in terms of information given with the descriptions of the SORTs and constructs.

With each SORT the number of bits used to encode the constructs is given in the following form:

Number of encoding bits: n

This number may be zero; if so the encoding is non-extendable. If it is non-zero the encoding may be extendable or non-extendable. This is specified in the following form:

Is coding extendable: yes/no

With each construct the number used to encode it is given in the following form:

Encoding number: n

If the number of encoding bits is zero, n will be zero.

There may be a requirement that a component of a construct should start on a byte boundary in the encoding. This is denoted by inserting Section 4.1.11, “standard_access” BYTE_ALIGN before the component SORT.

Chapter 3. Installer Behaviour

3.1. Definition of terms

In this document the behaviour of TDF installers is described in a precise manner. Certain words are used with very specific meanings. These are:

  • "undefined": means that installers can perform any action, including refusing to translate the program. It can produce code with any effect, meaningful or meaningless.

  • "shall": when the phrase "P shall be done" (or similar phrases involving "shall") is used, every installer must perform P.

  • "should": when the phrase "P should be done" (or similar phrase involving "should") is used, installers are advised to perform P, and producer writers may assume it will be done if possible. This usage generally relates to optimisations which are recommended.

  • "will": when the phrase "P will be true" (or similar phrases involving "will") is used to describe the composition of a TDF construct, the installer may assume that P holds without having to check it. If, in fact, a producer has produced TDF for which P does not hold, the effect is undefined.

  • "target-defined": means that behaviour will be defined, but that it varies from one target machine to another. Each target installer shall define everything which is said to be "target-defined".

3.2. Properties of Installers

All installers must implement all of the constructions of TDF. There are some constructions where the installers may impose limits on the ranges of values which are implemented. In these cases the description of the installer must specify these limits.

Installers are not expected to check that the TDF they are processing is well-formed, nor that undefined constructs are absent. If the TDF is not well-formed any effect is permitted.

Installers shall only implement optimisations which are correct in all circumstances. This correctness can only be shown by demonstrating the equivalence of the transformed program, from equivalences deducible from this specification or from the ordinary laws of arithmetic. No statements are made in this specification of the form "such and such an optimisation is permitted".

Note

Fortran90 has a notion of mathematical equivalence which is not the same as TDF equivalence. It can be applied to transform programs provided parentheses in the text are not crossed. TDF does not acknowledge this concept. Such transformations would have to be applied in a context where the permitted changes are known.

Chapter 4. Specification of TDF Constructs

Table of Contents

4.1. ACCESS
4.1.1. access_apply_token
4.1.2. access_cond
4.1.3. add_accesses
4.1.4. constant
4.1.5. long_jump_access
4.1.6. no_other_read
4.1.7. no_other_write
4.1.8. out_par
4.1.9. preserve
4.1.10. register
4.1.11. standard_access
4.1.12. used_as_volatile
4.1.13. visible
4.2. AL_TAG
4.2.1. al_tag_apply_token
4.2.2. make_al_tag
4.3. AL_TAGDEF
4.3.1. make_al_tagdef
4.4. AL_TAGDEF_PROPS
4.4.1. make_al_tagdefs
4.5. ALIGNMENT
4.5.1. alignment_apply_token
4.5.2. alignment_cond
4.5.3. alignment
4.5.4. alloca_alignment
4.5.5. callees_alignment
4.5.6. callers_alignment
4.5.7. code_alignment
4.5.8. locals_alignment
4.5.9. obtain_al_tag
4.5.10. parameter_alignment
4.5.11. unite_alignments
4.5.12. var_param_alignment
4.6. BITFIELD_VARIETY
4.6.1. bfvar_apply_token
4.6.2. bfvar_cond
4.6.3. bfvar_bits
4.7. BITSTREAM
4.8. BOOL
4.8.1. bool_apply_token
4.8.2. bool_cond
4.8.3. false
4.8.4. true
4.9. BYTESTREAM
4.10. CALLEES
4.10.1. make_callee_list
4.10.2. make_dynamic_callees
4.10.3. same_callees
4.11. CAPSULE
4.11.1. make_capsule
4.12. CAPSULE_LINK
4.12.1. make_capsule_link
4.13. CASELIM
4.13.1. make_caselim
4.14. ERROR_CODE
4.14.1. nil_access
4.14.2. overflow
4.14.3. stack_overflow
4.15. ERROR_TREATMENT
4.15.1. errt_apply_token
4.15.2. errt_cond
4.15.3. continue
4.15.4. error_jump
4.15.5. trap
4.15.6. wrap
4.15.7. impossible
4.16. EXP
4.16.1. exp_apply_token
4.16.2. exp_cond
4.16.3. abs
4.16.4. add_to_ptr
4.16.5. and
4.16.6. apply_proc
4.16.7. apply_general_proc
4.16.8. assign
4.16.9. assign_with_mode
4.16.10. bitfield_assign
4.16.11. bitfield_assign_with_mode
4.16.12. bitfield_contents
4.16.13. bitfield_contents_with_mode
4.16.14. case
4.16.15. change_bitfield_to_int
4.16.16. change_floating_variety
4.16.17. change_variety
4.16.18. change_int_to_bitfield
4.16.19. complex_conjugate
4.16.20. component
4.16.21. concat_nof
4.16.22. conditional
4.16.23. contents
4.16.24. contents_with_mode
4.16.25. current_env
4.16.26. div0
4.16.27. div1
4.16.28. div2
4.16.29. env_offset
4.16.30. env_size
4.16.31. fail_installer
4.16.32. float_int
4.16.33. floating_abs
4.16.34. floating_div
4.16.35. floating_minus
4.16.36. floating_maximum
4.16.37. floating_minimum
4.16.38. floating_mult
4.16.39. floating_negate
4.16.40. floating_plus
4.16.41. floating_power
4.16.42. floating_test
4.16.43. goto
4.16.44. goto_local_lv
4.16.45. identify
4.16.46. ignorable
4.16.47. imaginary_part
4.16.48. initial_value
4.16.49. integer_test
4.16.50. labelled
4.16.51. last_local
4.16.52. local_alloc
4.16.53. local_alloc_check
4.16.54. local_free
4.16.55. local_free_all
4.16.56. long_jump
4.16.57. make_complex
4.16.58. make_compound
4.16.59. make_floating
4.16.60. make_general_proc
4.16.61. make_int
4.16.62. make_local_lv
4.16.63. make_nof
4.16.64. make_nof_int
4.16.65. make_null_local_lv
4.16.66. make_null_proc
4.16.67. make_null_ptr
4.16.68. make_proc
4.16.69. make_stack_limit
4.16.70. make_top
4.16.71. make_value
4.16.72. maximum
4.16.73. minimum
4.16.74. minus
4.16.75. move_some
4.16.76. mult
4.16.77. n_copies
4.16.78. negate
4.16.79. not
4.16.80. obtain_tag
4.16.81. offset_add
4.16.82. offset_div
4.16.83. offset_div_by_int
4.16.84. offset_max
4.16.85. offset_mult
4.16.86. offset_negate
4.16.87. offset_pad
4.16.88. offset_subtract
4.16.89. offset_test
4.16.90. offset_zero
4.16.91. or
4.16.92. plus
4.16.93. pointer_test
4.16.94. power
4.16.95. proc_test
4.16.96. profile
4.16.97. real_part
4.16.98. rem0
4.16.99. rem1
4.16.100. rem2
4.16.101. repeat
4.16.102. return
4.16.103. return_to_label
4.16.104. round_with_mode
4.16.105. rotate_left
4.16.106. rotate_right
4.16.107. sequence
4.16.108. set_stack_limit
4.16.109. shape_offset
4.16.110. shift_left
4.16.111. shift_right
4.16.112. subtract_ptrs
4.16.113. tail_call
4.16.114. untidy_return
4.16.115. variable
4.16.116. xor
4.17. EXTERNAL
4.17.1. string_extern
4.17.2. unique_extern
4.17.3. chain_extern
4.18. EXTERN_LINK
4.18.1. make_extern_link
4.19. FLOATING_VARIETY
4.19.1. flvar_apply_token
4.19.2. flvar_cond
4.19.3. flvar_parms
4.19.4. complex_parms
4.19.5. float_of_complex
4.19.6. complex_of_float
4.20. GROUP
4.20.1. make_group
4.21. LABEL
4.21.1. label_apply_token
4.21.2. make_label
4.22. LINK
4.22.1. make_link
4.23. LINKEXTERN
4.23.1. make_linkextern
4.24. LINKS
4.24.1. make_links
4.25. NAT
4.25.1. nat_apply_token
4.25.2. nat_cond
4.25.3. computed_nat
4.25.4. error_val
4.25.5. make_nat
4.26. NTEST
4.26.1. ntest_apply_token
4.26.2. ntest_cond
4.26.3. equal
4.26.4. greater_than
4.26.5. greater_than_or_equal
4.26.6. less_than
4.26.7. less_than_or_equal
4.26.8. not_equal
4.26.9. not_greater_than
4.26.10. not_greater_than_or_equal
4.26.11. not_less_than
4.26.12. not_less_than_or_equal
4.26.13. less_than_or_greater_than
4.26.14. not_less_than_and_not_greater_than
4.26.15. comparable
4.26.16. not_comparable
4.27. OTAGEXP
4.27.1. make_otagexp
4.28. PROCPROPS
4.28.1. procprops_apply_token
4.28.2. procprops_cond
4.28.3. add_procprops
4.28.4. check_stack
4.28.5. inline
4.28.6. no_long_jump_dest
4.28.7. untidy
4.28.8. var_callees
4.28.9. var_callers
4.29. PROPS
4.30. ROUNDING_MODE
4.30.1. rounding_mode_apply_token
4.30.2. rounding_mode_cond
4.30.3. round_as_state
4.30.4. to_nearest
4.30.5. toward_larger
4.30.6. toward_smaller
4.30.7. toward_zero
4.31. SHAPE
4.31.1. shape_apply_token
4.31.2. shape_cond
4.31.3. bitfield
4.31.4. bottom
4.31.5. compound
4.31.6. floating
4.31.7. integer
4.31.8. nof
4.31.9. offset
4.31.10. pointer
4.31.11. proc
4.31.12. top
4.32. SIGNED_NAT
4.32.1. signed_nat_apply_token
4.32.2. signed_nat_cond
4.32.3. computed_signed_nat
4.32.4. make_signed_nat
4.32.5. snat_from_nat
4.33. SORTNAME
4.33.1. access
4.33.2. Aal_tag
4.33.3. alignment_sort
4.33.4. Abitfield_variety
4.33.5. Abool
4.33.6. Aerror_treatment
4.33.7. Aexp
4.33.8. Afloating_variety
4.33.9. foreign_sort
4.33.10. Alabel
4.33.11. Anat
4.33.12. Antest
4.33.13. Aprocprops
4.33.14. Arounding_mode
4.33.15. Ashape
4.33.16. Asigned_nat
4.33.17. Astring
4.33.18. Atag
4.33.19. Atransfer_mode
4.33.20. Atoken
4.33.21. variety
4.34. STRING
4.34.1. string_apply_token
4.34.2. string_cond
4.34.3. concat_string
4.34.4. make_string
4.35. TAG
4.35.1. tag_apply_token
4.35.2. make_tag
4.36. TAGACC
4.36.1. make_tagacc
4.37. TAGDEC
4.37.1. make_id_tagdec
4.37.2. make_var_tagdec
4.37.3. common_tagdec
4.38. TAGDEC_PROPS
4.38.1. make_tagdecs
4.39. TAGDEF
4.39.1. make_id_tagdef
4.39.2. make_var_tagdef
4.39.3. common_tagdef
4.40. TAGDEF_PROPS
4.40.1. make_tagdefs
4.41. TAGSHACC
4.41.1. make_tagshacc
4.42. TDFBOOL
4.43. TDFIDENT
4.44. TDFINT
4.45. TDFSTRING
4.46. TOKDEC
4.46.1. make_tokdec
4.47. TOKDEC_PROPS
4.47.1. make_tokdecs
4.48. TOKDEF
4.48.1. make_tokdef
4.49. TOKDEF_PROPS
4.49.1. make_tokdefs
4.50. TOKEN
4.50.1. token_apply_token
4.50.2. make_tok
4.50.3. use_tokdef
4.51. TOKEN_DEFN
4.51.1. token_definition
4.52. TOKFORMALS
4.52.1. make_tokformals
4.53. TRANSFER_MODE
4.53.1. transfer_mode_apply_token
4.53.2. transfer_mode_cond
4.53.3. add_modes
4.53.4. overlap
4.53.5. standard_transfer_mode
4.53.6. trap_on_nil
4.53.7. volatile
4.53.8. complete
4.54. UNIQUE
4.54.1. make_unique
4.55. UNIT
4.55.1. make_unit
4.56. VARIETY
4.56.1. var_apply_token
4.56.2. var_cond
4.56.3. var_limits
4.56.4. var_width
4.57. VERSION_PROPS
4.57.1. make_versions
4.58. VERSION
4.58.1. make_version
4.58.2. user_info

4.1. ACCESS

Number of encoding bits: 4
Is coding extendable: yes

An ACCESS describes properties a variable or identity may have which may constrain or describe the ways in which the variable or identity is used.

Each construction which needs an ACCESS uses it in the form OPTION(ACCESS). If the option is absent the variable or identity has no special properties.

An ACCESS acts like a set of the values constant, long_jump_access, no_other_read, no_other_write, register, out_par, used_as_volatile, and visible. standard_access acts like the empty set. add_accesses is the set union operation.

4.1.1. access_apply_token

Encoding number: 1
token_value: TOKEN
token_args:  BITSTREAM param_sorts(token_value)
             → ACCESS

The token is applied to the arguments encoded in the BITSTREAM token_args to give an ACCESS.

The notation param_sorts(token_value) is intended to mean the following. The token definition or token declaration for token_value gives the SORTs of its arguments in the SORTNAME component. The BITSTREAM in token_args consists of these SORTs in the given order. If no token declaration or definition exists in the CAPSULE, the BITSTREAM cannot be read.

4.1.2. access_cond

Encoding number: 2
control: EXP INTEGER(v)
e1:      BITSTREAM ACCESS
e2:      BITSTREAM ACCESS
         → ACCESS

control is evaluated. It will be a constant at install time under the constant evaluation rules. If it is non-zero, e1 is installed at this point and e2 is ignored and never processed. If control is zero then e2 is installed at this point and e1 is ignored and never processed.

4.1.3. add_accesses

Encoding number: 3
a1: ACCESS
a2: ACCESS
    → ACCESS

A construction qualified with add_accesses has both ACCESS properties a1 and a2. This operation is associative and commutative.

4.1.4. constant

Encoding number: 4
→ ACCESS

Only a variable (not an identity) may be qualified with constant. A variable qualified with constant will retain its initialising value unchanged throughout its lifetime.

4.1.5. long_jump_access

Encoding number: 5
→ ACCESS

An object must also have this property if it is to have a defined value when a long_jump returns to the procedure declaring the object.

4.1.6. no_other_read

Encoding number: 6
→ ACCESS

This property refers to a POINTER, p. It says that, within the lifetime of the declaration being qualified, there are no contents, contents_with_mode or move_some source accesses to any pointer not derived from p which overlap with any of the contents, contents_with_mode, assign, assign_with_mode or move_some accesses to pointers derived from p.

The POINTER being described is that obtained by applying obtain_tag to the TAG of the declaration. If the declaration is an identity, the SHAPE of the TAG will be a POINTER.

4.1.7. no_other_write

Encoding number: 7
→ ACCESS

This property refers to a POINTER, p. It says that, within the lifetime of the declaration being qualified, there are no assign, assign_with_mode or move_some destination accesses to any pointer not derived from p which overlap with any of the contents, contents_with_mode, assign, assign_with_mode or move_some accesses to pointers derived from p.

The POINTER being described is that obtained by applying obtain_tag to the TAG of the declaration. If the declaration is an identity, the SHAPE of the TAG will be a POINTER.

4.1.8. out_par

Encoding number: 8
→ ACCESS

An object qualified by out_par will be an output parameter in a make_general_proc construct. This will indicate that the final value of the parameter is required in postlude part of an apply_general_proc of this procedure.

4.1.9. preserve

Encoding number: 9
→ ACCESS

This property refers to a global object. It says that the object will be included in the final program, whether or not all possible accesses to that object are optimised away; for example by inlining all possible uses of procedure object.

4.1.10. register

Encoding number: 10
→ ACCESS

Indicates that an object with this property is frequently used. This can be taken as a recommendation to place it in a register.

4.1.11. standard_access

Encoding number: 11
→ ACCESS

An object qualified as having standard_access has normal (i.e. no special) access properties.

4.1.12. used_as_volatile

Encoding number: 12
→ ACCESS

An object qualified as having used_as_volatile will be used in a move_some, contents_with_mode or an assign_with_mode construct with TRANSFER_MODE volatile.

4.1.13. visible

Encoding number: 13
→ ACCESS

An object qualified as visible may be accessed when the procedure in which it is declared is not the current procedure. A TAG must have this property if it is to be used by env_offset.

4.2. AL_TAG

Number of encoding bits: 1
Is coding extendable: yes
Linkable entity identification: alignment

AL_TAGs name ALIGNMENTs. They are used so that circular definitions can be written in TDF. However, because of the definition of alignments, intrinsic circularities cannot occur.

For example, the following equation has a circular form x = alignment(pointer(alignment(x))) and it or a similar equation might occur in TDF. But since alignment(pointer(x)) is {pointer}, this reduces to x = {pointer}.

4.2.1. al_tag_apply_token

Encoding number: 2
token_value: TOKEN
token_args:  BITSTREAM param_sorts(token_value)
             → AL_TAG

The token is applied to the arguments encoded in the BITSTREAM token_args to give an AL_TAG.

If there is a definition for token_value in the CAPSULE then token_args is a BITSTREAM e