Situation Calculus. Gerald Steinbauer. Institute for Software Technology. Gerald Steinbauer. Situation Calculus - Introduction

Similar documents
The Situation Calculus and Golog

Gerald Steinbauer Institute for Software Technology

Situation Calculus and Golog

On the Role of Possibility in Action Execution and Knowledge in the Situation Calculus

14. Actions. KR & R Brachman & Levesque Situation calculus

On the Progression of Situation Calculus Basic Action Theories: Resolving a 10-year-old Conjecture

Reconciling Situation Calculus and Fluent Calculus

Tractable Reasoning with Incomplete First-Order Knowledge in Dynamic Systems with Context-Dependent Actions

Non-Markovian Control in the Situation Calculus

Non-Markovian Control in the Situation Calculus

Continuing the KRR Journey

Expressing Transactions with Savepoints as Non-Markovian Theories of Actions

On Defaults in Action Theories

Integrating State Constraints and Obligations in Situation Calculus

14. Actions. Situation calculus. Fluents. Preconditions and effects

Cumulative Effects of Concurrent Actions on Numeric-Valued Fluents

Decidable Reasoning in a Modified Situation Calculus

Ontologies and Domain Theories

Example: Robot Tasks. What is planning? Background: Situation Calculus. Issues in Planning I

THE LANGUAGE OF FIRST-ORDER LOGIC (FOL) Sec2 Sec1(1-16)

Projection using Regression and Sensors

A description logic based situation calculus

On First-Order Definability and Computability of Progression for Local-Effect Actions and Beyond

Price: $25 (incl. T-Shirt, morning tea and lunch) Visit:

Interpreting Golog Programs in Flux

Embracing Causality in Specifying the Indirect Effects of Actions*

Progression of Situation Calculus Action Theories with Incomplete Information

Introduction on Situational Calculus

Handling Uncertainty System in the Situation Calculus with Macro-actions. actions

From Causal Theories to Successor State Axioms and STRIPS-Like Systems

COMP9414: Artificial Intelligence Propositional Logic: Automated Reasoning

Planning and search. FOL and situation calculus. FOL and situation calculus 1

Precondition Control and the Progression Algorithm

Situation Calculus. Chapter 16. Fangzhen Lin

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

Default Reasoning in Action Domains with Conditional, Non-Local Effect Actions

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

Reasoning about Noisy Sensors and Effectors in the Situation Calculus

COMP3702/7702 Artificial Intelligence Week 5: Search in Continuous Space with an Application in Motion Planning " Hanna Kurniawati"

Action, Belief Change and the Frame Problem: A Fluent Calculus Approach

Situations, si! Situation terms, no!

CS1021. Why logic? Logic about inference or argument. Start from assumptions or axioms. Make deductions according to rules of reasoning.

Change, Change, Change: three approaches

Propositional Logic: Logical Agents (Part I)

Reasoning by Regression: Pre- and Postdiction Procedures for Logics of Action and Change with Nondeterminism*

A Closed-Form Solution to the Ramification Problem (Sometimes)

Overview. Knowledge-Based Agents. Introduction. COMP219: Artificial Intelligence. Lecture 19: Logic for KR

Compiling Causal Theories to Successor State Axioms and STRIPS-Like Systems

First Order Logic: Syntax and Semantics

Lecture 10: Feb. 11, 2015

On Ability to Autonomously Execute Agent Programs with Sensing

A Generative Dialogue System for Arguing about Plans in Situation Calculus

First-Order Logic. 1 Syntax. Domain of Discourse. FO Vocabulary. Terms

Propositional logic. First order logic. Alexander Clark. Autumn 2014

On the Decidability of Verifying LTL Properties of GOLOG Programs

On the Progression of Knowledge in the Situation Calculus

Propositional Logic: Logical Agents (Part I)

Logic Background (1A) Young W. Lim 12/14/15

Intelligent Agents. Formal Characteristics of Planning. Ute Schmid. Cognitive Systems, Applied Computer Science, Bamberg University

Applications of the Situation Calculus To Formalizing. Control and Strategic Information: The Prolog Cut Operator. Fangzhen Lin

185.A09 Advanced Mathematical Logic

Agenda Artificial Intelligence. Let s Talk About the Wumpus Instead? Let s Talk About Blocks, Baby...

Reasoning about State Constraints in the Situation Calculus

Principles of Intelligent Systems: Situation Calculus

Reasoning. Inference. Knowledge Representation 4/6/2018. User

