COMPILATION LISTING OF SEGMENT random_unit_ Compiled by: Multics PL/I Compiler, Release 27d, of October 11, 1982 Compiled at: Honeywell LISD Phoenix, System M Compiled on: 11/15/82 1749.4 mst Mon Options: optimize map 1 /* *********************************************************** 2* * * 3* * Copyright, (C) Honeywell Information Systems Inc., 1982 * 4* * * 5* *********************************************************** */ 6 /* This is the standard random unit generating routine for random_word_. 7* It is specified in the call to random_word_ by generate_word_. 8* It does not reference the digram table, but assumes that it contains 9* 34 units in a certain order. This routine attempts to return 10* unit indexes with a distribution approaching that of the distribution 11* of the 34 units in English. In order to do this, a random number 12* (supposedly uniformly distributed as returned from encipher_) 13* is used to do a table lookup into an array containing unit indexes. 14* There are 211 entries in the array for the random_unit_ entry point. 15* The probablity of a particular unit being generated is equal to the 16* fraction of those 211 entries that contain that unit index. For example, 17* the letter "a" is unit number 1. Since unit index 1 appears 10 times 18* in the array, the probability of selecting an "a" is 10/211. 19* 20* Changes may be made to the digram table without affect to this procedure 21* providing the letter-to-number correspondence of the units does 22* not change. Likewise, the distribution of the 34 units may be altered 23* (and the array size may be changed) in this procedure without affecting 24* the digram table or any other programs using the random_word_ subroutine. 25**/ 26 27 random_unit_: procedure (number); 28 dcl numbers (0:210) fixed static init ((10)1, (8)2, (12)3, (12)4, (12)5, (8)6, 29 (8)7, (6)8, (10)9, (8)10, (8)11, (6)12, (6)13, (10)14, (10)15, (6)16, 30 (10)17, (8)18, (10)19, (6)20, (8)21, (8)22, 23, (8)24, 25, 31 26, 27, 28, 29, (2)30, (2)31, 32, 33, 34); 32 dcl vowel_numbers (0:11) fixed static init (1, 1, 5, 5, 5, 9, 9, 15, 15, 20, 20, 24); 33 dcl encipher_ entry (fixed bin (71), (*) fixed bin (71), (*) fixed bin (71), fixed bin); 34 dcl random_unit_stat_$seed (1) external fixed bin (71); 35 dcl number fixed bin; 36 37 call encipher_ (random_unit_stat_$seed (1), random_unit_stat_$seed, random_unit_stat_$seed, 1); 38 number = numbers (mod (abs (fixed (random_unit_stat_$seed (1), 17)), 211)); 39 return; 40 random_vowel: entry (number); 41 call encipher_ (random_unit_stat_$seed (1), random_unit_stat_$seed, random_unit_stat_$seed, 1); 42 number = vowel_numbers (mod (abs (fixed (random_unit_stat_$seed (1), 17)), 12)); 43 return; 44 45 /* This entry returns the probabilities of the 34 units in two arrays. 46* The first array contains the probabilities of all units assuming 47* the random_unit_ entry was called. The second array contains the 48* probabilities of all units assuming random_vowel was called. 49* Of course, there will be a lot of zeros in this second array, since 50* most units aren't vowels. 51* 52* This entry is used by hyphenate_$probability to find out what the 53* probabilities of the different units are. Hyphenate_ does not know 54* how many units there are or what their probabilities are. It also 55* makes no assumption about the unit index - to - letter correspondence 56* of the units. Thus this program can be replaced without changing 57* anything in hyphenate_. 58**/ 59 60 probabilities: entry (unit_probs, vowel_probs); 61 dcl unit_probs (34) float bin; 62 dcl vowel_probs (34) float bin; 63 dcl i fixed bin; 64 65 unit_probs, vowel_probs = 0; 66 67 /* These probabilities are calculated merely by adding up the number of 68* occurances of each of the unit indexes in the numbers array and the 69* vowel_numbers array. */ 70 71 do i = 0 to 210; 72 unit_probs (numbers (i)) = unit_probs (numbers (i)) + 1; 73 if i < 12 74 then vowel_probs (vowel_numbers (i)) = vowel_probs (vowel_numbers (i)) + 1; 75 end; 76 77 unit_probs = unit_probs/211; /* Normalize these values so they add up to 1.0 */ 78 vowel_probs = vowel_probs/12; 79 return; 80 end; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 11/15/82 1530.1 random_unit_.pl1 >dumps>old>recomp>random_unit_.pl1 NAMES DECLARED IN THIS COMPILATION. IDENTIFIER OFFSET LOC STORAGE CLASS DATA TYPE ATTRIBUTES AND REFERENCES (* indicates a set context) NAMES DECLARED BY DECLARE STATEMENT. encipher_ 000010 constant entry external dcl 33 ref 37 41 i 000100 automatic fixed bin(17,0) dcl 63 set ref 71* 72 72 73 73 73* number parameter fixed bin(17,0) dcl 35 set ref 27 38* 40 42* numbers 000014 constant fixed bin(17,0) initial array dcl 28 ref 38 72 72 random_unit_stat_$seed 000012 external static fixed bin(71,0) array dcl 34 set ref 37* 37* 37* 38 41* 41* 41* 42 unit_probs parameter float bin(27) array dcl 61 set ref 60 65* 72* 72 77* 77 vowel_numbers 000000 constant fixed bin(17,0) initial array dcl 32 ref 42 73 73 vowel_probs parameter float bin(27) array dcl 62 set ref 60 65* 73* 73 78* 78 NAMES DECLARED BY EXPLICIT CONTEXT. probabilities 000473 constant entry external dcl 60 random_unit_ 000354 constant entry external dcl 27 random_vowel 000422 constant entry external dcl 40 NAMES DECLARED BY CONTEXT OR IMPLICATION. abs builtin function ref 38 42 fixed builtin function ref 38 42 mod builtin function ref 38 42 STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 670 704 605 700 Length 1056 605 14 136 63 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME random_unit_ 86 external procedure is an external procedure. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME random_unit_ 000100 i random_unit_ THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. call_ext_out_desc return mod_fx1 ext_entry THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. encipher_ THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. random_unit_stat_$seed LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 27 000351 37 000361 38 000405 39 000417 40 000420 41 000427 42 000454 43 000466 60 000467 65 000500 71 000526 72 000532 73 000540 75 000550 77 000552 78 000566 79 000602 ----------------------------------------------------------- Historical Background This edition of the Multics software materials and documentation is provided and donated to Massachusetts Institute of Technology by Group BULL including BULL HN Information Systems Inc. as a contribution to computer science knowledge. This donation is made also to give evidence of the common contributions of Massachusetts Institute of Technology, Bell Laboratories, General Electric, Honeywell Information Systems Inc., Honeywell BULL Inc., Groupe BULL and BULL HN Information Systems Inc. to the development of this operating system. Multics development was initiated by Massachusetts Institute of Technology Project MAC (1963-1970), renamed the MIT Laboratory for Computer Science and Artificial Intelligence in the mid 1970s, under the leadership of Professor Fernando Jose Corbato. Users consider that Multics provided the best software architecture for managing computer hardware properly and for executing programs. Many subsequent operating systems incorporated Multics principles. Multics was distributed in 1975 to 2000 by Group Bull in Europe , and in the U.S. by Bull HN Information Systems Inc., as successor in interest by change in name only to Honeywell Bull Inc. and Honeywell Information Systems Inc. . ----------------------------------------------------------- Permission to use, copy, modify, and distribute these programs and their documentation for any purpose and without fee is hereby granted,provided that the below copyright notice and historical background appear in all copies and that both the copyright notice and historical background and this permission notice appear in supporting documentation, and that the names of MIT, HIS, BULL or BULL HN not be used in advertising or publicity pertaining to distribution of the programs without specific prior written permission. Copyright 1972 by Massachusetts Institute of Technology and Honeywell Information Systems Inc. Copyright 2006 by BULL HN Information Systems Inc. Copyright 2006 by Bull SAS All Rights Reserved