Presentation is loading. Please wait.

Presentation is loading. Please wait.

A Semantic Characterization of Unbounded-Nondeterministic Abstract State Machines Andreas Glausch and Wolfgang Reisig 1.

Similar presentations


Presentation on theme: "A Semantic Characterization of Unbounded-Nondeterministic Abstract State Machines Andreas Glausch and Wolfgang Reisig 1."— Presentation transcript:

1 A Semantic Characterization of Unbounded-Nondeterministic Abstract State Machines Andreas Glausch and Wolfgang Reisig 1

2 S OME R EVIEW AND R EMINDER ASM is a transition system where each state is an Algebra. An algebra A consists of a non empty set U a (its universe), together with a finitely many functions defined over U a, each with a fixed arity. Therefore, each state of an ASM may naturally include any mathematical data structure that can be described in terms of logic (sets, real numbers, uncomputable function, etc.). A class S of ASMs maybe characterized by answering the following question: Which transition system can be represented by the ASMs in S? 2

3 Gurevich Answers this question for the class of sequential ASMs. He defines a class of transition systems which he calls sequential algorithms by the next axioms, and proves this class to be equivalent to sequential ASMs : 1. A sequential algorithm consists of a set of states S, a set of initial states, and a next-state function k :S  S. 2. Each state is an algebra 3. preserves the universe of states 4. S and J are closed under isomorphism, and preserves isomorphism 5. A finite set of ground terms is sufficient to characterize In this presentation we define the class of non- deterministic algorithms by 5 axioms, when the first 4 are basically an extension of Gurevich’s original axioms. 3

4 A XIOM N1 A non-deterministic algorithm N consists of: A set of states S N A set of initial states A next – state relation Each pair is a step on N. A run of N is a sequence A 0 A 1 A 2 … of states with k and for all indices i. This axiom actually assumes that a non-deterministic can be represented by a transition system. 4

5 S OME NOTIONS Algebras are general enough to describe any static mathematical entity A signature ∑ is used to address to the functions of an algebra, it consists of function symbols. An Algebra A is a ∑-algebra if A determines for each n-ary function symbol f, a unique function f a As an algorithm always has a finite syntactical representation, therefore, a single signature is suffice for all states Which leads us to the 2-nd axiom: 5

6 A XIOM N2 For a nondeterministic algorithm N, all states in S N are Algebras over the same signature ∑ N 6

7 S OME MORE NOTIONS The elements of a universe U a of an algebra A are atomic and foundational objects that cannot be decomposed, destroyed or created. Only the functions of A are modified. 7

8 As an example consider the Euclidian algorithm: it computes the greatest common divisor between two integers. The states of the algorithm are built over the universe of integers. The algorithm defines a new relationship between the integers, but non of the computation in this algorithm add or remove integers from its universe. What leads us to: 8

9 A XIOM N3 For a nondeterministic algorithm N, the following holds: for each step (A,A’) of N, A and A’ have the same universe 9

10 S OME MORE NOTIONS As we already seen in previous lectures, Isomorphic algebras only differ I their concrete representation of the universe The functions of both algebras are essentially the same In general, the algorithm does not distinguish isomorphic states This insight is formalized by: 10

11 A XIOM N4 For a nondeterministic algorithm N, the following holds: (i) S N and J N are closed under isomorphism (ii) Let (A,A’) be a step of N and let with an isomorphism. Then there is a step (B,B’) of N such that is an isomorphism. 11

12 S OME ADDITIONAL NOTIONS Every real-world processor we know, such as a computer, a human being, performs only bounded time of work each step. It is quite natural then, to require an algorithm to limit the amount of work to be done in each step. 12

13 As we already seen, for a step (A,A’), A and A’ only differ in their function values For convenience, in order to represent such differences formally, we will now consider a state A as a set of location-value-triples. A location consists of n-ary function symbol f, and n-ary argument tuple a. Each location (f,a) of A defines a unique value v=f A (a). 13

14 A triple (f,a,v) represents a small component of A which we call a molecule of A. A state is completely described by a set of molecules. 14

15 In order to formalize the idea of “performing bounded work in each step”, we should only allow a bounded part of A to contribute to each step. We call each a subset of A A substep changes a substate M by updating the values of the molecules in M 15

16 In order to capture the “amount of work” performed by a step of N: Each step (A,A’) is decomposed into a substep (M,M’) and a substate E such that: In this case, the substep (M,M’) describes the actual work performed by the step We call (A,A’) a completion of (M,M’) 16

17 A “bounded amount of work then is captured by a substep bounded in size: for a natural number k, a substep (M,M’) is k- bounded iff |M|< k We are now able to formulate the final axiom stating that the steps of a nondeterministic algorithm performs only bounded substeps: 17

18 A XIOM N5 For a nondeterministic algorithm N there exists a constant and a set W of k- bounded substeps such that for all states A,A’ of N, the following holds: (A,A’) is a step of N iff (A,A’) is an completion of a substep in W We call W a bounded-work witness of N. 18

19 From now on, we call any entity satisfying the Axioms N1-N5 a nondeterministic algorithm. This raises the question, is there a language expressive enough to describe any nondeterministic algorithm? In the following we answer this question positively by presenting to you the nondeterministic ASMs. 19

20 We start by introducing the syntax and semantics of nondeterministic ASM rules which form the syntactical basis of nondeterministic ASMs introduced afterwards 20

21 A SSIGNMENT RULES ∑-terms are constructed inductively from a signature ∑ and a set of variables V Given a ∑-algebra A and a variable assignment, each ∑-term t is evaluated to a unique value Terms are used to form assignment rules which update a single function value of an algebra 21

