NonT erminating Pro cesses in the Situation Calculus Giusepp - - PDF document

non t erminating pro cesses in the situation calculus
SMART_READER_LITE
LIVE PREVIEW

NonT erminating Pro cesses in the Situation Calculus Giusepp - - PDF document

NonT erminating Pro cesses in the Situation Calculus Giusepp e De Giacomo Eugenia T erno vsk aia Dipartimen to di Informatica e Sistemistica Departmen t of Computer Science Univ ersit a di Roma La


slide-1
SLIDE 1 NonT erminating Pro cesses in the Situation Calculus Giusepp e De Giacomo Dipartimen to di Informatica e Sistemistica Univ ersit a di Roma La Sapienza degiacomodisuniromait Eugenia T erno vsk aia Departmen t
  • f
Computer Science Univ ersit y
  • f
T
  • ron
to eugeniacstorontoedu Ra y Reiter Departmen t
  • f
Computer Science Univ ersit y
  • f
T
  • ron
to reitercstorontoedu
  • In
tro duction By their v ery design man y rob
  • t
con trol programs are nonterminating T
  • giv
e a simple example
  • ne
w e shall use in this pap er
  • an
  • ce
coeedeliv ery rob
  • t
migh t b e implemen ted as an innite lo
  • p
in whic h the rob
  • t
resp
  • nds
to exogenous requests for coee that are main tained
  • n
a queue Since a future coee request is alw a ys p
  • ssible
the program nev er terminates As is the case for more con v en tional programs w e w an t some reliabilit y assurances for rob
  • t
con trollers This pap er describ es the approac h b eing tak en b y
  • ur
Cognitiv e Rob
  • tics
Group to expressing and pro ving prop erties
  • f
nonterminating programs expressed in GOLOG a high lev el logic program ming language for mo deling and implemen ting dynamical systems The kinds
  • f
prop erties w e ha v e in mind are traditional in computer science liv eness fairness etc W e dier from the classical approac hes LS
  • Cou
  • MP
  • for
reasons dictated b y the follo wing c haracteristics
  • f
GOLOG
  • T
  • write
a GOLOG program the programmer rst axiomatizes the primitiv e actions
  • f
the appli cation domain using rst
  • rder
logic These actions ma y also include exogenous ev en ts
  • Next
she describ es in GOLOG the complex b eha viors her rob
  • t
is to exhibit in this domain This GOLOG program is in terpreted b y means
  • f
a form ula this time in second
  • rder
logic
  • Finally
  • a
suitable theorempro v er executes the program Because these features are all represen ted in classical second
  • rder
logic it is natural to express and pro v e prop erties
  • f
GOLOG programs including nonterminating
  • nes
in the v ery same logic This approac h to program pro
  • fs
has the adv an tage
  • f
logical uniformit y and the a v ailabilit y
  • f
classical pro
  • f
theory
  • It
also pro vides a v ery ric h language with whic h to express program prop erties as w e shall see in this pap er Moreo v er it pro vides for pro
  • fs
  • f
programs with incomplete initial state the normal situation in rob
  • tics
where the agen t do es not ha v e complete information ab
  • ut
the w
  • rld
it inhabits Finally
  • this
approac h gracefully accommo dates exogenous ev en t
  • ccurrences
and pro
  • fs
  • f
program prop erties in their presence
  • F
  • rmal
Preliminaries
  • The
Situation Calculus The situation calculus is a second
  • rder
language sp ecically designed for represen ting dynamically c hang ing w
  • rlds
All c hanges to the w
  • rld
are the result
  • f
named actions A p
  • ssible
w
  • rld
history
  • whic
h is simply a sequence
  • f
actions is represen ted b y a rst
  • rder
term called a situation The constan t S
  • is
used to denote the initial situation namely the empt y history
  • There
is a distinguished binary function sym b
  • l
do do s denotes the successor situation to s resulting from p erforming the action
  • Actions
ma y b e parameterized F
  • r
example putx y
  • migh
t stand for the action
  • f
putting
  • b
ject x
  • n
  • b
ject y
  • in
whic h case doputA B
  • s
denotes that situation resulting from placing A
  • n
B when the history is s Notice that in the situation calculus actions are denoted b y rst
  • rder
terms and situations w
  • rld
histories are also rst
  • rder
terms F
  • r
example doputdow nA dow al k L dopick upA S
slide-2
SLIDE 2 is a situation denoting the w
  • rld
history consisting
  • f
the sequence
  • f
actions pic kupA w alkL put do wnA Notice that the sequence
  • f
actions in a history
  • in
the
  • rder
in whic h they
  • ccur
is
  • btained
from a situation term b y reading
  • the
actions from righ t to left The situation calculus has a distin guished predicate sym b
  • l
Poss the in tended meaning
  • f
P
  • ssa
s is that it is p
  • ssible
to p erform the action a in situation s Relations functions whose truth v alues function v alues v ary from situation to situation are called r elational functional uents
  • They
are denoted b y predicate function sym b
  • ls
taking a situation term as their last argumen t F
  • r
example hasC
  • f
f ee p s is a relational uen t whose in tended meaning is that p erson p has coee in situation s r
  • botLocations
is a functional uen t denoting the rob
  • ts
lo cation in situation s When formalizing an application domain
  • ne
m ust sp ecify certain axioms
  • A
ction pr e c
  • ndition
axioms
  • ne
for eac h primitiv e action These c haracterize the relation P
  • ss
and giv e the preconditions for the p erformance
  • f
an action in a situation In a rob
  • t
coee deliv ery setting suc h an axiom migh t b e P
  • ssg
iv eC
  • f
f ee per son s
  • hol
ding C
  • f
f ee s
  • r
  • botLocations
  • f
f ice per son This sa ys that the preconditions for the rob
  • t
to giv e coee to p erson p are that the rob
  • t
is carrying coee and the rob
  • ts
lo cation is ps
  • ce
  • Suc
c essor state axioms
  • ne
for eac h uen t These capture the causal la ws
  • f
the domain together with a solution to the frame problem Rei F
  • r
  • ur
coee deliv ery rob
  • t
the follo wing is an example P
  • ssa
s
  • hol
ding C
  • f
f ee doa s
  • a
  • pick
upC
  • f
f ee
  • hol
ding C
  • f
f ee s
  • per
sona
  • g
iv eC
  • f
f ee per son In
  • ther
w
  • rds
pro vided the action a is p
  • ssible
the rob
  • t
will b e holding a cup
  • f
coee after action a is p erformed i a is the action
  • f
the rob
  • t
pic king up the coee
  • r
the rob
  • t
is already holding coee and a is not the action
  • f
the rob
  • t
giving that coee to someone
  • Unique
names axioms for the primitiv e actions stating that dieren t names for actions denote dieren t actions
  • Axioms
describing the initial situation
  • what
is true initially
  • b
efore an y actions ha v e
  • ccurred
This is an y nite set
  • f
sen tences whic h men tion no situation term
  • r
  • nly
the situation term S
  • Examples
  • f
axioms for the initial situation for
  • ur
coee deliv ery example are phasC
  • f
f ee p S
  • r
  • botLocationS
  • C
M
  • These
ha v e the in tended reading that initially
  • no
  • ne
has coee and the rob
  • t
is lo cated at the coee mac hine C M
  • See
LRL
  • for
a full description
  • GOLOG
GOLOG LRL
  • is
a situation calculusbased logic programming language that allo ws for dening complex actions using a rep ertoire
  • f
user sp ecied primitiv e actions GOLOG pro vides the usual kinds
  • f
imp erativ e programming language con trol structures as w ell as v arious forms
  • f
nondeterminism Briey
  • GO
LO G programs are formed b y using the follo wing constructs
  • Primitive
actions a Do action a in the curren t situation Actually a is a pseudoaction
  • btained
from an action b y suppressing the situation argumen t in eac h functional uen t The function as that giv en a pseudoaction a and a situation s returns the
  • riginal
action see LRL
  • T
est actions
  • T
est the truth v alue
  • f
expression
  • in
the curren t situation As for primitiv e actions
  • is
a pseudoform ula
  • btained
from a situation calculus form ula b y suppressing all situation argumen ts The function s that giv en a pseudoform ula
  • and
a situation s returns the
  • riginal
form ula
  • Se
quenc e
  • Execute
program
  • follo
w ed b y program
slide-3
SLIDE 3
  • Nondeterministic
action choic e
  • j
  • Execute
  • r
  • Nondeterministic
choic e
  • f
ar guments
  • z
  • Nondeterministically
pic k a v alue for z
  • and
for that v alue
  • f
z
  • execute
program
  • Nondeterministic
r ep etition
  • Execute
  • a
nondeterministic n um b er
  • f
times
  • While
lo
  • ps
while
  • do
  • endWhile
  • whic
h is expressed as
  • Conditionals
if
  • then
  • else
  • whic
h is expressed as
  • j
  • Pr
  • c
e dur es including recursion pro c P r
  • cN
ame
  • v
  • P
r
  • cN
ame endPro c
  • Single
step seman tics for GOLOG In LRL
  • GOLOG
programs are in terpreted b y means
  • f
a sp ecial relation D
  • s
s
  • that
giv en a generally nondeterministic program
  • and
a situation s returns a p
  • ssible
situation s
  • resulting
b y executing
  • starting
from s Actually in LRL
  • the
relation D
  • is
not denoted b y a predicate but instead it is dened implicitly b y using macr
  • s
exp ansion rules suc h as D
  • s
s
  • def
  • s
  • D
  • s
s
  • D
  • s
  • s
  • D
  • j
  • s
s
  • def
  • D
  • s
s
  • D
  • s
s
  • D
  • s
s
  • def
  • P
  • P
s s
  • where
  • stands
for the conjunction
  • f
s sP s s s s
  • s
  • P
s s
  • D
  • s
  • s
  • P
s s
  • ne
for eac h construct in the language By using suc h macro expansions rules the relation D
  • s
s
  • for
the particular program
  • is
dened b y a generally second
  • rder
form ula
  • s
s
  • not
men tioning
  • at
all This is v ery con v enien t since it completely a v
  • ids
the in tro duction
  • f
programs in to the language they are used
  • nly
during the macro expansion pro cess to get the form ulas
  • s
s
  • corresp
  • nding
to D
  • s
s
  • Observ
e ho w ev er that in this w a y programs cannot b e quan tied
  • v
er b ecause they are not terms
  • f
the language
  • f
the situation calculus The kind
  • f
seman tics D
  • asso
ciates to programs whic h is based
  • n
the complete ev aluation
  • f
the program is sometimes called evaluation semantics Hen
  • Suc
h a seman tics is not w ell suited to in terpret nonterminating programs lik e innite lo
  • ps
since for suc h programs the ev aluation can nev er b e completed and a nal situation can nev er b e reac hed F
  • r
nonterminating programs
  • ne
needs to rely
  • n
a seman tics that allo ws for in terpreting se gments
  • f
pr
  • gr
am exe cutions So w e adopt a kind
  • f
seman tics called c
  • mputational
semantics Hen whic h is based
  • n
single steps
  • f
computation
  • r
tr ansitions
  • A
step here is either a primitiv e
  • r
a test action W e b egin b y in tro ducing t w
  • sp
ecial relations Final and T r ans
  • Final
  • is
in tended to sa y that program
  • is
in a nal state ie it ma y legally terminate in the curren t situation T r ans
  • s
  • s
  • is
in tended to sa y that program
  • in
situation s ma y legally execute
  • ne
step ending in situation s
  • with
program
  • remaining
T
  • follo
w this approac h it is necessary to quan tify
  • v
er programs and so unlik e in LRL
  • w
e need to enco de GO LO G programs as rstorder terms including in tro ducing constan ts denoting v ariables and so
  • n
This is lab
  • rious
but quite straigh tforw ard Lei
  • W
e
  • mit
all suc h details here and simply use programs within form ulas as if they w ere already rstorder terms Final and T r ans are denoted b y predicates dened inductiv ely
  • n
the structure
  • f
the rst argumen t It is con v enien t to include a sp ecial empt y program
  • denoting
that nothing
  • f
the program remains to b e p erformed
  • Both
t yp es
  • f
seman tics b elong to the family
  • f
structural
  • p
erational seman tics in tro duced in Plo
  • W
e assume that the predicates in tro duced in this section including Final and T r ans
  • cannot
  • ccur
in tests hence disallo wing selfreference
slide-4
SLIDE 4 The denition
  • f
Final is as follo ws
  • Final
  • F
  • F
  • where
  • stands
for the conjunction
  • f
the univ ersal closure
  • f
the follo wing clauses F
  • F
  • F
  • F
  • F
  • F
  • F
  • j
  • F
  • F
  • z
  • F
  • F
  • P
r
  • cN
ame
  • F
P r
  • cN
ame
  • x
  • Observ
e that b eing nal is a syn tactic prop ert y
  • f
programs programs
  • f
a certain form are considered to b e in a nal state Moreo v er b eing nal do es not dep end
  • n
the
  • b
jects the program deals with indeed Final
  • z
  • and
Final P r
  • cN
ame
  • x
  • dep
end
  • nly
  • n
  • and
  • P
r
  • cN
ame and not
  • n
the particular v alues
  • f
z and
  • x
resp ectiv ely
  • Observ
e that from the ab
  • v
e denition w e get that primitiv e and test actions are nev er nal for all actions a Final a
  • F
alse and for all tests
  • Final
  • F
alse
  • The
denition
  • f
T r ans is as follo ws
  • s
  • s
  • T
r ans
  • s
  • s
  • T
  • T
  • s
  • s
  • where
  • stands
for the conjunction
  • f
the univ ersal closure
  • f
the follo wing clauses Poss as s
  • T
a s
  • doas
s s
  • T
  • s
  • s
T
  • s
  • s
  • T
  • s
  • s
  • Final
  • T
  • s
  • s
  • T
  • s
  • s
  • T
  • s
  • s
  • T
  • j
  • s
  • s
  • T
  • s
  • s
  • T
  • j
  • s
  • s
  • y
T
  • z
y
  • s
  • s
  • T
  • z
  • x
s
  • s
  • T
  • s
  • s
  • T
  • s
  • s
  • T
  • P
r
  • cN
ame
  • v
  • x
  • s
  • s
  • T
P r
  • cN
ame
  • x
s
  • s
  • The
clauses dening T r ans c haracterize when a c
  • ngur
ation
  • s
can ev
  • lv
e in a single step to a conguration
  • s
  • In
tuitiv ely they can b e read as follo ws
  • a
s ev
  • lv
es to
  • dos
s pro vided as is p
  • ssible
in s Observ e that after ha ving p erformed a nothing remains to b e p erformed
  • s
ev
  • lv
es to
  • s
pro vided that s holds Otherwise it cannot pro ceed Observ e that in an y case the situation remains unc hanged
  • s
can ev
  • lv
e to
  • s
  • pro
vided that
  • s
can ev
  • lv
e to
  • s
  • Moreo
v er it can ev
  • lv
e to
  • s
  • pro
vided that
  • is
nal and
  • s
can ev
  • lv
e to
  • s
  • j
  • s
can ev
  • lv
e to
  • s
  • pro
vided that either
  • s
  • r
  • s
can do so
  • z
  • s
can ev
  • lv
e to
  • s
  • pro
vided that there exists a y suc h that
  • z
y
  • s
can ev
  • lv
e to
  • s
  • z
is b
  • und
b y
  • in
  • z
  • and
is t ypically free in
  • s
can ev
  • lv
e to
  • s
  • pro
vided that
  • s
can ev
  • lv
e to
  • s
  • Observ
e that
  • s
can also not ev
  • lv
e at all since
  • is
nal
  • P
r
  • cN
ame
  • x
  • s
can ev
  • lv
e to
  • s
  • pro
vided that the b
  • dy
  • P
r
  • cN
ame
  • f
the pro cedure P r
  • cN
ame with the actual parameters
  • x
substituted for the formal parameters
  • v
  • can
do so The p
  • ssible
congurations that can b e reac hed b y a program
  • starting
in a situation s are those
  • btained
b y rep eatly follo wing the transition relation denoted b y T r ans starting from
  • s
ie those in
  • Here
  • z
y is the usual notion
  • f
substitution in whic h the nondeterministic c hoice
  • p
erator
  • is
treated lik e a quan tier
slide-5
SLIDE 5 the reexiv e transitiv e closure
  • f
the transition relation Suc h a relation is denoted b y the reexiv e transitiv e closure
  • f
T r ans T r ans
  • dened
as
  • s
  • s
  • T
r ans
  • s
  • s
  • U
  • U
  • s
  • s
  • where
  • stands
for the conjunction
  • f
the univ ersal closure
  • f
the follo wing clauses U
  • s
  • s
U
  • s
  • s
  • T
r ans
  • s
  • s
  • U
  • s
  • s
  • Using
T r ans
  • and
Final w e ma y denote the relation D
  • as
follo ws D
  • s
s
  • def
  • T
r ans
  • s
  • s
  • Final
  • In
  • ther
w
  • rds
D
  • s
s
  • holds
if it is p
  • ssible
to rep eatedly singlestep the program
  • btaining
a program
  • and
a situation s
  • suc
h that
  • can
legally terminate in s
  • Note
that this form ulation
  • f
D
  • is
equiv alen t to the
  • ne
in LRL
  • cf
Hen
  • Exogenous
actions Exogenous action are primitiv e actions that are not under the con trol
  • f
the program They are executed b y
  • ther
agen ts in an async hronous w a y wrt the program T r ans can b e easily mo died to tak e in to accoun t exogenous actions as w ell It suce to add to the ab
  • v
e denition a clause ha ving as a rst appro ximation the form Exoexo
  • Poss
exo s
  • T
  • s
  • doexo
  • s
whic h sa ys that an y conguration
  • s
can ev
  • lv
e due to the
  • ccurrence
  • f
an exogenous action exo to
  • doexo
s where the situation has c hanged but the program hasnt The ab
  • v
e clause enables the
  • ccurrence
  • f
an exogenous action exo ev ery time the action preconditions for exo and hence Possexo
  • s
are true Ho w ev er it is
  • f
in terest to restrict further the actual
  • ccurrence
  • f
exo along a sequence
  • f
transitions establishing some sort
  • f
dynamics for exogenous actions Suc h a dynamics has a role similar to that
  • f
programs for normal primitiv e actions although t ypically it is not strict enough to extract a program that implemen ts it Rather the dynamics
  • f
exogenous actions has to b e sp ecied b y means
  • f
suitable axioms A p
  • ssible
w a y to follo w suc h a strategy is to in tro duce a sp ecial uen t D y naP
  • ssexo
s and mo dify T r ans b y in tro ducing the follo wing renemen t
  • f
the ab
  • v
e clause Exoexo
  • Poss
exo
  • s
  • D
y naP
  • ss
exo
  • s
  • T
  • s
  • doexo
  • s
Then
  • ne
uses sp ecial axioms expressing the dynamics
  • f
exogenous actions b y sp ecifying in whic h situa tions s along a sequence
  • f
transitions D y naP
  • ss
exo
  • s
holds Suc h axioms ma y express sophisticated temp
  • ral dynamic
la ws and t ypically they are going to b e second
  • rder
Observ e that exo can actually
  • ccur
  • nly
if b
  • th
P
  • ssexo
  • s
and D y naP
  • ss
exo s hold in s
  • Logical
represen tation
  • f
inductiv e denitions and xp
  • in
ts The relations T r ans and Final are dened inductiv ely
  • Inductive
denitions Acz
  • Mos
  • are
broadly used in mathematical logic for dening sets F
  • r
the past sev eral y ears they b ecame p
  • pular
in computer science CC
  • A
ruleb ase d inductive denition is a set R
  • f
rules
  • f
the form P c
  • where
P is the set
  • f
premises and c is the conclusion together with a closure condition a set Z is Rclosed if eac h rule in R whose premises are in Z also has its conclusion in Z
  • A
set H
  • inductively
dene d by R is giv en b y H
  • T
fZ j Z is Rclosedg
  • r
b y H
  • S
fZ j Z is Rclosed g The former is called a p
  • sitive
inductive denition
  • f
H
  • the
latter is called a ne gative inductive
  • r
c
  • inductive
denition
  • f
H
  • Let
U b e a set An
  • p
er ator induc e d by an inductive denition is a total mapping !
  • P
  • w
U
  • P
  • w
U
  • suc
h that !Z
  • fc
  • U
j P
  • Z
  • P
c
  • Rg
That is ! is a mapping taking sets to sets Inductiv e denitions are strongly related to xp
  • int
pr
  • p
erties ie prop erties dened as solutions
  • f
recursiv e equations Sp ecically
  • p
  • sitiv
e inductiv e denitions are related to least xp
  • in
ts ie minimal
slide-6
SLIDE 6 solution
  • f
the recursiv e equations whereas negativ e inductiv e denitions are related to greatest xp
  • in
ts ie maximal solutions
  • f
the recursiv e equations Dynamic prop erties are t ypically xp
  • in
t prop erties expressed as the least
  • r
greatest solutions
  • f
certain recursiv e logical equations eg see Sti Ev ery prop ert y denable as an extreme xp
  • in
t m ust ha v e b y denition
  • its
  • wn
construction principle a recursiv e equation a xp
  • in
t
  • f
whic h is
  • ur
prop ert y
  • an
appropriate induction
  • r
coinduction principle to guaran tee the minimalit y
  • r
maximalit y
  • f
the solution
  • f
the recursiv e equation
  • Construction
principle T
  • dene
a set Z
  • here
