File size: 43,388 Bytes
d2a0598
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378

:- 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("Alethia Kidd", "amateur astronomy").
hobby("Alexis Kingsley", "crystals").
hobby("Ana Colin", "stamp collecting").
hobby("Antionette Song", "trainspotting").
hobby("Byron Song", "animation").
hobby("Carlos Baptiste", "esports").
hobby("Damon Song", "magnet fishing").
hobby("Danilo Colin", "billiards").
hobby("Deirdre Bivins", "iceboat racing").
hobby("Eddie Song", "aerospace").
hobby("Elisabeth Kingsley", "learning").
hobby("Felton Kidd", "meteorology").
hobby("Freda Song", "learning").
hobby("Gene Song", "trapshooting").
hobby("Genesis Colin", "shoes").
hobby("Geneva Song", "meteorology").
hobby("Gilbert Summerlin", "birdwatching").
hobby("Hannah Bivins", "mahjong").
hobby("Hyun Song", "horseback riding").
hobby("Idell Kidd", "birdwatching").
hobby("Isidro Kidd", "air sports").
hobby("Jamal Song", "publishing").
hobby("Jeana Song", "fossicking").
hobby("Jesse Kiel", "dolls").
hobby("Jolene Song", "web design").
hobby("Lance Kiel", "tourism").
hobby("Lester Bivins", "lapel pins").
hobby("Lynda Colin", "slot car").
hobby("Madaline Song", "audiophile").
hobby("Matilda Summerlin", "model united nations").
hobby("Maynard Song", "insect collecting").
hobby("Mckinley Colin", "baking").
hobby("Meghann Kidd", "mineral collecting").
hobby("Melvin Kidd", "stone collecting").
hobby("Nathaniel Song", "dandyism").
hobby("Nikki Kidd", "mineral collecting").
hobby("Nina Song", "digital hoarding").
hobby("Noreen Kingsley", "reading").
hobby("Ramona Colin", "pinball").
hobby("Romelia Song", "dog sport").
hobby("Seymour Song", "research").
hobby("Shelly Reece", "butterfly watching").
hobby("Sol Song", "research").
hobby("Stephan Kidd", "stamp collecting").
hobby("Tawana Summerlin", "jogging").
hobby("Thomasine Kidd", "rowing").
hobby("Tod Song", "sport stacking").
hobby("Twila Baptiste", "audiophile").
hobby("Winfred Baptiste", "seashell collecting").
hobby("Wyatt Reece", "skateboarding").
hobby("Yvette Song", "lomography").
hobby("Adah Camper", "ant farming").
hobby("Adele Ahmad", "rock tumbling").
hobby("Amos Vargas", "birdwatching").
hobby("Angie Vargas", "model aircraft").
hobby("Ayesha Abbate", "die-cast toy").
hobby("Bradley Yocum", "metal detecting").
hobby("Carina Vargas", "learning").
hobby("Christa Vargas", "phillumeny").
hobby("David Mcclelland", "cycling").
hobby("Derek Flatt", "benchmarking").
hobby("Eddy Vargas", "sociology").
hobby("Elfriede Moffitt", "shoes").
hobby("Eli Flatt", "jujitsu").
hobby("Elvie Vargas", "tourism").
hobby("Errol Camper", "ant farming").
hobby("Forrest Vargas", "slot car racing").
hobby("Fred Vargas", "flower collecting and pressing").
hobby("Gerry Vargas", "videography").
hobby("Ginger Hamrick", "powerlifting").
hobby("Harriette Vargas", "picnicking").
hobby("Ivan Abbate", "stone collecting").
hobby("Jeannie Loper", "sea glass collecting").
hobby("Joey Mcclelland", "radio-controlled model playing").
hobby("Kacey Yocum", "badminton").
hobby("Kendrick Vargas", "insect collecting").
hobby("Kraig Hamrick", "animation").
hobby("Livia Camper", "bowling").
hobby("Marlana Mcclelland", "disc golf").
hobby("Millard Camper", "model aircraft").
hobby("Newton Moffitt", "ant farming").
hobby("Nicholas Vargas", "geography").
hobby("Noe Vargas", "meditation").
hobby("Page Vargas", "slot car racing").
hobby("Pamula Flatt", "stone collecting").
hobby("Raphael Vargas", "roundnet").
hobby("Renaldo Ahmad", "chemistry").
hobby("Robyn Vargas", "tether car").
hobby("Ronnie Vargas", "roller skating").
hobby("Rosie Vargas", "aircraft spotting").
hobby("Son Loper", "martial arts").
hobby("Stevie Vargas", "rowing").
hobby("Thelma Flatt", "philately").
hobby("Theodore Yocum", "research").
hobby("Theron Mcclelland", "butterfly watching").
hobby("Toney Vargas", "neuroscience").
hobby("Valentina Vargas", "judo").
hobby("Wendell Flatt", "cycling").
hobby("Will Vargas", "myrmecology").
hobby("Winnifred Mcclelland", "auto audiophilia").
hobby("Xavier Vargas", "lomography").

granddaughter(X, Y) :-
    grandchild(X, Y),
    female(Y).

grandson(X, Y) :-
    grandchild(X, Y),
    male(Y).

:- dynamic job/2.

job("Alethia Kidd", "academic librarian").
job("Alexis Kingsley", "clinical research associate").
job("Ana Colin", "museum curator").
job("Antionette Song", "technical sales engineer").
job("Byron Song", "advertising account planner").
job("Carlos Baptiste", "toxicologist").
job("Damon Song", "education administrator").
job("Danilo Colin", "colour technologist").
job("Deirdre Bivins", "regulatory affairs officer").
job("Eddie Song", "gaffer").
job("Elisabeth Kingsley", "producer").
job("Felton Kidd", "newspaper journalist").
job("Freda Song", "social researcher").
job("Gene Song", "learning disability nurse").
job("Genesis Colin", "interior and spatial designer").
job("Geneva Song", "pharmacologist").
job("Gilbert Summerlin", "investment banker").
job("Hannah Bivins", "biomedical engineer").
job("Hyun Song", "marketing executive").
job("Idell Kidd", "chartered legal executive").
job("Isidro Kidd", "public relations officer").
job("Jamal Song", "nutritional therapist").
job("Jeana Song", "psychotherapist").
job("Jesse Kiel", "production designer").
job("Jolene Song", "phytotherapist").
job("Lance Kiel", "training and development officer").
job("Lester Bivins", "electronics engineer").
job("Lynda Colin", "contracting civil engineer").
job("Madaline Song", "air traffic controller").
job("Matilda Summerlin", "airline pilot").
job("Maynard Song", "IT consultant").
job("Mckinley Colin", "geophysical data processor").
job("Meghann Kidd", "careers information officer").
job("Melvin Kidd", "applications developer").
job("Nathaniel Song", "architectural technologist").
job("Nikki Kidd", "horticultural therapist").
job("Nina Song", "theme park manager").
job("Noreen Kingsley", "animal nutritionist").
job("Ramona Colin", "education administrator").
job("Romelia Song", "community development worker").
job("Seymour Song", "ophthalmologist").
job("Shelly Reece", "lobbyist").
job("Sol Song", "telecommunications researcher").
job("Stephan Kidd", "social worker").
job("Tawana Summerlin", "exercise physiologist").
job("Thomasine Kidd", "senior tax professional").
job("Tod Song", "environmental consultant").
job("Twila Baptiste", "soil scientist").
job("Winfred Baptiste", "interpreter").
job("Wyatt Reece", "professor emeritus").
job("Yvette Song", "archivist").
job("Adah Camper", "herpetologist").
job("Adele Ahmad", "transport planner").
job("Amos Vargas", "advice worker").
job("Angie Vargas", "hospital pharmacist").
job("Ayesha Abbate", "network engineer").
job("Bradley Yocum", "personal assistant").
job("Carina Vargas", "tax inspector").
job("Christa Vargas", "industrial buyer").
job("David Mcclelland", "physicist").
job("Derek Flatt", "sub").
job("Eddy Vargas", "market researcher").
job("Elfriede Moffitt", "building services engineer").
job("Eli Flatt", "general practice doctor").
job("Elvie Vargas", "dispensing optician").
job("Errol Camper", "company secretary").
job("Forrest Vargas", "sub").
job("Fred Vargas", "accounting technician").
job("Gerry Vargas", "local government officer").
job("Ginger Hamrick", "magazine features editor").
job("Harriette Vargas", "publishing rights manager").
job("Ivan Abbate", "government social research officer").
job("Jeannie Loper", "mudlogger").
job("Joey Mcclelland", "senior tax professional").
job("Kacey Yocum", "patent examiner").
job("Kendrick Vargas", "science writer").
job("Kraig Hamrick", "estate agent").
job("Livia Camper", "lighting technician").
job("Marlana Mcclelland", "fine artist").
job("Millard Camper", "ship broker").
job("Newton Moffitt", "tree surgeon").
job("Nicholas Vargas", "geologist").
job("Noe Vargas", "restaurant manager").
job("Page Vargas", "designer").
job("Pamula Flatt", "drilling engineer").
job("Raphael Vargas", "radiographer").
job("Renaldo Ahmad", "legal secretary").
job("Robyn Vargas", "health visitor").
job("Ronnie Vargas", "medical physicist").
job("Rosie Vargas", "engineer").
job("Son Loper", "geophysical data processor").
job("Stevie Vargas", "midwife").
job("Thelma Flatt", "financial risk analyst").
job("Theodore Yocum", "English as a foreign language teacher").
job("Theron Mcclelland", "personnel officer").
job("Toney Vargas", "systems analyst").
job("Valentina Vargas", "animator").
job("Wendell Flatt", "educational psychologist").
job("Will Vargas", "production manager").
job("Winnifred Mcclelland", "magazine journalist").
job("Xavier Vargas", "runner").

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("Alethia Kidd", "0873-07-19").
dob("Alexis Kingsley", "1041-10-02").
dob("Ana Colin", "0935-04-16").
dob("Antionette Song", "0991-05-04").
dob("Byron Song", "0908-09-14").
dob("Carlos Baptiste", "1044-12-31").
dob("Damon Song", "1021-10-02").
dob("Danilo Colin", "0909-08-09").
dob("Deirdre Bivins", "1021-12-21").
dob("Eddie Song", "0935-01-05").
dob("Elisabeth Kingsley", "1073-05-19").
dob("Felton Kidd", "0874-01-26").
dob("Freda Song", "0961-03-14").
dob("Gene Song", "1016-07-28").
dob("Genesis Colin", "0935-10-02").
dob("Geneva Song", "1017-08-26").
dob("Gilbert Summerlin", "0875-11-11").
dob("Hannah Bivins", "0991-10-05").
dob("Hyun Song", "0908-01-20").
dob("Idell Kidd", "0882-10-19").
dob("Isidro Kidd", "0900-05-25").
dob("Jamal Song", "0961-07-23").
dob("Jeana Song", "0965-11-11").
dob("Jesse Kiel", "0878-11-05").
dob("Jolene Song", "1015-01-07").
dob("Lance Kiel", "0879-03-08").
dob("Lester Bivins", "0991-03-23").
dob("Lynda Colin", "0941-08-16").
dob("Madaline Song", "0959-12-18").
dob("Matilda Summerlin", "0874-08-12").
dob("Maynard Song", "1023-05-28").
dob("Mckinley Colin", "0936-10-18").
dob("Meghann Kidd", "0929-12-23").
dob("Melvin Kidd", "0905-06-22").
dob("Nathaniel Song", "0985-07-27").
dob("Nikki Kidd", "0903-01-28").
dob("Nina Song", "0936-08-07").
dob("Noreen Kingsley", "1042-12-18").
dob("Ramona Colin", "0909-09-08").
dob("Romelia Song", "1020-12-02").
dob("Seymour Song", "0964-05-16").
dob("Shelly Reece", "0985-04-02").
dob("Sol Song", "0993-10-31").
dob("Stephan Kidd", "0852-06-22").
dob("Tawana Summerlin", "0904-08-01").
dob("Thomasine Kidd", "0854-04-15").
dob("Tod Song", "0993-10-31").
dob("Twila Baptiste", "1018-11-12").
dob("Winfred Baptiste", "1014-09-07").
dob("Wyatt Reece", "0983-05-04").
dob("Yvette Song", "0962-11-01").
dob("Adah Camper", "0932-07-19").
dob("Adele Ahmad", "0925-02-26").
dob("Amos Vargas", "0956-09-05").
dob("Angie Vargas", "0977-10-14").
dob("Ayesha Abbate", "0916-07-12").
dob("Bradley Yocum", "0978-01-11").
dob("Carina Vargas", "0983-08-23").
dob("Christa Vargas", "0955-08-11").
dob("David Mcclelland", "1006-12-16").
dob("Derek Flatt", "0970-03-01").
dob("Eddy Vargas", "0980-12-28").
dob("Elfriede Moffitt", "0880-02-08").
dob("Eli Flatt", "0945-08-01").
dob("Elvie Vargas", "1005-07-01").
dob("Errol Camper", "0927-10-02").
dob("Forrest Vargas", "1002-10-20").
dob("Fred Vargas", "0981-04-01").
dob("Gerry Vargas", "0980-03-01").
dob("Ginger Hamrick", "0947-04-05").
dob("Harriette Vargas", "0958-03-01").
dob("Ivan Abbate", "0919-06-20").
dob("Jeannie Loper", "0846-01-09").
dob("Joey Mcclelland", "0974-07-26").
dob("Kacey Yocum", "0982-03-17").
dob("Kendrick Vargas", "1010-11-04").
dob("Kraig Hamrick", "0950-03-09").
dob("Livia Camper", "0905-05-08").
dob("Marlana Mcclelland", "1006-08-22").
dob("Millard Camper", "0903-07-02").
dob("Newton Moffitt", "0880-10-06").
dob("Nicholas Vargas", "1033-02-24").
dob("Noe Vargas", "0983-04-25").
dob("Page Vargas", "1008-11-17").
dob("Pamula Flatt", "0946-04-07").
dob("Raphael Vargas", "1009-02-12").
dob("Renaldo Ahmad", "0928-10-18").
dob("Robyn Vargas", "1008-05-19").
dob("Ronnie Vargas", "0983-02-22").
dob("Rosie Vargas", "0983-02-16").
dob("Son Loper", "0851-04-10").
dob("Stevie Vargas", "0929-04-04").
dob("Thelma Flatt", "0968-03-13").
dob("Theodore Yocum", "1009-01-14").
dob("Theron Mcclelland", "1032-04-22").
dob("Toney Vargas", "1007-07-11").
dob("Valentina Vargas", "0929-05-28").
dob("Wendell Flatt", "0974-07-13").
dob("Will Vargas", "0958-01-11").
dob("Winnifred Mcclelland", "0974-12-02").
dob("Xavier Vargas", "0983-02-22").

:- 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("Alethia Kidd", person).
type("Alexis Kingsley", person).
type("Ana Colin", person).
type("Antionette Song", person).
type("Byron Song", person).
type("Carlos Baptiste", person).
type("Damon Song", person).
type("Danilo Colin", person).
type("Deirdre Bivins", person).
type("Eddie Song", person).
type("Elisabeth Kingsley", person).
type("Felton Kidd", person).
type("Freda Song", person).
type("Gene Song", person).
type("Genesis Colin", person).
type("Geneva Song", person).
type("Gilbert Summerlin", person).
type("Hannah Bivins", person).
type("Hyun Song", person).
type("Idell Kidd", person).
type("Isidro Kidd", person).
type("Jamal Song", person).
type("Jeana Song", person).
type("Jesse Kiel", person).
type("Jolene Song", person).
type("Lance Kiel", person).
type("Lester Bivins", person).
type("Lynda Colin", person).
type("Madaline Song", person).
type("Matilda Summerlin", person).
type("Maynard Song", person).
type("Mckinley Colin", person).
type("Meghann Kidd", person).
type("Melvin Kidd", person).
type("Nathaniel Song", person).
type("Nikki Kidd", person).
type("Nina Song", person).
type("Noreen Kingsley", person).
type("Ramona Colin", person).
type("Romelia Song", person).
type("Seymour Song", person).
type("Shelly Reece", person).
type("Sol Song", person).
type("Stephan Kidd", person).
type("Tawana Summerlin", person).
type("Thomasine Kidd", person).
type("Tod Song", person).
type("Twila Baptiste", person).
type("Winfred Baptiste", person).
type("Wyatt Reece", person).
type("Yvette Song", person).
type("Adah Camper", person).
type("Adele Ahmad", person).
type("Amos Vargas", person).
type("Angie Vargas", person).
type("Ayesha Abbate", person).
type("Bradley Yocum", person).
type("Carina Vargas", person).
type("Christa Vargas", person).
type("David Mcclelland", person).
type("Derek Flatt", person).
type("Eddy Vargas", person).
type("Elfriede Moffitt", person).
type("Eli Flatt", person).
type("Elvie Vargas", person).
type("Errol Camper", person).
type("Forrest Vargas", person).
type("Fred Vargas", person).
type("Gerry Vargas", person).
type("Ginger Hamrick", person).
type("Harriette Vargas", person).
type("Ivan Abbate", person).
type("Jeannie Loper", person).
type("Joey Mcclelland", person).
type("Kacey Yocum", person).
type("Kendrick Vargas", person).
type("Kraig Hamrick", person).
type("Livia Camper", person).
type("Marlana Mcclelland", person).
type("Millard Camper", person).
type("Newton Moffitt", person).
type("Nicholas Vargas", person).
type("Noe Vargas", person).
type("Page Vargas", person).
type("Pamula Flatt", person).
type("Raphael Vargas", person).
type("Renaldo Ahmad", person).
type("Robyn Vargas", person).
type("Ronnie Vargas", person).
type("Rosie Vargas", person).
type("Son Loper", person).
type("Stevie Vargas", person).
type("Thelma Flatt", person).
type("Theodore Yocum", person).
type("Theron Mcclelland", person).
type("Toney Vargas", person).
type("Valentina Vargas", person).
type("Wendell Flatt", person).
type("Will Vargas", person).
type("Winnifred Mcclelland", person).
type("Xavier Vargas", person).

