|
| 1 | +-- Cheryls Birthday in SMCDEL |
| 2 | + |
| 3 | +VARS 5,6,7,8, -- month |
| 4 | + 14,15,16,17,18,19 -- day of the month |
| 5 | + |
| 6 | +LAW AND ( |
| 7 | + -- birthday is one of these ten possibilities: |
| 8 | + OR ( (15 & 5), (16 & 5) , (19 & 5) |
| 9 | + , (17 & 6), (18 & 6) |
| 10 | + , (14 & 7), (16 & 7) |
| 11 | + , (14 & 8), (15 & 8), (17 & 8) |
| 12 | + ), |
| 13 | + -- month must be unique: |
| 14 | + AND ( ~(5 & 6), ~(5 & 7), ~(5 & 8) |
| 15 | + , ~(6 & 7), ~(6 & 8) |
| 16 | + , ~(7 & 8) |
| 17 | + ), |
| 18 | + -- days must be unique: |
| 19 | + AND ( ~(14 & 15), ~(14 & 16), ~(14 & 17), ~(14 & 18), ~(14 & 19) |
| 20 | + , ~(15 & 16), ~(15 & 17), ~(15 & 18), ~(15 & 19) |
| 21 | + , ~(16 & 17), ~(16 & 18), ~(16 & 19) |
| 22 | + , ~(17 & 18), ~(17 & 19) |
| 23 | + , ~(18 & 19) |
| 24 | + ) |
| 25 | + ) |
| 26 | + |
| 27 | +OBS albert: 5,6,7,8 -- knows month |
| 28 | + bernard: 14,15,16,17,18,19 -- knows day |
| 29 | + |
| 30 | +-- list all states |
| 31 | +WHERE? |
| 32 | + Top |
| 33 | + |
| 34 | +-- the dialogue |
| 35 | +WHERE? |
| 36 | + -- Albert: I don't know when Cheryl's birthday is, ... |
| 37 | + < ! ~ OR ( albert knows that (15 & 5), albert knows that (16 & 5) |
| 38 | + , albert knows that (19 & 5), albert knows that (17 & 6) |
| 39 | + , albert knows that (18 & 6), albert knows that (14 & 7) |
| 40 | + , albert knows that (16 & 7), albert knows that (14 & 8) |
| 41 | + , albert knows that (15 & 8), albert knows that (17 & 8) |
| 42 | + ) > |
| 43 | + -- ... but I know that Bernard doesn't know too. |
| 44 | + < ! ( albert knows that ( |
| 45 | + ~( OR ( bernard knows that (15 & 5), bernard knows that (16 & 5) |
| 46 | + , bernard knows that (19 & 5), bernard knows that (17 & 6) |
| 47 | + , bernard knows that (18 & 6), bernard knows that (14 & 7) |
| 48 | + , bernard knows that (16 & 7), bernard knows that (14 & 8) |
| 49 | + , bernard knows that (15 & 8), bernard knows that (17 & 8) |
| 50 | + ) ) ) ) > |
| 51 | + -- Bernard: First I did not know when Cheryl's birthday is, but now I know. |
| 52 | + < ! OR ( bernard knows that (15 & 5), bernard knows that (16 & 5) |
| 53 | + , bernard knows that (19 & 5), bernard knows that (17 & 6) |
| 54 | + , bernard knows that (18 & 6), bernard knows that (14 & 7) |
| 55 | + , bernard knows that (16 & 7), bernard knows that (14 & 8) |
| 56 | + , bernard knows that (15 & 8), bernard knows that (17 & 8) |
| 57 | + ) > |
| 58 | + -- Albert: Then I also know when Cheryl's birthday is. |
| 59 | + < ! OR ( albert knows that (15 & 5), albert knows that (16 & 5) |
| 60 | + , albert knows that (19 & 5), albert knows that (17 & 6) |
| 61 | + , albert knows that (18 & 6), albert knows that (14 & 7) |
| 62 | + , albert knows that (16 & 7), albert knows that (14 & 8) |
| 63 | + , albert knows that (15 & 8), albert knows that (17 & 8) |
| 64 | + ) > |
| 65 | + -- (show all states where these announcements can be made in this order) |
| 66 | + Top |
0 commit comments