Information Technology Reference
In-Depth Information
fire in a building which is supported through a fire alarm system. Possible actions (states) of
the system turn off the electricity and then to pump water. After just having turned off the
electricity, it does not extinguish the fire, but only the pumping of water guarantees that it
is really extinguished. Using the following guess and check programs
fire
guess
and
fire
check
respectively, we can compute a plan for extinguishing the fire by two actions,
fire
guess
and
fire
check
, the program
fire
guess
guesses all candidate plans
P
=
p
1
,
p
2
, ...,
p
n
using time points
for action execution,
fire_guess:
% Timestamps:
time(0).
time(1).
% Guess a plan:
turn_off(T) v -pump(T) :- time(T).
pump(T) v -pump(T) :- time(T).
% Forbid concurrent actions:
:- pump(T), turn_off(T).
while
fire
check
checks whether any such plan
P
is conformant
for the goal
g
=
(
)
not
extinguished
The final constraint eliminates a plan execution if it reaches the goal; thus,
fire
check
has no answer set if the plan
P
is conformant.
fire_check:
% Initial state:
fired(0) v -fired(0).
% Frame Axioms:
fired(T1) :- fired(T),
time(T),
not -fired(T1),
T1=T+1.
turned_off(T1) :- turn_off(T),
T1=T+1.
% Effect of turning off:
turned_off(T1) :- turn_off(T),
T1=T+1.
fired(T1) v -fired(T1) :- turn_off(T),
fired(T),
T1=T+1.
2
% Effect of pumping:
-fired(T1) :- pump(T),
turn_off(T),
T1=T+1.
% Check goal in stage 2 (constraint):
:- not fired(2).
The program
fire
guess
generates the answer set
S
=
{
time
(
0
)
,
time
(
1
)
,
turn
off
(
0
)
,
pump
(
1
)
}
which corresponds to the (single) conformant plan
{
P
=
turn
off
,
pump
}
for goal not
. Using the method
fire
guess
and
fire
check
can be integrated automatically into a single
program
fire
solve
=
fired
(
2
)
fire
check
It has a single answer set, corresponding to the single
∨
fire
guess
conformant plan
P
as desired.
With these examples in mind, we now turn to the problem of diagnosing such ontologies.
As should have become evident by now, spotting an error in a large-scale program is a
challenging task. We deliver a solution that is flexible and can be implemented with widely
standard components. In particular, our proposal does not require substantial changes to an
=
{
turn
off
,
pump
}
Search WWH ::
Custom Search