Logic & Logic Agents Chapter 7 (& Some background)

COMPUTER SCIENCE TRIPOS

Logic Background (1A) Young W. Lim 5/14/18

02 Propositional Logic

Iterated Belief Change in the Situation Calculus

LTCS Report. On the Decidability of Verifying LTL Properties of Golog Programs (Extended Version) LTCS-Report 13-10

The Two-Variable Situation Calculus

Inductive situation calculus

A Fixed Point Representation of References

Adding Modal Operators to the Action Language A

AI Principles, Semester 2, Week 2, Lecture 5 Propositional Logic and Predicate Logic

Propositional Logic Arguments (5A) Young W. Lim 11/8/16

Principles of AI Planning

The Typed Situation Calculus

Inference in first-order logic. Production systems.

A Logic Primer. Stavros Tripakis University of California, Berkeley

22c:145 Artificial Intelligence

SCOPE: A Situation Calculus Ontology of Petri Nets

Part of this work we present an extension for Language PP and we show how this

First Order Logic Semantics (3A) Young W. Lim 9/17/17

Logic. Introduction to Artificial Intelligence CS/ECE 348 Lecture 11 September 27, 2001

Monitoring the Generation and Execution of Optimal Plans. Christian Fritz

Agenda. Artificial Intelligence. Reasoning in the Wumpus World. The Wumpus World

Introduction to Arti Intelligence

First-Order Theorem Proving and Vampire. Laura Kovács (Chalmers University of Technology) Andrei Voronkov (The University of Manchester)

PREDICATE LOGIC: UNDECIDABILITY AND INCOMPLETENESS HUTH AND RYAN 2.5, SUPPLEMENTARY NOTES 2

Kecerdasan Buatan M. Ali Fauzi

Symbolic Dynamic Programming for First-order POMDPs

COMP2411 Lecture 10: Propositional Logic Programming. Note: This material is not covered in the book. Resolution Applied to Horn Clauses

Logic for Computer Scientists

Principles of AI Planning

Artificial Intelligence Chapter 7: Logical Agents

CS 4700: Foundations of Artificial Intelligence

Logic and Inferences

Transcription:

Situation Calculus Institute for Software Technology 1

Dates Organizational Issues 10.11.2016 8:45-11:00 (HS i12) lecture and first assignment 17.11.2016 8:45-11:00 (HS i12) lecture and programming assignment 23.11.2016 18:00-18:45 (HS i11) practice 30.11.2016 18:00-18:45 (HS i11) practice and solution for first assignment 28.11.2016 12:00 submission first assignment 07.12.2016 23:59 submission programming assignment 2

Organizational Issues Motivation Introduction Agenda Brief Recap of First Order Logic (if needed) Situation Calculus (today) Introduction Formal Definition Usage Programming in Situation Calculus (next week) Programming Language YAGI Domain Modeling 3

Literature Knowledge in Action by Raymond Reiter MIT Press Artificial Intelligence: A Modern Approach by Stuart Russel amd Peter Norvig Prentice Hall 4

Motivation What is Situation Calculus good for? 5

There is nothing permanent except change. Heraclitus of Ephesus, 535 c. 475 BC 6

Perception-Decision-Execution 7

Dealing with Multiple Worlds 8

Belief Management 9

Belief Management 10

Brief Recap First Order Logic 11

The Situation Calculus is a methodology to reason about actions and change it allows deductive reasoning on how to behave what are the consequences proposed by John McCarthy (1963) further developed by Raymond Reiter and others originally used for database transactions (1995) uses second-order logic (Reiter 2001) modeling of dynamic systems (e.g., robots, plants, ) basis for several (action) programming languages (e.g. Golog) 18

Properties of the Situation Calculus Advantages allows for reasoning about actions and change uses the foundations of logic allows for testing and proving of properties is solution to some fundamental problems of AI (e.g. frame problem) Drawbacks based on second-order logic domain modeling is complex and error prune real implementation somehow fuzzy computational expensive (in particular if you do it wrong) 19

Building Blocks Domain Dependent Objects Fluents Situations Actions The green building blocks are different sorts in the second order logic. The blue building block is used to retrieve properties about the world. 20

States Electrical Engineering or Computer Science several applications of states Deterministic Finite Automaton signup protocols parser model checking testing submission pass q 0 q 1 q 2 q 30 A Q,, q,, 0 F no submission not pass 22

