\stackMath
Foundations for a Probabilistic Event Calculus
Technical Report
Fabio A. D’Asaro, Antonis Bikakis, Luke Dickens and Rob Miller
{uczcfad*, a.bikakis, l.dickens, r.s.miller}@ucl.ac.uk
*Department of Information Studies
University College London
1 Introduction
The Event Calculus (EC) [9] is a well-known approach to reasoning about the effects of a narrative of action occurrences (events) along a time line. This paper describes PEC, an adaptation of EC able to reason with probabilistic causal knowledge.
There are numerous applications for this kind of probabilistic reasoning, e.g. in modelling medical, environmental, legal and commonsense domains, and in complex activity recognition and security monitoring.
PEC’s main characteristics are: i) it supports EC-style narrative reasoning, ii) it uses a possible worlds semantics to naturally allow for epistemic extensions, iii) it uses a tailored action language syntax and semantics,
iv) its generality allows in principle for the use of other models of uncertainty, e.g. Fuzzy Logic [20] or Dempster-Schafer Theory [4], and
v) for a wide subset of domains it has a sound and complete ASP implementation.
Although other formalisms exist for probabilistic reasoning about actions, PEC is, to our knowledge, the only framework to combine these features.
We use the following two example scenarios to illustrate the main definitions and characteristics of our framework.
Scenario 1** (Coin Toss).**
A coin initially (instant [math]) shows Heads. A robot can attempt to toss the coin, but there is a small chance that it will fail to pick it up, leaving the coin unchanged. The robot attempts to toss the coin (instant 1).
Scenario 2** (Antibiotic).**
A patient has a rash often associated with a bacterial infection, and can take an antibiotic known to be reasonably effective. Treatment is not always successful, and if not may still clear the rash. Failed treatment leaves the bacteria resistant. The patient is treated twice (instants 1 and 3).
Scenario 3** (Keys).**
Leaving the house without first picking up the keys causes being locked out. In the context of a daily routine, there is a small chance that a person forgets to pick up the keys before leaving the house at 7:40 AM.
2 PEC
2.1 Syntax
Definition 1** (Domain Language).**
A domain language is a tuple \mathcal{L}=\langle\mathcal{F},\mathcal{A},\mathcal{V},\mbox{{vals}},\mathcal{I},\leq,\mbox{\bar{0}}\rangle consisting of a finite non-empty set F of fluents, a finite set A of actions, a finite non-empty set V of values such that {⊤,⊥}⊆V, a function \mboxvals:F∪A→2V∖∅, a non-empty set I of instants and a minimum element \mbox{\bar{0}}\in\mathcal{I} w.r.t. a total ordering ≤ over I. For A∈A we impose \mboxvals(A)={⊤,⊥}.
Example 1**.**
An appropriate domain language for Scenario 1 would be LC=⟨FC,AC,VC,\mboxvalsC,N,≤N,0⟩ where, FC={\mboxCoin}, AC={\mboxToss}, VC={⊤,⊥,\mboxHeads,\mboxTails}, \mboxvalsC(\mboxCoin)={\mboxHeads,\mboxTails} and \mboxvalsC(\mboxToss)={⊤,⊥}, N is the set of natural numbers (including 0), and ≤N is the standard total ordering between naturals. Scenario 2 could be captured by a language ⟨FA,AA,VA,\mboxvalsA,N,≤N,0⟩ where FA={\mboxBacteria,\mboxRash}, AA={\mboxTakesMedicine}, VA={⊤,⊥,\mboxWeak,\mboxPresent,\mboxResistant,\mboxAbsent}, and \mboxvalsA is defined by \mboxvalsA(\mboxBacteria)={\mboxWeak,\mboxResistant,\mboxAbsent} and \mboxvalsA(\mboxRash)={\mboxPresent,\mboxAbsent}.
In what follows, all definitions are with respect to a domain language \mathcal{L}=\langle\mathcal{F},\mathcal{A},\mathcal{V},\mbox{{vals}},\mathcal{I},\leq,\mbox{\bar{0}}\rangle.
We begin by defining what a (fluent) literal and a formula are in this language. Literals and formulas with time information attached are called i-literals and i-formulas respectively.
Definition 2** (Fluent and Action Literals, i-literals).**
A fluent literal is an expression of the form F=V for some F∈F and V∈\mboxvals(F). A fluent is boolean if \mboxvals(F)={⊤,⊥}. An action literal is either A=⊤ or A=⊥. When no ambiguity can arise, Z=⊤ is sometimes abbreviated to Z and Z=⊥ is abbreviated to ¬Z for Z a fluent or action. An i-literal is an expression of the form [L]@I for some (fluent or action) literal L and some I∈I.
Definition 3** (Formulas, i-formulas).**
The set of formulas, denoted by Θ, is the closure of the set of literals under ∧ and ¬ (with ∨ and → being defined as shorthand in the usual way). The set of i-formulas, denoted by Φ, is the closure of the set of i-literals under ∧ and ¬. We use the shorthand [θ]@I for the i-formula formed from the formula θ and the instant I by replacing all literals L occurring in θ by [L]@I, e.g. [\mbox{F!=!V}\rightarrow\mbox{F^{\prime}!=!V^{\prime}}]@3 is a shorthand for [\mbox{F!=!V}]@3\rightarrow[\mbox{F^{\prime}!=!V^{\prime}}]@3.
Example 2**.**
In Scenario 1 the i-literal [\mbox{\mbox{{Coin}}!=!\mbox{{Heads}}}]@3 indicates that the coin shows heads at instant 3, while [¬\mboxToss]@2 indicates that the robot does not attempt to toss the coin at instant 2. In Scenario 2, [\mbox{\mbox{{Rash}}!=!\mbox{{Present}}}]@0\wedge[\mbox{\mbox{{Bacteria}}!=!\mbox{{Absent}}}\wedge\mbox{{TakesMedicine}}]@3 indicates that the patient initially has a rash, and that she takes the medicine and the bacterial infection is absent at instant 3.
Definition 4** (State, Partial State, Fluent State).**
A state S is a set of literals, exactly one for each F∈F and A∈A. A partial state is a subset X⊆S of a state S. Given a partial state X, we call its subset containing all and only the fluent literals in X a partial fluent state, and we denote it as X↾F. For a state S we call S↾F a fluent state. We also define X↾A as the subset of X containing all and only the action literals in X. The set of all states is denoted by S, the set of all partial states is denoted by X, and we use S~ and X~ to denote the sets {S↾F∣S∈S} and {X↾F∣X∈X} respectively.
Example 3**.**
One of the states we can build with the elements of the domain language ⟨FA,AA,VA,\mboxvalsA,N,≤N,0⟩ for Scenario 2 is S^{1}_{A}=\{\mbox{\mbox{{Bacteria}}!=!\mbox{{Resistant}}},\mbox{\mbox{{Rash}}!=!\mbox{{Absent}}},\neg\mbox{{TakesMedicine}}\}. Its associated fluent state is S^{1}_{A}\mathord{\upharpoonright}\mathcal{F}=\{\mbox{\mbox{{Bacteria}}!=!\mbox{{Resistant}}},\mbox{\mbox{{Rash}}!=!\mbox{{Absent}}}\}. Any arbitrary subset of SA1, e.g. X^{1}_{A}=\{\mbox{\mbox{{Rash}}!=!\mbox{{Absent}}},\neg\mbox{{TakesMedicine}}\}, is a partial state, whereas any arbitrary subset of SA1↾F, e.g. X_{A}^{1}\mathord{\upharpoonright}\mathcal{F}=\{\mbox{\mbox{{Rash}}!=!\mbox{{Absent}}}\}, is a partial fluent state.
Definition 5** (Outcome, Projection Functions).**
An outcome is a pair of the form (X~,P+) for some X~∈X~ and P+∈(0,1]. The two projection functions χ and π are such that χ((X~,P+))=X~ and π((X~,P+))=P+ for any outcome. The set of all outcomes X~×(0,1] will be denoted by O.
Definition 6** (Weight of a Set of Outcomes).**
Given a finite set of outcomes
[TABLE]
we define the weight of O as
[TABLE]
Notation 1**.**
In the following, we will generally use:
I,I′,I1,I′′,I2,… to denote elements of I,
A,A′,A1,A′′,A2,… to denote elements of A,
F,F′,F1,F′′,F2,… to denote elements of F,
V,V′,V1,V′′,V2,… to denote elements of V,
θ,θ′,θ1,θ′′,θ2,… to denote formulas,
φ,φ′,φ1,φ′′,φ2,… to denote i-formulas,
P,P′,P1,P′′,P2,… to denote real values in [0,1],
P+,P1+,P2+,… to denote real values in (0,1],
S,S′,S1,S′′,S2,… to denote elements of S,
X,X′,X1,X′′,X2,… to denote elements of X,
S~,S~′,S~1,S~′′,S~2,… to denote elements of S~,
X~,X~′,X~1,X~′′,X~2,… to denote elements of X~,
O,O′,O1,O′′,O2,… to denote outcomes.
We now introduce the standard propositions of our language: v-propositions are used to declare which value a fluent may take, c-propositions are used to model the causal relationships of a domain, i-propositions declare the initial conditions, p-propositions are for the action occurrences, and h-propositions state that a given i-formula holds.
Definition 7** (v-proposition).**
A v-proposition has the form
[TABLE]
where m≥1 and {V1,…,Vm}=vals(F).
Definition 8** (c-proposition, Head and Body of a c-proposition).**
A c-proposition c has the form
[TABLE]
where Oi∈O, χ(Oi)=χ(Oj) when i=j, θ is a formula such that θ Herbrand-entails111For two formulas θ and θ′ we write that θ Herbrand-entails θ′ if, taking literals as propositions, every classical Herbrand model of θ is also a Herbrand model of θ′. A=⊤ for at least one A∈A, and π({O1,…,Om})=1.
\mboxbody(C)=θ and \mboxhead(C)={O1,…,Om} are the body and head of C, respectively. We often omit Oi from \mboxhead(C) if χ(Oi)=∅ (leaving it implicit since π({O1,…,Om})=1).
Definition 9** (i-proposition).**
An i-proposition has the form
[TABLE]
where Oi∈O, π({O1,…,Om})=1, χ(Oi)∈S~, and χ(Oi)=χ(Oj) when i=j.
Definition 10** (p-proposition).**
A p-proposition has the form
[TABLE]
where P+∈(0,1] and I is such that I<I′ for some other I′∈I. When a p-proposition p has the form (4) we say that p has instant I.
In the following, we will frequently use
[TABLE]
as a shorthand for the p-proposition
[TABLE]
Notation 2**.**
In the following, we will generally use lowercase letters to denote propositions, e.g. c,c′,c1,c′′,c2,… will be used for c-propositions.
Definition 11** (Domain Description).**
A domain description is a finite set D of v-propositions, c-propositions, p-propositions and i-propositions such that: (i) for any two distinct c-propositions in D with bodies θ and θ′ respectively, θ does not Herbrand-entail θ′, (ii) D contains exactly one i-proposition, (iii) D contains exactly one v-proposition for each F∈F and (iv) if a p-proposition “A\mboxperformed−atI\mboxwith−probP′” belongs to D, then there is no other p-proposition of the form “A\mboxperformed−atI\mboxwith−probP′′” for some P′′∈(0,1] that belongs to D.
Definition 12** (Action Narrative).**
An action narrative is any finite set of p-propositions. For D a domain description, we define the action narrative narr(D) as the set of all p-propositions in D.
Example 4**.**
Scenario 1 can be modeled using the following domain description DC:
\mboxCoin\mboxtakes−values{\mboxHeads,\mboxTails} (C1)
\mboxinitially−one−of{({\mboxCoin=\mboxHeads},1)} (C2)
Toss causes-one-of (C3)
{({\mboxCoin=\mboxHeads},0.49),
({\mboxCoin=\mboxTails},0.49),
(∅,0.02)}
\mboxToss\mboxperformed−at1 (C4)
where (C1) is a v-proposition, (C2) is an i-proposition, (C3) is a c-proposition and (C4) is a p-proposition.
Example 5**.**
Scenario 2 can be modeled using the following domain description DA:
\mboxBacteria\mboxtakes−values{\mboxWeak,\mboxResistant,\mboxAbsent} (A1)
\mboxRash\mboxtakes−values{\mboxPresent,\mboxAbsent} (A2)
initially-one-of (A3)
{({\mboxBacteria=\mboxWeak,\mboxRash=\mboxPresent},9/10),
({\mboxBacteria=\mboxAbsent,\mboxRash=\mboxPresent},1/10)}
\mboxTakesMedicine∧\mboxBacteria=\mboxWeak (A4)
causes-one-of
{({\mboxBacteria=\mboxAbsent,\mboxRash=\mboxAbsent},7/10),
({\mboxBacteria=\mboxResistant,\mboxRash=\mboxAbsent},1/10),
({\mboxBacteria=\mboxResistant},2/10)}
\mboxTakesMedicine∧\mboxBacteria=\mboxResistant (A5)
causes-one-of
{({\mboxBacteria=\mboxAbsent,\mboxRash=\mboxAbsent},1/13),
(∅,12/13)}
\mboxTakesMedicine\mboxperformed−at1 (A6)
\mboxTakesMedicine\mboxperformed−at3 (A7)
where (A1) and (A2) are v-propositions, (A3) is an i-proposition, (A4) and (A5) are c-propositions, (A6) and (A7) are p-propositions.
Example 6**.**
Scenario 3 can be modeled using the following domain description DK:
\mboxHasKeys\mboxtakes−values{⊤,⊥} (K1)
\mboxLockedOut\mboxtakes−values{⊤,⊥} (K2)
\mboxLocation\mboxtakes−values{\mboxInside,\mboxOutside} (K3)
\mbox{{\bf initially-one-of} }\{(\{\neg\mbox{{HasKeys}},\neg\mbox{{LockedOut}},\mbox{\mbox{{Location}}!=!\mbox{{Inside}}}\},1)\} (K4)
\mbox{{GoOut}}\wedge\neg\mbox{{HasKeys}}\wedge\mbox{\mbox{{Location}}!=!\mbox{{Inside}}} (K5)
causes-one-of
\{(\{\mbox{{LockedOut}},\mbox{\mbox{{Location}}!=!\mbox{{Outside}}}\},1)\}
\mbox{{GoOut}}\wedge\mbox{{HasKeys}}\wedge\mbox{\mbox{{Location}}!=!\mbox{{Inside}}} (K6)
\mbox{ {\bf causes-one-of} }\{(\{\mbox{\mbox{{Location}}!=!\mbox{{Outside}}}\},1)\}
\mbox{{PickupKeys}}\wedge\mbox{\mbox{{Location}}!=!\mbox{{Inside}}} (K7)
\mboxcauses−one−of{({\mboxHasKeys},1)}
\mboxPickupKeys\mboxperformed−at7:30 AM\mboxwith−prob0.99 (K8)
GoOut performed-at 7:40 AM (K9)
Finally, we introduce h-propositions, whose role is that of being entailed by domain descriptions:
Definition 13** (h-proposition).**
An h-proposition has the form
[TABLE]
for some i-formula φ.
For example, we will show in the following sections the formal sense in which DC entails the h-proposition “[\mbox{\mbox{{Coin}}!=!\mbox{{Heads}}}]@2\mbox{ {\bf holds-with-prob }}0.51”.
2.2 Semantics
For the remainder of this paper, D is an arbitrary domain description.
Definition 14** (Worlds).**
A world is a function W:I→S. The set of all worlds is denoted by W.
Notation 3**.**
In the following, we will use W,W′,W′′,W1,W2,… to denote worlds.
Definition 15** (Satisfaction of an i-formula, Logical Consequence for i-formulas).**
Given a world W and a literal L, W satisfies an i-formula [L]@I, written W∣∣\joinrel\Relbar[L]@I, iff L∈W(I)222The symbols ∣∣\joinrel\Relbar and ∣∣\joinrel\Relbar should not be confused with ⊨ and ⊨ which we use for the classical propositional entailment. Otherwise we write W∣∣\joinrel\Relbar[L]@I. The definition of ∣∣\joinrel\Relbar is recursively extended for arbitrary i-formulas as follows: if φ and φ′ are i-formulas, we write W∣∣\joinrel\Relbarφ∧φ′ iff W∣∣\joinrel\Relbarφ and W∣∣\joinrel\Relbar′, and W∣∣\joinrel\Relbar¬φ iff W∣∣\joinrel\Relbarφ. ∨ and → are taken as shorthand in the usual way. Given a (possibly empty) set Δ of i-formulas, we write W∣∣\joinrel\RelbarΔ iff W∣∣\joinrel\Relbarψ for all ψ∈Δ. Given an i-formula φ and a set Δ of i-formulas we write Δ∣∣\joinrel\Relbarφ if for all W∈W such that W∣∣\joinrel\RelbarΔ, W∣∣\joinrel\Relbarφ also holds. For two i-formulas ψ and φ, we use ψ∣∣\joinrel\Relbarφ as a shorthand for {ψ}∣∣\joinrel\Relbarφ, and ∣∣\joinrel\Relbarφ as a shorthand for ∅∣∣\joinrel\Relbarφ.
Example 7**.**
Three worlds for Scenario 1 can be specified as follows:
W1(0)={\mboxCoin=\mboxHeads,\mboxToss=⊥},
W1(1)={\mboxCoin=\mboxHeads,\mboxToss=⊤},
W1(I)={\mboxCoin=\mboxTails,\mboxToss=⊥} for all I≥2.
W2(0)={\mboxCoin=\mboxTails,\mboxToss=⊥},
W2(1)={\mboxCoin=\mboxHeads,\mboxToss=⊥},
W2(I)={\mboxCoin=\mboxTails,\mboxToss=⊤} for all I≥2.
W3(0)={\mboxCoin=\mboxHeads,\mboxToss=⊥},
W3(1)={\mboxCoin=\mboxHeads,\mboxToss=⊤},
W3(I)={\mboxCoin=\mboxHeads,\mboxToss=⊥} for all I≥2.
Intuitively, W1 and W3 match the domain description in Example 4 as they represent a coherent history of what could have happened in Scenario 1, whereas W2 does not (e.g., changes occur when no action is performed, an infinite number of actions is being performed, etc…). This intuition will be made precise in what follows.
Since worlds are functions from instants to states, they can conveniently be depicted as timelines as follows:
W_{1}$$i
{\mboxCoin=\mboxHeads, \mboxToss=⊥}
{\mboxCoin=\mboxHeads, \mboxToss=⊤}
{\mboxCoin=\mboxTails, \mboxToss=⊥}
01≥2
W_{2}$$i
{\mboxCoin=\mboxTails, \mboxToss=⊥}
{\mboxCoin=\mboxHeads, \mboxToss=⊥}
{\mboxCoin=\mboxTails, \mboxToss=⊤}
01≥2
W_{3}$$i
{\mboxCoin=\mboxHeads, \mboxToss=⊥}
{\mboxCoin=\mboxHeads, \mboxToss=⊤}
{\mboxCoin=\mboxHeads, \mboxToss=⊥}
01≥2
Definition 16** (Closed World Assumption for Actions).**
A world W is said to satisfy the closed world assumption for actions (or CWA for actions, for short) w.r.t. D if it satisfies the following condition: for all A∈A and I∈I, if W∣∣\joinrel\Relbar[A]@I then there exists some P+∈(0,1] such that “A\mboxperformed−atI\mboxwith−probP+” is in D. Furthermore, if for some A∈A and I∈I the p-proposition “A\mboxperformed−atI\mboxwith−prob1” is in D then it must be the case that W∣∣\joinrel\Relbar[A]@I.
Example 8**.**
Let W1, W2 and W3 be the worlds in Example 7, and let DC be the domain description in Example 4. World W1 satisfies CWA for actions w.r.t. DC as \mboxToss∈W1(I) if and only if I=1, which is consistent with (C4) being the only p-proposition in DC. CWA is not satisfied by W2 as ¬\mboxToss∈W2(1), i.e. W2∣∣\joinrel\Relbar[¬\mboxToss]@1, but this is not consistent with (C4). W3 satisfies CWA for actions for the same reason as W1.
Definition 17** (Cause Occurrence).**
Let θ be the body of a c-proposition c in a domain description D and I∈I. If W∣∣\joinrel\Relbar[θ]@I then we say that that a cause occurs at instant I in W w.r.t. to D, and that the c-proposition c is activated at I in W w.r.t. D. We write \mboxoccD(W) for the set \{I\in\mathcal{I}\mid\text{a cause occurs at IinW}\}. The function cpropD with domain {(W,I)∣W∈W,I∈occD(W)} is defined for instants I in its domain as cpropD(W,I)=c where c is the (unique) c-proposition activated at I in world W.
Example 9**.**
Let DC be as in Example 4 and W1, W2 and W3 be as in Example 7. Since W1∣∣\joinrel\Relbar[\mboxToss]@I if and only if I=1 (and similarly for W3), we derive that \mboxoccDC(W1)=\mboxoccDC(W3)={1}, with cpropDC(W1,1)=cpropDC(W3,1)=(C3). For W2, \mboxoccDC(W2) is defined as {I∣I∈N,I≥2} with cpropDC(W2,I)=(C3) for I≥2.
Definition 18** (Initial Choice).**
Let D be a domain description and the unique i-proposition in D be of the form (3). Each O1,O2,…,Om is called an initial choice w.r.t. D.
Definition 19** (Effect Choice).**
Let W be a world and D a domain description. An effect choice for W w.r.t. D is a function \mboxec:\mboxoccD(W)→O such that for all instants I∈\mboxoccD(W), \mboxec(I)∈\mboxhead(cpropD(W,I)).
Example 10**.**
Let DC be as in Example 4 and W1, W2 and W3 be as in Example 7. The only initial choice w.r.t. DC is \mboxic1=({\mboxCoin=\mboxHeads},1). The only effect choices for W1 w.r.t. DC are \mboxec1(1)=({\mboxCoin=\mboxTails},49/100), \mboxec2(1)=({\mboxCoin=\mboxHeads},49/100) and \mboxec3(1)=(∅,2/100). Notice that since occDC(W1)=occDC(W3), all the effect choices for W1 are also effect choices for W3. There are an (uncountably) infinite number of effect choices for W2 w.r.t. DC, each one mapping each instant I≥2 to ({\mboxCoin=\mboxHeads},49/100), ({\mboxCoin=\mboxTails},49/100) or (∅,2/100).
Definition 20** (Initial Condition).**
A world W is said to satisfy the initial condition w.r.t. D if there exists an initial choice ic w.r.t. D such that W(\mbox{\bar{0}})\mathord{\upharpoonright}\mathcal{F}=\chi(\mbox{{ic}}). If a world W satisfies the initial condition w.r.t. D for some initial choice ic, then we say that W and ic are consistent with each other w.r.t. D.
Example 11**.**
Let DC be as in Example 4, and W1, W2 and W3 be as in 7. Since \mboxic1=({\mboxCoin=\mboxHeads},1) is the only initial choice w.r.t. DC as outlined in Example 10, W1 and W3 are consistent w.r.t. DC with it, since W1(0)↾F=W3(0)↾F=χ(\mboxic1). Therefore, W1 and W3 satisfy the initial condition w.r.t. DC. Since W2(0)↾F=χ(\mboxic1), W2 does not satisfy the initial condition.
Definition 21** (Intervals).**
Given two instants I and I′ such that I≤I′, the intervals [I,I′], [I,I′), (I,I′] and (I,I′) are defined in the standard way w.r.t. the total order ≤. We also use [I,+∞) as shorthand for the set {I′∣I′∈I,I′≥I}, (−∞,I] as shorthand for {I′∣I′∈I,I′≤I}, (I,+∞) as a shorthand for [I,∞)∖{I} and (−∞,I) as a shorthand for (−∞,I]∖{I}.
Definition 22** (Fluent State Update).**
Given a fluent state S~ and a partial fluent state X~, the update of S~ w.r.t. X~, written S~⊕X~, is the fluent state (S~⊖X~)∪X~, where S~⊖X~ is the partial fluent state formed by removing all fluent literals from S~ of the form F=V for some F and V′ such that F=V′∈X~. The operator ⊕ is left-associative, so e.g. S~⊕X~⊕X~′ is understood as (\mbox{(\mbox{S~⊕X~})\oplus\tilde{X}^{\prime}}).
Definition 23** (Justified Change).**
A world W is said to satisfy the justified change condition w.r.t. D if and only if there exists an effect choice ec w.r.t. D such that for all instants I and I′ with I<I′, ec maps the possibly empty set of instants in \mboxoccD(W)∩[I,I′)={I1,…,In} to O1,O2,…,On respectively, where I1,…,In are ordered w.r.t. ≤, and
[TABLE]
If a world W satisfies the justified change condition for some effect choice ec, W and ec are said to be consistent with each other w.r.t. D.
Example 12**.**
Let DC be as in Example 4, W1, W2 be as in Example 7, and ec1 be defined as in Example 10.
For any two instants I, I′∈N with I<I′, if [I,I′)∩\mboxoccDC(W1)=∅ then clearly W1(I′)↾F=W1(I)↾F. Otherwise, if [I,I′)∩\mboxoccDC(W1)=∅, i.e. [I,I′)∩\mboxoccDC(W1)={1} then (6) holds as W1(I)↾F⊕χ(ec1(1))={\mboxCoin=\mboxTails}=W(I′)↾F. So the justified change condition w.r.t. DC is satisfied by W1.
For W to satisfy the justified change condition w.r.t. DC, equation (6) would require W2(0)↾F=W2(1)↾F (as \mboxoccDC(W2)∩[1,2)=∅), but this is not the case. Hence, W2 does not satisfy the justified change condition w.r.t. DC.
Definition 24** (Well-behaved Worlds).**
A world is said to be well-behaved w.r.t. D if it satisfies CWA for actions, the initial condition and the justified change condition w.r.t. D. We denote the set of well-behaved worlds w.r.t. D with WD.
Example 13**.**
Let DC be as in Example 4 and W1, W2 be as in Example 7. W1 is well-behaved as it satisfies CWA (see Example 8), the initial condition (see Example 11) and the justified change condition (see Example 12) w.r.t. DC. W2 is not well-behaved as it fails to satisfy any of these conditions.
Definition 25** (Candidate Trace, Trace).**
A candidate trace is a function tr:\textit{dom}(tr)\cup\{\rotatebox{90.0}{\bowtie}\}\rightarrow\mathcal{O} where dom(tr)⊆I and
⋈
is a new symbol such that \rotatebox{90.0}{\bowtie}\notin\mathcal{I}. For readability, we will sometimes write \langle tr(\rotatebox{90.0}{\bowtie})@\rotatebox{90.0}{\bowtie},tr(I_{1})@I_{1},\dots,tr(I_{m})@I_{m}\rangle where dom(tr)={I1,…,Im} and the instants are ordered w.r.t. ≤.
If W is well-behaved w.r.t. D and is consistent with the initial choice ic and the effect choice ec w.r.t. D, then tr is said to be a trace of W w.r.t. D if dom(tr)=\mboxoccD(W) and tr(\rotatebox{90.0}{\bowtie})=\mbox{{ic}} and for all I∈dom(tr), tr(I)=\mboxec(I) and in this case we will sometimes write tr=(\mboxic,\mboxec).
For any W∈W, we write TRDW for the set of all traces of W w.r.t. D, and notice that TRDW=∅ if and only if W is well-behaved.
A well-behaved world can have multiple traces, as shown in the following example.
Example 14**.**
Let DC be as in Example 4, W3 be as in Example 7 and \mboxic1, \mboxec2, \mboxec3 be as defined in Example 10. World W3 has two distinct traces, tr3′=(ic1,\mboxec2) and tr3′′=(\mboxic1,\mboxec3), which disagree on the effect choice: in one case the robot manages to toss the coin producing \mboxCoin=\mboxHeads as a result (i.e., tr3′(1)=({\mboxCoin=\mboxHeads},0.49)) whereas in the other case the robot fails to grab the coin (i.e., tr3′′(1)=(∅,0.02)) leaving \mboxCoin=\mboxHeads to hold. These two traces are also the only traces of this world w.r.t. DC.
However, for some candidate traces tr there exists no well-behaved world W such that tr is a trace of W. We now generalise Definition 25 to domain descriptions:
Definition 26** (Trace of a Domain Description).**
Given a candidate trace tr, if there exists a well-behaved world W w.r.t. D such that tr is a trace of W w.r.t. D, then tr is said to be a trace of D.
Definition 27** (Evaluation of a Trace).**
Let tr be a candidate trace. The evaluation of tr, written ϵ(tr), is defined as:
[TABLE]
Definition 28** (Evaluation of a Narrative).**
Given a p-proposition p of the form “A\mboxperformed−atI\mboxwith−probP+”, we define the evaluation of p w.r.t. W as
[TABLE]
For an action narrative N (see Definition 12) we extend the previous definition to:
[TABLE]
and write ϵD(W) as a shorthand for ϵ(narr(D),W). Conventionally, ϵ(N,W)=1 when N=∅.
Definition 29** ([0,1]-interpretation).**
A [0,1]-interpretation is a function from W to [0,1].
Definition 30** (Model).**
A model of a domain description D is a [0,1]-interpretation MD such that
-
If W∈W is not well-behaved w.r.t. D,
[TABLE]
2. 2.
If W∈W is well-behaved w.r.t. D,
[TABLE]
Example 15**.**
Let DC be as in Example 4 and W3 be as Example 7. As discussed in Example 14, W3 has exactly two traces tr3′=(ic1,\mboxec2) and tr3′′=(\mboxic1,\mboxec3). Equations (7) and (11) yield:
[TABLE]
Proposition 1**.**
A domain description D has a unique model.
Proof.
This can be derived from Definition 30 by considering that MD(W) is calculated as a product of functions of the states of W.
∎
Definition 31**.**
We extend the model MD to a function MD∗:Φ→[0,1] over i-formulas in the following way:
[TABLE]
Definition 32** (Entailment for Domain Descriptions).**
Given a domain description D and an i-formula φ, we say that the h-proposition “φ\mboxholds−with−probP” is entailed by D iff MD∗(φ)=P.
Example 16**.**
For DC as in Example 4, the only well-behaved world W such that W\mathrel{||}\joinrel\Relbar[\mbox{\mbox{{Coin}}!=!\mbox{{Heads}}}]@2 is W3. Definition 31 and Example 15 yield
[TABLE]
The reader can verify that [\mbox{\mbox{{Coin}}!=!\mbox{{Heads}}}]@0 yields
[TABLE]
and from this we can derive that DC entails the two following h-propositions:
[\mbox{\mbox{{Coin}}!=!\mbox{{Heads}}}]@2\mbox{ {\bf holds-with-prob }}0.51,
[\mbox{\mbox{{Coin}}!=!\mbox{{Heads}}}]@0\mbox{ {\bf holds-with-prob }}1.
Example 17**.**
Let DK be as in Example 6. Assuming \mbox{\bar{0}}=\text{7:30 AM}, the only two well-behaved worlds w.r.t. DK are:
W_{1}$$i
{¬\mboxHasKeys, ¬\mboxLockedOut, \mbox{\mbox{{Location}}!=!\mbox{{Inside}}}, \mboxPickupKeys, ¬\mboxGoOut}
{\mboxHasKeys, ¬\mboxLockedOut, \mbox{\mbox{{Location}}!=!\mbox{{Inside}}}, ¬\mboxPickupKeys, \mboxGoOut}
{\mboxHasKeys, ¬\mboxLockedOut, \mbox{\mbox{{Location}}!=!\mbox{{Outside}}}, ¬\mboxPickupKeys, ¬\mboxGoOut}
7:30 AM7:40 AM>7:40 AM
W_{2}$$i
{¬\mboxHasKeys, ¬\mboxLockedOut, \mbox{\mbox{{Location}}!=!\mbox{{Inside}}}, ¬\mboxPickupKeys, ¬\mboxGoOut}
{¬\mboxHasKeys, ¬\mboxLockedOut, \mbox{\mbox{{Location}}!=!\mbox{{Inside}}}, ¬\mboxPickupKeys, \mboxGoOut}
{¬\mboxHasKeys, \mboxLockedOut, \mbox{\mbox{{Location}}!=!\mbox{{Outside}}}, ¬\mboxPickupKeys, ¬\mboxGoOut}
7:30 AM7:40 AM>7:40 AM
Since both actions GoOut and PickupKeys have definite effects (i.e., outcomes in the head of the corresponding c-propositions have probability equal to 1), the only significant factors in the calculation of MDK are those given by the evaluation of the action narrative:
[TABLE]
[TABLE]
implying that DK entails the following propositions:
[\mboxLockedOut]@9AM\mboxholds−with−prob0.01,
[\mboxHasKeys]@9AM\mboxholds−with−prob0.99.
2.3 Properties of a model
We now introduce the concept of a probability function, adapted from [15]:
Definition 33** (Probability Function, Conditional Probability).**
A probability function (over i-formulas) is a function p:Φ→[0,1] such that:
-
if ∣∣\joinrel\Relbarφ, then p(φ)=1,
2. 2.
if φ∣∣\joinrel\Relbar¬ψ for two i-formulas φ and ψ, then p(φ∨ψ)=p(φ)+p(ψ).
The associated conditional probability of φ given ψ is defined as
[TABLE]
for p(ψ)=0.
We will show that MD∗ is a probability function. To prove this, first we need to introduce some auxiliary definitions:
Definition 34** (Restricted Domain Description).**
If D is a domain description, we denote by D≤I the domain description obtained from D by removing all the p-propositions occurring at instants >I, and similarly we denote by D<I the domain description obtained from D by removing all the p-propositions occurring at instants ≥I. Finally, we denote by D∅ the domain description obtained from D by removing all p-propositions, i.e. \mathcal{D}_{<\mbox{\bar{0}}}.
Definition 35** (Fluent-indistinguishability, Indistinguishability).**
A world W is said to be fluent-indistinguishable from W′ up to an instant I if and only if W(I′)↾F=W′(I′)↾F for all instants I′ such that I′≤I. W is said to be indistinguishable from W′ up to an instant I if and only if it is fluent indistinguishable from W′ up to I and if for all I′<I it also satisfies A∈W(I′) if and only if A∈W′(I′).
In the following example, we illustrate the two concepts of restricted domain description and indistinguishability:
Example 18**.**
Let D′ be the domain description obtained from DC as in Example 4 by adding the following p-proposition:
\mboxToss\mboxperformed−at2 (C5)
and consider the following well-behaved world w.r.t. D′:
W′(0)={\mboxCoin=\mboxHeads,¬\mboxToss},
W′(1)=W′(2)={\mboxCoin=\mboxHeads,\mboxToss},
W′(I)={\mboxCoin=\mboxTails,¬\mboxToss} for all I>2
W′ has exactly two traces tr^{\prime}=\langle(\{\mbox{{Coin}}=\mbox{{Heads}}\},1)@\rotatebox{90.0}{\bowtie},(\{\mbox{{Coin}}=\mbox{{Heads}}\},0.49)@1,(\{\mbox{{Coin}}=\mbox{{Tails}}\},0.49)@2\rangle and tr^{\prime\prime}=\langle(\{\mbox{{Coin}}=\mbox{{Heads}}\},1)@\rotatebox{90.0}{\bowtie},(\emptyset,0.02)@1,(\{\mbox{{Coin}}=\mbox{{Heads}}\},0.49)@2\rangle.
Consider D<2′ and notice that it coincides with DC as in the previous examples. There is a unique well-behaved world w.r.t. DC that is indistinguishable from W′ up to 2, and this world is W3 as in Example 7.
Definition 36** (Transition Set, Transition Function).**
Given a domain description D, a state S and a fluent state S~′, the transition set tsetD(S,S~′) is defined as follows: if D contains a (unique) c-proposition c such that S Herbrand-entails \mboxbody(c), then tsetD(S,S~′)={O∈\mboxhead(c)∣(S↾F)⊕χ(O)=S~′} if there is no such c-proposition and S↾F=S~′ then tset(S,S~′)={(∅,1)}; otherwise, tsetD(S,S~′)=∅.
The transition function for a domain description D is the function tD:S×S~→[0,1] defined by tD(S,S~′)=π(tsetD(S,S~′)) (recall Definition 6 for the meaning of π in this case).
Informally, the transition function gives the probability of moving from state S to the fluent state S~′ within D, independently of its particular narrative.
The transition function for the coin toss example can be visualised as in Figure 1, where the nodes represent fluent states (in this case we have two nodes H and T standing for the fluent states {\mboxCoin=\mboxHeads} and {\mboxCoin=\mboxTails} respectively), and if p=tD(S,S~′) for some state S and some fluent state S~′, then there is an arrow from a node representing S↾F to a node representing S~′ which is labelled S↾A,p. The arrow is omitted in some trivial cases (for instance when the set of actions is empty).
Similarly, the transition function for the antibiotic domain can be pictured as in Figure 2.
where RPBR is the fluent state {\mboxRash=\mboxPresent,\mboxBacteria=\mboxResistant}, RPBW is the fluent state {\mboxRash=\mboxPresent,\mboxBacteria=\mboxWeak}, RABA is the fluent state {\mboxRash=\mboxAbsent,\mboxBacteria=\mboxAbsent}, RABR is the fluent state {\mboxRash=\mboxAbsent,\mboxBacteria=\mboxResistant}, and TM={\mboxTakesMedicine}.
The transition function can be conveniently used to express MD(W) in terms of the model of a well-behaved world w.r.t. an appropriately restricted domain description:
Proposition 2**.**
Let D be an arbitrary domain description and W be a world such that \mboxoccD(W)={I1,…,In}=∅ where I1,…,In are ordered w.r.t. ≤, and let c be the c-proposition activated in W at In w.r.t. D. Then W is well-behaved w.r.t. D if and only if (i) there exists a unique world W′ well-behaved w.r.t. D<In which is indistinguishable from W up to In, (ii) for all I>In, W(I)↾F=S~>InW where S~>InW=(W(In)↾F)⊕χ(O) for some outcome O∈\mboxhead(c) , and (iii) W satisfies CWA for actions w.r.t. D.
Furthermore, for S~>InW the unique fluent state taken by W at instants I>In:
[TABLE]
Proof.
“Only if” subproof. Let W be well-behaved w.r.t. D. Let tr=\langle tr(\rotatebox{90.0}{\bowtie})@\rotatebox{90.0}{\bowtie},tr(I_{1})@I_{1},\dots,tr(I_{n})@I_{n}\rangle be an arbitrary trace of W w.r.t. D and consider the candidate trace tr^{\prime}=\langle tr(\rotatebox{90.0}{\bowtie})@\rotatebox{90.0}{\bowtie},tr(I_{1})@I_{1},\dots,tr(I_{n-1})@I_{n-1}\rangle.
Since W is well-behaved w.r.t. D, since D and D<In differ only by one p-proposition occurring at In, and since tr′ does not mention any instant strictly greater than In−1, it is possible to construct a world W′ which has trace tr′ w.r.t. D<In and which is fluent-indistinguishable from W up to instant In by simply considering that W^{\prime}(\mbox{\bar{0}})=\chi(tr^{\prime}(\rotatebox{90.0}{\bowtie}))=W(\mbox{\bar{0}}) makes the Initial Condition satisfied w.r.t. D<In as both D and D<In share the same i-proposition, and a similar argument applies to the Justified Change Condition w.r.t. D<In. Well-behavedness w.r.t. D and D<In guarantees that for all instants I≤In, W(I)\mathord{\upharpoonright}\mathcal{F}=tr(\rotatebox{90.0}{\bowtie})\oplus\dots\oplus tr(I_{i})=tr^{\prime}(\rotatebox{90.0}{\bowtie})\oplus\dots\oplus tr^{\prime}(I_{i})=W^{\prime}(I)\mathord{\upharpoonright}\mathcal{F} for some i<n, hence W is fluent-indistinguishable from W′ up to In. Such a W′ might not be unique, but if we choose W′ as to satisfy A∈W(I)⇔A∈W′(I) for all I<In then the uniqueness of W′ is guaranteed. Then, (i) holds. Since W is well-behaved w.r.t. D and In is the greatest element in \mboxoccD, χ(tr(In))=O for some O∈\mboxhead(c) and Justified Change implies W(I)↾F=(W(In)↾F)⊕χ(tr(In)) for all I>In, and if we let S~>InW be such unique fluent state (ii) is also satisfied. Finally, (iii) holds by definition of well-behavedness w.r.t. D.
“If” subproof. Let W′ be a well-behaved world w.r.t. D<In and let \mboxoccD<In(W′)={I1,…,In−1}. Let tr^{\prime}=\langle tr(\rotatebox{90.0}{\bowtie})@\rotatebox{90.0}{\bowtie},tr(I_{1})@I_{1},\dots,tr(I_{n-1})@I_{n-1}\rangle be a trace of W′ w.r.t. DIn and construct the candidate trace tr=\langle tr(\rotatebox{90.0}{\bowtie})@\rotatebox{90.0}{\bowtie},tr(I_{1})@I_{1},\dots,O@I_{n}\rangle for the outcome O∈\mboxhead(c) such that (W(I)↾F)=(W(In)↾F)⊕χ(O) for all I>In. Since W′ is well-behaved w.r.t. D<In and indistinguishable from W up to In by hypothesis (i), we derive that tr is a trace of W′ w.r.t. D by noticing again that both D and D<In share the same i-proposition, and a similarly arguments applies for the Justified Change Condition w.r.t. D (also using hypothesis (ii)). Since W also satisfies CWA for actions by hypothesis (iii), it is well-behaved.
“Furthermore” subproof. Let S~>InW and c be as in the statement of the proposition. The above proof implies that for any trace tr of W w.r.t. D this trace can be constructed from a trace tr′ of W′ by letting tr(Ii)=tr′(Ii) for i<In and tr(In)=χ(O) for some O∈\mboxhead(c) such that S~>InW=(W(In)↾F)⊕χ(O) (and notice that there is at least such an outcome O since W is well-behaved), i.e. for some O∈tsetD(W(In),S~>InW).
Definition 30 now implies
[TABLE]
which is well defined since ϵ(N,W)>0 for any action narrative N and world W.
∎
Corollary 1**.**
Let D be any domain description and let I be any instant. Then W is well-behaved w.r.t. D≤I if and only if (i) there exists a unique world W′ well-behaved w.r.t. D<I which is indistinguishable from W up to I, (ii) for all I′>I then W(I′)↾F=S~>InW where S~>InW=(W(I)↾F)⊕χ(O) for some outcome O∈\mboxhead(c) if I∈\mboxoccD≤I(W), and S~>InW=W(I)↾F otherwise, and (iii) W satisfies CWA for actions w.r.t. D≤I.
Furthermore, for S~>InW the unique fluent state taken by W at instants I>In:
[TABLE]
Proof.
If I∈\mboxoccD≤I(W) then the corollary follows directly from Proposition 2 since the domain description D≤I satisfies all of its hypotheses. If I∈/\mboxoccD≤I(W) then no change of state occurs at I in W, i.e. W(I)↾F=W(I′)↾F=S~>IW for any I′>I, and Equation (14) holds for tD(W(I),S~>IW)=1.
∎
Lemma 1**.**
For any D and any state S,
[TABLE]
Proof.
We prove this by cases:
Case 1. If there is no c-proposition c such that S Herbrand-entails \mboxbody(c), then it follows from Definition 36 that
[TABLE]
which is what we want.
Case 2. Let c be the unique c-proposition S Herbrand-entails \mboxbody(c). Then, applying the definition of tD from Definition 36 gives
[TABLE]
Notice that for a fixed outcome O, it is impossible to have O∈tsetD(S,S~′) and O∈tsetD(S,S~′′) for two distinct fluent states S~′,S~′′ as this would imply S~′=(S↾F)⊕χ(O)=S~′′. Hence it is sufficient to show that {O∈tsetD(S,S~′)∣S~′∈S~}=\mboxhead(c), as this implies that the sum (15) equals 1 since π(\mboxhead(c))=1 by definition of a c-proposition.
By definition of a transition set, {O∈tsetD(S,S~′)∣S~′∈S~}⊆\mboxhead(c). Conversely, for any O∈\mboxhead(c), O∈tsetD(S,S~′) for S~′=(S↾F)⊕χ(O), hence \mboxhead(c)⊆{O∈tsetD(S,S~′)∣S~′∈S~} which ends the proof of lemma.
∎
Lemma 2**.**
Let D be any domain description, I be any instant and NI be the possibly empty action narrative that contains exactly those p-propositions in D that occur at I. Let W1,…,Wm be well-behaved worlds w.r.t. D such that Wi(I)↾F=Wj(I)↾F for all 1≤i,j≤m and which represent all the equivalence classes such that W is equivalent to W′ if and only if W(I)=W′(I). Then,
[TABLE]
Proof.
Let p1,…,pk be the p-propositions in NI (possibly none, in which case k=0) that have probabilities strictly less than 1 attached. Then, there are at least 2k well-behaved worlds w.r.t. D satisfying W(I)↾F=W′(I)↾F, of which W1,…,Wm are representatives of each possible assignment of actions to {⊤,⊥}. Therefore, if we let pi have the form “Ai\mboxperformed−atI\mboxwith−probPi” for all 1≤i≤k, the sum ∑j=1mϵ(NI,Wj) evaluates to:
[TABLE]
∎
We can now prove the central property of M∗:
Proposition 3**.**
Given a model MD of a domain description D, its extension to MD∗ is a probability function.
Proof.
We show that for any domain description, requirements 1 and 2 as in Definition 33 are always satisfied by a model of that domain description.
Proof of requirement 1. We need to show that for any ψ such that W∣∣\joinrel\Relbarψ for all worlds W,
[TABLE]
where the second equality is guaranteed by the fact that MD(W)=0 when W is not well-behaved.
For a p-proposition p we define \mboxhasInstant(p) as the instant p has, and for an action narrative N we extend this to:
[TABLE]
We prove (16) by induction on \mboxhasInstants(narr(D))={I1,…,In} where I1,…,In are ordered w.r.t. ≤. Notice that D≤In=D.
Base case. We consider D∅ first. Since there are no p-propositions in D∅, \mboxhasInstants(D∅)=∅, ϵD∅(W)=∅ for all worlds W, and the sum (16) becomes:
[TABLE]
Let {O1,…,Om} be the outcomes occurring in the only i-proposition of D∅. We prove that the well-behaved worlds w.r.t. D∅ are exactly those Ws taking the form W(I)↾F=χ(Oi) and ¬A∈W(I) for all instants I and all action symbols A.
If W has this form, then it satisfies CWA (as there are no p-propositions in D∅, and this is consistent with ¬A∈W(I) for all I and A), it satisfies the initial condition w.r.t. D∅ as Oi is an initial choice w.r.t. D∅ and W(\mbox{\bar{0}})\mathord{\upharpoonright}\mathcal{F}=\chi(O_{i}) by definition, and finally it also satisfies the justified change condition in the form (6) as \mboxoccD∅(W)=∅, which in turn forces W(I)↾F=W(I′)↾F for all I and I′. The fact that if W is well-behaved then it is of the form above is a simple inversion of the previous chain of implications.
Notice that each of these well-behaved worlds is consistent with a unique trace \langle O_{i}@\rotatebox{90.0}{\bowtie}\rangle for some 1≤i≤m, and let Wi denote the world having trace \langle O_{i}@\rotatebox{90.0}{\bowtie}\rangle for 1≤i≤m. Hence we can write WD∅={W1,…,Wm}. For such Wi,
[TABLE]
and (17) evaluates to:
[TABLE]
as π({O1,…,Om})=1 by Definition 9 of an i-proposition.
Inductive step. Assume that MD<Ii∗(ψ)=1 for some i≤n. We prove that MD≤Ii∗(ψ)=1.
Let [W′]DI be the set of well-behaved worlds w.r.t. D that are indistinguishable from W′ up to I. Corollary 1 and Lemma 1 together with the inductive hypothesis allow us to turn Equation (16) into:
[TABLE]
According to Corollary 1 every world in [W′]D≤IiIi can be reconstructed from its state at instant Ii and the unique state S~′ that it takes at instants strictly greater than Ii. Consider the equivalence relation such that two well-behaved worlds W and W′ w.r.t. D≤Ii are equivalent if and only if W(Ii)=W′(Ii), and let W1,…,Wm be representatives of all the equivalence classes. Then, the above chain of equalities continues as follows:
[TABLE]
Proof of requirement 2. Let φ and ψ be two i-formulas such that φ∣∣\joinrel\Relbar¬ψ. Obviously, since φ∣∣\joinrel\Relbar¬ψ if for some W∈W, W∣∣\joinrel\Relbarφ, then W∣∣\joinrel\Relbarψ and vice-versa, hence
[TABLE]
∎
An immediate consequence of the previous proposition is the following one:
Corollary 2**.**
For any given domain description D, WD=∅.
2.4 Example entailments
The following are example entailments from the formalisation of Scenarios 1, 2 and 3.
DC as in Example 4 entails, among others:
⊤\mboxholds−with−prob1 (∣∣\joinrel\RelbarC1)
[\mboxCoin=\mboxTails]@0\mboxholds−with−prob0 (∣∣\joinrel\RelbarC2)
[\mboxToss=⊤]@1\mboxholds−with−prob1 (∣∣\joinrel\RelbarC3)
[\mboxCoin=\mboxHeads]@2\mboxholds−with−prob0.51 (∣∣\joinrel\RelbarC4)
[\mboxCoin=\mboxHeads]@1∧[\mboxCoin=\mboxTails]@3 (∣∣\joinrel\RelbarC5)
\mboxholds−with−prob0.49
where ⊤ is any tautological i-formula (i.e., W∣∣\joinrel\Relbar⊤ for all W∈W).
The following h-propositions are entailed by DA:
[\mboxBacteria=\mboxWeak]@0\mboxholds−with−prob0.9 (∣∣\joinrel\RelbarA1)
[\mboxBacteria=\mboxWeak∧\mboxRash=\mboxAbsent]@0 (∣∣\joinrel\RelbarA2)
\mboxholds−with−prob0
[\mboxBacteria=\mboxResistant]@2\mboxholds−with−prob0.27 (∣∣\joinrel\RelbarA3)
[\mboxRash=\mboxAbsent]@4\mboxholds−with−prob0.733846 (∣∣\joinrel\RelbarA4)
[\mboxBacteria=\mboxAbsent∧\mboxRash=\mboxAbsent]@4 (∣∣\joinrel\RelbarA5)
\mboxholds−with−prob0.650769
Notice that from (∣∣\joinrel\RelbarA4) and (∣∣\joinrel\RelbarA5) we can calculate the conditional probability that the medicine has cured the infection at instant 4, i.e. [\mboxBacteria=\mboxAbsent]@4, given that no sign of rash is visible at the end of the treatment, i.e. [\mboxRash=\mboxAbsent]@4. Applying (12) gives that this probability equals 0.650769/0.733846≈0.887.
Finally, the following h-propositions are entailed by DK:
[\mboxLockedOut]@8AM\mboxholds−with−prob0.01, (∣∣\joinrel\RelbarK1)
[\mboxHasKeys]@9AM\mboxholds−with−prob0.99, (∣∣\joinrel\RelbarK2)
[\mboxPickupKeys]@7:40AM\mboxholds−with−prob0.99. (∣∣\joinrel\RelbarK3)
3 Translation
To aid the reader’s intuition, we outline the translation of a domain description D into an answer set program. The idea is that of generating all the traces of a domain description as distinct stable models of the translated domain description. These traces can then be processed by an external tool such as AWK in order to calculate the probability of given queries.
In the following, we restrict the domain language to be such that I is a finite interval {0,1,…,\mboxmaxinst} of N, with \mbox{\bar{0}}=0 and ≤=≤N being the usual ordering relation between naturals.
3.1 Translation of the domain-dependent part
We start by introducing the full translation of the coin domain description from Example 4.
Example 19** (Translation of the Coin Toss Domain).**
Let DC be as in Example 4. The translation of DC results in the following set of clauses:
\mboxfluent(\mboxcoin). (TC0)
\mboxaction(\mboxtoss).
\mboxinstant(0..\mboxmaxinst).
\mboxpossVal(\mboxcoin,\mboxheads). (TC1)
\mboxpossVal(\mboxcoin,\mboxtails).
\mboxbelongsTo((\mboxcoin,\mboxheads),id10). (TC2)
\mboxinitialCondition((id10,1)).
\mboxbelongsTo((\mboxcoin,\mboxheads),id11). (TC3.1)
\mboxcausesOutcome((id11,49/100),I)←
\mboxholds(((\mboxtoss,\mboxtrue),I)).
\mboxbelongsTo((\mboxcoin,\mboxtails),id21). (TC3.2)
\mboxcausesOutcome((id21,49/100),I)←
\mboxholds(((\mboxtoss,\mboxtrue),I)).
\mboxcausesOutcome((id31,2/100),I)← (TC3.3)
\mboxholds(((\mboxtoss,\mboxtrue),I)).
\mboxperformed(\mboxtoss,1). (TC4)
where, informally, the set of clauses (TC0) is the translation of the three sorts F, A and I; (TC1), (TC2) and (TC4) are the translation of (C1), (C2) and (C4) respectively; (TC3.1), (TC3.2) and (TC3.3) together give the translation of (C3), and each of them corresponds to an outcome in the corresponding c-proposition;
Since in logic programming lowercase letters are conventionally used for constants, we switch to that convention by letting lower case letters be the logic programming counterparts of (upper case) constants in PEC so that e.g. f is regarded as the translated fluent F. Furthermore, literals of the form X=V are translated into pairs of the form (x,v).
The three sorts F, A and I are translated to the three sets {\mboxfluent(f)∣F∈F}, {\mboxaction(a)∣A∈A} and {\mboxinstant(i)∣I∈I} respectively (see e.g. (TC0) in Example 19).
Let c be a c-proposition of the generic form (2):
[TABLE]
but first considering the case where θ is a conjunction of the form X1=V1∧⋯∧Xj=Vj. Given a conjunction θ as before, we write \mboxholds([θ]@I) as a shorthand for the logic programming conjunction
[TABLE]
Fix an enumeration (without repetitions) of all the c-propositions in D, and let c be the nth proposition occurring in such enumeration. Then, c is translated to:
{\mboxbelongsTo((x,v),idin)∣i=1,…,m,X=V∈χ(Oi)}
∪{\mboxcausesOutcome((idin,p),I)←\mboxholds(θ,I)∣
i=1,…,m,,P=π(Oi)}
where id1n,…,idmn are new constants in the underlying ASP language. We write CD for the set of all translated c-propositions in D.
Example 20**.**
The clauses (TC3.1), (TC3.2) and (TC3.3) are the translation of the c-proposition (C2) from Example 4.
As a further example, consider the c-proposition (A5) as in Example 5, and notice that two outcomes occur in it, i.e. ({\mboxBacteria=\mboxAbsent,\mboxRash=\mboxAbsent},1/13) and (∅,4/13). If we fix the enumeration of c-propositions in DA such that (A4) is first and (A5) is second, this c-proposition is translated to:
\mboxbelongsTo((\mboxbacteria,\mboxabsent),id12). (TA5.1)
\mboxbelongsTo((\mboxrash,\mboxabsent),id12).
\mboxcausesOutcome((id12,1/13),I)←
\mboxholds((\mboxtakesMedicine,\mboxtrue),I),
\mboxholds((\mboxbacteria,\mboxresistant),I).
\mboxcausesOutcome((id22,4/13),I)← (TA5.2)
\mboxholds((\mboxtakesMedicine,\mboxtrue),I),
\mboxholds((\mboxbacteria,\mboxresistant),I).
If θ is not a conjunction of literals, then represent it in Disjunctive Normal Form, i.e. in the form θ1∨⋯∨θn with θ1,…,θn conjunctions of literals, and then for each rule write the precondition of each causes-one-of clause in the disjunctive form:
[TABLE]
The translation of i-propositions works in a very similar way: if J is an i-proposition of the general form (3):
[TABLE]
then its translation is given by the following set of clauses:
{\mboxbelongsTo((x,v),idi0)∣i=1,…,m,X=V∈χ(Oi)}
∪{\mboxinitialCondition((idi0,p))∣i=1,…,m,P=π(Oi)}
and we write ID for the set of all translated i-propositions in D.
Example 21**.**
An example of translated i-proposition is the set of clauses (TC2), that translate (C2) as in Example 19.
The i-proposition (A3) from Example 5 is translated to:
\mboxbelongsTo((\mboxbacteria,\mboxweak),id10). (TA3.1)
\mboxbelongsTo((\mboxrash,\mboxpresent),id10).
\mboxinitialCondition((id10,9/10)).
\mboxbelongsTo((\mboxbacteria,\mboxabsent),id20). (TA3.2)
\mboxbelongsTo((\mboxrash,\mboxpresent),id20).
\mboxinitialCondition((id20,1/10)).
Finally, the translation of p-propositions and v-propositions is straightforward: any generic p-proposition of the form (4) is translated to
\mboxperformed(a,i).
and we write PD for the set of all translated p-propositions in D, while any v-proposition of the form (1) is translated to:
{\mboxpossVal(f,vi)∣1≤i≤n}
and we write VD for the set of all translated v-propositions in D.
Example 22**.**
The v-proposition (C1) and p-proposition (C4) from from Example 4 are translated to (TC1) and (TC4) as in Example 19, respectively, while (A1), (A2), (A6), (A7) from Example 5 are translated to:
\mboxpossVal(\mboxbacteria,\mboxweak). (TA1)
\mboxpossVal(\mboxbacteria,\mboxresistant).
\mboxpossVal(\mboxbacteria,\mboxabsent).
\mboxpossVal(\mboxrash,\mboxpresent). (TA2)
\mboxpossVal(\mboxrash,\mboxabsent).
\mboxperformed(\mboxtakesMedicine,1). (TA6)
\mboxperformed(\mboxtakesMedicine,3). (TA7)
Since PD and VD contain only ground facts which clearly correspond to their semantic counterparts (i.e., p-propositions and v-propositions) we are not going to discuss their correctness in close detail.
We write ΠD for the set of translated propositions from D, e.g. if DC is the coin toss domain, ΠDC= (TC0–4).
3.2 Translation of the domain-independent part
We define the domain-independent part of our theory to be:
\mboxpossVal(A,\mboxtrue)←\mboxaction(A). (PEC1)
\mboxpossVal(A,\mboxfalse)←\mboxaction(A).
\mboxfluentOrAction(X)←\mboxfluent(X);\mboxaction(X). (PEC2)
\mboxliteral((X,V))←\mboxpossVal(X,V). (PEC3)
\mboxiLiteral((L,I))←\mboxliteral(L),\mboxinstant(I). (PEC4)
\mboxdefinitelyPerformed(A,I)←\mboxperformed(A,I,1). (PEC5)
\mboxpossiblyPerformed(A,I)←\mboxperformed(A,I,P). (PEC6)
1{ \mboxholds(((X,V),I)):\mboxiLiteral(((X,V),I)) }1 (PEC7)
←\mboxinstant(I),\mboxfluentOrAction(X).
\mboxinOcc(I)←\mboxinstant(I),\mboxcausesOutcome(O,I). (PEC8)
1{ \mboxeffectChoice(O,I):\mboxcausesOutcome(O,I) }1 (PEC9)
←\mboxinOcc(I).
1{ \mboxinitialChoice(O):\mboxinitialCondition(O) }1. (PEC10)
⊥←\mboxaction(A),\mboxinstant(I), (PEC11)
\mboxholds(((A,\mboxtrue),I)),not\mboxpossiblyPerformed(A,I).
⊥←\mboxaction(A),\mboxinstant(I), (PEC12)
\mboxholds(((A,\mboxfalse),I)),\mboxdefinitelyPerformed(A,I).
⊥←\mboxinitialChoice((S,P)),\mboxliteral(L), (PEC13)
\mboxbelongsTo(L,S),not\mboxholds((L,0)).
⊥←\mboxinstant(I),\mboxeffectChoice((X,P),I), (PEC14)
\mboxfluent(F),\mboxbelongsTo((F,V),X),
not\mboxholds(((F,V),I+1)),I<\mboxmaxinst.
⊥←\mboxinstant(I),\mboxfluent(F),not\mboxholds(((F,V),I)), (PEC15)
\mboxeffectChoice((X,P),I),not\mboxbelongsTo((F,V),X),
\mboxholds(((F,V),I+1)),I<\mboxmaxinst.
⊥←\mboxfluent(F),\mboxinstant(I),\mboxholds(((F,V),I)), (PEC16)
not\mboxinOcc(I),not\mboxholds(((F,V),I+1)),
I<\mboxmaxinst.
\mboxeval(A,I,P)←\mboxaction(A),\mboxinstant(I), (PEC17)
\mboxperformed(A,I,P),\mboxholds(((A,\mboxtrue),I)).
\mboxeval(A,I,1−P)←\mboxaction(A),\mboxinstant(I), (PEC18)
\mboxperformed(A,I,P),\mboxholds(((A,\mboxfalse),I)).
(PEC1–4) implement the basic predicates and sorts of PEC, namely: (PEC1) states that actions are boolean; (PEC2) defines a characteristic predicate for F∪A; (PEC3) and (PEC4) define literals and i-literals, respectively. (PEC5) and (PEC6) define the two auxiliary predicates definitelyPerformed and possiblyPerformed representing the sets of actions and instants such that A is certainly performed at I (i.e., with probability 1) and such that A might have been performed at I (i.e., with a probability greater than [math]) respectively. Proving that (PEC1–6) correctly characterise the sorts and sets they stand for is trivial and is omitted here.
Intuitively, axioms (PEC7–18) correspond to the definitions introduced in the previous section, namely: (PEC7) corresponds to Definition 14, (PEC8) defines a characteristic predicate for occ as in Definition 17, (PEC9) and (PEC14–16) correspond to justified change, (PEC10) and (PEC13) corresponds to the initial condition, (PEC11) and (PEC12) correspond to CWA for actions.
We denote the domain-independent part of our theory, i.e. (PEC1–18), by ΠI. Notice that axioms (PEC11–16) are constraints, and in the following will be referred to as ΠC.
4 Correctness
We now show that the provided translation is sound and complete with respect to the definitions given in the previous sections. This proof relies on the Splitting Theorem [10], a useful tool to obtain the answer sets of a ground program. Informally, a set U of atoms is a splitting set for a program Π if, for every rule in Π, if U contains some atom in the head of such rule, then it also contains all the atoms occurring in that rule. For instance, if Π′={a←notb,b←c,c} then {a,b,c}, ∅, {b,c} and {c} are splitting sets for Π′, whereas {a,b}, {a} and {b} are not.
A splitting set U splits an answer set program Π into a bottom program botU(Π) and a top program topU(Π)=Π∖botU(Π). With the program Π′ defined as above, U′={c} splits Π′ into botU′(Π′)={c} and topU′(Π′)={a←notb,b←c}.
The splitting set theorem states that the answer sets of Π are exactly those that can be expressed as X∪Y for X an answer set of botU(Π) and Y an answer set of \mboxeU(topU(Π),X), where \mboxeU(Π,Z) for a generic program Π, set of atoms U and answer set Z denotes the partial evaluation of the program Π w.r.t. U which is defined as follows: a rule r is in \mboxeU(Π,Z) if and only if there exists a rule r′∈Π such that all literals in the body of r′ with at least an atom of U occurring in them are also in Z, and the rule r is obtained from r′ by removing all the occurrences of such literals. If we consider Π′ and U′ again and let X′ be the only answer set {c} of botU′(Π′)={c}, Π′′=\mboxeU′(topU′(Π′),X′)={a←notb,b} and notice that now we can split Π′′ itself. If we let U′′={b}, then botU′′(Π′′)={b} and Π′′′=\mboxeU′′(topU′′(Π′′),X′′)=∅ for the only answer set X′′={b} of botU′′(Π′′). The answer sets of the original program Π′ can now be obtained as X′∪X′′∪X′′′, where X′={c} is the answer set of botU′(Π′), X′′={b} is the answer set of botU′′(Π′′)={c} and X′′′=∅ is the answer set of Π′′′. Then, the program Π′ has only one answer set {b,c}.
In the following, we will use the fact that answer sets of a choice rule {a1,…,an} are the power set {∅,{a1},…,{an},{a1,a2},…,{a1,…,an}}, and that answer sets of a constrained choice rule X{a1,…,an}Y are the answer sets of {a1,…,an} with cardinality ≥X and ≤Y. Also, we use the fact that the only answer set of the program {p(X):q(X),q(a1),…,q(an)}, where p(X):q(X) is called a conditional literal, is {p(a1),…,p(an),q(a1),…,q(an)}. Notice that conditional literal and choice rules can be combined so that e.g. answer sets of the program {q(a,b),q(a,c),q(b,c),1{p(X):q(a,X)}1} are {q(a,b),q(a,c),q(b,c),p(b)} and {q(a,b),q(a,c),q(b,c),p(c)}. Finally, constraints are used to eliminate answer sets that satisfy its body, e.g. answer sets of the program {q(a,b),q(a,c),q(b,c),1{p(X):q(a,X)}1,⊥←p(b)} are the answer sets of {q(a,b),q(a,c),q(b,c),1{p(X):q(a,X)}1} that do not satisfy p(b), hence {q(a,b),q(a,c),q(b,c),p(c)} is its only answer set.
The splitting set theorem can only be applied to ground programs, hence in the following we will interpret non-ground clauses as shorthand for the set of all their ground instances, e.g. the clause p(X)←q(X,Y) from the program {p(X)←q(X,Y),q(a,b)} is shorthand for the set {p(a)←q(a,a),p(a)←q(a,b),p(b)←q(b,a),p(b)←q(b,b)}.
Before proving the correctness of the implementation, we need to define a correspondence between answer sets and traces. This is the aim of the following definitions:
Definition 37** (Manifest Choice Element).**
We say that the choice element (X~,P+)@I is manifest in the answer set Z if and only if there exists a symbol id such that \mboxeffectChoice((\mboxid,p+),i)∈Z and such that L∈X~ if and only if \mboxbelongsTo(l,\mboxid)∈Z (recall that p+, i and l are the ASP representations of P+, I and L respectively).
Definition 38** (Trace of an answer set).**
The trace of an answer set Z is the trace \langle O_{\rotatebox{90.0}{\bowtie}}@\rotatebox{90.0}{\bowtie},O_{1}@I_{1},\dots,O_{n}@I_{n}\rangle where O_{\rotatebox{90.0}{\bowtie}}@\rotatebox{90.0}{\bowtie},O_{1}@I_{1},\dots,O_{n}@I_{n} are exactly the manifest choice elements in Z ordered according to instants I1,…,In.
Proposition 4**.**
A candidate trace tr is a trace of D if and only if there exists an answer set Ztr of ΠD∪ΠI such that tr is a trace of Ztr.
Proof.
Let Π be the ground program obtained by grounding ΠD∪ΠI. We split Π with respect to the set U of all possible groundings of the predicates fluent, action, instant and possVal. The bottom botU(Π) is guaranteed by the translation process to have a unique answer set ZL which includes a correct representation of the domain language L, i.e. of the three sorts F, A and I and of the function vals (note that the definition of V is implicitly derived from that of vals and that our implementation is restricted to the case where ≤=≤N and \mbox{\bar{0}}=0).
We now split the partially evaluated top Π(1)=\mboxeU(topU(Π),ZL) using the set U(1) consisting of all possible groundings of the predicate holds. The bottom botU(1)(Π(1)) consists only of (PEC7) and has answer sets that correspond to any possible world in the domain language, i.e., (PEC7) generates every possible function from instants to states, hence for a particular world W∈W we denote by ZW the corresponding answer set of botU(1)(Π(1)), and we are allowed to interpret \mboxholds(((x,v),i))∈ZW as \mbox{X!=!V}\in W(I).
Notice that for any fixed W∈W the three sets of propositions Π(2)=\mboxeU(1)((PEC8–9)∪CD,ZW), Π(3)=\mboxeU(1)((PEC10)∪ID,ZW) and Π(4)=\mboxeU(1)((PEC17–18)∪PD,ZW) are independent of each other so we can evaluate their answer sets separately.
We start with the set Π(2). If a c-proposition c=“θ\mboxcauses−one−of{O1,O2,…,Om}” in D is activated at I in W w.r.t. D, i.e. W∣∣\joinrel\Relbar[θ]@I, then also the preconditions of the translated c-proposition in CD are satisfied (as ZW correctly represents W), and Π(2) will contain the facts \mboxcausesOutcome((idjn,p),i) for 1≤j≤m and c being the nth c-proposition in the enumeration fixed during the translation process (see Section 3.1 for reference), alongside the corresponding belongsTo facts in CD which we assume correctly represent the ∈ relation for outcomes, i.e., \mboxbelongsTo((x,v),idjn)∈Π(2) if and only if \mbox{X!=!V}\in O_{j}. The converse is a straightforward inversion of this reasoning.
For a fixed I, if we denote by CW,I the set of facts of the form \mboxcausesOutcome((idjn,p),i) that are in Π(2), what we have just shown yields:
[TABLE]
If we now let U(2) be a splitting set such that it contains all possible groundings of the causesOutcome predicate, we get that the the only answer set of botU(2)(Π(2)) is BC∪CW, where BC is the set of belongsTo facts contained in CD and CW is defined as:
[TABLE]
The partially evaluated top Π1(2)=\mboxeU(2)(Π(2),BC∪CW) includes the following set of facts:
OW={\mboxinOcc(i)∣∃o:\mboxcausesOutcome(o,i)∈CW}={\mboxinOcc(i)∣I∈I,CW,I=∅}
=\{\mbox{{inOcc}}(i)\mid\text{a cause occurs in WatI}\}
where we have used Equation (19) to derive the last equality. Therefore, we can interpret \mboxinOcc(i)∈OW as I∈\mboxinOccD(W).
Let U1(2) be the splitting set consisting of all possible groundings of inOcc. The only answer set of botU1(2)(Π1(2)) is OW, and we now need to evaluate and find the answer sets of Π2(2)=\mboxeU1(2)(topU1(2)(Π1(2)),OW) which now consists only of a partially evaluated (PEC7).
The role of (PEC7) is to implement the effectChoice function. Indeed, for each instant I such that I∈occD(W), exactly one atom of the form \mboxeffectChoice(o,i) is included in an answer set of Π2(2) for some o such that \mboxcausesOutcome(o,i)∈CW. Since this is consistent with definition 19, we can interpret \mboxeffectChoice(o,i) as its intended semantic counterpart \mboxec(I)=O where ec is an effect choice function for W w.r.t. D. For an effect choice function ec for W w.r.t. D, we call the corresponding answer set that encodes it E\mboxec.
Applying the splitting theorem, we can now conclude that answer sets of Π(2) are exactly those given by the set {BC∪CW∪OW∪E\mboxec∣\mboxec is an effect choice function for W w.r.t. D}.
Answer sets of Π(3) correspond to the initialChoice constant and can be worked out in a similar way as in the effect choice function case. It can be shown that \mboxinitialChoice(o) correctly represents an initial choice ic as in definition 20, and answer sets of Π(3) are given by ID∪I\mboxic, where the singleton set I\mboxic consists only of an encoded ic for an initial choice ic w.r.t. D.
Finally we need to derive answer sets of Π(4). We split it using U(4) consisting of all performed ground facts. The bottom botU(4)(Π(4)) has answer set PD itself (notice that PD contains only ground facts), and we are left with calculating answer sets of Π1(4)=\mboxeU(4)(topU(4)(Π(4),PD),PD). The aim of eval is that of implementing Equation (8). It is important to notice here that, thanks to requirement iv) in Definition 11, it is possible to label a p-proposition “A\mboxperformed−atI\mboxwith−probP+” using only A and I. Comparing Equation (8) with (PEC17–18) immediately gives that the only answer set of Π(4) is PD∪\mboxEvW where
\mbox{{Ev}}_{W}=\Big{\{}\mbox{{eval}}(a,i,p)\mid A\in\mathcal{A},I\in\mathcal{I},\text{``A\mbox{ {\bf performed-at} }I\mbox{ {\bf with-prob} }P^{+}''}\in\mathcal{D},
P=P^{+}\text{ if }W\mathrel{||}\joinrel\Relbar[A]@I,P=1-P^{+}\text{ otherwise}\Big{\}}.
We are now able to calculate the answer sets of the whole program Π∖ΠC, which are given by the set \Big{\{}Z_{\mathcal{L}}\cup Z_{W}\cup B_{C}\cup C_{W}\cup O_{W}\cup E_{\mbox{{ec}}}\cup I_{\mathcal{D}}\cup I_{\mbox{{ic}}}\cup P_{\mathcal{D}}\cup\mbox{{Ev}}_{W}, for W∈W, an effect choice ec for W w.r.t. D and an initial choice ic w.r.t. \mathcal{D}\Big{\}}
Finally, we take into account the constraints ΠC, whose effect is that of implementing the Closed World Assumption and the effects of initialisation and persistence. Since (PEC11–16) are constraints, they eliminate those answer sets of Π∖ΠC that satisfy their bodies.
If we let ZW be the world encoded in an answer set Z of Π∖ΠC, (PEC11) and (PEC12) ensure that:
\mboxholds(((a,\mboxtrue),i))∈ZW⇒∃p>0,\mboxperformed(a,i,p)∈ΠD
\Leftrightarrow\text{``A\mbox{ {\bf performed-at} }I\mbox{ {\bf with-prob} }P^{+}''}\in\mathcal{D}
and, conversely
\mboxholds(((a,\mboxfalse),i))∈ZW⇒\mboxperformed(a,i,1)∈ΠD
\Leftrightarrow\text{``A\mbox{ {\bf performed-at} }I\mbox{ {\bf with-prob} }1''}\in\mathcal{D}
therefore the world encoded in ZW must satisfy CWA, i.e. definition 16.
Let now “\mboxinitially−one−of(O1,O2,…,Om)” be an i-proposition in D and ZW be as before. (PEC14) makes sure that:
\mboxholds(((f,v),0))∈ZW⇔∃s:{\mboxinitialChoice((s,p)),\mboxbelongsTo((f,v),s)}⊆ΠD⇔
∃O:O∈{O1,…,Om},S~=χ(O),[F=V]∈S~.
which satisfies the initial condition, i.e. definition 18.
Finally we consider (PEC14–16). Let I,I′ be two instants with I<I′ as in definition 23, consider the world encoded in ZW and let W(I)↾F=S~ and W(I′)↾F=S~′. Assume that the effectChoice function encoded in Z maps instants in \mboxinOccD(W)∩[I,I′) to outcomes O1,O2,…,On. Axiom (PEC16) makes sure that S~ cannot be altered if I∈/\mboxinOccD(W). Therefore S~ can only change at instants I∈\mboxinOccD(W). We now show that S~′ is actually equal to S~⊕O1⊕O2⊕⋯⊕On. If not, and considering that our implementation is restricted to a finite set of instants, either (i) there is a fluent literal L∈χ(O) for some O∈{O1,O2,…,On} and an instant I′′∈[I,I′) such that L∈χ(O) but L∈/W(I′′+1), or (ii) for some O∈{O1,O2,…,On} and a fluent literal L=[F=V] such that L∈/O and L∈/W(I′′), L∈W(I′′+1). Both (i) and (ii) are forbidden by (PEC15) and (PEC16) respectively, by considering that the answer set Z correctly represents the semantic objects that it encodes.
∎
5 Related Work
Although there is existing work on probabilistic reasoning about actions, most is based on Reiter’s variant of Situation Calculus (SC) [16], with focus on hypothetical rather than narrative reasoning. An exception is Prob-EC (see below).
Of the SC approaches, the Bacchus-Halpern-Levesque framework [1] is a cornerstone of early work integrating probabilistic knowledge with logical formalisms for reasoning about actions, and incorporates epistemic notions such as sensing actions. The Probabilistic Situation Calculus (PSC) [13] is extended to deal with knowledge-producing actions in [12]. A reasoning system based on PSC able to perform temporal projection has been implemented by the authors in Wolfram Mathematica [19] and uses Monte Carlo methods for tractability. The language PAL [2] focuses on building an elaboration tolerant representation for Markov Decision Processes. It is based on Language A [5] and oriented to counterfactual reasoning and observation assimilation. PAL uses two kinds of unknown variables – inertial and non-inertial – to achieve an elaboration tolerant representation of domains. The action language E+ [7], based on C+ [6], supports both non-deterministic and probabilistic actions. Its main focus is on providing algorithms for the efficient computation of plans.
To our knowledge, the Probabilistic Logic Programming Event Calculus (Prob-EC) [18] is the only EC-style language in this class of formalisms other than PEC able to support reasoning about explicit event occurrences (narratives). Unlike our framework, which has its own bespoke semantics, Prob-EC is a logic programming framework based on the probabilistic logic programming language ProbLog [3] and therefore inherits and exploits its semantics. In [18] Prob-EC is applied to human activity recognition. The authors describe how a set of long-term activities (LTAs) can be detected from a set of short-term activities (STAs). Such STAs, which constitute the input to the system, are treated as events happening at given instants and have probabilities attached. This is a somewhat different approach than PEC’s, motivated by its application to activity recognition, analogous to attaching probabilities to p-propositions (rather than i- and c-propositions). In other words Prob-EC’s focus is on representing probabilistic knowledge about event occurrences rather than about their general causal effects.
6 Summary
In this work, we present PEC, an EC variant for reasoning about actions in a narrative domain where actions can have probabilistic outcomes, and illustrated how for a wide sub-class of domains it can be implemented in ASP in a sound and complete way. Unlike Prob-EC [18] which follows the “logic programming” tradition, our formalism belongs to the “action language” tradition (originating in [5], but see also [8] for the first EC style action language), and therefore its own specialised semantics. This makes of PEC portable in the sense that it is independent of any particular computational implementation. Its semantics is defined in terms of (possible) worlds, with a view to adding epistemic features at a later date (see e.g. [14], [17]).
In our initial experimentation with adding epistemic features to PEC, we have focused on representing imperfect sensing actions and actions conditioned on knowledge acquired during the progression of the narrative. These features are similar to those in the EFEC extension of FEC [11]. We envisage including *s-propositions * such as
[TABLE]
which represents that our coin-tossing robot can imperfectly sense the current face showing on the coin, and conditional p-propositions such as
[TABLE]
which represents that the robot will toss again if it believes with a greater than 65% probability that the first toss resulted in Tails. Preliminary results indicate that our possible worlds semantics can be readily extended to cover these notions.
There are several other ways in which the present work can be continued. For instance, the problem of elaboration tolerance, which plays an important role in classical reasoning about actions, needs to be reviewed and solved in our setting. This problem has already been tackled in [2], but needs to be restated in our framework due to the different way in which we introduce probabilities in PEC. A related point is that of underspecification, i.e. what an agent can reasonably infer from a domain in which the initial conditions and the effects of actions are not entirely specified (even probabilistically). Finally, in our view a crucial point is that of computational efficiency. Indeed, the intractability of several computational problems arising in this setting (such as temporal projection) suggests that techniques (e.g. Monte Carlo Markov Chain) are needed to efficiently approximate the correct answer to a given query with an appropriate degree of confidence.