Skip to content

Instantly share code, notes, and snippets.

@cflewis
Created February 25, 2010 10:10
Show Gist options
  • Save cflewis/314432 to your computer and use it in GitHub Desktop.
Save cflewis/314432 to your computer and use it in GitHub Desktop.
#domain person(P).
citizen(P) :- born_in_usa(P).
citizen(P) :- not_born_in_usa(P), resident_usa(P), naturalized(P).
citizen(P) :- not_born_in_usa(P), mother(Y,P), citizen(Y), registered(P).
#hide mother(P, Y).
mother(mary, john).
#hide citizen(P).
citizen(mary).
#hide person(P).
person(john).
:- resident_usa(john).
:- born_in_usa(P), not_born_in_usa(P).
:- born_in_usa(P), registered(P).
:- born_in_usa(P), naturalized(P).
:- born_in_usa(P), resident_usa(P).
:- registered(P), naturalized(P).
{born_in_usa(P)}.
{resident_usa(P)}.
{naturalized(P)}.
{not_born_in_usa(P)}.
{registered(P)}.
compute { citizen(john) }.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment