Reasoning about Discontinuities in the Event Calculus

Rob Miller Department of Computing,

Imperial College of Science, Technology & Medicine,

180 Queen’s Gate, London SW7 2BZ, U.K.

rsm@doc.ic.ac.uk http://www.doc.ic.ac.uk/˜ rsm/

Murray Shanahan Department of Computer Science, Queen Mary & Westfield College,

Mile End Road, London E1 4NS, U.K.

mps@dcs.qmw.ac.uk http://www.dcs.qmw.ac.uk/˜ mps/

This paper appears in the proceedings of KR’96, but without Appendix B.

Abstract

This paper describes a logic-based formalism which combines techniques for reasoning about actions with standard mathematical techniques for modelling dynamic systems using the differential calculus. The formalism inherits a robust solution to the frame problem which can handle concurrency, non-determinism, domain constraints and narrative. It also incorporates a mechanism for reasoning about the boundary conditions associated with systems of differential equations defined over various intervals. This mechanism overcomes a number of drawbacks of previous systems.

1 INTRODUCTION

Solutions to the frame problem now exist which can handle a variety of phenomena, such as narrative, concurrent action and non-deterministic action (see (Shanahan 1997) for a general discussion). However, the topic of continuous change has received relatively little attention in the Reasoning about Action literature. In particular, a satisfactory general framework has yet to be developed which reconciles logic-based techniques for reasoning about action with the standard mathematical approach to modelling dynamic systems, using differential calculus.

Some previous logic-based approaches to reasoning about action do allow limited types of mathematical expressions involving continuously varying parameters to be embedded within domain descriptions. For example, Shanahan (1990) presents a logic programming approach to representing continuous change, based on the event calculus of Kowalski and Sergot (1986). Further work along these lines has been done by Van Belleghem et al. (1994), whose treatment allows a wider class of mathematical expressions, by Shanahan (1995), where a full predicate calculus version using circumscription is presented, and by Herrmann and Thielscher (1996), whose notion of a process generalises Shanahan’s notion of a trajectory. However, none of these frameworks incorporates the notion of a derivative function. Hence any differential equations representing the domain have to be solved before they can be added to the model.

In contrast, Sandewall (1989a, 1989b) presents an approach to continuous change which combines logic and differential equations. Sandewall identifies the need to incorporate mechanisms within such frameworks to deal with the boundary conditions usually associated with sets of such equations. He advocates a default reasoning method, based on Shoham’s notion of chronological minimisation (Shoham 1988), to generate new boundary conditions when an action or event transforms one mathematical model into another. However, as shown by Rayner (1991), Sandewall’s approach leaves open the possibility of anomalous models. Miller (1996) introduces techniques for incorporating differential equations within a circumscribed situation calculus. He avoids Rayner’s anomalous models through the use of a (minimised) Breaks predicate, which describes when actions cause discontinuities in particular parameters.

This paper draws on the techniques of (Miller 1996) in order to construct an event calculus resembling that of (Shanahan 1997, Ch. 16), but which allows continuous change to be described using arbitrary systems of differential equations. Unlike existing versions of the situation calculus which can handle continuous change, such as (Miller 1996) and (Reiter 1996), this calculus inherits the ability to handle domain constraints, concurrent actions, and actions with non-deterministic effects from the event calculus (Shanahan 1997, Ch. 16).

2 TWO EXAMPLES

Both the examples below help to illustrate how arbitrary systems of simultaneous differential equations can be incorporated within an axiomatic description of a given domain. The first, adapted from (Shanahan 1996), concerns the movement of a mobile robot, which will stop whenever it bumps against an object (in this case, a wall). It thus shows how the formalism represents actions (events) which are “triggered” when certain conditions occur. The second is a modification of the “water tanks” example from (Miller 1996). It shows how the formalism supports reasoning about concurrently performed actions (a tap is opened, and some water is simultaneously scooped from a tank). A key feature of both these examples is that, as is usual in the mathematical modelling of dynamic systems, the continuously changing aspects of the domain are represented as a system of (possibly simultaneous or coupled) differential equations, together with one or more sets of boundary conditions (or initial conditions). In such models, the complete set of boundary conditions may not be listed – some conditions are implicit in the accompanying physical description of the domain, or are “common sense”.

In this section we concentrate on showing how both examples can be modelled “conventionally” using differential calculus, highlighting some of the reasoning processes involved in obtaining explicit mathematical expressions for parameters’ behaviours over time. In both cases we go into some mathematical detail, primarily in order to analyse why and how specific values are assigned to arbitrary constants of integration during the mathematical modelling process. This analysis is central to the understanding of the rest of the paper. As we shall see, these value assignments are based partly on “common sense”, and it was incomplete modelling of this implicit assignment process which lead to problems with anomalous models in the work of Sandewall (1989a, 1989b).

In both examples, dashes (′) are used to refer to derivatives of parameters – for example, P′ refers to the first derivative with respect to time of P.

2.1 THE MOBILE ROBOT EXAMPLE

The robot in this example can start (and stop) moving at any constant speed in the direction it is facing (its “bearing”). It can also (continuously) vary its bearing by turning at any constant angular velocity, possibly while moving. It can therefore follow any path consisting of a series of circle fragments and straight lines. It has sensors which will cause it to stop if it bumps against any object. We will represent the following scenario. At time 0 the robot is stationary at the point (0, 0), facing east, and has angular velocity 0. At time T_{1} it starts moving forward (east) at speed S^{+}. At time T_{2} it also starts to turn in a anticlockwise direction with angular speed A^{+}. Some time later it bumps into the only other object in the domain – a wall (of “infinite length”) running east-west, at a distance D_{W} due north from the origin.

[figure: (0, 0); Robot’s path; Wall; T_{1}; T_{2}; T_{B}; D_{W}]

By idealising the robot as a moving point and the wall as a fixed line, a mathematical model of this domain can be formulated in a simple way, using the parameters (real-valued functions of time) Bearing, NSP (“North-South-Position”), and EWP (“East-West-Position”). We can write down the following mathematical constraints between these parameters using the “constants” S (forward speed) and A (angular speed), whose values are determined directly and instantaneously by the robot’s actions, or by the event of bumping into the wall.

\begin{matrix}EWP′(t) = S. cos(Bearing(t)) & (1) \\ NSP′(t) = S. sin(Bearing(t)) & (2) \\ Bearing′(t)=A & (3) \end{matrix}

Let T_{B} be the time that the robot bumps against the wall. We know that EWP (0) = NSP (0) = Bearing(0) = 0, that NSP (T_{B}) = D_{W}, and that, because of the robot’s actions and the effect of bumping into the wall,

for 0 ≤ t ≤ T_{1}:  A = 0 and S = 0  (4)
for T_{1} < t ≤ T_{2}: A = 0 and S = S^{+}  (5)
for T_{2} < t ≤ T_{B}: A = A^{+} and S = S^{+}  (6)
for T_{B} < t:  A = 0 and S = 0  (7)

The formalism described in this paper allows us to include equations (1)–(3) directly in the domaindependent axiomatisation, rather than first having to solve them to determine an explicit or stratified set of expressions for EWP, NSP and Bearing, as in (Shanahan 1990) and related approaches. It also allows us to infer (4)–(7) from more general knowledge, both about the effects and timings of the robot’s actions, and about the general hypothetical circumstances under which the robot will bump into the wall.

It is important to note, however, that from a strictly mathematical point of view, expressions (1)–(7) do not contain enough information to uniquely determine the position of the robot at a given time T (even when considered together with information about the values of each parameter at time 0). An assumption also has to be made that EWP, NSP and Bearing are continuous at times T_{1}, T_{2} and T_{B}. The simultaneous solution to (1)–(3) for any given value of S and A (obtained by integrating (3), substituting the answer in (1) and (2), and integrating again) is

EWP (t) = \frac{S}{A} sin(At + C_{1}) + C_{2}
NSP (t) = \frac{−S}{A} cos(At + C_{1}) + C_{3}
Bearing(t) = At + C_{1}

where C_{1}, C_{2} and C_{3} are arbitrary constants of integration. In the time interval [0, T_{1}] (when S = A = 0), the values of these constants can be computed using knowledge about the initial values of the three parameters, but in the intervals (T_{1}, T_{2}], (T_{2}, T_{B}] and (T_{B}, ∞), C_{1}, C_{2} and C_{3} can only be given specific numerical values by making continuity assumptions. Fortunately, it is “common sense” that the robot cannot instantaneously shift its own position or bearing. However, it is not difficult to imagine another scenario where some external action (such as giving the robot a good shove from behind) does cause an instantaneous shift in position (at least at the level of detail at which we wish to model the domain).

The formalism described below provides a general purpose default reasoning mechanism which allows us to infer the extra common sense information that the parameters EWP, NSP and Bearing are continuous at times T_{1}, T_{2} and T_{B} (when particular actions or events cause discontinuities in some or all of their derivatives, or in other unrelated parameters), without forbidding, in principle, the existence of other actions or events that could potentially cause discontinuities in the robot’s position or orientation. Putting all this together, it allows us to infer the explicit values of EWP, NSP and Bearing at any time t, and (assuming that D_{W} < \frac{2S^{+}}{A^{+}} , so that the robot doesn’t turn in a full circle and miss the wall) it allows us to infer that

T_{B} = T_{2} + \frac{1}{A^{+}} arccos(1 − \frac{A^{+}.D_{W}}{S^{+}} )

The formalism is “elaboration tolerant” in the sense that, at some later date, we can represent new knowledge about other effects of the robot’s actions, or about other occurrences of actions or events at specific times, simply by adding to the existing set of domaindependent axioms.

2.2 THE WATER TANK EXAMPLE

This example involves an open-top water tank. In the bottom of the tank are two taps, T apC and T apD, both of which (when open) discharge water out of the tank at a rate proportional to the level of water in it (i.e. at a rate proportional to the water pressure at the bottom of the tank). Initially, both taps are closed, and the level of water in the tank is L. At time T_{1}, half the water is (instantaneously) scooped out of the tank, and, simultaneously, T apC is opened. At time T_{2}, T apD is also opened.

[figure: T apC; T apD; L; 0; T_{1}; T_{2}; t; T apC ; opened ; & ; water ; scooped; \begin{matrix}T apD \\ opened \end{matrix}]

A mathematical model of this domain can be formulated using three parameters. Level(t) is the function representing the level of water in the tank, and F lowC(t) and F lowD(t) represent the water flow through T apC and T apD respectively. Let K be the constant of proportionality between the level of water and the flow through either of the taps when open. The following equations are each applicable in the circumstances indicated

Always:  Level′(t) =  (8)
−(F lowC(t) + F lowD(t))
T apC closed: F lowC(t) = 0  (9)
T apC open: F lowC(t) = K.Level(t)  (10)
T apD closed: F lowD(t) = 0  (11)
T apD open: F lowD(t) = K.Level(t)  (12)

In the interval [0, T_{1}] the relevant equations are (8),

(9) and (11). Their simultaneous solution is

\begin{matrix}Level(t) = C_{4} & (S1) \\ F lowC(t) = 0 & (S2) \\ F lowD(t) = 0 & (S3) \end{matrix}

where C_{4} is an arbitrary constant of integration. In fact, since we have also been given the initial condition Level(0) = L, we know that C_{4} = L.

At time T_{1}, T apC is opened, so that in the interval (T_{1}, T_{2}] the equations to solve are (8), (10) and (11). Their simultaneous solution is

Level(t) = C_{5}.e^{−Kt} F lowC(t) = C_{5}.Ke^{−Kt}

F lowD(t) = 0

where C_{5} is an arbitrary constant of integration. We also know that the water level in the tank is instantaneously decreased from L to \frac{L}{2} at T_{1} by a “scoop” action. Hence, with a little algebra, it is easy to see that C_{5} = \frac{L}{2}e^{KT_{1}}. So the overall solution for t ∈ (T_{1}, T_{2}] is

\begin{matrix}Level(t) = \frac{L}{2}e^{−K(t−T_{1})} & (S4) \\ F lowC(t) = \frac{LK}{2} e^{−K(t−T_{1})} & (S5) \\ F lowD(t) = 0 & (S6) \end{matrix}

In the interval (T_{2}, ∞), both T apC and T apD are open, and the equations to solve are (8), (10) and (12). Their simultaneous solution is

Level(t) = C_{6}.e^{−2Kt} F lowC(t) = C_{6}.Ke^{−2Kt} F lowD(t) = C_{6}.Ke^{−2Kt}

where again C_{6} is an arbitrary real valued constant.

What value should C_{6} take? Everyday knowledge about taps and tanks tells us that Level(t) is continuous at T_{2}. In other words, we know that by itself the action of turning on T apD will only cause water to disappear from the tank gradually, not instantaneously. (Although, at the level of physical detail we have chosen to incorporate in our mathematical model, the action of scooping water from the tank does cause the water level to drop instantaneously.) Hence C_{6} = \frac{L}{2}e^{K(T_{1}+T_{2})}, and the overall solution for t ∈ (T_{2}, ∞) is

\begin{matrix}Level(t) = \frac{L}{2}e^{K(T_{1}+T_{2}−2t)} & (S7) \\ F lowC(t) = \frac{LK}{2} e^{K(T_{1}+T_{2}−2t)} & (S8) \\ F lowD(t) = \frac{LK}{2} e^{K(T_{1}+T_{2}−2t)} & (S9) \end{matrix}

Notice that, if instead we had wished to keep F lowD and its derivatives continuous at T_{2}, we could have made the assignment C_{6} = 0. Alternatively, if we had wished to keep the first derivatives Level′ and F lowC′ continuous, we could have made the assignment C_{6} = \frac{L}{4}e^{K(T_{1}+T_{2})}. The important general point here is that in many mathematical models, it is possible to trade discontinuities in some parameters for discontinuities in others, using alternative assignments of values to (arbitrary) constants of integration. It is only common sense, or extra knowledge about the physical reality of the domain being modelled, that allows us to pick the right assignments from the different sets of possibilities.

The formalism described below allows us to include equations (8)–(12), along with their conditions of applicability, directly in the domain-dependent axiomatisation. The default reasoning method it incorporates allows us to infer that there is a discontinuity in Level at T_{1} (an instantaneous change from the value L to the value \frac{L}{2} caused by the action of scooping water from the tank), but that Level is continuous at T_{2} (although its derivatives are not). In doing so, it correctly eliminates the anomalous models of the domain (which would otherwise be sanctioned by (8)–(12)) in which all (or half) the remaining water in the tank instantaneously disappears at T_{2}, thus illegally “trading” the discontinuity in F lowD (or the discontinuities in Level′ and F lowC′) at T_{2} for discontinuities in Level and F lowC. Hence it allows us to correctly infer the values of Level, F lowC, F lowD and their derivatives at any time t.

3 AN EXTENDED EVENT CALCULUS

The event calculus presented in this section is written in a sorted predicate calculus, with sorts as summarised in the following table.

NAME OF SORT SYMBOL VARIABLES
Actions  A  a, a_{1}, a_{2}, …
Fluents  F  f, f_{1}, f_{2}, …
Times  T  t, t_{1}, t_{2}, …
Parameters  P  p, p_{1}, p_{2}, …
Reals  R  r, r_{1}, r_{2}, …
Domain objects  X  x, x_{1}, x_{2}, …

Models will be considered only in which terms of sort R and T are interpreted as real and non-negative real numbers respectively. The sorting of the predicate symbols^{1} in the language can be understood from their arguments in the axioms below, in which all variables are assumed to be universally quantified with maximum scope unless otherwise stated. The function symbols Value : P × T ↦ R and δ : P ↦ P are also introduced. The term Value(δ(P), T) represents the numerical value of the first derivative of parameter P at time T.

1As mentioned previously, this formalism builds on several previous axiomatisations. However, some predicate and function names have been changed for the sake of clarity. InitialisedTrue and InitialisedFalse correspond to Initially_{P} and Initially_{N} in (Shanahan 1997), and BreaksTo and Value are analogous to InstantEffect and Function in (Miller 1996).

The six core event calculus axioms (EC1)–(EC6) below, which do not directly concern continuous change, are domain-independent, i.e. included in every theory. For the sake of generality, this part of the axiomatisation includes a mechanism, inspired by Kartha and Lifschitz’s work (1994) and Sandewall’s notion of occlusion (Sandewall 1994), for dynamically adding fluents to (and removing fluents from) the “frame” (i.e. the set of fluents subject to the “commonsense law of inertia”). It was first introduced into the event calculus by Shanahan (1995). At time 0, exactly those fluents which have been initialised true or initialised false belong to the frame. These mechanisms are useful, for example, in dealing with domain constraints and non-deterministic actions (Shanahan 1995). However, in the example domains used in this paper, all fluents are permanently subject to the commonsense law of inertia, so that the (universally quantified) sentences [InitialisedTrue(f) ∨ InitialisedFalse(f)] and ¬Releases(a, f, t) may safely be assumed or added to the axiomatisation. Hence axioms (EC1)–(EC6) simply express the following: (1) Fluents which initially hold, or which have been initiated by an occurrence of an action, continue to hold until an occurrence of an action which terminates them. (2) Fluents which do not initially hold, or which have been terminated by an occurrence of an action, continue not to hold until an occurrence of an action which initiates them.

\begin{matrix}HoldsAt(f, t) ← & (EC1) \\ [InitialisedTrue(f) ∧ ¬Clipped(0, f, t)] \end{matrix}

\begin{matrix}¬HoldsAt(f, t) ← & (EC2) \\ [InitialisedFalse(f) ∧ ¬Declipped(0, f, t)] \end{matrix}

HoldsAt(f, t_{2}) ←  (EC3)

[Happens(a, t_{1}) ∧ Initiates(a, f, t_{1})

∧ t_{1} < t_{2} ∧ ¬Clipped(t_{1}, f, t_{2})]

¬HoldsAt(f, t_{2}) ←  (EC4)

[Happens(a, t_{1}) ∧ Terminates(a, f, t_{1}) ∧

t_{1} < t_{2} ∧ ¬Declipped(t_{1}, f, t_{2})]

Clipped(t_{1}, f, t_{2}) ↔  (EC5)
∃a, t[Happens(a, t) ∧ t_{1} < t < t_{2} ∧
[Terminates(a, f, t) ∨ Releases(a, f, t)]]

Declipped(t_{1}, f, t_{2}) ↔  (EC6)
∃a, t[Happens(a, t) ∧ t_{1} < t < t_{2} ∧
[Initiates(a, f, t) ∨ Releases(a, f, t)]]

This basic event calculus can be extended to deal with continuous change as follows. To respect the convention that actions take effect immediately after they occur, it is necessary to axiomatise the mathematical constraint that, at every time-point (including those at which actions occur), the function associated with each parameter is left-hand continuous:

LeftContinuous(p, t)  (EC7)

To describe instantaneous changes in the values of parameters at times when actions occur, and discontinuities in their corresponding functions of time, the predicates BreaksTo and Breaks are introduced. Both are minimised. BreaksTo(A, P, T, R) should be read as ‘at time T, an occurrence of action A will cause parameter P to instantaneously take on value R’. More precisely, Axiom (EC10) below states that if A also happens at time T, then R is the value of the right-hand limit of P at T. BreaksTo is used, for example, to describe the effects of a “scoop” action on the parameter Level in the water tank example. Breaks(A, P, T) can be read as ‘at time T, action A potentially causes a discontinuity in parameter P ’. The following domainindependent axioms make direct use of BreaksTo and Breaks. Axioms (EC8) and (EC9) can be likened to ‘frame axioms’ for parameters. Axiom (EC12) states the relationship between BreaksTo and Breaks, and Axiom (EC12) states that if an action potentially causes a discontinuity in a given parameter, it also potentially causes discontinuities in its higher derivatives.

\begin{matrix}¬[Happens(a, t) ∧ Breaks(a, p, t)] & (EC8) \\ → Continuous(p, t) \end{matrix}

\begin{matrix}¬[Happens(a, t) ∧ Breaks(a, δ(p), t)] & (EC9) \\ → Differentiable(p, t) \end{matrix}

\begin{matrix}[BreaksTo(a, p, t, r) ∧ Happens(a, t)] & (EC10) \\ → RightLimit(p, t, r) \end{matrix}

BreaksTo(a, p, t, r) → Breaks(a, p, t)  (EC11)

Breaks(a, p, t) → Breaks(a, δ(p), t)  (EC12)

For any given time point T, it is useful to be able to refer to the next point after T at which an action occurs, if there is such a point. Axioms (EC13), (EC14) and (EC15) state that if any action occurs at any time point after T, then the term Next(T) refers to the least such time point. (Such points are somewhat analogous to the “least natural time points” discussed in (Reiter 1996).)

t<Next(t)  (EC13)

[t<t_{1} ∧ t_{1} <Next(t)] → ¬Happens(a, t_{1}) (EC14)

\begin{matrix}[Happens(a_{1}, t_{1}) ∧ t<t_{1}] & (EC15) \\ → ∃a.Happens(a, Next(t)) \end{matrix}

Finally, the standard mathematical definitions of Continuous, Differentiable, LeftContinuous and RightLimit are straightforwardly axiomatised using the function symbols Value and δ:

Continuous(p, t) ↔  (A1)

∀r∃t_{1}∀t_{2}[[|t − t_{2}| < t_{1} ∧ 0 < r] → |Value(p, t) − Value(p, t_{2})| < r]

Differentiable(p, t) ↔  (A2)

∀r∃t_{1}∀t_{2}[[0 < |t − t_{2}| < t_{1} ∧ 0 < r] → |(\frac{Value(p,t)−Value(p,t_{2})}{t−t_{2}}) − Value(δ(p), t)| < r]

LeftContinuous(p, t) ↔  (A3)

∀r∃t_{1}∀t_{2}[[t_{2} < t ∧ (t − t_{2}) < t_{1} ∧ 0 < r] → |Value(p, t) − Value(p, t_{2})| < r]

RightLimit(p, t, r) ↔  (A4)

∀r_{1}∃t_{1}∀t_{2}[[t < t_{2} ∧ (t_{2} − t) < t_{1} ∧ 0 < r_{1}] → |Value(p, t_{2}) − r| < r_{1}]

4 DOMAIN-DEPENDENT AXIOMS

4.1 AN AXIOMATISATION OF THE ROBOT EXAMPLE

The robot described in Section 2 can start to move forward or start to turn at any speed, so that two parameterised action symbols are needed, ChangeSpeed : R ↦ A and StartTurn : R ↦ A, where, for example, ChangeSpeed(S) signifies the action of “changing the forward speed to S”. We can describe the properties that these actions actions initiate and terminate using the parameterised fluent symbols Moving : R ↦ F and Turning : R ↦ F, as follows

Initiates(ChangeSpeed(r), Moving(r), t)  (R1)
Initiates(StartTurn(r), Turning(r), t)  (R2)
Terminates(ChangeSpeed(r_{1}), Moving(r_{2}), t) (R3)
← r_{1} ≠r_{2}
Terminates(StartTurn(r_{1}), Turning(r_{2}), t)  (R4)
← r_{1} ≠r_{2}

The following axioms express the fact that a ChangeSpeed action can cause discontinuities in the first derivatives of the parameters NSP and EWP, whereas a StartTurn action can cause discontinuities in the first derivatives of all three parameters in the domain:

\begin{matrix}Breaks(ChangeSpeed(r), δ(NSP), t) & (R5) \\ Breaks(StartTurn(r), δ(NSP), t) & (R6) \\ Breaks(ChangeSpeed(r), δ(EWP), t) & (R7) \\ Breaks(StartTurn(r), δ(EWP), t) & (R8) \\ Breaks(StartTurn(r), δ(Bearing), t) & (R9) \end{matrix}

The constraints (1)–(3) of Section 2 can now be axiomatised as follows:

Value(δ(EWP), t) = r. cos(Value(Bearing, t)) (R10)
← HoldsAt(Moving(r), t)
Value(δ(NSP), t) = r. sin(Value(Bearing, t)) (R11)
← HoldsAt(Moving(r), t)
Value(δ(Bearing), t)=r  (R12)
← HoldsAt(Turning(r), t)

Happens can be used to state that the robot changes speed at time T_{1}, starts to turn at time T_{2}, and stops moving whenever it hits the wall:

Happens(ChangeSpeed(S^{+}), T_{1})  (R13)
Happens(StartTurn(A^{+}), T_{2})  (R14)
[Happens(ChangeSpeed(0), t)  (R15)
∧ Happens(StartTurn(0), t)] ←
[Value(NSP, t)=D_{W}
∧ Value(δ(NSP), t)>0]

Finally, axioms are needed stating various initial conditions, and expressing uniqueness-of-names properties (using the “UNA[…]” notation from (Baker 1991)) for all action, fluent and parameter symbols.

[InitialisedTrue(Moving(0)) ∧  (R16)
InitialisedTrue(Turning(0))]
[InitialisedFalse(Moving(r)) ∧  (R17)
InitialisedFalse(Turning(r))] ← r ≠0
Value(NSP, 0)=0 ∧ Value(EWP, 0)=0  (R18)
∧ Value(Bearing, 0)=0
UNA[ChangeSpeed, StartTurn]  (R19)
UNA[Moving, Turning]  (R20)
UNA[Bearing, NSP, EWP, δ]  (R21)

4.2 AN AXIOMATISATION OF THE WATER TANK EXAMPLE

The following constant symbols will be used to axiomatise the water tanks example. T urnOnC, T urnOnD and Scoop of sort A, OpenC and OpenD of sort F, and Level, F lowC and F lowD of sort P. The (direct) effects of turning on either tap can be described as follows:

\begin{matrix}Initiates(T urnOnC, OpenC, t) & (T1) \\ Initiates(T urnOnD, OpenD, t) & (T2) \end{matrix}

The action of scooping water from the tank has no effect on the fluents in the domain, but instantaneously effects the parameter Level. If the level in the tank is greater than or equal to \frac{L}{2}, a Scoop action reduces the level by \frac{L}{2}. For the purpose of illustration, we will further suppose that if the level in the tank is less than \frac{L}{2}, a scoop action removes all the water from the tank:

BreaksTo(Scoop, Level, t, Value(Level, t) − \frac{L}{2}) (T3)
← Value(Level, t)≥ \frac{L}{2}
BreaksTo(Scoop, Level, t, 0)  (T4)
← Value(Level, t)< \frac{L}{2}

As well as causing a discontinuity in F lowC, the action T urnOnC causes a discontinuity in the first derivative Level′, and, if T apD is open, in the first derivative F lowD′. The effects of T urnOnD are analogous:

Breaks(T urnOnC, F lowC, t)  (T5)
Breaks(T urnOnC, δ(Level), t)  (T6)
Breaks(T urnOnC, δ(F lowD), t)  (T7)
← HoldsAt(OpenD, t)
Breaks(T urnOnD, F lowD, t)  (T8)

Breaks(T urnOnD, δ(Level), t)  (T9)
Breaks(T urnOnD, δ(F lowC), t)  (T10)
← HoldsAt(OpenC, t)

Constraints (8)–(12) of Section 2 are axiomatised as follows:

Value(δ(Level), t) =  (T11)
−(Value(F lowC, t) + Value(F lowD, t))
HoldsAt(OpenC, t) →  (T12)
Value(F lowC, t) = K.Value(Level, t)
¬HoldsAt(OpenC, t) → Value(F lowC, t) = 0 (T13)
HoldsAt(OpenD, t) →  (T14)
Value(F lowD, t) = K.Value(Level, t)
¬HoldsAt(OpenD, t) → Value(F lowD, t) = 0 (T15)

The action occurrences are:

\begin{matrix}Happens(Scoop, T_{1}) & (T16) \\ Happens(T urnOnC, T_{1}) & (T17) \\ Happens(T urnOnD, T_{2}) & (T18) \end{matrix}

Finally, the initial conditions and uniqueness-of-names axioms are:

InitialisedFalse(OpenC)  (T19)
InitialisedFalse(OpenD)  (T20)
Value(Level, 0) = L  (T21)
UNA[T urnOnC, T urnOnD, Scoop]  (T22)
UNA[OpenC, OpenD]  (T23)
UNA[Level, F lowC, F lowD, δ]  (T24)

5 THE CIRCUMSCRIPTION POLICY CIRC_{CEC}

By themselves, the axioms in Section 4.1 are not sufficient to infer the robot’s trajectory. In general, a default reasoning mechanism will also be required which models various default assumptions about such domains. The circumscription policy used here is inspired by a solution to the frame problem described by Kartha and Lifschitz (1995), which is related to Sandewall’s idea of filter preferential entailment (Sandewall 1989b). This has been adapted for use with the event calculus, and extended so that it also models the assumptions that by default a given action does not occur at a given time point, and that by default a given action occurrence does not result in a discontinuity for a given parameter. Given a collection of domaindependent axioms D similar to those in the previous section, the circumscription policy is:

CIRC[Nar(D) ; Happens] ∧ CIRC[Eff(D) ; Initiates, Terminates, Releases] ∧ CIRC[(Inst(D) ∧ (EC11) ∧ (EC12)) ;

Breaks ; BreaksTo]

∧ Con(D) ∧ Una(D) ∧ [(EC1) ∧ … ∧ (EC15)]

We will abbreviate this to CIRC_{CEC}[D]. In CIRC_{CEC}[D], the term “Nar(D)” stands for (the conjunction of) those domain-specific axioms describing the “narrative” (e.g. Happens facts and statements about the initial values of fluents or parameters), “Eff(D)” stands for those axioms describing the effects of actions on fluents (using Initiates, Terminates and Releases), “Inst(D)” stands for those axioms describing the instantaneous effects of actions on parameters (using Breaks and BreaksTo), “Con(D)” stands for axioms describing mathematical constraints between parameters during different circumstances (e.g. when a tap is open, its flow is proportional to the water level in the tank), and “Una(D)” stands for the uniqueness-of-names axioms. So, if D_{R} is the set of axioms describing the robot,

Nar(D_{R}) = [(R13) ∧ … ∧ (R18)]
Eff(D_{R}) = [(R1) ∧ … ∧ (R4)]
Inst(D_{R}) = [(R5) ∧ … ∧ (R9)]
Con(D_{R}) = [(R10) ∧ … ∧ (R12)]
Una(D_{R}) = [(R19) ∧ … ∧ (R21)]

and if D_{T} is the set of axioms describing the water tank example,

Nar(D_{T}) = [(T16) ∧ … ∧ (T21)]
Eff(D_{T}) = [(T1) ∧ (T2)]
Inst(D_{T}) = [(T3) ∧ … ∧ (T10)]
Con(D_{T}) = [(T11) ∧ … ∧ (T15)]
Una(D_{T}) = [(T22) ∧ … ∧ (T24)]

Whenever Nar(D), Eff(D) and Inst(D) are of a certain general form, we can prove general properties of CIRC_{CEC}[D] which allow its consequences to be computed using classical deduction. The three propositions below are applicable to a wide class of domains which includes both D_{R} and D_{T}. (Strictly speaking, to fit the conditions of the propositions, some of the domain-dependent axioms in D_{R} and D_{T} must be rewritten in a slightly different form. For example, (T3) is re-written as

BreaksTo(a, p, t, r) ←  (T3′)
[Value(Level, t)≥ \frac{L}{2} ∧ a=Scoop
∧ p=Level ∧ r =Value(Level, t) − \frac{L}{2}]

and similar syntactic transformations are applied to the other clauses partially defining Initiates, Terminates, Happens, Breaks or BreaksTo.)

Proposition 1 Let S be the conjunction of (EC11) and (EC12) with the following sentences:

Breaks(a, p, t) ← Φ_{1}(a, p, t)  (S1)
:  :
Breaks(a, p, t) ← Φ_{k}(a, p, t)  (Sk)
BreaksTo(a, p, t, r) ← Φ_{k+1}(a, p, t, r)  (Sk+1)
:  :
BreaksTo(a, p, t, r) ← Φ_{m}(a, p, t, r)  (Sm)

where a, p and t are the only variables which appear free in the formulae Φ_{1}(a, p, t), …, Φ_{k}(a, p, t), where a, p, t and r are the only variables which appear free in the formulae Φ_{k+1}(a, p, t, r), …, Φ_{m}(a, p, t, r), and where none of Φ_{1}(a, p, t), …, Φ_{k}(a, p, t) or Φ_{k+1}(a, p, t, r), …, Φ_{m}(a, p, t, r) mention the predicates Breaks or BreaksTo. Then CIRC[S ; Breaks ; BreaksTo] entails the following sentence S_{comp}:

Breaks(a, p, t) ↔

[∃p_{1}[p=δ(p_{1}) ∧ Breaks(a, p_{1}, t)] ∨
Φ_{1}(a, p, t) ∨ … ∨ Φ_{k}(a, p, t) ∨
∃r[Φ_{k+1}(a, p, t, r) ∨ … ∨ Φ_{m}(a, p, t, r)]]

Proof: (Notation: Let \overline{x} be the tuple of free variables in the formula Φ(\overline{x}). Then in the following proof, \overline{Φ} refers to the predicate expression λ\overline{x}.Φ(\overline{x}) (see (Lifschitz 1995) for definition). Hence, given a model M and an appropriately sorted tuple of domain objects \overline{χ}, the statement \overline{χ} ∈ M[[ \overline{Φ} ]] signifies that M,v ∥− \overline{Φ}(\overline{x}) for all variable assignments v such that v(\overline{x})=\overline{χ}.)

The if half of S_{comp} follows directly from S. It remains to prove the only-if half. Suppose there is some model M of S which does not satisfy the only-if half of S_{comp}. Then there must be some ⟨α, ρ, τ⟩ ∈ M[[ Breaks]] such that:

(i) there is no ρ′ such that ρ = M[[ δ]](ρ′) and ⟨α, ρ′, τ⟩ ∈ M[[ Breaks]]

(ii) for all i≤k, ⟨α, ρ, τ⟩ ∉ M[[ \overline{Φ_{i}}]]

(iii) for all k < i ≤ m, there is no π such that ⟨α, ρ, τ, π⟩ ∈ M[[ \overline{Φ_{i}}]] Furthermore, since M is a model of S, it follows that for each parameter ρ′′ such that ρ = M[[ δ]]^{n}(ρ′′) for some n ≥ 1:

(iv) ⟨α, ρ′′, τ⟩ ∉ M[[ Breaks]]

(v) for all i≤k, ⟨α, ρ′′, τ⟩ ∉ M[[ \overline{Φ_{i}}]]

(vi) for all k < i ≤ m, there is no π such that ⟨α, ρ′′, τ, π⟩ ∈ M[[ \overline{Φ_{i}}]]

(Otherwise, we could put ρ′ = M[[ δ]]^{n−1}(ρ′′) and (i) would not be satisfied.) Hence we can construct a smaller model than M by removing ⟨α, ρ, τ⟩ from M[[ Breaks]]. In order to satisfy (E13), this necessitates the additional removal of all tuples of the form ⟨α, ρ, τ, π⟩ from M[[ BreaksTo]]. More precisely, let M′ be an interpretation obtained from M in the following way:

• M′ agrees with M on the interpretation of all predicate, constant and function symbols except Breaks and BreaksTo.

• ⟨α′, ρ′, τ′⟩ ∈ M′[[ Breaks]] if and only if ⟨α′, ρ′, τ′⟩ ∈ M[[ Breaks]] and ⟨α′, ρ′, τ′⟩ ≠ ⟨α, ρ, τ⟩.

• ⟨α′, ρ′, τ′, π⟩ ∈ M′[[ BreaksTo]] if and only if ⟨α′, ρ′, τ′, π⟩ ∈ M[[ BreaksTo]] and ⟨α′, ρ′, τ′⟩ ≠ ⟨α, ρ, τ⟩.

It is easily verified that M′ is also a model of S. Since M′[[ Breaks]] is a strict subset of M[[ Breaks]], M′ is preferable to M according to the circumscription policy. Therefore M cannot be a model of CIRC[S ; Breaks ; BreaksTo], and the proposition holds. □

Proposition 2 Let S be the conjunction of the following sentences:

\begin{matrix}Happens(a, t) ← Φ_{1}(a, t) & (S1) \\ : & : \\ Happens(a, t) ← Φ_{n}(a, t) & (Sn) \end{matrix}

where a and t are the only variables which (possibly) appear free in the formulae Φ_{1}(a, t), …, Φ_{n}(a, t), and where none of Φ_{1}(a, t), …, Φ_{n}(a, t) mention the predicate Happens. Then CIRC[S ; Happens] entails the following sentence:

Happens(a, t) ↔ [Φ_{1}(a, t) ∨ … ∨ Φ_{n}(a, t)]

Proof: The proposition follows directly from Proposition 3.1.1 in (Lifschitz 1995). □

Proposition 3 Let S be the conjunction of the following sentences:

Initiates(a, f, t) ← Φ_{1}(a, f, t)  (S1)
:  :
Initiates(a, f, t) ← Φ_{k}(a, f, t)  (Sk)
Terminates(a, f, t) ← Φ_{k+1}(a, f, t)  (Sk+1)
:  :
Terminates(a, f, t) ← Φ_{m}(a, f, t)  (Sm)
Releases(a, f, t) ← Φ_{m+1}(a, f, t)  (Sm+1)
:  :
Releases(a, f, t) ← Φ_{n}(a, f, t)  (Sn)

where a, f and t are the only variables which (possibly) appear free in the formulae Φ_{1}(a, f, t), …, Φ_{n}(a, f, t), and where none of Φ_{1}(a, f, t), …, Φ_{n}(a, f, t) mention the predicates Initiates, Terminates or Releases.

Then CIRC[S ; Initiates, Terminates, Releases] entails the following three sentences:

Initiates(a, f, t) ↔ [Φ_{1}(a, f, t) ∨ … ∨ Φ_{k}(a, f, t)]

\begin{matrix}Terminates(a, f, t) ↔ \\ [Φ_{k+1}(a, f, t) ∨ … ∨ Φ_{m}(a, f, t)] \end{matrix}

Releases(a, f, t) ↔ [Φ_{m+1}(a, f, t) ∨ … ∨ Φ_{n}(a, f, t)]

Proof: The proposition follows directly from Propositions 3.1.1 and 7.1.1 in (Lifschitz 1995). □

Using these results, it is not hard to generate classical derivations of sentences of the form HoldsAt(F, T), Happens(A, T) and Value(P, T)=R as required. For example, an outline derivation of the sentence

Happens(ChangeSpeed(0), T_{2}+ \frac{1}{A^{+}} arccos(1− \frac{A^{+}.D_{W}}{S^{+}} ))

from CIRC_{CEC}[D_{R}] is given in Appendix B.

6 SUMMARY AND DISCUSSION

A logical formalism for representing both discrete and continuous change has been presented which overcomes a number of drawbacks in existing logic-based formalisms. It permits the use of arbitrary formulae of the differential calculus without giving rise to anomalous models. In addition, it incorporates a solution to the frame problem which is robust in the presence of narrative, concurrent actions, non-deterministic actions, and domain constraints.

It is important to incorporate the notion of a derivative function in any comprehensive formalism for modelling domains with continuous change. Differential calculus is the primary tool for mathematical modelling in mainstream science and engineering. When a reasonably complex dynamic system is represented as a set of differential equations it is often not possible to obtain an analytical solution. Instead, numerical methods may be used, and the present formalism is a step towards integrating such computational techniques with systems for automated reasoning about actions. Furthermore, the information about the continuously varying aspects of a domain may be incomplete, in which case it may be more appropriate to use computational methods from Qualitative Reasoning (Weld 1990) (Kuipers 1994). Again, the notion of a derivative function is fundamental to the semantics of such systems.

The mechanisms incorporated in the formalism for reasoning about boundary conditions, using the predicates Breaks and BreaksTo, are similar to those introduced in (Miller 1996). However, whereas the discussion in (Miller 1996) was restricted to a particular case study, Propositions 1, 2 and 3 have allowed the effects of the circumscription policy CIRC_{CEC} to be characterised for a wide class of domains. Moreover, they allow the use of standard, first-order proof-theoretic techniques (as opposed to the model-theoretic arguments of (Miller 1996), (Sandewall 1989a) or (Sandewall 1989b)) to ascertain logical consequences of a given domain description. Indeed, the overall structure of the example derivation given in Appendix B points towards a particular approach to designing algorithms for temporal projection, which would be sound with respect to the logical specification presented here. Such algorithms would compute forward in time in alternating “steps”, each step being either a single time point identified by the Next function (see Section 3), or an open interval between such time points.

A great deal of work has already been done on algorithms which perform this kind of computation in the Qualitative Reasoning community (Weld 1990) (Kuipers 1994). In the terminology of qualitative reasoning, time points identified by the Next function may often coincide with distinguished or landmark time-points with respect to some continuously varying parameter. Algorithms for reasoning about landmark time-points and the associated landmark values of particular parameters are embedded in, for example, QSIM (Kuipers 1986), and in systems based on Qualitative Process Theory (Forbus 1984). Furthermore, qualitative process theory incorporates the ability to handle actions (Forbus 1989). Although some effort has been made to reconcile logic-based work in Reasoning about Action with that in Qualitative Reasoning (Crawford & Etherington 1992) (van Belleghem et al 1994), the two fields have yet to be properly integrated. Attempts to axiomatise qualitative reasoning are valuable here (Davis 1992), and it is hoped that the present paper can serve to further work in this vein.

Of course, the emphasis in Qualitative Reasoning is on reasoning with incomplete or qualitative information about relationships between parameters. In the present formalism, such information would manifest itself in the use of the inequality predicate and existentially quantified numerical variables in constraints between parameters, or in the use of appropriately defined “qualitative predicates”. This is discussed further in Appendix A. Domain dependent qualitative constraints would appear in axioms analogous to (R10)–(R12) in the “Con” part of the theory (see Section 5). The fact that Con(D) is outside the scope of any circumscription indicates that the minimisation policy is equally applicable to either qualitative or quantitative domain descriptions. It is therefore hoped that, as well as integrating the notions of discrete and continuous change, the present formalism is a step towards providing a unifying conceptual framework for qualitative, semi-qualitative and quantitative reasoning about continuous change. But further work needs to be done in order to substantiate this claim.

Acknowledgement

This research was funded by the U.K. Engineering and Physical Sciences Research Council (EPSRC).

References

A. Baker (1991), Nonmonotonic Reasoning in the Framework of the Situation Calculus, A.I. vol. 49, page 5, Elsevier Science Publishers.

J. Crawford and D. Etherington (1992), Formalizing Reasoning about Change: A Qualitative Reasoning Approach, Proceedings AAAI’92, pages 577-583.

E. Davis (1992a), Axiomatising Qualitative Process Theory, Proceedings KR’92, Morgan Kaufmann, pages 177-188.

E. Davis (1992b), Infinite Loops in Finite Time: Some Observations, Proceedings KR’92, Morgan Kaufmann.

K. Forbus (1984), Qualitative Process Theory, in Artificial Intelligence 24, reprinted in Weld and de Kleer (eds.), Readings in Qualitative Reasoning about Physical Systems, Morgan Kaufmann (1990), 1984.

K. Forbus (1989), Introducing Actions into Qualitative Simulation, Proceedings IJCAI’89, pages 1273-1278.

C. Herrmann and M. Thielscher (1996), Reasoning about Continuous Processes, Proceedings AAAI’96.

G.N. Kartha and V. Lifschitz (1994), Actions with Indirect Effects (Preliminary Report), Proceedings KR’94, pages 341-350.

G.N. Kartha and V. Lifschitz (1995), A Simple Formalization of Actions Using Circumscription, Proceedings IJCAI’95, pages 1970-1975.

R. Kowalski and M. Sergot (1986), A Logic-Based Calculus of Events, New Generation Computing, vol. 4, page 267.

B. Kuipers (1986), Qualitative Simulation, A.I. vol. 29, pages 289-338, Elsevier Science Publishers.

B. Kuipers (1994), Qualitative Reasoning: Modeling and Simulation with Incomplete Knowledge, MIT Press.

V. Lifschitz (1995), Circumscription, in Handbook of Logic in Artificial Intelligence, ed.s D. Gabbay, C. Hogger and J.A. Robinson, Oxford University Press, pages 297-352.

R. Miller (1995), Situation Calculus Specifications for Event Calculus Logic Programs, in Proceedings of the Third International Conference on Logic Programming and Non-monotonic Reasoning, Lexington, KY, USA, pub. Springer Verlag.

R. Miller (1996), A Case Study in Reasoning about Actions and Continuous Change, Proceedings ECAI’96, pub. John Wiley & Sons, Ltd.

R. Miller and M. Shanahan (1994), Narratives in the Situation Calculus, in Journal of Logic and Computation, Special Issue on Actions and Processes, vol. 4 no. 5, Oxford University Press.

R. Miller and M. Shanahan (1996), Reasoning about Discontinuities in the Event Calculus (Extended Ver-

sion), http://www-lp.doc.ic.ac.uk/UserPages/
staff/rsm/abstract12.html.

J. Pinto (1994), Temporal Reasoning in the Situation Calculus, PhD. Thesis, University of Toronto.

M. Rayner (1991), On the Applicability of Nonmonotonic Logic to Formal Reasoning in Continuous Time, A.I. vol. 49, pages 345-360, Elsevier Science.

R. Reiter (1991), The Frame Problem in the Situation Calculus: a Simple Solution (Sometimes) and a Completeness Result for Goal Regression, in Artificial Intelligence and Mathematical Theory of Computation: Papers in Honour of John McCarthy, ed. V. Lifschitz, Academic Press, page 418.

R. Reiter (1996), Natural Actions, Concurrency and Continuous Time in the Situation Calculus, Proceedings KR’96 (this proceedings), Morgan Kaufmann.

E. Sandewall (1989a), Combining Logic and Differential Equations for Describing Real World Systems, Proceedings KR’89, Morgan Kaufman.

E. Sandewall (1989b), Filter Preferential Entailment for the Logic of Action in Almost Continuous Worlds, Proceedings IJCAI’89, pages 894-899.

E. Sandewall (1994), Features and Fluents, Oxford University Press.

M. Shanahan (1990), Representing Continuous Change in the Event Calculus, Proceedings ECAI’90, pages 598-603.

M. Shanahan (1995), A Circumscriptive Calculus of Events, A.I. vol. 77, pages 249-284, Elsevier Science.

M. Shanahan (1996), Robotics and the Common Sense Informatic Situation, in Proceedings ECAI’96, pub. John Wiley & Sons, Ltd.

M. Shanahan (1997), Solving the Frame Problem: A Mathematical Investigation of the Common Sense Law of Inertia, MIT Press, (to appear).

Y. Shoham (1988), Reasoning About Change: Time and Causation from the Standpoint of Artificial Intelligence, MIT Press.

K. Van Belleghem, M. Deneker and D. De Schreye (1994), Representing Continuous Change in the Abductive Event Calculus, in Proceedings 1994 International Conference on Logic Programming, ed. P. Van Hentenrijck, pages 225-240.

D. Weld and J. de Kleer (editors) (1990), Qualitative Reasoning about Physical Systems, Morgan Kaufmann.

APPENDIX A – REPRESENTING QUALITATVE INFORMATION ABOUT PARAMETER BEHAVIOUR

This appendix outlines some preliminary ideas for incorporating qualitative information about parameter behaviour in domain descriptions, along the lines of (Kuipers 1986) and (Kuipers 1994). The discussion here is speculative – a more thorough investigation is needed to fully integrate the notions and ontologies of QR with those of action based logical formalisms.

Kuipers lists seven qualitative relationships between parameters as being particularly important as regards the qualitative description of a system’s behaviour. These relationships are add, mult, minus, d/dt, constant, M^{+} (monotonically increasing) and M^{−} (monotonically decreasing). These notions can be included in the present framework by appropriately extending the axiom set (A1)–(A4):

\begin{matrix}Add(p_{1}, p_{2}, p_{3}, t) ↔ & (Q1) \\ Value(p_{1}, t)+Value(p_{2}, t)=Value(p_{3}, t) \end{matrix}

\begin{matrix}Mult(p_{1}, p_{2}, p_{3}, t) ↔ & (Q2) \\ Value(p_{1}, t).Value(p_{2}, t)=Value(p_{3}, t) \end{matrix}

\begin{matrix}Minus(p_{1}, p_{2}, t) ↔ & (Q3) \\ Value(p_{1}, t)=−Value(p_{2}, t) \end{matrix}

\begin{matrix}Derivative(p_{1}, p_{2}, t) ↔ & (Q4) \\ Value(δ(p_{1}), t)=Value(p_{2}, t) \end{matrix}

Constant(p, t) ↔ Value(δ(p), t)=0  (Q5)

MonInc(p_{1}, p_{2}, t) ↔  (Q6)

[[Value(δ(p_{1}), t)>0 ↔ Value(δ(p_{2}), t)>0] ∧ [Value(δ(p_{1}), t)<0 ↔ Value(δ(p_{2}), t)<0]]

MonDec(p_{1}, p_{2}, t) ↔  (Q7)

[[Value(δ(p_{1}), t)>0 ↔ Value(δ(p_{2}), t)<0] ∧ [Value(δ(p_{1}), t)<0 ↔ Value(δ(p_{2}), t)>0]]

With such extra definitions, it is easy to include qualitative constraints in domain descriptions. For example, in the water tank example we might replace axiom (T12) with the sentence

HoldsAt(OpenC, t) → MonInc(F lowC, Level, t)

to reflect the fact that, although we know that the flow through tap C decreases as the water level decreases, we do not know the exact mathematical relationship between the two parameters in this circumstance.

Another notion central to QR is that of a landmark value (w.r.t. a particular parameter). A landmark value, or simply “landmark”, is a particular “qualitatively important” value for some parameter, typically where the first derivative changes sign. Symbolic names may be used for landmarks, since their exact numerical values may be unknown. In the present context, landmarks can be represented by extra constant or function symbols, along with suitable sets of ordering declarations. For example, qualitatively important values for the parameter Level in the water tank example are 0 and the top of the tank. Hence the “quantity space” for Level can be described by the sentence

0 < Top

where Top is an extra constant symbol of sort R. In the terminology of QSIM, this quantity space gives rise to 15 possible qualitative values for the parameter Level, each of the form ⟨qmag, qdir⟩, where qmag is chosen from the set {(−∞, 0), 0, (0, Top), Top, (Top, ∞)}, and qdir is chosen from the set {Inc, Std, Dec} (“increasing”, “steady” or “decreasing”). Qualitative values can be represented as fluents within the present framework by incorporating (6) domain independent axioms of the following form:

\begin{matrix}HoldsAt(QV (p, ⟨(r_{1}, r_{2}), Inc⟩), t) ↔ & (Q8) \\ [r_{1} <Value(p, t)<r_{2} ∧ Value(δ(p), t)>0] \end{matrix}

\begin{matrix}HoldsAt(QV (p, ⟨r, Inc⟩), t) ↔ & (Q9) \\ [Value(p, t)=r ∧ Value(δ(p), t)>0] \end{matrix}

The fluent QV (Level, ⟨(0, Top), Inc⟩) is not included in the “frame”. Conceptually, its truth value at any instant of time is instead determined by the values of Level and δ(Level). With such notation, axiom (T21) stating the initial value of Level could be replaced with an assertion such as

HoldsAt(QV (Level, ⟨(0, Top), Std⟩), 0)

or

∃x.HoldsAt(QV (Level, ⟨(0, Top), x⟩), 0)

Similarly, we could describe when triggered events such as as an “overflow” occur with axioms of the form

\begin{matrix}Happens(Overflow, t) ← \\ HoldsAt(QV (Level, ⟨Top, Inc⟩), t) \end{matrix}

Computationally, for domains involving both discrete and continuous change a hybrid system seems feasible, in which an event calculus style mechanism (perhaps using logic programming) determines the instantaneous changes in system configuration at times (identified by the Next function) when actions (events) occur, and where a QSIM style algorithm determines the possible evolutions of the continuously varying aspects of the domain between such time points. The interaction between these two components would be in both directions – actions could impose new and remove existing qualitative constraints between parameters, and achievement of landmark values by particular parameters could trigger particular action occurrences.

APPENDIX B – AN EXAMPLE OUTLINE DERIVATION FROM CIRC_{CEC}[D_{R}]

This appendix gives an outline derivation of the sentence

Happens(ChangeSpeed(0), T_{2}+\frac{1}{A^{+}} arccos(1− \frac{A^{+}.D_{W}}{S^{+}} )).

from CIRC_{CEC}[D_{R}] – in other words, a derivation of the fact that the robot stops moving (because it bumps into the wall) at time T_{B}.

The derivation is given in several stages. Sentences given parenthesised ( ) labels are (domain-independent or domain-dependent) axioms or are direct consequences of Propositions 1, 2 or 3, whereas sentences given square-bracketed [ ] labels are derived.

As regards the topic of this paper, the key steps in the derivation below are [iii] to [iv], [xii] to [xiii], [xvi] to [xvii], [ii(a)] to [iii(a)], and [xxvi] to [xxvii]. These are inferences of expressions of the form “t ∈ I → Value(P, t) = ∫ f(t)dt” from expressions of the form “t ∈ I → Value(δ(P), t) = f(t)”. Such derivation steps are only legitimate if it is first shown (using axiom (EC9)) that P is differentiable over the time interval I in question. It is only in this case that axiom (A2) ensures that “δ(P)” is the “derivative of P ” in the standard mathematical sense (as well as purely syntactically).

In derivation steps [iv], [xiii], [xvii], [iii(a)] and [xxvii], terms of the form “∫ f(t)dt” are written after they have been symbolically integrated^{2}, and so contain existentially quantified variables representing “arbitrary constants of integration”. These are assigned specific values in steps [v], [xv], [xix], [v(a)] and [xxix], using information about the particular parameters’ values at the greatest lower bounds of the intervals in question, together with the information (derived using (EC8)) that these parameters are continuous at these greatest lower bounds.

Steps [ii], [xi], [xii], [ii(a)] and [xxvi] are derived using the “basic” event calculus of axioms (EC1)–(EC6), and so details are omitted.

In the first stage of the derivation, “completion” sentences are listed for the predicates Breaks, Happens, Initiates, Terminates and Releases.

Stage 1: Completions of Breaks, Happens, Initiates, Terminates and Releases

By Proposition 1 and the definition of CIRC_{CEC}[D_{R}]:

Breaks(a, p, t) ↔  (CB)
[∃p_{1}[p = δ(p_{1}) ∧ Breaks(a, p_{1}, t)] ∨
∃r[a = ChangeSpeed(r) ∧ p = δ(NSP)] ∨
∃r[a = StartTurn(r) ∧ p = δ(NSP)] ∨
∃r[a = ChangeSpeed(r) ∧ p = δ(EWP)] ∨
∃r[a = StartTurn(r) ∧ p = δ(EWP)] ∨
∃r[a = StartTurn(r) ∧ p = δ(Bearing)]]

By Proposition 2 and the definition of CIRC_{CEC}[D_{R}]:

Happens(a, t) ↔  (CH)
[[a = ChangeSpeed(S^{+}) ∧ t = T_{1}] ∨
[a = StartTurn(A^{+}) ∧ t = T_{2}] ∨
[a = ChangeSpeed(0) ∧ Value(NSP, t) = D_{W}
∧ Value(δ(NSP), t) > 0] ∨
[a = StartTurn(0) ∧ Value(NSP, t) = D_{W}
∧ Value(δ(NSP), t) > 0]]

By Proposition 3 and the definition of CIRC_{CEC}[D_{R}]:

Initiates(a, f, t) ↔  (CI)
[∃r[a = ChangeSpeed(r) ∧ f = Moving(r)] ∨
∃r[a = StartTurn(r) ∧ f = Turning(r)]]
Terminates(a, f, t) ↔  (CT)
[∃r_{1},r_{2}[a = ChangeSpeed(r_{1}) ∧
f = Moving(r_{2}) ∧ r_{1} ≠ r_{2}] ∨
∃r_{1},r_{2}[a = StartTurn(r_{1}) ∧ f = Turning(r_{2}) ∧ r_{1} ≠ r_{2}]]
¬Releases(a, f, t)  (CR)

Stage 2: Derivation of Next(0)=T_{1} and Values of Parameters, etc. at T_{1}

By (CH) and (R18):

¬Happens(a, 0)  [i]

By (R16), (EC1), (EC5), (EC14) and [i]:

\begin{matrix}[0 ≤ t ∧ t ≤ Next(0)] → & [ii] \\ [HoldsAt(Moving(0), t) ∧ HoldsAt(Turning(0), t)] \end{matrix}

By [ii], (R10), (R11) and (R12):

\begin{matrix}[0 ≤ t ∧ t ≤ Next(0)] → [Value(δ(NSP), t) = 0 ∧ & [iii] \\ Value(δ(EWP), t) = 0 ∧ Value(δ(Bearing), t) = 0] \end{matrix}

By (EC14), (EC9) [i], [iii] and integration:

\begin{matrix}∃r_{1}, r_{2}, r_{3}∀t[[0 ≤ t ∧ t < Next(0)] → [Value(NSP, t) = r_{1} & [iv] \\ ∧ Value(EWP, t) = r_{2} ∧ Value(Bearing, t) = r_{3}]] \end{matrix}

By (R18) and [iv]:

2More precisely, “t ∈ I → Value(P, t) = ∫ f(t)dt” can be written

t,t_{1} ∈I → Value(P, t) = Value(P, t_{1}) + ∫_{t_{1}}^{t}f(t)dt It is the lack of information about the exact numerical value of “Value(P, t_{1})” for any t_{1} ∈ I that leads to “arbitrary constants of integration” when such “indefinite integrals”

are symbolically integrated.

\begin{matrix}[0 ≤ t ∧ t < Next(0)] → [Value(NSP, t) = 0 ∧ & [v] \\ Value(EWP, t) = 0 ∧ Value(Bearing, t) = 0] \end{matrix}

By [v] and (EC7):

\begin{matrix}[Value(NSP, Next(0)) = 0 ∧ & [vi] \\ Value(EWP, Next(0)) = 0 ∧ Value(Bearing, Next(0)) = 0] \end{matrix}

By (CH) and (EC15):

∃a.Happens(a, Next(0))  [vii]

By (EC14), [vii] and (CH):

Next(0) = T_{1}  [viii]

By [viii] and [vi]:

