Skip to content

Instantly share code, notes, and snippets.

@andrewjjenkins
Last active March 1, 2022 22:19
Show Gist options
  • Save andrewjjenkins/f70419208d68b432ff11daeadbc51c50 to your computer and use it in GitHub Desktop.
Save andrewjjenkins/f70419208d68b432ff11daeadbc51c50 to your computer and use it in GitHub Desktop.
A prolog skeleton for a Knights-and-Knaves problem with 8 animals
% Constraint Logic Programming
:- use_module(library(clpb)). % Boolean constraints
animals(1, [Horse, Cow, Chicken, Pig, Sheep, Goat, Swan, Cat]) :-
labeling([Horse, Cow, Chicken, Pig, Sheep, Goat, Swan, Cat]).
/** <examples> Your example queries go here, e.g.
?- animals(1, [Horse, Cow, Chicken, Pig, Sheep, Goat, Swan, Cat]).
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment