|
|
|
:- dynamic term_expansion/2. |
|
:- multifile term_expansion/2. |
|
|
|
|
|
great_grandfather(X, Y) :- |
|
great_grandparent(X, Y), |
|
male(Y). |
|
|
|
great_grandchild(X, Y) :- |
|
great_grandparent(Y, X). |
|
|
|
great_grandparent(X, Y) :- |
|
grandparent(X, Z), |
|
parent(Z, Y). |
|
|
|
:- dynamic library_directory/1. |
|
:- multifile library_directory/1. |
|
|
|
|
|
great_grandmother(X, Y) :- |
|
great_grandparent(X, Y), |
|
female(Y). |
|
|
|
:- dynamic goal_expansion/4. |
|
:- multifile goal_expansion/4. |
|
|
|
|
|
:- dynamic hobby/2. |
|
|
|
hobby("Adolph Barbee", "birdwatching"). |
|
hobby("Allie Barbee", "geography"). |
|
hobby("Andres Barbee", "research"). |
|
hobby("Courtney Parkinson", "audiophile"). |
|
hobby("Dollie Barbee", "knowledge/word games"). |
|
hobby("Elicia Barbee", "geocaching"). |
|
hobby("Karolyn Lance", "croquet"). |
|
hobby("Kelley Barbee", "badminton"). |
|
hobby("Kenny Barbee", "fossil hunting"). |
|
hobby("Konstantin Barbee", "rail transport modelling"). |
|
hobby("Krystle Barbee", "jujitsu"). |
|
hobby("Kurt Parkinson", "beauty pageants"). |
|
hobby("Leonila Parkinson", "softball"). |
|
hobby("Lyndon Barbee", "golfing"). |
|
hobby("Nettie Barbee", "inline skating"). |
|
hobby("Rocco Lance", "radio-controlled model collecting"). |
|
hobby("Rudy Barbee", "videography"). |
|
hobby("Twyla Parkinson", "butterfly watching"). |
|
hobby("Tyrone Parkinson", "learning"). |
|
hobby("Wallace Ragland", "business"). |
|
hobby("Walter Hope", "curling"). |
|
hobby("Wanita Hope", "magnet fishing"). |
|
hobby("Willie Parkinson", "pickleball"). |
|
hobby("Windy Parkinson", "shuffleboard"). |
|
hobby("Yasmin Ragland", "geocaching"). |
|
|
|
granddaughter(X, Y) :- |
|
grandchild(X, Y), |
|
female(Y). |
|
|
|
grandson(X, Y) :- |
|
grandchild(X, Y), |
|
male(Y). |
|
|
|
:- dynamic job/2. |
|
|
|
job("Adolph Barbee", "police officer"). |
|
job("Allie Barbee", "community education officer"). |
|
job("Andres Barbee", "herbalist"). |
|
job("Courtney Parkinson", "podiatrist"). |
|
job("Dollie Barbee", "prison officer"). |
|
job("Elicia Barbee", "animal technologist"). |
|
job("Karolyn Lance", "leisure centre manager"). |
|
job("Kelley Barbee", "speech and language therapist"). |
|
job("Kenny Barbee", "dietitian"). |
|
job("Konstantin Barbee", "amenity horticulturist"). |
|
job("Krystle Barbee", "theatre stage manager"). |
|
job("Kurt Parkinson", "hydrologist"). |
|
job("Leonila Parkinson", "learning mentor"). |
|
job("Lyndon Barbee", "location manager"). |
|
job("Nettie Barbee", "chartered management accountant"). |
|
job("Rocco Lance", "plant breeder"). |
|
job("Rudy Barbee", "advertising account executive"). |
|
job("Twyla Parkinson", "tourism officer"). |
|
job("Tyrone Parkinson", "civil service fast streamer"). |
|
job("Wallace Ragland", "designer"). |
|
job("Walter Hope", "development worker"). |
|
job("Wanita Hope", "tourist information centre manager"). |
|
job("Willie Parkinson", "community education officer"). |
|
job("Windy Parkinson", "farm manager"). |
|
job("Yasmin Ragland", "doctor"). |
|
|
|
great_uncle(X, Y) :- |
|
grandparent(X, A), |
|
brother(A, Y). |
|
|
|
:- dynamic save_all_clauses_to_file/1. |
|
|
|
save_all_clauses_to_file(A) :- |
|
open(A, write, B), |
|
set_output(B), |
|
listing, |
|
close(B). |
|
|
|
:- dynamic term_expansion/4. |
|
:- multifile term_expansion/4. |
|
|
|
|
|
grandchild(X, Y) :- |
|
grandparent(Y, X). |
|
|
|
:- dynamic dob/2. |
|
|
|
dob("Adolph Barbee", "0980-08-29"). |
|
dob("Allie Barbee", "0928-07-23"). |
|
dob("Andres Barbee", "0977-09-16"). |
|
dob("Courtney Parkinson", "0954-06-24"). |
|
dob("Dollie Barbee", "0975-03-08"). |
|
dob("Elicia Barbee", "1040-03-27"). |
|
dob("Karolyn Lance", "0924-11-06"). |
|
dob("Kelley Barbee", "0952-08-19"). |
|
dob("Kenny Barbee", "0953-06-18"). |
|
dob("Konstantin Barbee", "1007-05-04"). |
|
dob("Krystle Barbee", "1008-12-24"). |
|
dob("Kurt Parkinson", "0924-12-27"). |
|
dob("Leonila Parkinson", "0924-09-18"). |
|
dob("Lyndon Barbee", "1036-01-09"). |
|
dob("Nettie Barbee", "1032-05-15"). |
|
dob("Rocco Lance", "0924-02-03"). |
|
dob("Rudy Barbee", "0927-04-02"). |
|
dob("Twyla Parkinson", "0949-02-16"). |
|
dob("Tyrone Parkinson", "0982-10-06"). |
|
dob("Wallace Ragland", "0951-01-09"). |
|
dob("Walter Hope", "0980-04-11"). |
|
dob("Wanita Hope", "0977-12-27"). |
|
dob("Willie Parkinson", "0954-09-22"). |
|
dob("Windy Parkinson", "0978-10-20"). |
|
dob("Yasmin Ragland", "0952-10-08"). |
|
|
|
:- dynamic file_search_path/2. |
|
:- multifile file_search_path/2. |
|
|
|
file_search_path(library, Dir) :- |
|
library_directory(Dir). |
|
file_search_path(swi, A) :- |
|
system:current_prolog_flag(home, A). |
|
file_search_path(swi, A) :- |
|
system:current_prolog_flag(shared_home, A). |
|
file_search_path(library, app_config(lib)). |
|
file_search_path(library, swi(library)). |
|
file_search_path(library, swi(library/clp)). |
|
file_search_path(library, A) :- |
|
system:'$ext_library_directory'(A). |
|
file_search_path(foreign, swi(A)) :- |
|
system: |
|
( current_prolog_flag(apple_universal_binary, true), |
|
A='lib/fat-darwin' |
|
). |
|
file_search_path(path, A) :- |
|
system: |
|
( getenv('PATH', B), |
|
current_prolog_flag(path_sep, C), |
|
atomic_list_concat(D, C, B), |
|
'$member'(A, D) |
|
). |
|
file_search_path(user_app_data, A) :- |
|
system:'$xdg_prolog_directory'(data, A). |
|
file_search_path(common_app_data, A) :- |
|
system:'$xdg_prolog_directory'(common_data, A). |
|
file_search_path(user_app_config, A) :- |
|
system:'$xdg_prolog_directory'(config, A). |
|
file_search_path(common_app_config, A) :- |
|
system:'$xdg_prolog_directory'(common_config, A). |
|
file_search_path(app_data, user_app_data('.')). |
|
file_search_path(app_data, common_app_data('.')). |
|
file_search_path(app_config, user_app_config('.')). |
|
file_search_path(app_config, common_app_config('.')). |
|
file_search_path(app_preferences, user_app_config('.')). |
|
file_search_path(user_profile, app_preferences('.')). |
|
file_search_path(app, swi(app)). |
|
file_search_path(app, app_data(app)). |
|
file_search_path(autoload, swi(library)). |
|
file_search_path(autoload, pce(prolog/lib)). |
|
file_search_path(autoload, app_config(lib)). |
|
file_search_path(autoload, Dir) :- |
|
'$autoload':'$ext_library_directory'(Dir). |
|
file_search_path(pack, app_data(pack)). |
|
file_search_path(library, PackLib) :- |
|
'$pack':pack_dir(_Name, prolog, PackLib). |
|
file_search_path(foreign, PackLib) :- |
|
'$pack':pack_dir(_Name, foreign, PackLib). |
|
file_search_path(app, AppDir) :- |
|
'$pack':pack_dir(_Name, app, AppDir). |
|
|
|
:- multifile prolog_list_goal/1. |
|
|
|
|
|
:- dynamic type/2. |
|
|
|
type("Adolph Barbee", person). |
|
type("Allie Barbee", person). |
|
type("Andres Barbee", person). |
|
type("Courtney Parkinson", person). |
|
type("Dollie Barbee", person). |
|
type("Elicia Barbee", person). |
|
type("Karolyn Lance", person). |
|
type("Kelley Barbee", person). |
|
type("Kenny Barbee", person). |
|
type("Konstantin Barbee", person). |
|
type("Krystle Barbee", person). |
|
type("Kurt Parkinson", person). |
|
type("Leonila Parkinson", person). |
|
type("Lyndon Barbee", person). |
|
type("Nettie Barbee", person). |
|
type("Rocco Lance", person). |
|
type("Rudy Barbee", person). |
|
type("Twyla Parkinson", person). |
|
type("Tyrone Parkinson", person). |
|
type("Wallace Ragland", person). |
|
type("Walter Hope", person). |
|
type("Wanita Hope", person). |
|
type("Willie Parkinson", person). |
|
type("Windy Parkinson", person). |
|
type("Yasmin Ragland", person). |
|
|
|
grandfather(X, Y) :- |
|
grandparent(X, Y), |
|
male(Y). |
|
|
|
:- dynamic expand_query/4. |
|
:- multifile expand_query/4. |
|
|
|
|
|
:- dynamic attribute/1. |
|
|
|
attribute("police officer"). |
|
attribute("birdwatching"). |
|
attribute("community education officer"). |
|
attribute("geography"). |
|
attribute("herbalist"). |
|
attribute("research"). |
|
attribute("podiatrist"). |
|
attribute("audiophile"). |
|
attribute("prison officer"). |
|
attribute("knowledge/word games"). |
|
attribute("animal technologist"). |
|
attribute("geocaching"). |
|
attribute("leisure centre manager"). |
|
attribute("croquet"). |
|
attribute("speech and language therapist"). |
|
attribute("badminton"). |
|
attribute("dietitian"). |
|
attribute("fossil hunting"). |
|
attribute("amenity horticulturist"). |
|
attribute("rail transport modelling"). |
|
attribute("theatre stage manager"). |
|
attribute("jujitsu"). |
|
attribute("hydrologist"). |
|
attribute("beauty pageants"). |
|
attribute("learning mentor"). |
|
attribute("softball"). |
|
attribute("location manager"). |
|
attribute("golfing"). |
|
attribute("chartered management accountant"). |
|
attribute("inline skating"). |
|
attribute("plant breeder"). |
|
attribute("radio-controlled model collecting"). |
|
attribute("advertising account executive"). |
|
attribute("videography"). |
|
attribute("tourism officer"). |
|
attribute("butterfly watching"). |
|
attribute("civil service fast streamer"). |
|
attribute("learning"). |
|
attribute("designer"). |
|
attribute("business"). |
|
attribute("development worker"). |
|
attribute("curling"). |
|
attribute("tourist information centre manager"). |
|
attribute("magnet fishing"). |
|
attribute("community education officer"). |
|
attribute("pickleball"). |
|
attribute("farm manager"). |
|
attribute("shuffleboard"). |
|
attribute("doctor"). |
|
attribute("geocaching"). |
|
|
|
great_aunt(X, Y) :- |
|
grandparent(X, A), |
|
sister(A, Y). |
|
|
|
grandparent(X, Y) :- |
|
parent(X, Z), |
|
parent(Z, Y). |
|
|
|
grandmother(X, Y) :- |
|
grandparent(X, Y), |
|
female(Y). |
|
|
|
:- dynamic friend_/2. |
|
|
|
friend_("Adolph Barbee", "Andres Barbee"). |
|
friend_("Adolph Barbee", "Kenny Barbee"). |
|
friend_("Adolph Barbee", "Leonila Parkinson"). |
|
friend_("Adolph Barbee", "Wanita Hope"). |
|
friend_("Allie Barbee", "Karolyn Lance"). |
|
friend_("Allie Barbee", "Konstantin Barbee"). |
|
friend_("Allie Barbee", "Walter Hope"). |
|
friend_("Allie Barbee", "Willie Parkinson"). |
|
friend_("Andres Barbee", "Willie Parkinson"). |
|
friend_("Andres Barbee", "Windy Parkinson"). |
|
friend_("Courtney Parkinson", "Kenny Barbee"). |
|
friend_("Courtney Parkinson", "Lyndon Barbee"). |
|
friend_("Elicia Barbee", "Twyla Parkinson"). |
|
friend_("Elicia Barbee", "Walter Hope"). |
|
friend_("Karolyn Lance", "Konstantin Barbee"). |
|
friend_("Karolyn Lance", "Krystle Barbee"). |
|
friend_("Karolyn Lance", "Wanita Hope"). |
|
friend_("Kelley Barbee", "Nettie Barbee"). |
|
friend_("Kelley Barbee", "Tyrone Parkinson"). |
|
friend_("Kelley Barbee", "Walter Hope"). |
|
friend_("Kenny Barbee", "Lyndon Barbee"). |
|
friend_("Kenny Barbee", "Nettie Barbee"). |
|
friend_("Kenny Barbee", "Tyrone Parkinson"). |
|
friend_("Konstantin Barbee", "Kurt Parkinson"). |
|
friend_("Konstantin Barbee", "Tyrone Parkinson"). |
|
friend_("Konstantin Barbee", "Wanita Hope"). |
|
friend_("Krystle Barbee", "Kurt Parkinson"). |
|
friend_("Krystle Barbee", "Rocco Lance"). |
|
friend_("Kurt Parkinson", "Windy Parkinson"). |
|
friend_("Leonila Parkinson", "Walter Hope"). |
|
friend_("Leonila Parkinson", "Wanita Hope"). |
|
friend_("Lyndon Barbee", "Nettie Barbee"). |
|
friend_("Lyndon Barbee", "Rocco Lance"). |
|
friend_("Lyndon Barbee", "Walter Hope"). |
|
friend_("Lyndon Barbee", "Windy Parkinson"). |
|
friend_("Nettie Barbee", "Wanita Hope"). |
|
friend_("Rocco Lance", "Walter Hope"). |
|
friend_("Rudy Barbee", "Tyrone Parkinson"). |
|
friend_("Twyla Parkinson", "Willie Parkinson"). |
|
friend_("Wallace Ragland", "Wanita Hope"). |
|
|
|
friend(X, Y) :- |
|
friend_(X, Y). |
|
friend(X, Y) :- |
|
friend_(Y, X). |
|
|
|
niece(X, Y) :- |
|
sibling(X, A), |
|
daughter(A, Y). |
|
|
|
nephew(X, Y) :- |
|
sibling(X, A), |
|
son(A, Y). |
|
|
|
brother_in_law(X, Y) :- |
|
married(X, A), |
|
brother(A, Y). |
|
|
|
:- multifile message_property/2. |
|
|
|
|
|
sister_in_law(X, Y) :- |
|
married(X, A), |
|
sister(A, Y). |
|
|
|
wife(X, Y) :- |
|
married(X, Y), |
|
female(Y). |
|
|
|
husband(X, Y) :- |
|
married(X, Y), |
|
male(Y). |
|
|
|
daughter_in_law(X, Y) :- |
|
child(X, A), |
|
wife(A, Y). |
|
|
|
son_in_law(X, Y) :- |
|
child(X, A), |
|
husband(A, Y). |
|
|
|
son(X, Y) :- |
|
child(X, Y), |
|
male(Y). |
|
|
|
female(X) :- |
|
gender(X, "female"). |
|
|
|
daughter(X, Y) :- |
|
child(X, Y), |
|
female(Y). |
|
|
|
father_in_law(X, Y) :- |
|
married(X, A), |
|
father(A, Y). |
|
|
|
mother_in_law(X, Y) :- |
|
married(X, A), |
|
mother(A, Y). |
|
|
|
father(X, Y) :- |
|
parent(X, Y), |
|
male(Y). |
|
|
|
:- multifile prolog_predicate_name/2. |
|
|
|
|
|
child(X, Y) :- |
|
parent(Y, X). |
|
|
|
male_first_cousin_once_removed(X, Y) :- |
|
cousin(X, A), |
|
son(A, Y), |
|
X\=Y. |
|
|
|
:- multifile prolog_clause_name/2. |
|
|
|
|
|
:- dynamic expand_answer/2. |
|
:- multifile expand_answer/2. |
|
|
|
|
|
:- dynamic exception/3. |
|
:- multifile exception/3. |
|
|
|
|
|
female_first_cousin_once_removed(X, Y) :- |
|
cousin(X, A), |
|
daughter(A, Y), |
|
X\=Y. |
|
|
|
brother(X, Y) :- |
|
sibling(X, Y), |
|
male(Y). |
|
|
|
mother(X, Y) :- |
|
parent(X, Y), |
|
female(Y). |
|
|
|
male_second_cousin(X, Y) :- |
|
parent(X, A), |
|
parent(Y, B), |
|
cousin(A, B), |
|
male(Y), |
|
X\=Y. |
|
|
|
:- dynamic message_hook/3. |
|
:- multifile message_hook/3. |
|
|
|
|
|
female_second_cousin(X, Y) :- |
|
parent(X, A), |
|
parent(Y, B), |
|
cousin(A, B), |
|
female(Y), |
|
X\=Y. |
|
|
|
married(X, Y) :- |
|
parent(Child, X), |
|
parent(Child, Y), |
|
X\=Y. |
|
|
|
male(X) :- |
|
gender(X, "male"). |
|
|
|
:- dynamic prolog_file_type/2. |
|
:- multifile prolog_file_type/2. |
|
|
|
prolog_file_type(pl, prolog). |
|
prolog_file_type(prolog, prolog). |
|
prolog_file_type(qlf, prolog). |
|
prolog_file_type(qlf, qlf). |
|
prolog_file_type(A, executable) :- |
|
system:current_prolog_flag(shared_object_extension, A). |
|
prolog_file_type(dylib, executable) :- |
|
system:current_prolog_flag(apple, true). |
|
|
|
sister(X, Y) :- |
|
sibling(X, Y), |
|
female(Y). |
|
|
|
male_cousin(X, Y) :- |
|
cousin(X, Y), |
|
male(Y). |
|
|
|
:- dynamic nonbinary/1. |
|
|
|
nonbinary(X) :- |
|
gender(X, "nonbinary"). |
|
|
|
female_cousin(X, Y) :- |
|
cousin(X, Y), |
|
female(Y). |
|
|
|
sibling(X, Y) :- |
|
parent(X, A), |
|
parent(Y, A), |
|
X\=Y. |
|
|
|
:- dynamic portray/1. |
|
:- multifile portray/1. |
|
|
|
|
|
:- dynamic prolog_load_file/2. |
|
:- multifile prolog_load_file/2. |
|
|
|
|
|
:- dynamic goal_expansion/2. |
|
:- multifile goal_expansion/2. |
|
|
|
|
|
:- dynamic parent/2. |
|
|
|
parent("Adolph Barbee", "Kelley Barbee"). |
|
parent("Adolph Barbee", "Kenny Barbee"). |
|
parent("Andres Barbee", "Kelley Barbee"). |
|
parent("Andres Barbee", "Kenny Barbee"). |
|
parent("Courtney Parkinson", "Karolyn Lance"). |
|
parent("Courtney Parkinson", "Rocco Lance"). |
|
parent("Dollie Barbee", "Wallace Ragland"). |
|
parent("Dollie Barbee", "Yasmin Ragland"). |
|
parent("Elicia Barbee", "Konstantin Barbee"). |
|
parent("Elicia Barbee", "Krystle Barbee"). |
|
parent("Kelley Barbee", "Karolyn Lance"). |
|
parent("Kelley Barbee", "Rocco Lance"). |
|
parent("Kenny Barbee", "Allie Barbee"). |
|
parent("Kenny Barbee", "Rudy Barbee"). |
|
parent("Konstantin Barbee", "Andres Barbee"). |
|
parent("Konstantin Barbee", "Dollie Barbee"). |
|
parent("Krystle Barbee", "Walter Hope"). |
|
parent("Krystle Barbee", "Wanita Hope"). |
|
parent("Lyndon Barbee", "Konstantin Barbee"). |
|
parent("Lyndon Barbee", "Krystle Barbee"). |
|
parent("Nettie Barbee", "Konstantin Barbee"). |
|
parent("Nettie Barbee", "Krystle Barbee"). |
|
parent("Twyla Parkinson", "Kurt Parkinson"). |
|
parent("Twyla Parkinson", "Leonila Parkinson"). |
|
parent("Tyrone Parkinson", "Courtney Parkinson"). |
|
parent("Tyrone Parkinson", "Willie Parkinson"). |
|
parent("Willie Parkinson", "Kurt Parkinson"). |
|
parent("Willie Parkinson", "Leonila Parkinson"). |
|
parent("Windy Parkinson", "Courtney Parkinson"). |
|
parent("Windy Parkinson", "Willie Parkinson"). |
|
|
|
cousin(X, Y) :- |
|
parent(X, A), |
|
parent(Y, B), |
|
sibling(A, B), |
|
X\=Y. |
|
|
|
uncle(X, Y) :- |
|
parent(X, A), |
|
brother(A, Y). |
|
|
|
:- dynamic resource/3. |
|
:- multifile resource/3. |
|
|
|
|
|
:- thread_local thread_message_hook/3. |
|
:- dynamic thread_message_hook/3. |
|
:- volatile thread_message_hook/3. |
|
|
|
|
|
aunt(X, Y) :- |
|
parent(X, A), |
|
sister(A, Y). |
|
|
|
second_uncle(X, Y) :- |
|
great_grandparent(X, A), |
|
brother(A, Y). |
|
|
|
:- dynamic gender/2. |
|
|
|
gender("Adolph Barbee", "male"). |
|
gender("Allie Barbee", "female"). |
|
gender("Andres Barbee", "male"). |
|
gender("Courtney Parkinson", "female"). |
|
gender("Dollie Barbee", "female"). |
|
gender("Elicia Barbee", "female"). |
|
gender("Karolyn Lance", "female"). |
|
gender("Kelley Barbee", "female"). |
|
gender("Kenny Barbee", "male"). |
|
gender("Konstantin Barbee", "male"). |
|
gender("Krystle Barbee", "female"). |
|
gender("Kurt Parkinson", "male"). |
|
gender("Leonila Parkinson", "female"). |
|
gender("Lyndon Barbee", "male"). |
|
gender("Nettie Barbee", "female"). |
|
gender("Rocco Lance", "male"). |
|
gender("Rudy Barbee", "male"). |
|
gender("Twyla Parkinson", "female"). |
|
gender("Tyrone Parkinson", "male"). |
|
gender("Wallace Ragland", "male"). |
|
gender("Walter Hope", "male"). |
|
gender("Wanita Hope", "female"). |
|
gender("Willie Parkinson", "male"). |
|
gender("Windy Parkinson", "female"). |
|
gender("Yasmin Ragland", "female"). |
|
|
|
second_aunt(X, Y) :- |
|
great_grandparent(X, A), |
|
sister(A, Y). |
|
|
|
great_grandson(X, Y) :- |
|
great_grandchild(X, Y), |
|
male(Y). |
|
|
|
:- dynamic pyrun/2. |
|
|
|
pyrun(A, B) :- |
|
read_term_from_atom(A, C, [variable_names(B)]), |
|
call(C). |
|
|
|
great_granddaughter(X, Y) :- |
|
great_grandchild(X, Y), |
|
female(Y). |
|
|
|
:- dynamic resource/2. |
|
:- multifile resource/2. |
|
|
|
|