Here is a solution using clpb .
:- use_module(library(clpb)).
solve :-
/* Alex is wearing one of the following costumes */
sat(card([1], [Alex * GhostA , Alex * ZombieA , Alex * WerewolfA])),
/* Bob is wearing one of the following costumes */
sat(card([1], [Bob * GhostB , Bob * ZombieB , Bob * WerewolfB])),
/* Mark is wearing one of the following costumes */
sat(card([1], [Mark * GhostM , Mark * ZombieM , Mark * WerewolfM])),
/* Alex wears only one of the following costumes */
sat(card([1], [GhostA, ZombieA, WerewolfA])),
/* Bob wears only one of the following costumes */
sat(card([1], [GhostB, ZombieB, WerewolfB])),
/* Mark wears only one of the following costumes */
sat(card([1], [GhostM, ZombieM, WerewolfM])),
/* There is only one ghost costume */
sat(card([1], [GhostA, GhostB, GhostM])),
/* There is only one zombie costume */
sat(card([1], [ZombieA, ZombieB, ZombieM])),
/* There is only one werewolf costume */
sat(card([1], [WerewolfA, WerewolfB, WerewolfM])),
/* Alex didn't fit the werewolf costume. */
sat(Alex * ~WerewolfA),
/* Bob can't wear the ghost costume. */
sat(Bob * ~GhostB),
/* Bob is the tallest */
sat(BobHigherA * ~AlexHigherB),
sat(BobHigherM * ~MarkHigherB),
/* For Alex and Mark we don't know */
sat(AlexHigherM * ~MarkHigherA + ~AlexHigherM * MarkHigherA ),
/* The one who chose the werewolf costume is shorter than the one who chose the ghost costume. */
sat((WerewolfB * GhostA) =< (BobHigherA < AlexHigherB)),
sat((WerewolfB * GhostM) =< (BobHigherM < MarkHigherB)),
sat((WerewolfA * GhostB) =< (AlexHigherB < BobHigherA)),
sat((WerewolfA * GhostM) =< (AlexHigherM < MarkHigherA)),
sat((WerewolfM * GhostB) =< (MarkHigherB < BobHigherM)),
sat((WerewolfM * GhostA) =< (MarkHigherA < AlexHigherM)),
/* We solve the puzzle */
labeling([GhostA, ZombieA, WerewolfA, GhostB, ZombieB, WerewolfB, GhostM, ZombieM, WerewolfM]),
writef('Alex => Ghost %d Zombie %d Werewolf %d\n', [GhostA, ZombieA, WerewolfA]),
writef('Bob => Ghost %d Zombie %d Werewolf %d\n', [GhostB, ZombieB, WerewolfB]),
writef('Mark => Ghost %d Zombie %d Werewolf %d\n', [GhostM, ZombieM, WerewolfM]).
The answer is
?- solve.
Alex => Ghost 1 Zombie 0 Werewolf 0
Bob => Ghost 0 Zombie 1 Werewolf 0
Mark => Ghost 0 Zombie 0 Werewolf 1
true.
[EDIT] After a search on the internet, I found these Halloween characters: Bob the ghost, Alex the werewolf and Mark the Zombie. So there is no need of the fact that "Alex didn't fit the werewolf costume."
We get now :
:- use_module(library(clpb)).
solve :-
/* Alex is wearing one of the following costumes */
sat(card([1], [Alex * GhostA , Alex * ZombieA , Alex * WerewolfA])),
/* Bob is wearing one of the following costumes */
sat(card([1], [Bob * GhostB , Bob * ZombieB , Bob * WerewolfB])),
/* Mark is wearing one of the following costumes */
sat(card([1], [Mark * GhostM , Mark * ZombieM , Mark * WerewolfM])),
/* Alex wears only one of the following costumes */
sat(card([1], [GhostA, ZombieA, WerewolfA])),
/* Bob wears only one of the following costumes */
sat(card([1], [GhostB, ZombieB, WerewolfB])),
/* Mark wears only one of the following costumes */
sat(card([1], [GhostM, ZombieM, WerewolfM])),
/* There is only one ghost costume */
sat(card([1], [GhostA, GhostB, GhostM])),
/* There is only one zombie costume */
sat(card([1], [ZombieA, ZombieB, ZombieM])),
/* There is only one werewolf costume */
sat(card([1], [WerewolfA, WerewolfB, WerewolfM])),
/* Alex can't wear the zombie costume. */
sat(Alex * ~ZombieA),
/* Bob can't wear the ghost costume. */
sat(Bob * ~GhostB),
/* Mark can't wear the werewolf costume. */
sat(Mark * ~WerewolfM),
/* Bob is the tallest */
sat(BobHigherAlex * ~AlexHigherBob),
sat(BobHigherMark * ~MarkHigherBob),
/* For Alex and Mark we don't know */
sat(AlexHigherMark * ~MarkHigherAlex + ~AlexHigherMark * MarkHigherAlex ),
/* The one who chose the werewolf costume is shorter than the one who chose the ghost costume. */
sat((WerewolfB * GhostA) =< (BobHigherAlex < AlexHigherBob)),
sat((WerewolfB * GhostM) =< (BobHigherMark < MarkHigherBob)),
sat((WerewolfA * GhostB) =< (AlexHigherBob < BobHigherAlex)),
sat((WerewolfA * GhostM) =< (AlexHigherMark < MarkHigherAlex)),
sat((WerewolfM * GhostB) =< (MarkHigherBob < BobHigherMark)),
sat((WerewolfM * GhostA) =< (MarkHigherAlex < AlexHigherMark)),
/* We solve the puzzle */
labeling([GhostA, ZombieA, WerewolfA, GhostB, ZombieB, WerewolfB, GhostM, ZombieM, WerewolfM]),
writef('Alex => Ghost %d Zombie %d Werewolf %d\n', [GhostA, ZombieA, WerewolfA]),
writef('Bob => Ghost %d Zombie %d Werewolf %d\n', [GhostB, ZombieB, WerewolfB]),
writef('Mark => Ghost %d Zombie %d Werewolf %d\n', [GhostM, ZombieM, WerewolfM]).
And the solution is now
?- solve.
Alex => Ghost 0 Zombie 0 Werewolf 1
Bob => Ghost 0 Zombie 1 Werewolf 0
Mark => Ghost 1 Zombie 0 Werewolf 0
true.