INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG,...

58
INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN
  • date post

    19-Dec-2015
  • Category

    Documents

  • view

    219
  • download

    2

Transcript of INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG,...

Page 1: INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN.

INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION

ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN

Page 2: INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN.

In earlier work, the Abstract State Machine Thesis — that arbitrary algorithms are behaviorally equivalent to abstract state machines —was established for several classes of algorithms, including ordinary, interactive, small-step algorithms.

Page 3: INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN.

(1) Describe axiomatically a class A of algorithms.

(2) Define behavioral equivalence of A algorithms.

(3) Define a class M of abstract state machines.

(4) Prove the following characterization theorem for A: M A, and every A A is behaviorally equivalent to some M M.

How?

(1) Describe axiomatically a class A of algorithms.

(2) Define behavioral equivalence of A algorithms.

(3) Define a class M of abstract state machines.

(4) Prove the following characterization theorem for A: M A, and every A A is behaviorally equivalent to some M M.

Page 4: INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN.

This means that the algorithms:

(1) Can complete a step without necessarily waiting for replies to all queries from that step.

(2) Can use not only the environment’s replies but also the order in which the replies were received.

Not necessarily ordinary

Page 5: INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN.

Motivation

:מלך הטריוויה

בכל שלב ישאל המנחה את המתחרים שאלה.

המתחרה הראשון שיענה נכונה יזכה בסוכריה.באם נענתה תשובה נכונה או במידה וטעו

כל המתחרים, יעבור המנחה לשאלה הבאה.

Page 6: INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN.

? כמה ימים נמשכה מלחמת ששת-הימיםשאלה:

טל גבי עומר אירנה פבל יורי

2 6 3 6 20 4

? מי יזכה בסוכריהבעיה:

Page 7: INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN.

? כמה ימים נמשכה מלחמת ששת-הימיםשאלה:

4יורי: 20פבל:

6אירנה: 3עומר:

6גבי:

..........................חושבת .....................................טל: חושבת............חושבת......................................................................................חושבת ........................................חושבת..............................................

Page 8: INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN.

.........................................................................חושבת....................................................................................................................................................................

.........חושבת......................................................................................................................................................................................................................................................................................................................

..................חושבת...........................................................................................................................................................................................................................

.....................................................חושבת..........................................................................................................................................................................................................................................................................

Page 9: INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN.

..........................חושבת ..................................

............חושבת.........................................................................2.

...לשאלה הבאה

Page 10: INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN.

? כמה ימים נמשכה מלחמת ששת-הימיםשאלה:

4יורי: 20פבל:

6אירנה:

...לשאלה הבאה

Page 11: INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN.

AXIOMATIZATION

(1) States

(2) Interaction

(3) Step

(4) Isomorphism

(5) Bounded Work

Page 12: INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN.

(1) States

States Postulate:

The algorithm determines:

• A finite vocabulary

• A nonempty set S of states which are all -structures

• A nonempty subset I S of initial states

• A finite set of labels (to be used in forming queries).

Definition: A potential query in state X is a finite tuple of elements of X . A potential reply in X is an element of X.

â

Page 13: INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN.

(2) Interaction

Definition: An answer function for a state X is a partial map from potential queries to potential replies.

Definition: A history for X is a pair E= <e’, e> consisting of an answer function e’ together with a linear pre-order e of its domain.

The domain ,Dom(e’), of the answer function component, is also the field of the pre-order component(the queries).

Page 14: INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN.

(a,1), (b,2), (c,3), (d,4), (g,5) (f,6)

e’(a)=1e’(b)=2 Dom(e’)={a,b,c,d,f,g)e’(c)=3 …

b <e [d =e a] <e c <e g <e f

(2) Interaction

Page 15: INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN.

(2) Interaction

We use histories to express the information received by the algorithm from its environment during a step.

Page 16: INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN.

(2) Interaction

If the environment can provide, as part of its replies, time stamps that tell when the answers were sent . If so, could we use only the answer function to get information from the environment ?

And what if the environment can provide, as part of its replies, time stamps that tell when the algorithm becomes aware of the replies ?

Page 17: INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN.

Remark: We emphasize that the timing we are concerned with here is logical time, not physical time. That is, it is measured by the progress of the computation, not by an external clock.

(2) Interaction

We regard a query as being issued by the algorithm as soon as the information causing that query is available.

Page 18: INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN.

(2) Interaction

One Executor Principle

A small-step algorithm is executed by a single, sequential entity.

Even if there are (boundedly many) sub processes running in parallel, they all operate under the control of a single, master executor.

Page 19: INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN.

Holistic Principle

The environment can send replies only to the executor of the algorithm, not directly to parts of it.