\begin{matrix}[Value(NSP, T_{1}) = 0 ∧ Value(EWP, T_{1}) = 0 & [ix] \\ ∧Value(Bearing, T_{1}) = 0] \end{matrix}

By [ix] and (CH):

Happens(a, T_{1}) ↔ a = ChangeSpeed(S^{+})  [x]

Stage 3: Derivation of Next(T_{1})=T_{2} and Values of Parameters, etc. at T_{2}

By (R1), (R10), (R11), (EC3), (EC5), (CT), (CR) and [X]:

[T_{1} < t ∧ t ≤ Next(T_{1})] →  [xi]
[Value(δ(EWP), t) = S^{+}. cos(Value(Bearing, t)) ∧
Value(δ(NSP), t) = S^{+}. sin(Value(Bearing, t))]

By (R16), (EC1), (EC5), (EC14) and [x]:

[T_{1} < t ∧ t ≤ Next(T_{1})] → Value(δ(Bearing), t) = 0  [xii]

By (EC14), (EC9), [xii] and integration:

∃r∀t[[T_{1} < t ∧ t < Next(T_{1})] → Value(Bearing, t) = r]  [xiii]

By (CB) and (R21):

¬Breaks(ChangeSpeed(S^{+}), Bearing, T_{1})  [xiv]

By (EC8), [xiv], [x], [xiii] and [ix]:

[T_{1} < t ∧ t < Next(T_{1})] → Value(Bearing, t) = 0  [xv]

By [xv] and [xi]:

\begin{matrix}[T_{1} ≤ t ∧ t ≤ Next(T_{1})] → [Value(δ(EWP), t) = S^{+} ∧ & [xvi] \\ Value(δ(NSP), t) = 0] \end{matrix}

By (EC14), (EC9), [xvi] and integration:

\begin{matrix}∃r∀t[[T_{1} < t ∧ t < Next(T_{1})] → & [xvii] \\ ∧ [Value(EWP, t) = S^{+}.t+r_{1} ∧ Value(NSP, t) = r_{2}]] \end{matrix}

By (CB) and (R21):

\begin{matrix}¬Breaks(ChangeSpeed(S^{+}), NSP, T_{1}) ∧ & [xviii] \\ ¬Breaks(ChangeSpeed(S^{+}), EWP, T_{1}) \end{matrix}

By (EC8), [xviii], [x], [xvii] and [ix]:

\begin{matrix}[T_{1} < t ∧ t ≤ Next(T_{1})] → & [xix] \\ [Value(EWP, t) = S^{+}(t−T_{1}) ∧ Value(NSP, t) = 0] \end{matrix}

By (EC7), [xix] and [xv]:

\begin{matrix}Value(EWP, Next(T_{1})) = S^{+}(Next(T_{1})−T_{1}) ∧ & [xx] \\ Value(NSP, Next(T_{1})) = 0 ∧ Value(Bearing, Next(T_{1})) = 0 \end{matrix}

By (CH) and (EC15):

∃a.Happens(a, Next(T_{1}))  [xxi]

By (EC14), [xxi] and (CH):

Next(T_{1}) = T_{2}  [xxii]

By [xx] and [xxii]:

\begin{matrix}Value(EWP, T_{2}) = S^{+}(T_{2} −T_{1}) ∧ & [xxiii] \\ Value(NSP, T_{2}) = 0 ∧ Value(Bearing, T_{2}) = 0 \end{matrix}

By [xxiii] and (CH):

Happens(a, T_{1}) ↔ a = StartTurn(S^{+})  [xxiv]

Stage 4: Derivation (by contradiction) of ∃a, t[Happens(a, t) ∧ T_{2} <t]

** beginning of sub-derivation **

Assumption:

¬∃a, t[Happens(a, t) ∧ T_{2} < t]  (a)

By (EC8), (EC9) and (a):

T_{2} < t → [Continuous(p, t) ∧ Differentiable(p, t)]  [i(a)]

By (R10), (R11), (R12), (EC3), (EC5), (CI), (CT), (CR), [xxiv] and [x]:

T_{2} < t →  [ii(a)]
[Value(δ(EWP), t) = S^{+}. cos(Value(Bearing, t)) ∧
Value(δ(NSP), t) = S^{+}. sin(Value(Bearing, t)) ∧
Value(δ(Bearing), t) = A^{+}]

By [i(a)], [ii(a)] and integration:

∃r_{1}, r_{2}, r_{3}∀t[T_{2} < t →  [iii(a)]
[Value(EWP, t) = \frac{S+}{A+} sin(A^{+}.t+r_{1})+r_{2} ∧
Value(NSP, t) = \frac{−S+}{A+} cos(A^{+}.t+r_{1})+r_{3} ∧
Value((Bearing, t) = A^{+}.t+r_{1}]]

By (CB) and (R21):

\begin{matrix}¬Breaks(a, NSP, T_{2}) ∧ ¬Breaks(a, EWP, T_{2}) & [iv(a)] \\ ¬Breaks(a, Bearing, T_{2}) \end{matrix}

By [iv(a)], [iii(a)], [xxiii] and (EC8):

T_{2} < t →  [v(a)]
[Value(EWP, t) = \frac{S+}{A+} sin(A^{+}.t−A^{+}.T_{2})+S^{+}.(T_{2} −T_{1})
∧ Value(NSP, t) = \frac{−S+}{A+} cos(A^{+}.t−A^{+}.T_{2})+ \frac{S+}{A+}
∧ Value((Bearing, t) = A^{+}.t−A^{+}.T_{2}]

By [v(a)], [ii(a)] and (CH):

Happens(ChangeSpeed(0), T_{2} + \frac{1}{A+} arccos(1 − \frac{A+.DW}{S+} )) [vi(a)]

By (a) and [vi(a)]:

⊥  [vii(a)]

** end of sub-derivation **

By sub-derivation leading from (a) to [vii(a)] above:

∃a, t[Happens(a, t) ∧ T_{2} < t]  [xxv]

Stage 5: Derivation of Happens(ChangeSpeed(0), T_{2}+ \frac{1}{A^{+}} arccos(1− \frac{A^{+}.D_{W}}{S^{+}} ))

By (R10), (R11), (R12), (EC3), (EC5), (CI), (CT), (CR), [xxiv] and [x]:

[T_{2} < t ∧ t ≤ Next(T_{2})] →  [xxvi]
[Value(δ(EWP), t) = S^{+}. cos(Value(Bearing, t)) ∧
Value(δ(NSP), t) = S^{+}. sin(Value(Bearing, t)) ∧
Value(δ(Bearing), t) = A^{+}]

By (EC9), (EC14), [xxvi] and integration:

∃r_{1}, r_{2}, r_{3}∀t[[T_{2} < t ∧ t < Next(T_{2})] →  [xxvii]
[Value(EWP, t) = \frac{S+}{A+} sin(A^{+}.t+r_{1})+r_{2} ∧
Value(NSP, t) = \frac{−S+}{A+} cos(A^{+}.t+r_{1})+r_{3} ∧
Value((Bearing, t) = A^{+}.t+r_{1}]]

By (CB) and (R21):

\begin{matrix}¬Breaks(a, NSP, T_{2}) ∧ ¬Breaks(a, EWP, T_{2}) & [xxviii] \\ ∧ ¬Breaks(a, Bearing, T_{2}) \end{matrix}

By [xxviii], [xxvii], [xxiii] and (EC8):

[T_{2} < t ∧ t < Next(T_{2})] →  [xxix]
[Value(EWP, t) = \frac{S+}{A+} sin(A^{+}.t−A^{+}.T_{2})+S^{+}.(T_{2} −T_{1})
∧ Value(NSP, t) = \frac{−S+}{A+} cos(A^{+}.t−A^{+}.T_{2})+ \frac{S+}{A+}
∧ Value((Bearing, t) = A^{+}.t−A^{+}.T_{2}]

By [xxv], (EC15) and (CH):

Happens(ChangeSpeed(0), Next(T_{2}))  [xxx]

By [xxix] and (EC7):

\begin{matrix}Value(NSP, Next(T_{2})) = & [xxxi] \\ \frac{−S+}{A+} cos(A^{+}.Next(T_{2})−A^{+}.T_{2})+ \frac{S+}{A+} \end{matrix}

By [xxx] and (CH):

Value(NSP, Next(T_{2})) = D_{W}  [xxxii]

By [xxx], [xxxi] and [xxxii]:

Happens(ChangeSpeed(0), T_{2} + \frac{1}{A+} arccos(1 − \frac{A+.DW}{S+} )) [xxxiii]