structuring and evaluation of vp-expert based knowledge bases

8
Pergamon 0952-1976(94)00021-2 Engng Applic. Artif. Intell. Vol. 7, No. 4, pp. 447-454, 1994 Copyright © 1994 Elsevier Science Ltd Printed in Great Britain. All rights reserved 0952-1976/94 $7.00 + 0.00 Contributed Paper Structuring and Evaluation of VP-Expert Based Knowledge Bases K. W. CHAU Hong Kong Polytechnic, Hong Kong WEN-WU YANG Hong Kong Polytechnic, Hong Kong (Received August 1993; in revisedform March 1994) The effective structuring of knowledge bases is most important for knowledge-based expert-system design, whilst the reliable evaluation of these knowledge bases is the key point for the acceptance of arttficial intelligence technology. This paper describes the structuring and evaluation of the knowledge bases for unsteady open channel flow in a river network employing the VP-Expert shell. A tree structure and its parameter hierarchy are designed and implemented in the VP-Expert environment. The architecture of the system is described and some proofs of its satisfactory performance are given. Moreover, the manuscript discusses the experience gained through this implementation process. White-box and black-box testing strategies are used to evaluate the knowledge bases. Some typical rule errors and debugging techniques are also summarized. Keywords: Evaluation, expert system, knowledge bases, structuring, unsteady open channel flow, VP-Expert environment. I. INTRODUCTION For knowledge-based expert systems, the effective structuring of the knowledge bases is the most import- ant facet of the system design, whilst the reliable evaluation of these knowledge bases has been recog- nized to be the key point for the acceptance of the artificial intelligence technology. The evaluation of a software system is composed of verification and valida- tion. Verification means building the system right: i.e. ensuring that the system correctly implements the spe- cifications. Validation means building the right system: i.e. writing specifications and checking performance to make sure that the system does what it is supposed to do. 1In a typical expert system, verification is done first, then validation. Verification and validation are carried out during and at the end of each prototype phase. Verification determines the conformance of the know- ledge base to its design requirements and with the software syntax from which it was built. It also guaran- tees the honest and smooth transition from one proto- type to another. Validation determines the correctness of an end product, the conformance of the output with Correspondence should be sent to: Dr K. W. Chau, Department of Civil and Structural Engineering, Hong Kong Polytechnic, Hung Horn, Kowloon, Hong Kong. the customer's established requirements, and the com- pleteness of the system. Under the traditional testing methods for an engineering expert system, the domain specialists run many test cases on the system. Unfortunately, this is often impractical due to the lack of expert resources. Furthermore, this technique does not guarantee that all the errors can be found and the knowledge engineer never knows if enough test cases have been used. The run-time evaluation is an efficient technique for detecting errors involved in the system at the developmental and later stages. This paper describes the structuring and evaluation of knowledge bases for unsteady open channel flow in a river network, based on the VP-Expert shell. 2. STRUCTURING KNOWLEDGE BASES FOR UNSTEADY OPEN CHANNEL FLOW In real open channel cases, unsteady flow is much more common than steady flow. Rivers are constantly rising or falling, either in a state of flood or on the recession curves of their hydrographs. 2 Therefore, it is essential for an engineer to simulate the unsteady open channel flow in river or tidal networks, for the design of a fluvial river system. It is of importance to be able to predict, accurately and efficiently, water levels and 447

Upload: kw-chau

Post on 26-Jun-2016

212 views

Category:

Documents


0 download

TRANSCRIPT

Pergamon 0952-1976(94)00021-2

Engng Applic. Artif. Intell. Vol. 7, No. 4, pp. 447-454, 1994 Copyright © 1994 Elsevier Science Ltd

Printed in Great Britain. All rights reserved 0952-1976/94 $7.00 + 0.00

Contributed Paper

Structuring and Evaluation of VP-Expert Based Knowledge Bases

K. W. CHAU Hong Kong Polytechnic, Hong Kong

WEN-WU YANG Hong Kong Polytechnic, Hong Kong

(Received August 1993; in revised form March 1994)

The effective structuring of knowledge bases is most important for knowledge-based expert-system design, whilst the reliable evaluation of these knowledge bases is the key point for the acceptance of arttficial intelligence technology. This paper describes the structuring and evaluation of the knowledge bases for unsteady open channel flow in a river network employing the VP-Expert shell. A tree structure and its parameter hierarchy are designed and implemented in the VP-Expert environment. The architecture of the system is described and some proofs of its satisfactory performance are given. Moreover, the manuscript discusses the experience gained through this implementation process. White-box and black-box testing strategies are used to evaluate the knowledge bases. Some typical rule errors and debugging techniques are also summarized.

Keywords: Evaluation, expert system, knowledge bases, structuring, unsteady open channel flow, VP-Expert environment.

I. INTRODUCTION

For knowledge-based expert systems, the effective structuring of the knowledge bases is the most import- ant facet of the system design, whilst the reliable evaluation of these knowledge bases has been recog- nized to be the key point for the acceptance of the artificial intelligence technology. The evaluation of a software system is composed of verification and valida- tion. Verification means building the system right: i.e. ensuring that the system correctly implements the spe- cifications. Validation means building the right system: i.e. writing specifications and checking performance to make sure that the system does what it is supposed to do. 1 In a typical expert system, verification is done first, then validation. Verification and validation are carried out during and at the end of each prototype phase. Verification determines the conformance of the know- ledge base to its design requirements and with the software syntax from which it was built. It also guaran- tees the honest and smooth transition from one proto- type to another. Validation determines the correctness of an end product, the conformance of the output with

Correspondence should be sent to: Dr K. W. Chau, Department of Civil and Structural Engineering, Hong Kong Polytechnic, Hung Horn, Kowloon, Hong Kong.

the customer's established requirements, and the com- pleteness of the system. Under the traditional testing methods for an engineering expert system, the domain specialists run many test cases on the system. Unfortunately, this is often impractical due to the lack of expert resources. Furthermore, this technique does not guarantee that all the errors can be found and the knowledge engineer never knows if enough test cases have been used. The run-time evaluation is an efficient technique for detecting errors involved in the system at the developmental and later stages.

This paper describes the structuring and evaluation of knowledge bases for unsteady open channel flow in a river network, based on the VP-Expert shell.

2. STRUCTURING KNOWLEDGE BASES FOR UNSTEADY OPEN CHANNEL FLOW

In real open channel cases, unsteady flow is much more common than steady flow. Rivers are constantly rising or falling, either in a state of flood or on the recession curves of their hydrographs. 2 Therefore, it is essential for an engineer to simulate the unsteady open channel flow in river or tidal networks, for the design of a fluvial river system. It is of importance to be able to predict, accurately and efficiently, water levels and

447

448 K . W . C H A U and WEN-WU YANG: VP-EXPERT BASED K N O W L E D G E BASES

currents in river channels or tidal networks. Prediction of the time and magnitude of flood peaks can give fore- warning to people downstream. Accurate calculations of currents are essential for understanding the transport phenomenon and dispersal of pollutants or deposition of sediment in a river system. However, the numerical simulation of unsteady flow in an open channel, especially in a natural river network, is a complicated task demanding highly specialized knowledge. 3 Although some computer programs for modeling unsteady flow have been developed, there still exist many difficulties for engineers attempting to solve their practical problems. The achievements of Artificial Intelligence (AI) provide an opportunity for the deve- lopment of an expert system for unsteady open channel flow in a river network (RIVER_NET). 4 The objective of the system is to give support to engineers for choices of appropriate problem-solving techniques, numerical models, proper parameters, etc., in simulating unsteady open channel flow in their engineering projects.

An expert-system shell is very useful for developing a practical system. Usually, a shell is composed of infer- ence engine, knowledge representations, interface faci- lities and knowledge base editor. The main task for the expert system developer is to structure the domain knowledge bases and to establish the system monitor- ing module. To implement the desired performance efficiently, a cautious selection of an expert system shell for the specific domain purposes is very important. VP-Expert 5 was finally chosen as the development shell for implementing RIVER_NET, considering the good performance of the interface and the command menu of the shell.

The RIVER_NET system has the following require-

To describe the hydraulic engineering problem and its requirements. To choose an appropriate model for solving the specific problem and to ask the user for values of essential parameters.

(3) To help the user to choose proper coefficients for the numerical model and to create the necessary data files.

(4) To execute the numerical analysis program to simulate the unsteady flow.

(5) To process the output data by the Symphony Access System.

The two main internal components of an expert system are its knowledge base and the inference engine. By using VP-Expert, it is easy to build a domain knowledge base. Moreover, the VP-Expert shell can itself act as an inference engine and can be used to reason about many different knowledge bases. Just as a database manager has built-in templates and procedures for managing large amounts of data, VP-Expert already has built into it the necessary search

ments:

(1)

(2)

[ Data Files I [Numerical Modeling ] [ Data Processing ]

Fig. 1. The tree structure of the RIVER_NET system.

and management routines for reasoning with the facts and rules in the knowledge base. Therefore all that is needed is to create the domain knowledge base and let VP-Expert apply its reasoning mechanisms to it.

The architecture of the knowledge-based expert system RIVER_NET consists of four modules. The first is the user-machine interface module, which provides a user-friendly interface environment for the end user. The second is the system monitoring module, which controls the reasoning path and data flow among modules. The third is the knowledge-base module, which stores the domain knowledge and specialized expertise. The last one is the analysis software module, which implements the numerical analysis and result representation tasks. Additionally, there are three kinds of data files, i.e. the fact files for knowledge-base consultation, and the input and output data files for numerical analysis software.

Representing the knowledge by a tree structure is more effective to emulate human input-output beha- vior than a flat representation.l The tree structure for implementing the RIVER_NET system is shown in Fig. 1. The parameter hierarchy making up the tree is listed in Table 1. To implement the goal of the RIVER_NET system, three intermediary goals were designed. The first intermediary goal is the formation of the necessary Data Files by reasoning about four knowledge bases: geometry.kbs, schemat.kbs, tidal.kbs, and land.kbs. The second intermediary goal is the execution of the modeling software by chaining the hydrau.exe or lwavex.exe files. The third intermedi- ary goal is the pictorial representation of results by running processing software: symphony access system.

The knowledge base geometry.kbs describes the topographical geometry of the river system. It consists of 23 rules which manipulate some parameters, such as Place_of river, River_type, Number_of_junction, etc. The schemat.kbs is a knowledge base carrying out the schematization of the river network. The task of sche- matization is grid and section discretization for the finite difference schemes for solving unsteady flow equations. This knowledge base has 21 rules and many parameters, such as, Variation_of_dx, Sideslopel. The tidal.kbs and land.kbs are knowledge bases represent- ing the seaward and landward boundary conditions respectively. There are 25 rules in total, and some parameters, such as, SN_harmonic, LN_harmonic, are included.

VP-Expert provides three clauses, BCALL, CALL and CCALL, to chain and execute external .BAT,

K. W. CHAU and WEN-WU YANG: VP-EXPERT BASED KNOWLEDGE BASES 449

• EXE and .COM files respectively• This function allows one to implement the numerical computation and to effect the post-processing under the expert system environment easily• The hydrau.exe and lwavex.exe are executable DOS files written in FORTRAN and C respectively. The former can model the unsteady flow in a river or tidal network; 6'7 whilst the latter program can only model the unsteady flow in a single channel, s The access.corn is the command file of the Symphony Access System for pictorially processing the output data of hydrau.exe or lwavex.exe program. The Symphony Access System developed by Lotus Development Corporation is adopted here, and has many powerful functions, e.g. spreadsheet calculations, word processing, business graphics, database manage- ment and communications•

To combine the numerical modeling programs and the data processing software into the RIVER N E T system, a loose integration model has been ~mple- mented by chaining a batch file.

3. VP-EXPERT ENVIRONMENT AND COMMAND MENU

VP-Expert is an expert-system shell developed by Paperback Software International, running on IBM Personal Computers or compatibles• A minimum of 512K RAM and at least two double-sided 360K diskette drives (or a hard disk with one double-sided drive) are necessary. It runs with DOS 2.0 or higher version• In order to make use of the program's facility to see a graphic trace of a consultation, the computer configu- ration must include an IBM CGA or EGA, a Hercules monochrome graphics adapter, or a compatible video adapter (graphics card). The VP-Expert 2.0 also sup- ports the features of a mouse•

VP-Expert provides an interacting command menu for users to process the knowledge bases• There are four ways to make a menu selection: (1) Use the right and left arrow keys to move the lightbar to the selec- tion, then press Enter; (2) Press the number associated with the selection; (3) Type the first letter of the selection; (4) Type the function key number• The functions of the commands are listed as follows:

(1) MAIN MENU 1Help 2Induce 3Edit 4Consult 5Tree 6FileName 7Path 8Quit Help--Calls the help system; Induce--Creates a working knowledge base from an induction table contained in text, database, or work- sheet file; Consult--Loads the current knowledge base into memory and displays the Consult Menu; Tree--Displays a menu of options for viewing the results of a consultation trace; FileName--Allows the user to the currently active knowledge base; Path--Sets the directory path used to access knowledge-base files; Quit--Returns to the system prompt (2) INDUCE MENU 1Help 2Create 3Database 4Text 5Worksht 6Quit Help--Calls the help system; Create--allows the user to create or edit an induction table in the VP-Expert Editor; Text--Tells VP-Expert that the knowledge base will be induced from an induction table in a worksheet; Quit--Returns to the main Menu. (3) CONSULT MENU 1Help 2Go 3Whatif 4Variable 5Rule 6Set 7Quit Help--Calls the help system;

Table 1. Parameter hierarchy

Description Parameters: Place of river River type Landward_boundary Nature of bed friction Variation of dx Nature of widthl Nature of width2 Side_slope 1 Side_slope2 Bed level Channel_depth Initial_height Initial_velocity Lateral flow

The place name of the river system The type of the river system The nature of the landward boundary conditions The type of bed friction along the channel The type of variation of DX along the channel The type of variation of width of main conveyance section The type of variation of width of flood plain section The type of variation of side slope of main conveyance section The type of variation of side slope of flood plain section The type of variation of bed level along the channel The type of depth of the main conveyance section The type of initial water surface height along the channel The type of initial water velocity along the channel The type of lateral flow along the channel

General Parameters: Alpha D_alpha Number of junction Nstep SN harmonic SMean tide level LN harmonic LM~an tide level

The coefficient correcting for non-uniform velocity distribution The derivative of Alpha The number of the junctions of the river network The number of the hydraulic steps The number of harmonics used to generate the seaward end The mean tide level at the seaward end The number of harmonics used to generate the landward end The mean tide level at the landward end

450 K.W. CHAU and WEN-WU YANG: VP-EXPERT BASED KNOWLEDGE BASES

Go--Begins the consultation and displays the Go menu options, including the Help, How, Why, Slow, Fast and Quit commands; Wha t l f - -Le t s the user find out how the outcome of a consultation would change if a question were answered differently; Variable--Shows the values assigned to one or all of the variables in the last consultation; Rule--Displays one or all of the rules of the current knowledge base; Set--Displays an additional menu of options, including the Help, Trace, Slow, Fast, Windows and Quit com- mands; Qui t - -Re tu rns to the Main Menu. (4) T R E E M E N U 1Help 2Text 3Graphics 4Quit Help--Cal ls the help system; Text--Displays a "text" representation of the last con- sultation trace; Graphics--Displays a "graphic" representation of the last consultation trace; Qui t - -Re tu rns to the Main Menu.

4. EVALUATING THE KNOWLEDGE BASES OF THE RIVER NET SYSTEM

For the evaluation of a complex software system, the authors of this paper have been concerned not only with module testing, but also with the integration testing and system testing. The organization of the testing activity should in some way reflect the organiza- tion of the design activity. Just as a complex system is built by first being designed as a collection of well- connected modules, it should be possible to test modules separately, one by one, and eventually test the whole system. Two methods, white-box testing and black-box testing were adopted to evaluate the RIVER_NET system. The former was used to validate the knowledge bases in a modular way whilst the latter was used to evaluate the whole system. Some typical classes of mistakes causing incorrect rules are summar- ized to demonstrate the evaluation techniques for VP-Expert based knowledge bases as follows:

(1) White-box testing

White-box testing is also called structural testing because it uses the internal structure of the program to derive the test data. By using the powerful command menu of VP-Expert , the white-box testing scheme can be efficiently implemented to detect the syntax errors in the knowledge bases.

(1) Errors caused by misspellings or illegal statements

When a knowledge base is created and edited under the VP-Expert environment, the CONSULT menu is used to begin the consultation of the knowledge base. This is the first step to verify the knowledge bases. When a syntactic or semantic error is encountered, the

system will halt and prompt the user with the error type and the line number. Then the user can press R E T U R N to locate the error line and revise the illegal statement.

As an example, when consulting the knowledge base, G E O M E T R Y . K B S , an error message is prompted as shown below. This message tells one that there is a syntax error in line 213. When R E T U R N is pressed, the cursor locates at the error clause ready for revision of the potential error. It is easy to find out that the error is caused by the misspelling of statement FIND as FINDD. The mistake can easily be corrected according to the error message. Then consultation of the know- ledge base can continue, to find out other possible errors. Most grammatical errors can be detected by the VP-Expert shell.

[ERRORI An error has occurred: Syntax error in clause Error in line 213 (Press RETURN to go on)

208 RULE 4 209 IF River_type = River_network THEN 210 CLS 211 FIND Graph 212 DISPLAY "Ng ={Number_of_grid}; Max. Nj = 10" 213 FINDD Num_junction 214 Number of junction =(Num_junction) 215 RESET Graph;

(2) Errors caused by false premises of a rule

The false premises of a rule usually cause potential errors in the knowledge base. They may cause that rule to fail, so that no value will be concluded for the expression in the conclusion proposition of that rule. Consequently, all the rules that use the conclusion proposition of the rule as a premise will fail. The system may also stop testing the remaining premises of the rule, and consequently the system will stop seeking values for the rest of the expressions of the rule, will stop displaying messages, and will even stop firing other rules.

For example, when the knowledge SCHEMAT.KBS is consulted, it is found that Rule 18 fails to be invoked because of the false premise of the rule. The false premise is caused by the use of illegal values of variable Channel_depth as shown in the following. The legal variable values of Channel_depth are declared in the fact base by an ASK statement, which is also shown below. It is obvious that the premise condition of rule 18, Channel_depth= Vary, violates the legal variable values of Channel_depth, Constant or Varying. Therefore no case can match the premise condition, i.e. the rule will never succeed. The situation causes the loss of some schematization data in the data file INPUT, and consequently the execution of the numeri- cal program will be disrupted by encountering the EOF flag while reading the INPUT file.

K. W. CHAU and WEN-WU YANG: VP-EXPERT BASED KNOWLEDGE BASES 451

Rule 18 IF Channel_depth = Vary THEN FDISPLAY C: \VPX\ INPUT, "1" FOR Iter = 1 TO @Number_of_grid

CLS FIND Section0 DISPLAY " * * For section No. {Iter} ** " FIND Depth1 FDISPLAY C:\VFX\INPUT, "{Depth1}" RESET Depth1 RESET Section0

END Id=(1);

ASK Channel_depth: "What is the type of depth D1 of the main conveyance channel?"; CHOICES Channel_depth: Constant, Varying;

(3) Errors caused by incorrect loop control structures A loop control structure is very useful for repeatedly

executing a clause's body. This function can be finished by use of "FOR (variable=startvalue TO stop_val- ue)... END" statement in VP-Expert. When this loop is initially executed, "variable" is automatically assigned the value "startvalue". "variable" is incre- mented by 1 with each iteration of the loop. When "variable" has a value greater than "stop_value", the loop stops. The clause's body between FOR and END may find variable values. However, the loop structure can also be controlled by the variable status involved in the clause's body. For example, Rule 6 in the know- ledge base TIDAL.KBS listed below, is designed to find the values of variable Velocity1 at each section and to store them in C: VPX INPUT. Unfortunately, the structure does not loop when the rule is fired. When the clause "FIND Velocity1" is processed, the variable Velocity1 gets a value, and its status is flagged as KNOWN. Since no clause after it will alter the status of the variable, there is no need to search for the value for Velocityl. The loop body can execute only once. A clause "RESET Velocity1" should be added before END to change the status of Velocity1 into UNKNOWN. This kind of error can only be detected by testing a special case, or by checking the data file INPUT.

RULE 6 IF Initial_velocity = Varying THEN FDISPLAY C: \VPX\INPUT, " 1 "

FOR Iter= 1 TO @Number_of_grid CLS FIND Profile1 DISPLAY " * * For section No. {Iter} * * "

FIND Velocity1 FDISPLAY C: \VPX\INPUT, "{Velocity1}" RESET Profile1

END Iv=(1);

(4) Errors about fact bases After all the facts have been listed, the knowledge

engineer should check the validity and usage of each fact. For a fact to be valid, it has to appear in at least one premise of a rule, or in the system monitoring module. Therefore, each fact is checked for its usage in

V I User-Machine Module I

I Symphony Software Module I

Knowledge Bases Module t

I ge°metry'kbsl I s°"emat.kbs I

Fig. 2. The graphical interface structure of RIVER_NET system modules.

the knowledge bases. When debugging, used and unused facts should be recorded for further inspection.

Whenever the inference engine of VP-Expert cannot find a value for a variable, an ASK statement requests that information from the user. If, however, there is no ASK statement for that variable written into the know- ledge base, the consultation will stop dead in its tracks. If an AUTOQUERY statement is included, the unhappy situation described above would be averted. When "no ask" statement is present for a variable, AUTOQUERY, if present, will cause the display of the question, "What is the value of {variable}?". The user can then enter a value for that variable. Therefore, if the consultation stops dead when finding a variable, or an AUTOQUERY-type question appears, the knowledge engineer should check the fact base to determine whether or not some facts are missing.

(2) Black-box testing Black-box testing, also called functional testing, is

based on the definition of what a (piece of) system is intended to do, i.e. on the system's specification, rather than on its structure.

For high-level errors, e.g. the logical errors of rules, TRACE, VARIABLE, RULE, WHATIF and TREE under the CONSULT menu can be used to evaluate the knowledge bases. The debug menu technique makes it convenient for the knowledge engineer to understand and analyze the inference track and system output. For a complex knowledge-based system like the RIVER_NET system, some special cases should also be designed to exercise rules or facts for testing the cor- rectness of the premises, conclusions and the logical relationships.

For the evaluation of the system performance, the integration efficiency is tested according to the designed interface structure of the system modules as shown in Fig. 2. The integration testing of the RIVER_NET system has been performed by a "big- band" testing strategy. 9 With big-band testing, one can first test all the modules of a system separately and then the whole system at once. Therefore, testing proceeds from module testing to system testing. For a system

452 K.W. CHAU and WEN-WU YANG: VP-EXPERT BASED KNOWLEDGE BASES

consisting of many modules, all intermodule dependen- cies have been tested during the system-testing phase by test cases, specially designed or prototype. An application example, the details of which can be found in the following section, has been used to depict the performance and efficiency of the system.

Last, but not least, the knowledge-based system should also be subjected to vigorous evaluation by domain experts employing test cases.

5. APPLICATION OF THE RIVER NET SYSTEM

As an application example, the system has been used to study the tidal dynamics and potential flood hazards in the Shing Mun River network, Hong Kong. This is a

(a)

river network with one main channel and three tribu- tary channels. The location of the Shing Mun River and its tributary nullahs can be found in Ref. 6.

A case of tidal dynamics is investigated. Tidal forces with amplitude 1.05, 0.85 and 0.50 m corresponding to spring tide, mean tide and neap tide, all with a period of 12.42 h, are imposed at the ocean end. The storm- water discharge, based on a rainfall intensity with a 50- year return period and with peak magnitude approx. 80% of the 200-year storm including the maximum expected overflow from a reservoir, is imposed at the landward boundary and along the channel as lateral inflows. The time of concentration for all these flows is assumed to be the same (3 h). Triangular hydrographs are assumed such that the time to peak magnitude and

I I

.......... i

I I I .......................................................

RIVER NETWORK ...... >

.............................................. I I ..................

I I I I

AMAIN RIVER ..... >

.....................................................................

What is the type of the river : Shing Mun River ? River network A main river

Enter to select END to complete /Q to Quit ? for Unknown

^ Discharge Q (m3/s)

I I. I I I . . . .

I [ ........................................................ > time T

^ Tidal Z (m)

........................................................ > time T What is the nature of the landward boundary condition ? Discharge Tidal

Ente r to s e l e c t END to c o m p l e t e /Q to Q u i t ? f o r Unknown

Fig. 3. (a)

K. W. CHAU and WEN-WU YANG: VP-EXPERT BASED KNOWLEDGE BASES 453

the time to decay to zero discharge are both three hours.

Figure 4 shows the envelope of the water elevation due to the effect of the flood hydrographs applied at the upstream end of the river channel with tidal force of amplitude 1.05 m at the ocean end, which is one of the output curves of the integrated expert system. It can be noted that the graphical representation of the output of the RIVER_NET system is very convenient to eva- luate. It is also found that the solution of the system is satisfactory as compared with the reference, and that consultation with the system is convenient, helpful and intelligent for a non-expert end-user.

6. CONCLUSION

An integrated expert system for unsteady open chan- nel flow in river networks, incorporating a numerical modelling program and the Lotus Symphony System, has been developed and implemented. The RIVER_NET system performs expert decision-making, numerical analysis and result representation for typical hydraulic engineering problems. It possesses friendly user-machine interfacing facilities to assist the hydraulic engineer to define specific tasks, schematize the natural river systems, choose the proper mathema- tical models and numerical schemes, describe the initial

(b)

water surface .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

..... >

flow ..... > ..... >

D I * D I I I l P ~ t l I 0 1 W S l ~ l m t J J , ~ W t P P

rough bottom

lMannlng's coeff. I Type ~-"

const. JConstant Manning vary IVarylng Manning linear J Const linear 0.00 J Frlctlonless

.... o . . . . . . . . . . . . . . . . . . . . . . . . . . . .

What type of bed friction along the channel ? Const Manning Vary Manning Frlctlonless

Const linear

Enter to select END to complete /Q to Quit ? for Unknown

RIVER: Shlng Hun River SECTION

I < . . . . . . . . . . . . . . . . . . . . . . . . . W2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . >I • Flood Plain

Main Conveyance Channel

! Zl (bed level)

• l:Sl

••i:S2

• ./.

I I D1

J I

-/-

I< . . . . . . . . . . wl . . . . . . . . . . >1

What type of variation of W1 of main conveyance channel along the channel? Constant Exponentially Linearly Varying

Enter to select END to complete /Q to Quit ? for Unknown

Fig. 3. Four typical consultation screens of the RIVER_NET system.

454 K.W. CHAU and WEN-WU YANG: VP-EXPERT BASED KNOWLEDGE BASES

4 . 0 B

3.5

,~ 3.0

.~ 2.5

N 2.0 - ~o o Maximum envelope "d

1.5 -- ¢ Minimum envelope "a

1 . 0 -

0.5 -

0.0 0 2 4 6 8

Distance x (km) Fig. 4. Maximum and minimum envelopes of water elevations along the channel due to the imposition of a 50-year stormwater discharge,

coincident with high tide of amplitude 1.05 m.

and bounda ry condit ions, de termine computa t iona l parameters , solve the governing equat ions , and present the final results.

To implement the knowledge-based expert system for uns teady open channel in a river or tidal ne twork , a t ree and its pa ramete r h ierarchy have been designed to s tructure the domain knowledge bases based on the VP-Exper t shell. The archi tecture of the system is described, and it is p roved that the architecture is sat isfactory for the integrated system. Software engi- neering evaluat ion methods , combined with the debug- ging c o m m a n d menu of the VP-Exper t shell were adop ted to test the domain expert system. The white- box testing and black-box testing strategies are demon- strated and were adop ted to evaluate the R I V E R _ N E T

system. The former is used to validate the knowledge bases in a modular way, whilst the latter is used to evaluate the whole system. Some typical rule errors of the knowledge bases and debugging techniques are illustrated. It is found that the run-t ime evaluat ion is an efficient technique for detect ing errors involved in the system at the developmenta l and the later stages. The knowledge-based system was also subjected to vigorous evaluat ion by domain experts employing test cases. By applying it to the solution of typical problems, it has been shown that the integrat ion model is feasible.

Acknowledgement--This project was supported by a grant from the Research Sub-committee of the Hong Kong Polytechnic.

R E F E R E N C E S

1. Bahill A. T. (Ed.) Verifying and Validating Personal Computer-Based Expert Systems. Prentice-Hall, Englewood Cliffs, N.J. (1991).

2. Fox J. A. Transient Flow in Pipes, Open Channels and Sewers. Ellis Horwood, Chichester (1989).

3. Cunge J. A., Holly F. M. and Verwey J. A. Practical Aspects of Computational River Hydrualics. Pitman, London (1980).

4. Chau K. W. and Yang Wen-wu. A knowledge based expert system for unsteady open channel flow. Engng Applic. Arti]~ Intell. 5,425-430 (1992).

5. Friederich S. and Gargano M. Expert Systems Design and Development Using VP-Expert. Wiley, New York (1989).

6. Chau K. W. and Lee J. H. Mathematical modelling of Shing Mun River network. Adv. Wat. Resour. 14, 106-112 (1991).

7. Chau K. W. and Lee J. H. W. A microcomputer model for flood prediction with applications. Microcomput. Civil Engng 6, 109- 121 (1991).

8. Chau K. W. Numerical model for unsteady open channel flow in C. Microcomput. Civil Engng 6, 237-251 (1991).

9. Ghezzi C., Jazayeri M. and Mandrioli D. Fundamentals of Software Engineering. Prentice-Hall, Englewood Cliffs, N.J. (1991).

A U T H O R S ' B I O G R A P H I E S

K. W. Chau is currently senior lecturer at the Department of Civil and Structural Engineering in the Hong Kong Polytechnic, Hong Kong. Wen-wu Yang is employed as research assistant at the Department of Civil and Structural Engineering in the Hong Kong Polytechnic, Hong Kong.