Situations inductively defined as term a constant symbol S 0 denotes the initial situation (nothing happened so far) a binary function symbol do:actions sitations situations situations can be interpreted as sequences of actions do(a,s) performs action a in situation s do(a,s) adds action a to sequence represented by s binary predicate symbol :situation situation s s denotes that s is a proper subsequence of s 23

Sates versus Situations situations are different to states they contain a history of what happened so far snapshots of properties of the world are retrieved by fluents, i.e. which predicates hold in a situation two situations are different if their sequence is different the state of fluents may be the same 24

Situation Tree do(a n,s 0 ) a n a 3 a 2 a n a 1 S 0 a 3 a 2 do(a n,do(a 1,S 0 )) a 1 do(a 1,S 0 ) a n a 3 a 2 a 1 25

Example Dress Up 26

Actions actions are the only entities which change something (i.e., situations and truth values of fluents) actions are represented as function symbols actions have a unique name, if the names are different the actions perform different things actions can have parameters of arity n, e.g. moveto(object, room) or sleep() an action a is executed in a situation s by the function s =do(a,s) leading to a new situation s an action has a precondition in which situation an action is possible to be executed 27

Action Precondition Axioms take care if an action a is executable we introduce a binary predicate symbol Poss:action situation is a sentence in the form Poss(A(x 1,,x n ),s) A (x 1,,x n,s) A is a formula with free variables x 1,,x n and s e.g. Poss(enter_room(x),s) door_open(x,s) axioms have to be defined for all actions a A 29

Fluents used to catch the dynamic world fluents are related to states represent relations and functions that change from situation to situation two different fluents relational fluents functional fluents 30

Relational Fluents represents a relation (or properties) of objects in a situation s it is represented by a predicate symbol with arity n+1 in the form F(x 1,,x n,s) F:(objects actions) n situation {T,F} it represents the truth value of a relation or property in a certain situation examples: at(x,y,s) or broken(x,s) 31

Functional Fluents represents a function of objects in a situation s it is represented by a function symbol with arity n+1 in the form f(x 1,,x n,s) it represents the result (object) of a function f:(objects actions) n situation (objects actions) example: position(x,s) 32

Frame Problem another important (fundamental) problem of AI formulated by John McCarhty and Patrick Hayes related to the abstract modeling of dynamic world how to efficiently specify what is changed by an action and what remains the same sloppy: logic has no memory we need frame axioms example: the color of an object does not change if it is lifted, color(x,c,s) color(x,c,do(lift(x),s)) 33

Successor State Axioms (1) are a solution to the Frame Problem naively we have to specify all effect axioms (because of the frame problem) a. φ F+ (x 1,,x n, y 1,,y m, s) F(x 1,,x n,do(a(y 1,,y m ),s)) b. φ F- (x 1,,x n, y 1,,y m, s) F(x 1,,x n,do(a(y 1,,y m ),s)) example: fragile(x,s) broken(x,do(drop(x),s)) use Causal Completeness Assumption a and b specify all casual laws related to A and F 34

Successor State Axioms (2) F(x 1,,x n,s) F(x 1,,x n,do(a(y 1,,y m ),s)) φ F- (x 1,,x n,y 1,,y m,s) F(x 1,,x n,s) φ F- (x 1,,x n,y 1,,y m,s) F(x 1,,x n,do(a(y 1,,y m ),s)) [PFA] F(x 1,,x n,s) F(x 1,,x n,do(a(y 1,,y m ),s)) φ F+ (x 1,,x n,y 1,,y m,s) F(x 1,,x n,s) φ F+ (x 1,,x n,y 1,,y m,s) F(x 1,,x n,do(a(y 1,,y m ),s)) [NFA] lead to 2 x #actions x #fluents frame axioms fragile(x,s) broken(x,do(drop(x),s)) [PEA] broken(x,s) fragile(x,s) broken(x,do(drop(x),s)) [NFA] 35

Successor State Axioms (4) the general solution positive and negative normal form effect axioms + F(t 1,,t n,do(α,s)) ( y 1,,y m )[a=α x=t + ] F(x 1,,x n,do(a,s)) + F(x 1,,x n,do(a,s)) ( +(1) +(k) ) F(x 1,,x n,do(a,s)) + (x 1,,x n,a,s) F(x 1,,x n,do(a,s)) [PNF] - (x 1,,x n,a,s) F(x 1,,x n,do(a,s)) [NNF] unique name axiom for actions A(x) B(y) and A(x 1,,x n )=A(y 1,,y n ) x 1 =y 1 x n =y n if T entails ( x,a,s). + (x,a,s) - (x,a,s) F(x,do(a,s)) + (x,a,s) F(x,s) - (x,a,s) [SSA-RF] 37

