|
| 1 | +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2 | +% Example 5: Wise men puzzle |
| 3 | +% |
| 4 | +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 5 | + |
| 6 | +%--- logic specification |
| 7 | +thf(wise_men_puzzle_semantics, logic , ( $modal := [ |
| 8 | + $constants := $rigid, $quantification := $varying, |
| 9 | + $consequence := $global, $modalities := $modal_system_S5] )). |
| 10 | + |
| 11 | +%--- $i type models the agents's hats |
| 12 | +thf(agent_a, type, (a: $i)). |
| 13 | +thf(agent_b, type, (b: $i)). |
| 14 | +thf(agent_c, type, (c: $i)). |
| 15 | +
|
| 16 | +%--- Property of an agent's hat: ws represents "having a white spot" |
| 17 | +thf(white_spot, type, (ws: ($i>$o))). |
| 18 | + |
| 19 | +%--- Common knowledge: At least one agent has a white spot |
| 20 | +thf(axiom_1, axiom, ($box_int @ 0 @ ((ws @ a) | (ws @ b) | (ws @ c)))). |
| 21 | + |
| 22 | +%--- If one agent has a white spot all other agents can see this |
| 23 | +thf(axiom_2ab, axiom, ($box_int @ 0 @ ((ws @ a) => ($box_int @ 2 @ (ws @ a))))). |
| 24 | +thf(axiom_2ac, axiom, ($box_int @ 0 @ ((ws @ a) => ($box_int @ 3 @ (ws @ a))))). |
| 25 | +thf(axiom_2ba, axiom, ($box_int @ 0 @ ((ws @ b) => ($box_int @ 1 @ (ws @ b))))). |
| 26 | +thf(axiom_2bc, axiom, ($box_int @ 0 @ ((ws @ b) => ($box_int @ 3 @ (ws @ b))))). |
| 27 | +thf(axiom_2ca, axiom, ($box_int @ 0 @ ((ws @ c) => ($box_int @ 1 @ (ws @ c))))). |
| 28 | +thf(axiom_2cb, axiom, ($box_int @ 0 @ ((ws @ c) => ($box_int @ 2 @ (ws @ c))))). |
| 29 | + |
| 30 | +%--- If one agent has a black spot all other agents can see this |
| 31 | +thf(axiom_3ab, axiom, ($box_int @ 0 @ ((~(ws @ a)) => ($box_int @ 2 @ (~(ws @ a)))))). |
| 32 | +thf(axiom_3ac, axiom, ($box_int @ 0 @ ((~(ws @ a)) => ($box_int @ 3 @ (~(ws @ a)))))). |
| 33 | +thf(axiom_3ba, axiom, ($box_int @ 0 @ ((~(ws @ b)) => ($box_int @ 1 @ (~(ws @ b)))))). |
| 34 | +thf(axiom_3bc, axiom, ($box_int @ 0 @ ((~(ws @ b)) => ($box_int @ 3 @ (~(ws @ b)))))). |
| 35 | +thf(axiom_3ca, axiom, ($box_int @ 0 @ ((~(ws @ c)) => ($box_int @ 1 @ (~(ws @ c)))))). |
| 36 | +thf(axiom_3cb, axiom, ($box_int @ 0 @ ((~(ws @ c)) => ($box_int @ 2 @ (~(ws @ c)))))). |
| 37 | + |
| 38 | +%--- Agents 1 and 2 do not know their hat color |
| 39 | +thf(axiom_9, axiom, ($box_int @ 0 @ (~($box_int @ 1 @ (ws @ a))))). |
| 40 | +thf(axiom_10, axiom, ($box_int @ 0 @ (~($box_int @ 2 @ (ws @ b))))). |
| 41 | + |
| 42 | +%--- Agent 3 can deduce the color of his hat (white spot) |
| 43 | +thf(con, conjecture, ($box_int @ 3 @ (ws @ c))). |
0 commit comments