grandfather(X, Y) :-
    grandparent(X, Y),
    male(Y).

:- dynamic expand_query/4.
:- multifile expand_query/4.


:- dynamic attribute/1.

attribute("academic librarian").
attribute("amateur astronomy").
attribute("clinical research associate").
attribute("crystals").
attribute("museum curator").
attribute("stamp collecting").
attribute("technical sales engineer").
attribute("trainspotting").
attribute("advertising account planner").
attribute("animation").
attribute("toxicologist").
attribute("esports").
attribute("education administrator").
attribute("magnet fishing").
attribute("colour technologist").
attribute("billiards").
attribute("regulatory affairs officer").
attribute("iceboat racing").
attribute("gaffer").
attribute("aerospace").
attribute("producer").
attribute("learning").
attribute("newspaper journalist").
attribute("meteorology").
attribute("social researcher").
attribute("learning").
attribute("learning disability nurse").
attribute("trapshooting").
attribute("interior and spatial designer").
attribute("shoes").
attribute("pharmacologist").
attribute("meteorology").
attribute("investment banker").
attribute("birdwatching").
attribute("biomedical engineer").
attribute("mahjong").
attribute("marketing executive").
attribute("horseback riding").
attribute("chartered legal executive").
attribute("birdwatching").
attribute("public relations officer").
attribute("air sports").
attribute("nutritional therapist").
attribute("publishing").
attribute("psychotherapist").
attribute("fossicking").
attribute("production designer").
attribute("dolls").
attribute("phytotherapist").
attribute("web design").
attribute("training and development officer").
attribute("tourism").
attribute("electronics engineer").
attribute("lapel pins").
attribute("contracting civil engineer").
attribute("slot car").
attribute("air traffic controller").
attribute("audiophile").
attribute("airline pilot").
attribute("model united nations").
attribute("IT consultant").
attribute("insect collecting").
attribute("geophysical data processor").
attribute("baking").
attribute("careers information officer").
attribute("mineral collecting").
attribute("applications developer").
attribute("stone collecting").
attribute("architectural technologist").
attribute("dandyism").
attribute("horticultural therapist").
attribute("mineral collecting").
attribute("theme park manager").
attribute("digital hoarding").
attribute("animal nutritionist").
attribute("reading").
attribute("education administrator").
attribute("pinball").
attribute("community development worker").
attribute("dog sport").
attribute("ophthalmologist").
attribute("research").
attribute("lobbyist").
attribute("butterfly watching").
attribute("telecommunications researcher").
attribute("research").
attribute("social worker").
attribute("stamp collecting").
attribute("exercise physiologist").
attribute("jogging").
attribute("senior tax professional").
attribute("rowing").
attribute("environmental consultant").
attribute("sport stacking").
attribute("soil scientist").
attribute("audiophile").
attribute("interpreter").
attribute("seashell collecting").
attribute("professor emeritus").
attribute("skateboarding").
attribute("archivist").
attribute("lomography").
attribute("herpetologist").
attribute("ant farming").
attribute("transport planner").
attribute("rock tumbling").
attribute("advice worker").
attribute("birdwatching").
attribute("hospital pharmacist").
attribute("model aircraft").
attribute("network engineer").
attribute("die-cast toy").
attribute("personal assistant").
attribute("metal detecting").
attribute("tax inspector").
attribute("learning").
attribute("industrial buyer").
attribute("phillumeny").
attribute("physicist").
attribute("cycling").
attribute("sub").
attribute("benchmarking").
attribute("market researcher").
attribute("sociology").
attribute("building services engineer").
attribute("shoes").
attribute("general practice doctor").
attribute("jujitsu").
attribute("dispensing optician").
attribute("tourism").
attribute("company secretary").
attribute("ant farming").
attribute("sub").
attribute("slot car racing").
attribute("accounting technician").
attribute("flower collecting and pressing").
attribute("local government officer").
attribute("videography").
attribute("magazine features editor").
attribute("powerlifting").
attribute("publishing rights manager").
attribute("picnicking").
attribute("government social research officer").
attribute("stone collecting").
attribute("mudlogger").
attribute("sea glass collecting").
attribute("senior tax professional").
attribute("radio-controlled model playing").
attribute("patent examiner").
attribute("badminton").
attribute("science writer").
attribute("insect collecting").
attribute("estate agent").
attribute("animation").
attribute("lighting technician").
attribute("bowling").
attribute("fine artist").
attribute("disc golf").
attribute("ship broker").
attribute("model aircraft").
attribute("tree surgeon").
attribute("ant farming").
attribute("geologist").
attribute("geography").
attribute("restaurant manager").
attribute("meditation").
attribute("designer").
attribute("slot car racing").
attribute("drilling engineer").
attribute("stone collecting").
attribute("radiographer").
attribute("roundnet").
attribute("legal secretary").
attribute("chemistry").
attribute("health visitor").
attribute("tether car").
attribute("medical physicist").
attribute("roller skating").
attribute("engineer").
attribute("aircraft spotting").
attribute("geophysical data processor").
attribute("martial arts").
attribute("midwife").
attribute("rowing").
attribute("financial risk analyst").
attribute("philately").
attribute("English as a foreign language teacher").
attribute("research").
attribute("personnel officer").
attribute("butterfly watching").
attribute("systems analyst").
attribute("neuroscience").
attribute("animator").
attribute("judo").
attribute("educational psychologist").
attribute("cycling").
attribute("production manager").
attribute("myrmecology").
attribute("magazine journalist").
attribute("auto audiophilia").
attribute("runner").
attribute("lomography").

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_("Alethia Kidd", "Carina Vargas").
friend_("Alethia Kidd", "Page Vargas").
friend_("Alethia Kidd", "Rosie Vargas").
friend_("Alexis Kingsley", "Antionette Song").
friend_("Alexis Kingsley", "Freda Song").
friend_("Alexis Kingsley", "Seymour Song").
friend_("Alexis Kingsley", "Sol Song").
friend_("Alexis Kingsley", "Forrest Vargas").
friend_("Ana Colin", "Jesse Kiel").
friend_("Ana Colin", "Matilda Summerlin").
friend_("Ana Colin", "Tod Song").
friend_("Ana Colin", "Robyn Vargas").
friend_("Ana Colin", "Will Vargas").
friend_("Antionette Song", "Adah Camper").
friend_("Antionette Song", "Ayesha Abbate").
friend_("Byron Song", "Nina Song").
friend_("Byron Song", "Kraig Hamrick").
friend_("Carlos Baptiste", "Gilbert Summerlin").
friend_("Carlos Baptiste", "Harriette Vargas").
friend_("Damon Song", "Jesse Kiel").
friend_("Damon Song", "Nina Song").
friend_("Danilo Colin", "Jesse Kiel").
friend_("Danilo Colin", "Nina Song").
friend_("Danilo Colin", "Bradley Yocum").
friend_("Danilo Colin", "Elfriede Moffitt").
friend_("Danilo Colin", "Toney Vargas").
friend_("Deirdre Bivins", "Noe Vargas").
friend_("Eddie Song", "Madaline Song").
friend_("Eddie Song", "Tod Song").
friend_("Eddie Song", "Adele Ahmad").
friend_("Elisabeth Kingsley", "Geneva Song").
friend_("Elisabeth Kingsley", "Madaline Song").
friend_("Elisabeth Kingsley", "Shelly Reece").
friend_("Elisabeth Kingsley", "Sol Song").
friend_("Elisabeth Kingsley", "Stephan Kidd").
friend_("Felton Kidd", "Stephan Kidd").
friend_("Felton Kidd", "Elvie Vargas").
friend_("Felton Kidd", "Thelma Flatt").
friend_("Felton Kidd", "Will Vargas").
friend_("Freda Song", "Hannah Bivins").
friend_("Freda Song", "Thomasine Kidd").
friend_("Gene Song", "Isidro Kidd").
friend_("Gene Song", "Pamula Flatt").
friend_("Gene Song", "Theodore Yocum").
friend_("Gene Song", "Theron Mcclelland").
friend_("Genesis Colin", "Lester Bivins").
friend_("Genesis Colin", "Elfriede Moffitt").
friend_("Genesis Colin", "Raphael Vargas").
friend_("Genesis Colin", "Thelma Flatt").
friend_("Geneva Song", "Hyun Song").
friend_("Geneva Song", "Romelia Song").
friend_("Geneva Song", "Derek Flatt").
friend_("Gilbert Summerlin", "Maynard Song").
friend_("Gilbert Summerlin", "Livia Camper").
friend_("Hannah Bivins", "Adah Camper").
friend_("Hannah Bivins", "Xavier Vargas").
friend_("Hyun Song", "Forrest Vargas").
friend_("Hyun Song", "Kacey Yocum").
friend_("Hyun Song", "Millard Camper").
friend_("Idell Kidd", "Sol Song").
friend_("Idell Kidd", "Fred Vargas").
friend_("Isidro Kidd", "Lance Kiel").
friend_("Isidro Kidd", "Seymour Song").
friend_("Isidro Kidd", "Eli Flatt").
friend_("Isidro Kidd", "Ginger Hamrick").
friend_("Isidro Kidd", "Renaldo Ahmad").
friend_("Isidro Kidd", "Thelma Flatt").
friend_("Isidro Kidd", "Theron Mcclelland").
friend_("Jamal Song", "Seymour Song").
friend_("Jamal Song", "Pamula Flatt").
friend_("Jeana Song", "Jeannie Loper").
friend_("Jolene Song", "Theron Mcclelland").
friend_("Lance Kiel", "Maynard Song").
friend_("Lance Kiel", "Joey Mcclelland").
friend_("Lester Bivins", "Xavier Vargas").
friend_("Lynda Colin", "Kacey Yocum").
friend_("Matilda Summerlin", "Melvin Kidd").
friend_("Matilda Summerlin", "Tawana Summerlin").
friend_("Matilda Summerlin", "Harriette Vargas").
friend_("Maynard Song", "Seymour Song").
friend_("Maynard Song", "Carina Vargas").
friend_("Mckinley Colin", "Romelia Song").
friend_("Mckinley Colin", "Wyatt Reece").
friend_("Mckinley Colin", "Elvie Vargas").
friend_("Mckinley Colin", "Toney Vargas").
friend_("Meghann Kidd", "Valentina Vargas").
friend_("Melvin Kidd", "Nina Song").
friend_("Melvin Kidd", "Shelly Reece").
friend_("Melvin Kidd", "Kraig Hamrick").
friend_("Melvin Kidd", "Noe Vargas").
friend_("Melvin Kidd", "Valentina Vargas").
friend_("Nathaniel Song", "Nicholas Vargas").
friend_("Nathaniel Song", "Theodore Yocum").
friend_("Nathaniel Song", "Valentina Vargas").
friend_("Nathaniel Song", "Wendell Flatt").
friend_("Nikki Kidd", "Ronnie Vargas").
friend_("Noreen Kingsley", "Winnifred Mcclelland").
friend_("Ramona Colin", "Angie Vargas").
friend_("Romelia Song", "Toney Vargas").
friend_("Seymour Song", "Sol Song").
friend_("Seymour Song", "Raphael Vargas").
friend_("Seymour Song", "Son Loper").
friend_("Seymour Song", "Stevie Vargas").
friend_("Seymour Song", "Valentina Vargas").
friend_("Shelly Reece", "Elfriede Moffitt").
friend_("Shelly Reece", "Errol Camper").
friend_("Shelly Reece", "Forrest Vargas").
friend_("Shelly Reece", "Renaldo Ahmad").
friend_("Sol Song", "Forrest Vargas").
friend_("Sol Song", "Renaldo Ahmad").
friend_("Tawana Summerlin", "Bradley Yocum").
friend_("Tawana Summerlin", "Forrest Vargas").
friend_("Tawana Summerlin", "Marlana Mcclelland").
friend_("Thomasine Kidd", "Christa Vargas").
friend_("Thomasine Kidd", "Derek Flatt").
friend_("Thomasine Kidd", "Marlana Mcclelland").
friend_("Thomasine Kidd", "Pamula Flatt").
friend_("Thomasine Kidd", "Thelma Flatt").
friend_("Twila Baptiste", "Derek Flatt").
friend_("Twila Baptiste", "Theodore Yocum").
friend_("Winfred Baptiste", "Yvette Song").
friend_("Yvette Song", "David Mcclelland").
friend_("Yvette Song", "Eddy Vargas").
friend_("Yvette Song", "Ginger Hamrick").
friend_("Yvette Song", "Stevie Vargas").
friend_("Adah Camper", "Adele Ahmad").
friend_("Adah Camper", "Kacey Yocum").
friend_("Adah Camper", "Renaldo Ahmad").
friend_("Adele Ahmad", "Thelma Flatt").
friend_("Angie Vargas", "Kraig Hamrick").
friend_("Angie Vargas", "Stevie Vargas").
friend_("Ayesha Abbate", "Elvie Vargas").
friend_("Carina Vargas", "Derek Flatt").
friend_("Carina Vargas", "Rosie Vargas").
friend_("Christa Vargas", "Eli Flatt").
friend_("Christa Vargas", "Renaldo Ahmad").
friend_("Eddy Vargas", "Noe Vargas").
friend_("Eddy Vargas", "Xavier Vargas").
friend_("Eli Flatt", "Thelma Flatt").
friend_("Errol Camper", "Kraig Hamrick").
friend_("Fred Vargas", "Ginger Hamrick").
friend_("Fred Vargas", "Rosie Vargas").
friend_("Gerry Vargas", "Page Vargas").
friend_("Gerry Vargas", "Pamula Flatt").
friend_("Gerry Vargas", "Robyn Vargas").
friend_("Ginger Hamrick", "Newton Moffitt").
friend_("Ginger Hamrick", "Theodore Yocum").
friend_("Harriette Vargas", "Theodore Yocum").
friend_("Harriette Vargas", "Toney Vargas").
friend_("Ivan Abbate", "Jeannie Loper").
friend_("Jeannie Loper", "Wendell Flatt").
friend_("Joey Mcclelland", "Raphael Vargas").
friend_("Kendrick Vargas", "Millard Camper").
friend_("Marlana Mcclelland", "Son Loper").
friend_("Marlana Mcclelland", "Xavier Vargas").
friend_("Newton Moffitt", "Noe Vargas").
friend_("Nicholas Vargas", "Son Loper").
friend_("Noe Vargas", "Son Loper").
friend_("Page Vargas", "Pamula Flatt").
friend_("Page Vargas", "Son Loper").
friend_("Page Vargas", "Valentina Vargas").
friend_("Robyn Vargas", "Stevie Vargas").
friend_("Robyn Vargas", "Theodore Yocum").
friend_("Rosie Vargas", "Valentina Vargas").
friend_("Stevie Vargas", "Winnifred Mcclelland").

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("Ana Colin", "Danilo Colin").
parent("Ana Colin", "Ramona Colin").
parent("Carlos Baptiste", "Twila Baptiste").
parent("Carlos Baptiste", "Winfred Baptiste").
parent("Damon Song", "Antionette Song").
parent("Damon Song", "Sol Song").
parent("Deirdre Bivins", "Hannah Bivins").
parent("Deirdre Bivins", "Lester Bivins").
parent("Eddie Song", "Byron Song").
parent("Eddie Song", "Hyun Song").
parent("Elisabeth Kingsley", "Alexis Kingsley").
parent("Elisabeth Kingsley", "Noreen Kingsley").
parent("Felton Kidd", "Stephan Kidd").
parent("Felton Kidd", "Thomasine Kidd").
parent("Gene Song", "Antionette Song").
parent("Gene Song", "Sol Song").
parent("Genesis Colin", "Melvin Kidd").
parent("Genesis Colin", "Nikki Kidd").
parent("Geneva Song", "Antionette Song").
parent("Geneva Song", "Sol Song").
parent("Hannah Bivins", "Jamal Song").
parent("Hannah Bivins", "Yvette Song").
parent("Idell Kidd", "Stephan Kidd").
parent("Idell Kidd", "Thomasine Kidd").
parent("Isidro Kidd", "Alethia Kidd").
parent("Isidro Kidd", "Felton Kidd").
parent("Jamal Song", "Eddie Song").
parent("Jamal Song", "Nina Song").
parent("Jeana Song", "Eddie Song").
parent("Jeana Song", "Nina Song").
parent("Jolene Song", "Shelly Reece").
parent("Jolene Song", "Wyatt Reece").
parent("Lynda Colin", "Danilo Colin").
parent("Lynda Colin", "Ramona Colin").
parent("Madaline Song", "Eddie Song").
parent("Madaline Song", "Nina Song").
parent("Maynard Song", "Antionette Song").
parent("Maynard Song", "Sol Song").
parent("Mckinley Colin", "Danilo Colin").
parent("Mckinley Colin", "Ramona Colin").
parent("Meghann Kidd", "Melvin Kidd").
parent("Meghann Kidd", "Nikki Kidd").
parent("Melvin Kidd", "Alethia Kidd").
parent("Melvin Kidd", "Felton Kidd").
parent("Nathaniel Song", "Freda Song").
parent("Nathaniel Song", "Seymour Song").
parent("Nikki Kidd", "Gilbert Summerlin").
parent("Nikki Kidd", "Matilda Summerlin").
parent("Noreen Kingsley", "Gene Song").
parent("Noreen Kingsley", "Jolene Song").
parent("Ramona Colin", "Jesse Kiel").
parent("Ramona Colin", "Lance Kiel").
parent("Romelia Song", "Antionette Song").
parent("Romelia Song", "Sol Song").
parent("Seymour Song", "Eddie Song").
parent("Seymour Song", "Nina Song").
parent("Sol Song", "Jamal Song").
parent("Sol Song", "Yvette Song").
parent("Tawana Summerlin", "Gilbert Summerlin").
parent("Tawana Summerlin", "Matilda Summerlin").
parent("Tod Song", "Jamal Song").
parent("Tod Song", "Yvette Song").
parent("Twila Baptiste", "Hannah Bivins").
parent("Twila Baptiste", "Lester Bivins").
parent("Yvette Song", "Genesis Colin").
parent("Yvette Song", "Mckinley Colin").
parent("Adah Camper", "Livia Camper").
parent("Adah Camper", "Millard Camper").
parent("Amos Vargas", "Stevie Vargas").
parent("Amos Vargas", "Valentina Vargas").
parent("Angie Vargas", "Eli Flatt").
parent("Angie Vargas", "Pamula Flatt").
parent("David Mcclelland", "Joey Mcclelland").
parent("David Mcclelland", "Winnifred Mcclelland").
parent("Derek Flatt", "Eli Flatt").
parent("Derek Flatt", "Pamula Flatt").
parent("Eddy Vargas", "Harriette Vargas").
parent("Eddy Vargas", "Will Vargas").
parent("Elfriede Moffitt", "Jeannie Loper").
parent("Elfriede Moffitt", "Son Loper").
parent("Elvie Vargas", "Angie Vargas").
parent("Elvie Vargas", "Gerry Vargas").
parent("Errol Camper", "Livia Camper").
parent("Errol Camper", "Millard Camper").
parent("Forrest Vargas", "Angie Vargas").
parent("Forrest Vargas", "Gerry Vargas").
parent("Fred Vargas", "Amos Vargas").
parent("Fred Vargas", "Christa Vargas").
parent("Gerry Vargas", "Amos Vargas").
parent("Gerry Vargas", "Christa Vargas").
parent("Harriette Vargas", "Adele Ahmad").
parent("Harriette Vargas", "Renaldo Ahmad").
parent("Kacey Yocum", "Amos Vargas").
parent("Kacey Yocum", "Christa Vargas").
parent("Kendrick Vargas", "Angie Vargas").
parent("Kendrick Vargas", "Gerry Vargas").
parent("Livia Camper", "Elfriede Moffitt").
parent("Livia Camper", "Newton Moffitt").
parent("Marlana Mcclelland", "Angie Vargas").
parent("Marlana Mcclelland", "Gerry Vargas").
parent("Nicholas Vargas", "Kendrick Vargas").
parent("Nicholas Vargas", "Page Vargas").
parent("Noe Vargas", "Amos Vargas").
parent("Noe Vargas", "Christa Vargas").
parent("Pamula Flatt", "Ayesha Abbate").
parent("Pamula Flatt", "Ivan Abbate").
parent("Raphael Vargas", "Ronnie Vargas").
parent("Raphael Vargas", "Rosie Vargas").
parent("Robyn Vargas", "Carina Vargas").
parent("Robyn Vargas", "Xavier Vargas").
parent("Ronnie Vargas", "Harriette Vargas").
parent("Ronnie Vargas", "Will Vargas").
parent("Rosie Vargas", "Ginger Hamrick").
parent("Rosie Vargas", "Kraig Hamrick").
parent("Thelma Flatt", "Eli Flatt").
parent("Thelma Flatt", "Pamula Flatt").
parent("Theodore Yocum", "Bradley Yocum").
parent("Theodore Yocum", "Kacey Yocum").
parent("Theron Mcclelland", "David Mcclelland").
parent("Theron Mcclelland", "Marlana Mcclelland").
parent("Toney Vargas", "Angie Vargas").
parent("Toney Vargas", "Gerry Vargas").
parent("Valentina Vargas", "Livia Camper").
parent("Valentina Vargas", "Millard Camper").
parent("Wendell Flatt", "Eli Flatt").
parent("Wendell Flatt", "Pamula Flatt").
parent("Will Vargas", "Stevie Vargas").
parent("Will Vargas", "Valentina Vargas").
parent("Xavier Vargas", "Harriette Vargas").
parent("Xavier Vargas", "Will Vargas").

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("Alethia Kidd", "female").
gender("Alexis Kingsley", "male").
gender("Ana Colin", "female").
gender("Antionette Song", "female").
gender("Byron Song", "male").
gender("Carlos Baptiste", "male").
gender("Damon Song", "male").
gender("Danilo Colin", "male").
gender("Deirdre Bivins", "female").
gender("Eddie Song", "male").
gender("Elisabeth Kingsley", "female").
gender("Felton Kidd", "male").
gender("Freda Song", "female").
gender("Gene Song", "male").
gender("Genesis Colin", "female").
gender("Geneva Song", "female").
gender("Gilbert Summerlin", "male").
gender("Hannah Bivins", "female").
gender("Hyun Song", "female").
gender("Idell Kidd", "female").
gender("Isidro Kidd", "male").
gender("Jamal Song", "male").
gender("Jeana Song", "female").
gender("Jesse Kiel", "female").
gender("Jolene Song", "female").
gender("Lance Kiel", "male").
gender("Lester Bivins", "male").
gender("Lynda Colin", "female").
gender("Madaline Song", "female").
gender("Matilda Summerlin", "female").
gender("Maynard Song", "male").
gender("Mckinley Colin", "male").
gender("Meghann Kidd", "female").
gender("Melvin Kidd", "male").
gender("Nathaniel Song", "male").
gender("Nikki Kidd", "female").
gender("Nina Song", "female").
gender("Noreen Kingsley", "female").
gender("Ramona Colin", "female").
gender("Romelia Song", "female").
gender("Seymour Song", "male").
gender("Shelly Reece", "female").
gender("Sol Song", "male").
gender("Stephan Kidd", "male").
gender("Tawana Summerlin", "female").
gender("Thomasine Kidd", "female").
gender("Tod Song", "male").
gender("Twila Baptiste", "female").
gender("Winfred Baptiste", "male").
gender("Wyatt Reece", "male").
gender("Yvette Song", "female").
gender("Adah Camper", "female").
gender("Adele Ahmad", "female").
gender("Amos Vargas", "male").
gender("Angie Vargas", "female").
gender("Ayesha Abbate", "female").
gender("Bradley Yocum", "male").
gender("Carina Vargas", "female").
gender("Christa Vargas", "female").
gender("David Mcclelland", "male").
gender("Derek Flatt", "male").
gender("Eddy Vargas", "male").
gender("Elfriede Moffitt", "female").
gender("Eli Flatt", "male").
gender("Elvie Vargas", "female").
gender("Errol Camper", "male").
gender("Forrest Vargas", "male").
gender("Fred Vargas", "male").
gender("Gerry Vargas", "male").
gender("Ginger Hamrick", "female").
gender("Harriette Vargas", "female").
gender("Ivan Abbate", "male").
gender("Jeannie Loper", "female").
gender("Joey Mcclelland", "male").
gender("Kacey Yocum", "female").
gender("Kendrick Vargas", "male").
gender("Kraig Hamrick", "male").
gender("Livia Camper", "female").
gender("Marlana Mcclelland", "female").
gender("Millard Camper", "male").
gender("Newton Moffitt", "male").
gender("Nicholas Vargas", "male").
gender("Noe Vargas", "male").
gender("Page Vargas", "female").
gender("Pamula Flatt", "female").
gender("Raphael Vargas", "male").
gender("Renaldo Ahmad", "male").
gender("Robyn Vargas", "female").
gender("Ronnie Vargas", "male").
gender("Rosie Vargas", "female").
gender("Son Loper", "male").
gender("Stevie Vargas", "male").
gender("Thelma Flatt", "female").
gender("Theodore Yocum", "male").
gender("Theron Mcclelland", "male").
gender("Toney Vargas", "male").
gender("Valentina Vargas", "female").
gender("Wendell Flatt", "male").
gender("Will Vargas", "male").
gender("Winnifred Mcclelland", "female").
gender("Xavier Vargas", "male").

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.