PII: 0957-4174(91)90113-S Expert Systems With Applications, Vol. 2, pp. 167-174, 1991 0957-4174/91 $3.00 + .00 Printed in the USA. © 1991 Pergamon Press plc An Expert System for Determining Government Relocation Allowances H A L B E R G H E L , D A V I D R O A C H University of Arkansas, Fayetteville, AR G A R Y G R E E N , J O E M E E H A N National Center for Toxicological Research, Jefferson, AR Abstract-- We describe an expert system whose rule base is a formafization of the subset of the federal travel regulations on relocation allowances. Its purpose is to help government employees making a permanent change of station to identify the reimbursable expenses associated with that change of station. We discuss the structure of the regulations, the implications of this structure for the rule base and inference engine, and the components of the user interface. 1. I N T R O D U C T I O N IN AN EARLIER article, we described a n i m p l e m e n t a t i o n o f a p r o t o t y p e o f the c u r r e n t system, called R A P (for R e l o c a t i o n Allowance Planner), whose rule base con- sisted o f o n l y a small subset o f the applicable regula- tions a n d whose user interface lacked s o m e o f the i m - p o r t a n t features t h a t h a v e since been a d d e d (Roach, Berghel, M e e h a n , & G r e e n , 1989). T h e p r o t o t y p e in- ference engine has also b e e n significantly e n h a n c e d [ R o a c h & Berghel, in press (a), in press (b)]. In this article, we p r o v i d e a n overview o f the m a t u r e version o f the system, with special e m p h a s i s o n the formaliza- tion o f the regulations a n d structure o f the inferential m e c h a n i s m necessary to carry o u t the required deduc- tions. R A P is i n t e n d e d to b e a p l a n n i n g tool for govern- m e n t e m p l o y e e s w h o are to undergo a p e r m a n e n t change o f station. T h r o u g h a consultation with the sys- t e m the e m p l o y e e c a n d e t e r m i n e w h a t kinds o f expen- ses are identified in the regulations as r e i m b u r s a b l e ex- penses. T h e e m p l o y e e c a n p l a n the m o v e to m a x i m i z e the r e i m b u r s e m e n t a n d m i n i m i z e the costs t h a t would h a v e to b e p a i d f r o m personal funds. Because the reg- ulations are c o m p l e x , this a p p r o a c h is m u c h simpler, This work was supported in part by a grant to the first author from the National Center for Toxicological Research. The authors wish to thank the anonymous referees of Expert Systems With Applications for suggesting several improvements to earlier drafts of this paper. Requests for reprints should be sent to Hal Berghel, Center for Artificial Intelligence and Expert Systems, 131 Biomass Research Center, University of Arkansas, Fayetteville, AR 7270 I. less error prone, less t i m e c o n s u m i n g , a n d less costly t h a n a m a n u a l a p p r o a c h . In addition, questions c o n - cerning the validity a n d a c c u r a c y o f the results can be resolved m o r e easily. T h e explanation facility generates a r e p o r t o f the reasoning process with explicit justifi- cations o f the p r o p o s e d allowances for each type o f expense. 2. R E L O C A T I O N A L L O W A N C E R E G U L A T I O N S W i t h i n carefully defined p a r a m e t e r s , the federal gov- e r n m e n t will c o v e r m a n y o f the expenses that o n e o f its employees encounters w h e n a transfer f r o m one post o f d u t y to a n o t h e r is required. T h e conditions, restric- tions, a n d limits pertaining to expense allowances for a change o f station are codified in a set o f regulations k n o w n as the Federal Travel Regulations (U.S. General Services A d m i n i s t r a t i o n [GSA], 1987). T h e relocation allowance regulations are divided into 10 sections (USGSA, 1984, 1987). T h e first section is c o n c e r n e d with the general eligibility conditions for obtaining a n allowance. T h e o t h e r nine sections are d e v o t e d to the different t y p e s o f c o v e r e d expenses. T h e 10 sections o f the m a n u a l are: 1. applicability a n d general rules, 2. travel to the new residence, 3. miscellaneous, 4. travel to seek new residence quarters, 5. o c c u p a n c y o f t e m p o r a r y quarters, 6. b u y i n g a n d selling residences, 7. t r a n s p o r t a t i o n o f h o u s e h o l d goods, 8. t r a n s p o r t a t i o n o f a m o b i l e h o m e , 167 168 9. n o n t e m p o r a r y storage o f household goods, and 10. transportation o f a privately owned vehicle. The first section is c o n c e r n e d with factors such as em- ployee status, cause o f transfer, authorization for transfer, and time and distance restrictions. T h e con- ditions in section (1) must be satisfied before a n y al- lowance can be granted. T h e remaining nine sections discuss conditions u n d e r which an employee is eligible for specific allowances and procedures for calculating those allowances. Section 2 o f the m a n u a l is concerned with the ex- penses for physically m o v i n g from one post to another. This includes subsistence and transportation expenses. T h e parameters o f interest are the size o f the immediate family, the n u m b e r o f days required to complete the move, and the mileage rate. Miscellaneous expenses and allowances (section 3) cover the costs o f a variety o f items and activities such as forfeitures o f nontrans- ferable medical contracts, registration, and license fees, etc. T h e a m o u n t s allowed depend on whether records are kept, the size o f the i m m e d i a t e family, and the a m o u n t o f the employee's regular weekly pay. Section 4 governs the expenses for a pretransfer trip to find housing at the new post o f duty. T r a n s p o r t a t i o n for b o t h the e m p l o y e e and spouse is provided. T h e per diem for the employee and spouse must be calculated as well as the mileage rate i f a personally owned vehicle is used for the trip. T h e n u m b e r o f trips, the length o f the trip, the distance to the new post o f duty, an d the employee's status must be ascertained. If t e m p o r a r y quarters are to be occupied before a p e r m a n e n t new residence is obtained (section 5) the length o f the stay and the n u m b e r and relationship o f other occupants must be k n o w n in order to d e t e r m i n e an allowance a m o u n t . T h e rates vary depending o n the length o f occupancy. T h e r e are n u m e r o u s conditions that must be satisfied before eligibility can be established for this allowance. Section 6 contains the regulations on allowances for the expenses associated with buying and selling homes. Eligibility conditions include having title to old a n d / or new residences, living in the old residence before transferring, and providing evidence o f transaction ex- penses. The covered expenses include broker's fees, real estate commissions, advertising and appraisal costs, le- gal fees, etc. M a x i m u m s are based on percentages o f actual buying and selling prices. T h e expenses for transporting household goods (section 7) are based o n the m e t h o d o f transportation, weight o f the goods, an d costs for t e m p o r a r y storage o f the goods while in transit (if any). All o f these facts must be obtained. M a x i m u m allowances for this category o f expenses exist a n d must not be exceeded. T h e costs for transporting a mobile h o m e (section 8) are also reimbursable. Mileage rates (consequently, allowance decisions) d e p e n d primarily on the m ean s o f transportation: c o m m e r c i a l carrier, private means, H. Berghel et al. some c o m b i n a t i o n o f the two, or a g o v e r n m e n t bill o f lading. Section 9 governs allowances for storing house- hold goods while at the new residence. Conditions for the allowance are that the transfer is to an isolated station where the goods can n o t be stored. Covered costs include packing, crating and transportation to and from the storage warehouse. T h e final section (section 10) is c o n c e r n e d with the transportation o f a privately o w n ed vehicle. T h e r e are n u m e r o u s eligibility condi- tions that m u st be satisfied in order to obtain this al- lowance. T h e size o f the vehicle, who will drive it, why it is being transported, and the cost relative to the length o f the transfer are all issues that must be addressed. 3. T H E M A N U A L S Y S T E M As a large g o v e r n m e n t research institution, the Na- tional Cen t er for Toxicological Research employs a n u m b e r o f research an d support personnel who fall u n d e r the purview o f these regulations. Because there are a significant n u m b e r o f personnel changes occurring each year, the center attempts to address the eligible employees' desires for assistance in obtaining a relo- cation allowance. T h e o b t a i n m e n t o f all an d only those allowances for which an e m p l o y e e is eligible is greatly hindered by the co m p l ex i t y o f the travel regulations. Appendix B o f the Travel Manual, which is devoted to relocation allowances, is roughly 150 pages o f detailed informa- tion (USGSA, 1987). T h e u n w ary employee, if left to his o w n devices in interpreting the regulations, is usu- ally o v erw h el m ed by the m ag n i t u d e o f the problem o f trying to apply t h e m to his particular situation. Thus, the Cen t er provides s o m e o n e who is familiar with the regulations to assist employees in d et erm i n i n g their re- location allowances. T h e process requires that the assistant interrogate the transferee in order to ascertain whether general eli- gibility conditions are met, which expense categories apply, w h et h er specific restrictions an d limitations are met, which rates are to be used, etc. M a n y questions require y e s / n o responses; others require that values for various entities be s u p p l i e d - - t h e n u m b e r o f family members, the distance to be traveled, the weight o f various objects, an d so forth. This, o f course, suggests that the assistant should possess a co m p reh en si v e and detailed knowledge o f the relocation regulations. However, the n u m b e r o f employees transferring, and t h u s requiring some assistance, is not large enough to justify a position d ev o t ed just to providing that kind o f assistance. As a result, the person w h o is charged with the responsibility o f assisting in allowance deter- m i n at i o n does so relatively infrequently; consequently, that person does n o t s p e c i a l i z e in the relocation reg- ulations. This m e a n s that while the expertise at inter- preting an d applying the regulations is greater t h an that o f the layman, it is still less t h an what could be provided An E S for Government Relocation Allowances by a specialist in the area. Because o f the level o f de- m a n d for assistance with the relocation regulations, it is simply not cost effective to dedicate a person full t i m e to the task. T h e result is that the employee w h o is transferring is not getting the level o f assistance that could be provided. 4. T H E A U T O M A T E D S Y S T E M T h e motivation for the a u t o m a t e d system is that it can provide unerring analyses in a cost effective man n er. T h e user interface is intuitive and simple enough that the l a y m a n can use the system to accurately d e t e r m i n e his allowances. T h e suitability o f the allowance deter- m i n a t i o n process to an expert system style solution is a function o f the hierarchical structure and translat- ability o f the regulations and the interactive character o f the d e t e r m i n a t i o n process. T h e character and or- ganization o f the regulations p e r m i t a fairly straight- forward translation to a standard rule base format. Also, the interactive aspects o f the m a n u a l system are au- t o m a t e d in a very natural way via the expert system's user interface. Figure 1 shows RAP's main menu. On the lower part o f the screen the current client is iden- tified, a n d an indication is given whether a trace, a s u m m a r y , a n d / o r a set o f answers exist for that client. These m a k e up the three categories o f i n f o r m a t i o n that result from a consultation. T h e usual options for re- viewing and printing the trace are present. However, R A P also provides a tabular s u m m a r y o f allowance a m o u n t s and a record o f responses given during a con- sultation. T h e tabular s u m m a r y includes a figure for each category o f expenses along with a total allowance a m o u n t . T h e i n f o r m a t i o n gained as a result o f a con- sultation can be stored and retrieved. This includes the trace, the answers supplied by the user during a con- sultation, and the allowance s u m m a r y information. It is possible to resume a previous consultation using a previously stored set o f answers. T h e system proceeds noninteractively using the retrieved answer set. Should a question arise for which there is no previous answer the system will q u e r y the user in the n o r m a l manner. This feature is useful for resuming incomplete consul- F1 HELP Line 1 Col 1 CLIENT: 7248 169 INSERT $yOu$ are Sa civilian officer or employee transferring from one official station or agency to another for permanent dutyS = Syes$. Syou$ have $appreval for travel from the proper official(s)$ = Syes$. Syou$ will $move within 2 years of your date of transfers = Syes$. Syou$ are $transferring in the interest of the Government and not primarily for your convenience or at your requeszS $yesS, $you$ are Sa new appointees = $no$. Syour spouses will Saccompany you on the moves = SyesS. $the numoer of family members age 12 or olderS = $I$. Sthe numoer of family members under age 125 = $i$. $the number of days required to complete the moves = $105. Syou$ will $drive a privately owned vehicles = SyesS. Sthe total miles drivenS = $i0005, Sthe size of your immediate family$ = $25. FIGURE 2. Editor and sample object value response set. tations. T h e previously answered questions need not be repeated. However, even co m p l et ed consultations can be re- sumed. This is usually d o n e with a co m p l et ed answer set that has been modified. An editor is provided that can be used to m o d i fy a previous answer set. Previous answer(s) can be changed, an d the system can generate a new trace a n d allowance s u m m a r y noninteractively. As a result, whole sessions need not be repeated should o n e desire to change a previous response. Figure 2 shows the ed i t o r screen, in which some o f the objects an d associated values resulting fro m a consultation are displayed. Figure 3 shows the screen when a consul- tation is begun. T h e t o p window identifies the section o f the m a n u a l o n which the cu rren t q u e r y is based. T h e q u e r y itself appears in the next window down. T h e middle p o rt i o n o f the screen consists o f a m e n u for obtaining the user responses to the query. YES and N O responses are entered by selecting the appropriate m e n u o p t i o n (see Figure 4). N u m e r i c responses are entered in the small window at the far left o f the m enu, as shown in Figure 5. T h e type o f response that is ap- propriate to a given q u ery is d e t e r m i n e d before it is displayed. Thus, the highlighting defaults to the correct part o f the m en u . Finally, the m e n u provides options for asking why a particular question is asked (the reason is displayed in the b o t t o m window, as in Figure 6) and for aborting the c u r r e n t consultation a n d returning to the main menu. Current Drive: C: RAP MAIN MENU Monday Current Directory: \RAP January 20, 1990 Data Directory: \RAP\DATA 4:00 pm First Time Consultation Resume Previous Consultation Review Allowance Su~unary Review Trace Print Allowance Summary Print Trace Select Client Edit Client Answers Delete Client Information Introduction to RAP Exit to DOS Client An ..... T .... ))S .... y 7248 YES NO I~ NO FIGURE 1. The mainmenu. Expense Category F__. L Value Query r J ! ! ! YES NO WHY DO YOU ASK? MAIN MENU I Response to Why FIGURE 3. Query screen layout. 170 H. Berghel et al. Current Questions Relate to General Eligibility Are you a civilian officer of employee transferring from ] oee official station or agency to another for permanent J duty? I I I l l i [] No ..Y oo A K? MENo FIGURE 4. Sample yes/no valued query. Current Questions Relate to Actual Moving Expenses How many family members age 12 or older will relocate with you? I I i ] I ~ YES NO WHY DO YOU ASK? MAIN MENU I FIGURE 5. Sample numeric valued query. Current Questions Relate to Actual Moving Expenses How many members are in your immediate family, including yourself, who will relocate with you? i Y~s IwHY Do Yoo AsKs1 MEmo I To determine value for mileage rate. a your I oK FIGURE 8. Reason for asking the question. As a consultation progresses from o n e category o f allowances to the next, the a m o u n t o f the allowance for the completed category is displayed. At the end o f a consultation the trace, s u m m a r y o f allowances, and user responses are saved, and the user is returned to the main menu. At this point, the results o f the consultation can be viewed, printed, modified, etc. The explanation o f the reasoning process for the completed consultation is in the form o f a 'pretty-printed' trace. Figures 7 and 8 show different portions o f a sample trace. The first is a partial justification o f the claim that the target client has met the eligibility conditions, and the second par- tially justifies the a m o u n t allocated for a particular type o f expense. Finally, the client can view or print a tabular s u m m a r y o f the allowances, as s h o w n in Figure 9. Trace of Reasoning for 7248 you are eligible for a relocation allowance because you meet the applicability requirements in 2-1.2 because you are a civilian officer or employee transferring from one official station or agency to another for permanent duty and you meet the general provisions in 2-1.3 because you have approval for travel from the proper officials and you meet the general provisions conditions in 2-1.3a because you are transferring in the interest of the Government and not primarily for you convenience or at your request FIGURE 7. Portion of explanation for client 7248. Trace of Reasoning for 7248 your subsistence/transportation allowance = 1970.00 because your subsistence/transportation allowance = your subsistence allowance per day + the subsistence allowance for your immediate family per day * the number of days required to complete the move + your transportation allowance for relocating and your subsistence allowance per day = 60.00 because your subsistence allowance per day = your per diem and your per diem = 60.00 and the subsistence allowance for your immediate family per day = 120.00 because FIGURE 8. Portion of explanation for client 7248. Allowance Summary for 7248 Subsistence/Transportation S 1970.00 Miscellaneous Expenses S 400.00 Travel to Seek Residence Quarters $ 80O.CC Temporary Quarters $ 200.00 Residence Transactions $ 1700.00 Mobile Home $ 0.00 Household Goods $ 800.00 Nontemporary Storage of Household Goods $ 1300.00 Personally Owned Vehicle $ 600.00 TOTAL $ 7770.00 FIGURE 9. Tabular summary of allowances for client 7248. 5. I M P L E M E N T A T I O N 5.1. Translating Regulations to Rules The prolix r e g u l a t i o n e s e and frequent use o f exclu- sionary clauses are the main impediments to efficient translation o f the regulations. For example, The expenses of travel, transportation, moving and/or storage of household goods, and applicable allowances as provided in these regulations in connection with the transfer or ap- pointment of employees to posts of duty outside the conter- minous United States, or between posts located in (i) separate countries, (ii) separate areas of the United States located out- side the conterminous United States (e.g., Alaska, Hawaii, the Commonwealth of Puerto Rico), or (iii) any combination of the above, shall not be allowed unless and until the em- ployee selected for such transfer or appointment agrees in writing to remain in the service of the Government for 12 An E S for Government Relocation Allowances 171 months following the effective date of the transfer or ap- pointment (or for 1 school year for Department of Defense overseas dependents school system teachers as determined under Chapter 25 of title 20 of the United States Code (U.S.C.)), unless separated for reasons beyond his/her control and acceptable to the agency concerned. (USGSA, 1984, p. 2-5) A careful a b r i d g m e n t o f the regulations is a necessary c o m p o n e n t o f the translation process. On the o t h er hand, their rigorous organization increases their trans- latability. T h e reason is that the hierarchical relation- ship o f all the parts to the whole is readily discernable. T h e following excerpt from the table o f contents gives some indication o f the level o f analysis (USGSA, 1984, p. iii): Allowable travel and transportation . . . . . . 2-1.5h(2) Destination . . . . . . . . . . . . . . . . . . . . . . . 2-1.5h(2)(a) Allowances . . . . . . . . . . . . . . . . . . . . . . . . 2-1.5h(2)(b) Alternate destination . . . . . . . . . . . . . . . . 2-1.5h(2)(c) Limitations . . . . . . . . . . . . . . . . . . . . . . . . . 2-1.5h(3) Husband and wife both employed . . . . . 2-1.5h(3)(a) Local hires not eligible . . . . . . . . . . . . . . 2-1.5h(3)(b) Married persons in area with spouse . . . 2-1.5h(3)(b)(i) Minors in area with parents . . . . . . . . . . 2-1.5h(3)(b)(ii) This organizational scheme is an i m p o r t a n t plus, since p r o d u c t i o n system rule bases t e n d to exhibit this same hierarchical structure (Davis & Buchanan, 1985; Min- sky, 1985; Nilsson, 1980). In the initial translation o f the regulations, the writ- ten m a n u a l was taken to be the " e x p e r t . " T h a t is, the knowledge engineer worked directly f r o m the written regulations in formulating the rule base. T h e c o m m o n knowledge acquisition p r o b l e m o f making explicit the reasoning processes o f the h u m a n expert was not pres- ent. S o m e clarification o f the m o r e obscure statements in the regulations was provided by people who had m o r e familiarity with the regulations than the knowl- edge engineer. T h e system has c o m p l e t e d one phase o f testing a n d is currently undergoing the second phase• In the first, the person responsible for assisting employees in the m a n u a l system verified the rules. In the current testing phase, the system is in actual use, but the results are double-checked. 5.2. The Rule Base Since we are interested in obtaining an answer to the question " a m I eligible for an allowance and, if so, for how m u c h o f one?," a goal-oriented, backward-chain- ing inference engine is employed. Thus, the rule base is organized as a hierarchy o f conditions on which the top-level goal is contingent. (There are currently 144 rules in the rule base.) T h e structure o f the rule base is complicated b y the fact that procedures for calculating allowances m u st be incorporated. Since simple conditional rule bases en- code declarative knowledge, some special provision m u st be m a d e for encoding procedural knowledge (Davis & Buchanan, 1985). [The problem o f procedural a t t a c h m e n t is a relatively old o n e in knowledge-based systems (Winograd, 1985)]. A frame-based approach provides o n e type o f so- lution to the p ro b l em (Men'itt, 1989; Minsky, 1985). However, we e m p l o y e d a simpler m e t h o d that facili- tates the integration o f procedural information into the explanation (trace) o f the reasoning process. T h e pro- cedural i n f o r m a t i o n in the regulations can be stated as arithmetic expressions. These expressions undergo a bipartite interpretation by the system. O n the one hand, they are interpreted as r u l e s - - i n m u c h the same way as o rd i n ary conditional rules. In fact, they are inter- mingled with conditional rules in the rule base. T h e right-hand side o f an expression is treated as i f it stated conditions for the o b t a i n m e n t o f the left-hand side. As a result, the procedural i n f o r m a t i o n can be incorpo- rated into the trace in a fashion similar to that used for the declarative information. O n the o t h er hand, the expressions are also interpreted as true arithmetic expressions. T h e values they represent are calculated. W e refer to the two rule types as conditional and assignment rules. T h e syntax o f the conditional rules is a variation o n the standard f o r m a t (Amble, 1987; Bratko, 1986; Merritt, 1989). We define both rule types in terms o f a hierarchy o f expressions as follows: Let the vocabulary o f an arithmetic expression be 1. a finite set o f real-valued variables, V = {vl, v2, • . . , V k } , 2. the arithmetic operators '*', '/', ' + ' , ' - ' , a n d 3. the p u n c t u a t i o n symbols '(' an d ')'. We define arithmetic expressions inductively as follows: 1. Real-valued variables a n d real n u m b e r s are arith- metic expressions. 2. If A an d B are arithmetic expressions, t h e n so are (A* a), (A/B), (A + a), an d (A - a). If we let the vocabulary o f a relational expression be 1. a finite set o f real-valued variables, V = {vl, v2, . . . . Vk}, an d 2. the set o f relational operators, O = { =, <, >, <, >-_}, t h en a relational expression is an expression o f the fo rm vi o vj o r vi o #, where 1 < i, j < k, vi, vj ~ V, o E O, an d tt is a real n u m b e r . T h e vocabulary o f a sentence evaluation consists o f 1. a finite set o f sentence variables, S -- {Sl, $ 2 , . . . , Sk}, 2. the identity o p e r a t o r ' = ' , a n d 3. the set o f sentence values, E = {yes, no}. T h e resulting sentence evaluations are expressions o f the f o r m si = e, 1 < i < k, where e ~ E. 172 H. Berghel et at,. Let the vocabulary o f a logical expression be 1. the vocabularies o f relational expressions an d sen- tence evaluations, 2. the set o f logical operators, O = {and, or}, an d 3. the p u n c t u a t i o n symbols '(' and ')'. A logical expression is defined inductively as follows 1. Relational expressions and sentence evaluations are logical expressions. 2. If A and B are logical expressions, then so are (A and B) and (A or B). We can now define assignment and conditional rules. T h e vocabulary o f an assignment rule is c o m p o s e d o f 1. the vocabulary o f arithmetic expressions, 2. the assignment operator ' = =', 3. a finite set o f sentence variables, S = {sl, s2 . . . . . Sk}, and 4. the set o f sentence values, E -- {yes, no}. T h e r e are two forms o f the assignment rule. 1. I f A is a real-valued variable and B is an arithmetic expression, then A = = B is an assignment rule. 2. Any expression o f the f o r m s, = - - e, 1 __< i _< k, where e E E is an assignment rule. By letting the vocabulary o f a conditional rule be 1. the vocabularies o f logical expressions and assign- m e n t rules plus 2. the conditional o p e r a t o r " i f t h e n , " we can define a conditional rule as follows: If A is a logical expression and B is an assignment rule, then if A t h e n B is a conditional rule. T h e following rules are instances o f the rule schemata. T h e first rule (a conditional rule) is a translation o f the excerpt q u o t e d in the previous section. T h e second is a typical assignment rule. 5.3 The Inference Engine T h e i n f e r e n c e en g i n e is w r i t t e n in P ro l o g a n d is m o d e l e d aft er t h e b a c k w a r d - c h a i n i n g engines de- scribed in (Amble, 1987; Brat k o , 1986; Merritt, 1989). An i n - d e p t h d e s c r i p t i o n o f the en g i n e can be f o u n d in [ R o a c h & Berghel, in press (b)]. It is a m e t a - level engine, with respect t o t h e i n t ri n si c P r o l o g en- gine, fo r c a p t u r i n g a t race o f the r e a s o n i n g process. A c c o r d i n g t o t h e v an H a r m e l e n classification o f ex- p e r t sy st em a r c h i t e c t u r e s ( H a r m e l e n , 1989), it is a bilingual m e t a - l e v e l i n f e r e n c e system. A m o d e l - t h e o r e t i c analysis o f t h e m u l t i l ev el r e l a t i o n s h i p s be- t w e e n t h e c o m p o n e n t s o f t h e system is given in [ R o a c h & Berghel, in press (a)]. T h e s t a n d a r d " w h y " a n d " h o w " t races are c o n - s t r u c t e d as t h e c h a i n i n g p r o c e e d s t h r o u g h t h e rule base ( A m b l e , 1987; B r a t k o , 1986; M e r r i t t , 1989). S i n ce a c o m p l e t e l y c o n n e c t e d ru l e base f o r m s an a n d / o r g r a p h (Nilsson, 1980), t h ese t r a c e s are best v i e w e d as r e p r e s e n t a t i o n s o f n o d e s a n d arcs c o m - p o s i n g t r a v e r s a l s o f this g rap h . T h e " w h y " t r a c e is i m p l e m e n t e d as a list o f all t h e satisfied goals o n a p a t h f r o m t h e r o o t n o d e t o t h e c u r r e n t goal. T h e s a t i s f a c t i o n o f t h e s u c c e s s i o n o f goals o n t h e p a t h b e c o m e s t h e " r e a s o n " fo r p u r s u i n g t h e c u r r e n t goal. T h e " h o w " t r a c e is i m p l e m e n t e d as a t ree s t r u c t u r e w h i c h i n c l u d e s all p a t h s l e a d i n g t o satisfied goals. T h e s a t i s f a c t i o n o f t h e r o o t goal is " e x p l a i n e d " in t e r m s o f t h e s a t i s f a c t i o n o f all goals o n w h i ch t h e r o o t goal is c o n t i n g e n t . A conditional rule becomes part o f the solution tree when its c o n s e q u e n t unifies with the cu rren t goal and its an t eced en t condition(s) are satisfied. T h e following Prolog clause illustrates the chaining o f a conditional rule into the solution space. if (('$you$ will $sign a 12 month service agreementS = yes or ($you$ are $a Department of Defense overseas dependents school system teacher as determined under Chapter 25 of title 20 of the United States Codes = yes and $you$ will $sign a service agreement for 1 school yearS = yes)) or (Syou$ are Sseparated for reasons beyond your controls = yes and $you$ will Stransfer with approval of the concerned agencyS = yes)) then $you$meet $the service agreement requirements in 2-1.5a(i) (a-b)$ == yes. Syour subsistence/transportation allowances = = ((($your subsistence allowance per dayS + Sthe subsistence allowance for your immediate family per dayS) * $the number of days required to complete the moveS) + $your transportation allowance for relocating$). An E S for Government Relocation Allowances 173 pursue(Goal=yes, Why, t(t(t(Goal,yes),TruthValue),Reason)) :- [! recorded(cond__rule(if Conditions then Goal=yes),_) !], pursue(Conditions,[Goal=yeslWhy],Reason), truth__value(Reason,TruthValue). T h e goal truth_value extracts the truth value fro m R e a s o n , which is instantiated during the recursive at- t e m p t to satisfy the rule's condition(s). In the case o f assignment rules, the backward- chaining engine matches the c u r r e n t goal with the left o p e r a n d o f the r u l e - - t r e a t i n g it as it would the con- sequent o f a conditional rule. T h e right operands are treated as if they were conditions for the satisfaction o f the left operand. During the attempted "satisfaction" o f these operands, values are associated with each o f them. Attempts are m a d e to match each o f the right operands with o t h e r rules (conditional or assignment). Once the assignment rule has b e c o m e a part o f the p r o o f tree, the right-hand side is treated as an arithmetic expression, that is, it is evaluated. The inference engine clause simply passes the expression on to the appro- priate arithmetic routines. T h e following clause illus- trates these points. the appropriate q u e r y is constructed directly fro m the statement portion o f the query. T h e statement is simply c o n v e r t e d fro m declarative to interrogative form. With o t h er types o f relations, the corresponding q u e r y is in- cluded in the rule base. Since the Prolog co m p i l er used (Arity Corp., 1988) permits Prolog an d C to be integrated, an d since C is better suited for handling the user interface, the pro- cedural language C is used for m o st o f the interface routines. C is used for its speed a n d because sophisti- cated screen interface libraries are readily a v a i l a b l e - - resulting in a substantial reduction in d e v e l o p m e n t t i m e and cost a n d a substantial increase in the quality o f the user interface. F o r a detailed discussion o f the relationship between Prolog an d C in the system see (Roach & Berghel, 1990). pursue (Goal, Why, t(t(t(Goal, Value), true), Reason)) :- recorded(assign_rule(Goal = = Expression),_), pursue(Expression,[GoallWhy],R), evaluate(Expression,Value), Reason = ((t(t(t(Goal,Expression),true),'inrulebase') andR), recordz(wasderived(Goal,Value),_). T h e arithmetic expression instantiated to E x p r e s s i o n is treated as a set o f conditions in the recursive call to p u r s u e . T h e 'how' trace for those 'conditions' is re- t u r n e d in R. It is treated as an arithmetic expression by e v a l u a t e . T h e value that the expression evaluates to is r e t u r n e d in V a l u e . T h e explanation for G o al evaluating to V a l u e is that a rule o f the form G o al = E x p r e s s i o n exists in the rule base and R. T h e con- tent o f R is not explicit in this clause, but it consists o f explanations o f the values associated with each o f the operands o f the arithmetic expression E x p r e s s i o n . 5.4. The User Interface T h e user interface provides access to a n u m b e r o f useful features a n d parcels o f information. T h r e e forms o f explanation are available: a " w h y " trace, a " h o w " trace, a n d a s u m m a r y o f allowance a m o u n t s . In addition, the user can access i n f o r m a t i o n provided in previous con- sultations a n d m o d i f y it. T h e user interface employs a r u d i m e n t a r y level o f natural language analysis in the f o r m a t i o n o f some queries. W h e n the user m u s t decide the truth value o f a relation with statements a n d responses as operands, 6. E X T E N S I B I L I T Y A couple o f extensions to R A P have been proposed. First, i f the n u m b e r o f employees using the system be- comes substantial, a n d there is a need for long-term storage o f the results o f their consultations, then a m o r e sophisticated file m a n a g e m e n t scheme should be em- ployed. T h e cu rren t system uses the operating system's file m a n a g e m e n t facilities, so it does n o t m ai n t ain a single a u t o n o m o u s database. Second, some type o f forms generator would be a natural a d d e n d u m to the system. T h e r e are n u m e r o u s forms that m u st be filled o u t by the e m p l o y e e during the d e t e r m i n a t i o n process. S o m e o f the paperwork required o f the employee could be eliminated b y letting the system generate the com- pleted f o r m s - - u s i n g the i n f o r m a t i o n available at the e n d o f a consultation. 7. C O N C L U S I O N W e have discussed the a u t o m a t i o n o f the process o f d e t e r m i n i n g relocation allowances. W e have seen that an expert system ap p ro ach is a viable one. T h e rep- resentation o f the federal regulations in an expert sys- 174 H. Berghel et al. tern rule base has been described. The procedural in- formation relating to the determination o f actual al- lowance a m o u n t s has been e n c o d e d in a manner that maximizes the scope o f the explanations supplied to the user. We have discussed the system's features for e x a m i n i n g the information available at the end o f a consultation. Finally, facilities have been discussed which make it possible to store, modify, retrieve, and resume previous consultations. R E F E R E N C E S Amble, T. (1987). Logic programming and knowledge engineering. Wokingham, England: Addison-Wesley. Arity Corporation. (1988). The Arity/Prolog language reference manual. Concord, MA. Bratko, I. (1986). Prolog programming for artificial intelligence. Wokingham, England: Addison-Wesley. Davis, R., & Buchanan, R. ( 1985 ). Production rules as a representation for a knowledge-based consultation program. In R. Brachman & H. Levesque (eds.), Readings in knowledge representation (pp. 371-388). San Mateo, CA: Morgan Kaufmann. Merritt, D. (1989). Building expert systems in Prolog. New York: Springer-Verlag. Minsky, M. (1985). A framework for representing knowledge. In R. Brachman and H. Levesque (eds.), Readings in knowledge rep- resentation (pp. 245-262). San Mateo, CA: Morgan Kaufmann. Nilsson, N. (1980). Principles of artificial intelligence. Palo Alto, CA: Tioga. Roach, D., & Berghel, H. [in press (a)]. Expert systems as overlapping logical theories. In H. Berghel, J. Talburt, and D. Roach (eds.), Proceedings of the 1990 ACM/IEEE Symposium on Applied Computing. Washington, DC: 1EEE Computer Society Press. Roach, D., & Berghel, H. (1990). Issues in Interfacing High-Level and Logic Programming Languages (Tech. Rep. No. TR-90-04). Fayetteville: University of Arkansas, Center for Artificial Intel- ligence and Expert Systems. Roach, D., & Berghel, H. [in press (b)]. The physiology of a Prolog expert system inference engine. In H. Berghel, E. Unger, and R. Rankin (eds.), Proceedings of the 1990 A CM Symposium on Small Systems. New York: ACM Press. Roach, D., Berghel, H., Meehan, J., & Green, G. (1989). RAP: An expert system for relocation allowance planning. In S. Dhall, H. Berghel, and K. George (eds.), Proceedings t f the 1989 ACM South Central Regional Conference (pp. 106-111). New York: ACM Press. van Harmelen, F. (1989). A classification of meta-level architectures. In P. Jackson, H. Reichgelt, and F. Harmelen (eds.), Logic-based knowledge representation (pp. 13-35). Cambridge, MA: MIT Press. Winograd, T. (1985). Frame representations and the declarative/pro- cedural controversy. In R. Brachman and H. Levesque (eds.), Readings in knowledge representation (pp. 357-370). San Mateo, CA: Morgan Kaufmann. United States General Services Administration. (1984). Federal Travel Regulations, HHS Appendix B. Washington, DC: Government Printing Otfice. United States General Services Administration, GSA Training Center. (1987). Relocation Allowances, Federal Travel Regulations and Joint Travel Regulations--Vol. H, Lecture Outline. Washington, DC: Government Printing O[fice.