D1. Abstractions: Formal Definition and Heuristics
Gabriele R¨oger and Thomas Keller
Universit¨at Basel
October 29, 2018
Content of this Course
Planning
Classical
Tasks Progression/
Regression Complexity Heuristics
Probabilistic
MDPs Uninformed Search
Heuristic Search Monte-Carlo
Methods
Content of this Course: Heuristics
Heuristics
Delete Relaxation
Abstraction
Abstractions in General
Pattern Databases
Merge &
Shrink Landmarks
Potential Heuristics Cost Partitioning
Abstractions
Abstracting a Transition System
Abstracting a transition system meansdropping some distinctions between states, whilepreserving the transition behaviouras much as possible.
An abstraction of a transition system T is defined by an abstraction mapping α that defines which states of T should be distinguished and which ones should not.
FromT andα, we compute anabstract transition systemTα which is similar to T, but smaller.
The abstract goal distances(goal distances in Tα) are used as heuristic estimates for goal distances inT.
Computing the Abstract Transition System
GivenT andα, how do we compute Tα? Requirement
We want to obtain anadmissible heuristic.
Hence,h∗(α(s)) (in the abstract state spaceTα) should never overestimateh∗(s) (in the concrete state spaceT).
An easy way to achieve this is to ensure thatall solutions in T are also present inTα:
Ifs is a goal state inT, then α(s) is a goal state in Tα. IfT has a transition froms to t, thenTα
has a transition from α(s) to α(t).
Example Task: One Package, Two Trucks
Example (One Package, Two Trucks)
Consider the following FDR planning taskhV,I,O, γi:
V ={p,tA,tB}with dom(p) ={L,R,A,B}
dom(tA) = dom(tB) ={L,R}
I ={p 7→L,tA7→R,tB 7→R}
O ={pickupi,j |i ∈ {A,B},j ∈ {L,R}}
∪ {dropi,j |i ∈ {A,B},j ∈ {L,R}}
∪ {movei,j,j0 |i ∈ {A,B},j,j0 ∈ {L,R},j 6=j0}, where pickupi,j =hti=j∧p=j,p:=i,1i
dropi,j =hti =j∧p=i,p:=j,1i
movei,j,j0 =hti =j,ti :=j0,1i
γ = (p= R)
Concrete Transition System of Example Task
LRR LLL LLR
LRL
ALR
ALL
BLL
BRL
ARL
ARR
BRR
BLR
RRR RRL
RLR
RLL
State {p 7→i,tA 7→j,tB 7→k} is depicted asijk. Transition labels are again not shown. For example, the transition from LLL to ALL has the label pickupA,L.
Abstract Transition System of Example Task
LRR
LLR
LLL
LRL LLR
LRL LLL
ALR ARL
ALL ARR
BLL
BRL
BRR
BLR ALR ARL
ARR ALL
BLL BRR
BLR BRL
RRR RRL
RLR
RLLRLL RRL
RLR RRR
State {p 7→i,tA 7→j,tB 7→k} is depicted asijk. Transition labels are again not shown. For example, the transition from LLL to ALL has the label pickupA,L.
Abstractions
Definition (Abstraction)
LetT =hS,L,c,T,s0,S?ibe a transition system.
Anabstraction(also: abstractionfunction, abstraction mapping) ofT is a functionα:S →Sα defined on the states of T, whereSα is an arbitrary set.
Without loss of generality, we require thatα is surjective.
Intuition: α maps the states of T to another (usually smaller) abstractstate space.
Abstract Transition System
Definition (Abstract Transition System)
LetT =hS,L,c,T,s0,S?ibe a transition system, and letα:S →Sα be an abstraction of T.
Theabstract transition system induced byα, in symbols Tα, is the transition systemTα=hSα,L,c,Tα,s0α,S?αidefined by:
Tα={hα(s), `, α(t)i | hs, `,ti ∈T} s0α=α(s0)
S?α={α(s)|s ∈S?}
Terminology
LetT be a transition system andα be an abstraction of T. T is called the concrete transition system.
Tα is called the abstract transition system.
Similarly: concrete/abstract state space, concrete/abstract transition, etc.
Practical Requirements for Abstractions
To be useful in practice, an abstraction heuristic must be efficiently computable. This gives us two requirements forα:
For a given state s, theabstract state α(s) must be efficiently computable.
For a given abstract stateα(s), theabstract goal distance h∗(α(s)) must be efficiently computable.
There are a number of ways of achieving these requirements:
pattern database heuristics(Culberson & Schaeffer, 1996) merge-and-shrink abstractions (Dr¨ager, Finkbeiner &
Podelski, 2006)
Cartesian abstractions (Ball, Podelski & Rajamani, 2001) structural patterns (Katz & Domshlak, 2008b)
Homomorphisms and Isomorphisms
Homomorphisms and Isomorphisms
The abstraction mappingα that transforms T toTα is also called a strict homomorphismfromT toTα. Roughly speaking, in mathematics a homomorphism is a property-preserving mapping between structures.
A stricthomomorphism is one where no additional features are introduced. A non-strict homomorphism in planning would mean that the abstract transition system may include additional transitions and goal states not induced byα.
We only consider strict homomorphisms in this course.
Ifα is bijective, it is called an isomorphismbetween T and Tα, and the two transition systems are called isomorphic.
Isomorphic Transition Systems
The notion of isomorphic transition systems is important enough to warrant a formal definition:
Definition (Isomorphic Transition Systems)
LetT =hS,L,c,T,s0,S?iand T0=hS0,L0,c0,T0,s00,S?0i be transition systems.
We say thatT is isomorphic toT0, in symbolsT ∼ T0, if there exist bijective functionsϕ:S →S0 andλ:L→L0 such that:
s −→` t ∈T iff ϕ(s)−−→λ(`) ϕ(t)∈T0, c0(λ(`)) =c(`) for all`∈L, ϕ(s0) =s00, and
s ∈S? iff ϕ(s)∈S?0.
Graph-Equivalent Transition Systems
Sometimes a weaker notion of equivalence is useful:
Definition (Graph-Equivalent Transition Systems)
LetT =hS,L,c,T,s0,S?iand T0=hS0,L0,c,T0,s00,S?0i be transition systems.
We say thatT is graph-equivalent to T0, in symbolsT ∼ TG 0, if there exists a bijective functionϕ:S →S0 such that:
There is a transitions −→` t ∈T with c(`) =k iff there is a transition ϕ(s) `
0
−→ϕ(t)∈T0 with c0(`0) =k, ϕ(s0) =s00, and
s ∈S? iff ϕ(s)∈S?0.
Note: The labels of T and T0 do not matter except that transitionsof the same costmust be preserved.
Isomorphism vs. Graph Equivalence
(∼) and (∼) are equivalence relations.G
Two isomorphic transition systems are interchangeable for all practical intents and purposes.
Two graph-equivalent transition systems are interchangeable for most intents and purposes.
In particular, their goal distances are identical.
Isomorphism implies graph equivalence, but not vice versa.
Abstraction Heuristics
Abstraction Heuristics
Definition (Abstraction Heuristic)
Letα:S →Sα be an abstraction of a transition systemT. Theabstraction heuristic induced byα, writtenhα,
is the heuristic functionhα:S →R+0 ∪ {∞} defined as hα(s) =h∗Tα(α(s)) for all s ∈S, whereh∗Tα denotes the goal distance function in Tα. Notes:
hα(s) =∞ if no goal state ofTα is reachable fromα(s) We also apply abstraction terminology to planning tasks Π, which stand for their induced transition systems.
For example, an abstraction of Π is an abstraction ofT(Π).
Abstraction Heuristics: Example
LRR
LLR
LLL
LRL LLR
LRL LLL
ALR ARL
ALL ARR
BLL
BRL
BRR
BLR ALR ARL
ARR ALL
BLL BRR
BLR BRL
RRR RRL
RLR
RLLRLL RRL
RLR RRR
hα({p7→L,tA 7→R,tB 7→R}) = 3
Consistency of Abstraction Heuristics (1)
Theorem (Consistency and Admissibility ofhα) Letα be an abstraction of a transition systemT. Then hα is safe, goal-aware, admissible and consistent.
Proof.
We prove goal-awareness and consistency;
the other properties follow from these two.
LetT =hS,L,c,T,s0,S?i.
LetTα =hSα,L,c,Tα,s0α,S?αi.
Goal-awareness: We need to show thathα(s) = 0 for alls ∈S?, so lets ∈S?. Thenα(s)∈S?α by the definition of abstract
transition systems, and hencehα(s) =h∗Tα(α(s)) = 0. . . .
Consistency of Abstraction Heuristics (1)
Theorem (Consistency and Admissibility ofhα) Letα be an abstraction of a transition systemT. Then hα is safe, goal-aware, admissible and consistent.
Proof.
We prove goal-awareness and consistency;
the other properties follow from these two.
LetT =hS,L,c,T,s0,S?i.
LetTα =hSα,L,c,Tα,s0α,S?αi.
Goal-awareness: We need to show that hα(s) = 0 for alls ∈S?, so lets ∈S?. Thenα(s)∈S?α by the definition of abstract
transition systems, and hencehα(s) =h∗Tα(α(s)) = 0. . . .
Consistency of Abstraction Heuristics (2)
Proof (continued).
Consistency: Consider any state transition s −→` t ofT. We need to showhα(s)≤c(`) +hα(t).
By the definition ofTα, we getα(s)−→` α(t)∈Tα. Hence,α(t) is a successor of α(s) in Tα via the label`.
We get:
hα(s) =h∗Tα(α(s))
≤c(`) +hT∗α(α(t))
=c(`) +hα(t),
where the inequality holds because perfect goal distancesh∗Tα
are consistent inTα.
(The shortest path fromα(s) to the goal in Tα cannot be longer than the shortest path fromα(s) to the goal via α(t).)
Consistency of Abstraction Heuristics (2)
Proof (continued).
Consistency: Consider any state transition s −→` t ofT. We need to showhα(s)≤c(`) +hα(t).
By the definition ofTα, we getα(s)−→` α(t)∈Tα. Hence,α(t) is a successor of α(s) in Tα via the label`.
We get:
hα(s) =h∗Tα(α(s))
≤c(`) +hT∗α(α(t))
=c(`) +hα(t),
where the inequality holds because perfect goal distancesh∗Tα
are consistent inTα.
(The shortest path fromα(s) to the goal in Tα cannot be longer than the shortest path fromα(s) to the goal via α(t).)
Consistency of Abstraction Heuristics (2)
Proof (continued).
Consistency: Consider any state transition s −→` t ofT. We need to showhα(s)≤c(`) +hα(t).
By the definition ofTα, we getα(s)−→` α(t)∈Tα. Hence,α(t) is a successor of α(s) in Tα via the label`.
We get:
hα(s) =h∗Tα(α(s))
≤c(`) +hT∗α(α(t))
=c(`) +hα(t),
where the inequality holds because perfect goal distancesh∗Tα
are consistent inTα.
(The shortest path fromα(s) to the goal in Tα cannot be longer than the shortest path fromα(s) to the goal via α(t).)
Coarsenings and Refinements
Abstractions of Abstractions
Since abstractions map transition systems to transition systems, they arecomposable:
Using a first abstractionα:S →S0, map T toTα.
Using a second abstraction β:S0 →S00, map Tα to (Tα)β. The result isthe same as directly using the abstraction (β◦α):
Let γ :S →S00 be defined asγ(s) = (β◦α)(s) =β(α(s)).
Then Tγ = (Tα)β.
Abstractions of Abstractions: Example (1)
LRR LLL LLR
LRL
ALR
ALL
BLL
BRL
ARL
ARR
BRR
BLR
RRR RRL
RLR
RLL
transition systemT
Abstractions of Abstractions: Example (2)
LRR
LRL LRR
LRL LLL LLRLLR
LLL
ALR
ALL ALR
ALL
ARL
ARR ARL
ARR
BLR BLL BRR
BRL BLL
BLR BRR
BRL
RRR RRLRRL
RRR
RLR
RLLRLL
RLR
Transition systemT0 as an abstraction ofT (ignore tB)
Abstractions of Abstractions: Example (2)
LRR
LRL LRR
LRL LLL LLRLLR
LLL
ALR
ALL ALR
ALL
ARL
ARR ARL
ARR
BRR BLL BLR
BRL
BLL BLR
BRL BRR
RRR RRLRRL
RRR
RLR
RLLRLL
RLR
Transition systemT0 as an abstraction ofT (ignore tB)
Abstractions of Abstractions: Example (3)
LRR LLL LLR
LRL LRR
LLR
LRL LLL
ALR ARL
ALL ARR ALR ARL
ARR ALL
BLL
BRL
BLR
BRR BLL BLR
BRR BRL
RRR RRL
RLR
RLLRLL RRL
RLR RRR
Transition system T00 as an abstraction ofT0 (ignore tA)
Abstractions of Abstractions: Example (3)
LRR LLL LLR
LRL LRR
LLR
LRL LLL
ALR ARL
ALL ARR ALR ARL
ARR ALL
BLL
BRL
BRR
BLR BLL BRR
BLR BRL
RRR RRL
RLR
RLLRLL RRL
RLR RRR
Transition system T00 as an abstraction ofT (ignoretA andtB)
Coarsenings and Refinements
Definition (Coarsening and Refinement)
Letα andγ be abstractions of the same transition system such thatγ =β◦α for some functionβ.
Thenγ is called acoarsening ofα andα is called arefinementof γ.
Heuristic Quality of Refinements
Theorem (Heuristic Quality of Refinements)
Letα andγ be abstractions of the same transition system such thatα is a refinement ofγ.
Then hα dominates hγ.
In other words,hγ(s)≤hα(s)≤h∗(s) for all states s.
Heuristic Quality of Refinements: Proof
Proof.
Sinceα is a refinement ofγ,
there exists a functionβ with γ =β◦α.
For all statess of Π, we get:
hγ(s) =h∗Tγ(γ(s))
=h∗Tγ(β(α(s)))
=hβTα(α(s))
≤h∗Tα(α(s))
=hα(s),
where the inequality holds becausehTβα is an admissible heuristic in the transition systemTα.
Summary
Summary
Abstractionis one of the principled ways of deriving heuristics.
An abstractionis a functionα that maps the states S of a transition system to another (usually smaller) setSα. Thisinduces an abstract transition systemTα, which behaves like the original transition system T except that states
mapped to the same abstract state cannot be distinguished.
Abstractions α induceabstraction heuristics hα: hα(s) is the goal distance of α(s) in the abstract transition system.
Abstraction heuristics are safe,goal-aware,admissible andconsistent.
Abstractions can be composed, leading to coarservs. finer abstractions. Heuristics for finer abstractions dominate those for coarser ones.