A Semantic Characterization of Unbounded-Nondeterministic Abstract State Machines Andreas Glausch...
-
date post
19-Dec-2015 -
Category
Documents
-
view
214 -
download
0
Transcript of A Semantic Characterization of Unbounded-Nondeterministic Abstract State Machines Andreas Glausch...
1
A Semantic Characterization of
Unbounded-Nondeterministic Abstract
State MachinesAndreas Glausch and Wolfgang Reisig
2
SOME REVIEW AND REMINDER ASM is a transition system where each state
is an Algebra. An algebra A consists of a non empty set Ua
(its universe), together with a finitely many functions defined over Ua, 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
?
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 algebra3. preserves the universe of states4. S and J are closed under isomorphism, and preserves
isomorphism5. 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.
A S
J S
4
AXIOM N1
A non-deterministic algorithm N consists of: A set of states SN
A set of initial states A next – state relation
Each pair is a step on N.A run of N is a sequence A0A1A2… of states with
k and for all indices i.
This axiom actually assumes that a non-deterministic can be represented by a transition system.
N NI S N N NS S
N(A,A')
0 NA I i N i 1A A
5
SOME 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 fa
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:
6
AXIOM N2
For a nondeterministic algorithm N, all states in SN are Algebras over the same signature ∑N
7
SOME MORE NOTIONS
The elements of a universe Ua of an algebra A are atomic and foundational objects that cannot be decomposed, destroyed or created.
Only the functions of A are modified.
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:
9
AXIOM N3
For a nondeterministic algorithm N, the following holds: for each step (A,A’) of N, A and A’ have the same universe
10
SOME 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:
11
AXIOM N4
For a nondeterministic algorithm N, the following holds:
(i) SN and JN 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.
NB Si : A B
i : A' B'
12
SOME 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.
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=fA(a).
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.
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
M A
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’)
(A,A') (M E,M' E)
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:
18
AXIOM 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.
k
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.
20
We start by introducing the syntax
and semantics of
nondeterministic ASM rules which
form the syntactical basis of
nondeterministic ASMs introduced
afterwards
21
ASSIGNMENT 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
A: V U
A, At U
22
The general form of an assignment rule is:
f(t1,…,tn):=t’
where t1,…,tn 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.
def 1,A, n,a,a (t ,..., t ) def A,v t'
23
CONDITIONAL 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.
24
PARALLEL RULES
Several condition rules nay be executed simultaneously, which is represented by a parallel rule.
The general form of an assignment rule Par is:par Cond1…Condn endpar
Where Cond1…Condn are conditional rules. Executing Par at a state A and variable assignment will result in a simultaneous execution of the updates performed by Cond1…Condn.
For technical convenience, we assume every conditional Cond as a parallel rule par Cond endpar.
25
CHOICE RULES
Choice rule allow nondeterministic choice of elements of the universe of a state.
The general form of a choice rule is:Choose x1,…,xn with do Par
Where x1,…,xn are variables, is a Boolean formula, and Par is a parallel rule such that and Par contain only variables from {x1,…,xn}.
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 .
27
NONDETERMINISTIC ASMS
In conclusion, ASM M consists of: A signature ∑M
A set of ∑M-algebras SM, closed under isomorphism (the states of M)
A set JM SM, closed under isomorphism (the initial states of M)
A choice rule CHOICE built over the signature ∑M.
28
THE EQUIVALENCE THEOREM
Nondeterministic algorithms and
non-deterministic ASMs describe
the same set of transition
systems.
Now, let’s prove it!
29
PART 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.
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.
31
PART 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.
32
LEMMA 1
Let and let . Then (A,A’) is a completion of (M,M’) iff and .
(M,M') W NA,A' S
M A A' A M'
33
LEMMA 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 UA. Then khkhkhkhkhkhkhkh also is an isomorphism.
i : (Par,A, ) (Par,B,i )
def A,(Par,A, ) A Par
34
LEMMA 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.
CHOICEA A' CHOICEB B' NB B'
35
PROOF OF LEMMA 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 xv.
(M,M') W
AV U
v V
36
Define the Boolean formulas and by:
v wdef v u Vx x
1 n
1 n
u u vdef (f ,[u ,...,u ],v) Mf(x ,...x ) x
37
Construct for each molecule the assignment rule .
Combine all these assignment rules to a single parallel rule Par.
Let v1,…,vn 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.
1 n(f,[u ,...,u ],v) M'1 nu u vf(x ,...,x ) : x
1 mv vx ,...,x
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,
CHOICEA A' v(x ) v v V
A,Par M' CHOICEA A M'
A M' A'
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 UB by a new element not contained in UB.
This construction is well defined. Let i: B C be the corresponding
isomorphism.
CHOICEB B'. NB B'
CHOICEB B'
B' (Par,B, )
v V v(x )
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 .
M C
C,iPar defC' (Par,C,i ) i : B' C'
c,iPar M' (Par,c,i ) C' C M'
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
i : (B C) i : (B' C')
M C
42
LEMMA 4
Let CHOICE1,…CHOICEn be choice rules. Then there exists a single choice rule Union such that
CHOICE is the union of CHOICE1,…CHOICEn.
The proof is by presenting a nested choice rule, when every nested choice rule can be transformed in an un-nested choice rule.
1 nCHOICE CHOICE CHOICE...
43
FINAL 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 NA A'
CHOICEA A'.
The end!