|
|
|
:- dynamic term_expansion/2. |
|
:- multifile term_expansion/2. |
|
|
|
|
|
great_grandson(X, Y) :- |
|
great_grandchild(X, Y), |
|
male(Y). |
|
|
|
second_aunt(X, Y) :- |
|
great_grandparent(X, A), |
|
sister(A, Y). |
|
|
|
great_grandchild(X, Y) :- |
|
great_grandparent(Y, X). |
|
|
|
:- dynamic attribute/1. |
|
|
|
attribute(contractor). |
|
attribute(meditation). |
|
attribute('teacher, adult education'). |
|
attribute(meteorology). |
|
attribute('biomedical scientist'). |
|
attribute(biology). |
|
attribute('freight forwarder'). |
|
attribute(meteorology). |
|
attribute('commercial/residential surveyor'). |
|
attribute(dolls). |
|
attribute('research scientist (life sciences)'). |
|
attribute(photography). |
|
attribute('production assistant, television'). |
|
attribute(shogi). |
|
attribute('public house manager'). |
|
attribute(dominoes). |
|
attribute('museum education officer'). |
|
attribute('tether car'). |
|
attribute('engineer, manufacturing systems'). |
|
attribute(architecture). |
|
attribute('chief marketing officer'). |
|
attribute(geocaching). |
|
attribute('ranger/warden'). |
|
attribute(trainspotting). |
|
attribute('air cabin crew'). |
|
attribute('bus spotting'). |
|
attribute('newspaper journalist'). |
|
attribute(research). |
|
attribute('police officer'). |
|
attribute(geography). |
|
attribute(translator). |
|
attribute(microbiology). |
|
attribute('accountant, chartered'). |
|
attribute(canoeing). |
|
attribute('product designer'). |
|
attribute(learning). |
|
attribute('geographical information systems officer'). |
|
attribute('dairy farming'). |
|
attribute('estate manager/land agent'). |
|
attribute('fossil hunting'). |
|
attribute('therapist, art'). |
|
attribute(sociology). |
|
attribute('civil engineer, consulting'). |
|
attribute(finance). |
|
attribute('investment banker, corporate'). |
|
attribute(meditation). |
|
attribute('airline pilot'). |
|
attribute('wikipedia editing'). |
|
attribute('advertising copywriter'). |
|
attribute('radio-controlled car racing'). |
|
attribute('agricultural engineer'). |
|
attribute('social studies'). |
|
|
|
great_granddaughter(X, Y) :- |
|
great_grandchild(X, Y), |
|
female(Y). |
|
|
|
:- dynamic library_directory/1. |
|
:- multifile library_directory/1. |
|
|
|
|
|
great_grandmother(X, Y) :- |
|
great_grandparent(X, Y), |
|
female(Y). |
|
|
|
great_grandfather(X, Y) :- |
|
great_grandparent(X, Y), |
|
male(Y). |
|
|
|
:- dynamic term_expansion/4. |
|
:- multifile term_expansion/4. |
|
|
|
|
|
grandson(X, Y) :- |
|
grandchild(X, Y), |
|
male(Y). |
|
|
|
:- dynamic goal_expansion/4. |
|
:- multifile goal_expansion/4. |
|
|
|
|
|
great_grandparent(X, Y) :- |
|
grandparent(X, Z), |
|
parent(Z, Y). |
|
|
|
grandchild(X, Y) :- |
|
grandparent(Y, X). |
|
|
|
:- 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). |
|
|
|
granddaughter(X, Y) :- |
|
grandchild(X, Y), |
|
female(Y). |
|
|
|
great_aunt(X, Y) :- |
|
grandparent(X, A), |
|
sister(A, Y). |
|
|
|
:- multifile prolog_predicate_name/2. |
|
|
|
|
|
:- multifile prolog_list_goal/1. |
|
|
|
|
|
great_uncle(X, Y) :- |
|
grandparent(X, A), |
|
brother(A, Y). |
|
|
|
grandmother(X, Y) :- |
|
grandparent(X, Y), |
|
female(Y). |
|
|
|
grandfather(X, Y) :- |
|
grandparent(X, Y), |
|
male(Y). |
|
|
|
:- dynamic hobby/2. |
|
|
|
hobby(antionette, meditation). |
|
hobby(daisy, meteorology). |
|
hobby(deanna, biology). |
|
hobby(dixie, meteorology). |
|
hobby(ila, dolls). |
|
hobby(johnna, photography). |
|
hobby(kanesha, shogi). |
|
hobby(kari, dominoes). |
|
hobby(lyndia, 'tether car'). |
|
hobby(maggie, architecture). |
|
hobby(meghann, geocaching). |
|
hobby(miki, trainspotting). |
|
hobby(reyna, 'bus spotting'). |
|
hobby(rosalee, research). |
|
hobby(thomasine, geography). |
|
hobby(alfonso, microbiology). |
|
hobby(alton, canoeing). |
|
hobby(colby, learning). |
|
hobby(deangelo, 'dairy farming'). |
|
hobby(derick, 'fossil hunting'). |
|
hobby(dominick, sociology). |
|
hobby(ellis, finance). |
|
hobby(matt, meditation). |
|
hobby(scotty, 'wikipedia editing'). |
|
hobby(tanner, 'radio-controlled car racing'). |
|
hobby(vicente, 'social studies'). |
|
|
|
:- dynamic expand_query/4. |
|
:- multifile expand_query/4. |
|
|
|
|
|
nephew(X, Y) :- |
|
sibling(X, A), |
|
son(A, Y). |
|
|
|
:- multifile message_property/2. |
|
|
|
|
|
grandparent(X, Y) :- |
|
parent(X, Z), |
|
parent(Z, Y). |
|
|
|
:- dynamic job/2. |
|
|
|
job(antionette, contractor). |
|
job(daisy, 'teacher, adult education'). |
|
job(deanna, 'biomedical scientist'). |
|
job(dixie, 'freight forwarder'). |
|
job(ila, 'commercial/residential surveyor'). |
|
job(johnna, 'research scientist (life sciences)'). |
|
job(kanesha, 'production assistant, television'). |
|
job(kari, 'public house manager'). |
|
job(lyndia, 'museum education officer'). |
|
job(maggie, 'engineer, manufacturing systems'). |
|
job(meghann, 'chief marketing officer'). |
|
job(miki, 'ranger/warden'). |
|
job(reyna, 'air cabin crew'). |
|
job(rosalee, 'newspaper journalist'). |
|
job(thomasine, 'police officer'). |
|
job(alfonso, translator). |
|
job(alton, 'accountant, chartered'). |
|
job(colby, 'product designer'). |
|
job(deangelo, 'geographical information systems officer'). |
|
job(derick, 'estate manager/land agent'). |
|
job(dominick, 'therapist, art'). |
|
job(ellis, 'civil engineer, consulting'). |
|
job(matt, 'investment banker, corporate'). |
|
job(scotty, 'airline pilot'). |
|
job(tanner, 'advertising copywriter'). |
|
job(vicente, 'agricultural engineer'). |
|
|
|
:- dynamic dob/2. |
|
|
|
dob(alfonso, '0240-12-31'). |
|
dob(alton, '0263-06-10'). |
|
dob(antionette, '0239-10-28'). |
|
dob(colby, '0244-04-07'). |
|
dob(daisy, '0237-11-04'). |
|
dob(deangelo, '0239-07-26'). |
|
dob(deanna, '0270-07-11'). |
|
dob(derick, '0212-09-01'). |
|
dob(dixie, '0270-01-28'). |
|
dob(dominick, '0236-06-02'). |
|
dob(ellis, '0272-04-21'). |
|
dob(ila, '0241-07-17'). |
|
dob(johnna, '0264-08-02'). |
|
dob(kanesha, '0212-07-22'). |
|
dob(kari, '0238-10-28'). |
|
dob(lyndia, '0178-04-18'). |
|
dob(maggie, '0148-03-17'). |
|
dob(matt, '0205-10-16'). |
|
dob(meghann, '0230-04-06'). |
|
dob(miki, '0256-10-26'). |
|
dob(reyna, '0261-08-01'). |
|
dob(rosalee, '0260-09-04'). |
|
dob(scotty, '0149-12-17'). |
|
dob(tanner, '0231-07-16'). |
|
dob(thomasine, '0204-09-13'). |
|
dob(vicente, '0178-01-25'). |
|
|
|
husband(X, Y) :- |
|
married(X, Y), |
|
male(Y). |
|
|
|
:- dynamic expand_answer/2. |
|
:- multifile expand_answer/2. |
|
|
|
|
|
niece(X, Y) :- |
|
sibling(X, A), |
|
daughter(A, Y). |
|
|
|
daughter(X, Y) :- |
|
child(X, Y), |
|
female(Y). |
|
|
|
wife(X, Y) :- |
|
married(X, Y), |
|
female(Y). |
|
|
|
:- dynamic exception/3. |
|
:- multifile exception/3. |
|
|
|
|
|
:- dynamic friend_/2. |
|
|
|
friend_(antionette, daisy). |
|
friend_(antionette, dixie). |
|
friend_(antionette, kari). |
|
friend_(antionette, derick). |
|
friend_(daisy, dixie). |
|
friend_(daisy, kari). |
|
friend_(daisy, thomasine). |
|
friend_(daisy, derick). |
|
friend_(deanna, ila). |
|
friend_(deanna, maggie). |
|
friend_(deanna, colby). |
|
friend_(deanna, scotty). |
|
friend_(deanna, tanner). |
|
friend_(dixie, kari). |
|
friend_(dixie, thomasine). |
|
friend_(dixie, derick). |
|
friend_(ila, maggie). |
|
friend_(ila, colby). |
|
friend_(ila, scotty). |
|
friend_(ila, tanner). |
|
friend_(johnna, maggie). |
|
friend_(johnna, miki). |
|
friend_(johnna, alton). |
|
friend_(johnna, deangelo). |
|
friend_(johnna, dominick). |
|
friend_(johnna, ellis). |
|
friend_(kanesha, lyndia). |
|
friend_(kanesha, meghann). |
|
friend_(kanesha, rosalee). |
|
friend_(kanesha, alfonso). |
|
friend_(kari, thomasine). |
|
friend_(kari, derick). |
|
friend_(lyndia, meghann). |
|
friend_(lyndia, rosalee). |
|
friend_(lyndia, alfonso). |
|
friend_(maggie, miki). |
|
friend_(maggie, alton). |
|
friend_(maggie, colby). |
|
friend_(maggie, deangelo). |
|
friend_(maggie, dominick). |
|
friend_(maggie, ellis). |
|
friend_(maggie, scotty). |
|
friend_(maggie, tanner). |
|
friend_(meghann, rosalee). |
|
friend_(meghann, alfonso). |
|
friend_(miki, alton). |
|
friend_(miki, deangelo). |
|
friend_(miki, dominick). |
|
friend_(miki, ellis). |
|
friend_(reyna, matt). |
|
friend_(rosalee, alfonso). |
|
friend_(rosalee, matt). |
|
friend_(rosalee, vicente). |
|
friend_(thomasine, derick). |
|
friend_(alfonso, vicente). |
|
friend_(alton, deangelo). |
|
friend_(alton, dominick). |
|
friend_(alton, ellis). |
|
friend_(colby, scotty). |
|
friend_(colby, tanner). |
|
friend_(deangelo, dominick). |
|
friend_(deangelo, ellis). |
|
friend_(dominick, ellis). |
|
friend_(scotty, tanner). |
|
|
|
child(X, Y) :- |
|
parent(Y, X). |
|
|
|
:- thread_local thread_message_hook/3. |
|
:- dynamic thread_message_hook/3. |
|
:- volatile thread_message_hook/3. |
|
|
|
|
|
son(X, Y) :- |
|
child(X, Y), |
|
male(Y). |
|
|
|
friend(X, Y) :- |
|
friend_(X, Y). |
|
friend(X, Y) :- |
|
friend_(Y, X). |
|
|
|
:- dynamic male/1. |
|
|
|
male(alfonso). |
|
male(alton). |
|
male(colby). |
|
male(deangelo). |
|
male(derick). |
|
male(dominick). |
|
male(ellis). |
|
male(matt). |
|
male(scotty). |
|
male(tanner). |
|
male(vicente). |
|
|
|
:- 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). |
|
|
|
male_first_cousin_once_removed(X, Y) :- |
|
cousin(X, A), |
|
son(A, Y), |
|
X\=Y. |
|
|
|
mother(X, Y) :- |
|
parent(X, Y), |
|
female(Y). |
|
|
|
:- dynamic message_hook/3. |
|
:- multifile message_hook/3. |
|
|
|
|
|
father(X, Y) :- |
|
parent(X, Y), |
|
male(Y). |
|
|
|
female_first_cousin_once_removed(X, Y) :- |
|
cousin(X, A), |
|
daughter(A, Y), |
|
X\=Y. |
|
|
|
:- dynamic female/1. |
|
|
|
female(antionette). |
|
female(daisy). |
|
female(deanna). |
|
female(dixie). |
|
female(ila). |
|
female(johnna). |
|
female(kanesha). |
|
female(kari). |
|
female(lyndia). |
|
female(maggie). |
|
female(meghann). |
|
female(miki). |
|
female(reyna). |
|
female(rosalee). |
|
female(thomasine). |
|
|
|
male_second_cousin(X, Y) :- |
|
parent(X, A), |
|
parent(Y, B), |
|
cousin(A, B), |
|
male(Y), |
|
X\=Y. |
|
|
|
brother(X, Y) :- |
|
sibling(X, Y), |
|
male(Y). |
|
|
|
:- dynamic resource/2. |
|
:- multifile resource/2. |
|
|
|
|
|
:- dynamic portray/1. |
|
:- multifile portray/1. |
|
|
|
|
|
:- dynamic goal_expansion/2. |
|
:- multifile goal_expansion/2. |
|
|
|
|
|
female_second_cousin(X, Y) :- |
|
parent(X, A), |
|
parent(Y, B), |
|
cousin(A, B), |
|
female(Y), |
|
X\=Y. |
|
|
|
:- dynamic prolog_load_file/2. |
|
:- multifile prolog_load_file/2. |
|
|
|
|
|
male_cousin(X, Y) :- |
|
cousin(X, Y), |
|
male(Y). |
|
|
|
sister(Y, X) :- |
|
sibling(X, Y), |
|
female(X). |
|
|
|
:- multifile prolog_clause_name/2. |
|
|
|
|
|
female_cousin(X, Y) :- |
|
cousin(X, Y), |
|
female(Y). |
|
|
|
:- dynamic resource/3. |
|
:- multifile resource/3. |
|
|
|
|
|
cousin(X, Y) :- |
|
parent(X, A), |
|
parent(Y, B), |
|
sibling(A, B), |
|
X\=Y. |
|
|
|
:- dynamic parent/2. |
|
|
|
parent(alfonso, derick). |
|
parent(alfonso, kanesha). |
|
parent(alton, antionette). |
|
parent(alton, deangelo). |
|
parent(antionette, derick). |
|
parent(antionette, kanesha). |
|
parent(colby, derick). |
|
parent(colby, kanesha). |
|
parent(daisy, matt). |
|
parent(daisy, thomasine). |
|
parent(deanna, daisy). |
|
parent(deanna, dominick). |
|
parent(dixie, antionette). |
|
parent(dixie, deangelo). |
|
parent(dominick, derick). |
|
parent(dominick, kanesha). |
|
parent(ellis, alfonso). |
|
parent(ellis, ila). |
|
parent(johnna, antionette). |
|
parent(johnna, deangelo). |
|
parent(kari, derick). |
|
parent(kari, kanesha). |
|
parent(lyndia, maggie). |
|
parent(lyndia, scotty). |
|
parent(matt, lyndia). |
|
parent(matt, vicente). |
|
parent(meghann, matt). |
|
parent(meghann, thomasine). |
|
parent(miki, meghann). |
|
parent(miki, tanner). |
|
parent(reyna, daisy). |
|
parent(reyna, dominick). |
|
parent(rosalee, daisy). |
|
parent(rosalee, dominick). |
|
|
|
:- dynamic nonbinary/1. |
|
|
|
|
|
married(X, Y) :- |
|
parent(Child, X), |
|
parent(Child, Y), |
|
X\=Y. |
|
|
|
uncle(X, Y) :- |
|
parent(X, A), |
|
brother(A, Y). |
|
|
|
aunt(X, Y) :- |
|
parent(X, A), |
|
sister(A, Y). |
|
|
|
:- dynamic pyrun/2. |
|
|
|
pyrun(A, B) :- |
|
read_term_from_atom(A, C, [variable_names(B)]), |
|
call(C). |
|
|
|
:- dynamic save_all_clauses_to_file/1. |
|
|
|
save_all_clauses_to_file(A) :- |
|
open(A, write, B), |
|
set_output(B), |
|
listing, |
|
close(B). |
|
|
|
sibling(X, Y) :- |
|
parent(X, A), |
|
parent(Y, A), |
|
X\=Y. |
|
|
|
second_uncle(X, Y) :- |
|
great_grandparent(X, A), |
|
brother(A, Y). |
|
|