Skip to content

Instantly share code, notes, and snippets.

@sebgod
Created July 6, 2014 13:55
Show Gist options
  • Save sebgod/9b25c5d8ec348770ed39 to your computer and use it in GitHub Desktop.
Save sebgod/9b25c5d8ec348770ed39 to your computer and use it in GitHub Desktop.
Here a solution without using negation, instead the universe of seasons is
specified.
<!-- language-all: prolog -->
season(summer).
season(winter).
now(winter).
warm(S) :-
season(S),
S = summer.
Some example queries:
?- now(S).
S = winter ;
false.
?- now(S), warm(S).
false.
?- warm(S).
S = summer ;
false.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment