Digitized by the Internet Archive in 2013 http://archive.org/details/induce1interacti876lars f «•" * UIUCDCS-R-77-876 Kb J7(, t^b 2- INDUCE-1: An Interactive Inductive Inference " Program in VL ?1 Logic System by James B. Larson May 1977 UILU-ENG 77 1727 DEPARTMENT OF COMPUTER SCIENCE UNIVERSITY OF ILLINOIS AT URBANA-CHAMPAIGN URBANA, ILLINOIS INDUCE-1: An Interactive Inductive Inference Program in VL 91 Logic System by James B. Larson Department of Computer Science University of Illinois Urbana, Illinois May 1977 This work was supported in part by the National Science Foundation, Washington, DC, grant no. NSF MCS 74-03514. TABLE OF CONTENTS C H A P T ?. R 1, Int. roduction, 1»1 Hiqh lpvel commands, Data Structures, ? Parameters, 1 Constants, *> Parse table (?T) 2 Symbol Table (SYKTAB) ft Domain Structures (DS73UC)*. c ?!et.a selector Table (MSTP) ~ Formula for Graph Structure (GRAPH) 7 VI Complex Storaqe (C?Y.) ° AQ7 Parameters (AQPA?) Q VI Parameters (PRM)... 11 Additional Variables I/O Piles. 1 TABLES, 2 FT PL A IS 3 CFTLE, U VL1EVE, 5 Other Files U. Proqr^im Structure U.1 Control and User Interface, PAGE 1 2 . 7 . 15 . 15 , 17 18 . 2? . 21 . 23 . 26 . 26 27 . 28 . 3G . 30 . 31 . 31 32 . 32 . 3 3 . 3U u.? VL Translation to Internal*. • ••• 35 • U. 3 VL Formula Manipulation •••••••••• 37 2 U.U AQl Complex Manipulation...... ■•••••■••••••• 39 U.~ Add Nov Functions.. • U" &,6 Supporting Routines ••••••••• • • U1 LIST OF REFERENCES 43 APPENDIX A » •••*.* • •••••••• U4 APPENDIX B ...... , ......... ••••••••••••••••••••••••••••• 6 C APPENDIX C 61 1 t Introduction ""his document is in support of the paper [ 1 ] to provids further details of the implementation of the program INDUCE_1. This program accepts an environment description, a set of VL decision rules, and a set of parameters. The program produces a s»=»t of generalizations of the input decision rules. The basic algorithms and input syntax are given in chapter 5 of the paper M I so will not be repeated in full here. In the following pages, the actual commands necessary to use the program are given. Chapter 2 contains a description of the data structures used in th-» program. The reader is refered to the program listing foe more derailed structure. In chapter 3, the various I/O files are described. Chapter u gives a brief outline of the purpose of each procedure and its relation to other procedures in the program, ""he aopendix provides a listing of the program for the CYBEP machine and a boss editor macro for converting the CYBEF version to a D5C-1C version. 1 . 1 Hiqh level commands The following single letter comands can be entered into th? program to preform various functions: ? (modify rule base) - This command is used to enter rules into the proqram or delete rules from memory. Following the M command, the user may enter (A) to add a new rule, (D) to delete an existing rule, or anything else to return to tha main level without doing anything. After an A is entered, the system expects a VL rule in correct syntax terminated 2 with a period (.). Since there is no online error correction, this is usually done by placing all rules in a local file (CPILE) with the commands (M and A) interspersed. After the rule has been entered, the program returns to the high level command mode. If a (D) is entered, the program proceeds through the list of all rules asking at each stage whether to delete the rule. The user may enter Y, U, or Q to delete the rule and move to the next rule, to keep the rule and move to the next, or return to the command level. Example: TSHAPZ (X1) =1 1[ P(X1,X2) =21 => [D=2]. H (get help) - Enter this command to obtain a brief explanation of the hiqh level commands and a detailed explanation of one such command by entering *H X 1 where x is one of the letters corresponding to a high level command. P (enter restrictions) - Fnter F (carraige return) followed by the restrictions which are to be added to each of the rules entered. ?.ach argument in the right hand side must appear in the left hand side and the left hand side must form a connected graph structure. As with all rules, the restriction rule must end with a period. Example [ON^OP (PI , P2) ]["ON?CP(P2,P3) ] => r ONTCP (P1 , P J) "|. ? (enter domain generalization structures) - Enter tree structure for such domains. These must be entered in order from lowest level generalization to highest level generalization. For VL applications, this should be done after a V command has been entered since the V command initializes the symbol table for the special VL mode. 1 Example: rSHRPE=2,Ul => [SHAPE = 1Q], rSHAPE = :,1, 3,5 ] => [SHAPE = 11 ]. rSHAPE=6,7,8 f 9 ] => [5HAPE = 12], rSHAPE=K',11 1 => rSHAPS=13l. L,S (Pnter F7TMTY and EQUIV type predicates) . Just enter the one letter command to add either type of generated predicate, (There is currently no way of removing such a predicate from a structure except by re-running the program. ) C (Cover a set of formulas) - Enter the number of the associated decision after the C command. Be sure to set any trace information using the appropriate parameters before entering the C command. V (VL mode) - This mode bypasses the VL type structure 1 2 creation and accepts VL events from the file VL1EVE. After entering V, the program asks for the number of variables which are to be used. Enter this number (it should be 1 less than the number of entries in each line of the VL1EVF file because of the class number in the file). Then, the user is asked to enter another command (Ef Z, 0, or P) . Enter E and then a domain generalization structure for that type of domain, P to change parameters (AQMAXSrAR, LQST, AQCBIT, AQTOLERANCS, or enter VCOST or VTY D F , the latter may be necessary for interval type variables) , C to cower a set of events, or g to return to the high level commands. All of the E and P parameters may be included in CFILE. When Z is entered, the progran reguests the number of the class of events to be covered and then the number (s) of the class (es) against which the cover should be made. To cover against all other classes, ent^r -1 instead of a list of all other classes. (This is useful for intersecting type covers.) The number of variables and the classes to be covered and covered against must be entered from the terminal. All other SDecif ications may be placed in CFILE, / ? (Parameters) - This places the user in a parameter examination and modification mode. To get an explanation of each parameter on-line, enter HFLP ) =i where is the name of a function which has been in a decision rule which is currently in the program, and i is the cost of the function. Some examples: 13 VCOST(SHAPF) = 2 or VTOST (X4) = 1 VTY n F(1) - This is the structure of each domain: 1 - nominal 2 - interval ? - tree structured. The type 3 is set automatically when the E command is entered. To make a function domain into an interval type, enter : VTYPE(SHAPE) = 2 MF7ATRIM(3) - This specifies the number of different meta-f unctions which are to be selected by the program to be used in descriptions. This value should be less than GSIZE, If it is 0, then no meta-f unctions are generated, PRINT 7. - This allows the user to examine certain tables in the program. X may be one of F, R, D, M and the system will respond ty listing: F - The set of input decision rules D - The set of input restrictions D - The domain table P 1 - The currently selected me ta-f unctions. 14 PPP*"FTEPS - This lists the current parameter values in a table. QUICK - This turns off all trace values BPIFF - This sets the trace options 3,9,10 and stop option 10, DFTATL - This sets all traces. FYP1ATN - This sets all traces and all stop options. HFL p - This allows the user to obtain an explanation on-line of the function of any of the parameters and a list of all parameters accepted under the P hiqh level command. OUIT - This returns the user to what ever he was doing before entering the parameter modification section. 15 2. Data Structures 2. 1 Constants Some constant in the program control the sizes of many structures which may be sensitive to the current problem characteristics. These constants may be increased (to allow larger data structures) or decreased (to permit more copies of a data structure in memory at one time). The constants and their use appear below (suggested values are in parentheses). SY^5ZF(36) - is the size of the symbol table. It can be estimated by finding the sum of the number of functions, predicates, and distinct variables plus the number of groups of variables plus 2 (for meta functions #PT and FOHALL) plus 2 times the number of binary predicates (for SST-, LST- type predicates). In VL mode, SYMSZE is the number of VL variables plus 1. SDES{15) - is the size of the DSTRUC table. Dne row is reguired in this table for each internal node in each generalization structure (i.e. one row for each rule which is input with the S command.) GSIZF (30) - specifies the size of all graph structures in the 16 proqram and the number of VL type variables which are 1 allowed in the proqram. This number being to small is probably the cause of an 'array index out of bounds' message and may be remedied by increasing the parameter. T ts value can be estimated by finding the sum of ths number of selectors in the longest rule which must be stored plus the number of variables in the rule plus 1 (not including meta selectors) . An estimate which is too larqe will use up memory very quickly and cause a message 'stack overruns heap' therefore, the parameter should be approximated rather closely. MNVAL(15) - is the maximum value in a set of values. A set of values (VALTP) is used in several places (GRAPH, CPX, DSTROC) in the program. Each set is allowed to contain values from to SMVAL. There is a maximum value of this parameter determined by the architecture of the machine (CDC is about 55, DEC is about 3C). LNK(19) - is the number of links to any node of a graph structure. This may be estimated by finding the maximum number of times that a particular variable occurs in a rule and using either this figure or the larger number of agruments of any one function, which ever is largest. 17 V LNK mast be one larger than either of these numbers since links are stored as an array of numbers which terminates with a r value. 1.2 Parse table (FT) ^he Darse table consists of a data structure which represents the productions in the VL grammar (PHS and CONT) along 2 with information about which semantic routines are invoked with the recognition of one non-terminal in the grammar (SEULE) . The array ?HS contains a row tor each alternative in each production where each element in a row is a positive or negative integer or zero. If the number is positive, it represents a token in the input (it is either the machine representation of a character or 1 a function symbol, 2 - a variable, or 3 - a number). If the entry in FHS is negative, it represents a non-terminal whose definition is found beginning in the row corresponding to the absolute value of the entry (e.g. -3 represents the non-terminal beqinning in row 3 of the table). A zero value signifies the end of the alternative. The boolean array CCNT indicates whether a row of 3HS is a continuation of a previous row in a production (value true) or the first alternative of a production (valus false). Finally, the array SPULE contains a number indicating the semantic rule (element in a case statement in the procedure ^P^C^SS) which is to be applied if the production in tha corr^sponinq row of the table is matched. 18 ^xamole: (see file TAELES for the complete input grammar) <"i?L?> = | = => = | = [ = ] | [ ( )= ] D arse Tahle in the program: (The actual table in the progran contains numbers instead of characters) ROW 1 2 3 U 5 6 SRULE CONT 1 2 "3 w u 5 1U 7 F T F F T RH5 3-3 -3 -a = > -6 a -6 -a o -6 r -19 = -io i o [ -21 ( -1U ) = -10 ] 2.2 Symbol Table (SYMTAB) The symbol table is a table with an entry for each function and variable in the VL decision rules. One entry (NELT) 2 specifies the number of rows which are actually used. The first 19 two rows always contain the information for the meta functions #PT and FORALL. The columns contain: MA1F -the character string representing the name of the entry ?N? - the function number associated with the entry (normally this iust points to the row which contains the entry). DPNO - for variables, this points to (contains the index of) the row which contains the domain definition of the particular entry (e.g. the row with xU would point to tha row containing the entry for x) • N£?G - the number of arguments of a function. vxyp^ - Jomain structure (1-nominal, 2-interval, 3-trea structured) • VC03T - variable cost used in cost function U and selection of alternative selectors (ALTER parameter) in tha procedure NESGP. FV*L - maximum value in complete domain. NVAL - number of leaves of tree structure domain. (EVAL = NVAL for non tree structure domains). . V VAL - minimum value in the domain. 20 Fxample: NFLT=7 NA* P DP1.0 PNG NAPG VTYPE VCOST EVAL MVAL NVAL FORALL 110 10 111

rSHAPE = 7], f SHAPE = C,5,6 1 => [SHAPE = 8 1. PBEH CONS PNO 1,2,3 7 3 '\5,6 8 3 21 ?. c feta selector Table (MSTR) ^his table records the meaning of meta selectors which are uspd in the formulas. The values of the selector themselves are stored in a structure referenced by MSEL in the GPAPH record. The '-able ontains two integers (METATRIM and NMST) the latter indicates the number of current entries in the table. Elements of th a table are accessed indirectly through the array PTP to facilitate sorting of the array with a minimum amount of effort, (e.g. the third eleent logically in the array PNO is the element P!?")r PTP[ ? ] 1) . Elements are sorted in descending order using PTR as an index according to the values of F1C0V (primary field) and - p "COV (the secondary field). The columms are interpreted: PNO - is the index in the symbol table of the name of the meta function (e.g. a pointer to either PORALL or #PT) . SYMP""? - is the index in the symbol table of the referee associated with the particular meta function (e.g. a pointer to SHAPE in the symbol table for a function which counts the number of occurrences of a selector of the form f shape (x1) = . . . ]) . V*L - is the set containing the reference of the function 22 associated with SYMPTR (e. q. the reference in a selector f SHAPE (X1) =2,3 1). PTR - is the location in PNO, SYMPTR etc. of the information for each selected meta selector in the order of preference (e.q. information for MS2 would be found in PNO[ PTR[ 2 1 ], SYMPTPf PTPf 2 1 1 etc) . P1C"^V - the maximum number of formulas in P1 covered by one value of this meta function. F'COV - is the number of formulas of TO covered by the meta function with the value found in F1C0V. ^xamDle: (NMST=3) PNO VAL SYMPTR PTP P1C0V FOCOV with the three meta functions: MS1 = #PT(SHAPE=0) MS2 = FORALL (SHAPE = 1) MS3 = #PT(SHAPE=1) 23 2.* Formula for Graph Structure (GRAPH) This is the structure used to store each formula* It is composed of U parts, the single parameters (COEF, P.NO, COST, ESET, >TX?N) , a pointer to a set of meta selectors (MSEL) , and a information about each node and the links between nodes* Each node has a number (the subscript value of each array below) which is used in the LNK array to refer to any node in the graph so that for example, VALf 3 ] is the value set associated with the node number 3. COE* - not used n *"0 - th«= unique rule number associated with the graph. FP - a flaq which is used in absorption and the COVEF routine. COST - the cost of the formula (COST[I] is the value associated with cost criterion number I) • ESET - the decision value associated with this rule !f7TN - the pointer to the next graph structure in a list or set of such structures. NN3G - not used. 2U MFFL - a pointer to the meta selectors associated with the qraph. VPL - if true, then the node is a variable, otherwise, it is a selector node. n RDI^? - if true, then the order of arguments is irrelevant (i.e. all connectinq edges are unlabeled). V\L - the set of values associated with the node (for variables, this may be a subrange corresponding to j"ic1=3..6] for example). CCUST - this is used in NEBGP and AQSET when generating alternative generalizations. In general, a non-zero value indicates that a node is in the graph. ASS^N - records assignments between nodes of two different graphs in SD8G1 when a 1-1 correspondence between nodes of two graphs is determined. PNO - a pointer to the domain definition for the function in the symbol table. DU1NU* - is used in VLINT and PGHAPH to distinguish between two variables with the same domains (e.g. x1 and x2) . 25 LNK - contain the links Detween nodes* Edges are not given an explicit direction, instead, certain routines infer the direction of an edge by the types of node at each end of the edqe. All nodes which are connected are doubly linked; if incomming edges are labeled, these labels are indicated by the location in the link array (LNK) for the node. Example for the expression [ P (X 1 , X2) ][ SHAPE (X1) =2 ], the link structure is ^Ow FUNCTION LINKS 1 X2 3 2 X1 3 u 3 P 2 10 U SHAPE 2 * A partial example using the symbol table above is: [SHAPE(X1) =1 ][P (X1,X2) ][MS2 = 2] NODE PNO VAL VBL ORDIRR LNK 1 U 0.. 15 TRUE TRUE 2 3 26 FALSE FALSE 1 FALSE FALSE 1 H 0.15 TRUE TRUE 3 MSEL|: [M31=* ][ MS2=2 ][MS3=* ] 2.7 VL Complex Storage (CPX) This structure is a simple list of references (CVAL) in bit positional notation along with certain flags (FP and ?Q) , a link to the next such structure in a set (NXTC) and the cost of the complex (COST) . The interpretation of each variable is found in the .symbol table through the index SLOC in AQPAEM (e.g. the set contained in CVALf 3 ] is the reference of the variable in row SL0C[3 1 of th« symbol table). ?.B AQ" 7 Parameters (AQPAR) The structure contains several parameters relevant to the AQ" 7 procedure. MVAR - the number of variables for the run. CSTF - the list of cost functions in the order of application. 'OLF? - the tolerance asociated with each cost function ( m 0LER[3 1 is the tolerance of the cost function which is applied third -- i.e. CSTF[ 3 ]) . 27 NF - the number of cost functions to apply FPEEC - a pointer to a list of free complex storage structures (CPX's) SLOC - the location in the symbol table of the domain definition for each VL type selector in CVAL» 1 CUT""' - a parameter which limits the number of formulas examined with AQCRIT of 3. LOS"" - if true, then VL compexes are stripped, MAXSTAHAQ - the maximum size of a partial star in AQ7 2.9 VL Parameters (PPM) This structure contains parameters relevant to the VL portions of the program. CST P - the cost function indices in order of application TCLF? - the tolerance associated with each cost function NF - the number of cost functions used MAX57AB - the maximum number of elements in a partial star, 28 ALTL ir5 - the number of new elements which are generated from one formula in a partial star P when forming a new partial i star P i + 1 EXTM7Y - a flag indicating whether EXTMTY type predicates have been added, EO'JTV - a flag indicating whether EQUIV type predicates have been aided MCONSIST - the minimum number of consistent generalizations produced. ?., i Additional Variables INFILL - an integer specifying whether input is from the terminal or from CFILE. NKQ - the number of elements in MQ F D EE3 - pointer to the list of available graph structures F^STLIST - pointer to the list of restrictions STAP - pointer to the list of formulas in a star mq - pointer to the list of consistent formulas 29 GSET - pointer to the list of input formulas COVSF T - pointer to the list of output formulas STP,TPACE - sets or values for trace features FTXIT - patch for compiler bug on DEC-1C PASCAL (fails to pass arguments which are sets by reference properly) • 30 3. I/O Files '.1 T*BLFS This file contains the parse table information. Terminals in *he qrammar which are characters immediately follow any number (i.e. non-terminal). The end of each row of the parse table has a 0, The boolean array CONT has the value 1 if true, if false. Below is the parse table as it currently stands cc:«t SRULE RHS 1 3 -3 C 12-30 p 3 -u=> -^ C * a -6 -a r 1 5 -6 C me -19= -10 I C 1 1[ -21 ( -14) = -10 1 1 18f -21 ( -14) I C 1 1[ -21= -1C ] C 8 -2 r , -1" 1 9 -2C. -2C 1 19* 1 1f -20 31 1 11 -19, -1U 1 20 -19, -1U 1 12 -19 a 13 , 19 * .ir. -17 Q 1 iu -19= - 1 C i 15 2 1 16 3 17 1 ?. 2 TPLAIU This file contains text for explanation. Each explanation has a number and is delimited by a ! in column 1 followed by the number of the explanation preceeding the text and a ! in column 2 3 r following the text. If a line ends with *, the program stops printinq to allow the user to read the material. (See appendix P. for a listing of this file). 3. 1 CFILF This file contains a set of input commands and data which is to be executed before the system asks for user input. Normally, input rules and certain parameters are included in this file. Unfortunately, the numbers indicating which sets are to be covered may not be entered in this file (they must come from the terminal. ) 32 *. U VL1FVF ""his file contains a list of VL type events. The file is in the format for AQ7 except that each event specification is proceeded with the class number of the associated decision. A -1 indicates a value which is irrelevant. 3.5 Other Files TFILE and OFILE are the TTY input and output (these are TTY in the DEC 1fl version). All other file are not currently used. 33 u. Program Structure "he program INDUCE_1 (Appendix C) contains about UCCO PASCAL statements and 40 basic procedures. These procedures may be grouped into several classes: 1) control and user interface, 2) VL to internal formula representation, 3) graph manipulation, U) ad1 new functions, 5) AQ7 complex manipulation and 6) supporting procedures. Each group of procedures operates nearly independently of the others thus giving the possibility of implementation on a smaller machine. The main program accepts high level commands and calls the aDorooriate procedures to preform the reguested action. Any input in the form of a decision rule passes through the VLINT procedure for translation to internal format. On some occasions, information is then copied from one internal form to another (E command) but most of the work is done in VLINT. All other user interaction takes place in ENTERP (enter parameters). The VL mode 1 uses the VL procedure and AQ, bypassing all procedures dealing with graph manipulation. To cover a set of formulas, the COVER procedure is called which in turn, calls NFtfGP to grow generalizations and AQSET to apply AQ to the consistent qenera lizat ions in MO. 31* u. 1 Control and User Interface MAIN - process hiqh level commands ^NTEF^ - Decode commands using the first 4 characters of the command name. If it's a number, find a rule with that number the data base. Find te first two numbers in the command (G^TNUM) and place in the variables I and L. Then, execute the command. PGRAPl* - Print the qra structure as VL formula. *ssing 2 indices to all varialbes, write out function and arguments if any. Then, write out reference (if not *) If tree structured domain and the value is an internal node, then only print out the internal node, PCPX - Print in VL type format indexing into SYMTA.B using AQ.SL3C array to find the maximum and minimum values. Don't print any selector with a (*) reference. D "!F:T&D - Print list of selected meta-f unctions. PDOM - Print domain table (i.e. dump symbol table). E!C°LN - Find requested text from the file EXPLAIN and print it stopping at (*) for carraige return from user. 35 U. 2 VL translation to Internal T^KEN - Pead an inut line and add the terminator (?) • Scan over the letters and digits and set CTYPE (O-delimiter , 1-function symbol, 2-variable, 3-number). If CTYPE was C then determine internal representation of the delimiter. If CTYPE is 1 or 2, then find the row in the symbol table (FINDFOW) , If it is not there, then add a new row to the symbol table (FIXSYM) (The name of the symbol is located hetwppn FCURS and LCUF.S in BUF) • In the case of a variable, add an extra row for the domain of the variable in addition to a new row for the variable itself (i.e. a row for Y in addition to a new row for X1). If CTYPE is 3, then compat the value of the number. Return the location in the symbol table or the computed number in the parameter SPCW and delimiter type in CTYPE. VLI^T - Translate VL formula into graph structure. Maintain a 2 value stack (VSTK) , a function stack (FSTK) , semantic stack (SSTK) and a parse stack (PSTK) • PSTK - Contains a stack of all non terminals not yet completed. 3P SSTK - Cooontains the tokens from the input buffer which have not been matched with an element of a completed production, VSTK - the stack of numbers not already placed into the graph. pc ;TK - the stack of arguments of a function (FSTK[ 1 ] is always the function symbol of the selector being parsed). As tokens are accepted from the input buffer, they are matched with productions in PT. If a token does not match an element of a production which is a non terminal, the location of the non terminal is placed on PSTK and the production defining the nonterminal is tried (PROD and LOC determine the current element in PT under consideration) • If there is no match, then try an altermative definition of the non terminal. If there is no alternative, back down PSTK and try another alternative of this non terminal. If a token matches the element of PT under consideration, put this token in SSTK and try the next element in the production. If the complete production is matched, replace the matching tokens on SSTK with the appropriate nonterminal, back down PSTK to the previous location, process the indicated semantic rule (PROCESS) 37 and proceed. Once the productions in row 1 of PT are completed, the expression is said to be syntactically correct. PPOCFSS - Fxecute the semantic rule for the production (-PP.OD) . briefly, node assignments are made usinq the elements in FSTK, values in the reference are assigned from elements in V?7K. The MNVAL and EVAL fields of the symbol table are updated and the type of a node is determined. Links between variables and functions are assigned recalling that PSTKf 1 1 contains the location of the function. '4.3 VL formula Manipulation -> SUBG1 - Determine if the graph in G1 is a subgraph of the graph in G2. If ALLSUBG is 1, then find all subgraphs of G2 which match G1 and apply ADDCONS (for restrictions) • If ALLSU3G is 2, then find all subgraphs of G2 which match G1 and apply £LLC (A07 procedure) • The procedure SCJBG1 selects a starting node of G1 and a matching node of G2. SUBG produces a spanning tree of G1 from the starting node calling match to determine for each pair of nodes whether they match. For each pair of matching nodes, ASSIGN records the correspondence. 38 T*>I!1G - Trim a list of formulas to MAXS elements, return other formulas to FEEEG. Place formulas with COST[ 3 ] into MQ (consistent formulas). Instead of sorting a linked list, the array CA is sorted. Costs are assumed to be stored with each formula (calculated in COVPR) • CCSTG - Determine the cost function CT specified for the formula ?. CQWF^ - Cover the set of formulas ES. First, select an element of F1 to cover (G) and compute the initial partial star. For all nodes in a qraph, the flag COUNT is set to 1. Trim the partial star and apply absorption. Form a new partial star by calling NEWGP for each remaining element of the trimmed partial star. Once NCONSIST elements are in *Q, apply AQ7 (via AQSET) to each consistent formula. Trim the list to one best element and remove elements of F1 covered by this formula (set FP to false). Select a new element of F1 and repeat until F1 is exhausted, NEWGP - Add new selectors to the input graph to form a list of ALTER or less new formulas, GO is the old generalization of G1; direct association exists between nodes of GO and nodes of G1 (i.e. correspondence is 1-1 by row, not throuqh ASSGK as with other correspondences). The 39 procedure forms only connected new graphs. A list of selectors which may be connected to the current graph is created in CANDID and sorted with respect to VCOST and NAEG. All variables connected to existing nodes are flagged (C0L'NT=2) and then all function nodes connected to variables with COUNT = 1 or 2 are marked (C0UNT=3) All count = ? selectors are placed in CANDID. Then, a new graph (in SLST) is formed from the old one with a new selector and any relevant variables. EQUIV type functions are discarded if they have no more than 1 argument. The list SLST is returned to the calling procedure (COVER) . u.4 AQ7 Complex Manipulation AQSFT - Translate from VL representation (graph structure) to 2 VL represenataion (seguence of sets of values). Create two sets of compxes, ?1 containing subgraphs of graphs with VL set F1 . and F2 , the set of complexes associated 2 with c-structures (GSUB) isomorphisms with elements of the VL set F r . The first element of F1 corresponds to the 2 part of the graph GSUB which was consistent. The two sets of events are passed to the Q PROCEDURE WHICH RETURNS A COMPLEX COVERING THE FIRST ELEMENT OF F1 BUT NO ELEMENT OF *2. THIS IS COPIED BACK IHTO GSUB to form the extended reference generalization. uo ALLC - Translate from graph to complex and add to the list of complexes if not already there. Also, set up SLOC to relate VL variables to symbols and find NVAR (number of 1 variables) . Use assignments from the c-structure GSUB and the graph G1 for nodes with COUNT = 1 in GSUB. All meta-selectors are loaded in the first METATRIM VL 1 variables, the remainder are nodes with COUNT = 1 in GSUP. VL1 - Input VL events from the file VL1EVE and translate to complex storaqe. Call AQ to find generalization and then print result. ^PISF - Trim a list of complexes with respect to AQCSTF etc. ^his is nearly the same as TRIMG but uses CPX structures. COSTF - compute the cost of a complex. U.5 add New Functions SDDSEL - find sets of nodes which have the same label in the graph. Add a new selector with the same label except that Q3DIP" = true and PNO is the negative of the original *>N0. The negative PNO always indicates a predicate of this type. m ADDML - Add MS? , LST type EXTMTY predicates. For each binary Dredicate whose arguments assume values from the same domain, add extremity predicates. ADD*FTA - add meta-sel actors to each formula in F1 and FO For each unary function and function value, count the number of occurrences of this pair in a formula and add a selector of that type to the formula (CO*PMS) . Calculate F1C0V and FOCOV and sort the list of meta selectors (TRIMM) . k. s SuDDortinq Routines ILIN" 7 - input end of line from CFILE or the terminal G!""CH?R - read one character from the TTY or CFILE PROS - detect end of line on TTY or CFILE INSIDE - determire if the set V is a generalization of the set 2 ET?»JD - find the extention of V against V . 1 2 INI? - initialize variables and files KFKG - allocate new graph. U2 GIN,GO r JT,SOUT - not used ADDCCNS - add decision part of restriction (called from SUBG) 43 LIST CF REFERENCES 1. Larson J., iQductive Inference in the Variable Valued Predicate Logic System VL i Met he do logy, and Computer l!D£l§Q] 7C SEE A RULE IN THE MEMORY, JUST ENTER THE RULE NUMBER. ~0 RETURN TO WHAT YOU WERE DOING, ENTEP QUIT !1 TRACE PARAMETER THIS PAEAKETEB MAY HAVE A SET OF VALUES FROM 1 TO 10. FACH VALUE PFLATFS TO A TRACE CF A PARTICULAR FEATURE OF THE PROGRAM. THE VALUES CURRENTLY MEANINGFUL ARE THE FOLLOWING: 1 PRINT ALL OF THE C-FORMULAS WHICH APE GENERATED FROM A PREVIOUS LIST OF C-FORMULAS. AT THE BEGINNING, ONLY C-FCEMULAS INVOLVING A SINGLE SELECTOR WITH A UNAFY FUNCTION ARE GENERATED. ON SUBSEQUENT PASSES THROUGH THIS "PACE, NEW SELECTORS ARE ADDED TO THE THOSE FORMULAS REMAINING AFTER TRIMMING WHICH FORM CONNECTED GRAPH STRUCTURES. IF ALTER IS NOT 0, THEN ONLY AT MOST ALTER NEW FORMULAS ARE ADDED. PRINT THE FORMULAS LEFT AFTER TRIMMING. DURING TRIMMING, ALL CONSISTENT FORMULAS APE REMOVED FROM THIS LIST AND PLACED IN THE MQ LIST FOP SUBSEQUENT PROCESSING PY THE AQ ALGORITHM. THESE *AY BE LISTED BY USING TRACE 2 3ELOW. 2 PRINT ALL CONSISTENT FORMULAS. EACH FORMULA IN U8 THE MO LIST IS PRINTED BEFORE AQ GENERALIZATION AND THEN THE RESULTING FORMULA AFTER AQ GENERALIZATION IS PRINTED. 3 AFTER FULL GENERALIZATION, THE BEST MQ IS SELECTED (LQ) AND PRINTED WITH THIS TRACE FEATURE. THE NEXT FVE*!T FROM F1 IS THEN SELECTED AND THE ENTIRE PROCESS IS FT?PAT£D. THE FINAL COVER IS ALWAYS PRINTED. U ALL INPUT EVENTS TC THE AQ PROCEDURE ARE PRINTED WITH WITH THIS TRACE. ON THE FIRST PASS, THESE MAY NOT BE *LL THE EVENTS AND THEREFORE THE EVENTS APE PRINTED FOR W ACH PASS THFCUGH THE AQ PROCEDURE. 5 THE SELECTED COMPLEX FROM THE CURRENT PASS THROUGH THE AQ PROCEDURE IS PRINTED IN AQ FORMAT. f PRINT THE SELECTED META FUNCTIONS 7,3 NOT USED 9 PRINT ALL ALTERNATIVE GENERALIZATIONS OF THE TNT I! PFIN^ EVENT F1 WHICH IS TC BE COVERED TO TURN DH ANY TRACE FEATURE, ENTER "'PACE I WHEFF. I IS THE NUMBER OF THE TRACE FEATURE WHICH IS T^ BP TJFNED OS. TO TUPN OFF THE TRACE FEATURE, FNTFF TRACE -I WHERE I IS THE NUMBER OF THE FEATURE WHICH IS TC BF TURNED OFF. TC STOP THE PROGRAM AT EACH TRACE FEATURE (POSSIBLY TC CHANGE SOME PARAMETERS), YOU MAY ENTER ^T? I WHERE I IS THE ASSOCIATED TPACE FEATURE. THE STOP MAY n E REMOVED BY ENTERING STP -I i i 2 <> f\ AOCUTF1 TM ORDER TO SPEED UP THE AQ PROCEDURE, ONLY CUTF1 EVENTS ARE CONSIDE r ED IN THF COST FUNCTION 3. THE DEFAULT VALUE IS 20 BUT M AY BE CHANGED BY ENTERING AQCUTF1 I WHERE I IS THE NSW VALUE OF AQCUTF1 t ^ U9 AQBAXSTAF THE AQMAXS m AE PARAMETER IS THE MAXSTAR PARAMETER USED IN "H" AQ PROCEDURE. THIS SPECIFIES THE NUMBER OF ALTERNATIVE COMPLEXES IN THE CURRENT PARTIAL VL1 TYPE STAR. f ! U r ' AQTOLERANCE PHIS PARAMETER SPECIFIES THE TOLEFANCE FOR THE ITH COST ?0'JC m :r\', I? IT IS AN INTEGER, THEN IT IS ASSUMED TO BE AN ABSOLUTE VALUE; IF IT IS A VALUE BETWEEN C AND 1 THEN IT IS A RELATIVE VALUF WHICH IS CALCULATED BY DETERMINING THE MAXIMUM AND MINIMUM COST FUNCTIONS IN THE STAR AND THEN OBTAINING AN ABSOLUTE VALU? WHTH IS CALCULATED AS FOLLOWS: ABSOLUTE VALUE = TOLERANCE * (MAX - MIN) ALL COMPLEXES HTTHTN "H? STAR RHICH HAVE COSTS WITHIN ABSOLUTE VALUE TOLERANCE AP^ CONSIDERED TO BE EQUIVALENT WITH RESPECT TO TRIMMING, THIS VALUE IS SPECIFIED BY ENTERING AQTOLERANCE (I) =T WHERE I MEANS THAT THIS TOLERANCE IS ASSOCIATED *'ITH THE ITH COST FUNCTION AND T IS THE TOLERANCE IN RTT?JD°5?HS (IT MUST BE AN INTEGER) FOP EXAMPLE: AQTOLERANCE (2) =2CC SPECIFIES THAT ALL COMPLEXES WITH THE SECOND C^ST FUNCTION VALUE WITHIN 2 ARE EQUIVALENT. TH" ^Y\ ? TAX IS SGM2WHAT RELAXED TO REQUIRE ONLY THE FIRST mv ? LETTER CF THE PARAMETER NABE (E.Q. AQTO ) AND THEN TWO TIMBERS WITH ANY DELIMITERS WHICH YOU DESIPE, E.G. AQTO 2 200 IS INTERPRETED TH r SAME AS THE ABOVE EXAMPLE. i PQCPIT "HIS PARAMETER SPECIFIES THE ORDER OF APPLICATION OF COST CFITFFIA. FOR THE AQ PPOCEDURE. SIX CRITEFIA APE CURPENTLY AVAILABLE 1 THE NUMEE? OF NEW VL1 EVENTS WHICH APE COVERED ALTHOUGH THIS IS NOT THE NUMBER OF C-FORMULA5 ^r WHICH APE COVERED, IS MAY BE A CLOSE APPROXIMATION IN CERTAIN CASES AND RUN'S MUCH MORE QUICKLY THAN CCST 1 2 THE NUMBER OF SELECTORS IN A COMPLEX WHICH DO NCI HAVE * IN THE REFERENCE 3 TH^ NUMBER OF C-FCRMULAS WHICH ARE ACTUALL COVERED BY THIS COMPLEX. THIS IS MORE TIME CONSUMING THAN 1 BUI V ^Y 5IVE BETTER RESULTS DEPENDING ON THE PROBLEM. U THE SUM OF THE COSTS OF VARIABLES IN THE COMPLEX. 5 THE NUMBER OF EVENTS IN THE VL1 SET 1 6 TUT. NUMBER OF EVENTS COVERED IN THE VL1 SET 2 T HIS PARAMETER MAY BE ENTERED BY TYPING AQC"TT(I) = J OP AQCPIT(I) = -J WHERE I SPECIFIES THE CRDE? 0* EVALUATION OF THIS CRITFRION AND J IS THE CRITERION (I ^• p . J TV J THE INTERVAL [1..61. THE FOFMAT OF THIS SPECIFICATION MAY pr ~T>.i\r?jj rc CNLY S?~CTEY THE FIRST FOUR LETTEFS CF THE PARAMETER NAM* (AQCh) *ND THEN TWO NUMBERS, I AND J, AQNF "THIS PARAMETER. SPECIFIES THE NUMBER OF AQ COST CRITERIA W^ZV 5R- TO BE USED. IT M UST B^ IN THE INTERVAL [1»#6] t ; 7 '. " VCOST THIS PARAMETER SPECIFIES THE COST OF A VARIABLE. INITIALLY, ALL VARIABLES HAVE COST 'OF 0. TO CHANGE THE COST OF P. VA~Ti\BL", ENT^R VCOST ()=II WHERE VARIABLE NAME IS THE NAME -c ~ H - 7.1^1-FLE (OR DESCRIPTOR) WHICH IS USED IN THE PULES. II IS T V ? COST OF THIS VARIABLE (IT MAY BE NEGATIVE). THE SYNTAX IS IMPORTANT REEF, YOU MUSI USE LEFT AND RIGHT BPACKETS '(..)' AND LEW 7 NO SPACES. EXAMPLE: VCCST (SHAPE l=-2 SI- IS THE COST ^F THE DESCRIPTOR c q ; n r ip _ -3mtjlAS AND SPECIFIES THE NUMBER OE NEW FORMULAS WHICH WILL 3E w^KED BY ADDING SELECTORS TO AN EXISTING MEMBER OR THE PARTIAL ^T'.F. ONLY NEW SELECTORS APR ADDED WHICH WILL FORK A CONNECTED ;RAPH ST'UCTURF. EQUIVALENT SELECTORS ([ SH (X1. X2) =S AME ]) ARE ADDED ONIY IF "HERE KERE TWO DUMMY OR INDEPENDENT VARIABLES IN THE »"Vi"'^ US" CF THE SLLECir;? IK THE ORIGINAL FCPMULA CF THE d a F T T A L S T k P . IF ALTEF IS r , THEN A NEW C-FCRMULA IS GENERATED FOP ALL SELECTORS NOT YET USED IN TH r CURRENT E-FOPMULA AND WHICH FORK A CONVFCT^D SUBGRAPH, t j 9 "» r PPULF THIS PARAMETER PRINTS TH v RULr.S AS WELL AS THE RULE NUMBERS AT EACH STEP. TO SUPRESS PRINTING RULES, ENTER PRULE F. TO ~FSU!*E P.FTNTIKG RULES, ENTER PRULE. THIS MAY BE US^D IF THE *CLFS ARE VEFY LARGE AND REQUIRE A LONG TIME TO PRINT ON THE T E ° M T N A L . t ! 1 - " n ??UL". 53 NOPSULE THIS PARAMETER TURNS OFF THE PRINTING OF RULES. SEE ! 1 f ; c r JTOTEACF THIS PARAMETERS ALLOWS THE USER TO TURN OFF A TRACF FFATURF (SEE "-FACE) TO TORN OFF A TRACE FEATURE I, ENTER NC'I'RAC 7 I r \ lir r QUIT RETURN TO THE COMMAND LEVEL. THE PROGRAM WILL RESUME FROM THE LAST POINT. t j 1 P ? r F1ELP HELP GIVES A LIST OF ALL PARAMETERS WHICH ARE UNDERSTOOD *T THIS POINT i ! 19rr PARAMETERS LIST CUPPFN m VALUES OF PARAMETERS i ! ?. r . r HALT THE PROGRAM AT A PARTICULAR TRACE FEATURE. GENERALLY, THIS MAY BE USED TO GET AN EXPLANATION OF WHATS HAPPFNING CR TO CHANGE SOME PARAMETER. j NOSTP TURN OFF THE STOP IN A TRACE. TO TURN OFF THE STOP FOR TRACE FEATURE I ENTEE NOSTP T i 5U ; 22 rxr • 230 ! 2 u r- c ! 2 5 r - QUICK THIS TRUNS OFF ALL TRACES ; DERAIL THIS TRUNS OK ALL TRACES, i EXPLAIN T HI5 "URNS ON ALL TRACES AND SETS \LL STOPS ; n ~ IFF "THIS SFTS TRACE OPTIONS 1 C AND STOP OPTIONS 1C ! 2^ or j i n () * CUSP FN' P.5STBK n;r ENTER VTYPE IN THE SAME FORMAT AS VCCST. THE TYPES ARE: 1 - NOMINAL 2 - INTFPVAL 3 - STRUCTURED ; PRINT "'HIS PARAMETEF REQUESTS A LIST OF THE MFTA SELECTORS 'LY SELECTED, THE DMAIN STRUCTURES, THE INPUT RULES OR ""IONS. ENTER: PRINT M EG? KETA SELECTORS Pi" INT D FOR DOMAINS PRINT R FCr RESTRICTIONS PRINT F FOP INPUT DECISION PULES. i MET ATR.TM 55 THIS PARAMETER SECIFIES THE NUMBER OF META FUNCTIONS SELECTED. I? SHOULD 3F LESS THAN GSIZE. IF IT IS 0, THEN NO BETA FUNCTIONS ARE COMPUTED. t LQST THIS PARAMETER (CM 3Y DEFAULT) STRIPS EACH OUTPUT COMPLEX "^ the \Ql PPOCEDUFE. TO TURN OFF, ENTER LQST F, r THE TSTILT CF THE AQ APPLICATION IS GIVEN BELOW. IF THIS IS SOT CONSISTENT, MORE EVENTS WILL BE ADDED TO SET 2 AND AQ RE?F*TFD. IF II IS CONSISTENT, THEN IT WILL BE TRANSLATED BACK INTO A VL2 FORMULA AND STORED IN THE NEW MQ LIST.! ! V R.N EVENT E1 OF F1 HAS BEE SELECTED, (F1 IS THE SET OF ALL CONDITIONS WHICH HAVE THE DESIRED SET IN THE DECISION PART; THE SF T E> r IS THE SET OF ALL OTHER CONDITION PARTS KNOWN TO THE PROGRAM) . THIS EVENT E1 WILL BE COVERED BY A C-FORMULA (CONNECTED CONJUNCTIVE VL2 FORMULA) WHICH IS CONSISTENT WITH RESPECT TO ALL FORMULAS OF FC (I.E. COVERS NO FORMULA OF FO) . ONCE A COVER (LQ) OF F1 IS FOUND, ALI EVENTS COVERED BY THIS LQ ARE PFMVED FROM F1 AND THE NEXT ELEMENT OF F1 IS SELECTED UNTIL NO MOPE ELEMENTS CAN BE FOUND IN F1. t !21 FNTEF RESTRICTIONS THIS COMMAND ALLOWS THE USER TO ENTER RESTRICTIONS WHICH WILL BE APPLIED TC ALL THE EVENTS WHICH WILL BE INPUT LATER RESTRICTIONS SIMPLY ADD NEW INFOMATION TO THE EVENT BY APPENDING CEPTAIN SELFCTORS TO THE EVENT. THE INPUT FORMAT REQUIRES * PRODUCT C? SELECTORS WHICH FCRM A CONNECTED GRAPH REPRESENTATION FOLLOWED BY '=>• AND A SELECTOR WITH A FUNCTION WYMBOL AND ARGUMENTS WHERF EACH ARGUMENT APPEARS IN THE CONITION PART OF THE RULE SOMEWHERE, EXAMPLE 56 rLEF7(7f,X2) ][ LEF?(X2,X3) ]=>r LEFT (X1 , X3) ], [ST. 1 (Y1) =1 ][PART(X1,L1) ]=>r C0ND(L1) =* ]. i t o "> MODIFY RULES (EVENTS) TiilS COMMAND ALLOWS A USEE TO ADD OR DELETE AN EVENT FROM ^H v SYSTEM. AFT^R THE USER ENTERS THE CHARACTER M, THE PROGRAM ASKSS T ? YOU WANT TO ADD OR DELETE A RULE. ENTER A OR D. ADD A °ULE ^ ^ T E ° A, THEN ENTER THE PULE. THER PULE KAY BE BROKEN *T?S? SELECTOR BOUNDARIES IF IT WON'T FIT ON ONE LINE. IF YOU MAKE A mt«5tAK* # YOU MUST REENTER THE ENTIFE RULE FROM THE BEGINNING. SEE RULE c; y m t i Y BELOW. D C LFT=: A FULF ENTFF D. "HE PROGRAM LISTS EACH EVENT KNOWN TO THE SYSTEM. 5 . FTF? r ACH EVENT IS LISTED THE PROGRAM ASKS IF IT IS TO BE DELETED. ANSWER: Y - TO DELETE THE RULE >? - TO RETAIN THE RULE AND LIST THE NEXT ONE - Tn RETURN TC THE COMMAND MODE.* °ULE SYNTAX A PULE CONTAINS A CONDITION PART (PRODUCT OF SELECTORS) AND A DECISION PART (A SINGLE SELECTOR WITH A 0-AF.Y FUNCTION OP DECISION VARIABLE) FOLLOWED BY A PERIOD (.). EACH SELECTOR IN THE CONDITION PA D T HAS A FUNCTION SYMBOL FOLLOWED BY ALIST OF URGUMENTSS SFPARATED WITH ','. THE FUNCTION SYMBOL IS A NAME WITH L^SS THAT V CHARACTERS. T HF ARGUMENTS CONTAIN A NAME (THE NAME OF A GROUP GPCOMPARABLF DUMY VARIABLES) AND A NUMBER WHICH EXTINGUISHES THIS ARGUMENT FROM OTHERS OF THE SAME GROUP (E.G. V1 pp CARU). THE REFERENCE MAY BE OMITTED (IN WHICH CASE IT ASSTTME3 THE VALU? 1), IT MAY B ? * (ALL VALUES), A LIST OF INTEGERS 57 SFPAPATED BY COMMAS, OH A PAIR OF INTEGERS SEPARATED BY .. (THIS SPECIFIES A RANGE OF VALUES AND TELLS THE SYSTEM THAT THE FUNCTION HAS AN INTERVAL DOKMN STRUCTURE), SELECTOR EXAMPLES: [SH(X1)=1,2] [P(X1,X2)] [SH(A1)=*] fSIZE(Ll) = 1.,6] RULE EXAMPLE: r SH (X1 ) =3 ][ Q (X1 , X2) ]=>r D=1 , 2 1. i j ?3 COVE? \ SET OF FORMULAS THE SYSTEM l«ILL ASK WHICH SET. ENTER THE NUMBER WHICH IS THE DECISION VALUE WHICH IS 10 BE GENERALIZED. YOU WILL PROBABLY WISH TO ENTER 'P» AND SET SOME TRACE AND STOP OPTIONS BEFORE ACTUALLY INITIATING THE COVER PROCEDURE. (SEE PARAMETERS QUICK, DETAIL, BRIEF ETC.) i i 2'i CHANG? PARAMETERS ENTER P TO CHANGS PARAMETERS. ONCE YOU ARE IN THE PARAMETER MODIFICATION SECTION, TYPE HELP FOR ■ FURTHER EXPLANATION, ALSO, WHEN THE PROGRAM STOPS DURING A TRACE, YOU MAY EN~EF P "0 GET THIS PROCEDURE. i i 25 ~:;tef domain structures enter s and then enter a rule with without arguments. enter the lowest levels FUNCTION SYMBOLS OF GENERALIZATIS I^ST. ENTER E AND THEN THE RULE FOR EACH GENER ALIZTION RULE. EXAMPLE: f SH=1,2,U ]=>[SH=7 ]; ! 25 HELP YOU MAY ENTER »HELP X» WHERE X IS M, C , V , R , P, L, S , OR E IN OROE- TO OBTAIN AN EXPLANATIN OF EACH OF THESE COMMANDS, i Ml VL1 MODE 58 Q M T 7B TF2 VI.1 MODE 3? PROGRAM OPERATION WHICH BYPASSES VL2 BY T H£ DECISION VALUE. FOP EXAMPLE, IF THERE APE TWO jFT 1 *ND 2 FV3KTS IN SET 5, THEN ENTER INTO THE FILF: CONSISTENT C-FOFMULA GENERATION. YOU WILL 3E ABLE TO FNTER VL1 rr V r N - s TN ft MQDIFIFD AQ7 FORMAT FROM A FILE VL1EVE. THE FORMAT OF ^HTS F T LF, CONTAINS A LIST OF EVENTS (VALUES OF VARIABLES) o^ECFFDED zv fn rs i m 1*13 5 113 c ■ 1 1 2 1 11 1 IS THIS EXAMPLE THERE ARE THREE VAPIABLES. NOTICE THA" T^F ORDFF CF EVENTS IS IRRELEVANT SINCE THE DECISION VALUE IS INCLUDED IN ~HF EVENT SPECIFICATION. THIS FILE MUST BE CPFATED ?r?o r E RUNNING THE PFGGFAM. IN "ID?" TO FUN THF PROGRAM IN VL1 MODE, CREATE A FILE IN -H? ABOVE FORMAT CALLED VL1EVF. THEN RUN THE PROGRAM AND ENTER V. ^T "•HIS PCI 57, YOU MAY ENTER DOMAIN STRUCTURES (IN THE VL2 FORMAT), FN7FP PAKA-'ETFPS (THIS ALLOWS ONE TO ENTER COST FUNTIONS AND MA^STA? PARAMETERS ETC.) OR COVER ONE SET AGAINST A BUNCH OP ~F*S OF "VrlVTSi * VAFIABLE COSTS AND DOMAIN TYPES (CHANGE DOMAIN TYPE FROM ^HF DEFAULT (NOMINAL) TO INTERVAL) MAY THEN BE ENTERED BY ENTERING ? AND THEN SPECIFYING EITHER VTYPE OR VCOST PARAMETERS. ALL VARIABLES A?* LABELLED •"CI". STRUCTURED DOMAINS ARE AUTOMATICALLY SET FY THE F COMMAND. THE DOMAIN TYPES ARE: 1 - NOMINAL ? - INTERVAL ? - STRUCTURED ONCE THE EVENTS ARE READ INTO THE PROGRAM AND ALL PAF'METEF.S ARE SET, YOU ARE READY TO COVER A SET OF EVENTS. ENTER THE C COMMAND, THF, PROGRAM ASKS WHICH SET IS TO BE COVERED. FNT,? THE NU*BE5 WHICH CORRESPONDS TO THE SET »HICH IS TD BE COVERED, Th r PROGRAM TH*~N ASKS WHICH SETS ARE TO BE COVEP.ED AGAINST. ENTFP A LIST OF INTEGERS WHICH CORRESPOND TO THE SETS AGAINST WHICH THE CCVER IS TO BE MADE. THF PROGRAM THEN PRINTS ~H~ COVFFING COMPLEXES. 59 UL CCMANDS EXCEPT FD^ THE NUMBER OF VARIABLES AND SETS NVCLVFD IN C n V-FING MAY 3F ENTERED IN CFILE. i • ~> z I ")0 L - FXTMTY PREDICATES \DD E''T"!TY TYPE PRFCIDATES LIKE LST- AND MST- t S - FQUTV PREDICATES *DD EQUIVALENCE "TYPE PREDICATES (E.G [ SK (X1 . X2) =SAKE ]) i 6: APPENDIX B The BOSS file which converts from CYB^R to DEC VS/STGXFNT2D//W vs/s/s/a VS/PFAD (TFILF/PFAD (FTY/W VS/WFTTE (CFILE/WEITF (TTY/W VS/G ET SEG ( I FILE/P E ft DLN (TT Y/H VS/PTITSEG (OFILF) /BREAK/'* VfVWEITFLN (OFILE/WPITELN (TTY/W Vpf VF/PPOGPAM VL2/ M/(* /;S/;/*)/ vs/<>/ /w VS/ECS (I P TLE) /EOLN (?TY)/K vpt VS$*) $*/$w TAB ? VS.? (*$/*$* pi I- V"* ID S YS 7EM= PRINT, PRINT =DEC10,H AM E= • VL2.PAS (4113,1374) • PFADW -1=JCL PIP VS/+PPEK/ OF PREM/W VS/TP.SLTVTRSLT CF /W VS/*TPSLT/ A^'D TPSLT/W vs/+[/ c p r /* V3/ + [ / OF r /W V5/V1 */V1 AND/R VS/CVAL[ Il*/CVALr I 1 *ND /W VF/CVALf I 1+/CVALT T 1 CP /W VS/*CLN (TFILF/EOLN (TTY/W 61 APP2NDIX C PP0G3AK LISTING 62 WH T C OF: *- • KT a . :n WH AN ma S5 TO jtr, ; ILE W : :lf • p ri 7 P - Til S E :le r T :t.f I v **■ V T Y? 'S A? T.L ^ ST IT T H E is TC D Y TC An D VI. s: FP VL2-SYNTHESIS OF VL2 FORMU PROGRAM SYSTHEIZFS VL2 FORMULAS (REP 5 GENERALIZATIONS OF A SET OF OF VL 2 OWING: LL VAFIA3LES ARE EXISTENTI ALLY QUANTI TNCT VALUES CF THEIR DOMAIN. ACH EVPRESSION IS ASSUMED TO BE A PRO ATOMIC FORMS WHICH ARF FUNCTINS OF S XPPESSTONS APE REQUIRED TO BE IN A FO A CONNECTED GRAPH. MORE PREDICATES *THE PROGRAM GENERATES LARGEF. AND LAF H CCVFP A SPFCIFIC ELEMENT OF THE SET 3 COVERED. WHEN ONE PRODUCT IS FOUND FORMULA IN OThF? SETS, AN AQVAL/1 TYP XTND m HE PFFFFENCFS. COVERING IS TLS HING ALGORITHM WHICH FINDS A SPANNING HE TWO GFAPHS AND TRIES TO FIND A TRE H WHICH MATCHES. A BACKTRACK MECHANI ACK DOWN THF TREE IF SOME MATCH FAILS MY DESCRIPTOR FOLLOWED BY A NUMBER IS 7 ON THE CYBFF LAS RESENTED AS DECISION PULES) FORMULAS. ASSUMTIOHS ARE FIED AND RFPPESSNT DUCT OF SELECTORS IN VL2 IMPLE VARIABLES RM WHICH CAN BE TRANSLATED MAY BE ADDED F«Y THE (ISEP TO ASSURE GER PRODUCTS OF SFLECTOPS OF FORMULAS WHICH hB* WHICH DOFSNT COVER E PROCEDURE IS CALLED TED BY A SUBGRAPH TREE OF THE SMALLER E IF THF LARGER SM IS BUILT IN TO * A DUMMY VARIABLE. IEVFFAL FILES WHICH THF PROGRAM USES. T HSY APE BRIEFLY DESCRIBED n, !-LP; .3^ DU - INFUT - OUTPU - OUTP SYMBOL '•" p R G B S S T :i ( - PAPS - S^ORA O cr "S RU G R A M I - npTjr PLANK 1 ni [■: p F : V, M < A < r s h ( y i ) = ->[ D = 1 1. M s r YS FCTED C-G LD BE A S THE PULPS MESSAliiS A TO STAPT DESCRIPTOR I1ICH TO NT A E3NAL RULE GFTLE AND THE RUIES ND FILE. FY LI NT 3 n ND DEBUG OUTP N A NEW PROBL S INTO THIS F IKS VALID SYN FORMAT, THE 'HE SYMBOL TA AND STAB APE IF COMMANDS A F INPUT A ONE TPUT AIGV UT EM. THIS FILE MAY BE ™PTY. ILE AT THE END OF EACH TAX OF VL2 EXPRESSIONS Q- COMMAND AUTOMATICALLY BLE INTO STAB. WHEN THF READ BACK INTO CORF RE HERE, THE FIRS T LINE MUST WOULD ENTER ON TF.E TERMINAL CODE FOR PROGPAM> FILE fhEIU- LF (C*ILF). K AND A AS COMMAND TO COMMAND 10 1 If SH (v.2) = N, STAB, GFTLE FOLLOWS: MODIFY RULE ADD PUL r TO 1 If P(X1,V2) =1 h (>:i^=2in T '■"? MI" V f T , (X2) = RULF ""rfF OM M O 1 ? DFLF'I LDING THE ND K F">LL OOK AT. £ ND DELETE DON'T D^LF FA METERS m i ;T7 P COM N ST RUTH) ? E COMMA PAPH (CONJ ELECTOR WI INTO THF AND (P). ING RULES RULE BASE OWED WITH j; >P p p the S *FULF, ENT TF THIS RU A N D 1 jr P(xi,x2> =1 WITH A PEPIC U MOTIVE GRAPH THOUT ARGUMEN RULF BASE, RU ) • BASE> BASE> ] ->[D = 2 . D. PREMISE SHOULD FCPM A ) WHEN TRANSLATED, CONSFQ N THE PRCGFAM , PUN THE PRO D. THE PP^GF (1 TO =>) . Y (DELETE 3RAM AND ENTER AM ASKS WHICH SET YOU IN RESPONSE "0 THE RULE JUST PRINTED URN TO COMMAND LEVEL) . M A N D PES ND AND THE NTLY STCPED FROM ON p T EK LE) CFv Q (RET HEN THE PARAMETER WHEN ASKED. N THE STROCTU E EXECUTION T RE. THESF STUCTUPEF APE C THF NEXT. ENTER 63 'H E EL^M PULE T'J 2. 0* PROC ■5 m J. i WHIG PROG FA LABEL CONST SYMSZ NDES GSIZE "IN VAT. MT.NK TYPE RH CO SP EN VALTP NOD FA f pv = CO FO cv NX EN GRAPH CO RN FP KS CO ES VB OR VA CO AS PN DH NX NN LN EN SYMTA NE NA PM DP NA VT vc ~v HV NVA FN MSTR STRUCT OR E L S NOTF TH ENTS IN IS TERM P SET OF ENTER T PROGRAM ACH CONS F IT IS HF FORMU ESS II E RULE H ARE CO M VL2 (CU 1,2,3,4, E AS FOLLOWS: H=1 i 2 # 3- 5 J->{" SH = 1G ]. AT THE DESCRIPTORS ARE GIVEN WITHOUT ARGUMENTS AND TH THE REFERENCE ARE SEPARATED BY COMMAS. THE ENTIPE INATED WITH A PERIOD. RULFS HE C COMMAND AND THEN THE SET WHTCH IS TO BE COVERED. PRINTS OUT INTERMEDIATE RESULTS: ISTENT FORMULA IS PRINTED AS IT IS FOUND NOT ALREADY IN THE STAR, THEN THE GENERALIZATION LA IS PRINTED ALONG WITH STEPS IN THE GENERALIZATION ED IS PRINTED AND ALL FORMULAS OPMULA ARE LISTED.*) E,STAB,GFILE,TABLFS,CFILE,EXPLAIN, VL1E AT WHICH IS SELECT VERED BY THIS F TPUT,IFILE,OFIL 5,99; v = 3*;(*' OF DESCRIPTORS ♦ ' OF DUMMY VARIABLES +K => « PCWS = 1 C >; (*NUMB£F OF ENTRI = 36; (*• OF DUMMY VBLS = 15; (* MAXIMUM NUMBE = 13; (* MAXIMUM ' OF LI ES IN DSTRUC RECORD *) + ' SELECTORS IN AN EVENT iR OF VALUES IN DOMAIN*) NKS TO ANY NODE +1*) 10 => VE) ; I N ST GDSS I A3*) N 3*) ^ECOR S : A N'T : OLE: D; = SE = PA PECO ^T : : bo PC D PRAYT 1 APRAYT APPA' AL TC : D; = P.E 3C EF ^L ST : L: PA DIFP IF L : P UNT : SON : o : P FINUM TK EG K : A D; B = R LT : ME * o ': *A NO : PG : YPE : OS*" al : " al : L : A D; = PEC : P T CF CKED A RD INTEGE OLEAN; OLEAN; PACKE CPX (* CO^D I N T EG E STSGER OL^AN; CPX; APRAYT VALTP; CKED A : PACK PDEP ACKFD PACKE PACKE *CKED : PACK GRAPH; GRAPH: RPAYT 1 ECORD INTLGE PACKED RPAYf 1 ARRAY" APEAY ARPA ARRAY ARRAY ARE PRA ..21.1.. 13 1..21 ] OF SO 1..21 ] OF IN . .MNVAL; RRAYf 1.. MLNK R; (* COST C (* LIST OF (* LIST OF C D APRAYT 1. »G POINTER TO OF INTEGER; OLEAN; TEGER 1 OF T. . GSIZE; (*TYPE FOR NODE LIST*) F COMPLEX *) COMPLEXES NOT COVERED BY ANY LQ *) OMPLEXES NOT COVERED BY ANY STAR *) SIZE! OF VALTP; (* SELECTOR VALUES *) NEXT COMPLEX *) R ; (*RULE NUN (♦TEMPORARY 1..4] OF INTEGER ; (*CCST CF THIS FORMULA*) BER*) FLAG USED IN COVER PROCEDURE*) RF AY[ 1. . GSIZ ED ABRAY[ 1.. F ARGS IPSE* APRAYf 1. .GS I D ARRAY[ 1. ,G D APRAYT 1. .G AERAYT 1. . GSI ED ARRAYM.. (* POINTER (* POINTER ..GSIZE 1 OF El OF BOOLEAN; (* TRUE IF ENTRY IS DUMMY *) GSIZE] CF BOOLEAN; ZE ] OF VALTP; (* VALUE OF THIS NODE *) SIZE] OF INTEGER; (* NO OF TIMES USED SIZE 1 OF 0.. GSIZE; (* ASSIGNMENT OF NO ZE ] OF -SYMSZE.. SYMSZE; (* DESC NUMBER GSIZE] OF C. SYMSZE; (* WORK PACKED AP TO NEXT GRAPH *) TO NEG GRAPH *) NODEA (*LINKS FOR NODES*) IN SFl DE *) FAY *) SY IF RAYT EAYT AYT 1 R; AFRAYM.. . . SYMSZE ] 1.. SYMSZE ] -SYMSZE. . SYM [1. .SYMSZE 1 [-SYMSZE.. SY 1.. SYMSZE] 3 1,. SYMSZE 1 3 . . SYMSZE 1 OF MSZE INT F IN SZE 1 OF 1 MSZE F IN F IN INT ,1.. 1C ] OF CHAR; (* EGER; (* DESC NO *) TEGER; (* DESC NO C! INTEGER; NAMFS OF DEST *) TEGER; (* MINIMUM EGER (* NUMBER OF ASSOC DESC *) ) -I AB TN VALUE OF PFF *) VALUES *) NT, 3-STRU*) LE*) D^DOM*) OPD ACKFD AtRAY C 1.. GSIZE] OF C. SYMSZE; 64 • QP T P ftp M = IA DS P C P N V IF GFI PR PR TR r- v ON MO PL r>T> PT pf PT SA ftP ( ST P ST L1 IL IL LE TA VftL SYMP PT" "ICO c "? CO "1ETA N.I ST FND APi« NVAR OLFP NF : FPFE SLOC CUT? L 2 MAXS FND; CSTF TOLE NF" • SRXS A IT P. r X "^M FQUI NC'ON FND; AY = AY = DC = M : s : : ft E : END; P - P = P = b = P = R = 'CHR * ^S NI CTI DST T?P COV mst *gse "EST cs FR NF1 P, TR F AQP CNS'T RM AB EVE E : 17 • ": "P BLFS ILF XPLA : PACK TR : P : PACK V : PA V : PA TRIM : : INT = RECO : TNT : APR : ARP IN^EG C : CP : APR 1 : IN ST:BOO TAPAQ ORD : APR R : AR INTEG TAP : R : IN TY: BOO v : bo s I s T : ARRAY ARRAY RECOR ARRAYf AP.PAYr RPAYf 1 INT EG E GPAPH; DSTPUC PT; SYMTAB AQP ARM CPX; ARPftYr K,CHRR - TND NSTR - PRENT : DST EFG,G1 S E^ , GS : MST T - PO LIST - ET - ? EF.G - AR - P ,CRULE ACF : IX IT : AQPAP CY : A PAPM; FILE : FILE SEGMEN SEGM? ILE OF FIL FILE IN : F ED ARRAY [ 1.. GSIZ ACKED ARRAY [ 1, .G ED ARPAYT 1. .GSIZE CKED ARRAY [ 1 . . GS CKED ARRAYf!. .GSI INTEGER; EGER El OF 0. .MNVAL; SIZE 1 OF C.SYMSZE; 1 OF 0.. GSIZE; IZE1 OF INTFGER; ZE 1 OF INTEGER; FD EGER A ft ; (* NUMBER ..6 1 OF INTEG ftY[ 1..6 1 U 1..6 1 ER;(* NUf (; j* P ^YfT..G ; TOLEi OST FORMULAS TO BE OF REAL; MBER OF C OINTER TO AYr T. . GSIZE 1 OF I EGEE ; (* NUMBER LEAN; : INTEGER (* MAXSTAK PARM IN AQ ALG *) a F VARIABLES IN AQ PROC ER ; (* COST FUNCTION ft *) TO BE USED *) FREE COMPLEX LIST *) NTEGEP: f* LOCATION IN THE F F1 TO CHECK TN AO * ST *) IN AQ *) STABLE OF VBL*) INTEGER f.AY ER ; OF INTEGER ; (*VL2 COST FUNCTIONS*) ;(*VL2 TOLERANCE*) 1 OF REAL ♦NUMBER OF COST FUNCTIONS*) (♦MAXSTAR PAFAMETER*) TEGSRj '(* NUMBER OF ALTERNATIVES *) LEAN; CLEAN: INTEGER (* NUMBER OF CONSISTENT ALTEPNS TO GENERATE*) 1..1M] OF CHAR; C. .MNVAL 1 OF INTEGER; D 1..NCES 1 1.. NDES j OF OF VftLTP VALTP P ( NDF5 1 OP INTEGE LUMBER OF EL fti P PREMISE OF DESC STRUCTURE RULE *) CONSEQUENCE OP DESC STRUCTURE PULE (* POINTER TO SYMBOLTADLE *) EMENTS IN THIS STRUCTURE USED SO *) FAR*) 1..51 1 :CHA EX OF NUME INPUT "UC; ,G2.G ET,MQ p • TNT^F PCIN OINTE POINT CINTE NO.NF SET VALT R R A Yf OF GPTR R:I,J,K, DFCISIO ER OF G FIL^ (0 , STAR, RE , PSTAR,0 S TO LIS TER TO L RS TO LI ER TO LI P TO CUR WTRACE.N F 1..1D; ES,E N WH STP'T STLI PSTA T OF 1ST ST ST RENT TIME PRUL PR,NINSTR, IN FILE. NMQ: INTEGER; ICH IS BEING COVERED CT IN VL2 STAR TY, 1 - CFILE*) ST,R:GPTR; R:GPTR; C GRAPHS FOP FACH DECISION OF RESTRICTIONS F IPRED GENERALIZATIONS F UNUSED G STRUCT VL2 STAR*) S: INTEGER; PTBL:PT; S: SYMTAB; E : BOOLEAN; 1. . GSIZE 1 OF INTEGER; (*CON5ISTENC Y VALUES*) OF SYMTAB; OF CHAR; TED FILE OF I NTED FILE OF GRAPH; E OF CHAR; OF CHAR; ILE CF CHAR; HAR: CHAP 65 d) i)d)d)d)d) poor v PROCED PROCED Pf)D A.N OT 3E id) J) i)d)i) FUNCT VA? I IN DM T F DFILE : FILE OF DSTRUC: 7) 1) 7) j) a) a) ,j) d u) i) a) d) j) d) a) d) a) a) J a) u) j)d>a)ci) 7) 1) 1! ?J a) at a) a) f) 1) i) j) a) 1) oj j ') d) c 1) 1) a) a) 1) d) a) J DURE PGRAPHfG:GPTR; S: SYMTAB) ; FORWARD; UPE ENTFFP;FOFWARD; UPF. VLINT(G:GPTR; VAR ERR: INTEGER ; VAR ES:INTEGER) HABD; d) d) d) d) j) d) a) a) d) a) a) a) d) a) a) a) d) a) a) d) ci) a) a) a) i a)2)aja)d)Jd)d)d)a>Jd)a}a)d)d)d>d}d)d}<3d)d)d^ PGRAPH(G:GPTR;S:SYHTAB); FOR WARD; '2)a)^Da)a)i)d)d).7)d)T)T)i)d)d)d)a)d)d)Ja)J)d)(73d)d)d)a)d)ia) D HE A" i)d) TO ,J N 57 uji s i" SET, THEN DETERMINES IF ONE NVAL ARE THE SAME D WISE. IT IS CARTESIAN. CHED FOR POSSIBLE GENER f>a) d) a) d) a) ai a) d) d) d) d) a) aid) aid) a) d) a) d)d) a) N INSIDE (DNUM:INTEGER;V : INTEGER ; a).i1d)d)d>a)i)^a)d)d)a>d)d)ald1d)d)*) DE:=FALSE; :=A3S (DNUM) ; . VTYPF[ DNUM ]<> 3 THEN IKSD AND V1 <=V2) INSIDE:=TRU? ELSE ELSE WITH DST DO FOP. I: = NELE DOWNTO IF DNUM=PNO[ I I TH TF CONSr I K = V2 V2:=V2+PREM[I ) OR (NOT INSD AND (V1 * V2 Of ]) ) 1 DO EN THEN HFN TF INSD AND (VK = V2) OR (HOT INSD AND (V1 * V2 <>|" 1) ) INSID£:=TRUE; "HEN T N (*d)d)d)d) IN WH IS SE TH d) d) i) d> d) $ (*I VAR ' BEG I KI END; (*hith*j n • d)d)T)z)a)d)j)tT)j)xi)a)(i)d)d)d)a)a)a)(i)a)a)i)j)i)(i) did) NS ED LN N TH ADD SYMMETRIC SELECTOR LVE THE SAME FUNCTION A H IS LINKED TO ALL THES HE NFGATTVE OP THE PNO TH FALSE IN THESE SELEC "FORE, SUBSETS OF ARGUM T)iid)d)a)d)d)ciJd)d)a)d)a)d)a)d)d)d)dJa)f7)d)a) IDF*) UPE ADDSFL (G:GPTR) ; ^NND,!, J,K,L: INTEGER; od7)a)a)d ADDSEL (G:GPTP) ; S TO THE G STRUCT. FIND ALL SELECTOPS WHICH ND SAME REFERENCE. FORM A NEW SELECTOR E. THE PNO OF THE NEW SELECTOR OF THE ORIGINAL SELETOPS. VBL IS TOPS AND ORDIFR IS ALSO SET TO TPUE. ENTS CAN BE COMPARED USING FUBG1. d)d) 3 a) d) a) a) a) a) a) a) a) d) a) 3) Ha) a) a) a) aid a) a) a) a) $ d) a) d)d)dJ a) a) a)d)d)d)d) did) did) i)*) 1 DO GIN LND:=1 ; WHILE LNK[ LND, 1 IOC DO LND:=LND*1 ; NND:=LND-1; EOF I:=1 TC NND DO CCUMTr I 1:=0; FOR I:=1 TO NND DO IF (COUNTT I ]=C) AND (NOT V3L[I1) AN D (LNK[ 1 , 2 ]=C ) Til EN BEGIN K * —1 ' LNKT LND.1 ]: =LNK[ I FC? J : = I + 1 TO NND' IF (VAL[ J l = VALr BEGIN CCUNTr J 1: =1 LNKf LND,K 1: K:=K+1; END- LNKf LND,K]:=n; IF K<>2 THEN •w D( I 1) AND (PNOfl ]=PNO[ J 1) THEN = LNKf J,1 ]; 66 REG IN PNC[ LND]:=-PKO[ I 1; s.vcosTrPNor 1 1 j : = s. vcosir-PNori 1 (* USED TO SELECT EQOIV RT*) VAL[ LND ]:=[ 0. .MNVAL 1; VBL[LND]: =FALSE; TYPE SELECTORS IN COVER SO ORDIRRrLND 1:=TRUE; FOR J: = 1 TO K-1 DO B^GIN (♦ADD BACK POINTERS*) L: = 1: WHILE LNK[ LNKfLND,J ],L ]<>0 DO L:=L+1; LNK[ LNK[LND,J ],L]:=LND; LNKf LNK[LND,J J, L+1 1:=0; END; f*FOP J*) LND:=LND+1; END (*K<>2*) ELSE LNKT LND, 1 ]:=0; END; (* AND *) END; (* WHILE*) EM D : EX TND(DNUM: INTEGER; V1.V2:VALTP) ; FIND THE SXTENSIOM OF V1 AGAINST V2, PUT RESULT IN RSLT. DNUX IS THE DESCRIPTOR NUKBEF (LOC IN STAB). IF EVAL = NVAL, THEN THE D0^AIN T S ASSUMED TO BE CARTESIAN, OTHERWISE, THE DSTRUC RECORDS APE SEARCHED TO FIND THE GENERALIZATION. DSTRUC RECORDS ARE ASSUMFD TO RE IN t H2 o^DER: LOWEST LEVEL GENERALIZATION FIRST. D^'D ili! t)i) Oil) a) a)d)Qi(i) :i)j)S)'j)*) (*A DD^EL*) PROCEDURE FXTND (DNU/,: INTEGER; V1 ,V?: VAI.TP) ; VAF I, J, LL:IN T EGEP; "RSLT: VALTP; BEGIN TRSLT:=V1; ONUM :=ABS (DNUM) ; CASE S. VTYT'Er DNUK 1 OF TRSLT:=r °. .MNVAL ]-V2; DO DO BEGIN l:=0; WHILE (KMNVAL) AND (NOT (I IN V1)) I:=I+1; J:=C: WHILE (Ja)c0a)$ ILINE: INPUT LIN 17 CF INFORMATION FROM TTY OP CFILE DEPENDING ON INFILE a) ■% a) a) a) i) 7)rDdhod)a)'D!2)d)5a)a)a)a)a)d)(Ja)a>$cJ)a)a)$j)i^^ i>d> cba) a) a) a) d> a) a) a) d a) a) 3 a) * ) (*EX T ND*) PROCEDURE ILINF; LABEL 1; BEGIN IF INFILE=0 THEN 1 : RE1IN GETS EG (I FILE); WHILE EOLN (IFILE) DO GETSEG (IFILE) ; END ELSE BEGIN IF EOF (CFILE) R^GIN THEN INFILE:=C GOTO 1 ; END; 9EADLN (CFILF) IF EOF (CFILE) 'THEN BEGIN INFILE: =0 GOTO 1 ; END; END; FND; ( * ahd u) 'S a) ii a) t) a) a) a) a) a) i ^ a) $ 7) a' a) a) a) a) ^iial(i(ild)aii)^dda)ddaid(bai^^^a)^^dddin)i)iii^iid^'i)iii PEOS (1:1 NTEGEP) : BOOLEAN; DETERMINE IF AT THE END OF SEGMENT OR LINE jla)7)d)a)i)a)o)a)a)i)a)a)$^ FUNCTION PEOS (I: INTEGER) : BOOLEAN; BEGIN PEOS:=PALSE; IF INEILE=0 THEN IF EOLN (IFILE) THEN PEOS:=TRUE ELSE ELSE IF ECLN(CFILF) THEN PECS:=TRUE; FND; (*a)j)o)7) 7) ,;)ali)a)a)o)o)a) $3)0)0)1)0)0)0)^ INIT { 68 F R OM it it i> i) a) it it PRCCED VA» T, r>2 3it; T R A C PPUL STt>: GSET F D EE PES"" DST. *!ST, N, ST. FOR MS INFI 3E INTTALIZE CERTAIN PARAMETERS, READ IN SYMBOL TABLE AND PAPSE TABLE STAB AND TABLES. rj)a)ci)a)(j)n)rda)d)cDa)a)(2)a)a)a)a)d)a)d)'i)a)a) a)d ; MFTAfPTMrsB; l:=1 to gsize do T. PTRf I 1: =1 ; LE:=0; T(TABLES) ; l:=1 TO 6 DO GIN AOP. RQP. AOP. AOP. PRM. A P . ST A" PS T s GSFT tivS P^M. aqp. A OP. PRY. ™M. AQP. MEWT '.Of. '-OP. CPfIL D ?M. RE AQP.CSTFf I ]:=! ; PRM.CSTFr I 1: = I: PRM.TOLEF[ 1 ]: = t.O; PRM.MF:=? : n PM. NCONSIST:=U; AOP.TOLEPf I]:=C; END; ■ 1 ■ : = 3: • 2 ' : = -1; " 1 ' : =-1; ■ c ■ :=-5; ■ 3 ' :=U; ;a ; :=3; fef T ! i7^. CSTF ""SIP CSTF CSTF C3 T " F CSTF CSTF NF: =2; : = 8 1 L ; P :=NIL; • = N I L • ET:=NTL; MAXSTAP:=2; KAXSTAPAQ:=2; LQST:=TRUE: EXTMTY:=FALSE ; EQUIV:=FALSE; CHTF1 :=2P ; PACE:=^; FPF.FC:=NIL; NVAR:=0; ENO:=1; ALTEP:=2; l:= 1 TO 21 DC GIN PEADLN (TABLES) ; RFAD (TABLFS, J) ; IF J=1 THEN PTBL.CCNT[ I ]:=TRUE ELSE PTBL. CCNTf I 1:=FALSE ; PEAD( TABLES, PTBL. SRUL E[ I l) ; J:=1: REPEAT REAP (TABLES. CHRR) ; IF CHP.BO 1 ' THEN PTBL. RHSf I, Jl:=OP.D(CHKR) ELSE READ (TABLES, PTBL. RHS[ I, J]) ; J:=J+1 ; UNTIL PTBL. PHSf I , J-1 1 = 0; END; 69 s. MVALf s. NV M c • «?v AL s. KV *L ! i • My AT, 3 . FV AL =c; =C; =C; i • =n • i ' . ♦ j:=1; 1: = 1; (*FOR T:= *) PESFT(STAB) ; S. NELT:=0; pro t : =1 TC SYKSZE DO RE JIN s.nvalT i ]:=0: S. VTYPFil 1:=1 ; S. EVAL[_IJ:=0: s. VCOSTr i 1:=C ; S. MVALT T 1:=1NVAL; FOP J:=1 TO 10 DO s.NAMFf I, J "):= • • ; FND; S. NAME[ S. NELT+1 ]: = ' FOR ALL S. NAIEl" S.NELT + 2l: = ' PT S. NELT: =S.NELT+2; S. PMO[ S. NELT-1 l:=S. NELT-1 ; S. PNO[ S. NELT 1:=S.NELT; S. VTYPEf S.NELT ]:=2; " 5. NELT " S. NELT S. NELT 3. NELT-1 S. NELT-1 S. NELT-1 -F NOT' EOF (STAB)' THEN S : = S T .A B ; ^FSFT (DF7LE1 : 7F NOT ^CFfDFTLF) THEN DS T : =DFTLE : END; (* ■i)a) D z) ii) i) a) 'O a) a; ai a) a) tjoj i).i) i) a; a) a) a) a) a) a) a) a) a) a) a) a) a) 3) a) a) a) a) a) d) a) d> a) a* a) a) a) j) a) a) a) a) a) a* a) a) 7)a)oM7)a)d)7>a)a)7)a)a)z) i)a>aV')a)7) NEWG i)al ?>i)a) ;) i)ri),j) i) a) tin) 1) 1) a) a) a) a) 2) u) a) a) 1) a) a) a) a) t) a)a) (i)f7)(i)uJa)(i)^(i)(ZJ(3)^.O^^d)^(i)^(j)oDUT U APH STRUCTURE jia) 2) z)ai a) 7^1) iVrt D zj a) 2) aJ a) a) a) a) a) a) i) a) a) ^ PROCEDURE GIN(G:GPTR) ; BE "IN G: =GFILE; GET ( 1FTLE) ; r NP; ( * i i> a) 7) il 2) 1) a) a) a) a) 1) a) a) j) 1) a) 1) a) a) a) a) a) a) a) a) a) a) d) a) a) a) a) a) a) a) a) a) a) <7J^a)'l)a)'7)ia)a)fi)a)i)d)a)d1a)ii)a)^J) 7)o^a)a)(iJa)a)a) 1) ))i)a)i) Ai^'Tj GOUT (G:GPTR) ; OUTPU"" GRAPH STRUCTURE •1; a) 7) -i) i a) ?) oV d a) oj i) t) i) 1) T)ri)i) a) a) a) a) '7) a) a) a) 7) 1) (i id id a)u)j) a) a)ajajaza) a) a)a)ajd)a)<2)a}a)a)a)a>daja)a)a)a) ?a)d)a)a7<7)d)d)a)a>a) 2)a)a)a)a)'S'7)aia)d>iDd) PRINT METAD 3d)a)dl)i)i)dV3a)a)a)i)3a)d>a)a)a)i)3a)rtfa)^ (♦EXPLN*) PROCFDURE PMETAD; VA? I:TNTE3FR; 3FGTN WRITFLN (OFILE, »THF SELECTED M ET A- SELECTOPS ARE: 1 ): WPITELN (CFILE, • MS TYPE FUNCTION F1C FOR I; si TO KST.NMST DO BEGIN WRI^E (OFILE T, 3 ' ') * WRITE [OFILE, §J NAHF[ Msf. SYMPTRf M ST. PTR f I ] ] ]) ; OV FOCDV) ; ^ND: WRITE OFILE, S. NAME[ MST. PNOI" MST. PTR[ I J ] ]) ; WHITE OFILE, • = • MST . V AL [ M ST. PTP[ I J 1 : 3) I WRITE (OFILE, • » ,MST. PlCOVr MST. PT9T I 1 ]:5) ; WRITE (OFILE, ', • , MST. FOCOVT M ST. PTRf I 1 J 5 S) ; WFITELN(OFILE) I ^N D ; ( * i) a; i) a) a) a) i) z) j) a) a) a) a) a) a) a) J 1) a) a) a) a) t) a) a) i fi i) a) a) d) d) a) d> a) a) i") a) a) a) '?• ENTERP i) (?) i) 3) 7)1) i) i) fi) i) j) a) i) i) a) a) a) d) a) 'i) j) a) a) j) a) id a) a) 3 il a) o) t) d) a) i) a; a) j) a) rfl a) a 1 a' o) J * ) (♦PMFTA*) PROC^D!!?? FNTEPP: LABEL 1,2,3,4,5,6,7,8,9; TYPE NTYPE = PACKED ARRAY[1..11l OF CHAR; Vt.P N', *E ; AFRAYT 1.. 2H I OF NTYPE; BUF : A3RAYP..80 1 OF CHAR; I, J, K i ,K,L,M,3LEN : INTEGER; GPTR ; PROCFDURE PDCM; VAP- I, J, KrINTEGER; BEGIN WRITELN (OFILF. ' . COST ' ,' MIN • , • MAX WITH S DO FO n I:=1 TO NELT BEGIN NAME i • f DO ', ' NAPG • , ' STRUCTURE') ; TYPE • , m WRITE (OFILE, NAME[ I 1,N , VCOSTfl ]:6,1VAL[ I ]:5,EVAL IF VTYPZf I 1 = 3 THEN ARG[ I 1:4, VTYPE f 11:5) ; FOR J:=1 TO DST.NELE DO IF I = DST. PNO[ JJ THEN BEGIN FOP K:=0 TO MNVAL DO IF K IN DST.PREMfjl THEN WRITE (OFILE. K:2) ; WRITE(OFILE,' => * ) ; WRITFLN (OFILE) ; END; END; (*?DOM*) PROCEDURE PRINTPS; VAR 7, J: TNTEGFF; REGTN WRITELN (OFILF) ; WR Tm FLN (OFILF ; FOR K:=C TO MNVAL DO IF K IN DST.CONSLJl WRITE (OFILE, K:2) ; WRITE (OFILE,' ; ' ) ; END; 'HEN WRITE (OFILE,' 'OR I:=C TO 1C DO IF I IN TRACE HEN w n lTF(OFILE,I: 3) ; WRIT?.LN_{OF ILE) ; DC WRITE(CFILE, ' *OE I:*0 TO 1C TRA3E=') ; STOPS=« ) ; w 72 IF I IN STP THEN WRITE(0PILE,I:3) ; WITELN (OFILE) ; IF PRULE THEN WRITE (OFILE, • PRINT ROLES AND ROLE NUMBERS'); WRITELN (OFILE) ; W^TTELN (OFILE) : WRITELN (OFILE-* VARIABLE NATE ', VTYPE' • VCOST'); FOR I:=1 TO S.NE1.T DO IF (S. VCOSTr I ]<>C) OR (S. VTYPE[ I ]<>1) THEN BEGIN WRITE (OFILE, • •) ; FOR J:=1 TC 10 DO WITFlOFILE^S.NAMEf I. J 1) ; WRITE(OFILE, • •) : WRIT FLN (OFILE, • • ,S.VTYPE[I 1: 1 , S. VCOST[ I 1:9) J END: WPITELN(OFILE) ; WRITELN (OFILE, ' AQPAFMS', • ', VLPARMS' ) : WRITE (OFTLE, 1 ',' AQKAXSTAR = ', AQP. MAXSTARAQ : 3) ; WRTTE(OFILE, • •) ; IF AQP. LQST THEN WRIT£(OFILE,« LQST 1 ) P LSF WRITE (OFILE, ' ') : WRT^E (OFILE, • N30NSIST = ', PPK. NCONSIST : 3. ' ALTER = •, PRM. ALTER : 3) ; WRITELN (OFILE, • VLMAXSTAR = • ,PRK . H A*STAP : 3) ; WPIT C LN (OFILE) ; WRITELN (OFILE, ' AQCRIT ',' AQTOLERANCE VLCRIT' , VLTOLERANCE') ; FOP I:=1 TO 6 DO WPITELN (OFILE, • •, AQP. CSTF[ I 1 : 2 . ' », 2, ' ' , PRM.CSTFfl ] :2, ' AOP. TOLF D [ II:? .TOLm 11:5:2) ; WPITFLN (CFTLE) ; WITFLN (OFILt, • NBR OF CPU: AQNF = •, AQP.NF:3, ' VLNF = • , PPM. NF:3) ; WPITF (OFILE, • NEW FNCTNS: MFTATRIM = • , MST. MET? TRIP. : 3) ; T F P^. v .. EXTMTY THIN WRITE (OFILL, ' SXTMIY 1 ); IF P? v j.FQniV THEN WP T TE (OFILE, ' EQiIIV ) ; WRITELN (OFILE) ; END; (♦PPTNTPS*) PROCEDURE GETNUM(VAF J: INTEGER; VA? T : TNTrSTF) ; LAP^L 1,2; ViP N^G : EOOL^AN; BEGIN V?G: =FALSF; 1:=^; WHILF J < PL EN DO BEGIN J:=J + 1 ; IF EUFf J 1='-' THEN N EG : = T F U F ; IE (BtTFr J 1 II. [ ")•. . «9« ]) AND (NOT (BUF[ J-1 1 IN [ * 0* . . ' 9 ' , ' X ' 1) ) THEN GOTO 1 ; ^ND; WHILE (JOBLEN) AND (3UF[ J 1IN[ 'C .. • 9« 1) DO 3E JIN I:=I*1C+CPD (PMF[ J 1) -ORD (• C ) ; J:=J+1 ; END; IF NFG THEN I: =-I; END; (*3ETt;UM*) 73 NA NA NA MS NA NB NA V* NA NA NA NA NA NA NA NA via, NA NA NA NA NA NA NA NA NA NA NA IF PAPA PU TL FO PL WH J: HE rcw 1 2 3 U 5 6 7 3 Q r 11 12 13 27 28 17 18 19 2C 21 22 23 2U 25 26 m 15 16 NFlLF ITELN R PAP EG (CF f; PLZN: *T BLF :=C; E NOT GIN RLES: GETCF END; TP ACE AQCUTF1 AQ>.AXSTAP AQTOLEPANCE AQCPIT AQNF VCOST VLKA.XSTAF VLTOLEFANCE VLCPIT VLNF MCONSIST ALTEP PRULE LOST QUIT HELP PA RAM PARAMETERS STP QUICK DETAIL EXPLAIN BRIEF VT Y PE PRINT SETATRIH = r THEN (OFILE, 'ENTER .V, ' =VALUE TO TLB) ; =ri TO 8C DO Nl: = « •; PECS (I) DO =RLEN+1; SP(BUF[BLSN ]) ; RULE SEE OP TO SEE RULE' . CNG.PABB*.. 1 HELP OP QUIT 1 ) fM(J,I ; UF[ 11 IN r * • . . » 9 » 1 THEN GIN G:=GSFT; WHIL* GO NIL DO IF G. RNC=I THEN GOTO 1 ELSF G:=G. NXTN; G:=STAR; WHILE GONIL DO IF G.RNO=I THEN GOTO 1 ELSE G:=G. NXTN; G:=PSTAP; WHILE GONIL DO IF G.PNO=I THEN GOTO 1 ELSF G:=G. NXTN; G:=COVSET; WHILE GONIL DC IF G. RFO=I THEN GOTO 1 ELSE G:=G. NXTN; 7U 1: 3: S: 1 • 2: H ': 5: 6: 14: • Ml ipt • n» i p » 15: 7 ,2> G:=RESTLIST; WHILE GONIL DO IF G«FNO = I THEN GOTO 1 ELSE 3:=G. NXTN; WRITFLN (OFILE, 'PULE', I, ' NOT FOUND 1 ); GOTO 2; PGP.APH (G, S) ; GOTO 2; END (*TF 3UF IN*) ELSE FOR K:=1 TO 28 DO BEGIN EOF K1:=1 TO U DO IF BUFr K1 1<>NAME[ K,K1 1 THEN GOTO 3; GOTO 5; END; WRITSLN (OFILE, 'TPY AGAIN') I GOTO 2; CASE K OF IF KG THEN TRACE:=TRACE-r RBS (I) ] ELSE ^RACE:=rFACE + r ABS (I) 1; A0P.CUTF1 :=I; AQ n . MAXSTAPAQ:=I: AQ^.TOLERr I 1:' = L/1C0. ; IF I>C THEN Agp.CSTFr I 1: = L; AOP. NF:=I; BEGIN IF BUFT 7 1 IN [ 'M' , 'R' ,' D' ,»P' 1 THEN BEGIN CASE BUFf 7 ] OF PMETAD; G:=RESTLIST; PDCM; G:=GSET END; (♦CASE STMT*) IF BUFf 7 1 IN f'R'/FM THEN WHILE GONIL DO BE TIN PGEAPH (G,S) ; G:=G.NXTN ; * END; END (*IF*) ELSE BEGIN WRITSLN (OFILE, WPITELN (OFILE, WRITELN (OFILE, WRITELN (OFILE, WRITELN (OFILE, END; END; MS7. METATRIM: =1; .: BEGIN L:=0; M:=0; FOR J:=1 TO ELEN IF BUFf J ]=• (' L:=J+1 ELSE IF BUFr J 1=') ' THEN M:=J-1 ; ENTER PRINT X WHERE X IP IS* PRINT META DESCRIPTORS' PRINT INPUT DECISION DOMAIN INFORMATION') RESTRICTIONS') ; ULES' ): DO THEN 7^ 8: 9: 10: 11 12 13 27: 28 17: 6: 19 27 23 2U 2 C IF M*L = THEN BEGIN WRITELN (OFILE, 'INVALID SYNTAX') ; GOTO 2; END: FOR J:=1 TO S.NELT DO BEGIN FOR K1:=L TO M DO IF BIJFrKi ]<>S.NAME[ J,K1-L + 1 1 THEN GOTO 8; GOTO 9; END; WRITFLN (OFILF, 'DESCRIPTOR NOT FOUND IN STAB'); GOTO 2; IF K=7 THEN S. VCOSTT J ]: = ! ELSE s. VTYPFr J ]: = I; GOTO 2; END: (*CASE 7*) PR H, MAXSTAR:=I: PRfl.TOLE?r I 1:=L/100.0; IF I>0 THEN PPK.CSTFf I 1:=L; PPM.NF:=T; P?.M.NCONSIST:=I; Pan. ALTFP:=I; T F BUF[7]<>* • THEN PHULE:=FALSE ELS E PP.ULF:=TRUE; IF BUFf 6 ]<>• • THEN AOP. LOST:=FALS E J\QP.LQST:=T''UE; GO TO a ; BEGIN FOR I:=1 TO 28 DO BEGIN FOP K1:=1 TO U DO IF BUFf K1+5 1<>NAME[ I r Kl 1 THEN GOTO 6: FYPLN (100*1) ; GOTO 7; END: FXPLN (18) ; WRITELN (GFILF. ' THE VALID PARAMETERS ARE:'); FOR I:=1 TO 28 DO WRITELN (OFILE, NAMEf I ]) ; FND; (*CASE 18*) NT PS PRIN* IF I<0 THEN STP: = STP-[ ABS (I) ] ELSE STP: = STP + f ABS(I) ]; TPACE:=r 1; BEGIN TRACE:=f 1. . 1C ]; STP:=r ]; END; BEGIN TRACE:=r 1.. 10 1; STP: = r 1. .10]; END; GIN TRACE:=f 3,9,10 ]; END; BEGIN T 76 STP:=f 10 1; END END: (*CASF STMT*) GOTO 2; U: *. END* (*a)^i)a)i)'i)i)(i)d)u)i»a)a)d)a)a)'D'?)aia)a)a)(i(?a) ^.^^d)<3(id)a)d)d>d)(ia)d)a)a)a)d)cfl^S^d)(ifi)flia)^d(i)ia)SS(d(7)d)d)^Sd)d)^i^^ii^5'fi SO UT ; OUTPUT SYMBOL TABLE ON STAD i> 3 d aV]) i) ']) J aH a) a) ^ i ^ a>a) d a) a)d> a) a) a) * a) a) a) a) 3 a) * ) (*FNTERP*) PROCEDURE SOHT; VAP I, J: INTEGER; st? n • =s • PU m (STAB) ; ^WPITFtDFILE) ; DFTLE:=DST; PUT(CFILF) ; ^ND; (*i)J^i)j)^a)a)d)a)a)d)(Ba)a)^ PROCEDURE ADDCONS (G1 ,G2:GPTR) ; HEEL 1,99; VA" I, J, K,L: INTEGER; BEGIN (♦ CONSEQUENCE IS IN GSIZF NODE ♦ ) FOR J:=1 TO GSIZt DO IF (G1 . PNC[ GSIZF ]=G2. PNOr J ]) THEN IF INSIDE (G1.PN0[GSIZE ],G2. VALf J ],G1. VALfGSIZF ],TRUF) THEN BEGIN I: = 1; WHILE 32. LNK[J,I ]<> n DO BEGIN IF G2. ASSGNf G2. LNKf J,I ] ]<>G1 . LNK[ GSIZE, I ] THEN GOTO 1; I:=I+1; END; f*FOR J*1 G2. VALT J 1: = G1 . VALTGSIZE J; (♦CONSEQUENCE ALRFAD i M9; END; IOTO <*9; Y IN G2, RETURN*) J*) (♦CONSEQUENCE NOT IN G2 , T:=1; WHILF G2. LNKf 1,1 !<> n DO I:=I*1 ; ADD TO G2*) G2 , P \'0 G 2 . V A L G2. V3L =G1. PNP =G1. VAI =G1. VBL G2 1 OPDIR?r T 1:=G1. J ■ = 1 GSIZF GSIZE ' GSIZE ORDIPR['GSIZE 1; (♦ADD SFLFCTOR TO G2*) WHIL C 31. LNKr GSIZE, J 1<>0 DO BEGIN G2. LNKfI,J 1:=G1. ASSGNTG1. LNKf GSIZE, J ] ]; L:=1 ; WHILF G2. LNKrG2. LNKfI,J ],L 1<>" DO L:=L + 1 : G2.LNKTG2.LNFf I, J ],L1:=I; J:=J+1 ; END; 99: END: (*5iVJi)3<3iVja>i)u>d)a)d)3d SUDG1 (G1.G2:GPTR, ALLSUBG: INTEGEPjVAR F:CPT?) : BOOLEAN; DETERMINE IF 31 IS SUBGRAPH OF 32. SUBG1 FINDSTHE FIRST MATCHING SELECTORS CF G1 AND G2. SU3G IS CALLED TO MATCH THE PEST OF "HE GRAPH. A BACKTRACK ARRAY LIST IS MAINTAINED TO FACILITATE BACKING U? IN THE SPANNING TREE IF TWO NODES DONT MATCH. LIST CONTAINS THE NODE NUKEEP. IN G1, AND THE LINK NUMBERS IN G1 AND 52 p OR EACH MATCH. AT EACH MATCH, ASSGN IS SET TC SPECIFY THE 1-TO-1 CORRESPONDENCE WHICH EXISTS BETWEEN GRAPHS, j>d)di ijz) il^iH^i) id) ali)d) a) a j>d^ ^ (* ALLC *) FDNCTCN SUBG1 (G1,G2:GPTE; ALLS(I31:INTEGER; VAR FtCPTP; INSD: BOOLEAN) : BOOLEAN; LABEL Q 3,1,2; TYPE LAP = ARRAYT 1.. 6^0 1 OF INTEGER; VAP L1.L2.PTR: INTEGER: (*d)d)d)d)a)'7)™i)a)id)d)d)d)'2)(!)d)^ SUBG (G1.G2:GPTR; RECURSIVE ALGORITHM WHICH DETERMINES IF THE TREE WITH ROOT ND1 IS A SUBGRAPH OF THE GRAPH WITH ROOT ND2. i)d)dd)d)d)d)d)d)fiJd)a)a)d)a)j)d)d)a) i)d}^ FUNCTION SUBG (G1,G2 :GPTR; N1.N2: INTEGER) :BOOIEAN; LABEL 1,2,3,4; 78 VAR P,?1 ,1, J,LASTP:INTEGER; DONS* BOO LF AN * FATHFP, L1^L2) ND1, MD2:ARPAY{" 1. .200 1 OF INTEGER; FUNCTION MATCH (P: INTEGER) -INTEGER; VAP N1 ,N2,TMATCH,I, J: INTEGER; BF3IN N1 :=G1. LNK[ ND1[ P],L1[ P J 1; N?: =G2.LNK[ ND2T P1,L2[ P] ]; TMATCH:=0: IF (G1. ASSGNf N1 1=N2) AND (G2. ASSGNr N2 ] = N1 ) THFN TMATCH: =1 ELSE ' (G IF G1.PNC IF (G1 .ASS3N[ N1 1=0) AND (G2. ASSGNf N2 1=^) THFN ' G1.PNC' N1 1=G2. PNOf N2 ] THEN IF INSIDL(Gl.PNOfN1 ],d?.VALrN2 ],G1. VAL[N1 ],TNSD) THEN TMATCH:=2; IF T*A?CF>* THEN IF NOT Gl.ORDIPRf N1 1 THEN BEGIN I: = 1: WHILE G1. LNKf M ,1 ]<>ND1[ P ] DO I: =1 + 1 ; J:*1: WHILE G2.LNKf N2 # J ]<>ND2[ P 1 DO J : = J ♦ 1 ; IF IOJ THEN TMATCH:=C ; END; IF TMATCH=2 THEN BEGIN G1. ASSGNT N1 ]: = N2; G2.ASSGNI N2 1:=N1 ; END; MATCH: =TMATCH; END; (♦MATCH*) PFGIN G1. ASSGN[ S1 ]:=N2 ; ;n[ N2 1:=! " G2. ASSGl SUBG: = FALSE;' : N1 ; EATHERf 1 ]:=C; L1T 1 1:=1; L2riJ:=1; ND1[ Tl: =N1 ; ND2[ 1 1: =N2 ; WHILE POO DC BEGIN WHILE 31. LNKT NDlf P 1,L1[ PI ]=C BFGTN Pl:=FATHEErP 1; IF P1=0 THEN BEGIN StIBG:=TRUE; GOTO 1 ; END ELSE B^GIN DO L2TP 1:=1 ELSE L2[ P 1: =L1[ P ND2C P]: = ND2[_P FAT HEFT P ]:=FA [ NDir P] ] THEN Lir p j:=Lir pi j*i ; NDir p]:=NDir pi 1; IF G1.0FDIRR[ ND1| THER[P1 1; END; END; REPEAT DCNE:=TEIIE; IF POO THEN 79 :n[ND1[ PI ]:=0; N[ ND2[ P] ]:=0; t p BE ^N EGI SU IF IF G2. LNK[ ND2[ P"|,L2[ P ]l = THEN BEGIN DONE:=FALSE: IF LIT P 1=1 THEN BEGIN G1. ASSG! G2. ASSG! END; P:=P-1 : IF POrt THEN IF NGT Gl.ORDIRBf ND1T P ] 1 THEN L2[ P ]:=MLNK ELSE L2fP 1:=L2[P ]*1 ; END ; UNTIL DONE; IF POC THEN CASE MATCH (P) OF IF G1.0RDIRP[ NDlf P] ] THEN L2T P1:=L2[P1*1' ELSE L2f P "|:=MLNK; BEGIN LASTP:=P; P:=P+1 ; FATHERf P 1:=FATHER[P-1 1; L1[ P1:=LT[P-1 1+1; ND1T P]: = NDir P-1 J: IF Gl.CRDTRRf NDlf P] ] THEN L2f P]:=1 ELSE L2rP 1:=L1[ P ]: ND2T P]:=ND2[ P-1 ]; END; BFGIN LASTP:=P; P:=P+1: ^ATHERI P ]:=P- 1: ND1[ P]:=Gl.LNK[NDir P-1 ],L1[P~1 ] 1; ND2Q P ]:=G2.LNK[ ND2[ P- 1 ], L2[ P- 1 1 ]; L1[P]:=1; L2T P 1: = 1 : END END; (*CASE STMT*) END; (♦WHILE*) (ALLSUB3O0) AND (POO) THEN BEGIN P:=LASTP: IF Gl.OBDIFRf N D1[ PI 1 THEN L2T P]:=L2[P 1 + 1 FLSE L2[ P 1:=KLNK; SU8G:=FALSE; IF ALLSUBG=1 THEN ADDCONS ( ;1,32) ELSF ALLC(F,G1,G2) ; GOTO 2; END; D; UBG*) THIS PROCEDURE EPCHES FOP STARTING NODES IN 32* N BG1: =FALSE; (G1. MSELONIL) A N D (G 2 . M SELON IL) THEN F0° L1:=1 TO MST.NMST DO IF NOT (G1. MSEL.CVALr MST. PT^f L1 1 ]> = G2. MSEL.CVAL[MST.PTF[L1 ID THEN GOTO 99; 3C FOP L1:=1 TO GSTZE-1 DO BEGIN G1. ASSGNf Li ]: =T ; G2. ASSGNf L1 1 : = n ; FND; (* n P£SCAN 10 FIND IF POSSIBLE COP P ESPON D5NCD*) FOP L1:=1 TO GSIZE-1 DO IF G 1. LNK|"L1,1 100 THEN BEGIN FOP L2:=1 TO GSIZE DO IFJG2. LNKf L2 # 1 ]<>0) AND (G2. ASSGNf L2 1=&) THEN IF (G2.PNO[L2 1 = G1. PNCf Li 1) THEN IF INSIDE (G1. PNO[ L1 ], (?2. V AL[ L2 ] f G1. VALf L1 1,IN BEGIN G2. ASSGNf L2 ]: =1 ; GOTO 2; END; SD) ""HFN GOTO 99; END; FOP L2:=1 TO GSIZE DO 32. ASSGNf L2 l:=f ; FOR L1:=1 TO GSI7.E-1 DO IF (31. LNKf L1,1 ]<>0) AND (31. LNKf L1, 2 ]<>C) AND(NOT G*» . ORDIPP[ L 1 ]) ?HEN GOTO 1 • FOP. Li : =1 to GSIZE-1 DO IF (31. LNKf L1, 1 1<>0) AND (NOT G1 .0 RDIP RT L1 1) THEN GOTO 1 ; ^0^ L1 :=1 TO GSIZE DO I* 1 31 . LNKf L1 ,1 TOT ^HFH GOTO 1: FOP L2:=1 TO GSIZE DO IF G2. LNKf L2.1 ]<>C THEN IF G1 .PNCf L1 1=G2.PN0r L2 1 THEN IF INSILE (G1. PNOf LI 1. G2. VALf L2 ], G1. VALf L1 l.INSD) IF SUBG (G1,G2,L1 ,L2) THEN THEN BEGIN SUB31 :=true; GOTO 99; END ELSE B^GIN p 0P PTP:=1 TO GSIZE DO BEGIN G1. ASSGNf PTP ]:=0; G2. ASSGNf PT3 J:=0; END; 3T O • = — ? • - i . • •-. I END; Q 9 : ; END; (* i) a) a) -i a) 5) lii<'i>>ii^^iiid(t^A^^^^iid)iididd)dtd^f 0. .HNV».L ] THEN BEGIN IF I>9 THEN WPITE (OFILE, '[X',I: 2, •=•) ELSE WPITE (OF ILE. •[ X',1: 1, • = ») ; IF F.CVALf I ]=[0. .MNVAL I THEN KEITF. (OFILE, •*•) ELSE FOP J:=s TF J I . MVALf ABS (AOP. SLCCri ]) 1 TO S.EVALfABS( AQP. SLOCT I ]) 1 DO N F.CVALf I] THEN 31 WRITF(0FILE,J:3) ; WRITE (OPILE. ' ]•) J NSEL:=NSEL+1 ; IF NSEL>fl THEN BFGIN WRITELN (OFILE) ; NSFL:=1 : FOR J: = 1 TO 5 DO WRITE (OPILE, 1 •) ; END; END; (♦FOR 1:=*) WRTTFLN (OPILE) ; END; ( * i) v 7) i) a) :) j) H J) D a if. t) dldw i)a\o a)n) d>T> da) do) i)aM> d)a)a) j)aJa)u)ii)i)id>d)i)S^d)a)Sia)a)id)iS(i)o)d)^d)(i)(d^u)a)a)i)a)a)i)2)T)'i) AQ (GSUB:GPTR; VL1 tt: BOOLEAN; F 1 ,F2:CPTP; ACTUAL AQ ALGORITHM — MUCH LIKE AQ7 a)n)a)'j) a)a)!2) T) D j) D i) f> i) S t) a) a) ci) a) cD i J) a) 4) oj a) a) a) a) (^ a) i j) a) a>a>J)^a)a)^d&a) a>d)3)'i>da)a)ida)d)'fi'f)a)a)a)d)d)Jd)a)d)da)a)a)i) *) PROCEDURE TRIM (VAR NSTAR:CPTR; 3AXS: X \'TEGE ) ; LABEL 1 ,2,99; ?Y^~ ATYPE = APRS. Y{C, . 300 1 OF CPTP; VAT CA:ATYPE; v : P EAL; NC.I, J.IB,IC:INTiGE2; ( * /) .j) i) ;) a) t) i i a) a) 'd -iVj) 5 1) a) a) a) a) a) a) J) i> d) i j) u) a) a) J <7) a) fi a) t) H a) a) i) cfl a) a) a) a) t) 9 3> iS<$Q)a) i>da)'l)a)a)iaidd>a)a)da)a}^a)a)a)aiia)a)^ia)a)(idia}d^dia)'daS(d(dd D3)d)afa)d)a)a)a)a)d}d) dd)d)a)i)*) FUNCTION COSTF (P:CPTP; CT: INTEGER) : INTFGEP. ; LAB P L *; VS^ T, J, K: INTEGER; I N ? D : 3 n O L E A N ; ;l:5PTP; CTNEG: ROCLEAN; : C^ TR • begin" ( * f*0 S T p * ) IF CT<0 THEN CTNEG :=TRUE ELSE CTMEG:=PALSE; CT:=ABS (CT) ; P. ~OST: =0: CASE CT OF 3: BEGIN G1 : =3SET; K:=r- WHILE GlONIL DO BEGIN IF G1.F? AND (SS IN G1.ESET) THEN BEGIN J:=1: K " = K+ 1 * IF GSUB.MSELONIL THEN EOF J:=1 TO MST.NMST DC GSUB.MSEL.CVALr MST.PTRf J 1 1: =P. CVALr J 1 ; J:=MST.NMST+1; FOR I:=1 TO GSIZF DO 82 2,u 1,5,6 IF (GSUB.COUNTf I 1 = 1) THEN BEGIN GSUB. VAL[ I]: = P. CVAL[ J ]; J:=J«-1; END; IF SUBG1 (3SUB f 3l,0, AQP. FP EEC , TPUE) THEN P. COST: = P.COST«-1; END; G1 :=G1.NXTN; IF (MA?S>1) AND (K>AQP.CUTF1) THEN G1 :=NIL; END; (*WHILF GlONIL*) END; (*CASF 1*) BEGIN FOR J:=1 TO AQP. NVAR DO IF (f C..9MVAL ]-P.CVAL[J 1) <>r J THEN IF CT = 2 THEN P. COST:=P.COST+1 ELSE P. COST : = P. COST* S. VCOST[ AOP. SLOC[ J ]1; END B^ i*CASE 2*) SIN CASE CT CF BEGIN Q: = E1 ' INSD:=T?UE; END; BEGIN Q:=F1; INSD:=TRl'E; FND; BEGIN 0:=F2; INSD:=FAL3E; END END: f*CASE STMT*) WHILE 0<>NIL DO BEGIN IF ((CT=1)AND Q.FQJORjCT IN [ 5 , b ]) THEN FOR I: = 1 TO AQP. NVAR DC IF INSD THEN IF NOT(Q. CVAL[ I ]<=P.CVALr I ]) THEN GOTO 6 ELSE ELSE IF NOT (Q.CVALf I 1*P.CVAL[ I ]<>r ]) THEN GOTO 6; P.CQST:=P.COST+1; Q:=U. NYTC; END; END (*CASE 3*) END; (*CASE STMT*) IF CTNEG THEN P,COST:=-P.COST; COSTF: =P.COST; END; (♦COSTF*) IEGIN (*TRIM*) IC:=1; IB:=1; P:=NSTAR; NC : =r > ; WHILE POSIL DO BEGIN 83 0: =P * IF P.'FP THEN BEGIN NC:=NC*1; CA[ n: 1: = P; P:=P.NXTC; END (*TF P.FF*) ELSE BEGIN P:=P.NXTC; 0. NXTC: = AQP. FREEC; AQP.FREEC:=Q; END; END; (*WHILE PONIL *) C»T NC+1 ]:=CAf NC ]; CAhj:=CAM]; IF N(X = NAXS THEN GOTO 99; I: = 1 : IF HAXS=C THEN GO TO 2 ; POP J:=1 TO NC DC CAT J J.COST:=COSTF (CA[ J ],AQP. CSTFr IC 1) ; (*SOPT ARRAY CA *) FOR I:=IB TO NC-1 DO FOP J:=I*IB TO NC DO IF CAfJl.COST < CAfll.COST THEN EEGIN P:=CAf J 1: CMC! 1:=CA[ I ]; CAfI 1:=P; END; I • =MAXS + 1 * IF AQP.TGLEFf IC 1 = TRUNC (AQP. TOLERf IC 1) THEN X:=A0P. TOLERf IC ] ELSE ' X:=AQP.TOLEB[ IC1* (CA[ NC ]. C0ST-CA[1 l.COST) ; IF ICOAQP.NF THEN rfHILE (CAf KAXS ]. COST >= CA|" I l.COST-X) AND (K=NC) DO I:=I+1 ; (* RETUPN ELEMENTS FROM I TO NC*) FOR J;=I TO NC DC BEGIN CAf J l.NXTC:=AQP. FRFEC; !^QP. FRFFC:=CAf J ]; END; NC:=I-1: IB:=MAXS-1 ; WHILE.(CA[ HAXS l.COST <= CAf IB ] .COST + X) AND (IB>0) DO IB:=IB-1 ; TB:=IB+1; IC:=IC+1: IF IC<=AQP.NF THEN GO ^0 1 : 99: NSTAP:=NIL; FOR I:=1 TO NC DO B^GIN CAf.Il. NXTC:=NSTAR; NSTAF:=CAr I 1; END; FND; begin"" (* place all events into fq and fp sets *) A0:=NIL; IF (F1=NIL) THEN GOTO 99; WITH AQP DO BEGIN 9U 1: ■»3 3: AQT:=NIL; P:=F1 ; WHILE PONIL DO BEGIN P.FP:=TRUE; P. FQ:=TRUF; P:=P.NXTC; END: (* ALLCOATE START OF OSTAP *) DELTA:=1 ; *JSTAR : =NI L * TF AQP.FR£EC=NIL THEN BEGIN NEW (ACP. FREEC) ; ?.0P. FREEC. NXTC :=NIL; END; OSTA»:=AQP. FFEFC; AQT. FRFEC:=ACP. FPEEC. NX TC ; OSTAP. NXTC: -NIL; OSTAR.FP:=TRUE: FOR I:=1 TO AQP.NVAR DD OSTAP. CVALr I J:=rO.. MNVAL 1; (* FIND UNCOVERED EVENT *) E1:=F1: TF NOT (((DELTA = 1) AND (E1 . FP) ) OR { (DELTA = 2) AND (E1.FQ))) THEN BEGIN E1: =F1.NXTC; IF NOT VL1H THEN GOTO 12; IF E1=NII THEN GOTO 12 ELSF GOTO 13; END; s" 2 • sj9 ■ WHILE "E20NIL DO BEGIN (* SEE IF E2 IS IN OSTAP, *) P:=OSTAR; WHILE PONIL DO BEGIN FOP. I: = 1 TO AQP.NVAR DO IF (E2.CVAL[ I 1*P. CVALr I 1) =T ] THEN GOTO 2; GOTO 3 ; P:=P. NXTC; FND; J* WHILE PONIL*) GOTO T; (* F2 IS IN OSTAF, FINE ELEMENTARY STAR CF E 1 AGAT NST E2 *) (* rULTIPLY BY OSTAP *) FOR I:=1 TO AQP.NVAR DO IF E1. CVALr I l<= (r °. .^NVAL]- E2.CVAL[I]) THEN BEGIN D : =OST A p • ' (* PUT CPX FROM OSTAR INTO NSTAP, MPY BF E2 COKPL *) WHILF PONIL DO BEGIN IF AQP.FPEEC=NIL THEN BEGIN NEW (AOP.FREEC) ; AOP. F R~ EEC. NXTC :=NIL; END; R:=AQP. FREEC; AQP. FREEC :=R. NXTC; R.NXTC: =NSTAR ; NSTAR:=R; FOR J:=1 TO AQP.NVAR DO P. CVALf J ]: = F.CVALr J ]; 85 10 7: F T XIT*=R» CV ALT I ] * extnd' (aqp. sLOcr i 1,e1.cval[ i ], E2.cvALr il) ; R.CVALf I] :=FIXIT; P:=P. NXTC; END; (* WHILE PONIL *) END; (* FOE I *) (* NOW APPLY ABSOURPTION LAWS TO NSTAR *) P : = N S T A R ; WHILE PONIL DO BEGIN P.FP:=TRUE; P: = P.NXTC; END; P:=NSTAR; while p<> nil do if'p.fp then BEGIN 0:=NSTAR; WHILE QONIL DO BEGIN IF 0. FP AND (QOP) THEN BEGIN FOR I:=1 TO AQP.NVAR DO IF N0T(Q.CVAL[ I 1< = R.CVAL[ I ]) THEN 5 0TC 4; 0.FP:=FALSE; END; (*IF 0. FP*) Q:=Q. NXTC; END; (*WHILF QONIL*) END; [* IF P.FP *) P:=P. NXTC; END; (♦WHILE P*) (* ABSOURPTION COMPLETE *\ (* TRIM NUMBER OF COMPLEXES *) TRIM (NSTAR ,AQP. MAXSTARAQ) ; (*P£TURN OLIST TO AQP. FREEC *) IF NSTA?=NIL THEN GOTO 1C; P: =0STAR; WHILE P.NXTCONIL DO D : = P. NXTC • P. NXTC :=A OP.' FREEC; AQP. FREEC:=OSTAR; 0STAR:=NST?P ; NSTAR:=NIL; E2:=E2. NXTC; END; (* WHILE E20NIL *) (* UPDATE FP AND FQ SETS *) ?:=0STAR ; WHILE PONIL DC BEGIN 0:=F1 ; WHILE 0ONIL DC B^GIN IF Q.FP THEN FOR I:=1 TO AQP.NVAR DO IF NOT (Q.CVALf I ]< = P. CVALf I ]) THEN GOTO 7; Q.FP:=FALSS; Q:=Q. NXTC; END;" {* WHILE QONIL*) P:=P.NXTC; 86 3: 1 : 21: 22 23 END; (* WHILF PONIL *) {* FINE NEXT F1 TO COVER *) IF 0?TAR=NIL THEN BET, IN E1. FP:=F?LSE; E1. FQ:=FALSE; GOTO 1; END: TRIM (0STAP,1) ; ":=OSTAR; (*LQ3T*) TF AQP.F?FFC=NIL THEN BEGIN NEV(AQP.FPEEC) ; .10 P. PR EEC. N7TC:=NIL; END: *"CR I: = 1 TO AQP.NVAR DO IF (F?=KTL)OR(P.CVALr I ]<>r-'..MNVAL 1) THEN '■OP. FP.EEC.CVALf I ]:=[ ] ELS E AOP."FRFEC.CVAL[ I 1 : = 1" . . MN V AL 1 ; 3:=F1; WHILE QONIL DO BEGIN FOF I:=1 TO AOP.NVAR DO IF NOT (O.CVALr I 1< = P. CVAL[ T 1) THEN GOTO 8; Q. FOi^ALSE; PC I:=1 TO AQP.NVAP DO A0P.F9EEC.CV A L[ I1:=AQP. FREEC. CV ALf I 1 + 0. CVAL!" I lj 0:=0. NXTC; END; (* WHILE QONIL*) OSTAP. NXTC:=AQT; AOT:=OSTAR; IF AQP.LQST THEN PEGIN FOR I:=1 TO AQP.NVAR DO CASE S. VTYPF[ AQP. SLOCf I 11 CF BEGIN FOF J:=0 TC MNVAL DO IF J IN AOP.FRPEC.CVPLr I 1 THEN C PTO 2 1 * FOE K:=MNVAL DOWNTO DO IF K IN AQP. FREEC. CVALf I 1 THEN GOTO 22; FOF L:=J TO K DO AQP. FREEC. CVAL|" I 1:=AQP. FREEC. CVALf I ] + [LI; END; BEGIN IF F20NIL THEN AQP. Ff> EEC, CVALf I 1 : =OSTAR . CV ALT I ] ELSE FOR J:=1 TO DST.NELE DO IF DST. PNO[ J ] = AQP. SLDC[ I 1 THEN IF AOP. FREEC. CVAL[ I ]< = DST. PREMf J 1 THEN R F ^ T N AQP. FREEC. CVALr I 1: =A OP. FREEC. VAL[ I 1 + DSI. CONSf J GOTO 23; END; END END; (♦CASE STMT*) FOP l:=1 TO AQP.NVAR DO CSTAR.CVALr I ] : = AQP. F R EEC. CV A L[ I ]; END; (*LQST*) GOTO 1; (* PASS 2 *) 87 1? } D i $ I 7) I) I) (* GS'JB T. A 1 - •1 \~ ?,F1 T,J, D")NE • ; • : T ^F DEL T A = 1 THEN BEGIN DFLTA :=2; G0 T 1; END; (* FIND BEST COMPLEX IN COVER *) P:=AQT: w'HILE P<> NIL DO BEGIN P. FP: =TR(JE ; P:=P. NXTC; END; IF NOT VI 1 M THEN TRIM (?.QT,1) ; AQ:=AQT; FND; (♦WITH A OP*) D; it <>,a 1 si j)i ij> 2)ri)fi)a>a)f7).])'j)ii)i)(i)f7) idflijJia) J4)a>a)'rtii>d)(J) iiiiaJi i> d> rf) 7> -i* j)t> AQSET]GSFT:GPTR; SETS UP STRUCTURES FOR AQ PROCEDURE. CVAL CONTAINS BIT POS ISENTATICN OF REFERENCES IN GSUB. SLOC CONTAINS INTER TO SYMBOL TABLE LOCATION OF ASSOCIATED DESCRI D TOR did 7>i i) ■Si iidMaJ S i)a) ja)a)(i^a)rda)a)d> a)o)a)C DO BEGIN IF LI.Kf LNKf I,J1,2 l=C THEN BEGIN ink[lnkt I, J 1, 1 ]:=0; cctiNTr lnkti, J ]j:=0; LNKf I, J]:=GSIZE; F1 END; J : = J ♦ 1 ; END; J:=1; K: = 1 ; WHILE LNKf I, J lO- DO BEGIN IE LNKf I, J lOGSIZE THEN BEGIN LNK[ I.K 1: =1 NK[ I, J ]; K:=K+1; END; J:=J+1 ; END; LMKr I,K ]:=0; END; :=NIL; :=MIL; = N T L ' ILE GONIL DO BEGIN ' IF (ES IN 3.SSET) AND (3. FP) THEN BEGIN BR **: FO IF KH F1 G: WH IF • r. 2 , . • as IF SUBG1 (GSUB,G,2,F,TRUE) THEN ;GCTO 4; END; C:=G.NXTN; END: (* WHILE *) (* CLEAR ALL VAL FIELDS OF GSUP *) ? I:=1 TO GSTZL DO GSrjR.VALfl ]:=[ ( . . MNVALl; W (GSUB. MSEL) ; GSUB. MSELONIL THEN FOR I:=1 TO G3IZE DO GSIJB.MSEL.CVALf I }: =f n . . MN VA L ] ; =G.NXTN; ILE GONTL DO BEGIN IF JES IN G.ESET) AND G.FP THEN IF SUBG1 (GSUR,G,2 ,F1,TPUE) THEN ; G:=G.NXTN; END; NX^C: =F1 ; • =F* = G*> ^T " t lF'g<>NIL DO B^GIN IF NOT(ES IN G.ESET) THEN IF SURG1 (GSUB, G, 2 ,F2, FALSE) THEN ; S:=G,NXTN; END; (♦WHILE*) a IN TRACE THEN BEGIN ZXPLN (U) ; WFITELN (OFILE, 'THE C-FDR^ULA STRUCTURE IS: 1 ); PGRAPH (GSUB,S) ; WRITELN (OFILE, 'THERE ARE • , AQP. N V A?.: 3 , • VL1 TYPE VARIABLES XI, * f ..,:<•, AOP. NVAF;2) ; WRITELN (CFILE, • VARIABLES FOLLOWS: •) ; WRITELN (OFILE) : WPITELN (CFILE, • J: = MST".NP!ST + 1 ; FOP I:=1 TO GSIZE DO ARE ASSOCIATED WITH NODES IN THE C- FOR MHL A • , NODE* , » VARIABLE' ) ; IF GSdB.COUNTf I 1=1 THEN BEGIN WRIT'-: (CFILE, • • ) ; K:=1 ; WHIL^ S. NAMEf ABS (AQP. SLOCf J l) ,K ]<>• • DO BEGIN WRITEjOFILE,S. NAMEf ABS (AOP.SLOCf J ]) , K 1) ; K:=K+T; END; IF GSUF. VBLT II THEN BEGIN IF GSrjB. DrjNNlMr I 1>9 THEN WRITE (OFILE, GSUB. DUMNUH[ I 1:2) FLSE WRITE (OFILE, GSUB. DUMNU1T I 1: 1) ; K:=K+1; FND; "Ok L:=K TO 20 DO WRITF(OFILE,' • ) ; IF J>9 THEN WPITFLN (OFILE,' X' , J:2) FLSE WRITELN (OFILE, • X 1 ,J: 1) ; J: =J>1; END; WRITELN CFILE, • A Q IS APPLIED TO THE FOLLOWING INPUT CPXS/EVENT3 • ) ; WRITELN (OFILE, • •,• SET 1'); v • I . 99 SET ?•) ; WHILE FONIL DO BEGIN °CPX (F) ; P:=F. NXTC; END; WRITELN(OFILE, • ', ' F* =F2 * vhile'eonil do BEGIN PC D X (F) ; F:=F.NXTC; END; END; ("T^ACE OF 4*) 3: *: =AQ (GSHB, FALSE, F1,F2) ; IF F=NIL THEN JCTO 99; IF 5 IN TRACF THEN BEGIN *XPLK(5) ; WSITELH (CFILE, • THE RESULTING COMPLEX FPOM THIS PASS IS:'); pcpr (P) ; ^ND; (*T"ACF 5*) ; {* TRANSLATE COVER INTO GRAPH *) J: = 0; Ft? J:=1 TO M ST, KM ST DO GSUB.MSFL.CVALr MST, PTR[ Jl ]: = F.CVAL[ J 1; J: = MST. KMST; FO» I:=1 TO 3SIZE DO IF GSUB.COUNT[I 1*1 THEN BEGIN J : = J ♦ 1 ; GSrjB. VALr I 1:=F. CVALr J ]', END; E. NXTC:=A0P. FPiiFC ; AOP, F?FEC:=F; QQ • } • =p 1 • KHIL^'F, NXTCOSII DO F: =F. N Y TC; p . NX"C : = ^0P. FR^EC; AOP. FPEEC:=F1 ; IE F20NIL THEN BEGIN F: = ^2; WHILE F. NXTCONIL DO F:=F, Nv-rc; F. NXTC: =AQP.FR EEC; VDP. FRFEC:=F2 ; C ND; ::n d ; ( * a) D i) diD tij) jjjioJi i)i) tvj)cb $d)>i)NDSS THEN WRITSLN (OFILF •DOMAIN STRUC TABLE OVFL 1 ); ' :=G. VAL[ 1 1; =G. VAL[ 2 ]; PR EM[ N P LE CONS] NELE PNOf NELE ]:' = G.PNO[ 1 ] ;" FOR I : =1 TO NELE' DO IF PNOf I ]=PNOf NFLE1 THEN IF CC\S[ I ]< = PPEM[ NELE ] THEN PFtKf NILE l:=PREMfNELE 1+ PR EM [I 1; 90 END; (♦WITH*) G. NX^ IXTS:=FREEG; F^FEG: = G; END; ( * r?) a) D d) i) a) 7l 1) a) a) a) a) a) $cDa)a)a)d)(daH9" T BEGIN S. biAMEfI,2 1:=CHP(TRUNC(I/1C) + OED (•O 1 ) ) : S.NAKL'[I,2 1: = CHR (I-THUNC (I/1C) *1^*OPD (»"» » END ELSE S. NAMEr 1,2 ]:=CHH (I+OSUCO 1 ) ) ; PNOfi 1:=I; SLOC[l]:=l; dpnc[ 1 1:=I; END; WHILE NOT FOF(VLIEVF) DO BEGIN NEW (U) ; 0. NXTC:=AQE; A of : = * FAD(VI1EVE,I); IF T>=C THEN 0. cvALr nvip+1 ]: =r 1 1 L T SE oTcVALr NVAP+1 J: =[ 0. . KNVAL ]j FOE l:=1 TO NVAR DO BEGIN READ (VL1EVE,J) ; IF J IN f C . MNVAL ] THEN O.CVAL[ I 1: = [ J 1 ■c lsE 0. CVAL[ I l:-[0.. MNVAL ]; IF JEVALTI 1 "I 1:=J IF J>NVALf I ] NVALf I ]:=J END: PEADLN (VL1 FVF) ; END ; THEN THEM 91 WE MR WR MP. PU IL r* -»-» La Z, IF EN (*PEAD ITLN ( I7FLN ( ITELN ( ITFLN ( TSEG (0 T M E * rCHRR ( CHRP WITH A WITH CA » P TO CHANGE PARAMETERS') ; C TO COVER EVENTS') : V TO ENTER DOMAIN STRUCTURE'); Q TO RETURN TO MAIN LEVEL'); , 'Q' , • E' , • P' ] THEN OF •C •FO^ THESE D; EVENTS OFILE, ' ENTER OFILF, ' OFTLF, • OFTLF,' FILE) ; CKPR) ; IN [ 'C OP DO S DO SE CHRP FNTEPP; FNTFRD; BEGIN WPITELN (OFILF,' ENTER DECISION NUMBER OF SFT TO BE COVERED 1 ); PUTSEO GETSE: pfadj: write: SETS OR PUTSEf getsf; agnst WHILE beg: LNloFfLE. 'AGAINST WHICH SETS, ENTER NUMBERS', ENTER -f TO COVER AGAINST ALL'); IG (OFILE) ; !G I FILE) ; ■ ! =y :n NOT EOLN(IFILE) DO >EAD (IFILF, I :f I=-1 THEN E F1 :=N F2:=N Q: = AQ AQ^: = WHILE REG P Q F IF (F EEG F W w P PfTN AGNST:=[ r >,.MN VAL }-[ ES 1; GOTO 3; END; 3NST:=AGNST+r I ]; ND; il; IL; E; N T L * o<3nil DO IN :=Q.NXIC; F ES IN Q.CVAL[ NVAR+1 1 THEN BEGIN Q.NXTC:=F1 ; F1:=Q; END F^ Q.CVALf NVAR+1 ] <= AGNST THEN BEGIN Q.NXTC:=F2; F2:=Q; END LSE EG IN Q.NXTC: =AQE; AQE:=Q; END; ND; 10NIL) THEN. IN : = AQ (G,TRUH,F1 -F2) ; RITELN (OFILE, • OUTPUT COMPLEXES FOR SET',ES:3); : = F ■ HILE QONIL DO BEGIN P • =Q • PCPX*(Q) ; Q:=Q» NXTC; END; 92 P.NXTC:=FPEEC; FREEC:=F; END; IF F10NIL THEN BEGIN P:=F1; WHILE P. NXTCONIL DO P : = P. N XTC ; P. NXTC:=AQS; A0F:=P1 ; END; IF F2 <> NIL THEN BFGIK P:=F2; WHILE P. NXTCONIL DO P:=P. NXTC ; P.NXTC:=AQE; A0F:=F2; END; END; {♦CASE C*) •0' : GOTO 1 FMD; (♦CASE STtfT*) qnfn 2' 1: F:=A0E: WHILF F. NXTCONIL DO F: =F.NXTC; F. N>'TC: = A0P. FP^EC; A OF. FHEEC:"=AQE; "ND; ( * 7) a) i) i) (?> >» a) D u) o) D t) a) T) I) a) i) a) a) i) a) a) a) a) a) a) a) a) i) a) a) a)d)tfia)a)^^(Dd)^ia)*^^^d)n)Sd)a)a»^ri^d)^^3(i)^a)a) i)a) 3Vi) ^t)i) NSWGP(GN,G1 tGPTR; FIND A NEW GFAPIi WITH MNODL SFLECTCFS IN IT. COUN" 1 IN C PECOPDS THE NUMBFR OF TIMES WHICH A SELFC T C?. HJS SEEN USED IN PPEVIOUS GRAPHS. COUNT IN GN INDICATES Tf! E NflKBEB OF OCCURRENCES ^F THIS V3I, IN THE NEW GP (*VL1 ♦) PROCEDURE 'TFWGP (A LTEF : IN TEG EP ; GC.G1: GPIR: VIP SLSTrGP""^ LAP'L 1 ,2 ; V?P I, .7,K,L, K,CPTR:INTEGER; TANDID: ARRPYT 1 . . JSIZF 1 OF INTEGER; G :GPTP: SEGIN (♦NEWGP*) (♦GENERATE A LIST OF ALL SELECTOPS WHICH 1AY PS CO NNECTFD TC "HF GRAPH. GC IS OLD GF.A!>H, G1 IS E V EM WHICH IS BEING COVERED COUNT=1,HDE FFOM OLD GP APH COUNT=2 NODE IS VARIABLE CONNECTED TO OLD G PAP H CCUNT=? NODE IS NEW SELECTOR *) ppq i:=1 to GSIZF DO TF G r .CCUNTf I ]<>n T HEN I? GC. PNO[ I 1C ) THEN BEGIN J: = 1; WHILE G1. LNKfl, J ]<>") DO ') ; 93 BEGIN IF GO.CCUNTfGl.LNKr I, J] ] = C THEN GO.CCUNTrGl.LNK[I, J 1 ]: = 3; J : = J ♦ 1 ; END; END; PCS I:=1 TO GSIZE DO BE3IN IF (GCCOIINTC I 1 = 3) THEN BEGIN CPTP:=CPTR+1 ; CANDIDrCPTP 1:=I; END; IF GO.COUNTr I ]<>1 THEN GG.COUNT[I 1:=C ; END; (♦SOFT CANDID APRAY IF ALTER < CPTP*) IF (ALTEROO) AND (A LTER S.VCOST f GO.PNOfCANDIDf J 11 jj 3R (S. VCOST[ GO. PNO r CANDID [ Ijil=S.VCOST[G0.PNOfCANDID r J ] 1 ]) AND (S. NARGf GO. PNO[ CANDID[I ] 1 ]>5.NARGr GO. PNO[ CANDIDf J ]1 ]) TH*N BEGIN L:=CANDIDf II; CANDID[ I ]:=CANDIDf J ]; CANDIDf J 1:=L; END: (*F0R1 N 17 * GRAPH FOR EACH ALTERNATIVE SELECTOR*) w: =0 ; FOR I:=1 TO CPTR DO BEGIN NFWG (G) ; c • =rn • G.'cOUNTf CANDIDf I ] ]:=1 ; G. RN0:=CPULENC-1; J: = 1; IF 3, PNOr CANDIDQI ]]>*) THEN- WHILE Gl.LNK[CANDir G. COtINT[ G1. LNKr CftNDIDfl ], J ] ]: =1 ; J: =J+1 ; END; FOR J:=1 TO GSIZE DO IF (G1. INKf J, 1 1<>^) AND(G. COUNTf J ]<>0) THEN BEGIN K: = 1; L: = 1; WHILE Gl.LNKf J,K]OC DO BEGIN IF G.COlJNTr G1.LNK[ J,K 1] = 1 THEN BEGIN G.LNKf J,L ]:=G1. LNK[ J, K ]; L:=L+1; END; K:=K+1; END; (*IF G1*) G. LNK[ J,LJ: =0: IF JG.PNOfJ ]<0) AND (L=2) THEN BEGIN G. NXTN:=FREEG ; FREEG:=G; GOTO 1; END; END; (*FOP J*) G. NXTN:=SLST; SLST:=G; Dfl ], J l<>0 DO 9U 1: 2 : EN (*t) oHd) PR i)o)i) o) 1) i (*!,' PROC L A BF VAP ' BSGI J: WR IP FO WE WP ?0 IF (ALTEPO^) AND(M> = ALTER) THEN GOTO 2; END; (**0R I*) D: rj)oY;i)f7)i) PGRAPH; INTS A VL2 FORMULA j)a)d)j)a)a)a)d)a)d)a)d)i)a)d)(i)(i)d) i)o)a)tt>a)a)a)a)fi)d)a)a)aJ : i)o)a)'j)o)o) i)d)(io)d)a)a)5(2)d)(i)a)So)Jd)a)a)a1(j)ci)a)a)^oia)a)o)a)u)2)T)*) EWGP*) FDHFE PGRAPH; L 1; I, J, K,L,M, NSEL: INTEGER; N TL TTE (( G.F' . .OFILE, ' RULE • ,G. KNO: 5) ; G.FSETOr 1 THEN WRITE (OFILE, « EVENT SETS:'); P I:=0 TO MNVAL DO T F I IN G. ESET THFN WPITF (OFILE,!: 3) ; TTE (OFILE, ' COSTS ( l ) ; P I:=1 TO PRP.NF DO WRITE (OFILF,PRK.CSTFr I 1:2) ; ITF(OFII.E, •) •) ; "F1. NF ITF (OFILE, C.COST[ ABS(Mm. CSTFf I 1) J: 5) ? I:=1 TO PF1. NF DO IF G.COSTf ABS (PPS.CSTFf I IO-1 OO THEN >LS in NS IF wniTF(CFiLE,r : 5) TTFLN (OFILE) ; "PRULE THEN WITH G DO BEGIN "FOP t :=1 TC 3SIZE DO IF V t- L T I l AND (G. LNK{ I, 1 1<><") THFN BEGIN J:=J*1: rur.NUNi ll:=J; END; FO° I:=1 TC GSIZE DO I" 1 (LNK[ I, 1 ]<>C) THEN IF (NOT VBLfI])OR VBL[I] AS D ( V AL[ I ]<>[ 0, . MN V? L ]) THEN F. EG T N NSEL:=NSEL+1; WRITE (OFIL' 7 , 'f ') ; L:=Ab? (PN0[ I 1) : ; FOP J:=1 TO 10 DC IF S. NAME J 1<>' • THEN WRITE (OFILE, S. NANEf L, J]); IF NOT VRL[ I 1 THEN BEGIN WRITE (OFILE,' (' ) ; J: = 1; WHILE LNKf I.J ]<>0 DC BEGIN m : = LN Kf I , J 1 ; FOR K:=1 TO 1C DC IF S. NA«ErPNOr M 1, K ]<>' ■ THEN WRITE (C b ILE.S. KAJlEf PNO[M ],K 1) ; IF DUMNUrtf M . ]>9 THEN WRITE (OFILE, DUMN'Uir M 1:2) ELSE WRI^E (OFILE, DUMNUMf M 1: 1 ) ; J:=J*1 IF LNKf I.JIOC THFN IF PNO[I1>0 THFN WRITE (CFILE, • , ») ELSE WHITE (OFILE, ' . •) 95 ELS E IF PN0[I19 THEN WRITE (OFILE, DUHNUPir 11:2) ELSE WRITE (OFILE, DUMNUM[ I 1:1) ; IF PNO[ I ]>0 THEN IF S. NVALrPNDf I ]1<>S. MVALLPNO[ I 11 THEN IF VAL[I.Wc. .KNVAL ] THEN YPE[PNO[ II 1=3 TH :=S.EVAL[PNOr II 1 M IN VAL[ I 1 THEN =3 THEN +1 DCWNTO S.NVSL[PNO[ 111 DO WRITE (OFILE, • * ') ELSE BEGIN IF S. VTYPE[PNO[ I FOR M:=~ IF BEGIN WRITE]OFILE,M:2) ; GOTO 1; END * FOR M:=S. MVAL[PNOCI J ] TO S. NV AL[ PNO[ I ] ] DD )R M:=S, MVAL[PNO[ 111 IF M IN VAL[ I 1 THEN WRITE (CFILE,M:2) ; •) ; END; IF PNOf I JO THFN WRITE (OFILF • SAJ'E') ; WRITF (OFILE,' ]' ) ; IF NSEL>=U THFN BEGIN NSEL: =0 ; WRITELN (DFILF) ; PUTSEG (OFILE) ; WFITE (OFILF, ' END; END; (*LNK<> A *) END; (♦WITH*) WPITELN (OFILF) ; IF G.MSELONTL THEN FOP I:=1 TO MST. NMST DO IF vi.WSEL.CVALr HST. PTSr I n<>[0..MNVAL 1 THEN BEGIN I* I>9 THEi: WRITE (OFILE, T MS' ,1:2, ' = •) ELSE WR" r I tr (CFILE ' {" K S ' 1*1 *='); FOR J: = S. MVAL[ MBT.SfMPTEf MST.' PTR[ I HI TO S.NVALf MST.SYMPTR[ MST. PTR[ I 1 1] DO IF J IN G.BSEL.CVALraST. PTRfl ]] THEN WEITE(OFILE,J:2) ; WRITE (OFILE, • ]•) ; END • WRITELN (CFTLI) ; PUTSE1 (OFILE) ; END: (*dd)i)a)i"fld)T)^i)d'Ji;tfa)a/'i)d)cfia>$a)2 THEN VPTTELN (OUTPUT, 'ENTERING FI NDRC W ' , B, E) ; FOP. I: = 1 TO S.N SIT DO BE 3IN FOR J:=1 TC E-B + 1 DO IF S. NAMEf I, J ]<>BUFf3-1+J ] THEN GOTO 1; GOTO 2; 1: ; END; (* FOE I *) 1:=^; 2: TM?:=I; END; FIXSYM (I, J:INTEGER) ; ADD A NEW ROW TO SYMBOL TABLE ii % D a) a) i 'i) f) $ a) a) i) ')) a) a) a) a) a) a) a) a) a) j) a) a) a) a) i) a)'i a) &*) (* FINDROW *) PROCEDURE FIXSYM (I, J: INTEGER) ; VA° K,L : INTEGER; C : C h A R ; BEGIN IF TRACE>2 THEN WTTELN (OUTPUT, 'ENTERING FIXSYM', I, J) ; (* ADD ROW TO STAB OR ELSE REPLACE DESC IN BUF *) S, NELT:=S.NELT+1 ; T " S N E L T > S Y K S % E THEN WPITEfOFILE, ''SYMBOL TABLE OVERFLOW, '); FOR K:=I TO J DO S. NAME[ S.NELT, K-I*1 1:=BUF[K ]• S. PNOf S.NELT ]: = S.NELT; C U P S : = I ; IF TEACE>2 THEN WRITELN (OUTPUT, 'LEAVING FIXSYM' ) ; END; (* FIXSYM *) B*GIN (* TOKEN*) T 15 AC": -2 ; IF T"ACE>2 THEN WP.ITELN (OUTPUT 'ENTERING TOK E N' , CUPS, C I YPE , SHOW , EFR ) ; 1: IF RUFfCURS] = '?' THEN BEGIN ILINE; 97 cu p s* = 1 • FOR i:=1 TO 1CC DO PUFri]:=' '; I:=1: WHILE NOT PEOS (I) DO BEGIN GETCHRP (BUF[ I ]) ; I:=I+1 ; END; (* WHILE *) END; :*if DUF = •?» *) ) AND (BUF[CURS !<>•?• ) DO J* WHILE(BlJFrCU?S 1= • CU^S^CUPS + I ; IF BUFf CUPS ]= • ?• THEN GOTO 1 ; CTYPE := DELIMTP; FCIIPS := CUPS; IF (BUFf CUPS l<=«Z f ) AND(BUF[ CURS "]> = • A 1 ) THEN BEGIN CTY?E:=DESCTP; LCUFS:=CUBS: CUP.S:=CUFS*1 ; GOTO 2; END: IF (BUFf CUPS ]>='C ') AND (BUFf CURS 1<= , 9') THEN BEGIN IF NG m (BUFrFCUPSJ IN |' , A , .. , Z»]) THEN CTYPE := DIGITTP ELSE CTYPE := DUMMYTP; CUPS:=CUPS+1 ; GOTO 2; 2ND; ERR:=0; CASF CIYPF OF P 1? C T N CTYPE: =OPD (BUF[CURS ]) ; CUPS:=CUPS+1; END; BEGIN FINDPOW (FCURS,CURS-1 f I) ; IF IOC THEN s RO v : = i ELSE BEGIN (* FIND ASSOC FN IN SYMTUB *) FINDPOW (FC UPS, LCU PS, I) ; IF K>r THEN BEGIN S.NELT:=S.NELT+1; SROW:=S. NELT: FOR J:=1 TO 10 DO S,NAME[ S. NELT,J 1:=» »; FOP. J:=PCriRS TD CUPS-1 DO S. NAMEr S. N2Lr,J-FCURS+1 ]: = BUF[ J ]; S.DPNOf SROW ]:=I; END (*I<>0*) ELSE BEGIN FIXSYM (FCURS,LCURS) ; GOTO 1; END; END; (* IF TO C ELSE *) END; (♦CASE DUMYTP *) BEGIN FINDPOK(FCUPS,CURS-1 , 1) ; IF 1=0 THEN 9fi 3E FIXSYM (FCURS,CURS-1) ; GOTO 1; END ELSE SROW:=I; "\D; ' DESCTP *) (*CAS GIN CA (* WR EN (* EN ( * 1) 4) l) S P o W : s • FOR f:=FCU?S TO CURS-1 DO SPOW:=SROW*10+ ORD(BUF[I])-ORD(*n«) END D; CASE S m MT *) ERP OF TTELN (OUTPHT, • INVALID CHAPACTER') ; Dj r\SF. STMT*) P ACE>? TilEN TTELN (OUTPUT, 'LEAVING TOKEN 1 , WF D; ■i) id i)i)a)a)a)d)d)u)d)a)3)d)d)a)a)j>d)d) n S7 PA FOR A P HP ;y 'OP ' H F j) n) id) a) d) d) i) ,c, b !L VT ID L V "v o)t)' (* RO' AB 1 A^ n u 1^ 13 3 - RA OF ON ?0 A3 A 3 R r ' FG C E ,S A AR ED L i& N St BE K I K I * I K I H T MI N UHH LF I ^N -»0 £L S Y j) d)d> KEN USE 11, °P ESC AF • T STK D E A RAY 3 USE 1,2 J: I HP E PS M S S s s ck ow AL ED t r\ f" D W EM on J)Q> * v 10 pT zk NT : A ?<. 01. p NT D E A A GF THE ft 5 ^ A ST THE EN E OF S, N 3Y D A R AN E OF A OF EOT GET d) a) a) d) ) LINT OP, S STOP YM. EGE^ PPAY 1..2 ..1" FAN; POCE UMPP VL2 APH. STAC ACK ACK TOP R<~>M EG "A TOKL SE N LEML ?0K THE GF P TO T ;)a).j)a) EXPRES ADD K OF N OF VAL OF DES DOWN P THF TO PARSF FE NON S, NEG EXT) . NT MAI (PROD MATCH, STK (A HE ROT a) ani) i) i) d) a) a) a) a) a) d) VL SICN A ENTR IF ONTERM (JE SET RIPTOR ARSE KFN FO TABLE TERM IN N U M 3 E CHES, UCTION PSTK LONG W TOM OF a) a) 'fid) a) d) d)a) d)a) INTf ND P S TO INAL S FO S AN F TH UTIN (IN ALS, RS S IT I I' T IS P ITH PST a)a)aia) CUP3,CTYPF,SR0W,ERR) ; <7)i)d^.d)d)a)a)d)i)d)ofld)cSa)a)<2d)d)i^ ERFORM SEMANTIC ACTIONS SYMBOL TABLE AND GRAPH S TRIED ALREADY 3 REFERENCES D DUMMY VARIABLES E EXPRESSION SO FAR E IS MATCHED WITH AN ELEMENT THIS TABLE, POS NUMREFS ARE POS NUMBERS HATCH THF NUMBER PEC I FY WHICH ROW OF THE PARSF AS REQUIRED 3TRUCTUPE. S PLACED ON SSTK, IF IT IS AT HEN THE ELEMENTS CF SSTK ARE REPLACED POW IS THF PSTK) . OPP r D AND THE CURRENT THE COLUMN POINTER IN K, THEN YOURF DON*\ a) a) a) a) i) a) J lit a) Jd) d)o)a)d)d)d)d)d)Sd)<01 THEN :=1 ; <1 THEN : = 1: .NVALf ABS (G. PNOf FSTKf 1 1 1) ]; 99 17 1S.MVAL[G. PNO[ FSTKT 1 11 1 THEN S.NVALf G.PNO[ FSTKf 1 J]J:=SROW; IF S?OW2^ THEN IF S.NARGfG. PNOfFSTKf 1 ] ]1 THEN GOTO 99; END; IF (RHSr-P30D,LCC 1<0) AND ( RHSf -PROD, LOC lOSSTKf" STC P 1) THFN BEGIN PUSH PROD AND LOC I 1:=P >j: = L THEN = PPOD; LOC; ') PUSH' ,PRGD, LOC) PSTKf PTOP+1 PSTKf PTOP+2 IF TRACE>2 KRITELN (OUTPUT, PTOP:=PTCP+2; PROD:=RHSf -PROD, LOC 1; LOC: =1 ; GOTO 1; END; * IF AND THEN*) IF PHSf-PPCD, LOC 1O0 THEN IF PHSr -PPCD, LOC ]=SSTKf STOP 1 THEN BEGIN (* ENTRY IN PT MATCHES TOKEN *) STOP:=STOP+1; LOC:=LCC*1; GOTO 1; END (* »HS = SSTK *) ELSE BEGIN (* ENTRY DOES NOT MATCH SSTK*) STOP:=STOP-(LOC-1) ; PROD:=PROD-1 ; LOC • = 1 * if"trace>2 then w pit eln (output, ' nomatch', prod) ; IF CONTf-PPCD 1 THEN GOTO 1 ELSE BEGIN PTOP:=PTOP-2; IF PTOP=-2 THEN GOTO 98; STOP:=STOP- (PSTK[ PTOP+2 1-1) ; PROD:=PSTKf PTOP + 1 1-1; GOTO 1C ; 102 END; END; (* IF RHS = SSTK *) BEGIN (* EXECUTE PROC *) PROCESS (DONE) ; IF DONF THEN IF J TPACE>2 THEN WP IT EL N (OUTPUT.' PROC .PROD) ; (*REPIACE LOC-1 ENTRIES IN SSTK WITH PPOD *) STOP : = STOP- (LOC-1) : FOR J:=STOP*1 TO 150 DO IF J*LOC-2<=150 THEN SSTK[ J l:=SSTKf J+LOC-2 1; WHILE CONTf -PRODI DO PPOD: =PROD+1 ; SSTKf STOP ]:=PROD; PTCP:=PTOP-2; IF PTOP=-2 THEN GOTO 2; PPOD:=PSIKf PTOP+1 1: LCC:=PSTKQ PTOP+2 ]*1 ; IF ' T, P\CE>2 THEN WPITELM (CUT PUT, 'POP' , PPOD , LOC , STOP) ; STOP:=STOP+1 ; GOTO 1; END; END; (*WTTH*) GOTO 9 5; 9P-. WRTTELN (OFILF, 'INVALID SYNTAX ', CTYPE , ' EXPECTING Efl'': =1 ; T F CTYPE <= 2 THFN pg p . = r> • STOP: =\ ; WHIL P SSTKf STCP+1 }<>0 DO BEGIN TF SSTKf STOP 1< THEN WHILE PTBL. CONTf -SSTKf STOP 1 ] DO SSTKf STOP ]:=SSTK[ STOP 1* 1; S70P:=STCF-H ; PN D ; PSIKf STOP ]:=C ; FOP .7: = 1 M ° CURS-1 DO t .7 d :~E (OFILE, 3UFf ,1 1) ; PTTTSEG (OFILE) ; WRITE (OFILE, 'PFTYPS LAST CHARACTER'); PUTS EG (OFILF) ; T LIN ^ • READ (I FILE, PUFf CURS-1 1) ; cups :=cup3-1 ; I:=1; WHILE NOT EGLN(IFILE) DO BEGIN FOR J:=CUPS+I TC 99 DO DOTJ + 1 J: = PUFf J ]; ^EADJIFILE, BUFf CUPS+I 1) ; I:=I+1; END; PTOP: =0 ; STOP:-1 ; GOTO 11; GOTO 99; ?! IF PSTKf 1 1 < -? THEN GOTO 9 P. ; (* IF RESTRICTION, THEN PLACE CONS AT; IF CH?E='P' ,PTDL. RKSr-PR0D f L2C 1) ; END OF G AND DPLET^ INCOMMING LINKS*) WHILE G. LNKf GTOP,I 1<>C DO THEN BEGIN I:=1; 1 D 3 BEGIN G. LNKf GSIZE,I l: = G.LNKf GTOP, I 1; J: =1 ; WHILE G.LNKf G. LNKf 1T0P,I ],J IOC DO J:=J+1; 3, LNKf G. LNKr GTOP, I 1, J- 1 ]:=0 ; G. LNKf gtop,i 1:=0; I:=I*1; END; (♦WHILE G. . .<>€♦) G. V3L[ GSIZEJ:=G. VDLf GTOP 1: G.ORDT ^RfGSTZE 1 : =G. ORDI R Rf GTD P 1; G.VSLf GSIZEl:=G.VAL[GTOP]; G. PNOf GSIZE1:=G.PNC[ GTOPl; END; (♦IF CHPF= , P'*) ^9:; ZND; COSTG(P:GPTR; EVALUATE THE COST OF THIS GRAPH (COST FUNCTION CT) . i^ i) O i) ?> j) ?) iH ^ (fi >i) d i) ^ a) i> a) fl <£ ^ a) a) a) a) ^ (♦ VLINT ♦) PROCEDURE CCSTG (P:GPTR ; CT: INT^G^P) ; LABEL 6; VA? J.I: INTEGFR; TNSD.CTNEG:BOOLEAN; 0: GPTP ; BEG I V J (♦COSTG*) TF CTO *HEN C r N5G:=TgUH ""LSE CTNEG: =FALSE; CT: =ABS (CT") ; TF CT IN f 1 f 2, 3, k 1 THEN ^ASE CT OF 1,3: BFGTfl CASE CT OF 1: INSD:=TPUE; 3: TNSn:=FALSE END; "(♦CASE STMT^) P.COSTf CT]: =0; : =GS FT ; WHILE QONIL DC BEGIN IF (CT = 1)AND(ES IN 0. E3 ET) AN D (0 . FP) r°( CT=3)AND JNOI (ES IN 0. ESET)) THEN IF SUBG1 (P, 0,0, AQP. FREEC, TRUE) THEN P. COSTf CT 1: = P. COSTf CT 1+1 ; Q:=Q,NXTN; END: (♦WHILE QOML*) IF CT=3 THEN END; (*CASE 1*) 2,U: 3^GIN P.COSTf CT 1: = r ; FOE J:=1 TO GSIZE DO IF P. LNKf J, 1 1<>0 THEN IF NOT P. VBLf J 1 THEN IF (S.NARGfABS (P. PNOf J ]) 1> 1 ) OS (P. VAL[ J ]<>f 0. . MNV?L 1) THEN IF CT-2 THEN ?, COSTf 2 1: = P. C0ST[2 ]+1 ELSE P. COSTf <4 ]: = P. COSTf 4 1-t-S. VCOSTf ABS (P. PNOf J ]) ]; IF P. 1SELONIL THEN FOR J:=1 TC KST.NMST DO IF P.HSSL.CVALf MST. PTRf J 1 ]<>f 0. .FNVAL ] THEN 134 IF CT=2 THEN P.COSTf 2 ]: = P. COSTf 2 1*1 ELSE P.COSTf 4 1: = P. CD ST[ 4 ]♦ S. V COSTf SBS (^ST . ?NOT PI ST. P??\ J ] ]) ]; FND (*CASF 2*) END; (*CASE STMT*) TF CTNEG THEN P.COSTf CT }:=- P. COSTf CT1; END; ( * in) i) idi id cda> a) 3 a)a)a)a)a)a)a)a1daVfida>a)a)a)d(Z)a)a)a) 4)17) i) a) a) j) a) d TRIMGtVAR NSTJF:GPTF; T RIM A LIST OF GRAPHS TC JIAYS GRAPHS ACCOFDIN5 TO FUNCTIONAL -7) 'J i) a) t) a) liVi al a) a)o) a) dfi) a) i) a) i) 1) a) a) a) da) a) a) a) a) a) a) a) i) ddiddti}d)dd)dd$d)(bd}d'$d= Ci DO v : =PP.M. TOLERf IC 1* (CA[ NC l.CDSTr ABS (PRK.CSTF r ic i) j-cam l. co sir abs prm.cstf [IC]) l) ; IF ICOPPM.NF THEN WHILE (CAf MAXS l.COSTr ABS(PEH.CSTPfIC 1) ] :A[ I J.COSTT ABS (PRfi. CSTFf IC ]) 1 - X) AND (K = NC) I: =1+1 ; (* RETURN ELEMENTS FPOM I TO NC*) ?:Fop j : =i XO NC DO 3FGIN CA[ J 1, NX IN: =FRFE3; FRFEG:=CAr J 1; P ND; NC:=I-1: T B:=M* ys-1 ; »HIL W (CAT XAXS l.COSTf ABS(PRM. CSTF[ IC 1) 1 <= CA r T3 i.COSTr AB«? (PFM.CSTF[IC ]) 1 ♦ X) AND (IB>0) DO IB: =TB-1 ; IB:=IB+1 ; IC:=IC+1: IF TC<=PFM.NF THEN GO ""O 1 ; 9 9 : N s T A P : = N I L ; POP t : =1 TO NC DO BEGIN CAT I 1. NXTN : =NSTAR: NSTAR:=CAf I 1; END; r ND: (* i)d)i)d) a) ii i)a) a)a)a) a) 17) a) d) a) i> 7) a) a) did) a) a); 1)1)0) -Dtd a)a)a)'i) did) a) a) a) a) d) a) fi) a) a) a) a) t) a) a) a) a) Scdd) a) t) a) a) a) a) 01*80)0)11) a) COMPMS did) 1) d) d) a) d) d> i)a) did) }> 7) 1) a) a) 0) a) J a? j)a)d)i)j)a)a)a)o)a)a)o)S. NVALf MST. SYMPTRTMST. PTPf 'HEN N ]11 THEN BEGIN S.NVAL[ MST.SYMPTR[MST.PTR[N1]]:=L; S.FVALf MST.SYMPTRrMST,PTR[N 111:=L; END * TF K = L THFN S.KSFL.CVALr MST. PrP[ N-1 1]:=[ 1 l FLSF G. MSEL.CVALf MST. PTPT N-1 11:=[C 1; IF K=L THEN IF ES IN G. ESET THEN FA1 :=FA1+1 ELSE FA'" :=FAC+1 ; T? ES IN G.FSET THFN NF1 :=NF1 + 1 ; IF r S IN G.ESET THEN NPTlf L 1: = NPT1[. L 1+1 ^LSF NPT"[ L 1:=N?TCT L 1 + 1 ; G: =G. N7TN; END; (*WHILF*) END; (* ?t)'j) t) ? t) i) j) i)a)(dn) iHnidt i) i) a) a) d) d> d) j) .i) d) Dd)d) a):])d)2) a) c£ a) a) a) 'A> ii jDa)a)a>a)a)d):2)d)d)d) 7)d)a)i1d)Si)S)d)a)d)a)a)<5)d)d) fid) 3^ ii i) TRIMM d)d)d)i)cDa)i)(i)^ *compms*) pp-)r"?DnpE T R "" M M ; VA"> I, J,K,L,K:TNTFGEF; J:GPfF ; 3 FUN IE MST.METATRIFKMS7. NKST ^H FN Q E G I N j t?o'p T.-i T0 MST, METATRIM DO '0' J: =1+1 TC MST. MIST DO IF (MST. FlCOVf MST. PTPfl J ]MST. F°CC Vf MST. PTR[ J | J) THFN NO; B EG I N L: = MST. P^RT I I: MST. PTF[ I ];=MST. MS". PTFr J ]:=L; END; MST. NMST:=MST.XETAT?IM; FMD; PTR[J 1; (* i) t) i> %> i>i i> i> i)u)d)id)d)d)a)a)a)d)a;4 Ja)dVi)a)d):i)a) tin) a) idaja)a)'a)wi)a)ftwd)ftdd)tiT)l) • - • ) F0° J:=S.MVAL[I] TO S.N'VAL[I] DC THFN D EGIN FOP T :=C TC MNVAL DO BE UN 137 'HIM P 6 BE (*I END; (*T)Da)i) (*ADDM OR OCFD LABEL f* S~L 5 70 S PHD PHCTH G :G n TR p-IR T : IF I 3 ' EG I S. s. F0 WH NPT1[ L ]:=0; NPTO[L 1:=0; END; FA1 :=0; FAO : =0 ; COMPMS (GSFT, ES.I, J,NPT1 , N PTC , FA1 , FA 0) ; MST. F1C0V[MST. PTR[ MST.NMST-1 ]]:=FA1 ; MST. F^ COV[M ST. PTR[ MST.NMST-1 1 1: =P AC ; K:=-100C ; FOR L:=C TC MNVAL DO IF NPT1[ L ]>K THEN EFT, IN K:=NPT1[ L 1; PA1:=L; END; MST.FlCOVf KST. PTR[ M ST. NMST ] 1 : = K : MST. F^COVT KST.PTPfMST.NHST 1 1: =NPTOf FA1 ]; END; m: in tpac" 7 t hen GIN E7PLN (6) ; PMETAD; ENn; F TFACE*) Mi)i)d)i)dHic&a)<7)a)r>aJa)d),i) i) a) a) a) a) a) a) i) i^ a) t) a) a) a) a) a) 8 a) a) a) a) a) i^aia)'(^i^aidi^^di^iiaidii^da)'b^3d>di(dd)^di3d)d)'a) i i)^*] E" 7 A*) URE ADDML; 2; FCT ONE PREDICATE AND ADD LEFT AND RIGHT TABLE THEN ADD THE LEFT OR RIGHT TC THF. GRAPH FCR EACH EVENT*) VAR I , J, K ,L, H: INTEGER; • = 1 TO S.NFLT DC NAPGf I 1 = 2) AND (S. MVAL[ I 1 = 1) THFN (*ADD TO STABLE*) N'^LT : =S. NFLT +2 ■ NAMFf S7NELT-1 ]:=«MST- '; NAMEf 3. MELT ]: = 'LST- ' ; R K:=S.NELT-1 TO 3.NELT DO B^GIN FOR J: =5 TO 1" DO S. NAMEf K, J 1: = S. NAdEf I ,J-4 ]; S. PNOr K ] : =K : 3. NARGTk ];=1 5. NVAL' K ' ;=1 S.MVAL' K ' : =1 S. FVAL'K ' :=1 END; (*FOF K*) =GSET; ILF (JONIL DO BEGIN FOR J:=1 TO GSIZE DO IF 3. PNOr 3 1 = 1 THEN IE G. PNOr G.LNKT3, 1 1 1=G. PNO[ G. LNK[ J, 2 1 1 THEN- EC P K:=1 TO 2 DO BEGIN M:=1; WHILE G.LNK[G.LNKf J.K ],M 1<>0 DO BEGIN L: = G. LNKf G. LNKf J,K],K]; IF (G.PNOf L 1=1) AND (JOL) THEN 10R IF (LG.LNK[ J,K]) GOTO 2 ELSE M: = M+ 1 ELSE M:=M+1; END; (*ADD NODE TO GRAPH*) L: = 1; WHILE G. LNK[L,1 ]<>0 DO L:=L*1 ; G.PNOT L 1: =S.NELT-2+K; THEN r ND END; (*FOF K*) S:=G.NXTN ; FND; (*WHILF*) G.PNOT L 1: =S.NELT-2* G. VBL[L 1:=FALSE; G.ORDIRET L1:=FALSE; g.valTl ]:=r 11; G.LNK[L,1 ];=G.LNK[ J, K 1; G . L N K| G . L NK f J , K ], fl 1 : = I ; EPD; (*ADD"i o q -\ f ■? Y) LABEL VAR G, t.j.k: D p ^ r- tt f) BFGI?! o;=^TA WHILE BEG I 0: wn ) 7) i) 7)1) i)o)ri)'J)a)'ia)d) i)i)a}aja)d)a)::)'Jia)cDa)a) t) 3) a) a) a! a) a) i)^'ft r bTl COVER (EScINTEGER) ; UPE COVEP(VAR ES:INTEGER); 1,2; 0, P,GFSTAP.:GPTP; T N "" 2- 3 E P " fjFF ABSCURB (STARrGPTR) ; p • PONIL DO N =P.NXTN; TL P OONIL DO B^GIN IF SUBG1 (P,0,l ,AQP. FREEC, TRUE) THEN IF SUBGliQ,P,C, AQP. FHEEC,TEUE) THEN P: FN END; (*AB50 PUT.l^G l^TS^G WHILE 3 ET S °EAD (I v i S "" " M IF MST ^DDM g: =cov IF GO 3EGI WH j« FR *H TOVS^T ^, : = S S w P. FP:=FALSc Q:=Q.NXTN; END; =P.NXTN; D; URB*) N (OFILE, • ENTER DECISION NUMBER OF 5 ^T TO BE C0VEPFD'); (OFILE) (OFILF SOLN(IFTLE) DO FG (IFILE) ; FILE.ES) ; . *!FTATRIH<><: THEN P TA; NIL 'THEN v IL 17 G. NXTNONIL DC G:=G. NXTN; NXTN: =FFEEG; EEG:=COVSF,T: D; :=NIL; 109 WHILE ~<>NIL DC BEGIN G. FP:=TEUJE; G: =G. NXTN ; FND; S^GS'T; WHILF GONIL DO BEGIN IF G.FP AND (ES IN G.ESET) THEN BEGIN FOR I:=1 TO GSIZE DO G.COHNTf I ]:=0; NQ:=NIL: ?STAP:=NIL; STAR:=NIL; NMQ:=0; j*SET UP INITIAL STAR*) IF 1 IN TRACE THEN BEGIN WFITELN (CFILE, ■ NOW COVERING EVENT'); PGRAPHfG, S) ; EXPLN (TO) ; END: FOP I:=1 TO GSIZE DO IF (NOT G.V3L[ I 1) AND(G. LNKfl, 1]<>C)AND( S.LKKfl, 2 ]=G) THEN B FG I N NFWG ]G1) : J:=G1.RNO; G'l.'coONTf 1 1 : = 1 ; G1. RNO:=J; 31. NXTN:=STAR ; FOP K: = 1 *TO GSIZE DO FO^ J:=1 TO MLNK DO 31. LNKr K,jj:*0; J : = 1 ; WHILE G.LNK[ I,J ]<>0 DO BEGIN G1.LNKT I f J1:=G. LNK[I r J 1; Gl.LNKrG1.LNKf I. J ,1 1: =1; Gl.COUNT[Gl.LNKfl,Jl]:=1; J:=J*1; END; END; 2: G1:=STAP; IF 1 IN TRACE THEN B EG I N WFTTELN (CFILE. 'THE FOLLOWING FORMULAS', • A°E IN THE TTNTETMKfcD STAR' ; EXPLN (*) ; END: WHILE GlONIL DO BFGIN FOP J: = 1 TO PR II, NF DO C0ST3 (G1 ,PRM.CSTF[ J 1) ; G1.FP:=TRUE; IF 1 IN TRACE THEN PGPA"H (G1 , S) ; G1: = G1,N>'TN; END; (*ABSOHPPTION *) ABSOURB (STAR) ; ■"P.IMGJSTAF.PPK.MAySTAR) ; IF 1 IN TRACF THEN B EG I Y- WPITELN (CFILE, THE FOLLOWING FORMULAS REtfAIN', ' AFTER TRIMMING'): EXPLN (1) ; FND; I? (NSO^PPI. NCONSIST) OR (STAR=NIL) THFN GOTO 1 ; 110 G1 :=STAR • WHILE GLONIL DO BEG T N OPSIAP:=PSTAR- NEWGP (PUP. ALTER ,G1,G, PS TAR) ; IF 1 IN TRACE THEN PGRAPH (G1,S) : (*ABS0URP P:-PSTAR; TION *) WHILE POCPSTAR DO BEGIN Q:=0PSTAR: WHILE OONIL DO BEGIN IF SUBG1 (P,Q,C, AQP.FREECTRUE) Q. FP:=FALSE ELSE 'HEN IF SUBG1 (Q, P, 0, AOP. FREEC,TRUE) THEN P. FP:=FALSE; 0:=0. NXTN; EN D ; P:=P.NXTN; FND; G1:=G1. NXTN; FND; (*WHILE G10NIL*) (* RETURN CURRENT STAR TO FREE LIST*) G1 :=3TAP ; WHILF G1.NXTNONIL DO G1:=G1.NXTN; G1 . NXTN: =FR PEG; FRFEG:=S7AR; STAR:=PSTAR; PSTAP:=NIL; GOTO 2; (*NGW HAVE MQ LIST OF CONSITFNT FORMULAS; APPI " IF n T p TV] "WHTTEIN (OFILE, »THE CONSISTENT FORMULAS: 1 ); FXPLS (2) ; END: WHILE GlONIL DO BEGIN IF 2 IN TPACE THEN BEGIN WRITEIN (OFILE, 1 BEFORE AQ: » ) ; PGRAPH (G1 ,S) ; END; AQSET (GS£T,ES,^1) : FOP I :=1 TO PR^.NF DD IF PRn.CSTFr I ]<>-"* THEM COSTG (G1,PRM. CSTF[I ]) ; IF 2 IN TPACE THEN BEGIN 'LY A0 PROC*) 1: G1:=MQ; 2 IN TRACE THEN WPITFLN (OFILE,* AFTER AQ PGRAPH (G1 ,S) ; •) ; END • G1 :=G1. NXTN; END; ?BSOUPB (MO) ; G1:=M0; IF 9 IN TRACE THEN WPITELN (OFILE. 'THE F3LLOWING ARE ALTERNATIVE', •CONSISTENT GENERALIZATIONS' ) ; WHILE GlONIL DO BEGIN IF 9 IN TRACE THEN IF G1.FP THEN PGRAPH (G1 .SI ; G1.C0ST[3 1 : =- 100; 111 G1:=G1.NYTN; END; TRIMG (MQ, 1) ; IF 3 IN TRACE THEN BEGIN WFITFLN (CFILE,'THE SELECTED MQ FORMULA IS:'); PGRAPHjMQ,S) ; EVPLN (3) ; END; MQ. NXTN:=COVSET; COVSFT:=MQ; C 1 * = G * WHILE* 310NIL DO BEGIN SUBG1 (MQ ESET) A .G1,0, LSS; CF (ES IN .Gl.ESETlANDjGl t PP)_ THEN G1. fp:=fa: AQP. FF.EEC,TRUE) THEN G: FN (*WHIL WFITFL G:=cov WHILE PFGI WP PG G: EN T F MS*" PMFT END; (*COVE BEGIN INIT; P^SF* ( WHILE BEGT NF GI G. GS FN (*WHTL CHIP : = INFILE rp^p^ ( WRITEL . w° ^: IF I WRIT ' (M)O PUTS EG ILTNF; 1ETCHR IF CHR CASE •H' :BE G1:=G1.NXTN; END; EUD; (*IE G. FP FTC*) =G.NXTN; D; E GO*) N (OFILE, 'THE ALLOWING FORMULAS COVER SET • , ES) ; SET ; GONIL DO N TTFLN (OFILE, 'THIS RULE COVERS ', -G. COST[ 1 1, ' NEW RULES'); PAPH (G,S) ; =G.NXTN ; .NMSTOC THEN AD; ) GF NO N WG *A n i F* i CF N( DI NF FL DI (0 TLE) • T EOF (G FILE) DO -) ; o) ; TN: = :=G; ) i . it TLE) OFIL FY, ILE = N (OF F|, FILE 1SET; E, 'ENTER ONE CHAR: (P) A F.AMETEPS , ( V) L 1 , (C)CVFP, ', (H)ELP FOR MORE OPTNS*) ; THEN ILE,'ENTFR ONE CHAR: (P ) ARAM ETERS , (V)L1, (C)OVEP, ' (H)ELP FOR MORE OPrNS'); ) ; P. (OH P T>J ' CHR GIN W R IT W^IT W°IT WRIT \]T> TT WRIT W»IT W^IT WRIT WRIT RR ; r 'R' R CF i t * M' ,'C, 'P' ,' E« ,' L' ,' H« , • V ,' S' ] THEN FLN ELN ELN ELN ELN ELN ELN FLN ELN ELN (OFILE, OFILE, OFILE, (OFILE, OFILE, (OFILE, OFILE, lOFILF, OFILE, I'CFILE, (R) ') READ IN RESTRICTIONS MODIFY PUI ES fM) ') ; 3ET HELP (H) ') : INCLUDE MOST-LEAST TYPE SELECTORS (L)») COVER SET OF PULES USE VL1 MODE (V) •) MODIFY PARAMETERS (P) ENTER DOMAIN STRUCTURE ADD FQUIV TYPE SFL (S) QUIT (Q) •) ; (C) •) 'I? PULFS •) ; (E) •) 112 IF TP tpt . •M» : t r i . i pi ' • V« : • E' : • s 1 : • L»: ipt : be • E» : EN ' V : VL ' L' : BE EL EX PU EN' GI EN FN i;' PFOS(I) THEN CHEF : = •!!• ELS E WHILE NOT PEOS(I) GETCHRR (CHFR) : CHRP IN[ ' R' , ' M* CASE CHRP OF EXPLN (21 EXPLN (22) EXPLN(23 FYPLN (2U EXPLN 27 FYPLN (25 EXPLN (29 EXPLN (2« END (♦CASE STMT*) SS PLN (2 6) ; TSEG (OFILE) ; D; N •*> P D p • D; CASE P*) RD: DO t p I II I i wi S» ] THEN AD PR EN S 1 :BEGI WH PR "N ' "• :PEGI NE VL G. w p EN (* I «j I . E(P ~T ' IF PU IL GE M DM M DJ IL BE EXTMTY: =TRUE; p; N WG IN NX CA N I WR TS IN TC "c CA SET; E GO NIL DC GIN RDDSEL (G) ; G:=G. NXTN; END; EQUIV:=TPUL ; ES) i G > : TN:=RESTLIST; LTST:=! SE R*) MFI ITE EG ( E: HRR HRR SE BEG N E N W LE=0 THEN (OFILE, • ADD OFILE) ; OR D3LETE PULE? ') H CH IN EK ■op EW HI B HPR1) ; IN [ • A ' RE1 OF D' ] THEN . N HI (G. LF FGI ER IF PU VL EN XTN PTS LE ) ; MSE ERF N R: = IF MFI TSF D i (*w :=G TLI R<> kU DO o; FILE=u THEN TELN (OFILE, 1 ENTER RULE') G (OFILE) ; (G,EPR,ES) ; HILE*) SET; ST ; NIL DO 113 •n •c Q 99 BEGIN IF SUBG1 (R,G,1, AQP. FREEC,TRUE) THEN ; R:=R.NXTN; END; GSET :=G; FND; (*C*SE A*) BEGIN G1 : = GSET; WHILE GlONIL DO BEGIN WPTTELN (OFILE,' DELETE THE FOLLOWING RULE? •); FUTSEG (OFILE) ; PGPAPH (G1 ,S) ; ILINE; GETCHRR (CHRR) ; IF CHPP = 'Y» THEN BEGIN G2:=G1. NXTN; G1. NXTN:=FREEG; FREEG:=G1 ; IF G1=GSET THEN GSET:=G2 ELSE G.NX'TN:=G2; G1:=G2; END; IF CHPP = ' N' THEN BEGIN G:=G1 : G1 :=Gl. NXTN ; END; IF CHRR = • Q' THEN 10TO 1 ; FND (*WHILE*) END (*CftSF D*) END; (*CASE STMT *) FND; (♦CASE M*) • '.BEGIN COVER (ES) ; END; (*CASE C*) ♦ I HEGIN GOTO 99; END (*CASE Q*) END; C»SE STMT *) TO 1 ; : END. BIBLIOGRAPHIC DATA SHEET 1. Report No. UIUCDCS-R- 77-876 3. Recipient's Accession No. 14. Title and Subtitle rr INDUCE-l: An Interactive Inductive Inference Program in VL2i Logic System eport Date May 1977 6. 7. Author(s) James B. Larson 8. Performing Organization Rept. No. 9. Performing Organization Name and Address Department of Computer Science University of Illinois Urbana, Illinois 61801 10. Project/Task/Work Unit No. 11. Contract/Grant No. NSF MCS 74-03514 12. Sponsoring Organization Name and Address National Science Foundation Washington, DC 13. Type of Report & Period Covered 14. 15. Supplementary Notes 16. Abstracts The program INDUCE-l is a PASCAL program which generalizes VL ?1 decision rules to form consistent, complete, and near optimal VL„ decision rules under a user specified criterion. The paper supplies the list of parameters and commands for operating the program, the I/O files which the program uses, description of the program structure and a complete program listing. 17. Key Words and Document Analysis. 17a. Descriptors VL 2 variable-valued logic first order predicate logic inductive inference production systems decision rules 17b. Identifiers/Open-Ended Terms 17c. COSATI Field/Group 18. Availability Statement 19. Security Class (This Report) UNCLASSIFIED 20. Security Class (This Page UNCLASSIFIED 21. No. of Pages 22. Price FORM NTIS-35 ( 10-70) USCOMM-DC 40329-P7 1 jp p 1 S Wf77 fftb i is/i oHDe^