Foundations for the Situation Calculus
Total Page:16
File Type:pdf, Size:1020Kb
Linkoping Electronic Articles in Computer and Information Science Vol nr Foundations for the Situation Calculus Hector Levesque Fiora Pirri and Ray Reiter Linkoping University Electronic Press Linkoping Sweden httpwwwepliuseeacis Published on December by Linkoping University Electronic Press Linkoping Sweden Linkoping Electronic Articles in Computer and Information Science ISSN Series editor Erik Sandewal l c Hector Levesque Fiora Pirri and Ray Reiter a Typeset by the author using L T X E Formatted using etendu style Recommended citation Author Title Linkoping Electronic Articles in Computer and Information Science Vol nr httpwwwepliuseeacis December This URL wil l also contain a link to the authors home page The publishers wil l keep this article online on the Internet or its possible replacement network in the future for a period of years from the date of publication barring exceptional circumstances as described separately The online availability of the article implies a permanent permission for anyone to read the article online to print out single copies of it and to use it unchanged for any noncommercial research and educational purpose including making copies for classroom use This permission can not be revoked by subsequent transfers of copyright Al l other uses of the article are conditional on the consent of the copyright owner The publication of the article on the date stated above included also the production of a limited number of copies on paper which were archived in Swedish university libraries like al l other written works published in Sweden The publisher has taken technical and administrative measures to assure that the online version of the article wil l be permanently accessible using the URL stated above unchanged and permanently equal to the archived printed copies at least until the expiration of the publication period For additional information about the Linkoping University Electronic Press and its procedures for publication and for assurance of document integrity please refer to its WWW home page httpwwwepliuse or by conventional mail to the address stated above Abstract This article gives the logical foundations for the situationsashistories vari ant of the situation calculus fo cusing on the following items The language of the situation calculus Foundational axioms for the domain of situations Axioms for an underlying domain theory The syntax and semantics of the logic programming language GOLOG Axioms for knowledge and sensing actions Essential metatheoretic results ab out the situation calculus Authors addresses Hector Levesque Department of Computer Science University of Toronto Toronto Canada MS A hectoraitorontoedu Fiora Pirri Dipartimento di Informatica e Sistemistica Universita degli Studi di Roma La Sapienza Via Salaria Roma Italy pirriassidisuniromait Ray Reiter Department of Computer Science University of Toronto Toronto Canada MS A reiteraitorontoedu Intro duction The situation calculus McCarthy has long b een a staple of AI research but only recently have there b een attempts to carefully axiomatize it The variant describ ed here has evolved in resp onse to the needs of the Cognitive Rob otics Pro ject at the University of Toronto and its foundations are now suciently develop ed to b e gathered in one place That is what this pap er sets out to do The principal intuition captured by our axioms is that situations are histories nite sequences of primitive actions and we provide a binary constructor doa s denoting the action sequence obtained from the history s by adding action a to it Other intuitions are certainly p ossible ab out the nature of situations McCarthy and Hayes saw them as snapshots of a world For the purp oses of representing narratives McCarthy and Costello wish to express that any numb er of actions may o ccur b etween a situa tion and its successor and therefore they do not app eal to a constructor like do The axioms and supp orting metatheory presented in this pap er have provided foundations for a wide range of practical work in mo deling dynami cal systems including planning Green Levesque control Levesque et al De Giacomo et al simulation Kelley database up dates Reiter Bertossi et al diagnosis of dynamical systems McIlraith and agent programming and rob otics Jenkin et al Lesperance et al Burgard et al Shapiro et al Reiter The Language of the Situation Calculus The following description is taken from Pirri and Reiter L is a sitcalc second order language with equality It has three disjoint sorts action for actions situation for situations and a catchall sort object for everything else dep ending on the domain of application Apart from the standard alphab et of logical symb ols we use and with the usual denitions of a full set of connectives and quantiers L has the following alphab et sitcalc Countably innitely many individual variable symb ols of each sort We shall use s and a with subscripts and sup erscripts for variables of sort situation and action resp ectively We normally use lower case roman letters other than a s with subscripts and sup erscripts for variables of sort object In addition b ecause L is second order sitcalc its alphab et includes countably innitely many predicate variables of all arities Two function symb ols of sort situation A constant symb ol S denoting the initial situation 0 A binary function symb ol do action situation situation The intended interpretation is that doa s denotes the succes sor situation resulting from p erforming action a in situation s A binary predicate symb ol < situation situation dening an order ing relation on situations The intended interpretation of situations 0 is as action histories in which case s < s means that s is a prop er 0 subhistory of s A binary predicate symb ol P oss action situation The intended interpretation of P ossa s is that it is p ossible to p erform the action a in situation s For each n countably innitely many predicate symb ols with ar n ity n and sorts action obj ect These are used to denote situation indep endent relations like humanJ ohn pr imeN umber n mov ing Actionr unper son l oc l oc etc For each n countably innitely many function symb ols of sort n action obj ect obj ect These are used to denote situation inde p endent functions like sq r tx heig htM tE v er est ag entr unper son l oc l oc etc For each n a nite or countably innite numb er of function n symb ols of sort action obj ect action These are called action functions and are used to denote actions like pick upx mov eA B etc In most applications there will b e just nitely many action functions but we allow the p ossibility of an innite numb er of them Notice that we distinguish b etween function symb ols taking values of sort object and those the action functions taking values of sort action In what follows the latter will b e distinguished by the requirement that they b e axiomatized in a particular way by what we shall call action precondition axioms For each n a nite or countably innite numb er of predicate n symb ols with arity n and sorts action obj ect situation These predicate symb ols are called relational uents In most ap plications there will b e just nitely many relational uents but we do not preclude the p ossibility of an innite numb er of them These are used to denote situation dep endent relations like ontabl ex s husbandM ar y J ohn s etc Notice that relational uents take just one argument of sort situation and this is always its last argument For each n a nite or countably innite numb er of function n symb ols of sort action obj ect situation action obj ect These function symb ols are called functional uents In most applications there will b e just nitely many functional uents but we do not preclude the p ossibility of an innite numb er of them These are used to denote situation dep endent functions like ag eM ar y s pr imeM inister I tal y s etc Notice that functional uents take just one argument of sort situation and this is always its last argument Notice that only two function symb ols of L S and do are p ermitted sitcalc 0 to take values in sort situation Foundational Axioms for Situations Here we fo cus on the domain of situations The primary intuition ab out situations that we wish to capture axiomatically is that they are nite se quences of actions We want also to b e able to say that a certain sequence of actions is a subsequence of another To formalize these desiderata we adopt the following four foundational axioms for the situation calculus taken from 1 doa s doa s a a s s 1 1 2 2 1 2 1 2 P P S a sP s P doa s sP s 0 Axiom is a unique names axiom for situations two situations are the same i they are the same sequence of actions Two situations S and 1 S may b e dierent yet assign the same truth values to all uents So a 2 situation in the version of the situation calculus presented here must not b e identied with the set of uents that hold in that situation ie with a state The prop er way to understand a situation is as a history namely a sequence of actions two situations are equal i they denote identical histories The second axiom is second order induction on situations The imp ortance of induction for the situation calculus is describ ed by Reiter There are two more axioms s < S 0 0 0 s < doa s s v s 0 0 0 Here s v s is an abbreviation for s < s s s The relation < provides 0 an ordering relation on situations Intuitively s < s means that the action 0 sequence s can