Title: Program Termination, and Well Partial Orderings
1Program Termination,and Well Partial Orderings
Andreas Blass and Yuri Gurevich
2Full version of the paper
- Andreas Blass and Yuri GurevichProgram
Termination, and Well Partial OrderingsTech
report MSR-TR-2006-27, Microsoft Research, March
2006 - 178 at YGs website
3Agenda
- Program termination and the covering question
- Well partial orderings and a game
- Stature ?P? of a wpo set P, and reduction to the
question what ??1?...??n? is - More about the stature
- ??1?...??n? ?1?...??n
- Extra Linearizations of an arbitrary well
partial ordering - Related work
4- A (nondeterministic) program ? terminates ?
the successor relation ySx (y succeeds x)
on (possibly some abstraction of) states is
well founded ? the transitive closure S is well
founded? there is a ranking function for ?
5Ranking functions
- A ranking function for ? is a function f from
the states to ordinals that is monotone ySx ?
fy - The ranking height of f is the smallest ordinal
? such that there is a ranking function f for ?
with values
6Covering observation
- A transitive relation covered by a finitely many
well-founded relations is well-founded if R ? U1
? U2 ? ? Unand U1, U2,, Un are well-founded
and R is transitive then R is well-founded. - Ref Geser, Podelski RybalchenkoWe learned it
from Byron Cook. - S is often over-approximated by a disjunction of
relations.
7Program ?1
- if a a,b a1, b 1/2 a,b a-1, b - 1
- Use the covering observation whereyUx is
ax - Ranking height of is ? as 3b-2a 1000 and
decreases at every step.
8Program ?2
- if a a1 a,b any int, b-1
- By covering observation, ?2 terminates.
- Ranking height is ?2.
9Program ?3
- In each state, some points (a,b,c) of N3 may be
"forbidden initially, none. Once forbidden a
point remains so forever. As long as possible,
chose a free point (a,b,c) and forbid points
(a?,b?,c?) with a?? a b? ? or c? ? c. - By covering observation, ?3 terminates. What is
the ranking height of ?3?
10Ordinal height
- Consider a well founded poset (or digraph) P and
let x, y range over the elements of P. - x min ? ? y for all y
- P min ? ? x for all x
11Ranking height ordinal height
- Suppose that ? terminates and consider the well
founded poset P (states, S). - Ordinal height x is a ranking function, and x
? fx for any ranking function. - Hence P is the ranking height of ?.
12Covering question
- Suppose that U1,..,Un are well founded and R ?
U1 ? ... ? Un is transitive.By covering
observation, R is well founded. How to bound R
in terms of U1,.., Un?
13Well partially ordered sets
- Df. A sequence ?x1,x2,...? in a poset P is bad
if there are no ipartially ordered (wpo) if every bad sequence is
finite. - E.g. ordinals, strings with the (not necessarily
contiguous) substring relation - wpo ? well-founded, but not the other way round
e.g. ? ? ? ? ? ? ??? - If P is wpo then, for every filter F, the set X
Min(F) is finite and F y y ? some x in X.
14A frequently rediscovered concept (Kruskal 1972)
- The bad terminology harks back to Cantors well
ordered sets. Some alternatives - Finitely based posets (Higman, apparently the
original discover, 1952) - Tight posets (think boots, YG 1969)
15Games ?(P,Q)
- P and Q are well-founded posets. Positions of P
are elements of P plus the summit above P. Same
for Q. - Players 1, 2 play at P, Q resp. and move
alternately 1 moves first. - Each player has a pebble, initially at the summit
position. - Move put the pebble to a position lower than the
old. - Win/lose if you cant move, you lose.
16Game criterion for height comparison
- 1 wins ?(P,Q) ? P Q
- 2 wins ?(P,Q) ? P ? Q
- here wins means has a winning strategy in.
17Stature Definition
- Let x, y be bad sequences. y is lower than x
if x is a proper initial segment of y. - Clearly BS(P) is well founded.
- The stature ?P? of a wpo set P is the height
BS(P) of the forest BS(P) of nonempty bad
sequences of P.
18Example
- Order ??? componentwise.
- A sequence ?(x1,y1),(x2,y2),...? without
repetitions is bad iff there are no i(xi,yi) - BS(???) is the well-founded forest of nonempty
bad sequences - ????? BS(???)
19- Let R and Ui be as in the covering question, and
let ?iUi. - Theorem. R ??1?...??n?.
20Upper bound
- Let R and Ui be as in the covering question, and
let ?iUi. - Proposition. R ? ??1?...??n?.
- Suffices to prove 2 wins ?(R,BS)). Strategy
when 1 moves to a point x of the domain D, append
(?1,, ?n) to the existing bad sequence where ?i
is the height of x in the poset (D,Ui).
21The bound is tight
- ??1..?n ?R,U1,..,Un as in the question with
Ui??n and R ??1?...??n?. - R is the lower relation of BS(?1?...??n), and
?...,(x1,..,xn)? Ui ?...,(y1,..,yn)? if xi
22New question
23More about the stature
24Ideals
- IDL(P) is the set of proper ideals of P ordered
by inclusion. - IDL is well founded.
- Pf. A descending sequence ?D1,D2,...? of ideals
gives rise to a bad sequence ?x1,x2,...? where
xi?Di-Di1.
25Antichains
- Let ACH(P) be the set of nonempty antichains of a
wpo set P ordered thusA?B if ?b in B ?a ? b in
A. - ACH is well founded.
- Pf. The mapping X ? P - Filter(X) is a poset
isomorphism.
26Pointed ideals
- A pointed ideal is a pair (D,x) where D is an
ideal and x a max element of D. - PI(P) is the set of pointed ideals of P ordered
thus(D,x) - PI is well founded.
- Pf. A descending seq of pointed ideals gives a
descending seq of ideals.
27Equivalent defs of stature
- Proposition.ACH(P) IDL(P) PI(P) ?P?.
- Pf. 1st equality by isomorphism. The rest by
games. E.g. PI?IDL. When 1 moves to (D,x),
move to D - x.
28Linearizations of wpo set P
- Every linearization A is well ordered and A ?
?P? - Pf. 2 wins ?(A,BS(P)) append the new position to
the current bad sequence.
29Natural sums and products
- ?2 5 ?3 ?3
- The last one is in Cantors normal form.
- Natural sum add as polynomials in ?.
- Natural product multiply as polynomials in ?
using natural sum for the exponents.
30??1?...??n? ?1?...??n
31?1?...??n is small enough
- ?1?...??n ? ??1?...??n?
- Pf. The length of any linearization of ?1?...??n
is ? ??1?...??n?. By induction on ?1?...??n,
construct a linearization of ?1?...??n of
length ?1?...??n.
32?1?...??n is large enough
- ?1?...??n ? ??1?...??n?
- Pf. Induction on ?1?...??n.
33Program ?3, again
- As long as possible, chose a free (a,b,c) in N3
and forbid all (a?,b?,c?) with a?? a b? ? or
c? ? c. - The ranking height is ?3.
- Replace N3 with the direct product of arbitrary
wpo sets.
34Extra Linearizations of an arbitrary well
partial ordering
35Motivation
- Let P be an arbitrary wpo set, and let A range
over linearizations of P. - We know that A ? ?P?.
- In the case P ???, we have an A with A
?P?. - What is the supremum of linearization lengths in
general? - Is the supremum attainable?
36Theorem
- For every wpo set P, there is a linearization A
of P such that A ?P?. - Cor. The supremum of linearization lengths is
?P?. - Cor. The supremum is attainable.
37The most relevant related work
- De Jongh and Parikh showed that
- among the lengths of linearizations of a wpo set
P there is always a largest one, and - in case P ???, the largest length is ???.