Similarly it receives queries only from the algorithm, not from parts of it.

(2) Interaction

Page 20: INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN.

We picture the execution of one step of an algorithm as follows:

1. The algorithm (its executor) computes as much as it can, with only the information provided by the current state(and initial queries), then pauses until it is “awakened” by the environment.

2. Compute as much as it can using the state and the new information from the environment, then pauses until the environment has provided some more replies (possibly to queries from phase 2 or to previously unanswered queries from phase 1).

3. This pattern continues until the algorithm determines that it is ready to complete the current step.

(2) Interaction

Page 21: INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN.

(2) Interaction

Definition: Let be a pre-order of a set D. An initial segment of D with respect to is a subset S of D such that whenever x y and yS then xS.

An initial segment of a history <e’, e> is a history <e’ s, e s> where S is an initial segment of Dom(e’) with respect to e.

We write H E to mean that the history H is an initial segment of the history E.

Page 22: INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN.

(2) Interaction

E= (a,1), (b,2), (c,3), (d,4), (g,5) (f,6) Dom(e’)={a,b,c,d,f,g)

b <e [d =e a] <e c <e g <e f

H E

Page 23: INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN.

(2) Interaction

Remark: If two histories e1 and e2 are initial segments of the same E, then one of e1 and e2 is an initial segment of the other.

Intuitively, if E is the history of an algorithm’s interaction with the environment up to a certain phase, then a proper initial segment of this history describes the interaction up to some earlier phase.

Page 24: INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN.

Definition: If pre-orders the set D and if qD, then we define two associated initial segments as follows.

( q) = {dD : d q} a < b < f < [q,d] < j < k

(< q) = {dD : d < q}. a < b < f < [q,d] < j < k

(2) Interaction

Page 25: INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN.

(2) Interaction

Interaction Postulate

For each state X, the algorithm determines a binary relation X, called the causality relation, between finite histories and potential queries.

The intended meaning of E X q is that, if the algorithm’s current state is X and the history of its interaction so far is E, then it will issue the query q unless it has already done so.

Page 26: INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN.

Definition: For any state X and history E, we define sets of queries

IssuedX(E) = {q : ( E) H X q}

PendingX(E) = IssuedX(E) − Dom(e’).

Thus, IssuedX(E) is the set of queries that have been issued by the algorithm, in state X, by the time the history is E.

and PendingX(E) is the subset of those that have, as yet, no replies.

(2) Interaction

H

Page 27: INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN.

(2) Interaction

Whenever we are given a description of the conditions under which various queries are to be issued, we can similarly convert it into a causality relation. Each of the conditions would be replaced by the set of finite histories that satisfy the condition.

Page 28: INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN.

For example, it might say “if the query p has received the reply a but p’ has no reply yet, then issue q”.

This description would correspond to a large set of instances of the causality relation, namely one instance for every history that fits the description,

i.e., such that E’(p) = a and p’ ! Dom(e’).

(2) Interaction

Page 29: INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN.

(2) Interaction

Notice that there is no guarantee that Dom(e’) IssuedX(E),

In general, a history as defined earlier may contain answers for queries that it and its initial segments don’t cause.

Page 30: INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN.

(2) Interaction

Definition: A history E is coherent, with respect to a state X or its associated causality relation, if:

(1) ( qDom(e’)) qIssuedX( E (< q)).

(2) The linear order induced by e is a well order.(why?)

It follows immediately from the definitions that any initial segment of a coherent history is coherent.

Page 31: INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN.

Definition: A history E for a state X is complete if PendingX(E)= .

(2) Interaction

If a complete history has arisen in the course of a computation, then there will be no further interaction with the environment during this step.

Page 32: INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN.

(3) Step

Because our algorithms are not required to be ordinary, they may finish a step without reaching a complete history. The following postulate says that they must finish the step when they reach a complete history, if they have not already done so earlier.

Page 33: INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN.

(3) Step

Step Postulate — Part A

The algorithm determines, for each state X, a set FX of final histories.

Every complete, coherent history has an initial segment (possibly the whole history) in FX.

Intuitively, a history is final for X if, whenever it arises in the course of a computation in X, the algorithm completes its step, either by failing or by executing its updates and proceeding to the next step.

Page 34: INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN.

Definition:

A history for a state X is attainable (in X) if it is coherent and no proper initial segment of it is final.

Since initial segments of coherent histories are coherent, it follows that initial segments of attainable histories are attainable.

(3) Step

Page 35: INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN.

(3) Step

Step Postulate — Part B

For each state X, the algorithm determines that certain histories succeed and others fail. Every final, attainable history either succeeds or fails but not both.

Definition: We write Fx+ for the set of successful final histories and Fx- for the set of failing final histories.

Page 36: INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN.

