Using atms algorithms for real-time applications

Using atms algorithms for real-time applications

Copyright0 IFACAticial Intelligencein Real-TimeContrd, California.USA, 1991 USING ATMS ALGORITHMS FOR REAL-TIME APPLICATIONS B. Fringuelli*, E. Lamma...

640KB Sizes 0 Downloads 68 Views

Copyright0 IFACAticial Intelligencein Real-TimeContrd, California.USA, 1991

USING ATMS ALGORITHMS FOR REAL-TIME APPLICATIONS B. Fringuelli*, E. Lamma**, P. Mello** and G. Santocchia** *Dipartimento

di Matematica,

Universiti

di Pen@,

Via Vanvitelli I,06100

**DEB, Universitd di Bo~o~M, Viale Rirorgimento 2,40136

ABSTRACT

Pen@.

Italy

Bo~o~M, Italy

Dependencies between input and output data are determined by suitable inference rules. Each time the input changes, the problem solver has to properly apply these rules to determine the new value of output. Notice that, if the problem is complex, when updating output the computational cost could be unacceptable. Applying the TMS technology to this problem, instead, greatly decreases this overhead, avoiding the repetition of inferences once made. Assumption-based TMS’s (ATMS) (deKleer, 1986) are the most recent step in the evolution of Truth Maintenance Systems. Although the previous TMS methodologies have been used extensively and successfully, they all had the fundamental limitation of forcing the problem solver to reason in a single context, i.e. with a single set of beliefs. However, many problem solving situations, like the ones we will describe in this paper, require reasoning in multiple contexts at once. Although it is possible to simulate a multiple-context effect in TMS by repeatedly enabling and retracting assumptions, this approach is extremely inefficient. ATMS, instead, works efficiently in a multiple-context domain. In this paper, we point out, through examples, how this feature of the ATMS can be conveniently exploited in the case of applications with time constraints. We map data into ATMS nodes, among which inputs are considered as assumptions. The main advantage is that the ATMS can directly tell if a node holds in a given set of assumptions by a simple subset test. After presenting the application of ATMS with time methodology to systems

In this paper we describe how a rather new Artificial Intelligence methodology, called Assumption-based Truth Maintenance System (ATMS), can be conveniently applied to the case of real-time applications. When considering applications where the input data frequently change, the ATMS efficiently computes the output avoiding the application of inference rules but simply performing set inclusion operations. We point out, through examples, how features of ATMS such as incrementality, multiplecontext and inconsistency handling, can be conveniently exploited in the case of realtime applications.

KEYWORDS Artificial Intelligence, Expert Systems, Inference Processes, Real-time Computer Systems, Rail Traffic, Programming.

INTRODUCTION The Truth Maintenance System (TMS) (Doyle, 1979) is a common tool of Artificial Intelligence technology used to revise the current set of beliefs, making assumptions and subsequently automatically retracting their beliefs when discoveries contradict these assumptions. In this paper we investigate the application of TMS techniques in the case of real-time applications. In particular, we consider the case of applications where the input data frequently change and values for output data have to be computed efficiently.

81

consistent environment combined with all nodes derivable from those assumptions and the current set of justi~cations. The input to an ATMS is a set of assumptions and a set of justifications. The task of the ATMS is to efficiently determine consistent contexts. The problem solver typically supplies the ATMS with justifications and assumptions one at a time, therefore the algorithm is incremental. With each new datum, the ATMS updates the node labels. The two most important queries sent to an ATMS are: 1. whether or not a given context is consistent, and 2. whether a node holds in a particular context. Therefore, the data structures are designed to answer these two types of queries with speed and efficiency. In partcular, the ATMS associate to each node N a label consituted by set of environments (see below) and the set of justifications for N, The ATMS answers the first type of query by a simple look-up in a nogood database which records the minimal inconsistent environments, and the second type of query by consulting the information stored in node labels. An ATMS label is a set of consistent environments associated with every node. The label describes the sets of (minimal) assumptions the node depends on, and is constructed by the ATMS itself. The ATMS guarantees that the label of every node is consistent, sound, complete and minimal with respect to the currentjustification set J. A label is consistent if all its environments are consistent. It is sound if a node N is derivable from every environment E in its label. The label is complete if every consistent environment E from which N is derivable is represented in N’s label, either as is, or as a super set of one of the environments already declared in the label. The label is said to be minimal if no en~ronment in the label is a superset of any other. As a consequence of these requirements on node labels, the ATMS can directly tell if a node holds in some environment by a simple subset test. Thus, any query as to whether the node N holds in an environment E may be quickly answered: if E is either equivalent to or a superset of one of the environments in N’s label, N holds in E. For an example, see section 2.

constraints, via a toy example, we briefly present its application to a real problem. We consider the case of assisting a stationmaster in the real-time management of the train traffic within big railway stations. We focus on the application of the ATMS methodology for designing this system (called Station Master Assistant - SMA), rather than on a deeply discussion of the domain knowledge that can be found in (Fringuelli et al., 1991).

In this section, we briefly recall the basic concepts of Assumption-based Truth Maintenance Systems. More details can be found in (deKleer, 1986). The basic architecture of the overall reasoning system consists of two components: a problem solver which draws inferences and an ATMS which records these inferences. ATMS functions as a cache for all the inference ever made, thus avoiding to repeat them. In contrast to a Justification-based TMS (JTMS) (Doyle, 1979) in which a status In (believed) or Out (disbelieved) is associated with every problem-solving datum (node), there is no notion of “current belief’ in an ATMS, thus there is no such status associated to nodes. In an ATMS, nodes are believed or not only with respect to a particular set of assumptions. The most important data structure in an ATMS is the node la~eZ, which is a specially encoded record of all assumption sets under which the node holds. The node label explicates all possible contexts in which the node is valid. Thus, determining the truth value of an ATMS node given a particular set of assumptions is simply a subset test. An ATMS node corresponds to a problem solver datum. A node is an assumption if the inference engine wishes to analyze later which nodes will follow from it. An ATMS just~~cat~o~ is a Horn clause defining how a node is derivable from other nodes. It has two essential parts: the fact being justified, called the consequent, and a list of facts supporting it, called the antecedents. An ATMS environment is a set (a conjunction) of assumptions. A node N is said to hold in an environment E if it can be derived from E and the current justification set J. An environment E is inconsistent if false (I) is derivable from E and J. An ATMS contert is the set formed by the assumptions of a

82

When one environment E is subsequently deduced to be a nogood, it is recorded in a nogood database, again in a minimal form. The ATMS consequently removes all environments in node labels that subsume E by set inclusion. Notice that if a node N has empty label thus N holds in no environment. If the label consists of the empty environment, then N holds universally. Another characteristic of ATMS is incrementality. At each instant, a new justification can be added without affecting the overall behaviour, and a new label computed for each node. Every ATMS operation which changes node labels can be viewed as adding a justification, therefore the major operation of concern is the addition of a justification. Each new justification initiates an incremental relabeling of involved nodes. The algorithm operates by making the labels locally correct and propagating changes until all labels become globally correct. A logically correct label for a node N can be computed by: 1, Computing a tentative label L’ for N, whose elements are the union of all possible combinations of picking one environment for each antecedent node label, and adding L’ to the old label of N. 2. Removing all nogoods and subsumed environments. If the label of N has not changed, the algorithm terminate. Otherwise: 1. If N is a contradiction node: a) Mark all the environments in the new label as nogood. b) Remove all new nogoods from every node label. 2. If N is not a contradiction node, then recursively update all consequences of N.

The logic circuit can described by using Horn clauses (which correspond to justifications) as follows: A, not-B + D not-A, B + E A,B-+C D+S E-+S Each time the input changes, the problem solver has to properly apply these rules to determinethe new truth value of output. It is trivial to notice that, if the problem is more complex (e.g. the depth of rule chain increases) the computational cost could increase a lot. Applying the ATMS to this problem, instead, avoids the repetition of inferences once made. Computing the new truth value for outputs, given a particular truth value for the inputs, only requires a subset test. In the following we better explain how this result can be obtained. A and B are mapped into assumptions. The ATMS maintains the following data structures, which associate labels (and justifications, here omitted for simplicity) to every node: CD, ((A,not_B)l, ...> eE, ((not_A, Bll, ...> 43, {{A,not_Bf, fnot_A, Bll, ...> Notice that, in this case, assumptions are supported by themselves. In order to determine if S has value true (i.e. 1) it is sufficient to test if (at least) one environment in S’s label is a subset of the current input status. For example, if A and B have value true (i.e. l),S has value false since neither (A,not_B) nor (not-A, B) is a subset of (A, B). If A has value true (i.e. 1) and B value false (i.e. 01, i.e. the believed environment is (A, not-B), S has value true. Then, thanks to the ATMS we are able to pass from a high-level, flexible but

2. A TOY l!lXAMPW IN LOGIC ClRm In the following we present a toy example to explain how the ATMS works and to point out its advantages in the case of quickly determining the output of the system, when input data changes. We consider the case of a half adder circuit. A half adder circuit is a circuit which sums two single-bit inputs and produces as output their sum and carry (see figure 1). In the following, data A and B are the input of the systems, while C (curry) and S (sum) the output. D and E are intermediate signals.

83

inefficient description of the circuit in terms of inference rules to a less expressive but more efficient one (that can be compared to the truth table of the circuit and its minimal synthesis). Notice that, the ATMS does not deal explicitly with negative information. So, for example, it could be possible to determine the current context starting from believed environment as (A, not-A, B), which is clearly inconsistent. Therefore, we have to add explicit justifications which determine inconsistent environments, e.g.: A, not-A + _I_ B, not-B + I In such a case, the nogood database is composed of the environments (A, not-A) and (B, not-B). Explicitly stating nogood environments turns to be useful in real-time applications where sometimes input data are not reliable thus inconsistencies can arise during the monitoring. Moreover, notice the multiple context feature offered by the ATMS. In the example above, the ATMS maintains simultaneously both characterized by the the context environments (A, B) and the context characterized by the environments [A, not-B) (even if they are inconsistent each other). If the believed environment is (A, B) and B changes its value, we simply switch the context, without any high-cost computation. Such a feature is not provided in Justification-based TMSs. The incrementality feature of ATMS, i.e. the capability of dynamically adding justifications, can be useful since it allow us to add on-line new knowledge, in terms of rules, without the need of re-configuring the system. To better explain this feature, let us consider the addition of the following justification: S,B+T where T is a new datum of interest. A new (sound and consistent) label L’ for T is computed starting from the labels of S and B, L’=({A,not_B,B), (not-A, B)). Making this tentative label minimal and consistent produces the following data structure: Notice that in this case we only put away the environment (A, not-B, B) since it is a superset of the nogood environment (not-B, B). No further label updating takes place in this case, since T is a new node which does not justify any previous one.

3. A REAL APPLICATION TRAFF’IC CONTROL

IN RAILWAY

In this section, we discuss the application of ATMS technology to a real problem with time constraints. We consider the case of train traffic management within big railway stations. In this setting, the work of the station-master consists in deciding quickly which route to assign a train entering or leaving the station, on the basis of the current state of the station. He needs to know at any time if a particular route is feasible, in order to assign it to a train. The station-master often suffers from information overload, particularly when trains delay thus upsetting the railway timetable or failures occur in the station. Assisting the station-master in route planning is fundamental in order to prevent deadlock situations and improve the management of the railway station. To this purpose we developed an expert system (called Station Master Assistant - SMA) (Fringuelli et al., 1991) by using KEE (IntelliCorp, 1984) which provides an ATMS tool. Here we focus on the application of the ATMS methodology to SMA design, rather than on a deeply discussion of SMA domain knowledge that can be found in (Fringuelli et al., 1991). The most important feature of SMA is to assist the station-master in the route planning, by continuously presenting the route-feasibility of the whole station on the basis of the state of each station device (i.e. track-segments, points, signals and positions). Thus the input of the system is represented by the global state of the station, which changes dynamically. By considering a medium size station, the global state of the station is formed by a quite big number of station devices and routes. In fact a station with about 20 track-segments has approximately 100 routes and increasing the track-segments number, the routes number augments in a non-linear way. The fundamental requirement we had to respect in designing SMA was the time constraint since it must give its advices almost immediately in a time comparable to that of human decision making. With respect to the ATMS, in SMA we consider as input the information concerning the state of station devices (e.g. the State of the Track-segment number 3 is

a4

feasible(route_l-2) and feasible(route_l-3) are believed nodes since they are characterized by one environment which is a subset of the current one. If now, for example, a train covers the route 1,2 the track segments tsl and ts2 become not free and neither feasible(route_l-2) nor feasible(route_l-3) are believed since they are characterized by environments which are inconsistent which the current one.

FREE, the State of the Point number 12 is OUT OF ORDER). This input is mapped into ATMS assumptions. Output data are the concerning the state information (feasibility) of routes, (e.g. the route from the position 3 to the position 4 is feasible) and are nodes which are not mapped into assumptions. We formalize justifications that state route feasibility on the basis of the state of the station. For example, a justification for the derived fact “feasible route 4-5” (where the route 4-5 covers the track-segment 3, 4 and 5) is: free(ts3), free(ts41, free(ts5)+feasible(route_4-5). It worth noticing that just before starting the system we had many different possible contexts, every one consistent, but only believed, i.e. the default one corresponding to the state where all the station devices available and consequently all the routes feasible. At run time, we query the ATMS with the set of assumptions corresponding to the current state of station devices. The ATMS determines the context in which the set of supplied assumptions is believed by subset operations, and determine if a route is feasible by a set membership operation. Thus, the real time constraint is satisfied since no deduction is performed. Let us consider the following example. We suppose to have the assumptions: free(ts1) free(ts2) free(ts3) not_free(tsl) not_free(ts2) not_free(ts3) and the following justifications: free(tsl), free&s21 + feasible(route_l-2) free(tsl), free(ts3) + feasible(route_l-3) free(tsl), not_free(tsl) + I free(ts2), not_free(ts2) + I free(ts3), not_free(ts3) + I The ATMS create, among the others, the following nodes: cfeasible(route_l-21, ((free(tsl>,free(ts2)11, . ..> The nogood database is: ( (free(tsl),not_free(tsl)l, (free(ts2), not_free(ts2)1, (free(ts31, not_free(ts3)1 1. Let us suppose that the current input is (free(tsl), free(ts21, free(ts3)), i.e. all the track segments are free. Then, both

CONCLUSIONS This work proves that artificial intelligence techniques can be suitably applied, in some case, to systems with time constraints. In we have investigated the particular, application of Assumption-based Truth Maintenance Systems (ATMS). ATMSs are provided in many commercially available expert system shells (e.g. KEE). We developed a real, large application in the rail traffic domain by using KEE. The main problem in further enhancing the efficiency of the implemented system is that KEE has many features (such as different problem-solving strategies, inheritance mechanisms, graphics, etc.) which are not necessary for this kind of applications and greatly affect performance. Therefore, we are considering simpler systems, just implementing the ATMS algorithm. In the next future it could be useful to develop a dedicated architecture (for example exploiting parallelism or using gate arrays) for an efficient implementation of ATMS algorithms

Acknowledgements This work has been partially supported by SASIB S.p.a. and M.U.R.S.T. 60%.

REFERENCES Fringuelli

B.,

Lamma

E.,

Mello

P.,

Santocchia G. (1991). An Expert System for Train Traffic Control. Proceedings Dert Svw Their ADDlications - AVIGNON91. Vol. 6. Avignon (F).

85

demeer J. (1986). An Assumption-eased Truth ~ain~nance System. Artificiarl . m 28, 127-162. Doyle J, (1979). A Truth Maintenance System . Artificial Intem, U., 231272. IntelliCorp Inc. (1984). The Knowledge Engineering Environment.

86