This problem is related to wolves.
model wolves1 "Werewolves II"; set p := [A B C] "Persons"; binary variable x{p}; y{p}; constraint A: xor{p} y; B{p}: y -> x "The werewolf is a knight"; Asays: x[1] <-> or{p} ~x "At least one is a knave, says A"; Bsays: x[2] = x[3] "B says: C is a knight"; minimize any: y[1]; Write{p}('%s is a %5s\n', p, if (x,'knight','knave')); Write{p|y}('%s is a werewolf\n', p); end
[1] MatMod. Homepage for Learning Mathematical Modeling : https://matmod.ch.
[2] Hürlimann T. Reference Manual for the LPL Modeling Language, most recent version. https://matmod.ch/lpl/doc/manual.pdf.