(3) Step

Step Postulate — Part C

For each attainable history EFx+ for a state X, the algorithm determines an update set +(X,E), whose elements are updates for X. It also produces a next state (X,E), which

• Has the same base set as X.

• Has f (X,E)(a) = b if <f, a, b> +(X,E).

• Otherwise interprets function symbols as in X.

Page 37: INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN.

(3) Step

:מלך הטריוויה

: qi שאילתות 6ההיסטוריה הריקה גורמת ל-

.היסטוריה חלקית שרק התשובה האחרונה בה נכונה.1.היסטוריה שלמה שבה המשיב השני ענה נכונה.2.היסטוריה שלמה שבה כולם טעו.3

Page 38: INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN.

(3) Step

מה אם היסטוריה שבה הראשון והשני ענו נכונה בו זמנית?

ניתן להגדיר באלגוריתם סדר עדיפויות לנשאלים.. 1

כלומר לבצע שאילתה להחליט בצורה אי-דטרמיניסטית,. 2( בין העונים נכונה.choice נוספת שהיא שאילתת בחירה)

Page 39: INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN.

(3) Step

מה אם היסטוריה שבה אין אף תשובה?או שיש רק חלק מהתשובת אבל הן שגויות?

נחכה, אולי לנצח )הסטוריה לא מסיימת(.. 1

להגדיר זמן שאחריו נפסיק לחכות בעזרת שאילתה נוספת. 2 שבה הסביבה תודיע לנו שהזמן יעבור )מסיימת ומצליחה(.

אולם גם כאן יכול להיות שלשאילתה זאת לא תיהיה תשובה.

Page 40: INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN.

(4) Isomorphism

Isomorphism Postulate

Suppose X is a state and i : X Y is an isomorphism of -structures. Then:

• Y is a state, initial if X is.

• i preserves causality, that is, if E X q then i(E) Y i(q).

• i preserves finality, success, and failure, that is, i(Fx+) = Fy+ and i(Fx-) = Fy-.

• i preserves updates, that is, i( +(X,E)) = +(Y, i(E)) for all histories E for X.

Page 41: INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN.

(5) Bounded Work

The final postulate formalizes the requirement that a small-step algorithm can do only a bounded amount of work in one step. The bound depends only on the algorithm. Work includes assembling queries and issuing them, computing what queries to issue, deciding whether the current history suffices to finish the step, deciding whether the computation has failed, and computing updates.

Page 42: INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN.

(5) Bounded Work

Bounded Work Postulate

(1) There is a bound, depending only on the algorithm, for the lengths of the tuples in IssuedX(E), for all states X and final, attainable histories .

(2) There is a bound, depending only on the algorithm, for the cardinality |IssuedX(E)|, for all states X and final, attainable histories.

Page 43: INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN.

(3) There is a finite set W of -terms, called “witness”, with the following property. Suppose X and X’ are two states and E is a history for both of them. Suppose further that each term in W has the same value in X as in X’ when the variables are given the same values in Range(e’).

Then: – If E X q then E X’ q.

– If E is in FX+ or FX-, then it is also in FX’+ or FX’-, respectively.

– +(X,E) = +(X’,E).

(5) Bounded Work

Page 44: INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN.

(5) Bounded Work

The first two parts of the Bounded Work Postulate assert bounds only for final, attainable histories. They imply the corresponding bounds for all attainable histories, by the following lemmas:

1. Any coherent history for X is an initial segment of a complete, coherent history for X.

2. Any attainable history for X is an initial segment of a final, attainable history for X.

Page 45: INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN.

(5) Bounded WorkProof(lemma 1):

• Let E be a coherent history.

• We shall inductively define a sequence of coherent histories En.

•E0=E.

•En En+1

•If En is complete, then stop.

•If En is incomplete, this means that the set Dn=Pending(n) is nonempty. Extend the answer function e’n by adjoining Dn to its domain and assigning it arbitrary values (in X) there.

Page 46: INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN.

•Call the resulting answer function e’n+1, and make it into a history En+1.

• We extend the ordering of Dom(e’n) by adding Dn at the end, as a single equivalence class.

•Obviously each En is a coherent history.

•After En is defined, if it is complete, then stop.

• If n is defined for all natural numbers n.

• Let H be the union of all the En’s. Then H is also coherent. Indeed, if qDom(h’) then there is some n such that qDom(e’n) => qIssued(En (< q)).

(5) Bounded Work

Page 47: INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN.

(5) Bounded Work• En is an initial segment of the next, and therefore

of H. => En (< q) = H (< q) => qIssued(H (< q)).

•The order-type of H is const+|N|, so it is well-ordered.

•To finish the proof of the first part of the lemma, we need only check that H is complete.

•Suppose, toward a contradiction, that qPending(H).

•=> there is an initial segment P of H such that P q. By the Interaction Postulate, P is finite, so it is an initial segment of En for some n. Then qIssued(En) Dom(e’n+1) Dom(h’).

Page 48: INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN.

(5) Bounded WorkProof(lemma 2):

•Let E be an attainable history => E is coherent.

•By the first lemma, it is an initial segment of a complete, coherent history H.

• By Part A of the Step Postulate, H has a shortest initial segment P that is a final history. thus no proper initial segment of P is final.

•P is coherent, because it is an initial segment of the coherent history .

•Since both E and P are initial segments of H, one of them is an initial segment of the other. Since E is attainable and P is final,E is an initial segment of P.

Page 49: INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN.

(5) Bounded Work

There is a bound, depending only on the algorithm, for the lengths of the tuples in IssuedX(E) for all states X and all attainable histories .

Proof: The bound on lengths of queries issued by final, attainable histories, given by the Bounded Work Postulate, applies to all attainable histories, because these are, by the lemma, initial segments of final ones.

Page 50: INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN.

(5) Bounded WorkThere is a bound, depending only on the

algorithm, for |IssuedX(E)|, for all states X and attainable histories E. The same number also bounds |Dom(e’)| for all attainable E.

Proof: By the lemma, any attainable history E is an initial segment of a final, attainable history H. Then IssuedX(E) IssuedX(H). E being attainable, is coherent, which implies Dom(e’) IssuedX(E).

Page 51: INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN.

Definition:

An interactive, small-step algorithm is any entity satisfying the States,Interaction, Step, Isomorphism, and Bounded Work Postulates.

Page 52: INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN.

Equivalence of Algorithms

We want to define that algorithms are equivalent if they agree on those histories that can actually occur.

When we define equivalence of two algorithms, which one’s attainability should we use?Tow options: (1) Require the algorithms to agree on those histories that are attainable for both algorithms (2) Require agreement on all histories that are attainable under at least one of the algorithms.

Page 53: INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN.

Equivalence of AlgorithmsDefinition1: Two algorithms are behaviorally

equivalent if:

• They have the same states (therefore the same vocabulary), the same initial states, and the same labels.

• In each state, they have the same attainable histories.

• For each state X and each attainable history , they have the same set IssuedX(E).

• For each state, the two algorithms have the same attainable histories in Fx+ and Fx-.

• For each state and each attainable, final, successful history, they have the same update sets.

Page 54: INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN.

But we can also define:Definition2: Two algorithms are behaviorally

equivalent if:

• They have the same states (therefore the same vocabulary), the same initial states, and the same labels.

• For each state X and each history that is attainable for both algorithms, they have the same set IssuedX(E).

• For each state, any history that is attainable in both algorithms and is in Fx+ or Fx- for one of the algorithms is also in Fx+ or Fx-, respectively, for the other.

• For each state and each history that is attainable for both and final and successful, they have the same update sets.

Page 55: INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN.

Equivalence of AlgorithmsLemma: Definition1 and Definition2 are Equivalence

Proof: If they have the same attainable histories so Definition1 Definition2.• Let A1 and A2 be two algorithms satisfying the hypotheses of def2. • Any attainable history has finite domain and therefore has finite length.

• We perform induction on the length of histories.

• Empty history is “coherent” and “attainable”.

• Let E be a nonempty history that is attainable for A1.

Page 56: INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN.

Equivalence of Algorithms• Let the last equivalence class in Dom(e’) be L and

let H be the initial segment of E obtained by deleting L from the domain. => H is attainable for A1 (because E is) and therefore also for A2 (by induction hypothesis).

• The linear order of the equivalence classes of E, being finite, is well-ordering.

•To complete the proof that E is attainable for A2, it suffices to verify that it satisfies, with respect to A2, the first clause in the definition of coherence (that every qDom(e’) is caused by an initial segment that ends before q) and that no proper initial segment of it is final.

Page 57: INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN.

Equivalence of Algorithms• Case1: qDom(h’) (true from the induction

hypothesis).

• Case2: q!Dom(h’) => qL and qIssuedA1(H) (because E is coherent for A1).

• H is attainable for both algorithms, the second hypothesis of def2 applies, and we conclude that q IssuedA2(H), as required.

•For the second goal, none of H proper initial segments can be final.

• Since H is not final for A1 (because E is attainable for A1) and since H is attainable for both algorithms, the third hypothesis of the lemma immediately gives the required conclusion.

Page 58: INTERACTIVE SMALL-STEP ALGORITHMS I: AXIOMATIZATION ANDREAS BLASS, YURI GUREVICH, DEAN ROSENZWEIG, AND BENJAMIN ROSSMAN.

Questions?