// A group of five school children is caught in a crime. matthew (id:id) = {} peter (id:id) = {} jack (id:id) = {} arnold (id:id) = {} carl (id:id) = {} liar (id:id) <= {,,,,} thief (id:id) <= {,,,,} // One of them has stolen something from some kid they all dislike. one thief // The headmistress has to find out who did it. She questions the children, and this is what they say: // Matthew: "Carl didn't do it, and neither did I." ¬ (matthew ⊆ liar) ⇒ no (carl ∪ matthew) ∩ thief // Peter: "It was Matthew or it was Jack." ¬ (peter ⊆ liar) ⇒ some (matthew ∪ jack) ∩ thief // Jack: "Matthew and Peter are both lying." ¬ (jack ⊆ liar) ⇒ matthew ∪ peter ⊆ liar // Arnold: "Matthew or Peter is speaking the truth, but not both." ¬ (arnold ⊆ liar) ⇒ one (matthew ∪ peter) ∩ liar // Carl: "What Arnold says is not true." ¬ (carl ⊆ liar) ⇒ no (matthew ∪ peter) ∩ liar // Their class teacher now comes in. She says: "three of these boys always tell the truth and two always lie." // The class teacher is telling the truth. let students = matthew ∪ peter ∪ jack ∪ arnold ∪ carl | ∃ s1 ∈ students, s2 ∈ students ∖ s1 | (s1 ∪ s2) = liar