Date post: | 27-Mar-2015 |
Category: |
Documents |
Upload: | matthew-parrish |
View: | 216 times |
Download: | 0 times |
Program Termination,and
Well Partial Orderings
Andreas Blass and Yuri Gurevich
2
Full 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 YG’s website
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
5
Ranking functions
A ranking function for is a function f from the states to ordinals that is monotone: ySx fy<fx. The ranking height of f is the smallest ordinal such that there is a ranking function f for with values < .
6
Covering observation
A transitive relation covered by a finitely many well-founded relations is well-founded: if R U1 U2 … Un
and 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.
7
Program 1
if a < 1000 < b then choose between a,b:= a+1, b + 1/2 a,b:= a-1, b - 1
Use the covering observation whereyUx is ax<ay<1000, yVx is 1000<by<bx .
Ranking height of is as 3b-2a > 1000 and decreases at every step.
8
Program 2
if a < 1000 < b then choose between a := a+1 a,b:= any int, b-1
By covering observation, 2 terminates. Ranking height is 2.
9
Program 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?
10
Ordinal 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 < x}
|P| = min {: > |x| for all x}
11
Ranking 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 .
12
Covering 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|?
13
Well partially ordered sets
Df. A sequence x1,x2,... in a poset P is bad if there are no i<j with xi xj. P is well partially 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}.
14
“A frequently rediscovered concept” (Kruskal 1972)
The bad terminology harks back to Cantor’s “well ordered sets”. Some alternatives:Finitely based posets (Higman, apparently the original discover, 1952) Tight posets (think boots, YG 1969)
15
Games (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 can’t move, you lose.
16
Game criterion for height comparison
1 wins (P,Q) ⇔ |P| > |Q|2 wins (P,Q) ⇔ |P| |Q|
here “wins” means “has a winning strategy in”.
17
Stature: 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.
18
Example
Order componentwise.
A sequence (x1,y1),(x2,y2),... without repetitions is bad iff there are no i<j with (xi,yi) < (xj,yj).
BS() is the well-founded forest of nonempty bad sequences
∥∥ = |BS()|
19
Let R and Ui be as in the covering
question, and let i=|Ui|.
Theorem. |R| = ∥1...n∥.
20
Upper bound
Let R and Ui be as in the covering question, and let i=|Ui|.
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).
21
The 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 < yi
22
New question
What is ∥1...n∥?
23
More about the stature
24
Ideals
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
xiDi-Di+1.
25
Antichains
Let ACH(P) be the set of nonempty antichains of a wpo set P ordered thus:AB if b in B a b in A.ACH is well founded.
Pf. The mapping X ↦ P - Filter(X) is a poset isomorphism.
26
Pointed 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) < (E,y) if D E – {y}.PI is well founded.Pf. A descending seq of pointed ideals gives a descending seq of ideals.
27
Equivalent 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}.
28
Linearizations 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.
29
Natural sums and products
2 5 + 3 = 3 < 3 + 2 5The last one is in Cantor’s 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.
33
Program 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.
34
Extra: Linearizations of an arbitrary well partial
ordering
35
Motivation
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?
36
Theorem
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.
37
The most relevant related work
De Jongh and Parikh showed that1. among the lengths of
linearizations of a wpo set P there is always a largest one, and
2. in case P = , the largest length is .