Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
<!-- Crown Copyright (c) 1998 -->
<HTML>
<HEAD>
<TITLE>Specification of TDF Constructs</TITLE>
</HEAD>
<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#400080" ALINK="#FF0000">
<H1>TDF Specification, Issue 4.0</H1>
<H3>January 1998</H3>
<A HREF="spec9.html"><IMG SRC="../images/next.gif" ALT="next section"></A>
<A HREF="spec7.html"><IMG SRC="../images/prev.gif" ALT="previous section"></A>
<A HREF="spec1.html"><IMG SRC="../images/top.gif" ALT="current document"></A>
<A HREF="../index.html"><IMG SRC="../images/home.gif" ALT="TenDRA home page">
</A>
<A HREF="spec12.html"><IMG SRC="../images/index.gif" ALT="document index"></A>
<P>
<HR>
<DL>
<DT><A HREF="#M296"><B>5.1</B> - ACCESS</A><DD>
<DL>
<DT><A HREF="#M3"><B>5.1.1</B> - access_apply_token</A><DD>
<DT><A HREF="#M4"><B>5.1.2</B> - access_cond</A><DD>
<DT><A HREF="#M5"><B>5.1.3</B> - add_accesses</A><DD>
<DT><A HREF="#M6"><B>5.1.4</B> - constant</A><DD>
<DT><A HREF="#M7"><B>5.1.5</B> - long_jump_access</A><DD>
<DT><A HREF="#M8"><B>5.1.6</B> - no_other_read</A><DD>
<DT><A HREF="#M9"><B>5.1.7</B> - no_other_write</A><DD>
<DT><A HREF="#M10"><B>5.1.8</B> - out_par</A><DD>
<DT><A HREF="#M11"><B>5.1.9</B> - preserve</A><DD>
<DT><A HREF="#M12"><B>5.1.10</B> - register</A><DD>
<DT><A HREF="#M13"><B>5.1.11</B> - standard_access</A><DD>
<DT><A HREF="#M14"><B>5.1.12</B> - used_as_volatile</A><DD>
<DT><A HREF="#M15"><B>5.1.13</B> - visible</A><DD>
</DL>
<DT><A HREF="#M297"><B>5.2</B> - AL_TAG</A><DD>
<DL>
<DT><A HREF="#M17"><B>5.2.1</B> - al_tag_apply_token</A><DD>
<DT><A HREF="#M18"><B>5.2.2</B> - make_al_tag</A><DD>
</DL>
<DT><A HREF="#M19"><B>5.3</B> - AL_TAGDEF</A><DD>
<DL>
<DT><A HREF="#M20"><B>5.3.1</B> - make_al_tagdef</A><DD>
</DL>
<DT><A HREF="#M21"><B>5.4</B> - AL_TAGDEF_PROPS</A><DD>
<DL>
<DT><A HREF="#M22"><B>5.4.1</B> - make_al_tagdefs</A><DD>
</DL>
<DT><A HREF="#M26"><B>5.5</B> - ALIGNMENT</A><DD>
<DL>
<DT><A HREF="#M24"><B>5.5.1</B> - alignment_apply_token</A><DD>
<DT><A HREF="#M25"><B>5.5.2</B> - alignment_cond</A><DD>
<DT><A HREF="#M26"><B>5.5.3</B> - alignment</A><DD>
<DT><A HREF="#M27"><B>5.5.4</B> - alloca_alignment</A><DD>
<DT><A HREF="#M28"><B>5.5.5</B> - callees_alignment</A><DD>
<DT><A HREF="#M29"><B>5.5.6</B> - callers_alignment</A><DD>
<DT><A HREF="#M30"><B>5.5.7</B> - code_alignment</A><DD>
<DT><A HREF="#M31"><B>5.5.8</B> - locals_alignment</A><DD>
<DT><A HREF="#M32"><B>5.5.9</B> - obtain_al_tag</A><DD>
<DT><A HREF="#M33"><B>5.5.10</B> - parameter_alignment</A><DD>
<DT><A HREF="#M34"><B>5.5.11</B> - unite_alignments</A><DD>
<DT><A HREF="#M35"><B>5.5.12</B> - var_param_alignment</A><DD>
</DL>
<DT><A HREF="#M299"><B>5.6</B> - BITFIELD_VARIETY</A><DD>
<DL>
<DT><A HREF="#M37"><B>5.6.1</B> - bfvar_apply_token</A><DD>
<DT><A HREF="#M38"><B>5.6.2</B> - bfvar_cond</A><DD>
<DT><A HREF="#M39"><B>5.6.3</B> - bfvar_bits</A><DD>
</DL>
<DT><A HREF="#M40"><B>5.7</B> - BITSTREAM</A><DD>
<DL>
</DL>
<DT><A HREF="#M300"><B>5.8</B> - BOOL</A><DD>
<DL>
<DT><A HREF="#M42"><B>5.8.1</B> - bool_apply_token</A><DD>
<DT><A HREF="#M43"><B>5.8.2</B> - bool_cond</A><DD>
<DT><A HREF="#M44"><B>5.8.3</B> - false</A><DD>
<DT><A HREF="#M45"><B>5.8.4</B> - true</A><DD>
</DL>
<DT><A HREF="#M46"><B>5.9</B> - BYTESTREAM</A><DD>
<DL>
</DL>
<DT><A HREF="#M47"><B>5.10</B> - CALLEES</A><DD>
<DL>
<DT><A HREF="#M48"><B>5.10.1</B> - make_callee_list</A><DD>
<DT><A HREF="#M49"><B>5.10.2</B> - make_dynamic_callees</A><DD>
<DT><A HREF="#M50"><B>5.10.3</B> - same_callees</A><DD>
</DL>
<DT><A HREF="#M51"><B>5.11</B> - CAPSULE</A><DD>
<DL>
<DT><A HREF="#M53"><B>5.11.1</B> - make_capsule</A><DD>
</DL>
<DT><A HREF="#M54"><B>5.12</B> - CAPSULE_LINK</A><DD>
<DL>
<DT><A HREF="#M55"><B>5.12.1</B> - make_capsule_link</A><DD>
</DL>
<DT><A HREF="#M56"><B>5.13</B> - CASELIM</A><DD>
<DL>
<DT><A HREF="#M58"><B>5.13.1</B> - make_caselim</A><DD>
</DL>
<DT><A HREF="#M59"><B>5.14</B> - ERROR_CODE</A><DD>
<DL>
<DT><A HREF="#M60"><B>5.14.1</B> - nil_access</A><DD>
<DT><A HREF="#M61"><B>5.14.2</B> - overflow</A><DD>
<DT><A HREF="#M62"><B>5.14.3</B> - stack_overflow</A><DD>
</DL>
<DT><A HREF="#M301"><B>5.15</B> - ERROR_TREATMENT</A><DD>
<DL>
<DT><A HREF="#M64"><B>5.15.1</B> - errt_apply_token</A><DD>
<DT><A HREF="#M65"><B>5.15.2</B> - errt_cond</A><DD>
<DT><A HREF="#M66"><B>5.15.3</B> - continue</A><DD>
<DT><A HREF="#M68"><B>5.15.4</B> - error_jump</A><DD>
<DT><A HREF="#M69"><B>5.15.5</B> - trap</A><DD>
<DT><A HREF="#M70"><B>5.15.6</B> - wrap</A><DD>
<DT><A HREF="#M71"><B>5.15.7</B> - impossible</A><DD>
</DL>
<DT><A HREF="#M302"><B>5.16</B> - EXP</A><DD>
<DL>
<DT><A HREF="#M73"><B>5.16.1</B> - exp_apply_token</A><DD>
<DT><A HREF="#M75"><B>5.16.2</B> - exp_cond</A><DD>
<DT><A HREF="#M76"><B>5.16.3</B> - abs</A><DD>
<DT><A HREF="#M77"><B>5.16.4</B> - add_to_ptr</A><DD>
<DT><A HREF="#M78"><B>5.16.5</B> - and</A><DD>
<DT><A HREF="#M80"><B>5.16.6</B> - apply_proc</A><DD>
<DT><A HREF="#M81"><B>5.16.7</B> - apply_general_proc</A><DD>
<DT><A HREF="#M82"><B>5.16.8</B> - assign</A><DD>
<DT><A HREF="#M83"><B>5.16.9</B> - assign_with_mode</A><DD>
<DT><A HREF="#M84"><B>5.16.10</B> - bitfield_assign</A><DD>
<DT><A HREF="#M85"><B>5.16.11</B> - bitfield_assign_with_mode</A><DD>
<DT><A HREF="#M86"><B>5.16.12</B> - bitfield_contents</A><DD>
<DT><A HREF="#M87"><B>5.16.13</B> - bitfield_contents_with_mode</A><DD>
<DT><A HREF="#M89"><B>5.16.14</B> - case</A><DD>
<DT><A HREF="#M90"><B>5.16.15</B> - change_bitfield_to_int</A><DD>
<DT><A HREF="#M91"><B>5.16.16</B> - change_floating_variety</A><DD>
<DT><A HREF="#M92"><B>5.16.17</B> - change_variety</A><DD>
<DT><A HREF="#M93"><B>5.16.18</B> - change_int_to_bitfield</A><DD>
<DT><A HREF="#M94"><B>5.16.19</B> - complex_conjugate</A><DD>
<DT><A HREF="#M95"><B>5.16.20</B> - component</A><DD>
<DT><A HREF="#M96"><B>5.16.21</B> - concat_nof</A><DD>
<DT><A HREF="#M97"><B>5.16.22</B> - conditional</A><DD>
<DT><A HREF="#M98"><B>5.16.23</B> - contents</A><DD>
<DT><A HREF="#M99"><B>5.16.24</B> - contents_with_mode</A><DD>
<DT><A HREF="#M101"><B>5.16.25</B> - current_env</A><DD>
<DT><A HREF="#M102"><B>5.16.26</B> - div0</A><DD>
<DT><A HREF="#M103"><B>5.16.27</B> - div1</A><DD>
<DT><A HREF="#M104"><B>5.16.28</B> - div2</A><DD>
<DT><A HREF="#M105"><B>5.16.29</B> - env_offset</A><DD>
<DT><A HREF="#M106"><B>5.16.30</B> - env_size</A><DD>
<DT><A HREF="#M107"><B>5.16.31</B> - fail_installer</A><DD>
<DT><A HREF="#M108"><B>5.16.32</B> - float_int</A><DD>
<DT><A HREF="#M109"><B>5.16.33</B> - floating_abs</A><DD>
<DT><A HREF="#M110"><B>5.16.34</B> - floating_div</A><DD>
<DT><A HREF="#M111"><B>5.16.35</B> - floating_minus</A><DD>
<DT><A HREF="#M112"><B>5.16.36</B> - floating_maximum</A><DD>
<DT><A HREF="#M113"><B>5.16.37</B> - floating_minimum</A><DD>
<DT><A HREF="#M114"><B>5.16.38</B> - floating_mult</A><DD>
<DT><A HREF="#M116"><B>5.16.39</B> - floating_negate</A><DD>
<DT><A HREF="#M117"><B>5.16.40</B> - floating_plus</A><DD>
<DT><A HREF="#M118"><B>5.16.41</B> - floating_power</A><DD>
<DT><A HREF="#M119"><B>5.16.42</B> - floating_test</A><DD>
<DT><A HREF="#M120"><B>5.16.43</B> - goto</A><DD>
<DT><A HREF="#M121"><B>5.16.44</B> - goto_local_lv</A><DD>
<DT><A HREF="#M122"><B>5.16.45</B> - identify</A><DD>
<DT><A HREF="#M123"><B>5.16.46</B> - ignorable</A><DD>
<DT><A HREF="#M124"><B>5.16.47</B> - imaginary_part</A><DD>
<DT><A HREF="#M125"><B>5.16.48</B> - initial_value</A><DD>
<DT><A HREF="#M127"><B>5.16.49</B> - integer_test</A><DD>
<DT><A HREF="#M128"><B>5.16.50</B> - labelled</A><DD>
<DT><A HREF="#M129"><B>5.16.51</B> - last_local</A><DD>
<DT><A HREF="#M130"><B>5.16.52</B> - local_alloc</A><DD>
<DT><A HREF="#M132"><B>5.16.53</B> - local_alloc_check</A><DD>
<DT><A HREF="#M133"><B>5.16.54</B> - local_free</A><DD>
<DT><A HREF="#M134"><B>5.16.55</B> - local_free_all</A><DD>
<DT><A HREF="#M135"><B>5.16.56</B> - long_jump</A><DD>
<DT><A HREF="#M136"><B>5.16.57</B> - make_complex</A><DD>
<DT><A HREF="#M137"><B>5.16.58</B> - make_compound</A><DD>
<DT><A HREF="#M138"><B>5.16.59</B> - make_floating</A><DD>
<DT><A HREF="#M139"><B>5.16.60</B> - make_general_proc</A><DD>
<DT><A HREF="#M141"><B>5.16.61</B> - make_int</A><DD>
<DT><A HREF="#M142"><B>5.16.62</B> - make_local_lv</A><DD>
<DT><A HREF="#M143"><B>5.16.63</B> - make_nof</A><DD>
<DT><A HREF="#M144"><B>5.16.64</B> - make_nof_int</A><DD>
<DT><A HREF="#M145"><B>5.16.65</B> - make_null_local_lv</A><DD>
<DT><A HREF="#M146"><B>5.16.66</B> - make_null_proc</A><DD>
<DT><A HREF="#M147"><B>5.16.67</B> - make_null_ptr</A><DD>
<DT><A HREF="#M148"><B>5.16.68</B> - make_proc</A><DD>
<DT><A HREF="#M150"><B>5.16.69</B> - make_stack_limit</A><DD>
<DT><A HREF="#M151"><B>5.16.70</B> - make_top</A><DD>
<DT><A HREF="#M152"><B>5.16.71</B> - make_value</A><DD>
<DT><A HREF="#M153"><B>5.16.72</B> - maximum</A><DD>
<DT><A HREF="#M154"><B>5.16.73</B> - minimum</A><DD>
<DT><A HREF="#M155"><B>5.16.74</B> - minus</A><DD>
<DT><A HREF="#M156"><B>5.16.75</B> - move_some</A><DD>
<DT><A HREF="#M157"><B>5.16.76</B> - mult</A><DD>
<DT><A HREF="#M158"><B>5.16.77</B> - n_copies</A><DD>
<DT><A HREF="#M159"><B>5.16.78</B> - negate</A><DD>
<DT><A HREF="#M160"><B>5.16.79</B> - not</A><DD>
<DT><A HREF="#M161"><B>5.16.80</B> - obtain_tag</A><DD>
<DT><A HREF="#M162"><B>5.16.81</B> - offset_add</A><DD>
<DT><A HREF="#M163"><B>5.16.82</B> - offset_div</A><DD>
<DT><A HREF="#M164"><B>5.16.83</B> - offset_div_by_int</A><DD>
<DT><A HREF="#M165"><B>5.16.84</B> - offset_max</A><DD>
<DT><A HREF="#M166"><B>5.16.85</B> - offset_mult</A><DD>
<DT><A HREF="#M167"><B>5.16.86</B> - offset_negate</A><DD>
<DT><A HREF="#M169"><B>5.16.87</B> - offset_pad</A><DD>
<DT><A HREF="#M170"><B>5.16.88</B> - offset_subtract</A><DD>
<DT><A HREF="#M172"><B>5.16.89</B> - offset_test</A><DD>
<DT><A HREF="#M173"><B>5.16.90</B> - offset_zero</A><DD>
<DT><A HREF="#M174"><B>5.16.91</B> - or</A><DD>
<DT><A HREF="#M175"><B>5.16.92</B> - plus</A><DD>
<DT><A HREF="#M176"><B>5.16.93</B> - pointer_test</A><DD>
<DT><A HREF="#M177"><B>5.16.94</B> - power</A><DD>
<DT><A HREF="#M178"><B>5.16.95</B> - proc_test</A><DD>
<DT><A HREF="#M179"><B>5.16.96</B> - profile</A><DD>
<DT><A HREF="#M180"><B>5.16.97</B> - real_part</A><DD>
<DT><A HREF="#M181"><B>5.16.98</B> - rem0</A><DD>
<DT><A HREF="#M182"><B>5.16.99</B> - rem1</A><DD>
<DT><A HREF="#M183"><B>5.16.100</B> - rem2</A><DD>
<DT><A HREF="#M184"><B>5.16.101</B> - repeat</A><DD>
<DT><A HREF="#M185"><B>5.16.102</B> - return</A><DD>
<DT><A HREF="#M186"><B>5.16.103</B> - return_to_label</A><DD>
<DT><A HREF="#M187"><B>5.16.104</B> - round_with_mode</A><DD>
<DT><A HREF="#M188"><B>5.16.105</B> - rotate_left</A><DD>
<DT><A HREF="#M190"><B>5.16.106</B> - rotate_right</A><DD>
<DT><A HREF="#M193"><B>5.16.107</B> - sequence</A><DD>
<DT><A HREF="#M194"><B>5.16.108</B> - set_stack_limit</A><DD>
<DT><A HREF="#M196"><B>5.16.109</B> - shape_offset</A><DD>
<DT><A HREF="#M197"><B>5.16.110</B> - shift_left</A><DD>
<DT><A HREF="#M198"><B>5.16.111</B> - shift_right</A><DD>
<DT><A HREF="#M199"><B>5.16.112</B> - subtract_ptrs</A><DD>
<DT><A HREF="#M200"><B>5.16.113</B> - tail_call</A><DD>
<DT><A HREF="#M201"><B>5.16.114</B> - untidy_return</A><DD>
<DT><A HREF="#M202"><B>5.16.115</B> - variable</A><DD>
<DT><A HREF="#M204"><B>5.16.116</B> - xor</A><DD>
</DL>
<DT><A HREF="#M205"><B>5.17</B> - EXTERNAL</A><DD>
<DL>
<DT><A HREF="#M206"><B>5.17.1</B> - string_extern</A><DD>
<DT><A HREF="#M207"><B>5.17.2</B> - unique_extern</A><DD>
<DT><A HREF="#M208"><B>5.17.3</B> - chain_extern</A><DD>
</DL>
<DT><A HREF="#M209"><B>5.18</B> - EXTERN_LINK</A><DD>
<DL>
<DT><A HREF="#M210"><B>5.18.1</B> - make_extern_link</A><DD>
</DL>
<DT><A HREF="#M303"><B>5.19</B> - FLOATING_VARIETY</A><DD>
<DL>
<DT><A HREF="#M212"><B>5.19.1</B> - flvar_apply_token</A><DD>
<DT><A HREF="#M213"><B>5.19.2</B> - flvar_cond</A><DD>
<DT><A HREF="#M214"><B>5.19.3</B> - flvar_parms</A><DD>
<DT><A HREF="#M215"><B>5.19.4</B> - complex_parms</A><DD>
<DT><A HREF="#M216"><B>5.19.5</B> - float_of_complex</A><DD>
<DT><A HREF="#M217"><B>5.19.6</B> - complex_of_float</A><DD>
</DL>
<DT><A HREF="#M218"><B>5.20</B> - GROUP</A><DD>
<DL>
<DT><A HREF="#M219"><B>5.20.1</B> - make_group</A><DD>
</DL>
<DT><A HREF="#M305"><B>5.21</B> - LABEL</A><DD>
<DL>
<DT><A HREF="#M221"><B>5.21.1</B> - label_apply_token</A><DD>
<DT><A HREF="#M222"><B>5.21.2</B> - make_label</A><DD>
</DL>
<DT><A HREF="#M223"><B>5.22</B> - LINK</A><DD>
<DL>
<DT><A HREF="#M224"><B>5.22.1</B> - make_link</A><DD>
</DL>
<DT><A HREF="#M225"><B>5.23</B> - LINKEXTERN</A><DD>
<DL>
<DT><A HREF="#M226"><B>5.23.1</B> - make_linkextern</A><DD>
</DL>
<DT><A HREF="#M227"><B>5.24</B> - LINKS</A><DD>
<DL>
<DT><A HREF="#M228"><B>5.24.1</B> - make_links</A><DD>
</DL>
<DT><A HREF="#M306"><B>5.25</B> - NAT</A><DD>
<DL>
<DT><A HREF="#M230"><B>5.25.1</B> - nat_apply_token</A><DD>
<DT><A HREF="#M231"><B>5.25.2</B> - nat_cond</A><DD>
<DT><A HREF="#M232"><B>5.25.3</B> - computed_nat</A><DD>
<DT><A HREF="#M233"><B>5.25.4</B> - error_val</A><DD>
<DT><A HREF="#M234"><B>5.25.5</B> - make_nat</A><DD>
</DL>
<DT><A HREF="#M307"><B>5.26</B> - NTEST</A><DD>
<DL>
<DT><A HREF="#M236"><B>5.26.1</B> - ntest_apply_token</A><DD>
<DT><A HREF="#M237"><B>5.26.2</B> - ntest_cond</A><DD>
<DT><A HREF="#M238"><B>5.26.3</B> - equal</A><DD>
<DT><A HREF="#M239"><B>5.26.4</B> - greater_than</A><DD>
<DT><A HREF="#M240"><B>5.26.5</B> - greater_than_or_equal</A><DD>
<DT><A HREF="#M241"><B>5.26.6</B> - less_than</A><DD>
<DT><A HREF="#M242"><B>5.26.7</B> - less_than_or_equal</A><DD>
<DT><A HREF="#M243"><B>5.26.8</B> - not_equal</A><DD>
<DT><A HREF="#M244"><B>5.26.9</B> - not_greater_than</A><DD>
<DT><A HREF="#M245"><B>5.26.10</B> - not_greater_than_or_equal</A><DD>
<DT><A HREF="#M246"><B>5.26.11</B> - not_less_than</A><DD>
<DT><A HREF="#M247"><B>5.26.12</B> - not_less_than_or_equal</A><DD>
<DT><A HREF="#M248"><B>5.26.13</B> - less_than_or_greater_than</A><DD>
<DT><A HREF="#M249"><B>5.26.14</B> - not_less_than_and_not_greater_than</A><DD>
<DT><A HREF="#M250"><B>5.26.15</B> - comparable</A><DD>
<DT><A HREF="#M251"><B>5.26.16</B> - not_comparable</A><DD>
</DL>
<DT><A HREF="#M252"><B>5.27</B> - OTAGEXP</A><DD>
<DL>
<DT><A HREF="#M253"><B>5.27.1</B> - make_otagexp</A><DD>
</DL>
<DT><A HREF="#M308"><B>5.28</B> - PROCPROPS</A><DD>
<DL>
<DT><A HREF="#M256"><B>5.28.1</B> - procprops_apply_token</A><DD>
<DT><A HREF="#M257"><B>5.28.2</B> - procprops_cond</A><DD>
<DT><A HREF="#M258"><B>5.28.3</B> - add_procprops</A><DD>
<DT><A HREF="#M259"><B>5.28.4</B> - check_stack</A><DD>
<DT><A HREF="#M260"><B>5.28.5</B> - inline</A><DD>
<DT><A HREF="#M261"><B>5.28.6</B> - no_long_jump_dest</A><DD>
<DT><A HREF="#M262"><B>5.28.7</B> - untidy</A><DD>
<DT><A HREF="#M263"><B>5.28.8</B> - var_callees</A><DD>
<DT><A HREF="#M264"><B>5.28.9</B> - var_callers</A><DD>
</DL>
<DT><A HREF="#M266"><B>5.29</B> - PROPS</A><DD>
<DL>
</DL>
<DT><A HREF="#M309"><B>5.30</B> - ROUNDING_MODE</A><DD>
<DL>
<DT><A HREF="#M268"><B>5.30.1</B> - rounding_mode_apply_token</A><DD>
<DT><A HREF="#M269"><B>5.30.2</B> - rounding_mode_cond</A><DD>
<DT><A HREF="#M270"><B>5.30.3</B> - round_as_state</A><DD>
<DT><A HREF="#M271"><B>5.30.4</B> - to_nearest</A><DD>
<DT><A HREF="#M272"><B>5.30.5</B> - toward_larger</A><DD>
<DT><A HREF="#M273"><B>5.30.6</B> - toward_smaller</A><DD>
<DT><A HREF="#M274"><B>5.30.7</B> - toward_zero</A><DD>
</DL>
<DT><A HREF="#M310"><B>5.31</B> - SHAPE</A><DD>
<DL>
<DT><A HREF="#M276"><B>5.31.1</B> - shape_apply_token</A><DD>
<DT><A HREF="#M277"><B>5.31.2</B> - shape_cond</A><DD>
<DT><A HREF="#M278"><B>5.31.3</B> - bitfield</A><DD>
<DT><A HREF="#M279"><B>5.31.4</B> - bottom</A><DD>
<DT><A HREF="#M280"><B>5.31.5</B> - compound</A><DD>
<DT><A HREF="#M282"><B>5.31.6</B> - floating</A><DD>
<DT><A HREF="#M283"><B>5.31.7</B> - integer</A><DD>
<DT><A HREF="#M284"><B>5.31.8</B> - nof</A><DD>
<DT><A HREF="#M285"><B>5.31.9</B> - offset</A><DD>
<DT><A HREF="#M286"><B>5.31.10</B> - pointer</A><DD>
<DT><A HREF="#M287"><B>5.31.11</B> - proc</A><DD>
<DT><A HREF="#M288"><B>5.31.12</B> - top</A><DD>
</DL>
<DT><A HREF="#M311"><B>5.32</B> - SIGNED_NAT</A><DD>
<DL>
<DT><A HREF="#M290"><B>5.32.1</B> - signed_nat_apply_token</A><DD>
<DT><A HREF="#M291"><B>5.32.2</B> - signed_nat_cond</A><DD>
<DT><A HREF="#M292"><B>5.32.3</B> - computed_signed_nat</A><DD>
<DT><A HREF="#M293"><B>5.32.4</B> - make_signed_nat</A><DD>
<DT><A HREF="#M294"><B>5.32.5</B> - snat_from_nat</A><DD>
</DL>
<DT><A HREF="#M295"><B>5.33</B> - SORTNAME</A><DD>
<DL>
<DT><A HREF="#M296A"><B>5.33.1</B> - access</A><DD>
<DT><A HREF="#M297A"><B>5.33.2</B> - al_tag</A><DD>
<DT><A HREF="#M298"><B>5.33.3</B> - alignment_sort</A><DD>
<DT><A HREF="#M299A"><B>5.33.4</B> - bitfield_variety</A><DD>
<DT><A HREF="#M300A"><B>5.33.5</B> - bool</A><DD>
<DT><A HREF="#M301A"><B>5.33.6</B> - error_treatment</A><DD>
<DT><A HREF="#M302A"><B>5.33.7</B> - exp</A><DD>
<DT><A HREF="#M303A"><B>5.33.8</B> - floating_variety</A><DD>
<DT><A HREF="#M304"><B>5.33.9</B> - foreign_sort</A><DD>
<DT><A HREF="#M305A"><B>5.33.10</B> - label</A><DD>
<DT><A HREF="#M306A"><B>5.33.11</B> - nat</A><DD>
<DT><A HREF="#M307A"><B>5.33.12</B> - ntest</A><DD>
<DT><A HREF="#M308A"><B>5.33.13</B> - procprops</A><DD>
<DT><A HREF="#M309A"><B>5.33.14</B> - rounding_mode</A><DD>
<DT><A HREF="#M310A"><B>5.33.15</B> - shape</A><DD>
<DT><A HREF="#M311A"><B>5.33.16</B> - signed_nat</A><DD>
<DT><A HREF="#M317A"><B>5.33.17</B> - string</A><DD>
<DT><A HREF="#M322A"><B>5.33.18</B> - tag</A><DD>
<DT><A HREF="#M365A"><B>5.33.19</B> - transfer_mode</A><DD>
<DT><A HREF="#M356A"><B>5.33.20</B> - token</A><DD>
<DT><A HREF="#M378A"><B>5.33.21</B> - variety</A><DD>
</DL>
<DT><A HREF="#M317"><B>5.34</B> - STRING</A><DD>
<DL>
<DT><A HREF="#M318"><B>5.34.1</B> - string_apply_token</A><DD>
<DT><A HREF="#M319"><B>5.34.2</B> - string_cond</A><DD>
<DT><A HREF="#M320"><B>5.34.3</B> - concat_string</A><DD>
<DT><A HREF="#M321"><B>5.34.4</B> - make_string</A><DD>
</DL>
<DT><A HREF="#M322"><B>5.35</B> - TAG</A><DD>
<DL>
<DT><A HREF="#M323"><B>5.35.1</B> - tag_apply_token</A><DD>
<DT><A HREF="#M324"><B>5.35.2</B> - make_tag</A><DD>
</DL>
<DT><A HREF="#M325"><B>5.36</B> - TAGACC</A><DD>
<DL>
<DT><A HREF="#M326"><B>5.36.1</B> - make_tagacc</A><DD>
</DL>
<DT><A HREF="#M327"><B>5.37</B> - TAGDEC</A><DD>
<DL>
<DT><A HREF="#M328"><B>5.37.1</B> - make_id_tagdec</A><DD>
<DT><A HREF="#M329"><B>5.37.2</B> - make_var_tagdec</A><DD>
<DT><A HREF="#M331"><B>5.37.3</B> - common_tagdec</A><DD>
</DL>
<DT><A HREF="#M332"><B>5.38</B> - TAGDEC_PROPS</A><DD>
<DL>
<DT><A HREF="#M333"><B>5.38.1</B> - make_tagdecs</A><DD>
</DL>
<DT><A HREF="#M334"><B>5.39</B> - TAGDEF</A><DD>
<DL>
<DT><A HREF="#M335"><B>5.39.1</B> - make_id_tagdef</A><DD>
<DT><A HREF="#M336"><B>5.39.2</B> - make_var_tagdef</A><DD>
<DT><A HREF="#M338"><B>5.39.3</B> - common_tagdef</A><DD>
</DL>
<DT><A HREF="#M340"><B>5.40</B> - TAGDEF_PROPS</A><DD>
<DL>
<DT><A HREF="#M341"><B>5.40.1</B> - make_tagdefs</A><DD>
</DL>
<DT><A HREF="#M342"><B>5.41</B> - TAGSHACC</A><DD>
<DL>
<DT><A HREF="#M343"><B>5.41.1</B> - make_tagshacc</A><DD>
</DL>
<DT><A HREF="#M344"><B>5.42</B> - TDFBOOL</A><DD>
<DL>
</DL>
<DT><A HREF="#M345"><B>5.43</B> - TDFIDENT</A><DD>
<DL>
</DL>
<DT><A HREF="#M346"><B>5.44</B> - TDFINT</A><DD>
<DL>
</DL>
<DT><A HREF="#M347"><B>5.45</B> - TDFSTRING</A><DD>
<DL>
</DL>
<DT><A HREF="#M348"><B>5.46</B> - TOKDEC</A><DD>
<DL>
<DT><A HREF="#M349"><B>5.46.1</B> - make_tokdec</A><DD>
</DL>
<DT><A HREF="#M350"><B>5.47</B> - TOKDEC_PROPS</A><DD>
<DL>
<DT><A HREF="#M351"><B>5.47.1</B> - make_tokdecs</A><DD>
</DL>
<DT><A HREF="#M352"><B>5.48</B> - TOKDEF</A><DD>
<DL>
<DT><A HREF="#M353"><B>5.48.1</B> - make_tokdef</A><DD>
</DL>
<DT><A HREF="#M354"><B>5.49</B> - TOKDEF_PROPS</A><DD>
<DL>
<DT><A HREF="#M355"><B>5.49.1</B> - make_tokdefs</A><DD>
</DL>
<DT><A HREF="#M356"><B>5.50</B> - TOKEN</A><DD>
<DL>
<DT><A HREF="#M357"><B>5.50.1</B> - token_apply_token</A><DD>
<DT><A HREF="#M358"><B>5.50.2</B> - make_tok</A><DD>
<DT><A HREF="#M359"><B>5.50.3</B> - use_tokdef</A><DD>
</DL>
<DT><A HREF="#M360"><B>5.51</B> - TOKEN_DEFN</A><DD>
<DL>
<DT><A HREF="#M362"><B>5.51.1</B> - token_definition</A><DD>
</DL>
<DT><A HREF="#M363"><B>5.52</B> - TOKFORMALS</A><DD>
<DL>
<DT><A HREF="#M364"><B>5.52.1</B> - make_tokformals</A><DD>
</DL>
<DT><A HREF="#M365"><B>5.53</B> - TRANSFER_MODE</A><DD>
<DL>
<DT><A HREF="#M366"><B>5.53.1</B> - transfer_mode_apply_token</A><DD>
<DT><A HREF="#M367"><B>5.53.2</B> - transfer_mode_cond</A><DD>
<DT><A HREF="#M368"><B>5.53.3</B> - add_modes</A><DD>
<DT><A HREF="#M369"><B>5.53.4</B> - overlap</A><DD>
<DT><A HREF="#M370"><B>5.53.5</B> - standard_transfer_mode</A><DD>
<DT><A HREF="#M371"><B>5.53.6</B> - trap_on_nil</A><DD>
<DT><A HREF="#M372"><B>5.53.7</B> - volatile</A><DD>
<DT><A HREF="#M373"><B>5.53.8</B> - complete</A><DD>
</DL>
<DT><A HREF="#M374"><B>5.54</B> - UNIQUE</A><DD>
<DL>
<DT><A HREF="#M375"><B>5.54.1</B> - make_unique</A><DD>
</DL>
<DT><A HREF="#M376"><B>5.55</B> - UNIT</A><DD>
<DL>
<DT><A HREF="#M377"><B>5.55.1</B> - make_unit</A><DD>
</DL>
<DT><A HREF="#M378"><B>5.56</B> - VARIETY</A><DD>
<DL>
<DT><A HREF="#M379"><B>5.56.1</B> - var_apply_token</A><DD>
<DT><A HREF="#M380"><B>5.56.2</B> - var_cond</A><DD>
<DT><A HREF="#M381"><B>5.56.3</B> - var_limits</A><DD>
<DT><A HREF="#M382"><B>5.56.4</B> - var_width</A><DD>
</DL>
<DT><A HREF="#M383"><B>5.57</B> - VERSION_PROPS</A><DD>
<DL>
<DT><A HREF="#M384"><B>5.57.1</B> - make_versions</A><DD>
</DL>
<DT><A HREF="#M385"><B>5.58</B> - VERSION</A><DD>
<DL>
<DT><A HREF="#M386"><B>5.58.1</B> - make_version</A><DD>
<DT><A HREF="#M387"><B>5.58.2</B> - user_info</A><DD>
</DL>
</DL>
<HR>
<H1>5. Specification of TDF Constructs</H1>
<HR>
<H2>5.1. <A NAME=M296>ACCESS</A></H2>
<B>Number of encoding bits</B>: 4<BR>
<B>Is coding extendable</B>: yes<P>
An <CODE>ACCESS</CODE> describes properties a variable or identity
may have which may constrain or describe the ways in which the variable
or identity is used.
<P>
Each construction which needs an <CODE>ACCESS</CODE> uses it in the
form <CODE>OPTION</CODE>(<CODE>ACCESS</CODE>). If the option is absent
the variable or identity has no special properties.
<P>
An <CODE>ACCESS</CODE> acts like a set of the values <I>constant</I>,
<I>long_jump_access</I>, <I>no_other_read</I>, <I>no_other_write</I>,
<I>register</I>, <I>out_par</I>, <I>used_as_volatile</I>, and
<I>visible</I>. <I>standard_access</I> acts like the empty set.
<I>add_accesses</I> is the set union operation.
<P>
<H3>5.1.1. <A NAME=M3>access_apply_token</A></H3>
<B>Encoding number</B>: 1<P>
<PRE>
<I>token_value</I>: TOKEN
<I>token_args</I>: BITSTREAM <I>param_sorts(token_value)</I>
-> ACCESS
</PRE>
The token is applied to the arguments encoded in the <CODE>BITSTREAM</CODE>
<I>token_args</I> to give an <CODE>ACCESS</CODE>.
<P>
The notation <I>param_sorts(token_value)</I> is intended to mean the
following. The token definition or token declaration for
<I>token_value</I> gives the <CODE>SORT</CODE>s of its arguments in
the
<CODE>SORTNAME</CODE> component. The <CODE>BITSTREAM</CODE> in
<I>token_args</I> consists of these <CODE>SORT</CODE>s in the given
order. If no token declaration or definition exists in the
<CODE>CAPSULE</CODE>, the <CODE>BITSTREAM</CODE> cannot be read.
<P>
<H3>5.1.2. <A NAME=M4>access_cond</A></H3>
<B>Encoding number</B>: 2<P>
<PRE>
<I>control</I>: EXP INTEGER(<I>v</I>)
<I>e1</I>: BITSTREAM ACCESS
<I>e2</I>: BITSTREAM ACCESS
-> ACCESS
</PRE>
<I>control</I> is evaluated. It will be a constant at install time
under the constant evaluation rules. If it is non-zero, <I>e1</I>
is installed at this point and <I>e2</I> is ignored and never processed.
If <I>control</I> is zero then <I>e2</I> is installed at this point
and <I>e1</I> is ignored and never processed.
<P>
<H3>5.1.3. <A NAME=M5>add_accesses</A></H3>
<B>Encoding number</B>: 3<P>
<PRE>
<I>a1</I>: ACCESS
<I>a2</I>: ACCESS
-> ACCESS
</PRE>
A construction qualified with <I>add_accesses</I> has both
<CODE>ACCESS</CODE> properties <I>a1</I> and <I>a2</I>. This operation
is associative and commutative.
<P>
<H3>5.1.4. <A NAME=M6>constant</A></H3>
<B>Encoding number</B>: 4<P>
<PRE>
-> ACCESS
</PRE>
Only a variable (not an identity) may be qualified with <I>constant</I>.
A variable qualified with <I>constant</I> will retain its initialising
value unchanged throughout its lifetime.
<P>
<H3>5.1.5. <A NAME=M7>long_jump_access</A></H3>
<B>Encoding number</B>: 5<P>
<PRE>
-> ACCESS
</PRE>
An object must also have this property if it is to have a defined
value when a <I>long_jump</I> returns to the procedure declaring the
object.
<P>
<H3>5.1.6. <A NAME=M8>no_other_read</A></H3>
<B>Encoding number</B>: 6<P>
<PRE>
-> ACCESS
</PRE>
This property refers to a <CODE>POINTER</CODE>, <I>p</I>. It says
that, within the lifetime of the declaration being qualified, there
are no <I>contents</I>, <I>contents_with_mode</I> or <I>move_some</I>
source accesses to any pointer not derived from <I>p</I> which overlap
with any of the <I>contents</I>, <I>contents_with_mode</I>, <I>assign</I>,
<I>assign_with_mode</I> or <I>move_some</I> accesses to pointers derived
from <I>p</I>.
<P>
The <CODE>POINTER</CODE> being described is that obtained by applying
<I>obtain_tag</I> to the <CODE>TAG</CODE> of the declaration. If the
declaration is an <I>identity</I>, the <CODE>SHAPE</CODE> of the
<CODE>TAG</CODE> will be a <CODE>POINTER</CODE>.
<P>
<H3>5.1.7. <A NAME=M9>no_other_write</A></H3>
<B>Encoding number</B>: 7<P>
<PRE>
-> ACCESS
</PRE>
This property refers to a <CODE>POINTER</CODE>, <I>p</I>. It says
that, within the lifetime of the declaration being qualified, there
are no <I>assign</I>, <I>assign_with_mode</I> or <I>move_some</I>
destination accesses to any pointer not derived from <I>p</I> which
overlap with any of the <I>contents</I>, <I>contents_with_mode</I>,
<I>assign</I>, <I>assign_with_mode</I> or <I>move_some</I> accesses
to pointers derived from <I>p</I>.
<P>
The <CODE>POINTER</CODE> being described is that obtained by applying
<I>obtain_tag</I> to the <CODE>TAG</CODE> of the declaration. If the
declaration is an <I>identity</I>, the <CODE>SHAPE</CODE> of the
<CODE>TAG</CODE> will be a <CODE>POINTER</CODE>.
<P>
<H3>5.1.8. <A NAME=M10>out_par</A></H3>
<B>Encoding number</B>: 8<P>
<PRE>
-> ACCESS
</PRE>
An object qualified by <I>out_par</I> will be an output parameter
in a <I>make_general_proc</I> construct. This will indicate that the
final value of the parameter is required in <I>postlude</I> part of
an <I>apply_general_proc</I> of this procedure.
<P>
<H3>5.1.9. <A NAME=M11>preserve</A></H3>
<B>Encoding number</B>: 9<P>
<PRE>
-> ACCESS
</PRE>
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.
<P>
<H3>5.1.10. <A NAME=M12>register</A></H3>
<B>Encoding number</B>: 10<P>
<PRE>
-> ACCESS
</PRE>
Indicates that an object with this property is frequently used. This
can be taken as a recommendation to place it in a register.
<P>
<H3>5.1.11. <A NAME=M13>standard_access</A></H3>
<B>Encoding number</B>: 11<P>
<PRE>
-> ACCESS
</PRE>
An object qualified as having <I>standard_access</I> has normal (i.e.
no special) access properties.
<P>
<H3>5.1.12. <A NAME=M14>used_as_volatile</A></H3>
<B>Encoding number</B>: 12<P>
<PRE>
-> ACCESS
</PRE>
An object qualified as having <I>used_as_volatile</I> will be used
in a
<I>move_some</I>, <I>contents_with_mode</I> or an
<I>assign_with_mode</I> construct with <CODE>TRANSFER_MODE</CODE>
<I>volatile</I>.
<P>
<H3>5.1.13. <A NAME=M15>visible</A></H3>
<B>Encoding number</B>: 13<P>
<PRE>
-> ACCESS
</PRE>
An object qualified as <I>visible</I> may be accessed when the procedure
in which it is declared is not the current procedure. A <CODE>TAG</CODE>
must have this property if it is to be used by <I>env_offset</I>.
<P>
<HR>
<H2>5.2. <A NAME=M297>AL_TAG</A></H2>
<B>Number of encoding bits</B>: 1<BR>
<B>Is coding extendable</B>: yes<BR>
<B>Linkable entity identification</B>: <I>alignment</I><P>
<CODE>AL_TAG</CODE>s name <CODE>ALIGNMENT</CODE>s. They are used so
that circular definitions can be written in TDF. However, because
of the definition of alignments, intrinsic circularities cannot occur.
<P>
<I>For example, the following equation has a circular form</I>
<I>x = alignment(pointer(alignment(x))) and it or a similar equation
might occur in TDF. But since
</I><I>alignment</I>(<I>pointer</I>(<I>x</I>)) is {<I>pointer</I>},
this reduces to <I>x</I> = {<I>pointer</I>}.
<H3>5.2.1. <A NAME=M17>al_tag_apply_token</A></H3>
<B>Encoding number</B>: 2<P>
<PRE>
<I>token_value</I>: TOKEN
<I>token_args</I>: BITSTREAM <I>param_sorts(token_value)</I>
-> AL_TAG
</PRE>
The token is applied to the arguments encoded in the <CODE>BITSTREAM</CODE>
<I>token_args</I> to give an <CODE>AL_TAG</CODE>.
<P>
If there is a definition for <I>token_value</I> in the <CODE>CAPSULE</CODE>
then <I>token_args</I> is a <CODE>BITSTREAM</CODE> encoding of the
<CODE>SORT</CODE>s of its parameters, in the order specified.
<P>
<H3>5.2.2. <A NAME=M18>make_al_tag</A></H3>
<B>Encoding number</B>: 1<P>
<PRE>
<I>al_tagno</I>: TDFINT
-> AL_TAG
</PRE>
<I>make_al_tag</I> constructs an <CODE>AL_TAG</CODE> identified by
<I>al_tagno</I>.
<P>
<HR>
<H2>5.3. <A NAME=M19>AL_TAGDEF</A></H2>
<B>Number of encoding bits</B>: 1<BR>
<B>Is coding extendable</B>: yes<P>
An <CODE>AL_TAGDEF</CODE> gives the definition of an <CODE>AL_TAG</CODE>
for incorporation into a <CODE>AL_TAGDEF_PROPS</CODE>.
<P>
<H3>5.3.1. <A NAME=M20>make_al_tagdef</A></H3>
<B>Encoding number</B>: 1<P>
<PRE>
<I>t</I>: TDFINT
<I>a</I>: ALIGNMENT
-> AL_TAGDEF
</PRE>
The <CODE>AL_TAG</CODE> identified by <I>t</I> is defined to stand
for the <CODE>ALIGNMENT</CODE> <I>a</I>. All the <CODE>AL_TAGDEF</CODE>s
in a <CODE>CAPSULE</CODE> must be considered together as a set of
simultaneous equations defining <CODE>ALIGNMENT</CODE> values for
the <CODE>AL_TAG</CODE>s. No order is imposed on the definitions.
<P>
In any particular <CODE>CAPSULE</CODE> the set of equations may be
incomplete, but a <CODE>CAPSULE</CODE> which is being translated into
code will have a set of equations which defines all the
<CODE>AL_TAG</CODE>s which it uses.
<P>
The result of the evaluation of the <I>control</I> argument of any
<I>x_cond</I> construction (e.g <I>alignment_cond</I>) used in <I>a</I>
shall be independent of any <CODE>AL_TAG</CODE>s used in the
<I>control</I>. Simultaneous equations defining <CODE>ALIGNMENT</CODE>s
can then always be solved.
<P>
See <A HREF="spec10.html#32">Circular types in languages</A>.
<P>
<HR>
<H2>5.4. <A NAME=M21>AL_TAGDEF_PROPS</A></H2>
<B>Number of encoding bits</B>: 0<BR>
<B>Is coding extendable</B>: no<BR>
<B>Unit identification</B>: <I>aldef</I><P>
<H3>5.4.1. <A NAME=M22>make_al_tagdefs</A></H3>
<B>Encoding number</B>: 0<P>
<PRE>
<I>no_labels</I>: TDFINT
<I>tds</I>: SLIST(AL_TAGDEF)
-> AL_TAGDEF_PROPS
</PRE>
<I>no_labels</I> is the number of local <CODE>LABEL</CODE>s used in
<I>tds</I>. <I>tds</I> is a list of <CODE>AL_TAGDEF</CODE>s which
define the bindings for <I>al_tags</I>.
<P>
<HR>
<H2>5.5. <A NAME=M26>ALIGNMENT</A></H2>
<B>Number of encoding bits</B>: 4<BR>
<B>Is coding extendable</B>: yes<P>
An <CODE>ALIGNMENT</CODE> gives information about the layout of data
in memory and hence is a parameter for the <CODE>POINTER</CODE> and
<CODE>OFFSET SHAPE</CODE>s (see <A HREF="spec10.html#26">Memory Model</A>).
This information consists of a set of elements.
<P>
The possible values of the elements in such a set are <I>proc</I>,
<I>code</I>, <I>pointer</I>, <I>offset</I>, all <CODE>VARIETY</CODE>s,
all <CODE>FLOATING_VARIETY</CODE>s and all
<CODE>BITFIELD_VARIETY</CODE>s. The sets are written here as, for
example, {<I>pointer</I>, <I>proc</I>} meaning the set containing
<I>pointer</I> and <I>proc</I>.
<P>
In addition, there are "special" <CODE>ALIGNMENT</CODE>s
<I>alloca_alignment</I>, <I>callers_alignment</I>,
<I>callees_alignment</I>, <I>locals_alignment</I> and
<I>var_param_alignment</I>. Each of these are considered to be sets
which include all of the "ordinary" <CODE>ALIGNMENT</CODE>s
above.
<P>
There is a function, <I>alignment</I>, which can be applied to a
<CODE>SHAPE</CODE> to give an <CODE>ALIGNMENT</CODE> (see the definition
below). The interpretation of a <CODE>POINTER</CODE> to an
<CODE>ALIGNMENT</CODE>, <I>a</I>, is that it can serve as a
<CODE>POINTER</CODE> to any <CODE>SHAPE</CODE>, <I>s</I>, such that
<I>alignment</I>(<I>s</I>) is a subset of the set <I>a</I>.
<P>
So given a <CODE>POINTER</CODE>({<I>proc</I>, <I>pointer</I>}) it
is permitted to assign a <CODE>PROC</CODE> or a <CODE>POINTER</CODE>
to it, or indeed a compound containing only <CODE>PROC</CODE>s and
<CODE>POINTER</CODE>s. This permission is valid only in respect of
the space being of the right kind; it may or may not be big enough
for the data.
<P>
The most usual use for <CODE>ALIGNMENT</CODE> is to ensure that addresses
of <I>int</I> values are aligned on 4-byte boundaries, <I>float</I>
values are aligned on 4-byte boundaries, <I>double</I>s on 8-bit boundaries
etc. and whatever may be implied by the definitions of the machines
and languages involved.
<P>
In the specification the phrase "<I>a</I> will include <I>b</I>"
where <I>a</I> and <I>b</I> are <CODE>ALIGNMENT</CODE>s, means that
the set <I>b</I> will be a subset of <I>a</I> (or equal to <I>a</I>).
<P>
<H3>5.5.1. <A NAME=M24>alignment_apply_token</A></H3>
<B>Encoding number</B>: 1<P>
<PRE>
<I>token_value</I>: TOKEN
<I>token_args</I>: BITSTREAM <I>param_sorts(token_value)</I>
-> ALIGNMENT
</PRE>
The token is applied to the arguments encoded in the <CODE>BITSTREAM</CODE>
<I>token_args</I> to give an <CODE>ALIGNMENT</CODE>.
<P>
If there is a definition for <I>token_value</I> in the <CODE>CAPSULE</CODE>
then <I>token_args</I> is a <CODE>BITSTREAM</CODE> encoding of the
<CODE>SORT</CODE>s of its parameters, in the order specified.
<P>
<H3>5.5.2. <A NAME=M25>alignment_cond</A></H3>
<B>Encoding number</B>: 2<P>
<PRE>
<I>control</I>: EXP INTEGER(<I>v</I>)
<I>e1</I>: BITSTREAM ALIGNMENT
<I>e2</I>: BITSTREAM ALIGNMENT
-> ALIGNMENT
</PRE>
<I>control</I> is evaluated. It will be a constant at install time
under the constant evaluation rules. If it is non-zero, <I>e1</I>
is installed at this point and <I>e2</I> is ignored and never processed.
If <I>control</I> is zero then <I>e2</I> is installed at this point
and <I>e1</I> is ignored and never processed.
<P>
<H3>5.5.3. <A NAME=M26A>alignment</A></H3>
<B>Encoding number</B>: 3<P>
<PRE>
<I>sha</I>: SHAPE
-> ALIGNMENT
</PRE>
The <I>alignment</I> construct is defined as follows:
<UL>
<LI>If <I>sha</I> is <CODE>PROC</CODE> then the resulting
<CODE>ALIGNMENT</CODE> is {<I>proc</I>}.
<LI>If <I>sha</I> is <CODE>INTEGER</CODE>(<I>v</I>) then the resulting
<CODE>ALIGNMENT</CODE> is {<I>v</I>}.
<LI>If <I>sha</I> is <CODE>FLOATING</CODE>(<I>v</I>) then the resulting
<CODE>ALIGNMENT</CODE> is {<I>v</I>}.
<LI>If <I>sha</I> is <CODE>BITFIELD</CODE>(<I>v</I>) then the resulting
<CODE>ALIGNMENT</CODE> is {<I>v</I>}.
<LI>If <I>sha</I> is <CODE>TOP</CODE> the resulting <CODE>ALIGNMENT</CODE>
is {} - the empty set.
<LI>If <I>sha</I> is <CODE>BOTTOM</CODE> the resulting <CODE>ALIGNMENT</CODE>
is undefined.
<LI>If <I>sha</I> is <CODE>POINTER</CODE>(<I>x</I>) the resulting
<CODE>ALIGNMENT</CODE> is {<I>pointer</I>}.
<LI>If <I>sha</I> is <CODE>OFFSET</CODE>(<I>x</I>, <I>y</I>) the resulting
<CODE>ALIGNMENT</CODE> is {<I>offset</I>}.
<LI>If <I>sha</I> is <CODE>NOF</CODE>(<I>n</I>, <I>s</I>) the resulting
<CODE>ALIGNMENT</CODE> is <I>alignment</I>(<I>s</I>).
<LI>If <I>sha</I> is <CODE>COMPOUND</CODE>(<CODE>EXP OFFSET</CODE>(<I>x</I>,
<I>y</I>)) then the resulting <CODE>ALIGNMENT</CODE> is <I>x</I>.
</UL>
<P>
<H3>5.5.4. <A NAME=M27>alloca_alignment</A></H3>
<B>Encoding number</B>: 4<P>
<PRE>
-> ALIGNMENT
</PRE>
Delivers the <CODE>ALIGNMENT</CODE> of <CODE>POINTER</CODE>s produced
from <I>local_alloc</I>.
<P>
<H3>5.5.5. <A NAME=M28>callees_alignment</A></H3>
<B>Encoding number</B>: 5<P>
<PRE>
<I>var</I>: BOOL
-> ALIGNMENT
</PRE>
If <I>var</I> is <I>true</I> the <CODE>ALIGNMENT</CODE> is that of
callee parameters qualified by the <CODE>PROCPROPS</CODE>
<I>var_callees</I>. If <I>var</I> is <I>false</I>, the
<CODE>ALIGNMENT</CODE> is that of callee parameters not qualified
by
<CODE>PROCPROPS</CODE> <I>var_callees</I>.
<P>
Delivers the <CODE>base ALIGNMENT</CODE> of <CODE>OFFSET</CODE>s from
a frame-pointer to a <CODE>CALLEE</CODE> parameter. Values of such
<CODE>OFFSET</CODE>s can only be produced by <I>env_offset</I> applied
to <CODE>CALLEE</CODE> parameters, or offset arithmetic operations
applied to existing <CODE>OFFSET</CODE>s.
<P>
<H3>5.5.6. <A NAME=M29>callers_alignment</A></H3>
<B>Encoding number</B>: 6<P>
<PRE>
<I>var</I>: BOOL
-> ALIGNMENT
</PRE>
If <I>var</I> is <I>true</I> the <CODE>ALIGNMENT</CODE> is that of
caller parameters qualified by the <CODE>PROCPROPS</CODE>
<I>var_callers</I>. If <I>var</I> is <I>false</I>, the
<CODE>ALIGNMENT</CODE> is that of caller parameters not qualified
by
<CODE>PROCPROPS</CODE> <I>var_callers</I>.
<P>
Delivers the <CODE>base ALIGNMENT</CODE> of <CODE>OFFSET</CODE>s from
a frame-pointer to a <CODE>CALLER</CODE> parameter. Values of such
<CODE>OFFSET</CODE>s can only be produced by <I>env_offset</I> applied
to <CODE>CALLER</CODE> parameters, or offset arithmetic operations
applied to existing <CODE>OFFSET</CODE>s.
<P>
<H3>5.5.7. <A NAME=M30>code_alignment</A></H3>
<B>Encoding number</B>: 7<P>
<PRE>
-> ALIGNMENT
</PRE>
Delivers {<I>code</I>}, the <CODE>ALIGNMENT</CODE> of the
<CODE>POINTER</CODE> produced by <I>make_local_lv</I>.
<P>
<H3>5.5.8. <A NAME=M31>locals_alignment</A></H3>
<B>Encoding number</B>: 8<P>
<PRE>
-> ALIGNMENT
</PRE>
Delivers the <CODE>base ALIGNMENT</CODE> of <CODE>OFFSET</CODE>s from
a frame-pointer to a value defined by <I>variable</I> or <I>identify</I>.
Values of such <CODE>OFFSET</CODE>s can only be produced by
<I>env_offset</I> applied to <CODE>TAG</CODE>s so defined, or offset
arithmetic operations applied to existing <CODE>OFFSET</CODE>s.
<P>
<H3>5.5.9. <A NAME=M32>obtain_al_tag</A></H3>
<B>Encoding number</B>: 9<P>
<PRE>
<I>at</I>: AL_TAG
-> ALIGNMENT
</PRE>
<I>obtain_al_tag</I> produces the <CODE>ALIGNMENT</CODE> with which
the <CODE>AL_TAG</CODE> <I>at</I> is bound.
<P>
<P>
<H3>5.5.10. <A NAME=M33>parameter_alignment</A></H3>
<B>Encoding number</B>: 10<P>
<PRE>
<I>sha</I>: SHAPE
-> ALIGNMENT
</PRE>
Delivers the <CODE>ALIGNMENT</CODE> of a parameter of a procedure
of <CODE>SHAPE</CODE> <I>sha</I>.
<P>
<H3>5.5.11. <A NAME=M34>unite_alignments</A></H3>
<B>Encoding number</B>: 11<P>
<PRE>
<I>a1</I>: ALIGNMENT
<I>a2</I>: ALIGNMENT
-> ALIGNMENT
</PRE>
<I>unite_alignments</I> produces the alignment at which all the members
of the <CODE>ALIGNMENT</CODE> sets <I>a1</I> and <I>a2</I> can be
placed - in other words the <CODE>ALIGNMENT</CODE> set which is the
union of <I>a1</I> and <I>a2</I>.
<P>
<H3>5.5.12. <A NAME=M35>var_param_alignment</A></H3>
<B>Encoding number</B>: 12<P>
<PRE>
-> ALIGNMENT
</PRE>
Delivers the <CODE>ALIGNMENT</CODE> used in the <I>var_param</I> argument
of <I>make_proc</I>.
<P>
<HR>
<H2>5.6. <A NAME=M299>BITFIELD_VARIETY</A></H2>
<B>Number of encoding bits</B>: 2<BR>
<B>Is coding extendable</B>: yes<P>
These describe runtime bitfield values. The intention is that these
values are usually kept in memory locations which need not be aligned
on addressing boundaries.
<P>
There is no limit on the size of bitfield values in TDF, but an installer
may specify limits. See <A HREF="spec10.html#66">Representing bitfields</A>
and <A HREF="spec10.html#68">Permitted limits</A>.
<P>
<H3>5.6.1. <A NAME=M37>bfvar_apply_token</A></H3>
<B>Encoding number</B>: 1<P>
<PRE>
<I>token_value</I>: TOKEN
<I>token_args</I>: BITSTREAM <I>param_sorts(token_value)</I>
-> BITFIELD_VARIETY
</PRE>
The token is applied to the arguments encoded in the <CODE>BITSTREAM</CODE>
<I>token_args</I> to give a <CODE>BITFIELD_VARIETY</CODE>.
<P>
If there is a definition for <I>token_value</I> in the <CODE>CAPSULE</CODE>
then <I>token_args</I> is a <CODE>BITSTREAM</CODE> encoding of the
<CODE>SORT</CODE>s of its parameters, in the order specified.
<P>
<H3>5.6.2. <A NAME=M38>bfvar_cond</A></H3>
<B>Encoding number</B>: 2<P>
<PRE>
<I>control</I>: EXP INTEGER(<I>v</I>)
<I>e1</I>: BITSTREAM BITFIELD_VARIETY
<I>e2</I>: BITSTREAM BITFIELD_VARIETY
-> BITFIELD_VARIETY
</PRE>
<I>control</I> is evaluated. It will be a constant at install time
under the constant evaluation rules. If it is non-zero, <I>e1</I>
is installed at this point and <I>e2</I> is ignored and never processed.
If <I>control</I> is zero then <I>e2</I> is installed at this point
and <I>e1</I> is ignored and never processed.
<P>
<H3>5.6.3. <A NAME=M39>bfvar_bits</A></H3>
<B>Encoding number</B>: 3<P>
<PRE>
<I>issigned</I>: BOOL
<I>bits</I>: NAT
-> BITFIELD_VARIETY
</PRE>
<I>bfvar_bits</I> constructs a <CODE>BITFIELD_VARIETY</CODE> describing
a pattern of <I>bits</I> bits. If <I>issigned</I> is <I>true</I>,
the pattern is considered to be a twos-complement signed number: otherwise
it is considered to be unsigned.
<P>
<HR>
<H2>5.7. <A NAME=M40>BITSTREAM</A></H2>
A <CODE>BITSTREAM</CODE> consists of an encoding of any number of
bits. This encoding is such that any program reading TDF can determine
how to skip over it. To read it meaningfully extra knowledge of what
it represents may be needed.
<P>
A <CODE>BITSTREAM</CODE> is used, for example, to supply parameters
in a <CODE>TOKEN</CODE> application. If there is a definition of this
<CODE>TOKEN</CODE> available, this will provide the information needed
to decode the bitstream.
<P>
See <A HREF="spec11.html#17">The TDF encoding</A>.
<P>
<HR>
<H2>5.8. <A NAME=M300>BOOL</A></H2>
<B>Number of encoding bits</B>: 3<BR>
<B>Is coding extendable</B>: yes<P>
A <CODE>BOOL</CODE> is a piece of TDF which can take two values,
<I>true</I> or <I>false</I>.
<P>
<H3>5.8.1. <A NAME=M42>bool_apply_token</A></H3>
<B>Encoding number</B>: 1<P>
<PRE>
<I>token_value</I>: TOKEN
<I>token_args</I>: BITSTREAM <I>param_sorts(token_value)</I>
-> BOOL
</PRE>
The token is applied to the arguments encoded in the <CODE>BITSTREAM</CODE>
<I>token_args</I> to give a <CODE>BOOL</CODE>.
<P>
If there is a definition for <I>token_value</I> in the <CODE>CAPSULE</CODE>
then <I>token_args</I> is a <CODE>BITSTREAM</CODE> encoding of the
<CODE>SORT</CODE>s of its parameters, in the order specified.
<P>
<H3>5.8.2. <A NAME=M43>bool_cond</A></H3>
<B>Encoding number</B>: 2<P>
<PRE>
<I>control</I>: EXP INTEGER(<I>v</I>)
<I>e1</I>: BITSTREAM BOOL
<I>e2</I>: BITSTREAM BOOL
-> BOOL
</PRE>
<I>control</I> is evaluated. It will be a constant at install time
under the constant evaluation rules. If it is non-zero, <I>e1</I>
is installed at this point and <I>e2</I> is ignored and never processed.
If <I>control</I> is zero then <I>e2</I> is installed at this point
and <I>e1</I> is ignored and never processed.
<P>
<H3>5.8.3. <A NAME=M44>false</A></H3>
<B>Encoding number</B>: 3<P>
<PRE>
-> BOOL
</PRE>
<I>false</I> produces a false <CODE>BOOL</CODE>.
<P>
<H3>5.8.4. <A NAME=M45>true</A></H3>
<B>Encoding number</B>: 4<P>
<PRE>
-> BOOL
</PRE>
<I>true</I> produces a true <CODE>BOOL</CODE>.
<P>
<HR>
<H2>5.9. <A NAME=M46>BYTESTREAM</A></H2>
A <CODE>BYTESTREAM</CODE> is analogous to a <CODE>BITSTREAM</CODE>,
but is encoded to permit fast copying.
<P>
See <A HREF="spec11.html#17">The TDF encoding</A>.
<P>
<HR>
<H2>5.10. <A NAME=M47>CALLEES</A></H2>
<B>Number of encoding bits</B>: 2<BR>
<B>Is coding extendable</B>: yes<P>
This is an auxilliary <CODE>SORT</CODE> used in calling procedures
by
<I>apply_general_proc</I> and <I>tail_call</I> to provide their actual
callee parameters.
<P>
<H3>5.10.1. <A NAME=M48>make_callee_list</A></H3>
<B>Encoding number</B>: 1<P>
<PRE>
<I>args</I>: LIST(EXP)
-> CALLEES
</PRE>
The list of <CODE>EXP</CODE>s <I>args</I> are evaluated in any interleaved
order and the resulting list of values form the actual callee parameters
of the call.
<P>
<H3>5.10.2. <A NAME=M49>make_dynamic_callees</A></H3>
<B>Encoding number</B>: 2<P>
<PRE>
<I>ptr</I>: EXP POINTER(<I>x</I>)
<I>sze</I>: EXP OFFSET(<I>x</I>, <I>y</I>)
-> CALLEES
</PRE>
The value of size <I>sze</I> pointed at by <I>ptr</I> forms the actual
callee parameters of the call.
<P>
The <CODE>CALLEES</CODE> value is intended to refer to a sequence
of zero or more callee parameters. <I>x</I> will include
<I>parameter_alignment</I>(<I>s</I>) for each <I>s</I> that is the
<CODE>SHAPE</CODE> of an intended callee parameter. The value addressed
by <I>ptr</I> may be produced in one of two ways. It may be produced
as a <CODE>COMPOUND SHAPE</CODE> value in the normal sense of a structure,
whose successive elements will be used to generate the sequence of
callee parameters. In this case, each element in the sequence of
<CODE>SHAPE</CODE> <I>s</I> must additionally be padded to
<I>parameter_alignment</I>(<I>s</I>). Alternatively, <I>ptr</I> may
address the callee parameters of an already activated procedure, by
referring to the first of the sequence. <I>sze</I> will be equivalent
to <I>shape_offset</I>(<I>c</I>) where <I>c</I> is the <CODE>COMPOUND
SHAPE</CODE> just described.
<P>
The call involved (i.e. <I>apply_general_proc</I> or <I>tail_call</I>)
must have a <I>var_callees</I> <CODE>PROCPROPS</CODE>.
<P>
<H3>5.10.3. <A NAME=M50>same_callees</A></H3>
<B>Encoding number</B>: 3<P>
<PRE>
-> CALLEES
</PRE>
The callee parameters of the call are the same as those of the current
procedure.
<P>
<P>
<HR>
<H2>5.11. <A NAME=M51>CAPSULE</A></H2>
<B>Number of encoding bits</B>: 0<BR>
<B>Is coding extendable</B>: no<P>
A <CODE>CAPSULE</CODE> is an independent piece of TDF. There is only
one construction, <I>make_capsule</I>.
<P>
<H3>5.11.1. <A NAME=M53>make_capsule</A></H3>
<!-- BREAK 2 -->
<B>Encoding number</B>: 0<P>
<PRE>
<I>prop_names</I>: SLIST(TDFIDENT)
<I>cap_linking</I>: SLIST(CAPSULE_LINK)
<I>ext_linkage</I>: SLIST(EXTERN_LINK)
<I>groups</I>: SLIST(GROUP)
-> CAPSULE
</PRE>
<I>make_capsule</I> brings together <CODE>UNIT</CODE>s and linking
and naming information. See <A HREF="spec5.html#2">The Overall Structure</A>.
<P>
The elements of the list, <I>prop_names</I>, correspond one-to-one
with the elements of the list, <I>groups</I>. The element of
<I>prop_names</I> is the unit identification of all the
<CODE>UNIT</CODE>s in the corresponding <CODE>GROUP</CODE>. See
<A HREF="#M266"><CODE>PROPS</CODE></A>. A <CODE>CAPSULE</CODE> need
not contain all the kinds of <CODE>UNIT</CODE>.
<P>
It is intended that new kinds of <CODE>PROPS</CODE> with new unit
identifications can be added to the standard in a purely additive
fashion, either to form a new standard or for private purposes.
<P>
The elements of the list, <I>cap_linking</I>, correspond one-to-one
with the elements of the list, <I>ext_linkage</I>. The element of
<I>cap_linking</I> gives the linkable entity identification for all
the <CODE>LINKEXTERN</CODE>s in the element of <I>ext_linkage</I>.
It also gives the number of <CODE>CAPSULE</CODE> level linkable entities
having that identification.
<P>
The elements of the list, <I>cap_linking</I>, also correspond one-to-one
with the elements of the lists called <I>local_vars</I>
in each of the <I>make_unit</I> constructions for the <CODE>UNIT</CODE>s
in <I>groups</I>. The element of <I>local_vars</I> gives the number
of <CODE>UNIT</CODE> level linkable entities having the identification
in the corresponding member of <I>cap_linking</I>.
<P>
It is intended that new kinds of linkable entity can be added to the
standard in a purely additive fashion, either to form a new standard
or for private purposes.
<P>
<I>ext_linkage</I> provides a list of lists of <CODE>LINKEXTERN</CODE>s.
These <CODE>LINKEXTERN</CODE>s specify the associations between the
names to be used outside the <CODE>CAPSULE</CODE> and the linkable
entities by which the <CODE>UNIT</CODE>s make objects available within
the <CODE>CAPSULE</CODE>.
<P>
The list, <I>groups</I>, provides the non-linkage information of the
<CODE>CAPSULE</CODE>.
<P>
<HR>
<H2>5.12. <A NAME=M54>CAPSULE_LINK</A></H2>
<B>Number of encoding bits</B>: 0<BR>
<B>Is coding extendable</B>: no<P>
An auxiliary <CODE>SORT</CODE> which gives the number of linkable
entities of a given kind at <CODE>CAPSULE</CODE> level. It is used
only in <I>make_capsule</I>.
<P>
<H3>5.12.1. <A NAME=M55>make_capsule_link</A></H3>
<B>Encoding number</B>: 0<P>
<PRE>
<I>sn</I>: TDFIDENT
<I>n</I>: TDFINT
-> CAPSULE_LINK
</PRE>
<I>n</I> is the number of <CODE>CAPSULE</CODE> level linkable entities
(numbered from 0 to <I>n</I>-1) of the kind given by <I>sn</I>. <I>sn</I>
corresponds to the linkable entity identification.
<P>
<HR>
<H2>5.13. <A NAME=M56>CASELIM</A></H2>
<B>Number of encoding bits</B>: 0<BR>
<B>Is coding extendable</B>: no<P>
An auxiliary <CODE>SORT</CODE> which provides lower and upper bounds
and the <CODE>LABEL</CODE> destination for the <I>case</I> construction.
<P>
<H3>5.13.1. <A NAME=M58>make_caselim</A></H3>
<B>Encoding number</B>: 0<P>
<PRE>
<I>branch</I>: LABEL
<I>lower</I>: SIGNED_NAT
<I>upper</I>: SIGNED_NAT
-> CASELIM
</PRE>
Makes a triple of destination and limits. The <I>case</I> construction
uses a list of <CODE>CASELIM</CODE>s. If the control variable of the
<I>case</I> lies between <I>lower</I>
and <I>upper</I>, control passes to <I>branch</I>.
<P>
<HR>
<H2>5.14. <A NAME=M59>ERROR_CODE</A></H2>
<B>Number of encoding bits</B>: 2<BR>
<B>Is coding extendable</B>: yes<P>
<H3>5.14.1. <A NAME=M60>nil_access</A></H3>
<B>Encoding number</B>: 1<P>
<PRE>
-> ERROR_CODE
</PRE>
Delivers the <CODE>ERROR_CODE</CODE> arising from an attempt to access
a nil pointer in an operation with <CODE>TRANSFER_MODE</CODE>
<I>trap_on_nil</I>.
<P>
<H3>5.14.2. <A NAME=M61>overflow</A></H3>
<B>Encoding number</B>: 2<P>
<PRE>
-> ERROR_CODE
</PRE>
Delivers the <CODE>ERROR_CODE</CODE> arising from a numerical exceptional
result in an operation with <CODE>ERROR_TREATMENT</CODE>
<I>trap</I>(<I>overflow</I>).
<P>
<H3>5.14.3. <A NAME=M62>stack_overflow</A></H3>
<B>Encoding number</B>: 3<P>
<PRE>
-> ERROR_CODE
</PRE>
Delivers the <CODE>ERROR_CODE</CODE> arising from a stack overflow
in the call of a procedure defined with <CODE>PROCPROPS</CODE>
<I>check_stack.</I><P>
<P>
<HR>
<H2>5.15. <A NAME=M301>ERROR_TREATMENT</A></H2>
<B>Number of encoding bits</B>: 3<BR>
<B>Is coding extendable</B>: yes<P>
These values describe the way to handle various forms of error which
can occur during the evaluation of operations.
<P>
<I>It is expected that additional <CODE>ERROR_TREATMENT</CODE>s will
be needed.</I>
<P>
<H3>5.15.1. <A NAME=M64>errt_apply_token</A></H3>
<B>Encoding number</B>: 1<P>
<PRE>
<I>token_value</I>: TOKEN
<I>token_args</I>: BITSTREAM <I>param_sorts(token_value)</I>
-> ERROR_TREATMENT
</PRE>
The token is applied to the arguments encoded in the <CODE>BITSTREAM</CODE>
<I>token_args</I> to give an <CODE>ERROR_TREATMENT</CODE>.
<P>
If there is a definition for <I>token_value</I> in the <CODE>CAPSULE</CODE>
then <I>token_args</I> is a <CODE>BITSTREAM</CODE> encoding of the
<CODE>SORT</CODE>s of its parameters, in the order specified.
<P>
<H3>5.15.2. <A NAME=M65>errt_cond</A></H3>
<B>Encoding number</B>: 2<P>
<PRE>
<I>control</I>: EXP INTEGER(<I>v</I>)
<I>e1</I>: BITSTREAM ERROR_TREATMENT
<I>e2</I>: BITSTREAM ERROR_TREATMENT
-> ERROR_TREATMENT
</PRE>
<I>control</I> is evaluated. It will be a constant at install time
under the constant evaluation rules. If it is non-zero, <I>e1</I>
is installed at this point and <I>e2</I> is ignored and never processed.
If <I>control</I> is zero then <I>e2</I> is installed at this point
and <I>e1</I> is ignored and never processed.
<P>
<H3>5.15.3. <A NAME=M66>continue</A></H3>
<B>Encoding number</B>: 3<P>
<PRE>
-> ERROR_TREATMENT
</PRE>
If an operation with a <I>continue</I> <CODE>ERROR_TREATMENT</CODE>
causes an error, some value of the correct <CODE>SHAPE</CODE> shall
be delivered. This value shall have the same properties as is specified
in <I>make_value</I>.
<P>
<H3>5.15.4. <A NAME=M68>error_jump</A></H3>
<B>Encoding number</B>: 4<P>
<PRE>
<I>lab</I>: LABEL
-> ERROR_TREATMENT
</PRE>
<I>error_jump</I> produces an <CODE>ERROR_TREATMENT</CODE> which requires
that control be passed to <I>lab</I> if it is invoked. <I>lab</I>
will be in scope.
<P>
If a construction has an <I>error_jump</I> <CODE>ERROR_TREATMENT</CODE>
and the jump is taken, the canonical order specifies only that the
jump occurs after evaluating the construction. It is not specified
how many further constructions are evaluated.
<P>
<I>This rule implies that a further construction is needed to guarantee
that errors have been processed. This is not yet included. The effect
of nearby procedure calls or exits also needs definition.</I>
<P>
<H3>5.15.5. <A NAME=M69>trap</A></H3>
<B>Encoding number</B>: 5<P>
<PRE>
<I>trap_list</I>: LIST(ERROR_CODE)
-> ERROR_TREATMENT
</PRE>
The list of <CODE>ERROR_CODES</CODE> in <I>trap_list</I> specifies
a set of possible exceptional behaviours. If any of these occur in
an construction with <CODE>ERROR_TREATMENT</CODE> <I>trap</I>, the
TDF exception handling is invoked (see <A HREF="spec10.html#17">section
7.8</A>).
<P>
The observations on canonical ordering in <I>error_jump</I> apply
equally here.
<P>
<H3>5.15.6. <A NAME=M70>wrap</A></H3>
<B>Encoding number</B>: 6<P>
<PRE>
-> ERROR_TREATMENT
</PRE>
<I>wrap</I> is an <CODE>ERROR_TREATMENT</CODE> which will only be
used in constructions with integer operands and delivering <CODE>EXP</CODE>
<CODE>INTEGER</CODE>(<I>v</I>) where either the lower bound of <I>v</I>
is zero or the construction is not one of <I>mult, power, div0, div1,
div2, rem0, rem1, rem2</I>. The result will be evaluated and any bits
in the result lying outside the representing <CODE>VARIETY</CODE>
will be discarded (see <A HREF="spec10.html#51">Representing integers</A>).
<P>
<H3>5.15.7. <A NAME=M71>impossible</A></H3>
<B>Encoding number</B>: 7<P>
<PRE>
-> ERROR_TREATMENT
</PRE>
<I>impossible</I> is an <CODE>ERROR_TREATMENT</CODE> which means that
this error will not occur in the construct concerned.
<P>
<I>impossible is possibly a misnomer. If an error occurs the result
is undefined.</I>
<P>
<HR>
<H2>5.16. <A NAME=M302>EXP</A></H2>
<B>Number of encoding bits</B>: 7<BR>
<B>Is coding extendable</B>: yes<P>
<CODE>EXP</CODE>s are pieces of TDF which are translated into program.
<CODE>EXP</CODE> is by far the richest <CODE>SORT</CODE>. There are
few primitive <CODE>EXP</CODE>s: most of the constructions take arguments
which are a mixture of <CODE>EXP</CODE>s and other <CODE>SORT</CODE>s.
There are constructs delivering <CODE>EXP</CODE>s that correspond
to the declarations, program structure, procedure calls, assignments,
pointer manipulation, arithmetic operations, tests etc. of programming
languages.
<P>
<H3>5.16.1. <A NAME=M73>exp_apply_token</A></H3>
<B>Encoding number</B>: 1<P>
<PRE>
<I>token_value</I>: TOKEN
<I>token_args</I>: BITSTREAM <I>param_sorts(token_value)</I>
-> EXP <I>x</I>
</PRE>
The token is applied to the arguments encoded in the <CODE>BITSTREAM</CODE>
<I>token_args</I> to give an <CODE>EXP</CODE>.
<P>
If there is a definition for <I>token_value</I> in the <CODE>CAPSULE</CODE>
then <I>token_args</I> is a <CODE>BITSTREAM</CODE> encoding of the
<CODE>SORT</CODE>s of its parameters, in the order specified.
<P>
<H3>5.16.2. <A NAME=M75>exp_cond</A></H3>
<B>Encoding number</B>: 2<P>
<PRE>
<I>control</I>: EXP INTEGER(<I>v</I>)
<I>e1</I>: BITSTREAM EXP <I>x</I>
<I>e2</I>: BITSTREAM EXP <I>y</I>
-> EXP (<I>control</I> ? <I>x</I> : <I>y</I>)
</PRE>
<I>control</I> is evaluated. It will be a constant at install time
under the constant evaluation rules. If it is non-zero, <I>e1</I>
is installed at this point and <I>e2</I> is ignored and never processed.
If <I>control</I> is zero then <I>e2</I> is installed at this point
and <I>e1</I> is ignored and never processed.
<P>
<H3>5.16.3. <A NAME=M76>abs</A></H3>
<B>Encoding number</B>: 3<P>
<PRE>
<I>ov_err</I>: ERROR_TREATMENT
<I>arg1</I>: EXP INTEGER(<I>v</I>)
-> EXP INTEGER(<I>v</I>)
</PRE>
The absolute value of the result produced by <I>arg1</I> is delivered.
<P>
If the result cannot be expressed in the <CODE>VARIETY</CODE> being
used to represent <I>v</I>, an overflow error is caused and is handled
in the way specified by <I>ov_err</I>.
<P>
<H3>5.16.4. <A NAME=M77>add_to_ptr</A></H3>
<B>Encoding number</B>: 4<P>
<PRE>
<I>arg1</I>: EXP POINTER(<I>x</I>)
<I>arg2</I>: EXP OFFSET(<I>y</I>, <I>z</I>)
-> EXP POINTER(<I>z</I>)
</PRE>
<I>arg1</I> is evaluated, giving <I>p</I>, and <I>arg2</I> is evaluated
and the results are added to produce the answer. The result is derived
from the pointer delivered by <I>arg1</I>. The intention is to produce
a <CODE>POINTER</CODE> displaced from the argument <CODE>POINTER</CODE>
by the given amount.
<P>
<I>x</I> will include <I>y</I>.
<P>
<I>arg1</I> may deliver a null <CODE>POINTER</CODE>. In this case
the result is derived from a null <CODE>POINTER</CODE> which counts
as an original <CODE>POINTER</CODE>. Further <CODE>OFFSET</CODE>s
may be added to the result, but the only other useful operation on
the result of adding a number of <CODE>OFFSET</CODE>s to a null <CODE>POINTER
</CODE>
is to <I>subtract_ptrs</I> a null <CODE>POINTER</CODE> from it.
<P>
The result will be less than or equal (in the sense of <I>pointer_test</I>)
to the result of applying <I>add_to_ptr</I> to the original pointer
from which <I>p</I> is derived and the size of the space allocated
for the original pointer.
<P>
<I>In the simple representation of <CODE>POINTER</CODE> arithmetic
(see
<A HREF="spec10.html#26">Memory Model</A>) add_to_ptr is represented
by addition. The constraint "x includes y" ensures that
no padding has to be inserted in this case.</I>
<P>
<H3>5.16.5. <A NAME=M78>and</A></H3>
<B>Encoding number</B>: 5<P>
<PRE>
<I>arg1</I>: EXP INTEGER(<I>v</I>)
<I>arg2</I>: EXP INTEGER(<I>v</I>)
-> EXP INTEGER(<I>v</I>)
</PRE>
The arguments are evaluated producing integer values of the same
<CODE>VARIETY</CODE>, <I>v</I>. The result is the bitwise <I>and</I>
of the two values in the representing <CODE>VARIETY</CODE>. The result
is delivered with the same <CODE>SHAPE</CODE> as the arguments.
<P>
See <A HREF="spec10.html#51">Representing integers</A>.
<P>
<H3>5.16.6. <A NAME=M80>apply_proc</A></H3>
<B>Encoding number</B>: 6<P>
<PRE>
<I>result_shape</I>: SHAPE
<I>p</I>: EXP PROC
<I>params</I>: LIST(EXP)
<I>var_param</I>: OPTION(EXP)
-> EXP <I>result_shape</I>
</PRE>
<I>p, params</I> and <I>var_param</I> (if present) are evaluated in
any interleaved order. The procedure, <I>p</I>, is applied to the
parameters. The result of the procedure call, which will have
<I>result_shape</I>, is delivered as the result of the construction.
<P>
The canonical order of evaluation is as if the definition were in-lined.
That is, the actual parameters are evaluated interleaved in any order
and used to initialise variables which are identified by the formal
parameters during the evaluation of the procedure body. When this
is complete the body is evaluated. So <I>apply_proc</I> is evaluated
like a <I>variable</I> construction, and obeys similar rules for order
of evaluation.
<P>
If <I>p</I> delivers a null procedure the effect is undefined.
<P>
<I>var_param</I> is intended to communicate parameters which vary
in <CODE>SHAPE</CODE> from call to call. Access to these parameters
during the procedure is performed by using <CODE>OFFSET</CODE> arithmetic.
Note that it is necessary to place these values on <I>var_param_alignment</I>
because of the definition of <I>make_proc</I>.
<P>
The optional <I>var_param</I> should not be confused with variable
argument lists in the C (<I><stdarg.h></I> or <I><varargs.h></I>)
sense, which are communicated by extending the <I>params</I> list.
This is discussed further in <A HREF="spec10.html#18">section 7.9</A>.
If the number of arguments in the <I>params</I> list differs from
the number of elements in the <I>params_intro</I> of the corresponding
<I>make_proc</I>, then <I>var_param</I> must not be present.
<P>
All calls to the same procedure will yield results of the same
<CODE>SHAPE</CODE>.
<P>
For notes on the intended implementation of procedures see
<A HREF="spec10.html#18">section 7.9</A>.
<P>
<H3>5.16.7. <A NAME=M81>apply_general_proc</A></H3>
<!-- BREAK 5 -->
<B>Encoding number</B>: 7<P>
<PRE>
<I>result_shape</I>: SHAPE
<I>prcprops</I>: OPTION(PROCPROPS)
<I>p</I>: EXP PROC
<I>callers_intro</I>: LIST(OTAGEXP)
<I>callee_pars</I>: CALLEES
<I>postlude</I>: EXP TOP
-> EXP <I>result_shape</I>
</PRE>
<I>p</I>, <I>callers_intro</I> and <I>callee_pars</I> are evaluated
in any order. The procedure, <I>p</I>, is applied to the parameters.
The result of the procedure call, which will have <I>result_shape</I>,
is delivered as the result of the construction.
<P>
If <I>p</I> delivers a null procedure the effect is undefined.
<P>
Any <CODE>TAG</CODE> introduced by an <CODE>OTAGEXP</CODE> in
<I>callers_intro</I> is available in <I>postlude</I> which will be
evaluated after the application.
<P>
<I>postlude</I> will not contain any <I>local_allocs</I> or calls
of procedures with untidy returns. If <I>prcprops</I> include
<I>untidy</I>, <I>postlude</I> will be <I>make_top</I>.
<P>
The canonical order of evaluation is as if the definition of <I>p</I>
were inlined in a manner dependent on <I>prcprops</I>.
<P>
If none of the <CODE>PROCPROPS</CODE> <I>var_callers</I>, <I>var_callees</I>
and <I>check_stack</I> are present the inlining is as follows, supposing
that P is the body of the definition of <I>p</I>:<P>
Let R<I>i</I> be the value of the <CODE>EXP</CODE> of the i<I>th</I>
<CODE>OTAGEXP</CODE> in <I>callers_intro</I> and T<I>i</I> be its
<CODE>TAG</CODE> (if it is present). Let E<I>i</I> be the i<I>th</I>
value in <I>callee_pars</I>.<BR>
Let r<I>i</I> be the i<I>th</I> formal caller parameter <CODE>TAG</CODE>
of <I>p</I>.<BR>
Let e<I>i</I> be the i<I>th</I> formal callee parameter <CODE>TAG</CODE>
of <I>p</I>.
<P>
Each R<I>i</I> is used to initialise a variable which is identified
by r<I>i</I>; there will be exactly as many R<I>i</I> as r<I>i</I>.The
scope of these variable definitions is a sequence consisting of three
components - the identification of a <CODE>TAG</CODE> <I>res</I> with
the result of a binding of P, followed by a binding of <I>postlude</I>,
followed by an <I>obtain_tag</I> of <I>res</I> giving the result of
the inlined procedure call.
<P>
The binding of P consists of using each E<I>i</I> to initialise a
variable identified with e<I>i</I>; there will be exactly as many
E<I>i</I> as e<I>i</I>. The scope of these variable definitions is
P modified so that the first <I>return</I> or <I>untidy_return</I>
encountered in P gives the result of the binding. If it ends with
a <I>return</I>, any space generated by <I>local_allocs</I> within
the binding is freed (in the sense of <I>local_free</I>) at this point.
If it ends with <I>untidy_return</I>, no freeing will take place.
<P>
The binding of <I>postlude</I> consists of identifying each T<I>i</I>
(if present) with the contents of the variable identified by r<I>i</I>.
The scope of these identifications is <I>postlude</I>.
<P>
If the <CODE>PROCPROPS</CODE> <I>var_callers</I> is present, the inlining
process is modified by:<BR>
A compound variable is constructed initialised to R<I>i</I> in order;
the alignment and padding of each individual R<I>i</I> will be given
by an exact application of <I>parameter_alignment</I> on the
<CODE>SHAPE</CODE> of R<I>i</I>. Each r<I>i</I> is then identified
with a pointer to the copy of R<I>i</I> within the compound variable;
there will be at least as many R<I>i</I> as r<I>i</I>. The evaluation
then continues as above with the scope of these identifications being
the sequence.
<P>
If the <CODE>PROCPROPS</CODE> <I>var_callees</I> is present, the inlining
process is modified by:<BR>
The binding of P is done by generating (as if by <I>local_alloc</I>)
a pointer to space for a compound value constructed from each E<I>i</I>
in order (just as for <I>var_callers</I>). Each e<I>i</I> is identified
with a pointer to the copy of E<I>i</I> within the generated space;
there will be at least as many e<I>i</I> as E<I>i</I>. P is evaluated
within the scope of these identifications as before. Note that the
generation of space for these callee parameters is a <I>local_alloc</I>
with the binding of P, and hence will not be freed if P ends with
an
<I>untidy_return</I>.
<P>
<H3>5.16.8. <A NAME=M82>assign</A></H3>
<B>Encoding number</B>: 8<P>
<PRE>
<I>arg1</I>: EXP POINTER(<I>x</I>)
<I>arg2</I>: EXP <I>y</I>
-> EXP TOP
</PRE>
The value produced by <I>arg2</I> will be put in the space indicated
by <I>arg1</I>.
<P>
<I>x</I> will include <I>alignment</I>(<I>y</I>).
<P>
<I>y</I> will not be a <CODE>BITFIELD</CODE>.
<P>
If the space which the pointer indicates does not lie wholly within
the space indicated by the original pointer from which it is derived,
the effect is undefined.
<P>
If the value delivered by <I>arg1</I> is a null pointer the effect
is undefined.
<P>
See <A HREF="spec10.html#48">Overlapping</A> and
<A HREF="spec10.html#50">Incomplete assignment</A>.
<P>
<I>The constraint "x will include alignment(y)" ensures
in the simple memory model that no change is needed to the <CODE>POINTER</CODE>.
</I>
<P>
<H3>5.16.9. <A NAME=M83>assign_with_mode</A></H3>
<B>Encoding number</B>: 9<P>
<PRE>
<I>md</I>: TRANSFER_MODE
<I>arg1</I>: EXP POINTER(<I>x</I>)
<I>arg2</I>: EXP <I>y</I>
-> EXP TOP
</PRE>
The value produced by <I>arg2</I> will be put in the space indicated
by <I>arg1</I>. The assignment will be carried out as specified by
the <CODE>TRANSFER_MODE</CODE> (q.v.).
<P>
If <I>md</I> consists of <I>standard_transfer_mode</I> only, then
<I>assign_with_mode</I> is the same as <I>assign</I>.
<P>
<I>x</I> will include <I>alignment</I>(<I>y</I>).
<P>
<I>y</I> will not be a <CODE>BITFIELD</CODE>.
<P>
If the space which the pointer indicates does not lie wholly within
the space indicated by the original pointer from which it is derived,
the effect is undefined.
<P>
If the value delivered by <I>arg1</I> is a null pointer the effect
is undefined.
<P>
See <A HREF="spec10.html#48">Overlapping</A> and
<A HREF="spec10.html#50">Incomplete assignment</A>.
<P>
<H3>5.16.10. <A NAME=M84>bitfield_assign</A></H3>
<B>Encoding number</B>: 10<P>
<PRE>
<I>arg1</I>: EXP POINTER(<I>x</I>)
<I>arg2</I>: EXP OFFSET(<I>y</I>, <I>z</I>)
<I>arg3</I>: EXP BITFIELD(<I>v</I>)
-> EXP TOP
</PRE>
The value delivered by <I>arg3</I> is assigned at a displacement given
by <I>arg2</I> from the pointer delivered by <I>arg1</I>.
<P>
<I>x</I> will include <I>y</I> and <I>z</I> will include <I>v</I>.
<P>
<I>arg2</I>, <CODE>BITFIELD</CODE>(<I>v</I>) will be
<I>variety-enclosed</I> (see <A HREF="spec10.html#66">section 7.24</A>).
<P>
<H3>5.16.11. <A NAME=M85>bitfield_assign_with_mode</A></H3>
<B>Encoding number</B>: 11<P>
<PRE>
<I>md</I>: TRANSFER_MODE
<I>arg1</I>: EXP POINTER(<I>x</I>)
<I>arg2</I>: EXP OFFSET(<I>y</I>, <I>z</I>)
<I>arg3</I>: EXP BITFIELD(<I>v</I>)
-> EXP TOP
</PRE>
The value delivered by <I>arg3</I> is assigned at a displacement given
by <I>arg2</I> from the pointer delivered by <I>arg1</I>.The assignment
will be carried out as specified by the <CODE>TRANSFER_MODE</CODE>
(q.v.).
<P>
If <I>md</I> consists of <I>standard_transfer_mode</I> only, then
<I>bitfield_assign_with_mode</I> is the same as <I>bitfield_assign</I>.
<P>
<I>x</I> will include <I>y</I> and <I>z</I> will include <I>v</I>.
<P>
<I>arg2</I>, <CODE>BITFIELD</CODE>(<I>v</I>) will be
<I>variety-enclosed</I>.(see <A HREF="spec10.html#66">section 7.24</A>).
<P>
<H3>5.16.12. <A NAME=M86>bitfield_contents</A></H3>
<B>Encoding number</B>: 12<P>
<PRE>
<I>v</I>: BITFIELD_VARIETY
<I>arg1</I>: EXP POINTER(<I>x</I>)
<I>arg2</I>: EXP OFFSET(<I>y</I>, <I>z</I>)
-> EXP BITFIELD(<I>v</I>)
</PRE>
The bitfield of <CODE>BITFIELD_VARIETY</CODE> <I>v</I>, located at
the displacement delivered by <I>arg2</I> from the pointer delivered
by <I>arg1</I> is extracted and delivered.
<P>
<I>x</I> will include <I>y</I> and <I>z</I> will include <I>v</I>.
<P>
<I>arg2</I>, <CODE>BITFIELD</CODE>(<I>v</I>) will be <I>variety_enclosed</I>
(see <A HREF="spec10.html#66">section 7.24</A>).
<P>
<H3>5.16.13. <A NAME=M87>bitfield_contents_with_mode</A></H3>
<B>Encoding number</B>: 13<P>
<PRE>
<I>md</I>: TRANSFER_MODE
<I>v</I>: BITFIELD_VARIETY
<I>arg1</I>: EXP POINTER(<I>x</I>)
<I>arg2</I>: EXP OFFSET(<I>y</I>, <I>z</I>)
-> EXP BITFIELD(<I>v</I>)
</PRE>
The bitfield of <CODE>BITFIELD_VARIETY </CODE><I>v</I>, located at
the displacement delivered by <I>arg2</I> from the pointer delivered
by <I>arg1</I> is extracted and delivered.The operation will be carried
out as specified by the <CODE>TRANSFER_MODE</CODE> (q.v.).
<P>
If <I>md</I> consists of <I>standard_transfer_mode</I> only, then
<I>bitfield_contents_with_mode</I> is the same as <I>bitfield_contents</I>.
<P>
<I>x</I> will include <I>y</I> and <I>z</I> will include <I>v</I>.
<P>
<I>arg2</I>, <CODE>BITFIELD</CODE>(<I>v</I>) will be <I>variety_enclosed</I>
(see <A HREF="spec10.html#66">section 7.24</A>).
<P>
<H3>5.16.14. <A NAME=M89>case</A></H3>
<B>Encoding number</B>: 14<P>
<PRE>
<I>exhaustive</I>: BOOL
<I>control</I>: EXP INTEGER(<I>v</I>)
<I>branches</I>: LIST(CASELIM)
-> EXP (<I>exhaustive</I> ? BOTTOM : TOP)
</PRE>
<I>control</I> is evaluated to produce an integer value, <I>c</I>.
Then <I>c</I> is tested to see if it lies inclusively between <I>lower</I>
and <I>upper</I>, for each element of <I>branches</I>. If this tests
succeeds, control passes to the label <I>branch</I> belonging to that
<CODE>CASELIM</CODE> (see <A HREF="#M56">section 5.13</A>). If <I>c</I>
lies between no pair, the construct delivers a value of
<CODE>SHAPE TOP</CODE>. The order in which the comparisons are made
is undefined.
<P>
The sets of <CODE>SIGNED_NAT</CODE>s in <I>branches</I> will be disjoint.
<P>
If <I>exhaustive</I> is true the value delivered by <I>control</I>
will lie between one of the <I>lower</I>/<I>upper</I> pairs.
<P>
<H3>5.16.15. <A NAME=M90>change_bitfield_to_int</A></H3>
<B>Encoding number</B>: 15<P>
<PRE>
<I>v</I>: VARIETY
<I>arg1</I>: EXP BITFIELD(<I>bv</I>)
-> EXP INTEGER(<I>v</I>)
</PRE>
<I>arg1</I> is evaluated and converted to a <CODE>INTEGER</CODE>(<I>v</I>).
<P>
If <I>arg1</I> exceed the bounds of <I>v</I>, the effect is undefined.
<P>
<H3>5.16.16. <A NAME=M91>change_floating_variety</A></H3>
<B>Encoding number</B>: 16<P>
<PRE>
<I>flpt_err</I>: ERROR_TREATMENT
<I>r</I>: FLOATING_VARIETY
<I>arg1</I>: EXP FLOATING(<I>f</I>)
-> EXP FLOATING(<I>r</I>)
</PRE>
<I>arg1</I> is evaluated and will produce floating point value, <I>fp</I>.
The value <I>fp</I> is delivered, changed to the representation of
the <CODE>FLOATING_VARIETY</CODE> <I>r</I>.
<P>
Either <I>r</I> and <I>f</I> will both real or both complex.
<P>
If there is a floating point error it is handled by <I>flpt_err</I>.
<P>
See <A HREF="spec10.html#60">Floating point errors</A>.
<P>
<H3>5.16.17. <A NAME=M92>change_variety</A></H3>
<B>Encoding number</B>: 17<P>
<PRE>
<I>ov_err</I>: ERROR_TREATMENT
<I>r</I>: VARIETY
<I>arg1</I>: EXP INTEGER(<I>v</I>)
-> EXP INTEGER(<I>r</I>)
</PRE>
<I>arg1</I> is evaluated and will produce an integer value, <I>a</I>.
The value <I>a</I> is delivered, changed to the representation of
the <CODE>VARIETY</CODE> <I>r</I>.
<P>
If <I>a</I> is not contained in the <CODE>VARIETY</CODE> being used
to represent <I>r</I>, an overflow occurs and is handled according
to <I>ov_err</I>.
<P>
<H3>5.16.18. <A NAME=M93>change_int_to_bitfield</A></H3>
<B>Encoding number</B>: 18<P>
<PRE>
<I>bv</I>: BITFIELD_VARIETY
<I>arg1</I>: EXP INTEGER(<I>v</I>)
-> EXP BITFIELD(<I>bv</I>)
</PRE>
<I>arg1</I> is evaluated and converted to a <CODE>BITFIELD</CODE>(<I>bv</I>).
<P>
If <I>arg1</I> exceed the bounds of <I>bv</I>, the effect is undefined.
<P>
<H3>5.16.19. <A NAME=M94>complex_conjugate</A></H3>
<B>Encoding number</B>: 19<P>
<PRE>
<I>c</I>: EXP FLOATING(<I>cv</I>)
-> EXP FLOATING(<I>cv</I>)
</PRE>
Delivers the complex conjugate of <I>c</I>.
<P>
<I>cv</I> will be a complex floating variety.
<P>
<H3>5.16.20. <A NAME=M95>component</A></H3>
<B>Encoding number</B>: 20<P>
<PRE>
<I>sha</I>: SHAPE
<I>arg1</I>: EXP COMPOUND(EXP OFFSET(<I>x</I>, <I>y</I>))
<I>arg2</I>: EXP OFFSET(<I>x</I>, <I>alignment</I>(<I>sha</I>))
-> EXP <I>sha</I>
</PRE>
<I>arg1</I> is evaluated to produce a <CODE>COMPOUND</CODE> value.
The component of this value at the <CODE>OFFSET</CODE> given by <I>arg2</I>
is delivered. This will have <CODE>SHAPE</CODE> <I>sha</I>.
<P>
<I>arg2</I> will be a constant and non-negative (see
<A HREF="spec10.html#7">Constant evaluation</A>).
<P>
If <I>sha</I> is a <CODE>BITFIELD</CODE> then <I>arg2</I>, <I>sha</I>
will be <I>variety_enclosed</I> (see <A HREF="spec10.html#66">section
7.24</A>).
<P>
<H3>5.16.21. <A NAME=M96>concat_nof</A></H3>
<B>Encoding number</B>: 21<P>
<PRE>
<I>arg1</I>: EXP NOF(<I>n</I>, <I>s</I>)
<I>arg2</I>: EXP NOF(<I>m</I>, <I>s</I>)
-> EXP NOF(<I>n</I>+<I>m</I>, <I>s</I>)
</PRE>
<I>arg1</I> and <I>arg2</I> are evaluated and their results concatenated.
In the result the components derived from <I>arg1</I> will have lower
indices than those derived from <I>arg2</I>.
<P>
<H3>5.16.22. <A NAME=M97>conditional</A></H3>
<B>Encoding number</B>: 22<P>
<PRE>
<I>altlab_intro</I>: LABEL
<I>first</I>: EXP <I>x</I>
<I>alt</I>: EXP <I>z</I>
-> EXP (<I>x</I> LUB <I>z</I>)
</PRE>
<!-- BREAK 1 -->
<I>first</I> is evaluated. If <I>first</I> produces a result, <I>f</I>,
this value is delivered as the result of the whole construct, and
<I>alt</I> is not evaluated.
<P>
If <I>goto</I>(<I>altlab_intro</I>) or any other jump (including
<I>long_jump</I>) to <I>altlab_intro</I> is obeyed during the evaluation
of <I>first</I>, then the evaluation of <I>first</I> will stop, <I>alt</I>
will be evaluated and its result delivered as the result of the construction.
<P>
The lifetime of <I>altlab_intro</I> is the evaluation of <I>first</I>.
<I>altlab_intro</I> will not be used within <I>alt</I>.
<P>
The actual order of evaluation of the constituents shall be indistinguishable
in all observable effects (apart from time) from evaluating all the
obeyed parts of <I>first</I> before any obeyed part of <I>alt</I>.
Note that this specifically includes any defined error handling.
<P>
For LUB see <A HREF="spec10.html#70">Least Upper Bound</A>.
<P>
<H3>5.16.23. <A NAME=M98>contents</A></H3>
<B>Encoding number</B>: 23<P>
<PRE>
<I>s</I>: SHAPE
<I>arg1</I>: EXP POINTER(<I>x</I>)
-> EXP <I>s</I>
</PRE>
A value of <CODE>SHAPE</CODE> <I>s</I> will be extracted from the
start of the space indicated by the pointer, and this is delivered.
<P>
<I>x</I> will include <I>alignment</I>(<I>s</I>).
<P>
<I>s</I> will not be a <CODE>BITFIELD</CODE>.
<P>
<P>
If the space which the pointer indicates does not lie wholly within
the space indicated by the original pointer from which it is derived,
the effect is undefined.
<P>
If the value delivered by <I>arg1</I> is a null pointer the effect
is undefined.
<P>
<I>The constraint "x will include alignment(s)" ensures
in the simple memory model that no change is needed to the <CODE>POINTER</CODE>.
</I>
<P>
<H3>5.16.24. <A NAME=M99>contents_with_mode</A></H3>
<B>Encoding number</B>: 24<P>
<PRE>
<I>md</I>: TRANSFER_MODE
<I>s</I>: SHAPE
<I>arg1</I>: EXP POINTER(<I>x</I>)
-> EXP <I>s</I>
</PRE>
A value of <CODE>SHAPE</CODE> <I>s</I> will be extracted from the
start of the space indicated by the pointer, and this is delivered.
The operation will be carried out as specified by the
<CODE>TRANSFER_MODE</CODE> (q.v.).
<P>
If <I>md</I> consists of <I>standard_transfer_mode</I> only, then
<I>contents_with_mode</I> is the same as <I>contents</I>.
<P>
<I>x</I> will include <I>alignment</I>(<I>s</I>).
<P>
<I>s</I> will not be a <CODE>BITFIELD</CODE>.
<P>
If the space which the pointer indicates does not lie wholly within
the space indicated by the original pointer from which it is derived,
the effect is undefined.
<P>
If the value delivered by <I>arg1</I> is a null pointer the effect
is undefined.
<P>
<H3>5.16.25. <A NAME=M101>current_env</A></H3>
<B>Encoding number</B>: 25<P>
<PRE>
-> EXP POINTER(<I>fa</I>)
</PRE>
A value of <CODE>SHAPE POINTER</CODE>(<I>fa</I>) is created and delivered.
It gives access to the variables, identities and parameters in the
current procedure activation which are declared as having
<CODE>ACCESS</CODE> <I>visible</I>.
<P>
If the immediately enclosing procedure is defined by
<I>make_general_proc</I>, then <I>fa</I> is the set union of
<I>local_alignment</I> and the alignments of the kinds of parameters
defined. That is to say, if there are caller parameters, then the
alignment includes <I>callers_alignment</I>(<I>x</I>) where <I>x</I>
is true if and only if the <CODE>PROCPROPS</CODE> <I>var_callers</I>
is present; if there are callee parameters, the alignment includes
<I>callees_alignment</I>(<I>x</I>) where <I>x</I> is true if and only
if the
<CODE>PROCPROPS</CODE> <I>var_callees</I> is present.
<P>
If the immediately enclosing procedure is defined by <I>make_proc</I>,
then <I>fa</I> = { <I>locals_alignment</I>,
<I>callers_alignment</I>(<I>false</I>) }.
<P>
If an <CODE>OFFSET</CODE> produced by <I>env_offset</I> is added to
a
<CODE>POINTER</CODE> produced by <I>current_env</I> from an activation
of the procedure which contains the declaration of the <CODE>TAG</CODE>
used by <I>env_offset</I>, then the result is an original
<CODE>POINTER</CODE>, notwithstanding the normal rules for
<I>add_to_ptr</I> (see <A HREF="spec10.html#44">Original pointers</A>).
<P>
If an <CODE>OFFSET</CODE> produced by <I>env_offset</I> is added to
such a pointer from an inappropriate procedure the effect is undefined.
<P>
<H3>5.16.26. <A NAME=M102>div0</A></H3>
<B>Encoding number</B>: 26<P>
<PRE>
<I>div_by_0_err</I>: ERROR_TREATMENT
<I>ov_err</I>: ERROR_TREATMENT
<I>arg1</I>: EXP INTEGER(<I>v</I>)
<I>arg2</I>: EXP INTEGER(<I>v</I>)
-> EXP INTEGER(<I>v</I>)
</PRE>
<I>arg1</I> and <I>arg2</I> are evaluated and will produce integer
values, <I>a</I> and <I>b</I>, of the same <CODE>VARIETY</CODE>,
<I>v</I>. Either the value <I>a</I> D1 <I>b</I> or the value <I>a</I>
D2 <I>b</I> is delivered as the result of the construct, with the
same
<CODE>SHAPE</CODE> as the arguments. Different occurrences of
<I>div0</I> in the same capsule can use D1 or D2 independently.
<P>
If <I>b</I> is zero a div_by_zero error occurs and is handled by
<I>div_by_0_err</I>.
<P>
If <I>b</I> is not zero and the result cannot be expressed in the
<CODE>VARIETY</CODE> being used to represent <I>v</I> an overflow
occurs and is handled by <I>ov_err</I>.
<P>
Producers may assume that shifting and <I>div0</I> by a constant which
is a power of two yield equally good code.
<P>
See <A HREF="spec10.html#10">Division and modulus</A> for the definitions
of D1, D2, M1 and M2.
<P>
<H3>5.16.27. <A NAME=M103>div1</A></H3>
<B>Encoding number</B>: 27<P>
<PRE>
<I>div_by_0_err</I>: ERROR_TREATMENT
<I>ov_err</I>: ERROR_TREATMENT
<I>arg1</I>: EXP INTEGER(<I>v</I>)
<I>arg2</I>: EXP INTEGER(<I>v</I>)
-> EXP INTEGER(<I>v</I>)
</PRE>
<I>arg1</I> and <I>arg2</I> are evaluated and will produce integer
values, <I>a</I> and <I>b</I>, of the same <CODE>VARIETY</CODE>, <I>v</I>.
The value <I>a</I> D1 <I>b</I> is delivered as the result of the construct,
with the same <CODE>SHAPE</CODE> as the arguments.
<P>
If <I>b</I> is zero a div_by_zero error occurs and is handled by
<I>div_by_0_err</I>.
<P>
If <I>b</I> is not zero and the result cannot be expressed in the
<CODE>VARIETY</CODE> being used to represent <I>v</I> an overflow
occurs and is handled by <I>ov_err</I>.
<P>
Producers may assume that shifting and <I>div1</I> by a constant which
is a power of two yield equally good code.
<P>
See <A HREF="spec10.html#10">Division and modulus</A> for the definitions
of D1, D2, M1 and M2.
<P>
<H3>5.16.28. <A NAME=M104>div2</A></H3>
<B>Encoding number</B>: 28<P>
<PRE>
<I>div_by_0_err</I>: ERROR_TREATMENT
<I>ov_err</I>: ERROR_TREATMENT
<I>arg1</I>: EXP INTEGER(<I>v</I>)
<I>arg2</I>: EXP INTEGER(<I>v</I>)
-> EXP INTEGER(<I>v</I>)
</PRE>
<I>arg1</I> and <I>arg2</I> are evaluated and will produce integer
values, <I>a</I> and <I>b</I>, of the same <CODE>VARIETY</CODE>, <I>v</I>.
The value <I>a</I> D2 <I>b</I> is delivered as the result of the construct,
with the same <CODE>SHAPE</CODE> as the arguments.
<P>
If <I>b</I> is zero a div_by_zero error occurs and is handled by
<I>div_by_0_err</I>.
<P>
If <I>b</I> is not zero and the result cannot be expressed in the
<CODE>VARIETY</CODE> being used to represent <I>v</I> an overflow
occurs and is handled by <I>ov_err</I>.
<P>
Producers may assume that shifting and <I>div2</I> by a constant which
is a power of two yield equally good code if the lower bound of <I>v</I>
is zero.
<P>
See <A HREF="spec10.html#10">Division and modulus</A> for the definitions
of D1, D2, M1 and M2.
<P>
<H3>5.16.29. <A NAME=M105>env_offset</A></H3>
<B>Encoding number</B>: 29<P>
<PRE>
<I>fa</I>: ALIGNMENT
<I>y</I>: ALIGNMENT
<I>t</I>: TAG <I>x</I>
-> EXP OFFSET(<I>fa</I>, <I>y</I>)
</PRE>
<I>t</I> will be the tag of a <I>variable</I>, <I>identify</I> or
procedure parameter with the <I>visible</I> property within a procedure
defined by <I>make_general_proc</I> or <I>make_proc</I>.
<P>
If it is defined in a make_general_proc, let P be its associated
<CODE>PROCPROPS</CODE>; otherwise let P be the <CODE>PROCPROPS</CODE>
{<I>locals_alignment</I>, <I>caller_alignment</I>(<I>false</I>)}.
<P>
If <I>t</I> is the <CODE>TAG</CODE> of a <I>variable</I> or <I>identify,
fa</I>
will contain <I>locals_alignment</I>; if it is a caller parameter
<I>fa</I> will contain a <I>caller_alignment</I>(<I>b</I>) where <I>b
</I>is true if and only if P contains <I>var_callers</I> ; if it is
a callee parameter <I>fa</I> will contain a <I>callee_alignment</I>(<I>b</I>)
where <I>b</I> is true if and only if P contains <I>var_callees</I>.
<P>
If t is the <CODE>TAG</CODE> of a <I>variable</I> or parameter, the
result is the <CODE>OFFSET</CODE> of its position, within any procedure
environment which derives from the procedure containing the declaration
of the variable or parameter, relative to its environment pointer.
In this case
<I>x</I> will be <CODE>POINTER</CODE>(<I>y).</I><P> If t is the <CODE>TAG</CODE>
of an <I>identify</I>, the result will be an <CODE>OFFSET</CODE> of
space which holds the value. This pointer will not be used to alter
the value. In this case <I>y</I> will be <I>alignment</I>(<I>x</I>).
<P>
See <A HREF="spec10.html#19">section 7.10</A>.
<P>
<H3>5.16.30. <A NAME=M106>env_size</A></H3>
<B>Encoding number</B>: 30<P>
<PRE>
<I>proctag</I>: TAG PROC
-> EXP OFFSET(<I>locals_alignment</I>, {})
</PRE>
Delivers an <CODE>OFFSET</CODE> of a space sufficient to contain all
the variables and identifications, explicit or implicit in the procedure
identified by <I>proctag</I>. This will not include the space required
for any <I>local_allocs</I> or procedure calls within the procedure.
<P>
<I>proctag</I> will be defined in the current <CODE>CAPSULE</CODE>
by a
<CODE>TAGDEF</CODE> identification of a <I>make_proc</I> or a
<I>make_general_proc</I>.
<P>
<H3>5.16.31. <A NAME=M107>fail_installer</A></H3>
<B>Encoding number</B>: 31<P>
<PRE>
<I>message</I>: STRING<I>(k, n)</I>
-> EXP BOTTOM
</PRE>
Any attempt to use this operation to produce code will result in a
failure of the installation process. <I>message</I> will give information
about the reason for this failure which should be passed to the installation
manager.
<P>
<H3>5.16.32. <A NAME=M108>float_int</A></H3>
<B>Encoding number</B>: 32<P>
<PRE>
<I>flpt_err</I>: ERROR_TREATMENT
<I>f</I>: FLOATING_VARIETY
<I>arg1</I>: EXP INTEGER(<I>v</I>)
-> EXP FLOATING(<I>f</I>)
</PRE>
<I>arg1</I> is evaluated to produce an integer value, which is converted
to the representation of <I>f</I> and delivered.
<P>
If <I>f</I> is complex the real part of the result will be derived
from <I>arg1</I> and the imaginary part will be zero.
<P>
If there is a floating point error it is handled by <I>flpt_err</I>.
See <A HREF="spec10.html#60">Floating point errors</A>.
<P>
<H3>5.16.33. <A NAME=M109>floating_abs</A></H3>
<B>Encoding number</B>: 33<P>
<PRE>
<I>flpt_err</I>: ERROR_TREATMENT
<I>arg1</I>: EXP FLOATING(<I>f</I>)
-> EXP FLOATING(<I>f</I>)
</PRE>
<I>arg1</I> is evaluated and will produce a floating point value,
<I>a</I>, of the <CODE>FLOATING_VARIETY</CODE>, <I>f</I>. The absolute
value of <I>a</I> is delivered as the result of the construct, with
the same <CODE>SHAPE</CODE> as the argument.
<P>
Though <I>floating_abs</I> cannot produce an overflow it can give
an invalid operand exception which is handled by <I>flpt_err</I>.
<P>
<I>f</I> will not be complex.
<P>
See also <A HREF="spec10.html#64">Floating point accuracy</A>.
<P>
<H3>5.16.34. <A NAME=M110>floating_div</A></H3>
<B>Encoding number</B>: 34<P>
<PRE>
<I>flpt_err</I>: ERROR_TREATMENT
<I>arg1</I>: EXP FLOATING(<I>f</I>)
<I>arg2</I>: EXP FLOATING(<I>f</I>)
-> EXP FLOATING(<I>f</I>)
</PRE>
<I>arg1</I> and <I>arg2</I> are evaluated and will produce floating
point values, <I>a</I> and <I>b</I>, of the same
<CODE>FLOATING_VARIETY</CODE>, <I>f</I>. The value <I>a</I>/<I>b</I>
is delivered as the result of the construct, with the same
<CODE>SHAPE</CODE> as the arguments.
<P>
If there is a floating point error it is handled by <I>flpt_err</I>.
See <A HREF="spec10.html#60">Floating point errors</A>.
<P>
See also <A HREF="spec10.html#64">Floating point accuracy</A>.
<P>
<H3>5.16.35. <A NAME=M111>floating_minus</A></H3>
<B>Encoding number</B>: 35<P>
<PRE>
<I>flpt_err</I>: ERROR_TREATMENT
<I>arg1</I>: EXP FLOATING(<I>f</I>)
<I>arg2</I>: EXP FLOATING(<I>f</I>)
-> EXP FLOATING(<I>f</I>)
</PRE>
<I>arg1</I> and <I>arg2</I> are evaluated and will produce floating
point values, <I>a</I> and <I>b</I>, of the same
<CODE>FLOATING_VARIETY</CODE>, <I>f</I>. The value <I>a</I>-<I>b</I>
is delivered as the result of the construct, with the same
<CODE>SHAPE</CODE> as the arguments.
<P>
If there is a floating point error it is handled by <I>flpt_err</I>.
See <A HREF="spec10.html#60">Floating point errors</A>.
<P>
See also <A HREF="spec10.html#64">Floating point accuracy</A>.
<P>
<H3>5.16.36. <A NAME=M112>floating_maximum</A></H3>
<B>Encoding number</B>: 36<P>
<PRE>
<I>flpt_err</I>: ERROR_TREATMENT
<I>arg1</I>: EXP FLOATING(<I>f</I>)
<I>arg2</I>: EXP FLOATING(<I>f</I>)
-> EXP FLOATING(<I>f</I>)
</PRE>
The maximum of the values delivered by <I>arg1</I> and <I>arg2</I>
is the result. <I>f</I> will not be complex.
<P>
If <I>arg1</I> and <I>arg2</I> are incomparable, <I>flpt_err</I> will
be invoked.
<P>
See also <A HREF="spec10.html#64">Floating point accuracy</A>.
<P>
<H3>5.16.37. <A NAME=M113>floating_minimum</A></H3>
<B>Encoding number</B>: 37<P>
<PRE>
<I>flpt_err</I>: ERROR_TREATMENT
<I>arg1</I>: EXP FLOATING(<I>f</I>)
<I>arg2</I>: EXP FLOATING(<I>f</I>)
-> EXP FLOATING(<I>f</I>)
</PRE>
The minimum of the values delivered by <I>arg1</I> and <I>arg2</I>
is the result. <I>f</I> will not be complex.
<P>
If <I>arg1</I> and <I>arg2</I> are incomparable, <I>flpt_err</I> will
be invoked.
<P>
See also <A HREF="spec10.html#64">Floating point accuracy</A>.
<P>
<H3>5.16.38. <A NAME=M114>floating_mult</A></H3>
<B>Encoding number</B>: 38<P>
<PRE>
<I>flpt_err</I>: ERROR_TREATMENT
<I>arg1</I>: LIST(EXP)
-> EXP FLOATING(<I>f</I>)
</PRE>
The arguments, <I>arg1</I>, are evaluated producing floating point
values all of the same <CODE>FLOATING_VARIETY</CODE>, <I>f</I>. These
values are multiplied in any order and the result of this multiplication
is delivered as the result of the construct, with the same
<CODE>SHAPE</CODE> as the arguments.
<P>
If there is a floating point error it is handled by <I>flpt_err</I>.
See <A HREF="spec10.html#60">Floating point errors</A>.
<P>
<I>Note that separate floating_mult operations cannot in general be
combined, because rounding errors need to be controlled. The reason
for allowing floating_mult to take a variable number of arguments
is to make it possible to specify that a number of multiplications
can be re-ordered.</I>
<P>
If <I>arg1</I> contains one element the result is the value of that
element. There will be at least one element in <I>arg1</I>.
<P>
See also <A HREF="spec10.html#64">Floating point accuracy</A>.
<P>
<H3>5.16.39. <A NAME=M116>floating_negate</A></H3>
<B>Encoding number</B>: 39<P>
<PRE>
<I>flpt_err</I>: ERROR_TREATMENT
<I>arg1</I>: EXP FLOATING(<I>f</I>)
-> EXP FLOATING(<I>f</I>)
</PRE>
<I>arg1</I> is evaluated and will produce a floating point value,
<I>a</I>, of the <CODE>FLOATING_VARIETY</CODE>, <I>f</I>. The value
-<I>a</I> is delivered as the result of the construct, with the same
<CODE>SHAPE</CODE> as the argument.
<P>
Though <I>floating_negate</I> cannot produce an overflow it can give
an invalid operand exception which is handled by <I>flpt_err</I>.
<P>
See also <A HREF="spec10.html#64">Floating point accuracy</A>.
<P>
<H3>5.16.40. <A NAME=M117>floating_plus</A></H3>
<B>Encoding number</B>: 40<P>
<PRE>
<I>flpt_err</I>: ERROR_TREATMENT
<I>arg1</I>: LIST(EXP)
-> EXP FLOATING(<I>f</I>)
</PRE>
The arguments, <I>arg1</I>, are evaluated producing floating point
values, all of the same <CODE>FLOATING_VARIETY</CODE>, <I>f</I>. These
values are added in any order and the result of this addition is delivered
as the result of the construct, with the same <CODE>SHAPE</CODE> as
the arguments.
<P>
If there is a floating point error it is handled by <I>flpt_err</I>.
See <A HREF="spec10.html#60">Floating point errors</A>.
<P>
<I>Note that separate floating_plus operations cannot in general be
combined, because rounding errors need to be controlled. The reason
for allowing floating_plus to take a variable number of arguments
is to make it possible to specify that a number of multiplications
can be re-ordered.</I>
<P>
If <I>arg1</I> contains one element the result is the value of that
element. There will be at least one element in <I>arg1</I>.
<P>
See also <A HREF="spec10.html#64">Floating point accuracy</A>.
<P>
<H3>5.16.41. <A NAME=M118>floating_power</A></H3>
<B>Encoding number</B>: 41<P>
<PRE>
<I>flpt_err</I>: ERROR_TREATMENT
<I>arg1</I>: EXP FLOATING(<I>f</I>)
<I>arg2</I>: EXP INTEGER(<I>v</I>)
-> EXP FLOATING(<I>f</I>)
</PRE>
The result of <I>arg1</I> is raised to the power given by <I>arg2</I>.
<P>
If there is a floating point error it is handled by <I>flpt_err</I>.
See <A HREF="spec10.html#60">Floating point errors</A>.
<P>
See also <A HREF="spec10.html#64">Floating point accuracy</A>.
<P>
<H3>5.16.42. <A NAME=M119>floating_test</A></H3>
<B>Encoding number</B>: 42<P>
<PRE>
<I>prob</I>: OPTION(NAT)
<I>flpt_err</I>: ERROR_TREATMENT
<I>nt</I>: NTEST
<I>dest</I>: LABEL
<I>arg1</I>: EXP FLOATING(<I>f</I>)
<I>arg2</I>: EXP FLOATING(<I>f</I>)
-> EXP TOP
</PRE>
<I>arg1</I> and <I>arg2</I> are evaluated and will produce floating
point values, <I>a</I> and <I>b</I>, of the same
<CODE>FLOATING_VARIETY</CODE>, <I>f</I>. These values are compared
using
<I>nt</I>.
<P>
If <I>f</I> is complex then <I>nt</I> will be <I>equal</I> or
<I>not_equal</I>.
<P>
If <I>a nt b</I>, this construction yields <CODE>TOP</CODE>. Otherwise
control passes to <I>dest</I>.
<P>
If <I>prob</I> is present<I>, prob</I>/100 gives the probability that
control will continue to the next construct (ie. not pass to <I>dest</I>).
If <I>prob</I> is absent this probability is unknown.
<P>
If there is a floating point error it is handled by <I>flpt_err</I>.
See <A HREF="spec10.html#60">Floating point errors</A>.
<P>
See also <A HREF="spec10.html#64">Floating point accuracy</A>.
<P>
<H3>5.16.43. <A NAME=M120>goto</A></H3>
<B>Encoding number</B>: 43<P>
<PRE>
<I>dest</I>: LABEL
-> EXP BOTTOM
</PRE>
Control passes to the <CODE>EXP</CODE> labelled <I>dest</I>. This
construct will only be used where <I>dest</I> is in scope.
<P>
<H3>5.16.44. <A NAME=M121>goto_local_lv</A></H3>
<B>Encoding number</B>: 44<P>
<PRE>
<I>arg1</I>: EXP POINTER(<I>{code</I>})
-> EXP BOTTOM
</PRE>
<I>arg1</I> is evaluated. The label from which the value delivered
by
<I>arg1</I> was created will be within its lifetime and this construction
will be obeyed in the same activation of the same procedure as the
creation of the <CODE>POINTER(</CODE><I>{code</I><CODE>})</CODE>
by <I>make_local_lv</I>. Control passes to this activation of this
<CODE>LABEL</CODE>.
<P>
If <I>arg1</I> delivers a null <CODE>POINTER</CODE> the effect is
undefined.
<P>
<H3>5.16.45. <A NAME=M122>identify</A></H3>
<!-- BREAK 3 -->
<B>Encoding number</B>: 45<P>
<PRE>
<I>opt_access</I>: OPTION(ACCESS)
<I>name_intro</I>: TAG <I>x</I>
<I>definition</I>: EXP <I>x</I>
<I>body</I>: EXP <I>y</I>
-> EXP <I>y</I>
</PRE>
<I>definition</I> is evaluated to produce a value, <I>v</I>. Then
<I>body</I> is evaluated. During this evaluation, <I>v</I> is bound
to <I>name_intro</I>. This means that inside <I>body</I> an evaluation
of <I>obtain_tag</I>(<I>name_intro</I>) will produce the value, <I>v</I>.
<P>
The value delivered by <I>identify</I> is that produced by <I>body</I>.
<P>
The <CODE>TAG</CODE> given for <I>name_intro</I> will not be reused
within the current <CODE>UNIT</CODE>. No rules for the hiding of one
<CODE>TAG</CODE> by another are given: this will not happen. The lifetime
of <I>name_intro</I> is the evaluation of <I>body</I>.
<P>
If <I>opt_access</I> contains <I>visible</I>, it means that the value
must not be aliased while the procedure containing this declaration
is not the current procedure. Hence if there are any copies of this
value they will need to be refreshed when the procedure is returned
to. The easiest implementation when <I>opt_access</I> is <I>visible</I>
may be to keep the value in memory, but this is not a necessary requirement.
<P>
The order in which the constituents of <I>definition</I> and <I>body</I>
are evaluated shall be indistinguishable in all observable effects
(apart from time) from completely evaluating <I>definition</I> before
starting <I>body</I>. See the note about order in
<A HREF="#M193">sequence</A>.
<P>
<H3>5.16.46. <A NAME=M123>ignorable</A></H3>
<B>Encoding number</B>: 46<P>
<PRE>
<I>arg1</I>: EXP <I>x</I>
-> EXP <I>x</I>
</PRE>
If the result of this construction is discarded, <I>arg1</I> need
not be evaluated, though evaluation is permitted. If the result is
used it is the result of <I>arg1</I>.
<P>
<H3>5.16.47. <A NAME=M124>imaginary_part</A></H3>
<B>Encoding number</B>: 47<P>
<PRE>
<I>arg1</I>: EXP <I>c</I>
-> EXP FLOATING (<I>float_of_complex(c)</I>)
</PRE>
<I>c</I> will be complex. Delivers the imaginary part of the value
produced by <I>arg1</I>.
<P>
<H3>5.16.48. <A NAME=M125>initial_value</A></H3>
<B>Encoding number</B>: 48<P>
<PRE>
<I>init</I>: EXP <I>s</I>
-> EXP <I>s</I>
</PRE>
<!-- BREAK 0 -->
Any tag used as an argument of an <I>obtain_tag</I> in <I>init</I>
will be global or defined within <I>init</I>.
<P>
All labels used in <I>init</I> will be defined within <I>init</I>.
<P>
<I>init</I> will be evaluated once only before any procedure application,
other than those involved in this or other
<I>initial_value</I> constructions, but after all load-time constant
initialisations of TAGDEFs. The result of this evaluation is the value
of the construction.
<P>
The order of evaluation of the different <I>initial_values</I> in
a program is undefined.
<P>
See <A HREF="spec10.html#73">section 7.29</A>.
<P>
<P>
<H3>5.16.49. <A NAME=M127>integer_test</A></H3>
<B>Encoding number</B>: 49<P>
<PRE>
<I>prob</I>: OPTION(NAT)
<I>nt</I>: NTEST
<I>dest</I>: LABEL
<I>arg1</I>: EXP INTEGER(<I>v</I>)
<I>arg2</I>: EXP INTEGER(<I>v</I>)
-> EXP TOP
</PRE>
<I>arg1</I> and <I>arg2</I> are evaluated and will produce integer
values, <I>a</I> and <I>b</I>, of the same <CODE>VARIETY</CODE>, <I>v</I>.
These values are compared using <I>nt</I>.
<P>
If <I>a nt b</I>, this construction yields <CODE>TOP</CODE>. Otherwise
control passes to <I>dest</I>.
<P>
If <I>prob</I> is present, <I>prob</I>/100 gives the probability that
control will continue to the next construct (ie. not pass to <I>dest</I>).
If <I>prob</I> is absent this probability is unknown.
<P>
<H3>5.16.50. <A NAME=M128>labelled</A></H3>
<!-- BREAK 1 -->
<B>Encoding number</B>: 50<P>
<PRE>
<I>labs_intro</I>: LIST(LABEL)
<I>starter</I>: EXP <I>x</I>
<I>places</I>: LIST(EXP)
-> EXP <I>w</I>
</PRE>
The lists <I>labs_intro</I> and <I>places</I> shall have the same
number of elements.
<P>
To evaluate the construction <I>starter</I> is evaluated. If its evaluation
runs to completion producing a value, then this is delivered as the
result of the whole construction. If a <I>goto</I> one of the
<CODE>LABEL</CODE>s in <I>labs_intro</I> or any other jump to one
of these <CODE>LABEL</CODE>s is evaluated, then the evaluation of
<I>starter</I> stops and the corresponding element of <I>places</I>
is evaluated. In the canonical ordering all the operations which
are evaluated from <I>starter</I> are completed before any from an
element of <I>places</I> is started. If the evaluation of the member
of
<I>places</I> produces a result this is the result of the construction.
<P>
If a jump to any of the <I>labs_intro</I> is obeyed then evaluation
continues similarly. Such jumping may continue indefinitely, but if
any <I>places</I> terminates, then the value it produces is the value
delivered by the construction.
<P>
The <CODE>SHAPE</CODE> <I>w</I> is the LUB of <I>x</I> and all the
<I>places</I>. See <A HREF="spec10.html#70">Least Upper Bound</A>.
<P>
The actual order of evaluation of the constituents shall be indistinguishable
in all observable effects (apart from time) from that described above.
Note that this specifically includes any defined error handling.
<P>
The lifetime of each of the <CODE>LABEL</CODE>s in <I>labs_intro</I>,
is the evaluation of <I>starter</I> and all the elements of <I>places</I>.
<P>
<H3>5.16.51. <A NAME=M129>last_local</A></H3>
<B>Encoding number</B>: 51<P>
<PRE>
<I>x</I>: EXP OFFSET(<I>y</I>, <I>z</I>)
-> EXP POINTER(<I>alloca_alignment</I>)
</PRE>
If the last use of <I>local_alloc</I> in the current activation of
the current procedure was after the last use of <I>local_free</I>
or
<I>local_free_all</I>, then the value returned is the last
<CODE>POINTER</CODE> allocated with <I>local_alloc</I>.
<P>
If the last use of <I>local_free</I> in the current activation of
the current procedure was after the last use of <I>local_alloc</I>,
then the result is the <CODE>POINTER</CODE> last allocated which is
still active.
<P>
The result <CODE>POINTER</CODE> will have been created by
<I>local_alloc</I> with the value of its <I>arg1</I> equal to the
value of <I>x</I>.
<P>
If the last use of <I>local_free_all</I> in the current activation
of the current procedure was after the last use of <I>local_alloc</I>,
or if there has been no use of <I>local_alloc</I> in the current activation
of the current procedure, then the result is undefined.
<P>
The <CODE>ALIGNMENT</CODE>, <I>alloca_alignment</I>, includes the
set union of all the <CODE>ALIGNMENT</CODE>s which can be produced
by
<I>alignment</I> from any <CODE>SHAPE</CODE>. See
<A HREF="spec10.html#34">Special alignments</A>.
<P>
<H3>5.16.52. <A NAME=M130>local_alloc</A></H3>
<B>Encoding number</B>: 52<P>
<PRE>
<I>arg1</I>: EXP OFFSET(<I>x</I>, <I>y</I>)
-> EXP POINTER(<I>alloca_alignment</I>)
</PRE>
The <I>arg1</I> expression is evaluated and space is allocated sufficient
to hold a value of the given size. <A NAME=M339>The result is an original
pointer to this space</A>.
<P>
<I>x</I> will not consist entirely of bitfield alignments.
<P>
The initial contents of the space are not specified.
<P>
This allocation is as if on the stack of the current procedure, and
the lifetime of the pointer ends when the current activation of the
current procedure ends with a <I>return</I>, <I>return_to_label</I>
or <I>tail_call</I> or if there is a long jump out of the activation.
Any use of the pointer thereafter is undefined. Note the specific
exclusion of the procedure ending with <I>untidy_return</I>; in this
case the calling procedure becomes the current activation.
<P>
The uses of <I>local_alloc</I> within the procedure are ordered dynamically
as they occur, and this order affects the meaning of <I>local_free</I>
and <I>last_local</I>.
<P>
<I>arg1</I> may be a zero <CODE>OFFSET</CODE>. In this case suppose
the result is <I>p</I>. Then a subsequent use, in the same activation
of the procedure, of<P>
<I>local_free</I>(<I>offset_zero</I>(<I>alloca_alignment</I>), <I>p</I>)<P>
will return the <I>alloca</I> stack to the state it was in immediately
before the use of <I>local_alloc</I>.
<P>
Note that if a procedure which uses <I>local_alloc</I> is inlined,
it may be necessary to use <I>local_free</I> to get the correct semantics.
<P>
See also <A HREF="spec10.html#22">section 7.12</A>.
<P>
<H3>5.16.53. <A NAME=M132>local_alloc_check</A></H3>
<B>Encoding number</B>: 53<P>
<PRE>
<I>arg1</I>: EXP OFFSET(<I>x</I>, <I>y</I>)
-> EXP POINTER(<I>alloca_alignment</I>)
</PRE>
<P>
If the <CODE>OFFSET</CODE> <I>arg1</I> can be accomodated within the
limit of the local_alloc stack (see <A HREF="#M130">section 5.16.108</A>),
the action is precisely the same as <I>local_alloc</I>.
<P>
If not, normal action is stopped and a TDF exception is raised with
ERROR_CODE <I>stack_overflow</I>.
<P>
<H3>5.16.54. <A NAME=M133>local_free</A></H3>
<B>Encoding number</B>: 54<P>
<PRE>
<I>a</I>: EXP OFFSET(<I>x</I>, <I>y</I>)
<I>p</I>: EXP POINTER(<I>alloca_alignment</I>)
-> EXP TOP
</PRE>
The <CODE>POINTER</CODE>, <I>p</I>, will be an original pointer to
space allocated by <I>local_alloc</I> within the current call of the
current procedure. It and all spaces allocated after it by <I>local_alloc</I>
will no longer be used. This <CODE>POINTER</CODE> will have been created
by <I>local_alloc</I> with the value of its <I>arg1</I> equal to the
value of <I>a</I>.
<P>
Any subsequent use of pointers to the spaces no longer used will be
undefined.
<P>
<H3>5.16.55. <A NAME=M134>local_free_all</A></H3>
<B>Encoding number</B>: 55<P>
<PRE>
-> EXP TOP
</PRE>
Every space allocated by <I>local_alloc</I> within the current call
of the current procedure will no longer be used.
<P>
Any use of a pointer to space allocated before this operation within
the current call of the current procedure is undefined.
<P>
Note that if a procedure which uses <I>local_free_all</I> is inlined,
it may be necessary to use <I>local_free</I> to get the correct semantics.
<P>
<H3>5.16.56. <A NAME=M135>long_jump</A></H3>
<B>Encoding number</B>: 56<P>
<PRE>
<I>arg1</I>: EXP POINTER(<I>fa</I>)
<I>arg2</I>: EXP POINTER({<I>code</I>})
-> EXP BOTTOM
</PRE>
<I>arg1</I> will be a pointer produced by an application of
<I>curent_env</I> in a currently active procedure.
<P>
The frame produced by <I>arg1</I> is reinstated as the current procedure.
This frame will still be active. Evaluation recommences at the label
given by <I>arg2</I>. This operation will only be used during the
lifetime of that label.
<P>
Only <CODE>TAG</CODE>s declared to have <I>long_jump_access</I> will
be defined at the re-entry.
<P>
If <I>arg2</I> delivers a null
<CODE>POINTER(</CODE>{<I>code</I><CODE>})</CODE> the effect is undefined.
<P>
<H3>5.16.57. <A NAME=M136>make_complex</A></H3>
<B>Encoding number</B>: 57<P>
<PRE>
<I>c</I>: FLOATING_VARIETY
<I>arg1</I>: EXP FLOATING(<I>f</I>)
<I>arg2</I>: EXP FLOATING(<I>f</I>)
-> EXP FLOATING(<I>c</I>)
</PRE>
<I>c</I> will be complex and derived from the same parameters as <I>f</I>.
<P>
Delivers a complex number with <I>arg1</I> delivering the real part
and <I>arg2</I> the imaginary.
<P>
<H3>5.16.58. <A NAME=M137>make_compound</A></H3>
<B>Encoding number</B>: 58<P>
<PRE>
<I>arg1</I>: EXP OFFSET(<I>base</I>, <I>y</I>)
<I>arg2</I>: LIST(EXP)
-> EXP COMPOUND(<I>arg1</I>)
</PRE>
Let the <I>i</I>th component (<I>i</I> starts at one) of <I>arg2</I>
be <I>x</I>[<I>i</I>]. The list may be empty.
<P>
The components <I>x</I>[2 * <I>k</I>] are values which are to be placed
at <CODE>OFFSET</CODE>s given by <I>x</I>[2 * <I>k</I> - 1]. These
<CODE>OFFSET</CODE>s will be constants and non-negative.
<P>
The <CODE>OFFSET</CODE> <I>x</I>[2 * <I>k</I> - 1] will have the
<CODE>SHAPE</CODE> <CODE>OFFSET</CODE>(<I>z</I><I>k</I>,
<I>alignment</I>(<I>shape</I>(<I>x</I>[2 * <I>k</I>]))), where
<I>shape</I> gives the <CODE>SHAPE</CODE> of the component and
<I>base</I> includes <I>z</I><I>k</I>.
<P>
<I>arg1</I> will be a constant non-negative <CODE>OFFSET</CODE>, see
<A HREF="#M169">offset_pad</A>.
<P>
The values <I>x</I>[2 * <I>k</I> - 1] will be such that the components
when in place either do not overlap or exactly coincide, in the sense
that the <CODE>OFFSET</CODE>s are equal and the values have the same
<CODE>SHAPE</CODE>. If they coincide the corresponding values <I>x</I>[2
* <I>k</I>] will have <CODE>VARIETY SHAPE</CODE>s and will be <I>ored</I>
together.
<P>
The <CODE>SHAPE</CODE> of a <I>x</I>[2 * <I>k</I>] component can be
<CODE>TOP</CODE>. In this case the component is evaluated, but no
value is placed at the corresponding <CODE>OFFSET</CODE>.
<P>
If <I>x[2 * k]</I> is a <CODE>BITFIELD</CODE> then <I>x[2 * k - 1]</I>,
<I>shape(x[2 * k])</I> will be <I>variety-enclosed</I> (see
<A HREF="spec10.html#66">section 7.24</A>).
<P>
<H3>5.16.59. <A NAME=M138>make_floating</A></H3>
<B>Encoding number</B>: 59<P>
<PRE>
<I>f</I>: FLOATING_VARIETY
<I>rm</I>: ROUNDING_MODE
<I>negative</I>: BOOL
<I>mantissa</I>: STRING<I>(k, n)</I>
<I>base</I>: NAT
<I>exponent</I>: SIGNED_NAT
-> EXP FLOATING(<I>f</I>)
</PRE>
<I>f</I> will not be complex.
<P>
<I>mantissa</I> will be a <CODE>STRING</CODE> of 8-bit integers, each
of which is either 46 or is greater than or equal to 48. Those values,
<I>c</I>, which lie between 48 and 63 will represent the digit <I>c</I>-48.
A decimal point is represented by 46.
<P>
The <CODE>BOOL</CODE> <I>negative</I> determines the sign of the result,
if true the result will be negative, if false, positive.
<P>
A floating point number, <I>mantissa</I>*(<I>base</I><SUP><I>exponent</I></SUP>)
is created and rounded to the representation of <I>f</I> as specified
by <I>rm</I>. <I>rm</I> will not be <I>round_as_state</I>. <I>mantissa</I>
is read as a sequence of digits to base <I>base</I> and may contain
one point symbol.
<P>
<I>base</I> will be one of the numbers 2, 4, 8, 10, 16. Note that
in base 16 the digit 10 is represented by the character number 58
etc.
<P>
The result will lie in <I>f</I>.
<P>
<H3>5.16.60. <A NAME=M139>make_general_proc</A></H3>
<!-- BREAK 4 -->
<B>Encoding number</B>: 60<P>
<PRE>
<I>result_shape</I>: SHAPE
<I>prcprops</I>: OPTION(PROCPROPS)
<I>caller_intro</I>: LIST(TAGSHACC)
<I>callee_intro</I>: LIST(TAGSHACC)
<I>body</I>: EXP BOTTOM
-> EXP PROC
</PRE>
Evaluation of <I>make_general_proc</I> delivers a <CODE>PROC</CODE>.
When this procedure is applied to parameters using <I>apply_general_proc</I>,
space is allocated to hold the actual values of the parameters <I>caller_intro
</I> and <I>callee_intro</I>
. The values produced by the actual parameters are used to initialise
these spaces. Then <I>body</I> is evaluated. During this evaluation
the <CODE>TAG</CODE>s in <I>caller_intro</I> and <I>callee_intro</I>
are bound to original <CODE>POINTER</CODE>s to these spaces. The lifetime
of these <CODE>TAG</CODE>s is the evaluation of <I>body</I>.
<P>
The <CODE>SHAPE</CODE> of <I>body</I> will be <CODE>BOTTOM</CODE>.
<I>caller_intro</I> and <I>callee_intro</I> may be empty.
<P>
The <CODE>TAG</CODE>s introduced in the parameters will not be reused
within the current <CODE>UNIT</CODE>.
<P>
The <CODE>SHAPE</CODE>s in the parameters specify the <CODE>SHAPE</CODE>
of the corresponding <CODE>TAG</CODE>s.
<P>
The <CODE>OPTION(ACCESS)</CODE> (in <I>params_intro</I>) specifies
the <CODE>ACCESS</CODE> properties of the corresponding parameter,
just as for a variable declaration.
<P>
In <I>body</I> the only <CODE>TAG</CODE>s which may be used as an
argument of <I>obtain_tag</I> are those which are declared by
<I>identify</I> or <I>variable</I> constructions in <I>body</I> and
which are in scope, or <CODE>TAG</CODE>s which are declared by
<I>make_id_tagdef</I>, <I>make_var_tagdef</I> or <I>common_tagdef</I>
or are in <I>caller_intro</I> or <I>callee_intro</I>. If a <I>make_proc</I>
occurs in <I>body</I> its <CODE>TAG</CODE>s are not in scope.
<P>
The argument of every <I>return</I> or <I>untidy_return</I> construction
in <I>body</I> will have <CODE>SHAPE</CODE> <I>result_shape</I>. Every
<I>apply_general_proc</I> using the procedure will specify the
<CODE>SHAPE</CODE> of its result to be <I>result_shape</I>.
<P>
The presence or absence of each of the <CODE>PROCPROPS</CODE>
<I>var_callers</I>, <I>var_callees, check_stack</I> and <I>untidy</I>
in
<I>prcprops</I> will be reflected in every <I>apply_general_proc</I>
or
<I>tail_call</I> on this procedure.
<P>
The definition of the canonical ordering of the evaluation of
<I>apply_general_proc</I> gives the definition of these
<CODE>PROCPROPS</CODE>.
<P>
If <I>prcprocs</I> contains <I>check_stack</I>, a TDF exception will
be raised if the static space required for the procedure call (in
the sense of <I>env_size</I>) would exceed the limit given by
<I>set_stack_limit</I>.
<P>
If <I>prcprops</I> contains <I>no_long_jump_dest</I>, the body of
the procedure will never contain the destination label of a
<I>long_jump</I>.
<P>
For notes on the intended implementation of procedures see
<A HREF="spec10.html#18">section 7.9</A>.
<P>
<H3>5.16.61. <A NAME=M141>make_int</A></H3>
<B>Encoding number</B>: 61<P>
<PRE>
<I>v</I>: VARIETY
<I>value</I>: SIGNED_NAT
-> EXP INTEGER(<I>v</I>)
</PRE>
An integer value is delivered of which the value is given by <I>value</I>,
and the <CODE>VARIETY</CODE> by <I>v</I>. The <CODE>SIGNED_NAT</CODE>
<I>value</I> will lie between the bounds of <I>v</I>.
<P>
<H3>5.16.62. <A NAME=M142>make_local_lv</A></H3>
<B>Encoding number</B>: 62<P>
<PRE>
<I>lab</I>: LABEL
-> EXP POINTER(<I>{code</I>})
</PRE>
A <CODE>POINTER(</CODE><I>{code</I><CODE>})</CODE> <I>lv</I> is created
and delivered. It can be used as an argument to <I>goto_local_lv</I>
or <I>long_jump</I>. If and when one of these is evaluated with <I>lv</I>
as an argument, control will pass to <I>lab</I>.
<P>
<H3>5.16.63. <A NAME=M143>make_nof</A></H3>
<B>Encoding number</B>: 63<P>
<PRE>
<I>arg1</I>: LIST(EXP)
-> EXP NOF(<I>n</I>, <I>s</I>)
</PRE>
Creates an array of <I>n</I> values of <CODE>SHAPE</CODE> <I>s</I>,
containing the given values produced by evaluating the members of
<I>arg1</I> in the same order as they occur in the list.
<P>
<I>n</I> will not be zero.
<P>
<H3>5.16.64. <A NAME=M144>make_nof_int</A></H3>
<B>Encoding number</B>: 64<P>
<PRE>
<I>v</I>: VARIETY
<I>str</I>: STRING<I>(k, n)</I>
-> EXP NOF(<I>n</I>, INTEGER(<I>v</I>))
</PRE>
An <CODE>NOF INTEGER</CODE> is delivered. The conversions are carried
out as if the elements of <I>str</I> were
<CODE>INTEGER</CODE>(<I>var_limits</I>(0, 2<SUP><I>k</I></SUP>-1)).
<I>n</I> may be zero.
<P>
<H3>5.16.65. <A NAME=M145>make_null_local_lv</A></H3>
<B>Encoding number</B>: 65<P>
<PRE>
-> EXP POINTER({<I>code</I>})
</PRE>
Makes a null <CODE>POINTER</CODE>({<I>code</I>}) which can be detected
by <I>pointer_test</I>. The effect of <I>goto_local_lv</I> or
<I>long_jump</I> applied to this value is undefined.
<P>
All null <CODE>POINTER</CODE>({<I>code</I>}) are equal to each other
and unequal to any other <CODE>POINTER</CODE>s.
<P>
<H3>5.16.66. <A NAME=M146>make_null_proc</A></H3>
<B>Encoding number</B>: 66<P>
<PRE>
-> EXP PROC
</PRE>
A null <CODE>PROC</CODE> is created and delivered. The null
<CODE>PROC</CODE> may be tested for by using <I>proc_test</I>. The
effect of using it as the first argument of <I>apply_proc</I> is undefined.
<P>
All null <CODE>PROC</CODE> are equal to each other and unequal to
any other <CODE>PROC</CODE>.
<P>
<H3>5.16.67. <A NAME=M147>make_null_ptr</A></H3>
<B>Encoding number</B>: 67<P>
<PRE>
<I>a</I>: ALIGNMENT
-> EXP POINTER(<I>a</I>)
</PRE>
A null <CODE>POINTER</CODE>(<I>a</I>) is created and delivered. The
null <CODE>POINTER</CODE> may be tested for by <I>pointer_test</I>.
<P>
<I>a</I> will not include <I>code</I>.
<P>
All null <CODE>POINTER</CODE>(<I>x</I>) are equal to each other and
unequal to any other <CODE>POINTER</CODE>(<I>x</I>).
<P>
<H3>5.16.68. <A NAME=M148>make_proc</A></H3>
<!-- BREAK 3 -->
<B>Encoding number</B>: 68<P>
<PRE>
<I>result_shape</I>: SHAPE
<I>params_intro</I>: LIST(TAGSHACC)
<I>var_intro</I>: OPTION(TAGACC)
<I>body</I>: EXP BOTTOM
-> EXP PROC
</PRE>
Evaluation of <I>make_proc</I> delivers a
<CODE>PROC</CODE>. When this procedure is applied to parameters using
<I>apply_proc</I>, space is allocated to hold the actual values of
the parameters <I>params_intro</I> and <I>var_intro</I> (if present).
The values produced by the actual parameters are used to initialise
these spaces. Then <I>body</I> is evaluated. During this evaluation
the
<CODE>TAG</CODE>s in <I>params_intro</I> and <I>var_intro</I> are
bound to original <CODE>POINTER</CODE>s to these spaces. The lifetime
of these
<CODE>TAG</CODE>s is the evaluation of <I>body</I>.
<P>
If <I>var_intro</I> is present, it may be used for one of two purposes,
with different consequences for corresponding uses of <I>apply_proc</I>.
See <A HREF="spec10.html#18">section 7.9</A>. The
<CODE>ALIGNMENT</CODE>, <I>var_param_alignment</I>, includes the set
union of all the <CODE>ALIGNMENT</CODE>s which can be produced by
<I>alignment</I> from any <CODE>SHAPE</CODE>. Note that <I>var_intro</I>
does not contain an <CODE>ACCESS</CODE> component and so cannot be
marked <I>visible</I>. Hence it is not a possible argument of
<I>env_offset</I>. If present, <I>var_intro</I> is an original pointer.
<P>
The <CODE>SHAPE</CODE> of <I>body</I> will be <CODE>BOTTOM</CODE>.
<I>params_intro</I> may be empty.
<P>
The <CODE>TAG</CODE>s introduced in the parameters will not be reused
within the current <CODE>UNIT</CODE>.
<P>
The <CODE>SHAPE</CODE>s in the parameters specify the <CODE>SHAPE</CODE>
of the corresponding <CODE>TAG</CODE>s.
<P>
The <CODE>OPTION(ACCESS</CODE>) (in <I>params_intro</I>) specifies
the <CODE>ACCESS</CODE> properties of the corresponding parameter,
just as for a variable declaration.
<P>
In <I>body</I> the only <CODE>TAG</CODE>s which may be used as an
argument of <I>obtain_tag</I> are those which are declared by
<I>identify</I> or <I>variable</I> constructions in <I>body</I> and
which are in scope, or <CODE>TAG</CODE>s which are declared by
<I>make_id_tagdef</I>, <I>make_var_tagdef</I> or <I>common_tagdef</I>
or are in <I>params_intro</I> or <I>var_intro</I>. If a <I>make_proc</I>
occurs in <I>body</I> its <CODE>TAG</CODE>s are not in scope.
<P>
The argument of every <I>return</I> construction in <I>body</I> will
have <CODE>SHAPE</CODE> <I>result_shape</I>. Every <I>apply_proc</I>
using the procedure will specify the <CODE>SHAPE</CODE> of it result
to be <I>result_shape</I>.
<P>
For notes on the intended implementation of procedures see
<A HREF="spec10.html#18">section 7.9</A>.
<P>
<H3>5.16.69. <A NAME=M150>make_stack_limit</A></H3>
<B>Encoding number</B>: 116<P>
<PRE>
<I>stack_base</I>: EXP POINTER(<I>fa</I>)
<I>frame_size</I>: EXP OFFSET(<I>locals_alignment</I>, <I>x</I>)
<I>alloc_size</I>: EXP OFFSET(<I>alloca_alignment</I>, <I>y</I>)
-> EXP POINTER(<I>fb</I>)
</PRE>
This creates a POINTER suitable for use with <I>set_stack_limit</I>.
<P>
<I>fa</I> and <I>fb</I> will include <I>locals_alignment</I> and,
if
<I>alloc_size</I> is not the zero offset, will also contain
<I>alloca_alignment</I>.
<P>
The result will be the same as if given by:<BR>
Assume <I>stack_base</I> is the current frame-pointer as given by
<I>current_env</I> in a hypothetical procedure P with <I>env_size</I>
equal to <I>frame_size</I> and which has generated <I>alloc_size</I>
by a <I>local_alloc</I>. If P then calls Q, the result will be the
same as that of a <I>current_env</I> performed immediately in the
body of Q.<BR>
If the following construction is performed:<BR>
set_stack_limit(make_stack_limit(current_env, F, A))<BR>
the frame space and local_alloc space that would be available for
use by this supposed call of Q will not be reused by procedure calls
with <I>check_stack</I> or uses of <I>local_alloc_check</I> after
the <I>set_stack_limit</I>. Any attempt to do so will raise a TDF
exception, <I>stack_overflow</I>.
<P>
<H3>5.16.70. <A NAME=M151>make_top</A></H3>
<B>Encoding number</B>: 69<P>
<PRE>
-> EXP TOP
</PRE>
<I>make_top</I> delivers a value of <CODE>SHAPE TOP</CODE>
(i.e. <I>void</I>).
<P>
<H3>5.16.71. <A NAME=M152>make_value</A></H3>
<B>Encoding number</B>: 70<P>
<PRE>
<I>s</I>: SHAPE
-> EXP <I>s</I>
</PRE>
This <CODE>EXP</CODE> creates some value with the representation of
the <CODE>SHAPE</CODE> <I>s</I>. This value will have the correct
size, but its representation is not specified. It can be assigned,
be the result of a <I>contents</I>, a parameter or result of a procedure,
or the result of any construction (like <I>sequence</I>) which delivers
the value delivered by an internal <CODE>EXP</CODE>. But if it is
used for arithmetic or as a <CODE>POINTER</CODE> for taking <I>contents</I>
or <I>add_to_ptr</I> etc. the effect is undefined.
<P>
Installers will usually be able to implement this operation by producing
no code.
<P>
<I>Note that a floating point NaN is a possible value for this purpose.</I>
<P>
The <CODE>SHAPE</CODE> <I>s</I> will not be <CODE>BOTTOM</CODE>.
<P>
<H3>5.16.72. <A NAME=M153>maximum</A></H3>
<B>Encoding number</B>: 71<P>
<PRE>
<I>arg1</I>: EXP INTEGER(<I>v</I>)
<I>arg2</I>: EXP INTEGER(<I>v</I>)
-> EXP INTEGER(<I>v</I>)
</PRE>
The arguments will be evaluated and the maximum of the values delivered
is the result.
<P>
<H3>5.16.73. <A NAME=M154>minimum</A></H3>
<B>Encoding number</B>: 72<P>
<PRE>
<I>arg1</I>: EXP INTEGER(<I>v</I>)
<I>arg2</I>: EXP INTEGER(<I>v</I>)
-> EXP INTEGER(<I>v</I>)
</PRE>
The arguments will be evaluated and the minimum of the values delivered
is the result.
<P>
<H3>5.16.74. <A NAME=M155>minus</A></H3>
<B>Encoding number</B>: 73<P>
<PRE>
<I>ov_err</I>: ERROR_TREATMENT
<I>arg1</I>: EXP INTEGER(<I>v</I>)
<I>arg2</I>: EXP INTEGER(<I>v</I>)
-> EXP INTEGER(<I>v</I>)
</PRE>
<I>arg1</I> and <I>arg2</I> are evaluated and will produce integer
values, <I>a</I> and <I>b</I>, of the same <CODE>VARIETY</CODE>, <I>v</I>.
The difference <I>a</I>-<I>b</I> is delivered as the result of the
construct, with the same <CODE>SHAPE</CODE> as the arguments.
<P>
If the result cannot be expressed in the <CODE>VARIETY</CODE> being
used to represent <I>v</I>, an overflow error is caused and is handled
in the way specified by <I>ov_err</I>.
<P>
<H3>5.16.75. <A NAME=M156>move_some</A></H3>
<B>Encoding number</B>: 74<P>
<PRE>
<I>md</I>: TRANSFER_MODE
<I>arg1</I>: EXP POINTER(<I>x</I>)
<I>arg2</I>: EXP POINTER(<I>y</I>)
<I>arg3</I>: EXP OFFSET(<I>z</I>, <I>t</I>)
-> EXP TOP
</PRE>
The arguments are evaluated to produce <I>p1</I>, <I>p2</I>, and
<I>sz</I> respectively. A quantity of data measured by <I>sz</I> in
the space indicated by <I>p1</I> is moved to the space indicated by
<I>p2</I>. The operation will be carried out as specified by the
<CODE>TRANSFER_MODE</CODE> (q.v.).
<P>
<I>x</I> will include <I>z</I> and <I>y</I> will include <I>z</I>.
<P>
<I>sz</I> will be a non-negative <CODE>OFFSET</CODE>, see
<A HREF="#M169">offset_pad</A>.
<P>
If the spaces of size <I>sz</I> to which <I>p1</I> and <I>p2</I> point
do not lie entirely within the spaces indicated by the original pointers
from which they are derived, the effect of the operation is undefined.
<P>
If the value delivered by <I>arg1</I> or <I>arg2</I> is a null pointer
the effect is undefined.
<P>
See <A HREF="spec10.html#48">Overlapping</A>.
<P>
<H3>5.16.76. <A NAME=M157>mult</A></H3>
<B>Encoding number</B>: 75<P>
<PRE>
<I>ov_err</I>: ERROR_TREATMENT
<I>arg1</I>: EXP INTEGER(<I>v</I>)
<I>arg2</I>: EXP INTEGER(<I>v</I>)
-> EXP INTEGER(<I>v</I>)
</PRE>
<I>arg1</I> and <I>arg2</I> are evaluated and will produce integer
values, <I>a</I> and <I>b</I>, of the same <CODE>VARIETY</CODE>, <I>v</I>.
The product <I>a</I>*<I>b</I> is delivered as the result of the construct,
with the same <CODE>SHAPE</CODE> as the arguments.
<P>
If the result cannot be expressed in the <CODE>VARIETY</CODE> being
used to represent <I>v</I>, an overflow error is caused and is handled
in the way specified by <I>ov_err</I>.
<P>
<H3>5.16.77. <A NAME=M158>n_copies</A></H3>
<B>Encoding number</B>: 76<P>
<PRE>
<I>n</I>: NAT
<I>arg1</I>: EXP <I>x</I>
-> EXP NOF(<I>n</I>, <I>x</I>)
</PRE>
<I>arg1</I> is evaluated and an <CODE>NOF</CODE> value is delivered
which contains <I>n</I> copies of this value. <I>n</I> can be zero
or one or greater.
<P>
Producers are encouraged to use <I>n_copies</I> to initialise arrays
of known size.
<P>
<H3>5.16.78. <A NAME=M159>negate</A></H3>
<B>Encoding number</B>: 77<P>
<PRE>
<I>ov_err</I>: ERROR_TREATMENT
<I>arg1</I>: EXP INTEGER(<I>v</I>)
-> EXP INTEGER(<I>v</I>)
</PRE>
<I>arg1</I> is evaluated and will produce an integer value, <I>a</I>.
The value -<I>a</I> is delivered as the result of the construct, with
the same <CODE>SHAPE</CODE> as the argument.
<P>
If the result cannot be expressed in the <CODE>VARIETY</CODE> being
used to represent <I>v</I>, an overflow error is caused and is handled
in the way specified by <I>ov_err</I>.
<P>
<H3>5.16.79. <A NAME=M160>not</A></H3>
<B>Encoding number</B>: 78<P>
<PRE>
<I>arg1</I>: EXP INTEGER(<I>v</I>)
-> EXP INTEGER(<I>v</I>)
</PRE>
The argument is evaluated producing an integer value, of
<CODE>VARIETY</CODE>, <I>v</I>. The result is the bitwise <I>not</I>
of this value in the representing <CODE>VARIETY</CODE>. The result
is delivered as the result of the construct, with the same
<CODE>SHAPE</CODE> as the arguments.
<P>
See <A HREF="spec10.html#51">Representing integers</A>.
<P>
<H3>5.16.80. <A NAME=M161>obtain_tag</A></H3>
<B>Encoding number</B>: 79<P>
<PRE>
<I>t</I>: TAG <I>x</I>
-> EXP <I>x</I>
</PRE>
The value with which the <CODE>TAG</CODE> <I>t</I> is bound is delivered.
The <CODE>SHAPE</CODE> of the result is the <CODE>SHAPE</CODE> of
the value with which the <CODE>TAG</CODE> is bound.
<P>
<H3>5.16.81. <A NAME=M162>offset_add</A></H3>
<B>Encoding number</B>: 80<P>
<PRE>
<I>arg1</I>: EXP OFFSET(<I>x</I>, <I>y</I>)
<I>arg2</I>: EXP OFFSET(<I>z</I>, <I>t</I>)
-> EXP OFFSET(<I>x</I>, <I>t</I>)
</PRE>
The two arguments deliver <CODE>OFFSET</CODE>s. The result is the
sum of these <CODE>OFFSET</CODE>s, as an <CODE>OFFSET</CODE>.
<P>
<I>y</I> will include <I>z</I>.
<P>
<I>The effect of the constraint "y will include z" is that,
in the simple representation of pointer arithmetic, this operation
can be represented by addition. offset_add can lose information, so
that offset_subtract does not have the usual relation with it.</I>
<P>
<H3>5.16.82. <A NAME=M163>offset_div</A></H3>
<B>Encoding number</B>: 81<P>
<PRE>
<I>v</I>: VARIETY
<I>arg1</I>: EXP OFFSET(<I>x</I>, <I>x</I>)
<I>arg2</I>: EXP OFFSET(<I>x</I>, <I>x</I>)
-> EXP INTEGER(<I>v</I>)
</PRE>
The two arguments deliver <CODE>OFFSET</CODE>s, <I>a</I> and <I>b</I>.
The result is <I>a/b</I>, as an <CODE>INTEGER</CODE> of <CODE>VARIETY</CODE>,
<I>v</I>. Division is interpreted in the same sense (with respect
to remainder) as in <I>div0</I>.
<P>
The value produced by <I>arg2</I> will be non-zero.
<P>
<H3>5.16.83. <A NAME=M164>offset_div_by_int</A></H3>
<B>Encoding number</B>: 82<P>
<PRE>
<I>arg1</I>: EXP OFFSET(<I>x</I>, <I>x</I>)
<I>arg2</I>: EXP INTEGER(<I>v</I>)
-> EXP OFFSET(<I>x</I>, <I>x</I>)
</PRE>
The result is the <CODE>OFFSET</CODE> produced by <I>arg1</I> divided
by <I>arg2</I>, as an <CODE>OFFSET</CODE>(<I>x</I>, <I>x</I>).
<P>
The value produced by <I>arg2</I> will be greater than zero.
<P>
The following identity will apply for all A and n:<P>
<I>offset_mult</I>(<I>offset_div_by_int</I>(A, n), n) = A<P>
<P>
<H3>5.16.84. <A NAME=M165>offset_max</A></H3>
<B>Encoding number</B>: 83<P>
<PRE>
<I>arg1</I>: EXP OFFSET(<I>x</I>, <I>y</I>)
<I>arg2</I>: EXP OFFSET(<I>z</I>, <I>y</I>)
-> EXP OFFSET(<I>unite_alignments</I>(<I>x</I>, <I>z</I>), <I>y</I>)
</PRE>
The two arguments deliver <CODE>OFFSET</CODE>s. The result is the
maximum of these <CODE>OFFSET</CODE>s, as an <CODE>OFFSET</CODE>.
<P>
See <A HREF="spec10.html#31">Comparison of pointers and offsets</A>.
<P>
<I>In the simple memory model this operation is represented by maximum.
The constraint that the second <CODE>ALIGNMENT</CODE> parameters are
both y is to permit the representation of <CODE>OFFSET</CODE>s in
installers by a simple homomorphism.</I>
<P>
<H3>5.16.85. <A NAME=M166>offset_mult</A></H3>
<B>Encoding number</B>: 84<P>
<PRE>
<I>arg1</I>: EXP OFFSET(<I>x</I>, <I>x</I>)
<I>arg2</I>: EXP INTEGER(<I>v</I>)
-> EXP OFFSET(<I>x</I>, <I>x</I>)
</PRE>
The first argument gives an <CODE>OFFSET</CODE>, <I>off</I>, and the
second an integer, <I>n</I>. The result is the product of these, as
an offset.
<P>
The result shall be equal to <I>offset_adding off n</I>
times to <I>offset_zero</I>(<I>x</I>).
<P>
<H3>5.16.86. <A NAME=M167>offset_negate</A></H3>
<B>Encoding number</B>: 85<P>
<PRE>
<I>arg1</I>: EXP OFFSET(<I>x</I>, <I>x</I>)
-> EXP OFFSET(<I>x</I>, <I>x</I>)
</PRE>
The inverse of the argument is delivered.
<P>
<I>In the simple memory model this can be represented by negate.</I>
<P>
<H3>5.16.87. <A NAME=M169>offset_pad</A></H3>
<B>Encoding number</B>: 86<P>
<PRE>
<I>a</I>: ALIGNMENT
<I>arg1</I>: EXP OFFSET(<I>z</I>, <I>t</I>)
-> EXP OFFSET(<I>unite_alignments</I>(<I>z</I>, <I>a</I>), <I>a</I>)
</PRE>
<I>arg1</I> is evaluated giving <I>off</I>. The next greater or equal
<CODE>OFFSET</CODE> at which a value of <CODE>ALIGNMENT</CODE> <I>a</I>
can be placed is delivered. That is, there shall not exist an
<CODE>OFFSET</CODE> of the same <CODE>SHAPE</CODE> as the result which
is greater than or equal to <I>off</I> and less than the result, in
the sense of <I>offset_test</I>.
<P>
<I>off</I> will be a non-negative <CODE>OFFSET</CODE>, that is it
will be greater than or equal to a zero <CODE>OFFSET</CODE> of the
same <CODE>SHAPE</CODE> in the sense of <I>offset_test</I>.
<P>
<I>In the simple memory model this operation can be represented by
((off + a - 1) / a) * a. In the simple model this is the only operation
which is not represented by a simple corresponding integer operation.</I>
<P>
<H3>5.16.88. <A NAME=M170>offset_subtract</A></H3>
<B>Encoding number</B>: 87<P>
<PRE>
<I>arg1</I>: EXP OFFSET(<I>x</I>, <I>y</I>)
<I>arg2</I>: EXP OFFSET(<I>x</I>, <I>z</I>)
-> EXP OFFSET(<I>z</I>, <I>y</I>)
</PRE>
The two arguments deliver offsets, <I>p</I> and <I>q</I>. The result
is <I>p</I>-<I>q</I>, as an offset.
<P>
Note that <I>x</I> will include <I>y</I>, <I>x</I> will include <I>z</I>
and <I>z</I> will include <I>y</I>, by the constraints on
<CODE>OFFSET</CODE>s.
<P>
<I>offset_subtract and offset_add do not have the conventional relationship
because offset_add can lose information, which cannot be regenerated
by offset_subtract.</I>
<P>
<H3>5.16.89. <A NAME=M172>offset_test</A></H3>
<B>Encoding number</B>: 88<P>
<PRE>
<I>prob</I>: OPTION(NAT)
<I>nt</I>: NTEST
<I>dest</I>: LABEL
<I>arg1</I>: EXP OFFSET(<I>x</I>, <I>y</I>)
<I>arg2</I>: EXP OFFSET(<I>x</I>, <I>y</I>)
-> EXP TOP
</PRE>
<I>arg1</I> and <I>arg2</I> are evaluated and will produce offset
values, <I>a</I> and <I>b</I>. These values are compared using <I>nt</I>.
<P>
If <I>a nt b</I>, this construction yields <CODE>TOP</CODE>. Otherwise
control passes to <I>dest</I>.
<P>
If <I>prob</I> is present, <I>prob</I>/100 gives the probability that
control will continue to the next construct (ie. not pass to <I>dest</I>).
If <I>prob</I> is absent this probability is unknown.
<P>
<I>a greater_than_or_equal b</I> is equivalent to
<I>offset_max</I>(<I>a</I>, <I>b</I>) = <I>a</I>, and similarly for
the other comparisons.
<P>
<I>In the simple memory model this can be represented by integer_test.</I>
<P>
<H3>5.16.90. <A NAME=M173>offset_zero</A></H3>
<B>Encoding number</B>: 89<P>
<PRE>
<I>a</I>: ALIGNMENT
-> EXP OFFSET(<I>a</I>, <I>a</I>)
</PRE>
A zero offset of <CODE>SHAPE OFFSET</CODE>(<I>a</I>,
<I>a</I>).
<P>
<I>offset_pad</I>(<I>b</I>, <I>offset_zero</I>(<I>a</I>)) is a zero
offset of <CODE>SHAPE OFFSET</CODE>(<I>unite_alignments</I>(<I>a</I>,
<I>b</I>), <I>b</I>).
<P>
<H3>5.16.91. <A NAME=M174>or</A></H3>
<B>Encoding number</B>: 90<P>
<PRE>
<I>arg1</I>: EXP INTEGER(<I>v</I>)
<I>arg2</I>: EXP INTEGER(<I>v</I>)
-> EXP INTEGER(<I>v</I>)
</PRE>
The arguments are evaluated producing integer values of the same
<CODE>VARIETY</CODE>, <I>v</I>. The result is the bitwise <I>or</I>
of these two integers in the representing <CODE>VARIETY</CODE>. The
result is delivered as the result of the construct, with the same
<CODE>SHAPE</CODE> as the arguments.
<P>
See <A HREF="spec10.html#51">Representing integers</A>.
<P>
<H3>5.16.92. <A NAME=M175>plus</A></H3>
<B>Encoding number</B>: 91<P>
<PRE>
<I>ov_err</I>: ERROR_TREATMENT
<I>arg1</I>: EXP INTEGER(<I>v</I>)
<I>arg2</I>: EXP INTEGER(<I>v</I>)
-> EXP INTEGER(<I>v</I>)
</PRE>
<I>arg1</I> and <I>arg2</I> are evaluated and will produce integer
values, <I>a</I> and <I>b</I>, of the same <CODE>VARIETY</CODE>, <I>v</I>.
The sum <I>a</I>+<I>b</I> is delivered as the result of the construct,
with the same <CODE>SHAPE</CODE> as the arguments.
<P>
If the result cannot be expressed in the <CODE>VARIETY</CODE> being
used to represent <I>v</I>, an overflow error is caused and is handled
in the way specified by <I>ov_err</I>.
<P>
<H3>5.16.93. <A NAME=M176>pointer_test</A></H3>
<B>Encoding number</B>: 92<P>
<PRE>
<I>prob</I>: OPTION(NAT)
<I>nt</I>: NTEST
<I>dest</I>: LABEL
<I>arg1</I>: EXP POINTER(<I>x</I>)
<I>arg2</I>: EXP POINTER(<I>x</I>)
-> EXP TOP
</PRE>
<I>arg1</I> and <I>arg2</I> are evaluated and will produce pointer
values, <I>a</I> and <I>b</I>, which will be derived from the same
original pointer. These values are compared using <I>nt</I>.
<P>
If <I>a nt b</I>, this construction yields <CODE>TOP</CODE>. Otherwise
control passes to <I>dest</I>.
<P>
If <I>prob</I> is present, <I>prob</I>/100 gives the probability that
control will continue to the next construct (ie. not pass to <I>dest</I>).
If <I>prob</I> is absent this probability is unknown.
<P>
The effect of this construction is the same as:<P>
<I>offset_test</I>(<I>prob, nt</I>, <I>dest</I>, <I>subtract_ptrs</I>(<I>arg1
</I>,
<I>arg2</I>), <I>offset_zero</I>(<I>x</I>))<P>
<I>In the simple memory model this construction can be represented
by integer_test.</I>
<P>
<H3>5.16.94. <A NAME=M177>power</A></H3>
<B>Encoding number</B>: 93<P>
<PRE>
<I>ov_err</I>: ERROR_TREATMENT
<I>arg1</I>: EXP INTEGER(<I>v</I>)
<I>arg2</I>: EXP INTEGER(<I>w</I>)
-> EXP INTEGER(<I>v</I>)
</PRE>
<I>arg2</I> will be non-negative. The result is the result of <I>arg1</I>
raised to the power given by <I>arg2</I>.
<P>
If the result cannot be expressed in the <CODE>VARIETY</CODE> being
used to represent <I>v</I>, an overflow error is caused and is handled
in the way specified by <I>ov_err</I>.
<P>
<H3>5.16.95. <A NAME=M178>proc_test</A></H3>
<B>Encoding number</B>: 94<P>
<PRE>
<I>prob</I>: OPTION(NAT)
<I>nt</I>: NTEST
<I>dest</I>: LABEL
<I>arg1</I>: EXP PROC
<I>arg2</I>: EXP PROC
-> EXP TOP
</PRE>
<I>arg1</I> and <I>arg2</I> are evaluated and will produce
<CODE>PROC</CODE> values, <I>a</I> and <I>b</I>. These values are
compared using <I>nt</I>. The only permitted values of <I>nt</I>
are
<I>equal</I> and <I>not_equal</I>.
<P>
If <I>a nt b</I>, this construction yields <CODE>TOP</CODE>. Otherwise
control passes to <I>dest</I>.
<P>
If <I>prob</I> is present, <I>prob</I>/100 gives the probability that
control will continue to the next construct (ie. not pass to <I>dest</I>).
If <I>prob</I> is absent this probability is unknown.
<P>
Two <CODE>PROC</CODE>s are equal if they were produced by the same
instantiation of <I>make_proc</I> or if they were both made with
<I>make_null_proc</I>. Otherwise they are unequal.
<P>
<H3>5.16.96. <A NAME=M179>profile</A></H3>
<B>Encoding number</B>: 95<P>
<PRE>
<I>uses</I>: NAT
-> EXP TOP
</PRE>
The integer <I>uses</I> gives the number of times which this construct
is expected to be evaluated.
<P>
All uses of <I>profile</I> in the same capsule are to the same scale.
They will be mutually consistent.
<P>
<H3>5.16.97. <A NAME=M180>real_part</A></H3>
<B>Encoding number</B>: 96<P>
<PRE>
<I>arg1</I>: EXP <I>c</I>
-> EXP FLOATING (<I>float_of_complex(c)</I>)
</PRE>
<I>c</I> will be complex. Delivers the real part of the value produced
by <I>arg1</I>.
<P>
<H3>5.16.98. <A NAME=M181>rem0</A></H3>
<B>Encoding number</B>: 97<P>
<PRE>
<I>div_by_0_err</I>: ERROR_TREATMENT
<I>ov_err</I>: ERROR_TREATMENT
<I>arg1</I>: EXP INTEGER(<I>v</I>)
<I>arg2</I>: EXP INTEGER(<I>v</I>)
-> EXP INTEGER(<I>v</I>)
</PRE>
<I>arg1</I> and <I>arg2</I> are evaluated and will produce integer
values, <I>a</I> and <I>b</I>, of the same <CODE>VARIETY</CODE>, <I>v</I>.
The value <I>a</I> M1 <I>b</I> or the value <I>a</I> M2 <I>b</I> is
delivered as the result of the construct, with the same <CODE>SHAPE</CODE>
as the arguments. Different occurrences of <I>rem0</I> in the same
capsule can use M1 or M2 independently.
<P>
The following equivalence shall hold:
<PRE>
<I>x = plus(mult(div0(x, y), y), rem0(x, y))</I>
</PRE>
if all the <CODE>ERROR_TREATMENT</CODE>s are <I>impossible</I>, and
<I>x</I> and <I>y</I> have no side effects.
<P>
If <I>b</I> is zero a div_by_zero error occurs and is handled by
<I>div_by_0_err</I>.
<P>
If <I>b</I> is not zero and <I>div0</I>(<I>a</I>, <I>b</I>) cannot
be expressed in the <CODE>VARIETY</CODE> being used to represent <I>v</I>
an overflow may occur in which case it is handled by <I>ov_err</I>.
<P>
Producers may assume that suitable masking and <I>rem0</I> by a power
of two yield equally good code.
<P>
See <A HREF="spec10.html#10">Division and modulus</A> for the definitions
of D1, D2, M1 and M2.
<P>
<H3>5.16.99. <A NAME=M182>rem1</A></H3>
<B>Encoding number</B>: 98<P>
<PRE>
<I>div_by_0_err</I>: ERROR_TREATMENT
<I>ov_err</I>: ERROR_TREATMENT
<I>arg1</I>: EXP INTEGER(<I>v</I>)
<I>arg2</I>: EXP INTEGER(<I>v</I>)
-> EXP INTEGER(<I>v</I>)
</PRE>
<I>arg1</I> and <I>arg2</I> are evaluated and will produce integer
values, <I>a</I> and <I>b</I>, of the same <CODE>VARIETY</CODE>, <I>v</I>.
The value <I>a</I> M1 <I>b</I> is delivered as the result of the construct,
with the same <CODE>SHAPE</CODE> as the arguments.
<P>
If <I>b</I> is zero a div_by_zero error occurs and is handled by
<I>div_by_0_err</I>.
<P>
If <I>b</I> is not zero and <I>div1</I>(<I>a</I>, <I>b</I>) cannot
be expressed in the <CODE>VARIETY</CODE> being used to represent <I>v</I>
an overflow may occur, in which case it is handled by <I>ov_err</I>.
<P>
Producers may assume that suitable masking and <I>rem1</I> by a power
of two yield equally good code.
<P>
See <A HREF="spec10.html#10">Division and modulus</A> for the definitions
of D1, D2, M1 and M2.
<P>
<H3>5.16.100. <A NAME=M183>rem2</A></H3>
<B>Encoding number</B>: 99<P>
<PRE>
<I>div_by_0_err</I>: ERROR_TREATMENT
<I>ov_err</I>: ERROR_TREATMENT
<I>arg1</I>: EXP INTEGER(<I>v</I>)
<I>arg2</I>: EXP INTEGER(<I>v</I>)
-> EXP INTEGER(<I>v</I>)
</PRE>
<I>arg1</I> and <I>arg2</I> are evaluated and will produce integer
values, <I>a</I> and <I>b</I>, of the same <CODE>VARIETY</CODE>, <I>v</I>.
The value <I>a</I> M2 <I>b</I> is delivered as the result of the construct,
with the same <CODE>SHAPE</CODE> as the arguments.
<P>
If <I>b</I> is zero a div_by_zero error occurs and is handled by
<I>div_by_0_err</I>.
<P>
If <I>b</I> is not zero and <I>div2</I>(<I>a</I>, <I>b</I>) cannot
be expressed in the <CODE>VARIETY</CODE> being used to represent <I>v</I>
an overflow may occur, in which case it is handled by <I>ov_err</I>.
<P>
Producers may assume that suitable masking and <I>rem2</I> by a power
of two yield equally good code if the lower bound of <I>v</I> is zero.
<P>
See <A HREF="spec10.html#10">Division and modulus</A> for the definitions
of D1, D2, M1 and M2.
<P>
<H3>5.16.101. <A NAME=M184>repeat</A></H3>
<!-- BREAK 1 -->
<B>Encoding number</B>: 100<P>
<PRE>
<I>replab_intro</I>: LABEL
<I>start</I>: EXP TOP
<I>body</I>: EXP <I>y</I>
-> EXP <I>y</I>
</PRE>
<I>start</I> is evaluated. Then <I>body</I> is evaluated.
<P>
If <I>body</I> produces a result, this is the result of the whole
construction. However if <I>goto</I> or any other jump to
<I>replab_intro</I> is encountered during the evaluation then the
current evaluation stops and <I>body</I> is evaluated again. In the
canonical order all evaluated components are completely evaluated
before any of the next iteration of <I>body</I>. The lifetime of
<I>replab_intro</I> is the evaluation of <I>body</I>.
<P>
The actual order of evaluation of the constituents shall be indistinguishable
in all observable effects (apart from time) from that described above.
Note that this specifically includes any defined error handling.
<P>
<H3>5.16.102. <A NAME=M185>return</A></H3>
<B>Encoding number</B>: 101<P>
<PRE>
<I>arg1</I>: EXP <I>x</I>
-> EXP BOTTOM
</PRE>
<I>arg1</I> is evaluated to produce a value, <I>v</I>. The evaluation
of the immediately enclosing procedure ceases and <I>v</I> is delivered
as the result of the procedure.
<P>
Since the <I>return</I> construct can never produce a value, the
<CODE>SHAPE</CODE> of its result is <CODE>BOTTOM</CODE>.
<P>
All uses of <I>return</I> in the <I>body</I> of a <I>make_proc</I>
or
<I>make_general_proc</I> will have <I>arg1</I> with the same
<CODE>SHAPE</CODE>.
<P>
<H3>5.16.103. <A NAME=M186>return_to_label</A></H3>
<B>Encoding number</B>: 102<P>
<PRE>
<I>lab_val</I>: EXP POINTER <I>code_alignment</I>
-> EXP BOTTOM
</PRE>
<I>lab_val</I> will be a label value in the calling procedure.
<P>
The evaluation of the immediately enclosing procedure ceases and control
is passed to the calling procedure at the label given by <I>lab_val</I>.
<P>
<H3>5.16.104. <A NAME=M187>round_with_mode</A></H3>
<B>Encoding number</B>: 103<P>
<PRE>
<I>flpt_err</I>: ERROR_TREATMENT
<I>mode</I>: ROUNDING_MODE
<I>r</I>: VARIETY
<I>arg1</I>: EXP FLOATING(<I>f</I>)
-> EXP INTEGER(<I>r</I>)
</PRE>
<I>arg</I> is evaluated to produce a floating point value, <I>v</I>.
This is rounded to an integer of <CODE>VARIETY</CODE>, <I>r</I>, using
the <CODE>ROUNDING_MODE</CODE>, <I>mode</I>. This is the result of
the construction.
<P>
If <I>f</I> is complex the result is derived from the real part of
<I>arg1</I>.
<P>
If there is a floating point error it is handled by <I>flpt_err</I>.
See <A HREF="spec10.html#60">Floating point errors</A>.
<P>
<H3>5.16.105. <A NAME=M188>rotate_left</A></H3>
<B>Encoding number</B>: 104<P>
<PRE>
<I>arg1</I>: EXP INTEGER(<I>v</I>)
<I>arg2</I>: EXP INTEGER(<I>w</I>)
-> EXP INTEGER(<I>v</I>)
</PRE>
The value delivered by <I>arg1</I> is rotated left <I>arg2</I> places.
<P>
<I>arg2</I> will be non-negative and will be strictly less than the
number of bits needed to represent <I>v</I>.
<P>
The use of this construct assumes knowledge of the representational
variety of <I>v</I>.
<P>
<H3>5.16.106. <A NAME=M190>rotate_right</A></H3>
<B>Encoding number</B>: 105<P>
<PRE>
<I>arg1</I>: EXP INTEGER(<I>v</I>)
<I>arg2</I>: EXP INTEGER(<I>w</I>)
-> EXP INTEGER(<I>v</I>)
</PRE>
The value delivered by <I>arg1</I> is rotated right <I>arg2</I> places.
<P>
<I>arg2</I> will be non-negative and will be strictly less than the
number of bits needed to represent <I>v</I>.
<P>
The use of this construct assumes knowledge of the representational
variety of <I>v</I>.
<P>
<H3>5.16.107. <A NAME=M193>sequence</A></H3>
<B>Encoding number</B>: 106<P>
<PRE>
<I>statements</I>: LIST(EXP)
<I>result</I>: EXP <I>x</I>
-> EXP <I>x</I>
</PRE>
The statements are evaluated in the same order as the list,
<I>statements</I>, and their results are discarded. Then <I>result</I>
is evaluated and its result forms the result of the construction.
<P>
A canonical order is one in which all the components of each statement
are completely evaluated before any component of the next statement
is started. A similar constraint applies between the last statement
and the <I>result</I>. The actual order in which the statements and
their components are evaluated shall be indistinguishable in all observable
effects (apart from time) from a canonical order.
<P>
Note that this specifically includes any defined error handling. However,
if in any canonical order the effect of the program is undefined,
the actual effect of the sequence is undefined.
<P>
Hence constructions with <I>impossible</I> error handlers may be performed
before or after those with specified error handlers, if the resulting
order is otherwise acceptable.
<P>
<H3>5.16.108. <A NAME=M194>set_stack_limit</A></H3>
<B>Encoding number</B>: 107<P>
<PRE>
<I>lim</I>: EXP POINTER({<I>locals_alignment, alloca_alignment}</I>)
-> EXP TOP
</PRE>
<I>set_stack_limit</I> sets the limits of remaining free stack space
to <I>lim</I>. This include both the frame stack limit and the local_alloc
stack. Note that, in implementations where the frame stack and local_alloc
stack are distinct, this pointer will have a special representation,
appropriate to its frame alignment. Thus the pointer should always
be generated using <I>make_stack_limit</I> or its equivalent formation.
<P>
Any later <I>apply_general_proc</I> with <CODE>PROCPROPS</CODE> including
<I>check_stack</I> up to the dynamically next <I>set_stack_limit</I>
will check that the frame required for the procedure will be within
the frame stack limit. If it is not, normal execution is stopped and
a TDF exception with ERROR_CODE <I>stack_overflow</I> is raised.
<P>
Any later <I>local_alloc_check</I> will check that the locally allocated
space required is within the local_alloc stack limit. If it is not,
normal execution is stopped and a TDF exception with ERROR_CODE
<I>stack_overflow</I> is raised.
<P>
<P>
<H3>5.16.109. <A NAME=M196>shape_offset</A></H3>
<B>Encoding number</B>: 108<P>
<PRE>
<I>s</I>: SHAPE
-> EXP OFFSET(<I>alignment</I>(<I>s</I>), {})
</PRE>
This construction delivers the "size" of a value of the
given <CODE>SHAPE</CODE>.
<P>
Suppose that a value of <CODE>SHAPE</CODE>, <I>s</I>, is placed in
a space indicated by a <CODE>POINTER</CODE>(<I>x</I>), <I>p</I>, where
<I>x</I> includes <I>alignment(s</I>). Suppose that a value of
<CODE>SHAPE</CODE>, <I>t</I>, where <I>a</I> is
<I>alignment</I>(<I>t</I>) and <I>x</I> includes <I>a</I>, is placed
at<P>
<I>add_to_ptr</I>(<I>p</I>, <I>offset_pad(a, shape_offset</I>(<I>s</I>)))<P>
Then the values shall not overlap. This shall be true for all legal
<I>s</I>, <I>x</I> and <I>t</I>.
<P>
<H3>5.16.110. <A NAME=M197>shift_left</A></H3>
<B>Encoding number</B>: 109<P>
<PRE>
<I>ov_err</I>: ERROR_TREATMENT
<I>arg1</I>: EXP INTEGER(<I>v</I>)
<I>arg2</I>: EXP INTEGER(<I>w</I>)
-> EXP INTEGER(<I>v</I>)
</PRE>
<I>arg1</I> and <I>arg2</I> are evaluated and will produce integer
values, <I>a</I> and <I>b</I>. The value <I>a</I> shifted left <I>b</I>
places is delivered as the result of the construct, with the same
<CODE>SHAPE</CODE> as <I>a</I>.
<P>
<I>b</I> will be non-negative and will be strictly less than the number
of bits needed to represent <I>v</I>.
<P>
If the result cannot be expressed in the <CODE>VARIETY</CODE> being
used to represent <I>v</I>, an overflow error is caused and is handled
in the way specified by <I>ov_err</I>.
<P>
Producers may assume that <I>shift_left</I> and multiplication by
a power of two yield equally efficient code.
<P>
<H3>5.16.111. <A NAME=M198>shift_right</A></H3>
<B>Encoding number</B>: 110<P>
<PRE>
<I>arg1</I>: EXP INTEGER(<I>v</I>)
<I>arg2</I>: EXP INTEGER(<I>w</I>)
-> EXP INTEGER(<I>v</I>)
</PRE>
<I>arg1</I> and <I>arg2</I> are evaluated and will produce integer
values, <I>a</I> and <I>b</I>. The value <I>a</I> shifted right <I>b</I>
places is delivered as the result of the construct, with the same
<CODE>SHAPE</CODE> as <I>arg1</I>.
<P>
<I>b</I> will be non-negative and will be strictly less than the number
of bits needed to represent <I>v</I>.
<P>
If the lower bound of <I>v</I> is negative, the sign will be propagated.
<P>
<H3>5.16.112. <A NAME=M199>subtract_ptrs</A></H3>
<B>Encoding number</B>: 111<P>
<PRE>
<I>arg1</I>: EXP POINTER(<I>y</I>)
<I>arg2</I>: EXP POINTER(<I>x</I>)
-> EXP OFFSET(<I>x</I>, <I>y</I>)
</PRE>
<I>arg1</I> and <I>arg2</I> are evaluated to produce pointers <I>p1</I>
and <I>p2</I>, which will be derived from the same original pointer.
The result, <I>r</I>, is the <CODE>OFFSET</CODE> from <I>p2</I> to
<I>p1</I>. Both arguments will be derived from the same original pointer.
<P>
Note that <I>add_to_ptr</I>(<I>p2</I>, <I>r</I>) = <I>p1</I>.
<P>
<H3>5.16.113. <A NAME=M200>tail_call</A></H3>
<B>Encoding number</B>: 112<P>
<PRE>
<I>prcprops</I>: OPTION(PROCPROPS)
<I>p</I>: EXP PROC
<I>callee_pars</I>: CALLEES
-> EXP BOTTOM
</PRE>
<I>p</I> is called in the sense of <I>apply_general_proc</I> with
the caller parameters of the immediately enclosing proc and
<CODE>CALLEES</CODE> given by <I>callee_pars</I> and
<CODE>PROCPROPS</CODE> <I>prcprops</I>.
<P>
The result of the call is delivered as the result of the immediately
enclosing proc in the sense of <I>return</I>. The <CODE>SHAPE</CODE>
of the result of <I>p</I> will be identical to the <CODE>SHAPE</CODE>
specified as the result of immediately enclosing procedure.
<P>
No pointers to any callee parameters, variables, identifications or
local allocations defined in immediately enclosing procedure will
be accessed either in the body of <I>p</I> or after the return.
<P>
The presence or absence of each of the <CODE>PROCPROPS</CODE>
<I>check_stack</I> and <I>untidy</I>, in <I>prcprops</I> will be reflected
in the <CODE>PROCPROPS</CODE> of the immediately enclosing procedure.
<P>
<H3>5.16.114. <A NAME=M201>untidy_return</A></H3>
<B>Encoding number</B>: 113<P>
<PRE>
<I>arg1</I>: EXP <I>x</I>
-> EXP BOTTOM
</PRE>
<I>arg1</I> is evaluated to produce a value, <I>v</I>. The evaluation
of the immediately enclosing procedure ceases and <I>v</I> is delivered
as the result of the procedure, in such a manner as that pointers
to any callee parameters or local allocations are valid in the calling
procedure.
<P>
<I>untidy_return</I> can only occur in a procedure defined by
<I>make_general_proc</I> with <CODE>PROCPROPS</CODE> including
<I>untidy</I>.
<P>
<P>
<H3>5.16.115. <A NAME=M202>variable</A></H3>
<!-- BREAK 3 -->
<B>Encoding number</B>: 114<P>
<PRE>
<I>opt_access</I>: OPTION(ACCESS)
<I>name_intro</I>: TAG POINTER(<I>alignment(x</I>))
<I>init</I>: EXP <I>x</I>
<I>body</I>: EXP <I>y</I>
-> EXP <I>y</I>
</PRE>
<I>init</I> is evaluated to produce a value, <I>v</I>. Space is allocated
to hold a value of <CODE>SHAPE</CODE> <I>x</I>
and this is initialised with <I>v</I>. Then <I>body</I> is evaluated.
During this evaluation, an original <CODE>POINTER</CODE> pointing
to the allocated space is bound to <I>name_intro</I>. This means that
inside <I>body</I> an evaluation of <I>obtain_tag</I>(<I>name_intro</I>)
will produce a <CODE>POINTER</CODE> to this space. The lifetime of
<I>name_intro</I> is the evaluation of <I>body</I>.
<P>
The value delivered by <I>variable</I> is that produced by <I>body</I>.
<P>
If <I>opt_access</I> contains <I>visible</I>, it means that the contents
of the space may be altered while the procedure containing this declaration
is not the current procedure. Hence if there are any copies of this
value they will need to be refreshed from the variable when the procedure
is returned to. The easiest implementation when <I>opt_access</I>
is <I>visible</I> may be to keep the value in memory, but this is
not a necessary requirement.
<P>
The <CODE>TAG</CODE> given for <I>name_intro</I> will not be reused
within the current <CODE>UNIT</CODE>. No rules for the hiding of one
<CODE>TAG</CODE> by another are given: this will not happen.
<P>
The order in which the constituents of <I>init</I> and <I>body</I>
are evaluated shall be indistinguishable in all observable effects
(apart from time) from completely evaluating <I>init</I> before starting
<I>body</I>. See the note about order in
<A HREF="#M193">sequence</A>.
<P>
When compiling languages which permit uninitialised variable declarations,
<I>make_value</I> may be used to provide an initialisation.
<P>
<H3>5.16.116. <A NAME=M204>xor</A></H3>
<B>Encoding number</B>: 115<P>
<PRE>
<I>arg1</I>: EXP INTEGER(<I>v</I>)
<I>arg2</I>: EXP INTEGER(<I>v</I>)
-> EXP INTEGER(<I>v</I>)
</PRE>
The arguments are evaluated producing integer values of the same
<CODE>VARIETY</CODE>, <I>v</I>. The result is the bitwise <I>xor</I>
of these two integers in the representing <CODE>VARIETY</CODE>. The
result is delivered as the result of the construct, with the same
<CODE>SHAPE</CODE> as the arguments.
<P>
See <A HREF="spec10.html#51">Representing integers</A>.
<P>
<HR>
<H2>5.17. <A NAME=M205>EXTERNAL</A></H2>
<B>Number of encoding bits</B>: 2<BR>
<B>Is coding extendable</B>: yes<P>
An <CODE>EXTERNAL</CODE> defines the classes of external name available
for connecting the internal names inside a <CODE>CAPSULE</CODE> to
the world outside the <CODE>CAPSULE</CODE>.
<P>
<H3>5.17.1. <A NAME=M206>string_extern</A></H3>
<!-- ALIGN 0 -->
<B>Encoding number</B>: 1<P>
<PRE>
<I>s</I>: BYTE_ALIGN TDFIDENT(<I>n</I>)
-> EXTERNAL
</PRE>
<I>string_extern</I> produces an <CODE>EXTERNAL</CODE> identified
by the <CODE>TDFIDENT</CODE> <I>s</I>.
<P>
<H3>5.17.2. <A NAME=M207>unique_extern</A></H3>
<!-- ALIGN 0 -->
<B>Encoding number</B>: 2<P>
<PRE>
<I>u</I>: BYTE_ALIGN UNIQUE
-> EXTERNAL
</PRE>
<I>unique_extern</I> produces an <CODE>EXTERNAL</CODE> identified
by the <CODE>UNIQUE</CODE> <I>u</I>.
<P>
<H3>5.17.3. <A NAME=M208>chain_extern</A></H3>
<!-- ALIGN 0 -->
<B>Encoding number</B>: 3<P>
<PRE>
<I>s</I>: BYTE_ALIGN TDFIDENT
<I>prev</I>: TDFINT
-> EXTERNAL
</PRE>
This construct is redundant and should not be used.
<P>
<HR>
<H2>5.18. <A NAME=M209>EXTERN_LINK</A></H2>
<B>Number of encoding bits</B>: 0<BR>
<B>Is coding extendable</B>: no<P>
An auxiliary <CODE>SORT</CODE> providing a list of <CODE>LINKEXTERN</CODE>.
<P>
<H3>5.18.1. <A NAME=M210>make_extern_link</A></H3>
<B>Encoding number</B>: 0<P>
<PRE>
<I>el</I>: SLIST(LINKEXTERN)
-> EXTERN_LINK
</PRE>
<I>make_capsule</I> requires a <CODE>SLIST</CODE>(<CODE>EXTERN_LINK</CODE>)
to express the links between the linkable entities and the named (by
<CODE>EXTERNAL</CODE>s) values outside the <CODE>CAPSULE</CODE>.
<P>
<HR>
<H2>5.19. <A NAME=M303>FLOATING_VARIETY</A></H2>
<B>Number of encoding bits</B>: 3<BR>
<B>Is coding extendable</B>: yes<P>
These describe kinds of floating point number.
<P>
<H3>5.19.1. <A NAME=M212>flvar_apply_token</A></H3>
<B>Encoding number</B>: 1<P>
<PRE>
<I>token_value</I>: TOKEN
<I>token_args</I>: BITSTREAM <I>param_sorts(token_value)</I>
-> FLOATING_VARIETY
</PRE>
The token is applied to the arguments to give a
<CODE>FLOATING_VARIETY</CODE><P> If there is a definition for
<I>token_value</I> in the <CODE>CAPSULE</CODE> then <I>token_args</I>
is a <CODE>BITSTREAM</CODE> encoding of the <CODE>SORT</CODE>s of
its parameters, in the order specified.
<P>
<H3>5.19.2. <A NAME=M213>flvar_cond</A></H3>
<B>Encoding number</B>: 2<P>
<PRE>
<I>control</I>: EXP INTEGER(<I>v</I>)
<I>e1</I>: BITSTREAM FLOATING_VARIETY
<I>e2</I>: BITSTREAM FLOATING_VARIETY
-> FLOATING_VARIETY
</PRE>
The <I>control</I> is evaluated. It will be a constant at install
time under the constant evaluation rules. If it is non-zero, <I>e1</I>
is installed at this point and <I>e2</I> is ignored and never processed.
If <I>control</I> is zero then <I>e2</I> is installed at this point
and <I>e1</I> is ignored and never processed.
<P>
<H3>5.19.3. <A NAME=M214>flvar_parms</A></H3>
<B>Encoding number</B>: 3<P>
<PRE>
<I>base</I>: NAT
<I>mantissa_digs</I>: NAT
<I>min_exponent</I>: NAT
<I>max_exponent</I>: NAT
-> FLOATING_VARIETY
</PRE>
<I>base</I> is the base with respect to which the remaining numbers
refer. <I>base</I> will be a power of 2.
<P>
<I>mantissa_digs</I> is the required number of <I>base</I> digits,
<I>q</I>, such that any number with <I>q</I> digits can be rounded
to a floating point number of the variety and back again without any
change to the <I>q</I> digits.
<P>
<I>min_exponent</I> is the negative of the required minimum integer
such that <I>base</I> raised to that power can be represented as a
non-zero floating point number in the <CODE>FLOATING_VARIETY</CODE>.
<P>
<I>max_exponent</I> is the required maximum integer such that
<I>base</I> raised to that power can be represented in the
<CODE>FLOATING_VARIETY</CODE>.
<P>
A TDF translator is required to make available a representing
<CODE>FLOATING_VARIETY</CODE> such that, if only values within the
given requirements are produced, no overflow error will occur. Where
several such representative <CODE>FLOATING_VARIETY</CODE>s exist,
the translator will choose one to minimise space requirements or maximise
the speed of operations.
<P>
All numbers of the form xb1 M*<I>base N+1-q</I> are required to be
represented exactly where M and N are integers such that<BR>
<I>base</I><I>q-1</I> M < <I>base</I><I>q</I><BR>
-<I>min_exponent</I> N <I>max_exponent</I><P>
Zero will also be represented exactly in any <CODE>FLOATING_VARIETY</CODE>.
<P>
<H3>5.19.4. <A NAME=M215>complex_parms</A></H3>
<B>Encoding number</B>: 4<P>
<PRE>
<I>base</I>: NAT
<I>mantissa_digs</I>: NAT
<I>min_exponent</I>: NAT
<I>max_exponent</I>: NAT
-> FLOATING_VARIETY
</PRE>
A <CODE>FLOATING_VARIETY</CODE> described by <I>complex_parms</I>
holds a complex number which is likely to be represented by its real
and imaginary parts, each of which is as if defined by <I>flvar_parms</I>
with the same arguments.
<P>
<H3>5.19.5. <A NAME=M216>float_of_complex</A></H3>
<B>Encoding number</B>: 5<P>
<PRE>
<I>csh</I>: SHAPE
-> FLOATING_VARIETY
</PRE>
<I>csh</I> will be a complex <CODE>SHAPE</CODE>.
<P>
Delivers the <CODE>FLOATING_VARIETY</CODE> required for the real (or
imaginary) part of a complex <CODE>SHAPE</CODE> <I>csh</I>.
<P>
<H3>5.19.6. <A NAME=M217>complex_of_float</A></H3>
<B>Encoding number</B>: 6<P>
<PRE>
<I>fsh</I>: SHAPE
-> FLOATING_VARIETY
</PRE>
<I>fsh</I> will be a floating <CODE>SHAPE</CODE>.
<P>
Delivers <CODE>FLOATING_VARIETY</CODE> required for a complex number
whose real (and imaginary) parts have <CODE>SHAPE</CODE> <I>fsh</I>.
<P>
<P>
<HR>
<H2>5.20. <A NAME=M218>GROUP</A></H2>
<B>Number of encoding bits</B>: 0<BR>
<B>Is coding extendable</B>: no<P>
A <CODE>GROUP</CODE> is a list of <CODE>UNIT</CODE>s with the same
unit identification.
<P>
<H3>5.20.1. <A NAME=M219>make_group</A></H3>
<B>Encoding number</B>: 0<P>
<PRE>
<I>us</I>: SLIST(UNIT)
-> GROUP
</PRE>
<I>make_capsule</I> contains a list of <CODE>GROUPS</CODE>. Each member
of this list has a different unit identification deduced from the
<I>prop_name</I> argument of <I>make_capsule</I>.
<P>
<HR>
<H2>5.21. <A NAME=M305>LABEL</A></H2>
<B>Number of encoding bits</B>: 1<BR>
<B>Is coding extendable</B>: yes<P>
A <CODE>LABEL</CODE> marks an <CODE>EXP</CODE> in certain constructions,
and is used in jump-like constructions to change the control to the
labelled construction.
<P>
<H3>5.21.1. <A NAME=M221>label_apply_token</A></H3>
<B>Encoding number</B>: 2<P>
<PRE>
<I>token_value</I>: TOKEN
<I>token_args</I>: BITSTREAM <I>param_sorts(token_value)</I>
-> LABEL <I>x</I>
</PRE>
The token is applied to the arguments to give a <CODE>LABEL</CODE>.
<P>
If there is a definition for <I>token_value</I> in the <CODE>CAPSULE</CODE>
then <I>token_args</I> is a <CODE>BITSTREAM</CODE> encoding of the
<CODE>SORT</CODE>s of its parameters, in the order specified.
<P>
<H3>5.21.2. <A NAME=M222>make_label</A></H3>
<B>Encoding number</B>: 1<P>
<PRE>
<I>labelno</I>: TDFINT
-> LABEL
</PRE>
Labels are represented in TDF by integers, but they are not linkable.
Hence the definition and all uses of a <CODE>LABEL</CODE> occur in
the same <CODE>UNIT</CODE>.
<P>
<HR>
<H2>5.22. <A NAME=M223>LINK</A></H2>
<B>Number of encoding bits</B>: 0<BR>
<B>Is coding extendable</B>: no<P>
A <CODE>LINK</CODE> expresses the connection between two variables
of the same <CODE>SORT</CODE>.
<P>
<H3>5.22.1. <A NAME=M224>make_link</A></H3>
<B>Encoding number</B>: 0<P>
<PRE>
<I>unit_name</I>: TDFINT
<I>capsule_name</I>: TDFINT
-> LINK
</PRE>
A <CODE>LINK</CODE> defines a linkable entity declared inside a
<CODE>UNIT</CODE> as <I>unit_name</I> to correspond to a
<CODE>CAPSULE</CODE> linkable entity having the same linkable entity
identification. The <CODE>CAPSULE</CODE> linkable entity is
<I>capsule_name</I>.
<P>
A <CODE>LINK</CODE> is normally constructed by the TDF builder in
the course of resolving sharing and name clashes when constructing
a composite <CODE>CAPSULE</CODE>.
<P>
<HR>
<H2>5.23. <A NAME=M225>LINKEXTERN</A></H2>
<B>Number of encoding bits</B>: 0<BR>
<B>Is coding extendable</B>: no<P>
A value of <CODE>SORT LINKEXTERN</CODE> expresses the connection between
the name by which an object is known inside a <CODE>CAPSULE</CODE>
and a name by which it is known outside.
<P>
<H3>5.23.1. <A NAME=M226>make_linkextern</A></H3>
<B>Encoding number</B>: 0<P>
<PRE>
<I>internal</I>: TDFINT
<I>ext</I>: EXTERNAL
-> LINKEXTERN
</PRE>
<I>make_linkextern</I> produces a <CODE>LINKEXTERN</CODE> connecting
an object identified within a <CODE>CAPSULE</CODE> by a <CODE>TAG</CODE>,
<CODE>TOKEN</CODE>, <CODE>AL_TAG</CODE> or any linkable entity constructed
from <I>internal</I>, with an <CODE>EXTERNAL</CODE>, <I>ext</I>. The
<CODE>EXTERNAL</CODE> is an identifier which linkers and similar programs
can use.
<P>
<HR>
<H2>5.24. <A NAME=M227>LINKS</A></H2>
<B>Number of encoding bits</B>: 0<BR>
<B>Is coding extendable</B>: no<P>
<H3>5.24.1. <A NAME=M228>make_links</A></H3>
<B>Encoding number</B>: 0<P>
<PRE>
<I>ls</I>: SLIST(LINK)
-> LINKS
</PRE>
<I>make_unit</I> uses a <CODE>SLIST</CODE>(<CODE>LINKS</CODE>) to
define which linkable entities within a <CODE>UNIT</CODE> correspond
to the <CODE>CAPSULE</CODE> linkable entities. Each <CODE>LINK</CODE>
in a <CODE>LINKS</CODE> has the same linkable entity identification.
<P>
<HR>
<H2>5.25. <A NAME=M306>NAT</A></H2>
<B>Number of encoding bits</B>: 3<BR>
<B>Is coding extendable</B>: yes<P>
These are non-negative integers of unlimited size.
<P>
<H3>5.25.1. <A NAME=M230>nat_apply_token</A></H3>
<B>Encoding number</B>: 1<P>
<PRE>
<I>token_value</I>: TOKEN
<I>token_args</I>: BITSTREAM <I>param_sorts(token_value)</I>
-> NAT
</PRE>
The token is applied to the arguments to give a <CODE>NAT</CODE>.
<P>
If there is a definition for <I>token_value</I> in the <CODE>CAPSULE</CODE>
then <I>token_args</I> is a <CODE>BITSTREAM</CODE> encoding of the
<CODE>SORT</CODE>s of its parameters, in the order specified.
<P>
<H3>5.25.2. <A NAME=M231>nat_cond</A></H3>
<B>Encoding number</B>: 2<P>
<PRE>
<I>control</I>: EXP INTEGER(<I>v</I>)
<I>e1</I>: BITSTREAM NAT
<I>e2</I>: BITSTREAM NAT
-> NAT
</PRE>
The <I>control</I> is evaluated. It will be a constant at install
time under the constant evaluation rules. If it is non-zero, <I>e1</I>
is installed at this point and <I>e2</I> is ignored and never processed.
If <I>control</I> is zero then <I>e2</I> is installed at this point
and <I>e1</I> is ignored and never processed.
<P>
<H3>5.25.3. <A NAME=M232>computed_nat</A></H3>
<B>Encoding number</B>: 3<P>
<PRE>
<I>arg</I>: EXP INTEGER(<I>v</I>)
-> NAT
</PRE>
<I>arg</I> will be an install-time non-negative constant. The result
is that constant.
<P>
<H3>5.25.4. <A NAME=M233>error_val</A></H3>
<B>Encoding number</B>: 4<P>
<PRE>
<I>err</I>: ERROR_CODE
-> NAT
</PRE>
Gives the <CODE>NAT</CODE> corresponding to the <CODE>ERROR_CODE</CODE>
<I>err</I>. Each distinct <CODE>ERROR_CODE</CODE> will give a different
<CODE>NAT</CODE>.
<P>
<H3>5.25.5. <A NAME=M234>make_nat</A></H3>
<B>Encoding number</B>: 5<P>
<PRE>
<I>n</I>: TDFINT
-> NAT
</PRE>
<I>n</I> is a non-negative integer of unbounded magnitude.
<P>
<HR>
<H2>5.26. <A NAME=M307>NTEST</A></H2>
<B>Number of encoding bits</B>: 4<BR>
<B>Is coding extendable</B>: yes<P>
These describe the comparisons which are possible in the various
<I>test</I> constructions. Note that <I>greater_than</I> is not necessarily
the same as <I>not_less_than_or_equal</I>, since the result need not
be defined (e.g. in IEEE floating point).
<P>
<H3>5.26.1. <A NAME=M236>ntest_apply_token</A></H3>
<B>Encoding number</B>: 1<P>
<PRE>
<I>token_value</I>: TOKEN
<I>token_args</I>: BITSTREAM <I>param_sorts(token_value)</I>
-> NTEST
</PRE>
The token is applied to the arguments to give a <CODE>NTEST</CODE>.
<P>
If there is a definition for <I>token_value</I> in the <CODE>CAPSULE</CODE>
then <I>token_args</I> is a <CODE>BITSTREAM</CODE> encoding of the
<CODE>SORT</CODE>s of its parameters, in the order specified.
<P>
<H3>5.26.2. <A NAME=M237>ntest_cond</A></H3>
<B>Encoding number</B>: 2<P>
<PRE>
<I>control</I>: EXP INTEGER(<I>v</I>)
<I>e1</I>: BITSTREAM NTEST
<I>e2</I>: BITSTREAM NTEST
-> NTEST
</PRE>
The <I>control</I> is evaluated. It will be a constant at install
time under the constant evaluation rules. If it is non-zero, <I>e1</I>
is installed at this point and <I>e2</I> is ignored and never processed.
If <I>control</I> is zero then <I>e2</I> is installed at this point
and <I>e1</I> is ignored and never processed.
<P>
<H3>5.26.3. <A NAME=M238>equal</A></H3>
<B>Encoding number</B>: 3<P>
<PRE>
-> NTEST
</PRE>
Signifies "equal" test.
<P>
<H3>5.26.4. <A NAME=M239>greater_than</A></H3>
<B>Encoding number</B>: 4<P>
<PRE>
-> NTEST
</PRE>
Signifies "greater than" test.
<P>
<H3>5.26.5. <A NAME=M240>greater_than_or_equal</A></H3>
<B>Encoding number</B>: 5<P>
<PRE>
-> NTEST
</PRE>
Signifies "greater than or equal" test.
<P>
<H3>5.26.6. <A NAME=M241>less_than</A></H3>
<B>Encoding number</B>: 6<P>
<PRE>
-> NTEST
</PRE>
Signifies "less than" test.
<P>
<H3>5.26.7. <A NAME=M242>less_than_or_equal</A></H3>
<B>Encoding number</B>: 7<P>
<PRE>
-> NTEST
</PRE>
Signifies "less than or equal" test.
<P>
<H3>5.26.8. <A NAME=M243>not_equal</A></H3>
<B>Encoding number</B>: 8<P>
<PRE>
-> NTEST
</PRE>
Signifies "not equal" test.
<P>
<H3>5.26.9. <A NAME=M244>not_greater_than</A></H3>
<B>Encoding number</B>: 9<P>
<PRE>
-> NTEST
</PRE>
Signifies "not greater than" test.
<P>
<H3>5.26.10. <A NAME=M245>not_greater_than_or_equal</A></H3>
<B>Encoding number</B>: 10<P>
<PRE>
-> NTEST
</PRE>
Signifies "not (greater than or equal)" test.
<P>
<H3>5.26.11. <A NAME=M246>not_less_than</A></H3>
<B>Encoding number</B>: 11<P>
<PRE>
-> NTEST
</PRE>
Signifies "not less than" test.
<P>
<H3>5.26.12. <A NAME=M247>not_less_than_or_equal</A></H3>
<B>Encoding number</B>: 12<P>
<PRE>
-> NTEST
</PRE>
Signifies "not (less than or equal)" test.
<P>
<H3>5.26.13. <A NAME=M248>less_than_or_greater_than</A></H3>
<B>Encoding number</B>: 13<P>
<PRE>
-> NTEST
</PRE>
Signifies "less than or greater than" test.
<P>
<H3>5.26.14. <A NAME=M249>not_less_than_and_not_greater_than</A></H3>
<B>Encoding number</B>: 14<P>
<PRE>
-> NTEST
</PRE>
Signifies "not less than and not greater than" test.
<P>
<H3>5.26.15. <A NAME=M250>comparable</A></H3>
<B>Encoding number</B>: 15<P>
<PRE>
-> NTEST
</PRE>
Signifies "comparable" test.
<P>
With all operands <CODE>SHAPE</CODE>s except <CODE>FLOATING</CODE>,
this comparison is always true.
<P>
<H3>5.26.16. <A NAME=M251>not_comparable</A></H3>
<B>Encoding number</B>: 16<P>
<PRE>
-> NTEST
</PRE>
Signifies "not comparable" test.
<P>
With all operands <CODE>SHAPE</CODE>s except <CODE>FLOATING</CODE>,
this comparison is always false.
<P>
<HR>
<H2>5.27. <A NAME=M252>OTAGEXP</A></H2>
<B>Number of encoding bits</B>: 0<BR>
<B>Is coding extendable</B>: no<P>
This is a auxilliary <CODE>SORT</CODE> used in <I>apply_general_proc</I>.
<P>
<H3>5.27.1. <A NAME=M253>make_otagexp</A></H3>
<B>Encoding number</B>: 0<P>
<PRE>
<I>tgopt</I>: OPTION(TAG <I>x</I>)
<I>e</I>: EXP <I>x</I>
-> OTAGEXP
</PRE>
<I>e</I> is evaluated and its value is the actual caller parameter.
If <I>tgopt</I> is present, the <CODE>TAG</CODE> will be bound to
the final value of caller parameter in the <I>postlude</I> part of
the <I>apply_general_proc</I>.
<P>
<HR>
<H2>5.28. <A NAME=M308>PROCPROPS</A></H2>
<B>Number of encoding bits</B>: 4<BR>
<B>Is coding extendable</B>: yes<P>
<CODE>PROCPROPS</CODE> is a set of properties ascribed to procedure
definitions and calls.
<P>
<H3>5.28.1. <A NAME=M256>procprops_apply_token</A></H3>
<B>Encoding number</B>: 1<P>
<PRE>
<I>token_value</I>: TOKEN
<I>token_args</I>: BITSTREAM <I>param_sorts(token_value)</I>
-> PROCPROPS
</PRE>
The token is applied to the arguments to give a <CODE>PROCPROPS</CODE>.
<P>
If there is a definition for <I>token_value</I> in the <CODE>CAPSULE</CODE>
then <I>token_args</I> is a <CODE>BITSTREAM</CODE> encoding of the
<CODE>SORT</CODE>s of its parameters in the order specified.
<P>
<H3>5.28.2. <A NAME=M257>procprops_cond</A></H3>
<B>Encoding number</B>: 2<P>
<PRE>
<I>control</I>: EXP INTEGER(<I>v</I>)
<I>e1</I>: BITSTREAM PROCPROPS
<I>e2</I>: BITSTREAM PROCPROPS
-> PROCPROPS
</PRE>
The <I>control</I> is evaluated. It will be a constant at install
time under the constant evaluation rules. If it is non-zero, <I>e1</I>
is installed at this point and <I>e2</I> is ignored and never processed.
If <I>control</I> is zero then <I>e2</I> is installed at this point
and <I>e1</I> is ignored and never processed.
<P>
<P>
<H3>5.28.3. <A NAME=M258>add_procprops</A></H3>
<B>Encoding number</B>: 3<P>
<PRE>
<I>arg1</I>: PROCPROPS
<I>arg2</I>: PROCPROPS
-> PROCPROPS
</PRE>
Delivers the join of <I>arg1</I> and <I>arg2</I>.
<P>
<H3>5.28.4. <A NAME=M259>check_stack</A></H3>
<B>Encoding number</B>: 4<P>
<PRE>
-> PROCPROPS
</PRE>
The procedure body is required to check for stack overflow.
<P>
<H3>5.28.5. <A NAME=M260>inline</A></H3>
<B>Encoding number</B>: 5<P>
<PRE>
-> PROCPROPS
</PRE>
The procedure body is a good candidate for inlining at its application.
<P>
<H3>5.28.6. <A NAME=M261>no_long_jump_dest</A></H3>
<B>Encoding number</B>: 6<P>
<PRE>
-> PROCPROPS
</PRE>
The procedure body will contain no label which is the destination
of a long_jump.
<P>
<H3>5.28.7. <A NAME=M262>untidy</A></H3>
<B>Encoding number</B>: 7<P>
<PRE>
-> PROCPROPS
</PRE>
The procedure body may be exited using an <I>untidy_return</I>.
<P>
<H3>5.28.8. <A NAME=M263>var_callees</A></H3>
<B>Encoding number</B>: 8<P>
<PRE>
-> PROCPROPS
</PRE>
Applications of the procedure may have different numbers of actual
callee parameters.
<P>
<H3>5.28.9. <A NAME=M264>var_callers</A></H3>
<B>Encoding number</B>: 9<P>
<PRE>
-> PROCPROPS
</PRE>
Applications of the procedure may have different numbers of actual
caller parameters.
<P>
<HR>
<H2>5.29. <A NAME=M266>PROPS</A></H2>
A <CODE>PROPS</CODE> is an assemblage of program information. This
standard offers various ways of constructing a <CODE>PROPS</CODE>
- i.e. it defines kinds of information which it is useful to express.
These are:
<UL>
<LI>definitions of <CODE>AL_TAG</CODE>s standing for <CODE>ALIGNMENT</CODE>s;
<LI>declarations of <CODE>TAG</CODE>s standing for <CODE>EXP</CODE>s;
<LI>definitions of the <CODE>EXP</CODE>s for which <CODE>TAG</CODE>s
stand;
<LI>declarations of <CODE>TOKEN</CODE>s standing for pieces of TDF
program;
<LI>definitions of the pieces of TDF program for which <CODE>TOKEN</CODE>s
stand;
<LI>linkage and naming information;
<LI>version information
</UL>
<CODE>PROPS</CODE> giving diagnostic information are described in
a separate document.
<P>
The standard can be extended by the definition of new kinds of
<CODE>PROPS</CODE> information and new <CODE>PROPS</CODE> constructs
for expressing them; and private standards can define new kinds of
information and corresponding constructs without disruption to adherents
to the present standard.
<P>
Each <CODE>GROUP</CODE> of <CODE>UNIT</CODE>s is identified by a unit
identification - a <CODE>TDFIDENT</CODE>. All the <CODE>UNIT</CODE>s
in that <CODE>GROUP</CODE> are of the same kind.
<P>
In addition there is a <I>tld</I> <CODE>UNIT</CODE>, see
<A HREF="spec11.html#17">The TDF encoding</A>.
<P>
<HR>
<H2>5.30. <A NAME=M309>ROUNDING_MODE</A></H2>
<B>Number of encoding bits</B>: 3<BR>
<B>Is coding extendable</B>: yes<P>
<CODE>ROUNDING_MODE</CODE> specifies the way rounding is to be performed
in floating point arithmetic.
<P>
<H3>5.30.1. <A NAME=M268>rounding_mode_apply_token</A></H3>
<B>Encoding number</B>: 1<P>
<PRE>
<I>token_value</I>: TOKEN
<I>token_args</I>: BITSTREAM <I>param_sorts(token_value)</I>
-> ROUNDING_MODE
</PRE>
The token is applied to the arguments to give a <CODE>ROUNDING_MODE</CODE>.
<P>
If there is a definition for <I>token_value</I> in the <CODE>CAPSULE</CODE>
then <I>token_args</I> is a <CODE>BITSTREAM</CODE> encoding of the
<CODE>SORT</CODE>s of its parameters, in the order specified.
<P>
<H3>5.30.2. <A NAME=M269>rounding_mode_cond</A></H3>
<B>Encoding number</B>: 2<P>
<PRE>
<I>control</I>: EXP INTEGER(<I>v</I>)
<I>e1</I>: BITSTREAM ROUNDING_MODE
<I>e2</I>: BITSTREAM ROUNDING_MODE
-> ROUNDING_MODE
</PRE>
The <I>control</I> is evaluated. It will be a constant at install
time under the constant evaluation rules. If it is non-zero, <I>e1</I>
is installed at this point and <I>e2</I> is ignored and never processed.
If <I>control</I> is zero then <I>e2</I> is installed at this point
and <I>e1</I> is ignored and never processed.
<P>
<H3>5.30.3. <A NAME=M270>round_as_state</A></H3>
<B>Encoding number</B>: 3<P>
<PRE>
-> ROUNDING_MODE
</PRE>
Round as specified by the current state of the machine.
<P>
<H3>5.30.4. <A NAME=M271>to_nearest</A></H3>
<B>Encoding number</B>: 4<P>
<PRE>
-> ROUNDING_MODE
</PRE>
Signifies rounding to nearest. The effect when the number lies half-way
is not specified.
<P>
<H3>5.30.5. <A NAME=M272>toward_larger</A></H3>
<B>Encoding number</B>: 5<P>
<PRE>
-> ROUNDING_MODE
</PRE>
Signifies rounding toward next largest.
<P>
<H3>5.30.6. <A NAME=M273>toward_smaller</A></H3>
<B>Encoding number</B>: 6<P>
<PRE>
-> ROUNDING_MODE
</PRE>
Signifies rounding toward next smallest.
<P>
<H3>5.30.7. <A NAME=M274>toward_zero</A></H3>
<B>Encoding number</B>: 7<P>
<PRE>
-> ROUNDING_MODE
</PRE>
Signifies rounding toward zero.
<P>
<HR>
<H2>5.31. <A NAME=M310>SHAPE</A></H2>
<B>Number of encoding bits</B>: 4<BR>
<B>Is coding extendable</B>: yes<P>
<CODE>SHAPE</CODE>s express symbolic size and representation information
about run time values.
<P>
<CODE>SHAPE</CODE>s are constructed from primitive <CODE>SHAPE</CODE>s
which describe values such as procedures and integers, and recursively
from compound construction in terms of other <CODE>SHAPE</CODE>s.
<P>
<H3>5.31.1. <A NAME=M276>shape_apply_token</A></H3>
<B>Encoding number</B>: 1<P>
<PRE>
<I>token_value</I>: TOKEN
<I>token_args</I>: BITSTREAM <I>param_sorts(token_value)</I>
-> SHAPE
</PRE>
The token is applied to the arguments to give a <CODE>SHAPE</CODE>.
<P>
If there is a definition for <I>token_value</I> in the <CODE>CAPSULE</CODE>
then <I>token_args</I> is a <CODE>BITSTREAM</CODE> encoding of the
<CODE>SORT</CODE>s of its parameters, in the order specified.
<P>
<H3>5.31.2. <A NAME=M277>shape_cond</A></H3>
<B>Encoding number</B>: 2<P>
<PRE>
<I>control</I>: EXP INTEGER(<I>v</I>)
<I>e1</I>: BITSTREAM SHAPE
<I>e2</I>: BITSTREAM SHAPE
-> SHAPE
</PRE>
The <I>control</I> is evaluated. It will be a constant at install
time under the constant evaluation rules. If it is non-zero, <I>e1</I>
is installed at this point and <I>e2</I> is ignored and never processed.
If <I>control</I> is zero then <I>e2</I> is installed at this point
and <I>e1</I> is ignored and never processed.
<P>
<H3>5.31.3. <A NAME=M278>bitfield</A></H3>
<B>Encoding number</B>: 3<P>
<PRE>
<I>bf_var</I>: BITFIELD_VARIETY
-> SHAPE
</PRE>
A <CODE>BITFIELD</CODE> is used to represent a pattern of bits which
will be packed, provided that the <I>variety_enclosed</I> constraints
are not violated. (see See <A HREF="spec10.html#66">section 7.24</A>)<P>
A <CODE>BITFIELD_VARIETY</CODE> specifies the number of bits and whether
they are considered to be signed.
<P>
There are very few operations on <CODE>BITFIELD</CODE>s, which have
to be converted to <CODE>INTEGER</CODE>s before arithmetic can be
performed on them.
<P>
An installer may place a limit on the number of bits it implements.
See <A HREF="spec10.html#68">Permitted limits</A>.
<P>
<H3>5.31.4. <A NAME=M279>bottom</A></H3>
<B>Encoding number</B>: 4<P>
<PRE>
-> SHAPE
</PRE>
<CODE>BOTTOM</CODE> is the <CODE>SHAPE</CODE> which describes a piece
of program which does not evaluate to any result. Examples include
<I>goto</I> and <I>return</I>.
<P>
If <CODE>BOTTOM</CODE> is a parameter to any other <CODE>SHAPE</CODE>
constructor, the result is <CODE>BOTTOM</CODE>.
<P>
<H3>5.31.5. <A NAME=M280>compound</A></H3>
<B>Encoding number</B>: 5<P>
<PRE>
<I>sz</I>: EXP OFFSET(<I>x</I>, y)
-> SHAPE
</PRE>
The <CODE>SHAPE</CODE> constructor <CODE>COMPOUND</CODE> describes
cartesian products and unions.
<P>
The alignments <I>x</I> and <I>y</I> will be <I>alignment</I>(<I>sx</I>)
and <I>alignment</I>(<I>sy</I>) for some <CODE>SHAPE</CODE>s <I>sx</I>
and <I>sy</I>.
<P>
<I>sz</I> will evaluate to a constant, non-negative <CODE>OFFSET</CODE>
(see <A HREF="#M169">offset_pad</A>). The resulting
<CODE>SHAPE</CODE> describes a value whose size is given by <I>sz</I>.
<P>
<H3>5.31.6. <A NAME=M282>floating</A></H3>
<B>Encoding number</B>: 6<P>
<PRE>
<I>fv</I>: FLOATING_VARIETY
-> SHAPE
</PRE>
Most of the floating point arithmetic operations, <I>floating_plus</I>,
<I>floating_minus</I> etc., are defined to work in the same way on
different kinds of floating point number. If these operations have
more than one argument the arguments have to be of the same kind,
and the result is of the same kind.
<P>
See <A HREF="spec10.html#57">Representing floating point</A>.
<P>
An installer may limit the <CODE>FLOATING_VARIETY</CODE>s it can represent.
A statement of any such limits shall be part of the specification
of an installer. See
<A HREF="spec10.html#57">Representing floating point</A>.
<P>
<H3>5.31.7. <A NAME=M283>integer</A></H3>
<B>Encoding number</B>: 7<P>
<PRE>
<I>var</I>: VARIETY
-> SHAPE
</PRE>
The different kinds of <CODE>INTEGER</CODE> are distinguished by having
different <CODE>VARIETY</CODE>s. A fundamental <CODE>VARIETY</CODE>
(not a <CODE>TOKEN</CODE> or conditional) is represented by two
<CODE>SIGNED_NAT</CODE>s, respectively the lower and upper bounds
(inclusive) of the set of values belonging to the <CODE>VARIETY</CODE>.
<P>
Most architectures require that dyadic integer arithmetic operations
take arguments of the same size, and so TDF does likewise. Because
TDF is completely architecture neutral and makes no assumptions about
word length, this means that the <CODE>VARIETY</CODE>s of the two
arguments must be identical. An example illustrates this. A piece
of TDF which attempted to add two values whose <CODE>SHAPE</CODE>s
were:
<PRE>
INTEGER(0, 60000) <I>and</I> INTEGER(0, 30000)
</PRE>
would be undefined. The reason is that without knowledge of the target
architecture's word length, it is impossible to guarantee that the
two values are going to be represented in the same number of bytes.
On a 16-bit machine they probably would, but not on a 15-bit machine.
The only way to ensure that two <CODE>INTEGER</CODE>s are going to
be represented in the same way in all machines is to stipulate that
their <CODE>VARIETY</CODE>s are exactly the same.
<P>
When any construct delivering an <CODE>INTEGER</CODE> of a given
<CODE>VARIETY</CODE> produces a result which is not representable
in the space which an installer has chosen to represent that
<CODE>VARIETY</CODE>, an integer overflow occurs. Whether it occurs
in a particular case depends on the target, because the installers'
decisions on representation are inherently target-defined.
<P>
A particular installer may limit the ranges of integers that it implements.
See <A HREF="spec10.html#51">Representing integers</A>.
<P>
<H3>5.31.8. <A NAME=M284>nof</A></H3>
<B>Encoding number</B>: 8<P>
<PRE>
<I>n</I>: NAT
<I>s</I>: SHAPE
-> SHAPE
</PRE>
The <CODE>NOF</CODE> constructor describes the <CODE>SHAPE</CODE>
of a value consisting of an array of <I>n</I> values of the same
<CODE>SHAPE</CODE>, <I>s</I>.
<P>
<H3>5.31.9. <A NAME=M285>offset</A></H3>
<B>Encoding number</B>: 9<P>
<PRE>
<I>arg1</I>: ALIGNMENT
<I>arg2</I>: ALIGNMENT
-> SHAPE
</PRE>
The <CODE>SHAPE</CODE> constructor <CODE>OFFSET</CODE> describes values
which represent the differences between <CODE>POINTER</CODE>s, that
is they measure offsets in memory. It should be emphasised that these
are in general run-time values.
<P>
An <CODE>OFFSET</CODE> measures the displacement from the value indicated
by a <CODE>POINTER</CODE>(<I>arg1</I>) to the value indicated by a
<CODE>POINTER</CODE>(<I>arg2</I>). Such an offset is only defined
if the <CODE>POINTER</CODE>s are derived from the same original
<CODE>POINTER</CODE>.
<P>
An <CODE>OFFSET</CODE> may also measure the displacement from a
<CODE>POINTER</CODE> to the start of a <CODE>BITFIELD_VARIETY</CODE>,
or from the start of one <CODE>BITFIELD_VARIETY</CODE> to the start
of another. Hence, unlike the argument of <I>pointer</I>, <I>arg1</I>
or
<I>arg2</I> may consist entirely of <CODE>BITFIELD_VARIETY</CODE>s.
<P>
The set <I>arg1</I> will include the set <I>arg2</I>.
<P>
See <A HREF="spec10.html#26">Memory Model</A>.
<P>
<H3>5.31.10. <A NAME=M286>pointer</A></H3>
<B>Encoding number</B>: 10<P>
<PRE>
<I>arg</I>: ALIGNMENT
-> SHAPE
</PRE>
A <CODE>POINTER</CODE> is a value which points to space allocated
in a computer's memory. The <CODE>POINTER</CODE> constructor takes
an
<CODE>ALIGNMENT</CODE> argument. This argument will not consist entirely
of <CODE>BITFIELD_VARIETY</CODE>s. See <A HREF="spec10.html#26">Memory
Model</A>.
<P>
<H3>5.31.11. <A NAME=M287>proc</A></H3>
<B>Encoding number</B>: 11<P>
<PRE>
-> SHAPE
</PRE>
<CODE>PROC</CODE> is the <CODE>SHAPE</CODE> which describes pieces
of program.
<P>
<H3>5.31.12. <A NAME=M288>top</A></H3>
<B>Encoding number</B>: 12<P>
<PRE>
-> SHAPE
</PRE>
<CODE>TOP</CODE> is the <CODE>SHAPE</CODE> which describes pieces
of program which return no useful value. <I>assign</I> is an example:
it performs an assignment, but does not deliver any useful value.
<P>
<HR>
<H2>5.32. <A NAME=M311>SIGNED_NAT</A></H2>
<B>Number of encoding bits</B>: 3<BR>
<B>Is coding extendable</B>: yes<P>
These are positive or negative integers of unbounded size.
<P>
<H3>5.32.1. <A NAME=M290>signed_nat_apply_token</A></H3>
<B>Encoding number</B>: 1<P>
<PRE>
<I>token_value</I>: TOKEN
<I>token_args</I>: BITSTREAM <I>param_sorts(token_value)</I>
-> SIGNED_NAT
</PRE>
The token is applied to the arguments to give a <CODE>SIGNED_NAT</CODE>.
<P>
If there is a definition for <I>token_value</I> in the <CODE>CAPSULE</CODE>
then <I>token_args</I> is a <CODE>BITSTREAM</CODE> encoding of the
<CODE>SORT</CODE>s of its parameters, in the order specified.
<P>
<H3>5.32.2. <A NAME=M291>signed_nat_cond</A></H3>
<B>Encoding number</B>: 2<P>
<PRE>
<I>control</I>: EXP INTEGER(<I>v</I>)
<I>e1</I>: BITSTREAM SIGNED_NAT
<I>e2</I>: BITSTREAM SIGNED_NAT
-> SIGNED_NAT
</PRE>
The <I>control</I> is evaluated. It will be a constant at install
time under the constant evaluation rules. If it is non-zero, <I>e1</I>
is installed at this point and <I>e2</I> is ignored and never processed.
If <I>control</I> is zero then <I>e2</I> is installed at this point
and <I>e1</I> is ignored and never processed.
<P>
<H3>5.32.3. <A NAME=M292>computed_signed_nat</A></H3>
<B>Encoding number</B>: 3<P>
<PRE>
<I>arg</I>: EXP INTEGER(<I>v</I>)
-> SIGNED_NAT
</PRE>
<I>arg</I> will be an install-time constant. The result is that constant.
<P>
<H3>5.32.4. <A NAME=M293>make_signed_nat</A></H3>
<B>Encoding number</B>: 4<P>
<PRE>
<I>neg</I>: TDFBOOL
<I>n</I>: TDFINT
-> SIGNED_NAT
</PRE>
<I>n</I> is a non-negative integer of unbounded magnitude. The result
is negative if and only if <I>neg</I> is true.
<P>
<H3>5.32.5. <A NAME=M294>snat_from_nat</A></H3>
<B>Encoding number</B>: 5<P>
<PRE>
<I>neg</I>: BOOL
<I>n</I>: NAT
-> SIGNED_NAT
</PRE>
The result is negated if and only if <I>neg</I> is true.
<P>
<HR>
<H2>5.33. <A NAME=M295>SORTNAME</A></H2>
<B>Number of encoding bits</B>: 5<BR>
<B>Is coding extendable</B>: yes<P>
These are the names of the <CODE>SORT</CODE>s which can be parameters
of <CODE>TOKEN</CODE> definitions.
<P>
<H3>5.33.1. <A NAME=M296A>access</A></H3>
<B>Encoding number</B>: 1<P>
<PRE>
-> SORTNAME
</PRE>
<H3>5.33.2. <A NAME=M297A>al_tag</A></H3>
<B>Encoding number</B>: 2<P>
<PRE>
-> SORTNAME
</PRE>
<H3>5.33.3. <A NAME=M298>alignment_sort</A></H3>
<B>Encoding number</B>: 3<P>
<PRE>
-> SORTNAME
</PRE>
<H3>5.33.4. <A NAME=M299A>bitfield_variety</A></H3>
<B>Encoding number</B>: 4<P>
<PRE>
-> SORTNAME
</PRE>
<H3>5.33.5. <A NAME=M300A>bool</A></H3>
<B>Encoding number</B>: 5<P>
<PRE>
-> SORTNAME
</PRE>
<H3>5.33.6. <A NAME=M301A>error_treatment</A></H3>
<B>Encoding number</B>: 6<P>
<PRE>
-> SORTNAME
</PRE>
<H3>5.33.7. <A NAME=M302A>exp</A></H3>
<B>Encoding number</B>: 7<P>
<PRE>
-> SORTNAME
</PRE>
The <CODE>SORT</CODE> of <CODE>EXP</CODE>.
<P>
<H3>5.33.8. <A NAME=M303A>floating_variety</A></H3>
<B>Encoding number</B>: 8<P>
<PRE>
-> SORTNAME
</PRE>
<H3>5.33.9. <A NAME=M304>foreign_sort</A></H3>
<B>Encoding number</B>: 9<P>
<PRE>
<I>foreign_name</I>: STRING<I>(k, n)</I>
-> SORTNAME
</PRE>
This <CODE>SORT</CODE> enables unanticipated kinds of information
to be placed in TDF.
<P>
<H3>5.33.10. <A NAME=M305A>label</A></H3>
<B>Encoding number</B>: 10<P>
<PRE>
-> SORTNAME
</PRE>
<H3>5.33.11. <A NAME=M306A>nat</A></H3>
<B>Encoding number</B>: 11<P>
<PRE>
-> SORTNAME
</PRE>
<H3>5.33.12. <A NAME=M307A>ntest</A></H3>
<B>Encoding number</B>: 12<P>
<PRE>
-> SORTNAME
</PRE>
<H3>5.33.13. <A NAME=M308A>procprops</A></H3>
<B>Encoding number</B>: 13<P>
<PRE>
-> SORTNAME
</PRE>
<H3>5.33.14. <A NAME=M309A>rounding_mode</A></H3>
<B>Encoding number</B>: 14<P>
<PRE>
-> SORTNAME
</PRE>
<H3>5.33.15. <A NAME=M310A>shape</A></H3>
<B>Encoding number</B>: 15<P>
<PRE>
-> SORTNAME
</PRE>
<H3>5.33.16. <A NAME=M311A>signed_nat</A></H3>
<B>Encoding number</B>: 16<P>
<PRE>
-> SORTNAME
</PRE>
<H3>5.33.17. <A NAME=M317A>string</A></H3>
<B>Encoding number</B>: 17<P>
<PRE>
-> SORTNAME
</PRE>
<H3>5.33.18. <A NAME=M322A>tag</A></H3>
<B>Encoding number</B>: 18<P>
<PRE>
-> SORTNAME
</PRE>
The <CODE>SORT</CODE> of <CODE>TAG</CODE>.
<P>
<H3>5.33.19. <A NAME=M365A>transfer_mode</A></H3>
<B>Encoding number</B>: 19<P>
<PRE>
-> SORTNAME
</PRE>
<H3>5.33.20. <A NAME=M356A>token</A></H3>
<B>Encoding number</B>: 20<P>
<PRE>
<I>result</I>: SORTNAME
<I>params</I>: LIST(SORTNAME)
-> SORTNAME
</PRE>
The <CODE>SORTNAME</CODE> of a <CODE>TOKEN</CODE>. Note that it can
have tokens as parameters, but not as result.
<P>
<H3>5.33.21. <A NAME=M378A>variety</A></H3>
<B>Encoding number</B>: 21<P>
<PRE>
-> SORTNAME
</PRE>
<HR>
<H2>5.34. <A NAME=M317>STRING</A></H2>
<B>Number of encoding bits</B>: 3<BR>
<B>Is coding extendable</B>: yes<P>
<H3>5.34.1. <A NAME=M318>string_apply_token</A></H3>
<B>Encoding number</B>: 1<P>
<PRE>
<I>token_value</I>: TOKEN
<I>token_args</I>: BITSTREAM <I>param_sorts(token_value)</I>
-> STRING<I>(k, n)</I>
</PRE>
The token is applied to the arguments to give a <CODE>STRING</CODE>
<P>
If there is a definition for <I>token_value</I> in the <CODE>CAPSULE</CODE>
then <I>token_args</I> is a <CODE>BITSTREAM</CODE> encoding of the
<CODE>SORT</CODE>s of its parameters, in the order specified.
<P>
<H3>5.34.2. <A NAME=M319>string_cond</A></H3>
<B>Encoding number</B>: 2<P>
<PRE>
<I>control</I>: EXP INTEGER(<I>v</I>)
<I>e1</I>: BITSTREAM STRING
<I>e2</I>: BITSTREAM STRING
-> STRING<I>(k, n)</I>
</PRE>
The <I>control</I> is evaluated. It will be a constant at install
time under the constant evaluation rules. If it is non-zero, <I>e1</I>
is installed at this point and <I>e2</I> is ignored and never processed.
If <I>control</I> is zero then <I>e2</I> is installed at this point
and <I>e1</I> is ignored and never processed.
<P>
<H3>5.34.3. <A NAME=M320>concat_string</A></H3>
<B>Encoding number</B>: 3<P>
<PRE>
<I>arg1</I>: STRING<I>(k, n)</I>
<I>arg2</I>: STRING<I>(k, m)</I>
-> STRING<I>(k, n+m)</I>
</PRE>
Gives a <CODE>STRING</CODE> which is the concatenation of <I>arg1</I>
with <I>arg2</I>.
<P>
<H3>5.34.4. <A NAME=M321>make_string</A></H3>
<B>Encoding number</B>: 4<P>
<PRE>
<I>arg</I>: TDFSTRING<I>(k, n)</I>
-> STRING<I>(k, n)</I>
</PRE>
Delivers the <CODE>STRING</CODE> identical to the <I>arg</I>.
<P>
<HR>
<H2>5.35. <A NAME=M322>TAG</A></H2>
<B>Number of encoding bits</B>: 1<BR>
<B>Is coding extendable</B>: yes<BR>
<B>Linkable entity identification</B>: <I>tag</I><P>
These are used to name values and variables in the run time program.
<P>
<H3>5.35.1. <A NAME=M323>tag_apply_token</A></H3>
<B>Encoding number</B>: 2<P>
<PRE>
<I>token_value</I>: TOKEN
<I>token_args</I>: BITSTREAM <I>param_sorts(token_value)</I>
-> TAG <I>x</I>
</PRE>
The token is applied to the arguments to give a <CODE>TAG</CODE>.
<P>
If there is a definition for <I>token_value</I> in the <CODE>CAPSULE</CODE>
then <I>token_args</I> is a <CODE>BITSTREAM</CODE> encoding of the
<CODE>SORT</CODE>s of its parameters, in the order specified.
<P>
<H3>5.35.2. <A NAME=M324>make_tag</A></H3>
<B>Encoding number</B>: 1<P>
<PRE>
<I>tagno</I>: TDFINT
-> TAG <I>x</I>
</PRE>
<I>make_tag</I> produces a <CODE>TAG</CODE> identified by <I>tagno</I>.
<P>
<HR>
<H2>5.36. <A NAME=M325>TAGACC</A></H2>
<B>Number of encoding bits</B>: 0<BR>
<B>Is coding extendable</B>: no<P>
Constructs a pair of a <CODE>TAG</CODE> and an <CODE>OPTION(ACCESS)</CODE>
for use in <I>make_proc</I>.
<P>
<H3>5.36.1. <A NAME=M326>make_tagacc</A></H3>
<B>Encoding number</B>: 0<P>
<PRE>
<I>tg</I>: TAG POINTER <I>var_param_alignment</I>
<I>acc</I>: OPTION(ACCESS)
-> TAGACC
</PRE>
Constructs the pair for <I>make_proc</I>.
<P>
<HR>
<H2>5.37. <A NAME=M327>TAGDEC</A></H2>
<B>Number of encoding bits</B>: 2<BR>
<B>Is coding extendable</B>: yes<P>
A <CODE>TAGDEC</CODE> declares a <CODE>TAG</CODE> for incorporation
into a <CODE>TAGDEC_PROPS.</CODE><P>
<H3>5.37.1. <A NAME=M328>make_id_tagdec</A></H3>
<B>Encoding number</B>: 1<P>
<PRE>
<I>t_intro</I>: TDFINT
<I>acc</I>: OPTION(ACCESS)
<I>signature</I>: OPTION(STRING)
<I>x</I>: SHAPE
-> TAGDEC
</PRE>
A <CODE>TAGDEC</CODE> announcing that the <CODE>TAG</CODE>
<I>t_intro</I> identifies an <CODE>EXP</CODE> of <CODE>SHAPE</CODE>
<I>x</I> is constructed.
<P>
<I>acc</I> specifies the <CODE>ACCESS</CODE> properties of the
<CODE>TAG</CODE>.
<P>
If there is a <I>make_id_tagdec</I> for a <CODE>TAG</CODE> then all
other <I>make_id_tagdec</I> for the same <CODE>TAG</CODE> will specify
the same <CODE>SHAPE</CODE> and there will be no <I>make_var_tagdec</I>
or <I>common_tagdec</I> for the <CODE>TAG</CODE>.
<P>
If two <I>make_id_tagdecs</I> specify the same tag and both have
<I>signatures</I> present, the strings will be identical. Possible
uses of this signature argument are outlined in
<A HREF="spec10.html#72">section 7.28</A>.
<P>
<P>
<H3>5.37.2. <A NAME=M329>make_var_tagdec</A></H3>
<B>Encoding number</B>: 2<P>
<PRE>
<I>t_intro</I>: TDFINT
<I>acc</I>: OPTION(ACCESS)
<I>signature</I>: OPTION(STRING)
<I>x</I>: SHAPE
-> TAGDEC
</PRE>
A <CODE>TAGDEC</CODE> announcing that the <CODE>TAG</CODE>
<I>t_intro</I> identifies an <CODE>EXP</CODE> of <CODE>SHAPE POINTER</CODE>(<I>alignment
</I>(<I>x</I>)) is constructed.
<P>
<I>acc</I> specifies the <CODE>ACCESS</CODE> properties of the
<CODE>TAG</CODE>.
<P>
If there is a <I>make_var_tagdec</I> for a <CODE>TAG</CODE> then all
other <I>make_var_tagdec</I>s for the same <CODE>TAG</CODE> will specify
<CODE>SHAPE</CODE>s with identical <CODE>ALIGNMENT</CODE> and there
will be no <I>make_id_tagdec</I> or <I>common_tagdec</I> for the
<CODE>TAG</CODE>.
<P>
If two <I>make_var_tagdec</I>s specify the same tag and both have
<I>signature</I> present, the strings will be identical. Possible
uses of this signature argument are outlined in
<A HREF="spec10.html#72">section 7.28</A>.
<P>
<H3>5.37.3. <A NAME=M331>common_tagdec</A></H3>
<B>Encoding number</B>: 3<P>
<PRE>
<I>t_intro</I>: TDFINT
<I>acc</I>: OPTION(ACCESS)
<I>signature</I>: OPTION(STRING)
<I>x</I>: SHAPE
-> TAGDEC
</PRE>
A <CODE>TAGDEC</CODE> announcing that the <CODE>TAG</CODE>
<I>t_intro</I> identifies an <CODE>EXP</CODE> of <CODE>SHAPE POINTER</CODE>(<I>alignment
</I>(<I>x</I>)) is constructed.
<P>
<I>acc</I> specifies the <CODE>ACCESS</CODE> properties of the
<CODE>TAG</CODE>.
<P>
If there is a <I>common_tagdec</I> for a <CODE>TAG</CODE> then there
will be no <I>make_id_tagdec</I> or <I>make_var_tagdec</I> for that
<CODE>TAG</CODE>. If there is more than one <I>common_tagdec</I> for
a <CODE>TAG</CODE> the one having the maximum <CODE>SHAPE</CODE> shall
be taken to apply for the <CODE>CAPSULE</CODE>. Each pair of such
<CODE>SHAPE</CODE>s will have a maximum. The maximum of two
<CODE>SHAPE</CODE>s, <I>a</I> and <I>b</I>, is defined as follows:
<UL>
<LI>If the <I>a</I> is equal to <I>b</I> the maximum is <I>a</I>.
<LI>If <I>a</I> and <I>b</I> are <CODE>COMPOUND</CODE>(<I>x</I>) and
<CODE>COMPOUND</CODE>(<I>y</I>) respectively and <I>a</I> is an initial
segment of <I>b</I>, then <I>b</I> is the maximum. Similarly if <I>b</I>
is an initial segment of <I>a</I> then <I>a</I> is the maximum.
<LI>If <I>a</I> and <I>b</I> are <CODE>NOF</CODE>(<I>n</I>, <I>x</I>)
and <CODE>NOF</CODE>(<I>m</I>, <I>x</I>) respectively and <I>n</I>
is less than or equal to <I>m</I>, then <I>b</I> is the maximum. Similarly
if <I>m</I> is less than or equal to <I>n</I> then <I>a</I> is the
maximum.
<LI>Otherwise <I>a</I> and <I>b</I> have no maximum.
</UL>
If two <I>common_tagdecs</I> specify the same tag and both have
<I>signatures</I> present, the strings will be identical. Possible
uses of this signature argument are outlined in
<A HREF="spec10.html#72">section 7.28</A>.
<P>
<P>
<HR>
<H2>5.38. <A NAME=M332>TAGDEC_PROPS</A></H2>
<B>Number of encoding bits</B>: 0<BR>
<B>Is coding extendable</B>: no<BR>
<B>Unit identification</B>: <I>tagdec</I><P>
<H3>5.38.1. <A NAME=M333>make_tagdecs</A></H3>
<B>Encoding number</B>: 0<P>
<PRE>
<I>no_labels</I>: TDFINT
<I>tds</I>: SLIST(TAGDEC)
-> TAGDEC_PROPS
</PRE>
<I>no_labels</I> is the number of local <CODE>LABEL</CODE>s used in
<I>tds</I>. <I>tds</I> is a list of <CODE>TAGDEC</CODE>s which declare
the <CODE>SHAPE</CODE>s associated with <CODE>TAG</CODE>s.
<P>
<HR>
<H2>5.39. <A NAME=M334>TAGDEF</A></H2>
<B>Number of encoding bits</B>: 2<BR>
<B>Is coding extendable</B>: yes<P>
A value of <CODE>SORT TAGDEF</CODE> gives the definition of a <CODE>TAG</CODE>
for incorporation into a <CODE>TAGDEF_PROPS</CODE>.
<P>
<H3>5.39.1. <A NAME=M335>make_id_tagdef</A></H3>
<!-- BREAK 1 -->
<B>Encoding number</B>: 1<P>
<PRE>
<I>t</I>: TDFINT
<I>signature</I>: OPTION(STRING)
<I>e</I>: EXP <I>x</I>
-> TAGDEF
</PRE>
<I>make_id_tagdef</I> produces a <CODE>TAGDEF</CODE> defining the
<CODE>TAG</CODE> <I>x</I> constructed from the <CODE>TDFINT</CODE>,
<I>t</I>. This <CODE>TAG</CODE> is defined to stand for the value
delivered by <I>e</I>.
<P>
<I>e</I> will be a constant which can be evaluated at load_time or
<I>e</I> will be some <I>initial_value</I>(E) (see <A HREF="#M125">section
5.16.48</A>).
<P>
<I>t</I> will be declared in the <CODE>CAPSULE</CODE> using
<I>make_id_tagdec</I>. If both the <I>make_id_tagdec</I> and
<I>make_id_tagdef</I> have <I>signatures</I> present, the strings
will be identical.
<P>
If <I>x</I> is <CODE>PROC</CODE> and the <CODE>TAG</CODE> represented
by <I>t</I> is named externally via a <CODE>CAPSULE_LINK</CODE>, e
will be some <I>make_proc</I> or <I>make_general_proc</I>.
<P>
There will not be more than one <CODE>TAGDEF</CODE> defining <I>t</I>
in a <CODE>CAPSULE</CODE>.
<P>
<H3>5.39.2. <A NAME=M336>make_var_tagdef</A></H3>
<!-- BREAK 1 -->
<B>Encoding number</B>: 2<P>
<PRE>
<I>t</I>: TDFINT
<I>opt_access</I>: OPTION(ACCESS)
<I>signature</I>: OPTION(STRING)
<I>e</I>: EXP <I>x</I>
-> TAGDEF
</PRE>
<I>make_var_tagdef</I> produces a <CODE>TAGDEF</CODE> defining the
<CODE>TAG POINTER</CODE>(<I>alignment(x)</I>) constructed from the
<CODE>TDFINT</CODE>, <I>t</I>. This <CODE>TAG</CODE> stands for a
variable which is initialised with the value delivered by <I>e</I>.
The <CODE>TAG</CODE> is bound to an original pointer which has the
evaluation of the program as its lifetime.
<P>
If <I>opt_access</I> contains <I>visible</I>, the meaning is that
the variable may be used by agents external to the capsule, and so
it must not be optimised away. If it contains constant, the initialising
value will remain in it throughout the program.
<P>
<I>e</I> will be a constant which can be evaluated at load_time or
<I>e</I> will be some <I>initial_value</I>(<I>e1</I>) (see
<A HREF="#M125">section 5.16.48</A>).
<P>
<I>t</I> will be declared in the <CODE>CAPSULE</CODE> using
<I>make_var_tagdec</I>. If both the <I>make_var_tagdec</I> and
<I>make_var_tagdef</I> have <I>signatures</I> present, the strings
will be identical.
<P>
<P>
There will not be more than one <CODE>TAGDEF</CODE> defining <I>t</I>
in a <CODE>CAPSULE</CODE>.
<P>
<H3>5.39.3. <A NAME=M338>common_tagdef</A></H3>
<!-- BREAK 1 -->
<B>Encoding number</B>: 3<P>
<PRE>
<I>t</I>: TDFINT
<I>opt_access</I>: OPTION(ACCESS)
<I>signature</I>: OPTION(STRING)
<I>e</I>: EXP <I>x</I>
-> TAGDEF
</PRE>
<I>common_tagdef</I> produces a <CODE>TAGDEF</CODE> defining the
<CODE>TAG</CODE> <CODE>POINTER</CODE>(<I>alignment(x)</I>) constructed
from the <CODE>TDFINT</CODE>, <I>t</I>. This <CODE>TAG</CODE> stands
for a variable which is initialised with the value delivered by <I>e</I>.
The <CODE>TAG</CODE> is bound to an original pointer which has the
evaluation of the program as its lifetime.
<P>
If <I>opt_access</I> contains <I>visible</I>, the meaning is that
the variable may be used by agents external to the capsule, and so
it must not be optimised away. If it contains constant, the initialising
value will remain in it throughout the program.
<P>
<I>e</I> will be a constant evaluable at load_time or <I>e</I> will
be some <I>initial_value</I>(E) (see <A HREF="#M125">section 5.16.48
</A>).
<P>
<I>t</I> will be declared in the <CODE>CAPSULE</CODE> using
<I>common_tagdec</I>.If both the <I>common_tagdec</I> and<BR>
<I>common_tagdef</I> have <I>signatures</I> present, the strings<BR>
will be identical. Let the maximum <CODE>SHAPE</CODE> of these (see
<A HREF="#M331">common_tagdec</A>) be <I>s</I>.
<P>
There may be any number of <I>common_tagdef</I> definitions for <I>t</I>
in a <CODE>CAPSULE</CODE>. Of the <I>e</I> parameters of these, one
will be a maximum. This maximum definition is chosen as the definition
of <I>t</I>. Its value of <I>e</I> will have <CODE>SHAPE</CODE> <I>s</I>.
<P>
The maximum of two <I>common_tagdef</I> <CODE>EXP</CODE>s, <I>a</I>
and <I>b</I>, is defined as follows:
<UL>
<LI>If <I>a</I> has the form <I>make_value</I>(<I>s</I>), <I>b</I>
is the maximum.
<LI>If <I>b</I> has the form <I>make_value</I>(<I>s</I>), <I>a</I>
is the maximum.
<LI>If <I>a</I> and <I>b</I> have <CODE>SHAPE COMPOUND</CODE>(<I>x</I>)
and <CODE>COMPOUND</CODE>(<I>y</I>) respectively and the value produced
by <I>a</I> is an initial segment of the value produced by <I>b</I>,
then <I>b</I> is the maximum. Similarly if <I>b</I> is an initial
segment of <I>a</I> then <I>a</I> is the maximum.
<LI>If <I>a</I> and <I>b</I> have <CODE>SHAPE NOF</CODE>(<I>n</I>,
<I>x</I>) and <CODE>NOF</CODE>(<I>m</I>, <I>x</I>) respectively and
the value produced by <I>a</I> is an initial segment of the value
produced by
<I>b</I>, then <I>b</I> is the maximum. Similarly if <I>b</I> is an
initial segment of <I>a</I> then <I>a</I> is the maximum.
<LI>If the value produced by <I>a</I> is equal to the value produced
by <I>b</I> the maximum is <I>a</I>.
<LI>Otherwise <I>a</I> and <I>b</I> have no maximum.
</UL>
<HR>
<H2>5.40. <A NAME=M340>TAGDEF_PROPS</A></H2>
<B>Number of encoding bits</B>: 0<BR>
<B>Is coding extendable</B>: no<BR>
<B>Unit identification</B>: <I>tagdef</I><P>
<H3>5.40.1. <A NAME=M341>make_tagdefs</A></H3>
<B>Encoding number</B>: 0<P>
<PRE>
<I>no_labels</I>: TDFINT
<I>tds</I>: SLIST(TAGDEF)
-> TAGDEF_PROPS
</PRE>
<I>no_labels</I> is the number of local <CODE>LABEL</CODE>s used in
<I>tds</I>. <I>tds</I> is a list of <CODE>TAGDEF</CODE>s which give
the <CODE>EXP</CODE>s which are the definitions of values associated
with <CODE>TAG</CODE>s.
<P>
<HR>
<H2>5.41. <A NAME=M342>TAGSHACC</A></H2>
<B>Number of encoding bits</B>: 0<BR>
<B>Is coding extendable</B>: no<P>
<H3>5.41.1. <A NAME=M343>make_tagshacc</A></H3>
<B>Encoding number</B>: 0<P>
<PRE>
<I>sha</I>: SHAPE
<I>opt_access</I>: OPTION(ACCESS)
<I>tg_intro</I>: TAG
-> TAGSHACC
</PRE>
This is an auxiliary construction to make the elements of
<I>params_intro</I> in <I>make_proc</I>.
<P>
<HR>
<H2>5.42. <A NAME=M344>TDFBOOL</A></H2>
A <CODE>TDFBOOL</CODE> is the TDF encoding of a boolean. See
<A HREF="spec11.html#4">Fundamental encoding</A>.
<P>
<HR>
<H2>5.43. <A NAME=M345>TDFIDENT</A></H2>
A <CODE>TDFIDENT</CODE>(<I>k</I>, <I>n</I>) encodes a sequence of
<I>n</I> unsigned integers of size <I>k</I> bits. <I>k</I> will be
a multiple of 8. See <A HREF="spec11.html#4">Fundamental encoding</A>.
<P>
This construction will not be used inside a <CODE>BITSTREAM</CODE>.
<P>
<HR>
<H2>5.44. <A NAME=M346>TDFINT</A></H2>
A <CODE>TDFINT</CODE> is the TDF encoding of an unbounded unsigned
integer constant. See <A HREF="spec11.html#4">Fundamental encoding</A>.
<P>
<HR>
<H2>5.45. <A NAME=M347>TDFSTRING</A></H2>
A <CODE>TDFSTRING</CODE>(<I>k</I>, <I>n</I>) encodes a sequence of
<I>n</I> unsigned integers of size <I>k</I> bits. See <A HREF="spec11.html#4">Fundamental
encoding</A>.
<P>
<HR>
<H2>5.46. <A NAME=M348>TOKDEC</A></H2>
<B>Number of encoding bits</B>: 1<BR>
<B>Is coding extendable</B>: yes<P>
A <CODE>TOKDEC</CODE> declares a <CODE>TOKEN</CODE> for incorporation
into a <CODE>UNIT</CODE>.
<P>
<H3>5.46.1. <A NAME=M349>make_tokdec</A></H3>
<B>Encoding number</B>: 1<P>
<PRE>
<I>tok</I>: TDFINT
<I>signature</I>: OPTION(STRING)
<I>s</I>: SORTNAME
-> TOKDEC
</PRE>
The sort of the token <I>tok</I> is declared to be <I>s</I>. Note
that
<I>s</I> will always be a token <CODE>SORT</CODE>, with a list of
parameter <CODE>SORT</CODE>s (possible empty) and a result
<CODE>SORT</CODE>.
<P>
If <I>signature</I> is present, it will be produced by <I>make_string</I>.
<P>
If two <I>make_tokdecs</I> specify the same token and both have
<I>signatures</I> present, the strings will be identical. Possible
uses of this signature argument are outlined in
<A HREF="spec10.html#72">section 7.28</A>.
<P>
<P>
<HR>
<H2>5.47. <A NAME=M350>TOKDEC_PROPS</A></H2>
<B>Number of encoding bits</B>: 0<BR>
<B>Is coding extendable</B>: no<BR>
<B>Unit identification</B>: <I>tokdec</I><P>
<H3>5.47.1. <A NAME=M351>make_tokdecs</A></H3>
<B>Encoding number</B>: 0<P>
<PRE>
<I>tds</I>: SLIST(TOKDEC)
-> TOKDEC_PROPS
</PRE>
<I>tds</I> is a list of <CODE>TOKDEC</CODE>s which gives the sorts
associated with <CODE>TOKEN</CODE>s.
<P>
<HR>
<H2>5.48. <A NAME=M352>TOKDEF</A></H2>
<B>Number of encoding bits</B>: 1<BR>
<B>Is coding extendable</B>: yes<P>
A <CODE>TOKDEF</CODE> gives the definition of a <CODE>TOKEN</CODE>
for incorporation into a <CODE>TOKDEF_PROPS</CODE>.
<P>
<H3>5.48.1. <A NAME=M353>make_tokdef</A></H3>
<B>Encoding number</B>: 1<P>
<PRE>
<I>tok</I>: TDFINT
<I>signature</I>: OPTION(STRING)
<I>def</I>: BITSTREAM TOKEN_DEFN
-> TOKDEF
</PRE>
A <CODE>TOKDEF</CODE> is constructed which defines the <CODE>TOKEN</CODE>
<I>tok</I> to stand for the fragment of TDF, <I>body</I>, which may
be of any <CODE>SORT</CODE> with a <CODE>SORTNAME</CODE>, except for
<I>token</I>. The <CODE>SORT</CODE> of the result, <I>result_sort</I>,
is given by the first component of the <CODE>BITSTREAM</CODE>. See
<A HREF="#M362">token_definition</A>.
<P>
If <I>signature</I> is present, it will be produced by <I>make_string</I>.
<P>
<I>tok</I> may have been introduced by a <I>make_tokdec</I>. If both
the <I>make_tokdec</I> and <I>make_tokdef</I> have <I>signatures</I>
present, the strings will be identical.
<P>
At the application of this <CODE>TOKEN</CODE> actual pieces of TDF
having <CODE>SORT</CODE> <I>sn</I>[<I>i</I>] are supplied to correspond
to the <I>tk</I>[<I>i</I>]. The application denotes the piece of TDF
obtained by substituting these actual parameters for the corresponding
<CODE>TOKEN</CODE>s within <I>body</I>.
<P>
<HR>
<H2>5.49. <A NAME=M354>TOKDEF_PROPS</A></H2>
<B>Number of encoding bits</B>: 0<BR>
<B>Is coding extendable</B>: no<BR>
<B>Unit identification</B>: <I>tokdef</I><P>
<H3>5.49.1. <A NAME=M355>make_tokdefs</A></H3>
<B>Encoding number</B>: 0<P>
<PRE>
<I>no_labels</I>: TDFINT
<I>tds</I>: SLIST(TOKDEF)
-> TOKDEF_PROPS
</PRE>
<I>no_labels</I> is the number of local <CODE>LABEL</CODE>s used in
<I>tds</I>. <I>tds</I> is a list of <CODE>TOKDEF</CODE>s which gives
the definitions associated with <CODE>TOKEN</CODE>s.
<P>
<HR>
<H2>5.50. <A NAME=M356>TOKEN</A></H2>
<B>Number of encoding bits</B>: 2<BR>
<B>Is coding extendable</B>: yes<BR>
<B>Linkable entity identification</B>: <I>token</I><P>
These are used to stand for functions evaluated at installation time.
They are represented by <CODE>TDFINT</CODE>s.
<P>
<H3>5.50.1. <A NAME=M357>token_apply_token</A></H3>
<B>Encoding number</B>: 1<P>
<PRE>
<I>token_value</I>: TOKEN
<I>token_args</I>: BITSTREAM <I>param_sorts(token_value)</I>
-> TOKEN
</PRE>
The token is applied to the arguments to give a <CODE>TOKEN</CODE>.
<P>
If there is a definition for <I>token_value</I> in the <CODE>CAPSULE</CODE>
then <I>token_args</I> is a <CODE>BITSTREAM</CODE> encoding of the
<CODE>SORT</CODE>s of its parameters, in the order specified.
<P>
<H3>5.50.2. <A NAME=M358>make_tok</A></H3>
<B>Encoding number</B>: 2<P>
<PRE>
<I>tokno</I>: TDFINT
-> TOKEN
</PRE>
<I>make_tok</I> constructs a <CODE>TOKEN</CODE> identified by <I>tokno</I>.
<P>
<H3>5.50.3. <A NAME=M359>use_tokdef</A></H3>
<B>Encoding number</B>: 3<P>
<PRE>
<I>tdef</I>: BITSTREAM TOKEN_DEFN
-> TOKEN
</PRE>
<I>tdef</I> is used to supply the definition, as in <I>make_tokdef</I>.
Note that <CODE>TOKEN</CODE>s are only used in <I>x_apply_token</I>
constructions.
<P>
<HR>
<H2>5.51. <A NAME=M360>TOKEN_DEFN</A></H2>
<B>Number of encoding bits</B>: 1<BR>
<B>Is coding extendable</B>: yes<P>
An auxiliary <CODE>SORT</CODE> used in <I>make_tokdef</I> and
<I>use_tokdef</I>.
<P>
<H3>5.51.1. <A NAME=M362>token_definition</A></H3>
<B>Encoding number</B>: 1<P>
<PRE>
<I>result_sort</I>: SORTNAME
<I>tok_params</I>: LIST(TOKFORMALS)
<I>body</I>: <I>result_sort</I>
-> TOKEN_DEFN
</PRE>
Makes a token definition. <I>result_sort</I> is the <CODE>SORT</CODE>
of body. <I>tok_params</I> is a list of formal <CODE>TOKEN</CODE>s
and their <CODE>SORT</CODE>s. <I>body</I> is the definition, which
can use the formal <CODE>TOKEN</CODE>s defined in <I>tok_params</I>.
<P>
The effect of applying the definition of a <CODE>TOKEN</CODE> is as
if the following sequence was obeyed.
<P>
First, the actual parameters (if any) are expanded to produce expressions
of the appropriate <CODE>SORT</CODE>s. During this expansion all token
applications in the actual parameters are expanded.
<P>
Second, the definition is copied, making fresh <CODE>TAG</CODE>s and
<CODE>LABEL</CODE>s where these are introduced in <I>identify</I>,
<I>variable</I>, <I>labelled</I>, <I>conditional</I>, <I>make_proc,
make_general_proc</I> and <I>repeat</I> constructions. Any other
<CODE>TAG</CODE>s or <CODE>LABEL</CODE>s used in <I>body</I> will
be provided by the context (see below) of the <CODE>TOKEN_DEFN</CODE>
or by the expansions of the actual parameters.
<P>
Third, the actual parameter expressions are substituted for the formal
parameter tokens in <I>tok_params</I> to give the final result.
<P>
The context of a <CODE>TOKEN_DEFN</CODE> is the set of names (<CODE>TOKEN</CODE>s,
<CODE>TAG</CODE>s, <CODE>LABEL</CODE>s,
<CODE>AL_TAG</CODE>s etc.) "in scope" at the site of the
<CODE>TOKEN_DEFN</CODE>.
<P>
Thus, in a <I>make_tokdef</I>, the context consists of the set of
<CODE>TOKEN</CODE>s defined in its tokdef <CODE>UNIT</CODE>, together
with the set of linkable entities defined by the <I>make_links</I>
of that <CODE>UNIT</CODE>. Note that this does not include
<CODE>LABEL</CODE>s and the only <CODE>TAG</CODE>s included are "global"
ones.
<P>
In a <I>use_tokdef</I>, the context may be wider, since the site of
the
<CODE>TOKEN_DEFN</CODE> need not be in a tokdef <CODE>UNIT</CODE>;
it may be an actual parameter of a token application. If this happens
to be within an EXP, there may be <CODE>TAG</CODE>s or <CODE>LABEL</CODE>s
locally within scope; these will be in the context of the
<CODE>TOKEN_DEFN</CODE>, together with the global names of the enclosing
UNIT as before.
<P>
<I>Previous versions of the specification limited token definitions
to be non-recursive. There is no intrinsic reason for the limitation
on recursive <CODE>TOKEN</CODE>s. Since the UNIT structure implies
different namespaces, there is very little implementation advantage
to be gained from retaining the limitation.</I>
<P>
<HR>
<H2>5.52. <A NAME=M363>TOKFORMALS</A></H2>
<B>Number of encoding bits</B>: 0<BR>
<B>Is coding extendable</B>: no<P>
<H3>5.52.1. <A NAME=M364>make_tokformals</A></H3>
<B>Encoding number</B>: 0<P>
<PRE>
<I>sn</I>: SORTNAME
<I>tk</I>: TDFINT
-> TOKFORMALS
</PRE>
An auxiliary construction to make up the elements of the lists in
<I>token_definition</I>.
<P>
<HR>
<H2>5.53. <A NAME=M365>TRANSFER_MODE</A></H2>
<B>Number of encoding bits</B>: 3<BR>
<B>Is coding extendable</B>: yes<P>
A <CODE>TRANSFER_MODE</CODE> controls the operation of
<I>assign_with_mode</I>, <I>contents_with_mode</I> and <I>move_some</I>.
<P>
A <CODE>TRANSFER_MODE</CODE> acts like a set of the values <I>overlap,
trap_on_nil, complete</I> and <I>volatile</I>. The
<CODE>TRANSFER_MODE</CODE> <I>standard_transfer_mode</I> acts like
the empty set. <I>add_modes</I> acts like set union.
<P>
<H3>5.53.1. <A NAME=M366>transfer_mode_apply_token</A></H3>
<B>Encoding number</B>: 1<P>
<PRE>
<I>token_value</I>: TOKEN
<I>token_args</I>: BITSTREAM <I>param_sorts(token_value)</I>
-> TRANSFER_MODE
</PRE>
The token is applied to the arguments encoded in the <CODE>BITSTREAM</CODE>
<I>token_args</I> to give a <CODE>TRANSFER_MODE</CODE>.
<P>
The notation <I>param_sorts(token_value)</I> is intended to mean the
following. The token definition or token declaration for
<I>token_value</I> gives the <CODE>SORT</CODE>s of its arguments in
the
<CODE>SORTNAME</CODE> component. The <CODE>BITSTREAM</CODE> in
<I>token_args</I> consists of these <CODE>SORT</CODE>s in the given
order. If no token declaration or definition exists in the
<CODE>CAPSULE</CODE>, the <CODE>BITSTREAM</CODE> cannot be read.
<P>
<H3>5.53.2. <A NAME=M367>transfer_mode_cond</A></H3>
<B>Encoding number</B>: 2<P>
<PRE>
<I>control</I>: EXP INTEGER(<I>v</I>)
<I>e1</I>: BITSTREAM TRANSFER_MODE
<I>e2</I>: BITSTREAM TRANSFER_MODE
-> TRANSFER_MODE
</PRE>
<I>control</I> is evaluated. It will be a constant at install time
under the constant evaluation rules. If it is non-zero, <I>e1</I>
is installed at this point and <I>e2</I> is ignored and never processed.
If <I>control</I> is zero then <I>e2</I> is installed at this point
and <I>e1</I> is ignored and never processed.
<P>
<H3>5.53.3. <A NAME=M368>add_modes</A></H3>
<B>Encoding number</B>: 3<P>
<PRE>
<I>md1</I>: TRANSFER_MODE
<I>md2</I>: TRANSFER_MODE
-> TRANSFER_MODE
</PRE>
A construction qualified by <I>add_modes</I> has both
<CODE>TRANSFER_MODES</CODE> <I>md1</I> and <I>md2</I>. If <I>md1</I>
is
<I>standard_transfer_mode</I> then the result is <I>md2</I> and symmetrically.
This operation is associative and commutative.
<P>
<H3>5.53.4. <A NAME=M369>overlap</A></H3>
<B>Encoding number</B>: 4<P>
<PRE>
-> TRANSFER_MODE
</PRE>
If <I>overlap</I> is used to qualify a <I>move_some</I> or an
<I>assign_with_mode</I> for which <I>arg2</I> is a <I>contents</I>
or
<I>contents_with_mode</I>, then the source and destination might overlap.
The transfer shall be made as if the data were copied from the source
to an independent place and thence to the destination.
<P>
See <A HREF="spec10.html#48">Overlapping</A>.
<P>
<H3>5.53.5. <A NAME=M370>standard_transfer_mode</A></H3>
<B>Encoding number</B>: 5<P>
<PRE>
-> TRANSFER_MODE
</PRE>
This <CODE>TRANSFER_MODE</CODE> implies no special properties.
<P>
<H3>5.53.6. <A NAME=M371>trap_on_nil</A></H3>
<B>Encoding number</B>: 6<P>
<PRE>
-> TRANSFER_MODE
</PRE>
If <I>trap_on_nil</I> is used to qualify a <I>contents_with_mode</I>
operation with a nil pointer argument, or an <I>assign_with_mode</I>
whose arg1 is a nil pointer, or a <I>move_some</I> with either argument
a nil pointer, the TDF exception <I>nil_access</I> is raised.
<P>
<H3>5.53.7. <A NAME=M372>volatile</A></H3>
<B>Encoding number</B>: 7<P>
<PRE>
-> TRANSFER_MODE
</PRE>
If <I>volatile</I> is used to qualify a construction it shall not
be optimised away.
<P>
<I>This is intended to implement ANSI C's volatile construction. In
this use, any volatile identifier should be declared as a <CODE>TAG</CODE>
with used_as_volatile <CODE>ACCESS</CODE>.</I>
<P>
<H3>5.53.8. <A NAME=M373>complete</A></H3>
<B>Encoding number</B>: 8<P>
<PRE>
-> TRANSFER_MODE
</PRE>
A transfer qualified with complete shall leave the destination unchanged
if the evaluation of the value transferred is left with a jump.
<P>
<P>
<HR>
<H2>5.54. <A NAME=M374>UNIQUE</A></H2>
<B>Number of encoding bits</B>: 0<BR>
<B>Is coding extendable</B>: no<P>
<P>
These are used to provide world-wide unique names for <CODE>TOKEN</CODE>s
and <CODE>TAG</CODE>s.
<P>
This implies a registry for allocating <CODE>UNIQUE</CODE> values.
<P>
<H3>5.54.1. <A NAME=M375>make_unique</A></H3>
<B>Encoding number</B>: 0<P>
<PRE>
<I>text</I>: SLIST(TDFIDENT)
-> UNIQUE
</PRE>
Two <CODE>UNIQUE</CODE> values are equal if and only if they were
constructed with equal arguments.
<P>
<HR>
<H2>5.55. <A NAME=M376>UNIT</A></H2>
<B>Number of encoding bits</B>: 0<BR>
<B>Is coding extendable</B>: no<P>
A <CODE>UNIT</CODE> gathers together a <CODE>PROPS</CODE> and
<CODE>LINK</CODE>s which relate the names by which objects are known
inside the <CODE>PROPS</CODE> and names by which they are to be known
across the whole of the enclosing <CODE>CAPSULE</CODE>.
<P>
<H3>5.55.1. <A NAME=M377>make_unit</A></H3>
<!-- BREAK 1 -->
<B>Encoding number</B>: 0<P>
<PRE>
<I>local_vars</I>: SLIST(TDFINT)
<I>lks</I>: SLIST(LINKS)
<I>properties</I>: BYTESTREAM PROPS
-> UNIT
</PRE>
<I>local_vars</I> gives the number of linkable entities of each kind.
These numbers correspond (in the same order) to the variable sorts
in <I>cap_linking</I> in <I>make_capsule</I>. The linkable entities
will be represented by <CODE>TDFINT</CODE>s in the range 0 to the
corresponding <I>nl</I>-1.
<P>
<I>lks</I> gives the <CODE>LINK</CODE>s for each kind of entity in
the same order as in <I>local_vars</I>.
<P>
The <I>properties</I> will be a <CODE>PROPS</CODE> of a form dictated
by the unit identification, see <A HREF="#M53">make_capsule</A>.
<P>
The length of <I>lks</I> will be either 0 or equal to the length of
<I>cap_linking</I> in <I>make_capsule</I>.
<P>
<HR>
<H2>5.56. <A NAME=M378>VARIETY</A></H2>
<B>Number of encoding bits</B>: 2<BR>
<B>Is coding extendable</B>: yes<P>
These describe the different kinds of integer which can occur at run
time. The fundamental construction consists of a <CODE>SIGNED_NAT</CODE>
for the lower bound of the range of possible values, and a
<CODE>SIGNED_NAT</CODE> for the upper bound (inclusive at both ends).
<P>
There is no limitation on the magnitude of these bounds in TDF, but
an installer may specify limits. See
<A HREF="spec10.html#51">Representing integers</A>.
<P>
<H3>5.56.1. <A NAME=M379>var_apply_token</A></H3>
<B>Encoding number</B>: 1<P>
<PRE>
<I>token_value</I>: TOKEN
<I>token_args</I>: BITSTREAM <I>param_sorts(token_value)</I>
-> VARIETY
</PRE>
The token is applied to the arguments to give a <CODE>VARIETY</CODE>.
<P>
If there is a definition for <I>token_value</I> in the <CODE>CAPSULE</CODE>
then <I>token_args</I> is a <CODE>BITSTREAM</CODE> encoding of the
<CODE>SORT</CODE>s of its parameters, in the order specified.
<P>
<H3>5.56.2. <A NAME=M380>var_cond</A></H3>
<B>Encoding number</B>: 2<P>
<PRE>
<I>control</I>: EXP INTEGER(<I>v</I>)
<I>e1</I>: BITSTREAM VARIETY
<I>e2</I>: BITSTREAM VARIETY
-> VARIETY
</PRE>
The <I>control</I> is evaluated. It will be a constant at install
time under the constant evaluation rules. If it is non-zero, <I>e1</I>
is installed at this point and <I>e2</I> is ignored and never processed.
If <I>control</I> is zero then <I>e2</I> is installed at this point
and <I>e1</I> is ignored and never processed.
<P>
<H3>5.56.3. <A NAME=M381>var_limits</A></H3>
<B>Encoding number</B>: 3<P>
<PRE>
<I>lower_bound</I>: SIGNED_NAT
<I>upper_bound</I>: SIGNED_NAT
-> VARIETY
</PRE>
<I>lower_bound</I> is the lower limit (inclusive) of the range of
values which shall be representable in the resulting <CODE>VARIETY</CODE>,
and <I>upper_bound</I> is the upper limit (inclusive).
<P>
<H3>5.56.4. <A NAME=M382>var_width</A></H3>
<B>Encoding number</B>: 4<P>
<PRE>
<I>signed_width</I>: BOOL
<I>width</I>: NAT
-> VARIETY
</PRE>
If <I>signed_width</I> is <I>true</I> then this construction is equivalent
to <I>var_limits</I>(-2<SUP><I>width</I>-1</SUP>, 2<SUP><I>width</I>-1</SUP>-1).
If <I>signed_width</I> is <I>false</I> then this construction is <I>var_limits
</I>(0, 2<SUP><I>width</I></SUP>-1).
<P>
<HR>
<H2>5.57. <A NAME=M383>VERSION_PROPS</A></H2>
<B>Number of encoding bits</B>: 0<BR>
<B>Is coding extendable</B>: no<BR>
<B>Unit identification</B>: <I>versions</I><P>
This <CODE>UNIT</CODE> gives information about version numbers and
user information.
<P>
<H3>5.57.1. <A NAME=M384>make_versions</A></H3>
<B>Encoding number</B>: 0<P>
<PRE>
<I>version_info</I>: SLIST(VERSION)
-> VERSION_PROPS
</PRE>
Contains version information.
<P>
<HR>
<H2>5.58. <A NAME=M385>VERSION</A></H2>
<B>Number of encoding bits</B>: 1<BR>
<B>Is coding extendable</B>: yes<P>
<H3>5.58.1. <A NAME=M386>make_version</A></H3>
<B>Encoding number</B>: 1<P>
<PRE>
<I>major_version</I>: TDFINT
<I>minor_version</I>: TDFINT
-> VERSION
</PRE>
The major and minor version numbers of the TDF used. An increase in
minor version number means an extension of facilities, an increase
in major version number means an incompatible change. TDF with the
same major number but a lower minor number than the installer shall
install correctly.
<P>
For TDF conforming to this specification the major number will be
4 and the minor number will be 0.
<P>
Every <CODE>CAPSULE</CODE> will contain at least one <I>make_version</I>
construct.
<P>
<H3>5.58.2. <A NAME=M387>user_info</A></H3>
<B>Encoding number</B>: 2<P>
<PRE>
<I>information</I>: STRING(<I>k, n</I>)
-> VERSION
</PRE>
This is (usually character) information included in the TDF for labelling
purposes.
<P>
<I>information</I> will be produced by <I>make_string</I>.
<P>
<HR>
<P><I>Part of the <A HREF="../index.html">TenDRA Web</A>.<BR>Crown
Copyright © 1998.</I></P>
</BODY>
</HTML>