CS4455 - Working with System Dynamics Maribeth Gandy Jeff Wilson.
Background, Reserve & Gandy Machines
description
Transcript of Background, Reserve & Gandy Machines
![Page 1: Background, Reserve & Gandy Machines](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816252550346895dd29bae/html5/thumbnails/1.jpg)
Background, Reserve & Gandy
MachinesAndres Blass & Yuri Gurevich
![Page 2: Background, Reserve & Gandy Machines](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816252550346895dd29bae/html5/thumbnails/2.jpg)
The ReserveAn ASM requires a Reserve of
elements that can be imported into the set of currently used elements
In previous talks this was defined as a “naked set” – a set with no structure on it
In application it is convinient to define structure ahead of time and we will focus on this in this talk
![Page 3: Background, Reserve & Gandy Machines](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816252550346895dd29bae/html5/thumbnails/3.jpg)
Introduction2 ways for an algorithm to increase
it’s working space:◦The space was there all along and just
wasn’t used◦A genuinely new space is created
Example:In a Turing machine:
◦First view: it has infinite tape◦Second view: tape is finite but it’s size
can be increased at any time
![Page 4: Background, Reserve & Gandy Machines](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816252550346895dd29bae/html5/thumbnails/4.jpg)
In ASMsWe adopt the first view for an infinite
ReserveReserve elements as input to functions
(except equality) result in default values. No reserve elements are outputed
It is often desirable to define a structure on the reserve- This way when a new element is imported, sets that involve it already exist and there’s no need to define є on it
![Page 5: Background, Reserve & Gandy Machines](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816252550346895dd29bae/html5/thumbnails/5.jpg)
Introducing Backgrond class of structuresExists above the set of Atoms
without imposing structure on them
Specifies the constructions (like finite sets) available for the algo
Importing from the Reserve:◦Non- deterministically using
Inessential non- determinism◦Using Gandy- style determinism
What is the Relationship between
these two methods?
![Page 6: Background, Reserve & Gandy Machines](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816252550346895dd29bae/html5/thumbnails/6.jpg)
StructuresSyntaxFirst order logic structure
includes:◦vocabulary: finite collection of
function names, can be marked static
◦=, TRUE, FALSE, undef, Boole(), operators
◦Terms- defined by induction, choosing the Nullary functions for the base case
![Page 7: Background, Reserve & Gandy Machines](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816252550346895dd29bae/html5/thumbnails/7.jpg)
StructuresSemantics (meaning)A structure X for a vocabulary γ:
◦Non- empty set S: the base set of X◦ Interpretations of function names in S◦Nullary functions identified with its value,
true ≠ false◦A j-ary function f:◦Domain and range defined to be all
elements different from undef◦Val(t,X) = Val(t’,X) implies that the
interpretations of t and t’ in X are equal
SS j
![Page 8: Background, Reserve & Gandy Machines](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816252550346895dd29bae/html5/thumbnails/8.jpg)
Sequential time & AS postulatesFor an algorithm A we define:A set S(A)- states of AA set I(A) of S(A)- initial states of A
◦ For deterministic: a map called the one- step transformation
◦ For non- deterministic: a map - all possible transforms
States of A are first order structuresAll states share the same vocabularyIf then they share the same base set
and the basic functionsThe map works identically under isom.Conclusion: Symmetry preservation: Every
automrphism of X is autom. of
)()(:A ASAS
)()( ASASA
AXX )',(
A)(XA
![Page 9: Background, Reserve & Gandy Machines](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816252550346895dd29bae/html5/thumbnails/9.jpg)
Hereditarily Finite SetsDefenitions: a set X is transitive if it contains all elements of it’s elements TC(x) is the least transitive set containing x A set x is hereditarily finite if TC(x) is finite Elements of x which are not sets are called atoms The collection of atoms in TC(x) is called the atomic support
of x or Sup(x) Let U be a set of atoms, then HF(U) or the hereditarily finite
sets over U is the collection of all HF sets x such that Sup(x) is in U. Those are all the HF sets which contain atoms only from U
Corollary: For a family of subsets of U we have:
Proof: A set x belongs to the intersection if Sup(x) is in for all i, which is the same as saying that □
iUi
ii
i UHFUHF )()(
iUi
iUxSup )(
![Page 10: Background, Reserve & Gandy Machines](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816252550346895dd29bae/html5/thumbnails/10.jpg)
Background ClassesDefinitions:The predicate Atomic() and the logical
symbols are called obligatoryX is explictly atom- generated if the
smallest sub- structure of X that includes all atoms is X itself
For 2 structures X, Y of the same vocabulary X≤Y means that X is a sub- structure of Y
If X also has property K we say that X is a K- substructure of Y
![Page 11: Background, Reserve & Gandy Machines](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816252550346895dd29bae/html5/thumbnails/11.jpg)
Background ClassesK is a background class if (def. 4.1):BC0 K is closed under isomorphismBC1 For every set U, there’s a
structure XєK with Atoms(X)=UBC2 For all X,Y єK and for every
embedding of sets there’s a unique embedding of structures that extends
BC3 For all XєK and every xєBase(X) there is a smallest K-substructure of X that contains x
)()(: YAtomsXAtoms
YX :
![Page 12: Background, Reserve & Gandy Machines](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816252550346895dd29bae/html5/thumbnails/12.jpg)
The EnvelopeK is a background class, XєK, S is in
Base(X). Let F be the set of substructures Y≤X such that Y belongs to K and Includes S. The smallest member of F, if exists, is called the envelope of S in X and Atoms(Y) is the support of S in X
i.e., the smallest background sub- structure of X containing xєX is
By BC3, every singleton subset has an envelope
Definition: a background class K is finitary if in every background structure the support of every sigleton set is finite
)(SEX)(SSupX
)( xEX
![Page 13: Background, Reserve & Gandy Machines](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816252550346895dd29bae/html5/thumbnails/13.jpg)
AnalysisLemma 4.4: In BC2, if ζ is onto then so is ηProof:
Lemma 4.5: Suppose Z is a background structure, X,Y are background substructures of Z, U=Atoms(X), V=Atoms(Y). Then:1. If then the identity on X is the unique
embedding of X into Y that is the identity on Y2. If then X<Y (X sub-structure of Y)
Proof: 1 follows from a similar uniqueness argument. Since the identity is an embedding, 2 follows.
VU
VU
onto identity is uniqunessBy . toextends (identity) X.Y: toextends 11
![Page 14: Background, Reserve & Gandy Machines](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816252550346895dd29bae/html5/thumbnails/14.jpg)
AnalysisLemma 4.6: In a background structure X,
every set U of atoms has an envelope◦ Proof: By BC1, exists Y, Atoms(Y)=U◦ The identity on U extends to◦ By BC0 Z is a background structure◦ By Lemma 4.5 it includes every other that
includes U, thus it is the smallest-> envelope
Corollary: has an envelope for every atom a. This is weaker than BC3, which requires that every singleton subset has an envelope
a
Does BC3 follow from BC0- BC2, and therefore can be dropped?
)(,: YZXY
![Page 15: Background, Reserve & Gandy Machines](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816252550346895dd29bae/html5/thumbnails/15.jpg)
Counter exampleLet K be the class of structures X
satisfying the following:◦TRUE, FALSE and UNDEF are distinct◦ If Atoms(X) is non- empty then X contains
no non- logic elements◦Otherwise there’s exactly one non- logic
element and the atomsK satisfies BC0- BC2 but if there’s
more than 1 atom and x is the unique non- logic non- atomic element then {x} doesn’t have an envelope
![Page 16: Background, Reserve & Gandy Machines](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816252550346895dd29bae/html5/thumbnails/16.jpg)
Alternative requirementsAlternative requirements for BC3: Lemma 4.8(BC3’): In a background structure
X, every has an envelopeProof: Define . By 4.6, U has
an envelope. This is also S’s envelope.Lemma 4.9(BC3’’): For all XєK, the
intersection of any family of K-substructures of X is a K-substructure of X
Proof: For a family F, we show that , U being the intersection of all atoms in F
)(XBaseS
}:})({{ SxxSupU
)(UEF
![Page 17: Background, Reserve & Gandy Machines](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816252550346895dd29bae/html5/thumbnails/17.jpg)
Alternative requirementsCorollary: For all i, let ,
then Lemma 4.11: In defenition 4.1, BC3
can be replaced with BC3’’Proof: Assume BC3’’ and let XєK,
xєX.◦Let F be the collection of substructures
Y of X that contain x◦By BC3’’ , which is clearly the
smallest K-substructure with x
)(XAtomsU i
)()( i
ii
i UEUE
)(UEF
![Page 18: Background, Reserve & Gandy Machines](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816252550346895dd29bae/html5/thumbnails/18.jpg)
AND NOW FOR SOME EXAMPLES
![Page 19: Background, Reserve & Gandy Machines](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816252550346895dd29bae/html5/thumbnails/19.jpg)
Set background (SB)The non-logic part: the hereditarily
finite sets over the atoms UNon- obligatory basic function: єOther optional vocabulary elements:1. , Singleton(x)={x}, BinaryUnion(x,y)2. , Pair(x,y), UnaryUnion(X)- union of
elements in x, TheUnique(X)- if X is singelton return it’s value
Both are explictly atom- generated
Can you spot the error in this example??
![Page 20: Background, Reserve & Gandy Machines](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816252550346895dd29bae/html5/thumbnails/20.jpg)
Set background refinedIn the previous basic definition,
the uniqueness requirement fails:◦Consider X and Y HF sets over {1,2}
and {1,2,3} repectively◦Consider the identity ◦It can be extended naturally by
sending each set to itself◦But it can also be extended in many
other ways, for example send to {3}If we add the optional elements the
problem doesn’t occur because of the additional constraints
}3,2,1{}2,1{:
![Page 21: Background, Reserve & Gandy Machines](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816252550346895dd29bae/html5/thumbnails/21.jpg)
Set background refinedSolution?One possibility is to equip our Set
background with enough functions so that the structure is preserved
This may lead to low levels of abstractions, so instead…
We refine our model and specify a special embedding which will be called standard. The requirement now is that every embedding has a unique extension to a standard embedding
![Page 22: Background, Reserve & Gandy Machines](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816252550346895dd29bae/html5/thumbnails/22.jpg)
String backgroundThe set of non- logic elements is the
set of strings of elements of the set of atoms U◦Nil function (empty string)◦Unary function to convert atoms to
strings◦Concatenation of 2 strings
Other optional vocabulary elements:Head(x), Tail(x)Also explictly atom- generated
![Page 23: Background, Reserve & Gandy Machines](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816252550346895dd29bae/html5/thumbnails/23.jpg)
List backgroundNon- logic part: lists over UDiffers from strings in that
nesting is allowedBasic functions: Nil (empty list),
Append(x,y), optional: Head, TailExplictly atom- generated
![Page 24: Background, Reserve & Gandy Machines](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816252550346895dd29bae/html5/thumbnails/24.jpg)
Set/ List backgroundNon- logic part is the least set V s.t.
◦ ◦
In this representation, lists (“<>”) and sets (“{}”) are regarded as independent basic constructions
Example of a non- finitary background class: take the string class allowing infinite strings this time
VU VxxVxxVxxn nnn ,...,,},...,{,...,, 111
![Page 25: Background, Reserve & Gandy Machines](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816252550346895dd29bae/html5/thumbnails/25.jpg)
Background structures & the ReserveFix a background class BC,
vocabulary of BC is the background vocabulary, function names in - background function names, members of BC- background structures
Def(6.1): For an algorithm A, BC is the background of A if:◦The vocabulary of A, , includes .
Every background function is static in ◦For every state X of A, the - reduct
of X (forget functions from - ) is a background structure
0
0
0
00
![Page 26: Background, Reserve & Gandy Machines](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816252550346895dd29bae/html5/thumbnails/26.jpg)
Even more definitionsThe basic functions of A with names in
are the background basic functionsOther functions will be called the
foreground basic functionsDef(6.2): Let X be a state of A. We call an
element x from Base(X) exposed if x belongs to the range of the foreground function or x occurs in a tuple that belongs to the domain of a foreground function
Def(6.3): The Active part of a state X is the envelope of the set of exposed elements- Active(X). The Reserve is the set of atoms which don’t belong to the active part
0
![Page 27: Background, Reserve & Gandy Machines](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816252550346895dd29bae/html5/thumbnails/27.jpg)
AnalysisLemma 6.4: Every permutation of the
reserve of X gives rise to a unique automorphism of X that is the identity on the active part of X
Proof: ◦ Let π be a permutation of the Reserve.◦ Extend it to the Active part of X using π(x)=x. ◦ Since Active(X) and Reserve(X) are disjoint,
this is an automorphism of the entire structureRemark: Any isomorphism between states
X and Y gives rise to an isomorphism between Active(X) and Active(Y)
![Page 28: Background, Reserve & Gandy Machines](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816252550346895dd29bae/html5/thumbnails/28.jpg)
Inessential non-determinism (IND)Def7.1: For a non- deterministic
algorithm A and background BC, A is inessentially non- deterministic if for all states X of A:If (X,X’) and (X,X’’) belong to , then there is an isomorphism from X’ onto X’’ that coincides with the identity on Active(X)
Corollary7.2: if (X,X’) and (Y,Y’) belong to , isom. From X to Y, the restriction to Active(x). Then extends to an isom. From X’ to Y’
Proof: From IND we have
A
A 0
0
'''': YYX
![Page 29: Background, Reserve & Gandy Machines](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816252550346895dd29bae/html5/thumbnails/29.jpg)
Application:
Nondeterministic choice problem and Gandy machines
![Page 30: Background, Reserve & Gandy Machines](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816252550346895dd29bae/html5/thumbnails/30.jpg)
Gandy machinesFor a fixed infinitely countable set of
atoms U, define Every permutation π of U naturally extends to
an automorphism on G: if xєHF(U) then πx={πy:yєx}
A subset S of HF(U) is structural if it is closed under automorphisms, which in this case means closed under π as defined above
Def(8.1): function F:S->HF(U) is structural if for every xєS and for every perm. π there’s a perm. ρ of U that pointwise fixes Sup({πx}) and ρπFx=Fπx
),,)(( UUHFUG
![Page 31: Background, Reserve & Gandy Machines](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816252550346895dd29bae/html5/thumbnails/31.jpg)
Lemma and main definitionLemma 8.2:
1. A structural function (SF) F over a structural set S extends to a SF over HF(U)
2. F SF Over HF(U), S structural subset of HF(U). Them the restriction of F|S is a SF over S
Def(8.3): a Gandy machine M is a pair (S,F) s.t.:
1. S is a structural subset of HF(U) (intuitively: the set of states of M)
2. F is a SF from S into S (the one step transformation function)
3. Some additional constraints irrelevant to us
![Page 32: Background, Reserve & Gandy Machines](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816252550346895dd29bae/html5/thumbnails/32.jpg)
ExampleM=(S,F), π a permutation of U
◦S is the collection of all finite subsets of U. Obviously it is structural
◦ , aєU-x (add new element)◦
◦So the required premutation ρ will transpose πb to c and leave everything else intact
◦Thus, M satisfies both requirements
},,...,{},,...,{
},...,{
1
1
1
caaxFbaaFx
aax
n
n
n
}{)( axxF
![Page 33: Background, Reserve & Gandy Machines](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816252550346895dd29bae/html5/thumbnails/33.jpg)
The Nondeterministic choice problemThink of an arbitrary Gandy machine
M=(S,F), xєS being the “current state” and Fx the next state of M
It is possible that Sup({Fx}) has new atoms that are not in Sup({x})
The choice of such new atoms shouldn’t matter, thus the structurality requirement
1 .Is the structurality requiremnt correctlly captures this irrelevance?2. Is there a better solution to the Nondeterministi choice problem?
![Page 34: Background, Reserve & Gandy Machines](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816252550346895dd29bae/html5/thumbnails/34.jpg)
Some answers ahead...We claim that the answer to the
second question is positive by proposing a nondeterministic formalization to Gandy machines
If we consider only deterministic machines, the answer to the first question is positive as well: we will see that the structurality requirement is equivalent to inessential non- determinism as defined earlier
![Page 35: Background, Reserve & Gandy Machines](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816252550346895dd29bae/html5/thumbnails/35.jpg)
Nondeterministic specificationS is structural subset of HF(U), F:S->S a unary operation over S.
Define a nondeterministic algorithmAll states of A have the same base
set and also TRUE, FALSE and UNDEF
Non- logic basic functions: Atomic, є and Core(X) that returns M’s current state
consists of pairs (X,Y) s.t. Core(Y)=F(Core(X))
MA
)(UHFU
A
![Page 36: Background, Reserve & Gandy Machines](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816252550346895dd29bae/html5/thumbnails/36.jpg)
In our exampleSup(X)=Core(X) for all statesFor a particular state X, what are
the states Y that A can continue to?
Those are the states Y s.t. Sup(Y)=Sup(X)+{a}, where a is a new additional atom
Any atom from U-Sup(X) will do!The Algorithm is completely
oblivious to which atom is chosen
![Page 37: Background, Reserve & Gandy Machines](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816252550346895dd29bae/html5/thumbnails/37.jpg)
AnalysisThe algorithm is a nondeterministic
algoritm with background SB (sets)The only exposed element of state X of A
is Core(X)The active part of X is Sup(X)UHF(Sup(X))
+ TRUE,FALSE, UNDEFHence, Reserve(X)= U- Sup(X)A permutation of Reserve(X) fixes
pointwise Sup(X) and agrees with π on Reserve(X)
Corollary 10.3: (X,Y)є iff there’s a premutation π of Reserve(X) s.t. Core(Y)=πF(Core(X))
A
![Page 38: Background, Reserve & Gandy Machines](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816252550346895dd29bae/html5/thumbnails/38.jpg)
Inessential nondeterminism and structurality
Let S and F be defined as in the previous section, A the nondeterministic specification. then:
Theorem 11.1: The following are equivalent:
◦A is inessentially nondeterministic◦F is structural over S
Proof: Hanc marginis exiguitas non caperet..
![Page 39: Background, Reserve & Gandy Machines](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816252550346895dd29bae/html5/thumbnails/39.jpg)
FinQuestions?