22 The general form of an assignment rule is: f(t 1,…,t n ):=t’ where t 1,…,t n and t’ are ∑-terms, and f is n-ary function symbol of ∑. Applied at a state A and variable assignment kj, the rule updates the value of the function symbol at f at the argument jkjkjk by the value ASM may update a few locations each time, that is represented by an update set. 22

23 C ONDITIONAL RULES The general form of a conditional rule is: if then ASSIGN Where is a Boolean formula and ASSIGN is an assignment rule. ASSIGN is executed if the condition is satisfied by A and, otherwise the state stays untouched. For technical convenience, we assume every assignment rule has a special conditional rule whose condition holds in every state. 23

24 P ARALLEL R ULES Several condition rules nay be executed simultaneously, which is represented by a parallel rule. The general form of an assignment rule Par is: par Cond 1 …Cond n endpar Where Cond 1 …Cond n are conditional rules. Executing Par at a state A and variable assignment will result in a simultaneous execution of the updates performed by Cond 1 …Cond n. For technical convenience, we assume every conditional Cond as a parallel rule par Cond endpar. 24

25 C HOICE R ULES Choice rule allow nondeterministic choice of elements of the universe of a state. The general form of a choice rule is: Choose x 1,…,x n with do Par Where x 1,…,x n are variables, is a Boolean formula, and Par is a parallel rule such that and Par contain only variables from {x 1,…,x n }. 25

26 First, for a given state A, the choice rule chooses nondeterministically a variable assignment, such that is satisfied by A and. Then Par is executed by use of the variable assignment. 26

27 N ONDETERMINISTIC ASM S In conclusion, ASM M consists of: A signature ∑ M A set of ∑ M -algebras S M, closed under isomorphism (the states of M) A set J M S M, closed under isomorphism (the initial states of M) A choice rule CHOICE built over the signature ∑ M. 27

28 T HE E QUIVALENCE T HEOREM Nondeterministic algorithms and non- deterministic ASMs describe the same set of transition systems. 28 Now, let’s prove it!

29 P ART 1 OF THE PROOF We need to show that every nondeterministic ASM represents a nondeterministic algorithm. Let M be a nondeterministic ASM with CHOICE its choice rule. All we need to do is to verify that M satisfies the axioms N1-N5. 29

30 Axioms N1 and N2 are satisfied by the definition of nondeterministic ASMs. Axioms N3 and N4 are properties of the semantics of CHOICE that are easily verified. Axiom N5 holds due to the fact that in each step (A,A’)of M, CHOICE access and modifies only a bounded subset of A. 30

31 P ART 2 OF THE PROOF We need to show that every nondeterministic algorithm can be represented by a nondeterministic ASM. Let N be a nondeterministic algorithm. Let W be a bounded work witness for N. 31

32 L EMMA 1 Let and let. Then (A,A’) is a completion of (M,M’) iff and. 32

33 L EMMA 2 Let denote the next state computed by Par at state A and variable assignment. Let Par be a parallel rule over a signature ∑, let A,B be a ∑-algebras with an isomorphism i: A  B, and let be a variable assignment with values in U A. Then khkhkhkhkhkhkhkh also is an isomorphism. 33

34 L EMMA 3 Let (A,A’) be a step of N. Then there is a choice rule CHOICE such that and implies for all states B,B’ of N. 34

35 P ROOF OF L EMMA 3 By axiom N5, there exists a subset such that (A,A’) is a completion of (M,M’). Let denote the elements of the universe of A occurring in M and M’. As the size of M is bounded, V is finite. For each element, choose a unique variable x v. 35

36 Define the Boolean formulas and by: 36

37 Construct for each molecule the assignment rule. Combine all these assignment rules to a single parallel rule Par. Let v 1,…,v n be the elements in V. Define CHOICE as: choose with do Par According to axiom N5, the size of M and M’ is bounded by a constant k. Consequently, the size of CHOICE also is bounded by a constant c. 37

38 We first show that : Let be the variable assignment defined by for all. Then and are satisfied by A and. Further, by construction of Par, we have kjkjkjkjkjk. There fore,, by Lemma 1, 38

39 Finally, let B,B’ be states of N such that hlhlhlhlhlhlhlh We need to show that As, there is a variable assignment such that and are satisfied at B and, and. Construct from B an isomorphic state C: for each, replace the element by v, and replace every other element in U B by a new element not contained in U B. This construction is well defined. Let i: B  C be the corresponding isomorphism. 39

40 As is satisfied by B and, one can show that. By construction of Par, we have = M’. Let. By lemma 2, is an isomorphism. As B,B’ are states of N, Axiom N4 implies that C,C’ also are states of N. As and by definition of we conclude. 40

41 As, lemma 1 implies that (C,C’) is a completion of (M,M’). By axiom N5, (C,C’) is a step of N. As, and are isomorphisms, Axiom N5 implies that (B,B’) also is a step of N 41

42 L EMMA 4 Let CHOICE 1,…CHOICE n be choice rules. Then there exists a single choice rule Union such that CHOICE is the union of CHOICE 1,…CHOICE n. The proof is by presenting a nested choice rule, when every nested choice rule can be transformed in an un-nested choice rule. 42

43 F INAL PROOF OF THE THEOREM For all steps (A,A’), derive a choice rule CHOICE (A,A’) by applying Lemma 3. Let S be the set of all these choice rules By lemma 4, let CHOICE be the union of all choice rules. Then for all states A,A’ of N, we have iff 43 The end!


Download ppt "A Semantic Characterization of Unbounded-Nondeterministic Abstract State Machines Andreas Glausch and Wolfgang Reisig 1."

Similar presentations


Ads by Google