Planning in Answer Set Programming

Slides:



Advertisements
Similar presentations
Planning.
Advertisements

Heuristic Search techniques
Knowledge Representation
Artificial Intelligence Knowledge Representation
First-Order Logic: Better choice for Wumpus World Propositional logic represents facts First-order logic gives us Objects Relations: how objects relate.
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.
Chapter 6: Percents Section 3 Finding a Percent of a Number.
Knowledge Representation and Reasoning (KR): A vibrant subfield of AI Jia You.
Problem Solving and Search in AI Part I Search and Intelligence Search is one of the most powerful approaches to problem solving in AI Search is a universal.
Programming with Constraints Jia-Huai You. Subject of Study Constraint Programming (CP) studies the computational models, languages, and systems for solving.
CPSC 322, Lecture 18Slide 1 Planning: Heuristics and CSP Planning Computer Science cpsc322, Lecture 18 (Textbook Chpt 8) February, 12, 2010.
1 Programming with Constraints Jia-Huai You Constraint programming languages - based on non-monotonic logic - Answer set programming (ASP) Knowledge Representation.
Constraint Logic Programming Ryan Kinworthy. Overview Introduction Logic Programming LP as a constraint programming language Constraint Logic Programming.
1 Chapter 15 Introduction to Planning. 2 Chapter 15 Contents l Planning as Search l Situation Calculus l The Frame Problem l Means-Ends Analysis l The.
Ontologies Reasoning Components Agents Simulations Belief Update, Planning and the Fluent Calculus Jacques Robin.
CSC 395 – Software Engineering Lecture 13: Object-Oriented Analysis –or– Let the Pain Begin (At Least I’m Honest!)
1 Chapter 15 Introduction to Planning. 2 Chapter 15 Contents l Planning as Search l Situation Calculus l The Frame Problem l Means-Ends Analysis l The.
Computing & Information Sciences Kansas State University Lecture 13 of 42 CIS 530 / 730 Artificial Intelligence Lecture 13 of 42 William H. Hsu Department.
1 CS 2710, ISSP 2160 The Situation Calculus KR and Planning Some final topics in KR.
1 Chapter 16 Planning Methods. 2 Chapter 16 Contents (1) l STRIPS l STRIPS Implementation l Partial Order Planning l The Principle of Least Commitment.
Introduction to Planning Dr. Shazzad Hosain Department of EECS North South Universtiy
Advanced Problem Solving Systems: Planning  In order to solve nontrivial problems, it is necessary to combine 1.Basic problem solving strategies 2.Knowledge.
Advanced Problem Solving Systems: Planning Lecture Module 8.
AI Lecture 17 Planning Noémie Elhadad (substituting for Prof. McKeown)
Planning I: Total Order Planners Sections
Artificial Intelligence 2004 Planning: Situation Calculus Review STRIPS POP Hierarchical Planning Situation Calculus (John McCarthy) situations.
Computing & Information Sciences Kansas State University Wednesday, 04 Oct 2006CIS 490 / 730: Artificial Intelligence Lecture 17 of 42 Wednesday, 04 October.
Artificial Intelligence Knowledge Representation.
Computing & Information Sciences Kansas State University Friday, 13 Oct 2006CIS 490 / 730: Artificial Intelligence Lecture 21 of 42 Friday, 13 October.
Knowledge Representation Techniques
Algorithms and Problem Solving
Chapter 2 Memory and process management
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Knowledge and reasoning – second part
Knowledge Representation
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
The Propositional Calculus
Introduction Defining the Problem as a State Space Search.
Knowledge Representation
Intelligent Agents Chapter 2.
Review for the Midterm Exam
CS416 Compiler Design lec00-outline September 19, 2018
Chapter 10: Process Implementation with Executable Models
Do Now Can you Reason abstractly?
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Lecture 2 Introduction to Computer Science (continued)
The Situation Calculus KR and Planning Some final topics in KR
Planning CSE 473 AIMA, 10.3 and 11.
Logic: Top-down proof procedure and Datalog
Artificial Intelligence
Fundamentals of Data Representation
Introduction to Situation Calculus
Class #20 – Wednesday, November 5
Graph Coverage for Specifications CS 4501 / 6501 Software Testing
Artificial Intelligence I: knowledge repre- sentation
Knowledge and reasoning – second part
CSE (c) S. Tanimoto, 2001 Search-Introduction
CS416 Compiler Design lec00-outline February 23, 2019
Knowledge Representation I (Propositional Logic)
Artificial Intelligence Chapter 21. The Situation Calculus
CSE (c) S. Tanimoto, 2002 State-Space Search
Artificial Intelligence I: knowledge repre- sentation
CSE (c) S. Tanimoto, 2004 State-Space Search
Information Retrieval and Web Design
Prof. Pushpak Bhattacharyya, IIT Bombay
Representations & Reasoning Systems (RRS) (2.2)
Knowledge Representation
Logical Agents Prof. Dr. Widodo Budiharto 2018
Algorithms Tutorial 27th Sept, 2019.
Presentation transcript:

Planning in Answer Set Programming Lecture Notes for Cmput 366

Objective Planning method as seen in Situation Calculus and STRIPS becomes alive General methodology of planning in ASP Examples

Planning Find a sequence of actions that leads from an initial state to a goal state. Complexity: The problem is NP-complete when we fix the length of a plan whose existence is to be determined.

