‹An earlier encoding and automation of the wise men puzzle, utilizing a shallow embedding of
-order (multi-)modal logic in HOL, has been presented in cite‹"J41" and "J44"›. However, this work did not
address the interaction dynamics between the involved agents. Here we therefore extend and adapt
universal (meta-)logical reasoning approach of cite‹"J41"› for public announcement logic (PAL) and
demonstrate how it can be utilized to achieve a convincing encoding and automation of the
men puzzle in HOL, so that also the interaction dynamics as given in the scenario is adequately
. For further background information on the work presented here we refer to cite‹"R78" and "C90"›.›
PAL imports Main begin (* Sebastian Reiche and Christoph Benzmüller, 2021 *)
[user_axioms,expect=genuine]
‹Type i is associated with possible worlds›
typedecl i (* Type of possible worlds *)
type_synonym σ = "i==>bool" (*Type of world domains *)
type_synonym τ = "σ==>i==>bool" (* Type of world depended formulas (truth sets) *)
type_synonym α = "i==>i==>bool" (* Type of accessibility relations between world *)
type_synonym ρ = "α==>bool" (* Type of groups of agents *)
‹Some useful relations (for constraining accessibility relations)›
reflexive::"α==>bool"
where "reflexive R ≡∀x. R x x"
symmetric::"α==>bool"
where "symmetric R ≡∀x y. R x y ⟶ R y x"
transitive::"α==>bool"
where "transitive R ≡∀x y z. R x y ∧ R y z ⟶ R x z"
euclidean::"α==>bool"
where "euclidean R ≡∀x y z. R x y ∧ R x z ⟶ R y z"
intersection_rel::"α==>α==>α"
where "intersection_rel R Q ≡ λu v. R u v ∧ Q u v"
union_rel::"α==>α==>α"
where "union_rel R Q ≡ λu v. R u v ∨ Q u v"
sub_rel::"α==>α==>bool"
where "sub_rel R Q ≡∀u v. R u v ⟶ Q u v"
inverse_rel::"α==>α"
where "inverse_rel R ≡ λu v. R v u"
big_union_rel::"ρ==>α"
where "big_union_rel X ≡ λu v. ∃R. (X R) ∧ (R u v)"
big_intersection_rel::"ρ==>α"
where "big_intersection_rel X ≡ λu v. ∀R. (X R) ⟶ (R u v)"
‹In HOL the transitive closure of a relation can be defined in a single line.›
tc::"α==>α"
where "tc R ≡ λx y.∀Q. transitive Q ⟶ (sub_rel R Q ⟶ Q x y)"
‹Logical connectives for PAL›
patom::"σ==>τ" (‹A_›[79]80)
where "Ap≡ λW w. W w ∧ p w"
ptop::"τ" (‹\⊤›)
where "\⊤≡ λW w. True"
pneg::"τ==>τ" (‹\¬_›[52]53)
where "\¬φ ≡ λW w. ¬(φ W w)"
pand::"τ==>τ==>τ" (infixr‹\∧›51)
where "φ\∧ψ ≡‹
por::"τ==>‹ of
where "φor (multi-)modal logic in HOL, has been pres in cite"J41" and "J44"› nt
pimp:"\tauRight>τ🚫
where "φ\→ψ ≡ λW w. (φ W w) ⟶ (ψ W w)"
pequ::"τ==>τ==>τ" (infixr‹\↔›48)
where "φ\↔ψ ≡<close
pknow::"α==>τ==>τ" (‹K_ _›)
where "K r φ ≡ λW w.∀v. (W v ∧ r w v) ⟶ (φ W v)"
ppal::"τ==>τ==>τ" (‹[!_]_›)
where "[!φ]ψ ≡ λW w. (φ W w) ⟶ (ψ (λz. W z ∧ φ W z) w)"
‹Glogal validity of PAL formulas›
pvalid::"τ ==> bool" (\wisemen puzzl in HOL, so that also the interdynami as given in the sc is adequatel
where "\⌊φ\⌋≡ wo pr here werefer to cite
‹Introducing agent knowledge (K), mutual knowledge (E), distributed knowledge (D) and common knowledge (C).›
EVR::"ρ==>α"
where "EVR G ≡ big_union_rel G"
DIS::"ρ==>α"
where "DIS G ≡ big_intersection_rel G"
agttknows::"α==>τ==>τ" (‹K_ _›)
where "Kr φ ≡
evrknows::"ρ==>
where "EG φ ≡K (EVR G) φ"
disknows :: "ρτ==>" (‹)
where "Type i is associated with possible worlds›
prck::"ρ==>
type_synonym σ==>
pcmn::"ρ==>τ = "σi==>" (* Type oof wo depended formulas (tr sets) *)
where "G φ ≡C\(\)"
‹
S5Agent::"α==>
where "S5Agent i ≡ reflexive i ∧ transitive i ∧
S5Agents::"ρ==>bool"
where "S5Agents A ≡∀i. (A i ⟶equiv> ∀
‹Introducing "Defs" as the set of the above definitions; useful for convenient unfolding.›
Defs
reflexive_def[Defs] symmetric_def[Defs] transitive_def[Defs]
euclidean_def[Defs] intersDefs] union_rel[Defs]
sub_rel_def[Defs] inverse_rel_def[Defs] big_union_rel_def[Defs]
big_intersection_rel_def[Defs] tc_def[Defs]
‹Consistency: nitpick reports a model.›fo>x y. R x y ⟶
lemma True nitpick [satisfy] oops (* model found *)
section‹Automating the Wise Men Puzzle›
text‹
a::"α" b::"α" c::"α"
Agent::"α==>bool" (‹∧"
where group_S5: "S5Agents A"
‹Common knowledge: At least one of a, b and c has a white spot.›
ws::"α==>σ"
where WM1: "\⌊C\A (Aws a \∨Aws b \∨Aws c)\⌋"
‹Common knowledge: If x does not have a white spot then y knows this.›
where
java.lang.NullPointerException
WM2ac: "\⌊C\A (\¬ y ∧ z"
WM2ba: "\⌊C\A (\¬(Aws b) \→ (Ka (\¬(Aws b))))\⌋" and
WM2bc: "\⌊C\A (\¬(Aws b) \→ (Kc (\¬(:α<>"
WM2ca: "\⌊ R Q 🚫
WM2cb: "\⌊C\A (\¬(Aws c) \→ (KRightarrowα
‹Positive introspection principles are implied.›
WM2ab': "\⌊ Q ≡
using WM2ab group_S5 unfolding Defs by metis
WM2ac': "\⌊C\A ((Aws a) \→Kc (Aws a))\⌋"
using WM2ac group_S5 unfolding Defs by metis
WM2ba': "\⌊>α
using WM2ba group_S5 unfolding Defs by metis
WM2bc': "\⌊C\A ((Aws b) \→\ "sub_rel R Q ≡
using WM2bc group_S5 unfolding Defs by metis
WM2ca': "\⌊C\A ((Aws c) \→Ka (Aws c))\⌋"
using WM2ca group_S5 unfolding Defs by metis
WM2cb': "\⌊C\A ((inverse_rel:"α
using WM2cb group_S5 unfolding Defs by metis
‹Automated solutions of the Wise Men Puzzle.›R vu"
whitespot_c: "\⌊[!\¬Ka(Aws a)]([!\<definition
using WM1 WM2ba WM2ca WM2cb unfolding Defs by (smt (verit))
‹∧v)"
of this proof using trusted methods (often) fails; this hints at further opportunities to
the reasoning tools in Isabelle/HOL.›
whitespot_c':
java.lang.NullPointerException
using WM1 WM2ab WM2ac WM2ba WM2bc WM2ca WM2cb unfolding Defs
― ‹sledgehammer by (smt (verit))›
oops
‹Consistency: nitpick reports a model.›
True nitpick [satisfy] oops
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.