Skip to content

Instantly share code, notes, and snippets.

@modernserf
Last active September 18, 2017 16:27
Show Gist options
  • Save modernserf/1d7cce4d5142cdec0f46353252cb1710 to your computer and use it in GitHub Desktop.
Save modernserf/1d7cce4d5142cdec0f46353252cb1710 to your computer and use it in GitHub Desktop.
outfit(Shirt, Pants, Shoes) :-
shirt(Shirt),
pants(Pants),
shoes(Shoes),
formal_coord(Shirt, Pants, Shoes),
texture_coord(Shirt, Pants),
color_coord(Shirt, Pants),
shoe_coord(Pants, Shoes).
formal_coord(Shirt, Pants, Shoes) :-
formality(Shirt, Formality),
formality(Pants, Formality),
formality(Shoes, Formality).
texture_coord(Shirt, Pants) :-
texture(Shirt, Texture),
not(texture(Pants, Texture)).
color_coord(Shirt, Pants) :-
color(Shirt, Color),
not(color(Pants, Color)).
shoe_coord(Pants, Shoes) :-
tone(Pants, Tone),
tone(Shoes, Tone).
shirt(dark_flannel).
shirt(gray_pattern).
shirt(light_with_blue).
pants(khakis).
pants(jeans).
pants(chinos).
shoes(sneakers).
shoes(chukkas).
shoes(wingtips).
tone(khakis, warm).
tone(jeans, cool).
tone(jeans, warm).
tone(chinos, cool).
tone(sneakers, cool).
tone(chukkas, warm).
tone(wingtips, cool).
color(dark_flannel, brown).
color(gray_pattern, gray).
color(light_with_blue, white).
color(khakis, tan).
color(jeans, blue).
color(chinos, gray).
formality(gray_pattern, formal).
formality(light_with_blue, formal).
formality(khakis, formal).
formality(chinos, formal).
formality(chukkas, formal).
formality(wingtips, formal).
formality(dark_flannel, informal).
formality(gray_pattern, informal).
formality(khakis, informal).
formality(jeans, informal).
formality(sneakers, informal).
formality(chukkas, informal).
texture(khakis, solid).
texture(jeans, solid).
texture(chinos, solid).
texture(dark_flannel, pattern).
texture(gray_pattern, pattern).
texture(light_with_blue, pattern).
?- outfit(Shirt, Pants, Shoes).
Pants = khakis,
Shirt = dark_flannel,
Shoes = chukkas
Pants = jeans,
Shirt = dark_flannel,
Shoes = sneakers
Pants = jeans,
Shirt = dark_flannel,
Shoes = chukkas
Pants = khakis,
Shirt = gray_pattern,
Shoes = chukkas
Pants = khakis,
Shirt = gray_pattern,
Shoes = chukkas
Pants = jeans,
Shirt = gray_pattern,
Shoes = sneakers
Pants = jeans,
Shirt = gray_pattern,
Shoes = chukkas
Pants = khakis,
Shirt = light_with_blue,
Shoes = chukkas
Pants = chinos,
Shirt = light_with_blue,
Shoes = wingtips
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment