L OGIC P ROGRAMMING TOOLS
APPLIED TO
F IRE D ETECTION
IN
H ARD - COAL M INING
Logic Programming Tools applied to Fire Detection in Hard-coal Mining Wolfram Burgard, Armin B. Cremers, Dieter Fox, Dirk H¨ahnel, Angelica M. Kappel, and Stefan L¨uttringhaus-Kappel Institut f¨ur Informatik III, Universit¨at Bonn, R¨omerstr. 164, D-53117 Bonn In Cooperation with Ruhrkohle Westfalen AG E-mail: fwolfram,abc,fox,angelica,
[email protected]
We present a system for fire detection in hard-coal mines based on a multiparadigm approach. ¨ B ONN U NIVERSITAT
Two Prolog-based tools have been developed, which are suitable for general applications as well.
¨ I NFORMATIK III I NSTITUT F UR
L OGIC P ROGRAMMING TOOLS
APPLIED TO
F IRE D ETECTION
IN
H ARD - COAL M INING
Forecasting of Carbon Monoxide by Adaptive Techniques Observations
[ppm/100]
The clouds of CO stream with the air through the mine. The CO-curves of sensors located one after another are correlated.
succ pred
8000 6000 4000 2000 680
700
The time delay between subsequent sensors undergoes only small short term changes.
720
740 [Minuten]
760
780
800
Blasting curve
The shape of CO-curves slightly changes from one sensor to the next.
10000 [ppm/100]
10000
Consequence
succ pred
8000 6000 4000 2000
CO-values measured at a CO-sensor can be predicted by the CO-curve of the preceeding COsensor(s).
0
500
1000
1500 [Minuten]
2000
2500
3000
Sample data
Adaptive forecasting techniques 6000
[ppm/100]
Based on sample data we extract: Time delay of the air stream between the COsensors. Functional dependency of the CO-values measured at the CO-sensors:
succ prediction
4000 2000
1140
1160
– Physical process of whirling of the COcurve ) gaussian dependency.
1220
1240
1260
succ pred1 pred2
[ppm/100]
900
The parameters are optimized by maximizing the correlation between the different curves of the sample data.
600 300 0
100
200 300 [Minuten]
400
500
Sample data
Advantages No series of similar (false) alarms.
1200 [ppm/100]
1200 [Minuten]
Prediction based on the sample data
– Chemical process of loss of CO ) linear dependency.
1180
Attention is focussed on the first CO-sensor where high CO-concentrations are observed. Thresholds for warnings and alarms can be reduced, improving security.
succ prediction
900 600 300 50
100
150
200
250 300 [Minuten]
350
400
Prediction based on the sample data
¨ B ONN U NIVERSITAT
¨ I NFORMATIK III I NSTITUT F UR
450
500
L OGIC P ROGRAMMING TOOLS
APPLIED TO
F IRE D ETECTION
IN
H ARD - COAL M INING
CO-Monitoring in Hard-Coal Mines
messages
fire detection messages
measuring values
forecasting
values
messages
values
filtering
values
values slopes slopes
linear regression
control msg.val.
msg.val.
msg.val.
checklimit
tend. short
tend. long
Module hierarchy of the monitoring system
CO-Monitoring
Control
CO-monitoring of one sensor is distributed over several program modules. CO-monitoring is executed in parallel for all sensors in the mine.
CO-values are examined in four different ways: Thresholds observation
Measurement
Filtering of high CO-values caused by human activities, e. g. blasting operations
CO-monitoring works on two kinds of input data:
Tendency analysis over short time periods
measured values retrieved online from a process computer
Tendency analysis over long time periods
predicted values computed by a forecasting component
¨ B ONN U NIVERSITAT
¨ I NFORMATIK III I NSTITUT F UR
L OGIC P ROGRAMMING TOOLS
APPLIED TO
F IRE D ETECTION
IN
H ARD - COAL M INING
Heuristics and Tools for CO-Monitoring
waiting
T
waiting
next section
fire alarm: no turning point
waiting
next section
M
fire alarm: no maximum
E
fire alarm: no end
Graph representation of the algorithm filtering blasting curves
The filtering algorithm for blasting operations is based on well-evaluated heuristics using turning point, maximum, and end of the blasting curve. CO-monitoring requires a high-level programming language supporting rule-based expression of algorithms. Our executable specification language SEA (Streams in EA) provides parallelism, descriptiveness, transparency and efficiency. The high level of abstraction supports verification and improves transparency of the system.
if
filtering = on & turning_point = yes & maximum = no & minutes < maxminutes & head(slope) >= 0 then mark_value, next_values; if
filtering = on & turning_point = yes & maximum = no & minutes < maxminutes & head(slope) < 0 then maximum := yes, mark_value, next_values; if
filtering = on & turning_point = yes & maximum = no & minutes = maxminutes then head(message)="Blasting, no maximum", message := tail(message), filtering := off, set_value, next_values;
SEA code implementing the filtering algorithm
¨ B ONN U NIVERSITAT
¨ I NFORMATIK III I NSTITUT F UR
L OGIC P ROGRAMMING TOOLS
APPLIED TO
F IRE D ETECTION
IN
H ARD - COAL M INING
SEA: A Rule-Based Specification Language algebra factorial defines fac( +x, ?y ); local i, p;
Evolving Algebras
start i := x, p := 1;
Evolving Algebras (EAs), introduced by Gurevich and intensively investigated by B¨orger, turned out to be a powerful rulebased specification tool.
transitions; if i =< 1 then y = p, stop; elseif i > 1 then p := p * i, i := i ? 1; end.
Various EA-applications in different fields are known, e. g. system architecture, language definition.
algebra kz konf defines kzk(+geraet, *werte, ?konf); local counter ok, counter void, darf void, muss ok; external define epsilon/2;
EA research now is focused on practical tools making EAs executable.
start counter ok := 30 + define epsilon(geraet), counter void := 0, darf void := 5, muss ok := 20 + define epsilon(geraet); transitions; if empty(werte) then konf = [], stop; elseif head(werte) = void, counter void >= darf void then head(konf) = nein, konf := tail(konf), werte := tail(werte), counter ok := 0; elseif head(werte) = void, counter void < darf void then head(konf) = ja, konf := tail(konf), werte := tail(werte), counter void := counter void + 1; elseif head(werte) /= void, counter ok < muss ok then head(konf) = nein, konf := tail(konf), werte := tail(werte), counter ok := counter ok + 1; elseif head(werte) /= void, counter ok >= muss ok then head(konf) = ja, konf := tail(konf), werte := tail(werte), counter void := 0; end.
Logic Programming Implementation SEA is an implementation of parallel and modular EAs. SEA modules are compiled into Prolog predicates. SEA extends the Evolving Algebra approach by stream parallelism. The parallel execution model assumed in SEA is committed choice and-parallel concurrency.
¨ B ONN U NIVERSITAT
¨ I NFORMATIK III I NSTITUT F UR
L OGIC P ROGRAMMING TOOLS
APPLIED TO
F IRE D ETECTION
IN
H ARD - COAL M INING
SEA: A Parallel Modular EA Implementation Streams in EAs
algebra ”Quicksort” defines qsort( *in, *out);
SEA is a modular language allowing parallel execution of modules.
external split/4, app/3;
SEA supports partially bound data structures, e.g. streams.
transitions; if empty(in) then out = [], stop; else var [smaller, bigger], split(head(in),tail(in),smaller,bigger), out = app(qsort(smaller), [head(in)jqsort(bigger)]), stop; end.
SEA programs are translated into efficient Prolog code. The Quicksort algorithm on the right side is translated exactly into the well-known Prolog procedure.
algebra ”Split” defines split( +number, *l, *small, *bigg);
SEA modules
transitions; if empty(l) then small = [], bigg = [], stop; elseif nonempty(l) & head(l) > number then head(bigg) = head(l), bigg := tail(bigg), l := tail(l); else head(small) = head(l), small := tail(small), l := tail(l); end.
An SEA module (algebra) consists of a module head and a module body. The module head defines – name and interface of the module – (static) external functions – (dynamic) local functions – an initial state. The module body is a set of transition rules. Transitions consist of conditions and updates.
algebra ”Append two lists” defines app(*l1, *l2, *l3); transitions; if empty(l1) then l3 = l2, stop; else head(l3) = head(l1), l3 := tail(l3), l1 := tail(l1); end.
Module parameters are treated as local functions. All local functions may be annotated with modes. Local functions evolve over time. Process communication and synchronization is realized by streams.
¨ B ONN U NIVERSITAT
¨ I NFORMATIK III I NSTITUT F UR
L OGIC P ROGRAMMING TOOLS
APPLIED TO
F IRE D ETECTION
IN
H ARD - COAL M INING
The Graphical User Interface General Tasks Display of actual fire alarm messages. Graphical display of a mine model. Visualization of CO curves in several ways. Maintaining the graphical mine model. Maintaining device dependent parameters, e. g. thresholds. A typical Blasting Curve floating through the Mine
Maintaining forecasting parameters by starting the adaptive generator program with semiautomatically selected input data. Visualization The user interface permits to observe stored data from a selected time interval. actually online data. If the forecasting method is applied, the expected CO-values are shown in advance.
A Blasting Curve and its forecasted Domain
forecasted values computed from stored data and the distance to the measured values. Implementation The graphical user interface has been developed on the basis of PAT (Prolog and Tcl/Tk).
Online Visualization with predicted Bounds
¨ B ONN U NIVERSITAT
¨ I NFORMATIK III I NSTITUT F UR
L OGIC P ROGRAMMING TOOLS
APPLIED TO
F IRE D ETECTION
IN
H ARD - COAL M INING
Maintaining a Graphical Mine Model Observation Knowledge about the position of CO-sensors and their relation to other devices is essential for our forecasting component. In a coal mine, CO-sensors are installed, moved or removed frequently. The mining staff has to update the topological model almost every day.
A Browser for Topological Data of CO-Devices
Supporting Tools A browser for CO-devices allows to maintain parameters of the mine model numerically. A graphical editor can be used to change topological parameters graphically. Sensors can be moved, added to or deleted from the model by simple mouse clicks.
A graphical Editor to maintain the Mine Model
¨ B ONN U NIVERSITAT
¨ I NFORMATIK III I NSTITUT F UR
L OGIC P ROGRAMMING TOOLS
APPLIED TO
F IRE D ETECTION
IN
H ARD - COAL M INING
PAT: Prolog and Tcl/Tk
Basics
example :tk_create(pat, "Nice PAT Example", [ canvas(canvas) : position([ left, fill-y ]) : relief(ridge) : width(260) : borderwidth(2), [ button("QUIT", tk_destroy(pat)) : position([ fill-x ]), button("HOUSE", house) : position([ fill-x ]), button("SMILE", smile) : position([ fill-x ]), button("CLEAR", tk_canvas(pat, canvas, clear)) : position([ fill-x ]) ] : position([ left ]) : relief(ridge) : borderwidth(2), [ filebox(filebox, true)] : position([ left ]) : relief(ridge) : borderwidth(2) ]). house :tk_canvas(pat, canvas, line([ (10,200),(10,100),(60,50), (110,100),(10,200),(110,200), (10,100),(110,100),(110,200) ]) : fill(red): width(2)).
PAT is a Logic Programming tool generating X11 applications. PAT consists of a Prolog program library based on ECLiPSe’s interface ProTcXl. Features With PAT, Prolog programmers are able to create X11 graphic widgets without any knowledge of Tcl/Tk. PAT handles all user interface elements as Prolog terms. PAT instructions are conform to the Logic Programming paradigm. Graphical components can be composed to groups using lists. Multiple attributes like e. g. colour and position can be added to any list.
WWW info: http://www.cs.uni-bonn.de/ ˜angelica/PAT ¨ B ONN U NIVERSITAT
¨ I NFORMATIK III I NSTITUT F UR
L OGIC P ROGRAMMING TOOLS
APPLIED TO
F IRE D ETECTION
IN
H ARD - COAL M INING
References Evolving Algebras
Fire detection in Hard-coal Mining W. Burgard, A. B. Cremers, D. Fox, M. Heidelbach, A. M. Kappel and S. L¨uttringhaus-Kappel: Knowledgeenhanced CO-monitoring in Coal Mines. Proceedings of the Ninth International Conference on Industrial & Engineering Applications of Artificial Intelligence & Expert Systems, Fukuoka, Japan, 1996. H. Kartenberg: Bessere Brand¨uberwachung in Strecken mit großen Wetterstr¨omen. Gl¨uckauf-Forschungshefte 48, Nr. 2, 1987. A. Littlewood: Gas Chromatography. Academic Press, 2nd edition, 1970. A. Stark, H. Seyfarth, H. Sredenscheck, and J. Steudel: Stand und Entwicklung der Brandfr¨uherkennung bei der Bergbau AG Lippe. Gl¨uckauf, 118(8):3–7, 1982.
E. B¨orger: Annotated Bibliography on Evolving Algebras. In Specification and Validation Methods, Ed. E. B¨orger, Oxford University Press, 1994. Y. Gurevich: Evolving Algebras. A tutorial introduction. Bulletin of EATCS, 43:264–284, 1991. Y. Gurevich: Evolving Algebras 1993: Lipari Guide. In Specification and Validation Methods, Ed. E. B¨orger, Oxford University Press, 1994. A. M. Kappel: Executable Specifications based on Dynamic Algebras. In A. Voronkov, editor, Logic Programming and Automated Reasoning, volume 698 of Lecture Notes in Artificial Intelligence, pages 229–240. Springer Verlag, 1993.
Prolog and Tcl/Tk D. H¨ahnel, S. L¨uttringhaus-Kappel, A. M. Kappel: PAT: Prolog and Tcl/Tk. Benutzerdokumentation des Entwicklungswerkzeugs. (In German. English version in preparation.) M. Meier: ProTcXl 2.1 User Manual. ECRC Munich, Germany. J. K. Ousterhout: Tcl and the Tk Toolkit. Addison Wesley, 1994.
¨ B ONN U NIVERSITAT
¨ I NFORMATIK III I NSTITUT F UR