Register structures #
A register structure is a type of states with registers, each register holding a value that can
be read (val) and updated (extend) according to the laws of Function.update. The canonical
example is a function type, whose coordinates are the registers. Muskens grafts discourse
representation theory onto type logic over such states: random assignment [r] resets a
register, and a box [u₁ … uₙ | C] resets its registers and tests C. The conditions over a
register structure form a cylindric algebra in the sense of Henkin, Monk and Tarski, in which
cylindrification is the weakest precondition of [r].
Main definitions #
RegisterStructure R S E, with its canonical instance atV → E.RegisterStructure.cylindricAlgebra: the cylindric algebra of conditions.Update.randomAssign,Update.dexists,Update.dforall: random assignment and the dynamic quantifiers.Update.box: the box[u₁ … uₙ | C]over a finite set of registers.Update.Fixes,Update.maxAt: an update leaves a register unchanged, and maximization over a register's value.
Main results #
Update.randomAssign_comp_self,Update.commute_randomAssign: random assignments are idempotent and commute; with theSetRel.IsRefl,IsSymmandIsTransinstances, each is an equivalence.Update.preimage_randomAssign,Update.core_randomAssign,Update.dom_dexists: the weakest precondition of[r]is cylindrification and its dual the universal; an existential is true where the cylindrification of its scope's truth set is.Update.commute_test_randomAssign_iff: a test commutes with[r]exactly whenris outside the dimension set of its condition.Update.box_comp_box: two boxes in sequence are one box over the union of their registers when the second's registers lie outside the dimension set of the first's condition (Muskens's Merging Lemma).Update.exists_box_map_iff,Update.mem_dom_box_map: quantifying over the outputs of a box over distinct registers is quantifying over tuples of values, so a box whose condition reads only its registers is true iff some tuple satisfies it (Muskens's Unselective Binding Lemma).Update.mem_box_iff: at assignments, a box relates an assignment to those that agree with it off the box's registers and satisfy its condition.RegisterStructure.dimSet_preimage_subset: a condition read off registers inshas its dimension set insides.
Implementation notes #
Muskens defines i[r]j as agreement on every register other than r and asserts that enough
states exist (AX1). Here [r] is the graph of extend · r e, which agrees with his relation when
a state is determined by its registers, as in every instance; it also serves states carrying
several sorts of registers (Semantics/Dynamic/ICDRT.lean), and its uniqueness gives the diagonal
axioms of the cylindric algebra. Constant registers (AX4) are constant functions of the state,
and AX3, that distinct referents denote distinct registers, is a hypothesis where it is used.
References #
A register structure has registers R (Muskens's type π), a value function val (his V)
and a register-wise update extend satisfying the laws of Function.update. extend
skolemizes AX1.
- val : R → S → E
The value of a register in a state (Muskens's
V). - extend : S → R → E → S
Update a state at a register (AX1's witness).
The updated register holds the new value.
Other registers are untouched.
Updating a register to its own value does nothing.
A second update of a register overrides the first.
- extend_comm (i : S) {r r' : R} (h : r ≠ r') (e e' : E) : extend (extend i r e) r' e' = extend (extend i r' e') r e
Updates of distinct registers commute.
Instances
In the canonical register structure the registers are the coordinates of a function type and
update is Function.update.
Equations
- One or more equations did not get rendered due to their size.
The conditions over a register structure form a cylindric algebra. Cylindrification along
r holds where some update of r satisfies the condition, and the diagonal of r and r'
holds where the two registers have the same value.
Equations
- One or more equations did not get rendered due to their size.
A register lies outside the dimension set of a condition exactly when updating it never changes whether the condition holds.
A condition read off a function of the state that no update outside s changes has its
dimension set inside s, as CylindricAlgebra.dimSet_subset_of_dependsOn says of predicates on
assignments.
A condition on the value of one register has its dimension set inside that register.
Random assignment [r] gives the register r an arbitrary value.
Equations
- DynamicSemantics.Update.randomAssign r = {(a, b) : S × S | ∃ (e : E), b = DynamicSemantics.RegisterStructure.extend a r e}
Instances For
Random assignment is idempotent.
Random assignments commute.
The weakest precondition of a random assignment is cylindrification.
The dual weakest precondition of a random assignment is universal quantification over the register.
A test commutes with a random assignment exactly when the register is outside the dimension set of its condition.
The existential update ∃r(D) is [r]; D.
Equations
- DynamicSemantics.Update.dexists r D = SetRel.comp (DynamicSemantics.Update.randomAssign r) D
Instances For
The universal condition ∀r(D) holds iff D has an output from every r-variant, which is
the clause of [GS91a] for the universal.
Equations
Instances For
An existential runs its scope from some update of the input at r.
A universal holds when its scope has an output from every update of the input at r.
An existential is true where the cylindrification of its scope's truth set is.
Frame conditions and maximization #
An update D fixes the register r if no output of D changes its value.
Equations
- DynamicSemantics.Update.Fixes r D = ∀ (i j : S), (i, j) ∈ D → DynamicSemantics.RegisterStructure.val r j = DynamicSemantics.RegisterStructure.val r i
Instances For
A random assignment fixes every other register.
Maximization over a register keeps the outputs of D at which no other output gives r a
strictly greater value.
Equations
Instances For
Maximizing a register an update fixes is vacuous, since every output agrees with the input there.
Boxes #
The box [u₁ … uₙ | C] of [Mus96]'s ABB3 assigns the registers of s at random and
then tests C. Random assignments commute, so a box needs only the set of its registers.
Equations
- DynamicSemantics.Update.box s C = s.noncommProd DynamicSemantics.Update.randomAssign ⋯ * DynamicSemantics.Update.test C
Instances For
A one-register box is an existential over a test.
The box [r | C] assigns r at random and then tests C.
A box commutes with a random assignment whose register lies outside the dimension set of its condition.
A box fixes every register outside it.
Prefixing a random assignment adds its register to a box.
A random assignment to r followed by a box gives the box with r added.
The weakest precondition of a box quantifies over each of its registers.
Two boxes in sequence are one box, provided no register of the second occurs in the conditions of the first (the Merging Lemma of [Mus96]).
For distinct registers u₀ … uₙ₋₁, the states that differ from i at most there realize
every tuple of values, so a quantifier over them is a quantifier over the tuples (the Unselective
Binding Lemma of [Mus96]).
A box over distinct registers whose condition reads only those registers is true exactly when some tuple of values satisfies the condition.
The canonical register structure #
At the canonical register structure, a box relates an assignment to the assignments that agree with it off the box's registers and satisfy its condition.
At the canonical register structure, random assignment at x is agreement off x.