denoted b y a predicate Z
  • x
  • w
e need to sa y what its elemen ts are The c
  • nstruction
principle tells us ho w to
  • btain
these elemen ts recursiv ely
  • xZ
  • x
  • Z
  • x
  • In
this case
  • is
called a c
  • nstructor
for Z
  • An
y solution
  • f
this recursiv e equation is called a xp
  • int
  • f
the
  • p
erator
  • The
KnasterT arski Theorem Kna
  • T
ar
  • guaran
tees that if the
  • p
erator
  • is
monotone the equation
  • has
b
  • th
a least and a greatest solution A sucien t condition for monotonicit y is that all
  • ccurrence
  • f
Z
  • ccur
within a ev en n um b er
  • f
negations
  • This
condition is alw a ys satised in this pap er
  • Induction
principle Least xp
  • in
ts T
  • guaran
tee that Z is the smallest solution w e apply the induction principle
  • P
  • xf
  • y
P
  • y
  • P
  • y
  • Z
  • x
  • P
  • x
g
  • ie
whatev er solution P
  • f
the recursiv e sp ecication w e tak e Z is included in it A set Z satisfying construction principle
  • and
induction principle
  • is
denoted b y
  • P
  • y
P
  • y
  • x
  • and
it is called a le ast xp
  • int
  • f
an
  • p
erator P
  • y
  • Note
that in
  • P
  • y
P
  • y
  • x
  • the
predicate v ariable P and the individual v ariables
  • y
are considered b
  • unded
b y
  • while
the individual v ariables
  • x
are free Another view
  • f
  • P
  • y
P
  • y
  • x
  • is
that
  • P
  • y
P
  • y
  • is
the name
  • f
a dened predicate and
  • x
are its argumen ts W e can rewrite the induction principle
  • in
the follo wing w a y
  • xfZ
  • x
  • P
  • y
P
  • y
  • P
  • y
  • P
  • xg
  • Notice
that implication in the
  • pp
  • site
direction follo ws from the construction principle
  • W
e
  • btain
  • xf
P
  • y
P
  • y
  • x
  • P
  • y
P
  • y
  • P
  • y
  • P
  • x
g
  • The
last sen tence is
  • ften
considered as a formal denition
  • f
a least xp
  • in
t Observ e that it has exactly the form w e ha v e used to dene T r ans and Final as w ell as D
  • s
s
  • in
LRL
  • Coinduction
principle Greatest xp
  • in
ts T
  • guaran
tee that Z is the biggest solution
  • f
  • w
e apply the c
  • induction
principle P
  • xf
  • y
P
  • y
  • P
  • y
  • P
  • x
  • Z
  • x
g
  • ie
whatev er solution P
  • f
the recursiv e sp ecication w e tak e Z includes it W e can rewrite the coinduction principle
  • in
the follo wing w a y
  • x
fP
  • y
P
  • y
  • P
  • y
  • P
  • x
  • Z
  • xg
  • An
explicit expression for a greatest xp
  • in
t can b e
  • btained
in a similar w a y as w as done for a least xp
  • in
t
  • xf
P
  • y
P
  • y
  • x
  • P
  • y
P
  • y
  • P
  • y
  • P
  • xg
  • The
last sen tence can b e tak en as a denition
  • f
a greatest xp
  • in
t
  • In
terpreting
  • as
an abbreviation for
  • The
idea
  • f
dening a least xp
  • in
t using t w
  • principles
construction and induction is from Heh
slide-7
SLIDE 7
  • Examples
  • f
expressible dynamic prop erties With T r ans and Final in place a wide v ariet y
  • f
dynamic prop erties can b e expressed b y relying
  • n
second
  • rder
form ulae expressing least and greatest xp
  • in
t prop erties In particular prop erties expressible b y logics
  • f
programs suc h as dynamic logics KT
  • m
ucalculus P ar
  • Sti
and temp
  • ral
logics Eme
  • can
b e rephrased in
  • ur
setting Let us presen t some examples
  • The
form ula Q
  • s
  • def
  • P
  • s
  • s
  • s
  • T
r ans
  • s
  • s
  • P
  • s
  • s
  • where
  • s
  • are
individual v ariables denes a predicate Q
  • s
  • that
denotes the smallest set
  • f
congurations C
  • suc
h that a conguration
  • s
b elongs to this set the predicate Q
  • is
true
  • n
  • s
if and
  • nly
if either
  • is
true
  • n
  • s
  • r
there exists a conguration
  • s
  • reac
hable in
  • ne
step b y the relation T r ans whic h also b elongs to the set C
  • In
this w a y the form ula expresses that from eac h conguration
  • s
  • n
whic h the sp ecied predicate is true there exists an execution path that ev en tually reac hes a conguration
  • s
  • n
whic h
  • is
true As a sp ecial case b y taking
  • s
def
  • s
  • Final
  • ne
can express that there exists a terminating execution
  • f
program
  • starting
from situation s
  • suc
h that
  • is
true in the nal situation
  • The
form ula Q
  • s
  • def
  • P
  • s
f
  • s
  • s
  • T
r ans
  • s
  • s
  • s
  • T
r ans
  • s
  • s
  • P
  • s
  • g
  • s
  • denes
a predicate Q
  • s
  • that
denotes the smallest set
  • f
congurations C
  • suc
h that the predicate is true
  • n
conguration
  • s
if and
  • nly
if either
  • is
true
  • n
  • s
  • r
there exists a conguration
  • s
  • reac
hable in
  • ne
step b y the relation T r ans
  • and
  • n
all suc h congurations the predicate is still true In this w a y the form ula expresses that from eac h conguration
  • s
  • n
whic h the sp ecied predicate is true all execution paths ev en tually reac h a conguration
  • s
  • n
whic h
  • is
true
  • The
form ula Q
  • s
  • def
  • P
  • s
  • s
  • s
  • T
r ans
  • s
  • s
  • P
  • s
  • s
  • denes
a predicate Q
  • s
  • that
denotes the greatest set
  • f
congurations C
  • suc
h that the predicate is true
  • n
conguration
  • s
if and
  • nly
if b
  • th
  • is
true
  • n
  • s
and the predicate is still true
  • n
at least
  • ne
conguration
  • s
  • reac
hable in
  • ne
step b y the relation T r ans In this w a y the form ula expresses that from eac h conguration
  • s
  • n
whic h the sp ecied predicate is true there exists a nonterminating execution path along whic h
  • is
alw a ys true As a sp ecial case b y
  • s
def
  • T
rue
  • ne
can express that there exists a nonterminating execution path
  • The
form ula Q
  • s
  • def
  • P
  • s
  • s
  • s
  • T
r ans
  • s
  • s
  • P
  • s
  • s
  • denes
a predicate that denotes the greatest set
  • f
congurations C
  • suc
h that the predicate is true
  • n
conguration
  • s
if and
  • nly
if b
  • th
  • is
true
  • n
  • s
and the predicate is still true
  • n
eac h conguration
  • s
  • reac
hable in
  • ne
step b y the relation T r ans In this w a y the form ula expresses that from eac h conguration
  • s
  • n
whic h the sp ecied predicate is true along all execution paths
  • is
alw a ys true As a sp ecial case b y
  • s
def
  • Final
  • s
  • T
r ans
  • s
  • s
  • ne
can express that all execution paths are nonterminating and no nal state is ev er reac hed
slide-8
SLIDE 8
  • Example
A Coee Deliv ery Rob
  • t
Here w e describ e a rob
  • t
whose task is to deliv er coee in an
  • ce
en vironmen t The rob
  • t
can carry just
  • ne
cup
  • f
coee at a time and there is a cen tral coee mac hine from whic h it gets the coee The rob
  • t
receiv es asynchr
  • nous
requests for coee from emplo y ees These requests are put in a queue The rob
  • t
con tin uously tak es the rst request from the queue and serv es coee to the sp ecied p erson The use
  • f
the queue guaran tees that all requests will in fact b e serv ed implemen ting a fair serving p
  • licy
  • Represen
tation
  • f
the queue As usual to dene an abstract data t yp e w e need to sp ecify the domain
  • f
its values and its functions and pr e dic ates The domain
  • f
v alues for queues is constructed inductiv ely from the constan t nil and the functor cons
  • as
follo ws
  • q
I sQueue q
  • Q
  • Qq
  • where
  • stands
for the conjunction
  • f
Qnil
  • f
  • r
Qr
  • Qconsf
  • r
  • The
functions and predicates for queues are the usual f ir st deq ueue
  • enq
ueue
  • and
isE mpty
  • They
are dened in
  • ur
setting as follo ws f
  • r
f ir stconsf
  • r
  • f
unspecified for nil
  • f
  • r
deq ueue consf
  • r
  • r
unspecified for nil
  • penq
ueue nil
  • p
  • consp
nil
  • p
f
  • r
enq ueue consf
  • r
  • p
  • cons
f
  • enq
ueue r
  • p
q isE mpty q
  • q
  • nil
T
  • these
w e add the function l eng th
  • that
returns the length
  • f
the queue and the predicate isF ul l since w e are going to need queues
  • f
a b
  • unded
length l eng th nil
  • f
  • r
l eng th consf
  • r
  • "
l eng th r
  • q
isF ul lq
  • l
eng thq
  • W
e enforce unique name assumption for terms built from nil and cons
  • but
  • b
viously not for those built with the functions deq ueue
  • enq
ueue
  • and
l eng th
  • F
  • rmalization
  • f
the Example Primitiv e Actions
  • r
eq uestC
  • f
f ee per son A request for coee is receiv ed from the emplo y ee per son This action is an exo genous
  • ne
ie an action not under the con trol
  • f
the rob
  • t
pExor eq uestC
  • f
f ee p holds
  • sel
ectR eq uest per son The rst request in the queue is selected and the emplo y ee per son that made that request will b e serv ed
  • pick
upC
  • f
f ee
  • The
rob
  • t
pic ks up a cup
  • f
coee from the coee mac hine
  • g
iv eC
  • f
f ee per son The rob
  • t
giv es a cup
  • f
coee to per son
  • star
tGo l
  • c
  • l
  • c
  • The
rob
  • t
starts to go from lo cation l
  • c
  • to
l
  • c
  • endGo
l
  • c
  • l
  • c
  • The
rob
  • t
ends its pro cess
  • f
going from lo cation l
  • c
  • to
l
  • c
  • Equiv
alen tly
  • q
  • I
sQueue q
  • Qq
q
  • nil
  • f
  • r
q
  • cons
f
  • r
  • Qr
q
slide-9
SLIDE 9 Fluen ts
  • q
ueue s A functional uen t denoting the queue
  • f
requests in situation s
  • r
  • botLocation
s A functional uen t denoting the rob
  • ts
lo cation in situation s
  • hasC
  • f
f ee per son s per son has coee in s
  • g
  • ing
l
  • c
  • l
  • c
  • s
In situation s the rob
  • t
is going from l
  • c
  • to
l
  • c
  • hol
ding C
  • f
f ee s In situation s the rob
  • t
is holding a cup
  • f
coee Situation Indep enden t Predicates and F unctions
  • f
f ice per son Denotes the
  • ce
  • f
per son
  • C
M
  • Constan
t denoting coee mac hines lo cation
  • S
ue M ar y
  • B
il l
  • J
  • e
Constan ts denoting p eople Primitiv e Action Preconditions P
  • ssr
eq uestC
  • f
f ee p s
  • isF
ul lq ueue s P
  • sssel
ectR eq uest p s
  • isE
mpty q ueue s
  • p
  • f
ir stq ueue s P
  • sspick
upC
  • f
f ee
  • s
  • hol
ding C
  • f
f ee s
  • r
  • botLocations
  • C
M P
  • ssg
iv eC
  • f
f ee per son s
  • hol
ding C
  • f
f ee s
  • r
  • botLocations
  • f
f ice per son P
  • ssstar
tGo l
  • c
  • l
  • c
  • s
  • l
  • l
  • g
  • ing
l
  • l
  • s
  • l
  • c
  • l
  • c
  • r
  • botLocations
  • l
  • c
  • P
  • ssendGol
  • c
  • l
  • c
  • s
  • g
  • ing
l
  • c
  • l
  • c
  • s
Successor State Axioms P
  • ssa
s
  • q
ueue doa s
  • q
  • pa
  • r
eq uestC
  • f
f ee p
  • q
  • enq
ueue q ueue s p
  • pa
  • sel
ectR eq uest p
  • q
  • deq
ueue q ueue s p
  • pa
  • r
eq uestC
  • f
f ee p
  • a
  • sel
ectR eq uest p
  • q
  • q
ueue s P
  • ssa
s
  • hasC
  • f
f eeper son doa s
  • a
  • g
iv eC
  • f
f ee per son
  • hasC
  • f
f ee per son s P
  • ssa
s
  • r
  • botLocation
doa s
  • l
  • c
  • l
  • c
  • a
  • endGol
  • c
  • l
  • c
  • r
  • botLocations
  • l
  • c
  • l
  • c
  • l
  • c
  • a
  • endGol
  • c
  • l
  • c
  • P
  • ssa
s
  • g
  • ing
l
  • l
  • doa
s
  • a
  • star
tGo l
  • l
  • g
  • ing
l
  • l
  • s
  • a
  • endGol
  • l
  • P
  • ssa
s
  • hol
ding C
  • f
f ee doa s
  • a
  • pick
upC
  • f
f ee
  • hol
ding C
  • f
f ee s
  • per
sona
  • g
iv eC
  • f
f ee per son Additional Axioms
  • sI
sQueue q ueue s the values
  • f
q ueue
  • are
queues Unique names axioms stating that the follo wing terms together with those formed from nil and cons
  • see
ab
  • v
e are pairwise unequal S ue M ar y
  • B
il l
  • J
  • e
C M
  • f
f ice S ue
  • f
f ice M ar y
  • f
f ice B il l
  • f
f ice J
  • e
  • The
rst axiom is not strictly necessary
  • w
e add it for sak e
  • f
clarit y
slide-10
SLIDE 10 Initial Situation r
  • botLocationS
  • C
M
  • hol
ding C
  • f
f ee S
  • l
  • l
  • g
  • ing
l
  • l
  • S
  • phasC
  • f
f ee p S
  • q
ueue S
  • nil
Rob
  • ts
GOLOG Program The rob
  • t
execute the program D el iv er C
  • f
f ee dened as follo ws note the suppressed situation argumen t in primitiv e and test actions pro c D el iv er C
  • f
f ee while T rue do if isE mpty q ueue
  • then
  • psel
ectR eq uest p S er v eC
  • f
f ee p else T rue skip endWhile endPro c pro c S er v eC
  • f
f ee p Goto C M
  • pick
upC
  • f
f ee
  • Gotoof
f ice p g iv eC
  • f
f ee p endPro c pro c Gotol
  • c
star tGo r
  • botLocation
l
  • c
endGor
  • botLocation
  • l
  • c
endPro c Dynamics
  • f
Exogenous Actions Along all p
  • ssible
ev
  • lutions
  • f
an y program
  • starting
from S
  • in
to an y conguration in a nite n um b er
  • f
transitions a situation s is reac hed where someb
  • dy
ma y request coee D y naP
  • ss
holds pro vided that it is p
  • ssible
to request coee ie that also P
  • ss
holds
  • sT
r ans
  • S
  • s
  • E
xoLaw s
  • s
E xoLaw s
  • s
  • def
  • E
  • s
fpD y naP
  • ssr
eq uestC
  • f
f ee p s
  • s
  • T
r ans
  • s
  • s
  • E
  • s
  • g
  • s
  • Reasoning
Next w e sho w some dynamic prop erties
  • f
the
  • v
erall system the program plus the exogenous actions First it is easy to see from its structure that the program D el iv er C
  • f
f ee will nev er reac h a nal conguration
  • sT
r ans
  • D
el iv er C
  • f
f ee
  • S
  • s
  • Final
  • A
more complex prop ert y that is p
  • ssible
to sho w is the follo wing ev ery request for coee so
  • ner
  • r
later will b e serv ed F
  • rmally
  • the
fairness prop ert y F air D el iv er C
  • f
f ee
  • S
  • holds
where F air
  • s
  • def
  • p
  • sT
r ans
  • s
  • dor
