Macro-actions in the Situation Calculus Yilan Gu Department of Computer Science University of Toronto August 10, 2003.

Slides:



Advertisements
Similar presentations
Heuristic Search techniques
Advertisements

Models of Computation Prepared by John Reif, Ph.D. Distinguished Professor of Computer Science Duke University Analysis of Algorithms Week 1, Lecture 2.
Artificial Intelligence Chapter 13 The Propositional Calculus Biointelligence Lab School of Computer Sci. & Eng. Seoul National University.
First-Order Logic: Better choice for Wumpus World Propositional logic represents facts First-order logic gives us Objects Relations: how objects relate.
The Logic of Intelligence Pei Wang Department of Computer and Information Sciences Temple University.
Situation Calculus for Action Descriptions We talked about STRIPS representations for actions. Another common representation is called the Situation Calculus.
Artificial Intelligence Chapter 21 The Situation Calculus Biointelligence Lab School of Computer Sci. & Eng. Seoul National University.
Artificial Intelligence Inference in first-order logic Fall 2008 professor: Luigi Ceccaroni.
Project Proposal.
Handling Uncertainty System in the Situation Calculus with Macro-actions Yilan Gu Department of Computer Science University of Toronto November 28, 2002.
Sheila McIlraith, Knowledge Systems Lab, Stanford University AAAI’00 08/2000 What Sensing Tells Us: Towards a Formal Theory of Testing for Dynamical Systems.
An Approach to Evaluate Data Trustworthiness Based on Data Provenance Department of Computer Science Purdue University.
CPSC 502, Lecture 11Slide 1 Introduction to Artificial Intelligence (AI) Computer Science cpsc502, Lecture 11 Oct, 18, 2011.
CPSC 322, Lecture 19Slide 1 Propositional Logic Intro, Syntax Computer Science cpsc322, Lecture 19 (Textbook Chpt ) February, 23, 2009.
Decision Theory: Single Stage Decisions Computer Science cpsc322, Lecture 33 (Textbook Chpt 9.2) March, 30, 2009.
1 Introduction to Computability Theory Lecture11: Variants of Turing Machines Prof. Amos Israeli.
1 Operational Semantics Mooly Sagiv Tel Aviv University Textbook: Semantics with Applications.
Artificial Intelligence Chapter 3: Solving Problems by Searching
Gradient Methods Yaron Lipman May Preview Background Steepest Descent Conjugate Gradient.
Operational Semantics Semantics with Applications Chapter 2 H. Nielson and F. Nielson
Chapter 1 Program Design
Chapter 2: Algorithm Discovery and Design
ALGORITHMS AND FLOW CHARTS 1 Adapted from the slides Prepared by Department of Preparatory year Prepared by: lec. Ghader Kurdi.
Algorithm design techniques
Software design and development Marcus Hunt. Application and limits of procedural programming Procedural programming is a powerful language, typically.
Teaching Teaching Discrete Mathematics and Algorithms & Data Structures Online G.MirkowskaPJIIT.
Languages and Environments Higher Computing Unit 2 – Software Development.
1 How to Take Tests 3 Using Concepts, Procedures, and Rules.
Ontologies Reasoning Components Agents Simulations Belief Update, Planning and the Fluent Calculus Jacques Robin.
The Electronic Geometry Textbook Project Xiaoyu Chen LMIB - Department of Mathematics Beihang University, China.
Proof Systems KB |- Q iff there is a sequence of wffs D1,..., Dn such that Dn is Q and for each Di in the sequence: a) either Di is in KB or b) Di can.
A Logic for Decidable Reasoning about Services Yilan Gu Dept. of Computer Science University of Toronto Mikhail Soutchanski Dept. of Computer Science Ryerson.
Empirical Explorations with The Logical Theory Machine: A Case Study in Heuristics by Allen Newell, J. C. Shaw, & H. A. Simon by Allen Newell, J. C. Shaw,
Artificial Intelligence Introductory Lecture Jennifer J. Burg Department of Mathematics and Computer Science.
School of Computing FACULTY OF ENGINEERING Developing a methodology for building small scale domain ontologies: HISO case study Ilaria Corda PhD student.
©Silberschatz, Korth and Sudarshan13.1Database System Concepts Chapter 13: Query Processing Overview Measures of Query Cost Selection Operation Sorting.
Expert System Development Tools Sean Lydon Daniel Nelson Emily Schwarz.
Knowledge Representation Use of logic. Artificial agents need Knowledge and reasoning power Can combine GK with current percepts Build up KB incrementally.
Pattern-directed inference systems
ISBN Chapter 3 Describing Semantics -Attribute Grammars -Dynamic Semantics.
Solving Large Markov Decision Processes Yilan Gu Dept. of Computer Science University of Toronto April 12, 2004.
ALGORITHM CHAPTER 8. Chapter Outlines and Objectives  Define an algorithm and relate it to problem solving.  Define three construct and describe their.
Slide 1 Propositional Definite Clause Logic: Syntax, Semantics and Bottom-up Proofs Jim Little UBC CS 322 – CSP October 20, 2014.
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information.
Haley: A Hierarchical Framework for Logical Composition of Web Services Haibo Zhao, Prashant Doshi LSDIS Lab, Dept. of Computer Science, University of.
4. The process specification (プロセス仕様) You will learn: (次の内容を学び) The concept of process specification (プロセス 仕様の概念) Notations for process specification (プロセス.
Kansas State University Department of Computing and Information Sciences CIS 730: Introduction to Artificial Intelligence Lecture 13 of 41 Monday, 20 September.
Lecture 3: 18/4/1435 Searching for solutions. Lecturer/ Kawther Abas 363CS – Artificial Intelligence.
Data Structures and Algorithms Dr. Tehseen Zia Assistant Professor Dept. Computer Science and IT University of Sargodha Lecture 1.
1 / 48 Formal a Language Theory and Describing Semantics Principles of Programming Languages 4.
CPSC 322, Lecture 19Slide 1 (finish Planning) Propositional Logic Intro, Syntax Computer Science cpsc322, Lecture 19 (Textbook Chpt – 5.2) Oct,
Hashtables. An Abstract data type that supports the following operations: –Insert –Find –Remove Search trees can be used for the same operations but require.
Computer Science CPSC 322 Lecture 22 Logical Consequences, Proof Procedures (Ch 5.2.2)
Intro to Planning Or, how to represent the planning problem in logic.
A framework of safe robot planning Roland Pihlakas Institute of Technology in University of Tartu august 2008.
8.1 8 Algorithms Foundations of Computer Science  Cengage Learning.
Logic: Proof procedures, soundness and correctness CPSC 322 – Logic 2 Textbook §5.2 March 7, 2011.
Operational Semantics Mooly Sagiv Tel Aviv University Textbook: Semantics with Applications Chapter.
Artificial Intelligence Knowledge Representation.
Selection Using IF THEN ELSE CASE Introducing Loops.
INTRODUCTION TO PROBLEM SOLVING
The Propositional Calculus
Decision Theory: Single Stage Decisions
Learning to Program in Python
Learning to Program in Python
Decision Theory: Single Stage Decisions
Interpret the execution mode of SQL query in F1 Query paper
Knowledge Representation I (Propositional Logic)
CS 416 Artificial Intelligence
Representations & Reasoning Systems (RRS) (2.2)
Presentation transcript:

Macro-actions in the Situation Calculus Yilan Gu Department of Computer Science University of Toronto August 10, 2003

Outline  Situation calculus  Introducing macro-actions  Developing the knowledge base for the macro-actions  Reuse of the macro-actions  Conclusion and future work

Situation Calculus  The basic elements of the situation calculus  Actions kick(x): kick object x  Situations S 0, do(a,s)  Objects mary, boxA  The basic action theory  Action precondition axioms  Successor state axioms  Initial database  Complex actions  ; , p?,  | , (  x)  (x), if-then-else, while loop, procedure  Golog program – a bunch of procedures

Situation Calculus (Cont.)  The regression operator R Example: Successor state axiom for fluent ontable(t,s) ontable(t,do(a,s))  a= putonTable(t)  ontable(t,s)   a= pickup(t) R [ontable(x,do(a,S 0 ))] = a= putonTable(x)  ontable(x,S 0 )   a= pickup(x)  The regression theorem For any regressable formula W, D |= W iff D S0 |= R [W]  Uncertainty system  Stochastic actions Example: choice(pickup(x),a)  a = pickupS(x)  a = pickupF(x)  Probability Example: prob(pickupS(x), pickup(x), s) = 0.9  Modified Golog interpreter – stGolog

Motivation of Introducing Macro- actions  Create intelligent autonomous agents to help human on particular topics  Agents often meet same local situations and asked to achieve same tasks and perform same strategies  Human beings often act “without thinking”  Purpose: save time on re-computation  Idea:  Consider certain kind of complex actions as a whole  Compute and keep intermediate knowledge  Reuse the existing intermediate knowledge

Example of Robot climbing Stairs

Robot Climbing Stairs (Cont.)  Nature’s choices: (example) choice(liftUpperLeg(h),a)  a = liftTill(h)  a = malfunc(h)  Fluents: Barycenter(l,s), footOnGround(l,s), overNewStair(l,s),…,etc  Precondition axioms: (example) Poss(liftTill(h), s)  barycenter(supporting, s)  Successor State Axioms: (example) overNewStair(l,do(a,s))  a = forwSupLegS  l= supporting  a = forwLowLegS  l = main  overNewStair(l,s)   a = stepDownS(l)  Probabilities: (examples) prob 0 (liftTill(h), liftUpperLeg(h), s) = h/(h+100). prob 0 (malfunc(h), liftUpperLeg(h), s) = h/(h+100).

Robot Climbing Stairs (Cont.)  Procedure of climbing a stair of height h proc climbing(h) legalStair(h)?; liftUpperLeg(h); forwLowLeg; stepDown(main); moveBarycenter(main); straightLeg; forwSupLeg; stepDown(supporting); moveBarycenter(supporting) Endproc The robot need to climb thousands of stairs, by using former stGolog, the agent need to do regression for each primitive action which includes lots of repetition information.We can treat climbing one stair as a whole, pre-compute and reuse its information.

Introducing macro-actions  Discard uncertain logic actions  |  and (  x)  (x)  Not consider p?, if-then-else or while loop as a part of macro-actions  Small sequence of actions is appropriate  Uniform syntax  Easy to find its deterministic choices and information of corresponding probabilities  Feasible to give extended precondition axioms and successor state axiom

Introducing macro-actions (Cont.)  Example: sequence of stochastic actions  1 ;  2 executed inn current situation 11 A 1,1 A 1,2 22 A 2,1 A 2,2 1;21;2 A 1,1 A 1,2 ;A 2,1 Extend precondition axioms and successor state axioms and compute probabilities for sequence of deterministic actions rather than for primitive actions, therefore regression operator can be extended to sequential actions as well.

Specifying macro-actions  Reason:  Distinguish from ordinary sequential actions  Need to let the autonomous agent know  Syntax: macro name  1 ;  2 ;  ;  n endmacro

Example of macro-actions  Example 1 macro stepMain(h) liftUpperLeg(h); forwLowLeg; stepDown(main); moveBarycenter(main); straightLeg endmacro macro stepSupp forwSupLeg; stepDown(supporting); moveBarycenter(supporting) endmacro proc climbing(h) legalStair(h)?; stepMain(h); stepSupp endproc

Example of macro-actions (Cont.)  Example 2 macro climbStair(h) liftUpperLeg(h); forwLowLeg; stepDown(main); moveBarycenter(main); straightLeg; forwSupLeg; stepDown(supporting); moveBarycenter(supporting) endmacro proc climbing(h) legalStair(h)?; climbStair(h) endproc

The knowledge base The knowledge base for macro- actions  What intermediate information do we want to keep?  Definition of macro-actions  The extended successor state axioms  The extended precondition axioms of nature’s choices of macro- actions that are not equivalent to false  The Extended probabilities of nature’s choices of macro-actions  By using a simple algorithm, we can develop knowledge base for macro-actions  Implemented in Prolog

Extended regression operator  Reason: reuse the existing info. in the knowledge base  s-regressable formula  Situation terms of from do([  1, ,  n ], s)  Regressable formula is same as S 0 -regressable  The extended regression operator R* for s-regressable formula W  Boarder than original regression operator  Save computational steps R* [F(x, do(a 1 ;a 2 ;a 3, S 0 ))] = R [F(x, do([a 1, a 2, a 3 ], S 0 ))], but has different computational steps  Now having R* [F(x, do(a 1 ;a 2 ;a 3, s))], but there was no R [F(x, do([a 1, a 2, a 3 ], s))];

The regression theorems for R*  Given s-regressable sentence W and a basic action theory D, R* [W] is a sentence uniform in s and D |= W  R* [W]  Given regressable sentence W and a basic action theory D, then D |= R [W ]  R* [W] D |= W iff D S0 |= R* [W]  Given S 0 - regressable sentence W 1, W 2 be the corresponding sentence by changing do(a 1 ;a 2 ;…;a n, s) to be do([a 1,a 2,…,a n ], s), and a basic action theory D, then D |= W 2 iff D S0 |= R* [W 1 ]

Reuse of macro-actions  After developing the knowledge base of macro-actions given by the user, we want to use and reuse the remembered information  A primitive application – macGolog  Modified from stGolog  Program now allows to include macro-actions  Use extended regression operator  Adding the checking that if an action is a macro-action, then use the existing extended axioms in the knowledge base for calculating; otherwise, treat as before

Implementation of macGolog  Implemented in Polog  Has same functions as stGolog  Benefit: save computing steps in the searching trees, therefore save computational time  Example: The robot climbing stairs, comparing running the procedures of climbing a stair without or with macro- actions, we have following different searching trees

Experiments of climbing stairs  Test on 3 different definitions of climbing stair procedure  No macro-actions (using stGolog)  Define 2 short macro-actions: stepMain(h), stepSupp  Define 1 long macro-action: climbStair(h)  4 tests – simulating different environments  Test 1 – all stairs are of the same height  Test 2 – at most 10 different heights  Test 3 – at most 50 different heights  Test 4 – at most 800 different heights

Searching trees (Figure 1)  The searching tree for climbing a stair without macro- actions 9 steps of regression

Searching Trees (Figure 2)  The searching tree of climbing a stair for using two macro- actions  The searching tree of climbing a stair for using one macro-action 3 steps of regression 2 steps of regression

Comparing Results -- 2 macro-actions -- 1 macro-action -- no macro-action X axis: number of stairs Y axis: CPU time

Discussion: benefits and limits  Benefits:  Saving computational time  Agents have “memories” in some sense and keep the “experiences”  Limits, especially under current implementation:  User’s duty to choose suitable macro-actions  The agents can not be aware of similar local situations themselves yet

Conclusions and future work  What we did:  Introduce concept of macro-action  Define extended regression operation  Develop knowledge base for macro-actions  macGolog – primary implementation of reuse macro-actions  What we can do in the future:  Improve implementation of reuse macro-actions  Possible to formalize the way of resetting the local situation, make agent forgettable  Try to make agents aware of similar local situations  Consider if we can adopt macro-action into the problem of solving MDP by using the situation calculus

Why 2 macro-actions perform bad when height h changes often  The searching tree of climbing a stair for using two macro- actions  The searching tree of climbing a stair for using one macro-action Similar local situations which robot doesn’t aware of,e.g: do(stepMain(15), s) do(stepMain(17), s) s

Why 2 macro-actions perform better than 1 macro when height h seldom changes  For 2 macro-action example, the longest nature’s choices of macro- actions are of length 5, therefore we only need to keep extended Successor State Axioms F(x,do(a 1 ;a 2,s)), F(x,do(a 1 ;a 2 ;a 3,s)), …, F(x,do(a 1 ;a 2 ;…;a 5,s)) for each fluent F ; while 1 macro-action example, the longest nature’s choices of macro-action are of length 8, therefore we need to keep extended Successor State Axioms F(x,do(a 1 ;a 2,s)), F(x,do(a 1 ;a 2 ;a 3,s)), …, F(x,do(a 1 ;a 2 ;…;a 8,s)) for each fluent F, which makes the knowledge base larger. And, searching knowledge base costs time.