Successor State Axioms (5) now we need only #actions + #fluents axioms 38

Summary Successor State Axioms provides a solution to the Frame Problem yields simple compact axioms only for deterministic primitive actions does not solve the qualification and ramification problem length of successor state axioms ~ #actions change a fluent assumption: only a few actions change a fluent 39

Initial Situation S 0 is a special constant of sort situation it represents the initial situation D S0 is the initial database it comprises sentences describing the initial theory of the world, i.e. fluents that hold in S 0 S 0 is the only situation mentioned D S0 must not mention Poss, do or it may comprise non-situation terms examples: location(robot,office1,s 0 ), mountain(mteverest) 42

Foundational Axioms for Situations ensure some properties of situations situations are understood as sequence of actions abbreviation: do(a n,( do(a 1,S 0 )) = do([a 1,a n ],S 0 ) s s denotes that s is a subsequence of s 1. do(a 1,s 1 )=do(a 2,s 2 ) a 1 =a 2 s 1 =s 2 [UNA] 2. P.P(S 0 ) a,s.(p(s) P(do(a,s))) s.p(s) [SCA] 3. (s S 0 ) [nothing happened prior S 0 ] 4. s do(a,s ) s s with s s ~ s s s=s 43

Basic Action Theory (BAT) D D ssa D ap D una D S 0 Σ set of foundational axioms for situations D ssa set of successor state axioms D ap set of action precondition axioms D una set of unique name axioms for actions D set of first order sentences uniform in S S 0 0 44

Putting all Together (An Example) Towers of Hanoi a b c 3 2 1 3 2 1 45

Regression related to the projection problem does a sentence hold for a future situation used for automated reasoning and planning in the SC sketch: prove if sentence W is entailed by BAT W mentions a relational fluent F(x 1,,x n,do(a,σ)) successor state axiom F(x 1,,x n,do(a,s)) F (x 1,,x n,a,s) obtain W by substituting F by F eliminating complex situation do(a, σ) from W W is closer to S 0 than W repeat the substitution until W 0 uniform in S 0 now we can prove W in the initial database (no second order axioms) 46

Regressable Formulas a formula W in the situation calculus is regressable iff 1. situation terms mentioned in W are of the form do([α 1,,α n ],S 0 ) 2. for atoms of form Poss(α,s) mentioned in W α has the form A(t 1,,t n ) and is an action function symbol 3. W does not quantify over situations 4. W does not mention the predicate symbol nor any equality atom σ=σ for situations 47

Examples for Regressable Formulas 1. Poss(walk(A,B)S 0 ) Poss(enter(office(Sue)),do(walk(A,B),S 0 )) Poss(giveCoffee(Sue),do([walk(A,B),enter(Office(Sue))],S 0 ) 2. ( a,a ).ontable(a,do(a,s 0 )) ( x).x A ontable(x,do([a,a ],S 0 )) Regressable? Poss(a,S 0 ) holding(x,do(pickup(a),s)) 48

Regression Operator 1. if W is situation-independent or a relational fluent F(x,S 0 ) [W]=W 2. if W is a regressable Poss(A(t),σ) atom and Poss(A(x),s) A (x,s) [W]= [ A (t,σ)] 3. if W is a relational fluent F(t,do(α,σ)) and F(x,do(a,s)) F (x,a,s) [W]= [ F (t,α,σ)] 4. [ W]= [W] [W 1 W 2 ]= [W 1 ] [W 2 ] [( v)w]=( v) [W] 49

Important Result from Regression if D is a basic action theory and W is a regressable sentence then, D W iff D S 0 D una [W] 50

Situation Calculus Summary allows for reasoning about change and actions a dialect of the second-order logic uses the concept of situations allows for proving properties solves the frame problem Basic Action Theory implements the situation calculus Action Precondition & Successor State Axioms & Unique Name Assumption & Foundation Axioms & Initial Situation Regression and Planning allows for automated reasoning and planning 53

Outlook Programming with SC Situation Calculus is yet only a theoretical construct Golog (algol for Logic) is based on the Situation Calculus it is a program language for dynamic systems cumbersome to use (Prolog-based interpreter ) YAGI (yet another golog interpreter) gives a clear syntax and better usability 54

Questions? 55