home *** CD-ROM | disk | FTP | other *** search
/ ftp.umcs.maine.edu / 2015-02-07.ftp.umcs.maine.edu.tar / ftp.umcs.maine.edu / pub / WISR / wisr4 / proceedings / detex / miller.detex < prev    next >
Text File  |  1992-04-05  |  14KB  |  400 lines

  1.  [12pt] article 
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.   A Knowledge-Based Approach to
  11. Encouraging Reuse of
  12. Simulation and Modeling Programs 
  13.  
  14.   Lawrence H. Miller  
  15.         The Aerospace Corporation  
  16.         Post Office BOX 92957  
  17.         Los Angeles, CA. 90009-2957  
  18.                
  19.         Alex Quilici  
  20.         Department of Electrical Engineering  
  21.         University of Hawaii at Manoa  
  22.         2540 Dole St, Holmes Hall 483  
  23.         Honolulu, HI. 96822 
  24.  
  25.    
  26.  
  27.  
  28.   
  29.  
  30. This paper describes a knowledge-based approach
  31. to encouraging the reuse of existing simulation
  32. and modeling programs.
  33. In our environment there are
  34. two barriers to reuse of these programs: poor
  35. interfaces and minimal documentation.
  36. To get around these problems,
  37. we are (1) treating each existing program as an operator
  38. in a planning system,
  39. (2) creating a knowledge base describing
  40. the user goals each program achieves,
  41. the pre- and post-conditions of running the program,
  42. and its I/O behavior, and
  43. (3) developing several tools that make use of
  44. this knowledge to automate the development of new
  45. interfaces to these programs and to assist the
  46. creation of scripts that achieve high-level user goals.
  47.  
  48.  
  49.  
  50.  
  51.   Introduction 
  52.  
  53. The Aerospace Corporation has a large collection of
  54. programs that perform simulation and modeling tasks
  55. related to spacecraft design and evaluation.
  56. As with most corporations, there exists a strong
  57. desire to make as much use of existing code as possible,
  58. and to write new code only as a last resort.
  59.  
  60. Unfortunately, these programs have several properties that
  61. make this goal extremely difficult to achieve.
  62. First, they were written in Fortran by engineers and
  63. physicists untrained in software engineering methodologies.
  64. The result is poor program design, which makes it
  65. all but impossible to separate
  66. these programs into reusable components.
  67. Second, they often started out as one-shot solutions
  68. to a particular program and only over time proved
  69. more generally useful.
  70. Because these programs were
  71. originally intended to be used only by their designers,
  72. they tend to have horrible interfaces and minimal
  73. to non-existent documentation which discourages their
  74. use by anyone other than the small community of users
  75. that are currently intimately familiar with the program.
  76.  
  77. Our efforts have concentrated on ways to maximize
  78. the use of these existing programs.
  79. In particular,
  80. we're concerned with developing techniques that encourage
  81. the use of existing programs as components in the creation
  82. of new software systems.
  83. Thus, our focus is on increasing the reuse
  84. of programs as a whole rather than on their components,
  85. although that's clearly an important issue as well
  86.  .
  87.  
  88. Our basic approach has been to create a knowledge base that
  89. describes our existing simulation and modeling programs,
  90. and to then use this knowledge base in two ways:
  91.   
  92.  
  93. To help construct new interfaces that can be wrapped
  94. around our existing programs.
  95.  
  96. To help construct scripts for achieving high-level
  97. user goals that use our existing programs as components.
  98.  
  99. Currently, we're in the process of developing a pair
  100. of tools that use this knowledge base.
  101. The first takes a description of a simulation
  102. program and automatically generates a new interface that can be wrapped around it.
  103. The second allows developers to form scripts that achieve
  104. high-level user goals by connecting up goal-oriented
  105. descriptions of the function of various programs.
  106.  
  107.   The Knowledge Base For Simulation Programs 
  108.  
  109. We view each of our simulation and modeling programs as an
  110. operator in a planning system.
  111. Thus, our
  112. knowledge base describing these programs contains
  113. information similar to that kept by most planning systems
  114.  .
  115. In particular, we describe the goals each program achieves, the situations in which it's applicable, and its input and
  116. output behavior (which corresponds loosely to the preconditions and postconditions of the program).
  117.  
  118. As an example, one very useful program, IMPACT, simulates
  119. a collision between two orbiting space-objects.
  120. Our knowledge base contains
  121. the following information for this program:
  122.  
  123.   
  124.  
  125. It achieves the goal ``simulate collision between
  126. two space craft.''
  127.  
  128. It is applicable under various constraints on the
  129. type of collision,
  130. such as that the collision must be orbital
  131. and hyper-velocity.
  132.  
  133. Its input is a file ``impact.in'' that contains the
  134. initial collision parameters,
  135. such as the initial velocity of the projectile in meters
  136. per second and the altitude of the collision in kilometers.
  137.  
  138. Its output is a file ``impact.out'' that contains a
  139. description of the initial orbits of the particles
  140. that result from the collision,
  141. presented as a set of particle positions and velocity,
  142. grouped by size of particle.
  143.  
  144. The information describing the various input and output
  145. values of these programs is quite detailed, including
  146. the value's purpose, its expected units, its expected
  147. range, and so on.
  148. In addition, since some of these input
  149. values can be computed automatically by running
  150. alternate programs,
  151. the knowledge base also associates input values with
  152. the programs that can be run to compute them.
  153.  
  154. We construct this knowledge base in the obvious way:
  155. first, by examining whatever program documentation
  156. happens to be available, and second, by
  157. consulting with current users of the program.
  158. Thus, in addition to its role in assisting the process of
  159. constructing new interfaces and forming scripts that
  160. use these programs,
  161. the knowledge base serves as additional
  162. documentation for these programs.
  163.  
  164.   Providing Multi-Modal Interfaces 
  165.  
  166. A key to making existing programs usable to a larger
  167. community of users is to provide them with a friendly
  168. user interface,
  169. complete with dialog boxes and mouse selections for input,
  170. and bar charts, plots, and tables for output.
  171. Unfortunately, our current
  172. fleet of aging simulation and modeling
  173. programs have interfaces that are exactly the opposite. 
  174. Typically, these programs accept a stream of values for
  175. input, in a particular order and in particular units,
  176. and produce a stream of values as output.   It
  177. takes a significant amount of time for users to come
  178. up to speed on the input formats and to understand
  179. the meaning of the program's output.
  180.  
  181. Because these programs are generally poorly written,
  182. it's difficult to perform cosmetic surgery
  183. on them.
  184. They frequently read input or produce output
  185. from multiple locations in the program,
  186. or read and write input and output values
  187. directly into specific locations in memory.
  188. Their batch nature, however, makes it straightforward,
  189. although time-consuming,
  190. to wrap them in a richer interface.
  191. The input side of the interface prompts for values or runs
  192. other programs to provide the needed values, and then
  193. creates the files necessary for a given program to run.
  194. The output side of the interface takes the program's
  195. output values and displays them in appropriate tabular
  196. or graphic forms.
  197.  
  198. Originally, we created these improved interfaces by hand.
  199. In particular, we built an improved interface to an aging
  200. Fortran program that computes reliability of satellite
  201. components, and included it as part of a new, multi-modal
  202. environment for evaluating satellite performance.
  203. Given this knowledge base, however, it becomes possible
  204. to automate much of this process.
  205. We've created a straightforward interpreter that's given
  206. existing programs to run,
  207. and uses the knowledge base to
  208. automatically query users or run other programs
  209. to determine the necessary input values.
  210. It then creates the necessary input file and runs
  211. the program.
  212. Once the program runs, the interpreter uses the
  213. knowledge base to run through its output
  214. file and display those output values appropriately.
  215.  
  216. By providing these programs with improved interfaces,
  217. we have greatly extended the community
  218. of users for these programs.
  219. In addition, our knowledge-based approach is much simpler
  220. than trying to construct new interfaces by hand,
  221. or trying to modify the existing simulation programs
  222. themselves.
  223.  
  224.  
  225.   Synthesizing Simulation and Modeling Scripts 
  226.  
  227. Another key to encouraging reuse is to make it easy for users and developers to combine existing programs to form
  228. solutions to their problems. 
  229. In our environment,
  230. one important set of programs simulates orbiting space
  231. objects.
  232. Along with IMPACT,
  233. these include programs
  234. to determine the probability of collisions with other
  235. space objects, how long particles will orbit, and where
  236. particles are likely to land when they return to earth.
  237. Experienced users of these programs have figured out
  238. how to combine them into scripts that achieve
  239. their high-level goals,
  240. such as planning satellite breakups meeting
  241. certain constraints, or determining whether an existing
  242. breakup will cause damage to a particular satellite.
  243. Most of these scripts haven't yet been
  244. implemented as programs, and exist solely in the
  245. heads of users.
  246.  
  247. Our feeling is that there are three ways to
  248. increase the reuse of our existing simulation programs.
  249. First, by capturing existing uses of programs as
  250. concrete scripts that solve particular user goals.
  251. Second, by assisting users in automatically creating
  252. new scripts. 
  253. And third, by presenting these scripts in
  254. a way that they can understand better what the
  255. component programs do.
  256.  
  257. Our assumption is that the scripts
  258. these experienced users
  259. formulate can be represented as a hierarchical goal
  260. decomposition, consisting of an initial goal decomposed
  261. into subgoals, with programs that achieve various
  262. subgoals attached to leaves of the tree.
  263. As an example, consider the goal of
  264. planning a breakup collision that satisfies the constraint that there's a low
  265. probability of debris colliding with an existing satellite.
  266. It breaks down into the following steps:
  267.   
  268.  
  269. Decide upon an initial collision velocity and
  270. collision angle.
  271.  
  272. Simulate the collision
  273.  
  274. Determine the probability of hitting an
  275. existing satellite.
  276.  
  277. Reposition existing satellites that are in
  278. danger.
  279.  
  280. Determine a new collision velocity and angle.
  281.  
  282. Go to step 2.
  283.  
  284. Some of these subgoals correspond directly to running
  285. programs, such as step 2, is achieved
  286. by running the IMPACT program.
  287. Others, however,
  288. correspond to another sequence of subgoals,
  289. such as step 3, which consists of a subgoal
  290. of determining which satellites are in the general
  291. orbit of the particles resulting from the breakup,
  292. and then determining the probabilities of
  293. each of these satellites being in danger.
  294. Finally, some subgoals correspond to manual tasks,
  295. such as steps 4 and 5, which involve
  296. manually trying to find new locations for satellites
  297. in danger and trying
  298. to guess more appropriate collision angles.
  299.  
  300. Our approach is to provide a graphically-oriented tool
  301. that allows users to specify the complete
  302. goal hierarchies for solving their problems,
  303. along with the connections between various
  304. subgoals and existing programs.
  305. This allows them to easily form a library of scripts
  306. that capture how the programs are actually being used
  307. to solve problems.
  308. We then provide an interpreter that automatically
  309. executes these scripts,
  310. automatically obtaining needed input values and displaying output values appropriately.
  311. In addition, while executing these scripts,
  312. the interpreter highlights active subgoals,
  313. allowing users to learn the uses of
  314. existing programs. 
  315.  
  316. Our knowledge base supports this process by containing
  317. the knowledge necessary to map programs to
  318. the goals they achieve,
  319. as well as knowledge about their inputs and outputs,
  320. so that users constructing scripts are freed from
  321. worrying about those values.
  322.  
  323.   Future Work and Conclusions 
  324.  
  325. Currently, there are several limitations to our approach.
  326. First, our programs are primarily batch and have
  327. limited options.
  328. We haven't yet tried to create a knowledge
  329. base for an interactive program or for a program that
  330. does different things in different situations.
  331. And second, our approach is only at the prototype stage.
  332. We have implemented knowledge bases describing a set of
  333. approximately a dozen programs and scripts of their use,
  334. as well as first pass implementations of the tools that
  335. use this knowledge base to provide new interfaces, and to
  336. assist users in entering and executing the scripts for
  337. their high-level goals.
  338. We are beginning to consider many of the issues that will
  339. arise when we scale up to larger collections of programs,
  340. such as users being able to find the appropriate script
  341. that achieves their goal  .
  342.  
  343. Besides beginning to deal with scaling issues,
  344. we're also starting to explore several new directions.
  345. The first is to use the knowledge base to automatically 
  346. form scripts from initial descriptions of user goals.
  347. In particular, we've been considering how to combine our
  348. approach with    Weaving , a large grained data flow
  349. environment designed to support the combination of programs
  350.  .
  351. Another problem we've begun looking at is
  352. to tryito automatically extract some of
  353. the information now placed into our knowledge base by hand.
  354. In particular, we're focusing on how we can
  355. extract knowledge about a program's input and output behavior.
  356.  
  357. In summary, we are trying to encourage the use of these
  358. batch programs by making them appear to be interactive
  359. and by including them as components of more
  360. sophisticated interactive, software systems.
  361. We're doing so by
  362. (1) providing them with better interfaces and by (2)
  363. combining them into high-level scripts that reflect
  364. how they're used.  The key is we're
  365. using a knowledge base describing these programs to help
  366. us create tools that
  367. automatically perform these tasks.
  368.  
  369.    Bigg 90 
  370.  
  371.  
  372. Allen, J., Hendler, J. and Tate, A. (Editors),    Readings
  373. in Planning , Morgan Kaufman, Palo Alto, CA, 1990.
  374.  
  375.  
  376. Biggerstaff, T. (Editor),    Software Reuse ,
  377. Addison Wesley, Reading, MA, 1990.
  378.  
  379.  
  380. Fischer, G., Henninger, S., and Redmiles, D.,
  381. ``Cognitive Tools for Locating and Comprehending Software
  382. Objects for Reuse.''
  383. In    Proceedings of the 13th International Conference
  384. on Software Engineering , IEEE Computer Society Press,
  385. 1991.
  386.  
  387.  
  388. Gorlick, M. and Razouk, R.,
  389. ``Using Weaves For
  390. Software Construction and Analysis.''
  391. In    Proceedings of the 13th International Conference
  392. on Software Engineering , IEEE Computer Society Press,
  393. 1991.
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.