Answer Set Programming: Review Programs are collections of rules: A  B1, …, Bm, not C1, …, not Cn Stable model semantics Language enhanced by new constructs (we will use Smodel as an example) -Cardinality constraint: L {a1, …, am, not b1, …, not bk }U -Choice rule has a special card. Constraint in rule head {h1 ,…, hn}  body. which is equivalent to 0{h1 ,…, hn}n  body.

Planning in ASP Steps in a plan E.g. time(0..steps). To solve a planning problem, we need to represent a number of things. First, the setup: Steps in a plan E.g. time(0..steps). next-state(T2,T1)  T2=T1+1.

Representation Fluents Properties, particularly those that may hold across states E.g. on(a, table, T) object a is on table at time (step) T Actions E.g. move-to(a,b,T) move a onto top of b at T

Representation Initial state E.g. on(a,b,0). on(b,table,0). on(c,table,0).

Representation Goal state goal(T)  time(T), on(a,c,T), …. Remember we have to say goal must be satisfied. This can be done by goal  time(T),goal(T).  not goal.

Representation An action system -Action choice: what actions may be chosen -Affected objects: what objects are affected by an action -Effects: if affected, what are effects on the affected objects -Frame axiom: if not affected by an action at a state, the fluents that hold in current state remain to hold in next state.

Scheme for representing an action system {action(Obj,T)}  pre-conditions.  action(Obj,T),conflicting-action(Obj , T). affected(Obj,T)  action(Obj,T). property2(Obj,T+1)  action(T), property1(Obj,T). Property(Obj,T+1)  not affected(Obj,T), property(Obj,T).

Example: Elevator Problem There is an elevator which transports passengers from initial floors to goal floors. The elevator can move up and down to any floor. When it stops at a floor, any passenger in it can be unboarded, and any waiting passenger can be be boarded onto it. The goal is to transport all passengers to their destination floors. Program at: www.cs.ualberta.ca/~you/courses/366/planning-examples/ee.sm (All programs can be accessed from course web page.)

Example: Ferry Problem A popular planning domain with actions board onto/unboard from a single ferry. The ferry can only transport one car at a time and a move action moves the ferry between any two locations The goal is to transport all cars to their destinations. Program at: http://www.cs.ualberta.ca/~you/courses/366/planning-examples/ferry.sm

Gripper Problem The goal is to transport all the balls from one room to another. The robot is allowed to move from one room to the other, and use its two grippers to pick up, and put down balls. See http://www.cs.ualberta.ca/~you/courses/366/planning-examples/gripper.sm Interests in this problem: there are too many symmetries.

Blocks world See program at http://web.cs.ualberta.ca/~you/ courses/621/Smodels-programs/ bw.lp

Domain Dependent Knowledge STRIPS aims at a language for domain independent knowledge To increase efficiency, domain knowledge must be added - as part of program - in the solver engine

Types of Domain Knowledge State relationship knowledge: How are the properties of two or more states related. E.g. in the gripper domain, the effect, “return a ball back to is original room can be expressed by a relation among three properties: at(A,R,T), not at(A,R,T+1), at at(A,R,T1) where T1 > T+1 Procedural knowledge -information about sequence of actions in final plan

Types of Domain Knowledge Relationship about state conditions and actions: E.g the following makes blocks world program extremely efficient: if not goodTower(X,Y,T) then not move(X,Y,T)

Types of Domain Knowledge Procedural knowledge: Info about sequence of actions in final plan E.g. A gripper must pick up a ball before putting it down If a gripper picks up a ball at T, it must put it down at T+2, and vice versa.

Types of Domain Knowledge Procedural knowledge E.g. - If a ferry boards a car at state T, it then must move to its destination. - Do not stop at a floor if the lift does not board or unboard any passenger at the next state.

Types of Domain Knowledge Symmetry knowledge: Info about check and break symmetry. Distance knowledge: Are there enough steps left for having a plan.

Review of Situation Calculus (cf. Russel and Norvig, Ch10 Review of Situation Calculus (cf. Russel and Norvig, Ch10.03 page 328-339)

Actions, events and situations

Describing change Simple Situation calculus requires two axioms to describe change: Possibility axiom: when is it possible to do the action At(Agent,x,s)  Adjacent(x,y)  Poss(Go(x,y),s) Effect axiom: describe changes due to action Poss(Go(x,y),s)  At(Agent,y,Result(Go(x,y),s)) What stays the same? Frame problem: how to represent all things that stay the same? Frame axiom: describe non-changes due to actions At(o,x,s)  (o  Agent)  Holding(o,s)  At(o,x,Result(Go(y,z),s))

Representational frame problem If there are F fluents and A actions then we need A*F frame axioms to describe other objects are stationary unless they are held. We write down the effect of each actions Solution; describe how each fluent changes over time Successor-state axiom: Pos(a,s)  (At(Agent,y,Result(a,s))  (a = Go(x,y))  (At(Agent,y,s)  a  Go(y,z)) Note that next state is completely specified by current state. Each action effect is mentioned only once.

Other problems How to deal with secondary (implicit) effects? If the agent is carrying the gold and the agent moves then the gold moves too Ramification problem How to decide EFFICIENTLY whether fluents hold in the future? Inferential frame problem Extensions: Event calculus (when actions have a duration)