eq uestC
  • f
f ee p s
  • E
v entual l y S er v edp
  • dor
eq uestC
  • f
f ee p s and E v entual l y S er v edp
  • s
  • def
  • P
  • s
fs
  • s
  • dosel
ectR eq uest p s
  • s
  • T
r ans
  • s
  • s
  • s
  • T
r ans
  • s
  • s
  • P
  • s
  • g
  • s
  • It
is also p
  • ssible
to sho w that there exists an innite execution path where no coee is ev er serv ed P
  • ssibl
y Al w ay sI dl eD el iv er C
  • f
f ee
  • S
  • where
P
  • ssibl
y Al w ay sI dl e
  • s
  • def
  • A
s fp s
  • s
  • dosel
ectR eq uest p s
  • s
  • T
r ans
  • s
  • s
  • A
  • s
  • g
  • s
  • Ho
w ev er b y the fairness prop ert y ab
  • v
e this means that no requests for coee w ere made along that execution path
slide-11
SLIDE 11
  • Conclusion
and further w
  • rk
In this pap er w e ha v e giv en an accoun t
  • f
nonterminating programs in the Situation Calculus The framew
  • rk
  • btained
is quite p
  • w
erful It allo ws the sp ecication
  • f
the dynamic system b y mo deling
  • ne
agen t with a program and external ev en ts b y suitable dynamic la ws extensions to m ultiple agen ts are also p
  • ssible
see DGLL for hin ts Observ e that although related this framew
  • rk
is more general than that t ypically considered in program v erication where exogenous actions that are sp ecied b y dynamic la ws axioms are not allo w ed There are man y directions for further researc h Among these w e men tion the dev elopmen t
  • f
systematic tec hniques for v erication suc h as suitable induction principles References Acz P
  • Aczel
An in tro duction to inductiv e denitions In J Barwise editor Handb
  • k
  • f
Mathematic al L
  • gic
pages
  • Elsevier
  • CC
P
  • Cousot
and R Cousot Inductiv e denitions seman tics and abstract in terpretation In Confer enc e R e c
  • r
d
  • f
the
  • th
A CM SIGA CTSIGMODSIGAR T Symp
  • sium
  • n
Principles
  • f
Pr
  • gr
amming L anguages pages
  • New
Y
  • rk
USA
  • A
CM Press Cou P
  • Cousot
Metho ds and logics for pro ving programs In J v an Leeu w en editor Handb
  • k
  • f
The
  • r
etic al Computer Scienc e pages
  • DGLL
G De Giacomo H J Lev esque and Y Lesp
  • erance
Reasoning ab
  • ut
concurren t executions prioritized in terrupts and exogenous actions in the situation calculus Submitted
  • Eme
E A Emerson Automated temp
  • ral
reasoning ab
  • ut
reactiv e systems In L
  • gics
for Concur r ency Structur e versus A utomata n um b er
  • in
Lecture Notes in Computer Science pages
  • SpringerV
erlag
  • Heh
ECR Hehner A pr actic al the
  • ry
  • f
pr
  • gr
amming SpringerV erlag
  • Hen
M Hennessy
  • The
Semantics
  • f
Pr
  • gr
amming L anguages John Wiley
  • Sons
  • Kna
B Knaster Un th
  • eor
  • eme
sur les fonctions densem bles A nn So c Polon Math
  • KT
D Kozen and J Tiuryn Logics
  • f
programs In J v an Leeu w en editor Handb
  • k
  • f
The
  • r
etic al Computer Scienc e pages
  • Lei
D Leiv an t Higher
  • rder
logic In Handb
  • k
  • f
L
  • gic
in A rticial Intel ligenc e and L
  • gic
Pr
  • gr
amming v
  • lume
  • pages
  • Clarendon
Press
  • LRL
  • HJ
Lev esque R Reiter Y Lesp
  • erance
F Lin and R Sc herl GOLOG a logic programming language for dynamic domains J
  • f
L
  • gic
Pr
  • gr
amming
  • T
  • app
ear LS J Lo ec kx and K Sieb er F
  • undation
  • f
Pr
  • gr
am V eric ation T eubnerWiley
  • New
Y
  • rk
  • Mos
YN Mosc ho v akis Elementary Induction
  • n
A bstr act Structur es Amsterdam North Holland
  • MP
Z Manna and A Pn ueli The T emp
  • r
al L
  • gic
  • f
R e active and Concurr ent Systems V
  • l
  • Springer
V erlag
  • P
ar D P ark Fixp
  • in
t induction and pro
  • fs
  • f
program prop erties In Machine Intel ligenc e v
  • lume
  • pages
  • Edin
burgh Univ ersit y Press
  • Plo
G Plotkin A structural approac h to
  • p
erational seman tics T ec hnical Rep
  • rt
D AIMIFN Com puter Science Dept Aarh us Univ Denmark
  • Rei
R Reiter The frame problem in the situation calculus a simple solution sometimes and a complete ness result for goal regression In Vladimir Lifsc hitz editor A rticial Intel ligenc e and Mathematic al The
  • ry
  • f
Computation Pap ers in Honor
  • f
John McCarthy pages
  • Academic
Press San Diego CA
  • Sti
C Stirling Mo dal and temp
  • ral
logics for pro cesses In L
  • gics
for Concurr ency Structur e versus A utomata n um b er
  • in
Lecture Notes in Computer Science pages
  • SpringerV
erlag
  • T
ar B T arski A latticetheoretical xp
  • in
t theorem and its applications Pacic J Math