File size: 44,457 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

:- 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("Abdul Felker", "birdwatching").
hobby("Adolph Barbee", "geography").
hobby("Alice Lance", "research").
hobby("Allie Barbee", "audiophile").
hobby("Allison Barbee", "knowledge/word games").
hobby("Alvin Lance", "geocaching").
hobby("Andres Barbee", "croquet").
hobby("Andrew Parkinson", "badminton").
hobby("Brooks George", "fossil hunting").
hobby("Clint Rahman", "rail transport modelling").
hobby("Colette Rahman", "jujitsu").
hobby("Courtney Parkinson", "beauty pageants").
hobby("Dalton Parkinson", "softball").
hobby("Dollie Barbee", "golfing").
hobby("Elicia Barbee", "inline skating").
hobby("Elyse Barbee", "radio-controlled model collecting").
hobby("Emma George", "videography").
hobby("Garth Kean", "butterfly watching").
hobby("Guadalupe Barbee", "learning").
hobby("Jenni Felker", "business").
hobby("Karolyn Lance", "curling").
hobby("Kelley Barbee", "magnet fishing").
hobby("Kenny Barbee", "pickleball").
hobby("Kirk Lo", "shuffleboard").
hobby("Konstantin Barbee", "geocaching").
hobby("Korey Kean", "trade fair visiting").
hobby("Krystle Barbee", "lapel pins").
hobby("Kurt Parkinson", "rock balancing").
hobby("Latosha Rahman", "breakdancing").
hobby("Leonila Parkinson", "audiophile").
hobby("Lesley Barbee", "dairy farming").
hobby("Lyndon Barbee", "research").
hobby("Marvin Hope", "mineral collecting").
hobby("Merrill Kean", "research").
hobby("Mitchel George", "mineral collecting").
hobby("Nettie Barbee", "learning").
hobby("Rocco Lance", "magnet fishing").
hobby("Rory George", "whale watching").
hobby("Royce Lo", "research").
hobby("Rudy Barbee", "fusilately").
hobby("Solomon Rahman", "shortwave listening").
hobby("Tracey Kean", "microscopy").
hobby("Twyla Parkinson", "life science").
hobby("Tyrone Parkinson", "meditation").
hobby("Wallace Ragland", "science and technology studies").
hobby("Walter Hope", "frisbee").
hobby("Wanda Lo", "satellite watching").
hobby("Wanita Hope", "chemistry").
hobby("Willie Parkinson", "ballet dancing").
hobby("Yasmin Ragland", "antiquities").
hobby("Ahmad Vansickle", "rock balancing").
hobby("Albertine Thrower", "leaves").
hobby("Alejandrina Thrower", "table football").
hobby("Andre Vansickle", "shogi").
hobby("Benny Guay", "learning").
hobby("Brain Thrower", "radio-controlled model playing").
hobby("Candice Bianchi", "whale watching").
hobby("Carmen Bianchi", "sociology").
hobby("Cesar Guay", "people-watching").
hobby("Chrissy Vansickle", "bowling").
hobby("Concepcion Najera", "city trip").
hobby("Edgar Bianchi", "ant farming").
hobby("Esperanza Bianchi", "whale watching").
hobby("Esperanza Ervin", "button collecting").
hobby("Eve Ervin", "archaeology").
hobby("Georgette Gebhart", "herping").
hobby("Gertrude Guay", "audiophile").
hobby("Hal Gebhart", "fencing").
hobby("Jaime Veilleux", "magnet fishing").
hobby("Jim Bianchi", "mineral collecting").
hobby("Joshua Ervin", "table tennis").
hobby("Kendrick Sherrod", "shortwave listening").
hobby("Kristopher Veilleux", "geocaching").
hobby("Landon Ervin", "physics").
hobby("Laurel Bianchi", "polo").
hobby("Laurel Guay", "lotology").
hobby("Linwood Thrower", "stone collecting").
hobby("Loraine Vansickle", "flower collecting and pressing").
hobby("Lucas Bianchi", "research").
hobby("Lura Bianchi", "netball").
hobby("Maragret Bianchi", "architecture").
hobby("Mauricio Vansickle", "bus spotting").
hobby("Minerva Pennington", "shortwave listening").
hobby("Norris Sherrod", "radio-controlled model playing").
hobby("Ollie Bianchi", "archaeology").
hobby("Philip Thrower", "geography").
hobby("Pricilla Pennington", "audiophile").
hobby("Raphael Ervin", "sea glass collecting").
hobby("Renea Thrower", "auto audiophilia").
hobby("Robby Pennington", "aircraft spotting").
hobby("Rosena Veilleux", "stone collecting").
hobby("Roxy Guay", "fencing").
hobby("Roy Najera", "cribbage").
hobby("Sarita Bianchi", "ant-keeping").
hobby("Shante Najera", "skateboarding").
hobby("Shizuko Veilleux", "herbalism").
hobby("Shon Guay", "satellite watching").
hobby("Sylvester Sherrod", "airsoft").
hobby("Twila Veilleux", "beekeeping").
hobby("Winnifred Sherrod", "darts").
hobby("Zachary Guay", "photography").

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

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

:- dynamic job/2.

job("Abdul Felker", "police officer").
job("Adolph Barbee", "community education officer").
job("Alice Lance", "herbalist").
job("Allie Barbee", "podiatrist").
job("Allison Barbee", "prison officer").
job("Alvin Lance", "animal technologist").
job("Andres Barbee", "leisure centre manager").
job("Andrew Parkinson", "speech and language therapist").
job("Brooks George", "dietitian").
job("Clint Rahman", "amenity horticulturist").
job("Colette Rahman", "theatre stage manager").
job("Courtney Parkinson", "hydrologist").
job("Dalton Parkinson", "learning mentor").
job("Dollie Barbee", "location manager").
job("Elicia Barbee", "chartered management accountant").
job("Elyse Barbee", "plant breeder").
job("Emma George", "advertising account executive").
job("Garth Kean", "tourism officer").
job("Guadalupe Barbee", "civil service fast streamer").
job("Jenni Felker", "designer").
job("Karolyn Lance", "development worker").
job("Kelley Barbee", "tourist information centre manager").
job("Kenny Barbee", "community education officer").
job("Kirk Lo", "farm manager").
job("Konstantin Barbee", "doctor").
job("Korey Kean", "newspaper journalist").
job("Krystle Barbee", "customer service manager").
job("Kurt Parkinson", "public house manager").
job("Latosha Rahman", "exercise physiologist").
job("Leonila Parkinson", "early years teacher").
job("Lesley Barbee", "chief executive officer").
job("Lyndon Barbee", "bookseller").
job("Marvin Hope", "physiotherapist").
job("Merrill Kean", "occupational hygienist").
job("Mitchel George", "advertising copywriter").
job("Nettie Barbee", "radiographer").
job("Rocco Lance", "mining engineer").
job("Rory George", "warden").
job("Royce Lo", "regulatory affairs officer").
job("Rudy Barbee", "location manager").
job("Solomon Rahman", "producer").
job("Tracey Kean", "teaching laboratory technician").
job("Twyla Parkinson", "orthoptist").
job("Tyrone Parkinson", "agricultural consultant").
job("Wallace Ragland", "quarry manager").
job("Walter Hope", "risk analyst").
job("Wanda Lo", "physiological scientist").
job("Wanita Hope", "equality and diversity officer").
job("Willie Parkinson", "firefighter").
job("Yasmin Ragland", "purchasing manager").
job("Ahmad Vansickle", "illustrator").
job("Albertine Thrower", "press photographer").
job("Alejandrina Thrower", "legal executive").
job("Andre Vansickle", "neurosurgeon").
job("Benny Guay", "IT sales professional").
job("Brain Thrower", "quarry manager").
job("Candice Bianchi", "veterinary surgeon").
job("Carmen Bianchi", "merchandiser").
job("Cesar Guay", "clinical scientist").
job("Chrissy Vansickle", "equities trader").
job("Concepcion Najera", "TEFL teacher").
job("Edgar Bianchi", "pension scheme manager").
job("Esperanza Bianchi", "outdoor activities manager").
job("Esperanza Ervin", "musician").
job("Eve Ervin", "artist").
job("Georgette Gebhart", "customer service manager").
job("Gertrude Guay", "dancer").
job("Hal Gebhart", "educational psychologist").
job("Jaime Veilleux", "animator").
job("Jim Bianchi", "barrister's clerk").
job("Joshua Ervin", "oceanographer").
job("Kendrick Sherrod", "chemical engineer").
job("Kristopher Veilleux", "animator").
job("Landon Ervin", "production designer").
job("Laurel Bianchi", "surveyor").
job("Laurel Guay", "animator").
job("Linwood Thrower", "advice worker").
job("Loraine Vansickle", "sports coach").
job("Lucas Bianchi", "scientific laboratory technician").
job("Lura Bianchi", "psychiatric nurse").
job("Maragret Bianchi", "water engineer").
job("Mauricio Vansickle", "professor emeritus").
job("Minerva Pennington", "loss adjuster").
job("Norris Sherrod", "sales promotion account executive").
job("Ollie Bianchi", "telecommunications researcher").
job("Philip Thrower", "music tutor").
job("Pricilla Pennington", "software engineer").
job("Raphael Ervin", "film editor").
job("Renea Thrower", "therapist").
job("Robby Pennington", "quarry manager").
job("Rosena Veilleux", "bookseller").
job("Roxy Guay", "public affairs consultant").
job("Roy Najera", "camera operator").
job("Sarita Bianchi", "artist").
job("Shante Najera", "secondary school teacher").
job("Shizuko Veilleux", "sports administrator").
job("Shon Guay", "radio producer").
job("Sylvester Sherrod", "seismic interpreter").
job("Twila Veilleux", "charity fundraiser").
job("Winnifred Sherrod", "museum education officer").
job("Zachary Guay", "artist").

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("Abdul Felker", "0895-03-24").
dob("Adolph Barbee", "0980-08-29").
dob("Alice Lance", "0951-04-07").
dob("Allie Barbee", "0928-07-23").
dob("Allison Barbee", "1005-06-23").
dob("Alvin Lance", "0950-05-19").
dob("Andres Barbee", "0977-09-16").
dob("Andrew Parkinson", "0952-04-16").
dob("Brooks George", "1006-06-23").
dob("Clint Rahman", "0866-11-02").
dob("Colette Rahman", "0861-05-02").
dob("Courtney Parkinson", "0954-06-24").
dob("Dalton Parkinson", "0984-02-16").
dob("Dollie Barbee", "0975-03-08").
dob("Elicia Barbee", "1040-03-27").
dob("Elyse Barbee", "1033-12-12").
dob("Emma George", "0978-10-20").
dob("Garth Kean", "0954-09-11").
dob("Guadalupe Barbee", "0950-11-19").
dob("Jenni Felker", "0896-03-17").
dob("Karolyn Lance", "0924-11-06").
dob("Kelley Barbee", "0952-08-19").
dob("Kenny Barbee", "0953-06-18").
dob("Kirk Lo", "1091-03-24").
dob("Konstantin Barbee", "1007-05-04").
dob("Korey Kean", "0984-12-02").
dob("Krystle Barbee", "1008-12-24").
dob("Kurt Parkinson", "0924-12-27").
dob("Latosha Rahman", "0840-02-22").
dob("Leonila Parkinson", "0924-09-18").
dob("Lesley Barbee", "1067-06-07").
dob("Lyndon Barbee", "1036-01-09").
dob("Marvin Hope", "1013-11-28").
dob("Merrill Kean", "0981-09-04").
dob("Mitchel George", "1007-06-03").
dob("Nettie Barbee", "1032-05-15").
dob("Rocco Lance", "0924-02-03").
dob("Rory George", "0974-12-02").
dob("Royce Lo", "1059-07-07").
dob("Rudy Barbee", "0927-04-02").
dob("Solomon Rahman", "0837-10-06").
dob("Tracey Kean", "0956-03-15").
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("Wanda Lo", "1059-03-28").
dob("Wanita Hope", "0977-12-27").
dob("Willie Parkinson", "0954-09-22").
dob("Yasmin Ragland", "0952-10-08").
dob("Ahmad Vansickle", "0993-08-22").
dob("Albertine Thrower", "0937-11-27").
dob("Alejandrina Thrower", "0913-03-27").
dob("Andre Vansickle", "1023-01-14").
dob("Benny Guay", "0967-12-07").
dob("Brain Thrower", "0914-08-21").
dob("Candice Bianchi", "0972-05-04").
dob("Carmen Bianchi", "0973-07-04").
dob("Cesar Guay", "0943-11-10").
dob("Chrissy Vansickle", "0996-09-22").
dob("Concepcion Najera", "0970-03-15").
dob("Edgar Bianchi", "0947-04-06").
dob("Esperanza Bianchi", "0894-11-11").
dob("Esperanza Ervin", "1005-08-13").
dob("Eve Ervin", "0973-09-08").
dob("Georgette Gebhart", "0903-01-10").
dob("Gertrude Guay", "0915-06-21").
dob("Hal Gebhart", "0903-10-03").
dob("Jaime Veilleux", "1036-02-05").
dob("Jim Bianchi", "0895-10-16").
dob("Joshua Ervin", "1003-03-26").
dob("Kendrick Sherrod", "1068-05-13").
dob("Kristopher Veilleux", "1068-05-01").
dob("Landon Ervin", "0975-04-15").
dob("Laurel Bianchi", "0974-01-03").
dob("Laurel Guay", "0941-08-21").
dob("Linwood Thrower", "0965-10-01").
dob("Loraine Vansickle", "0960-04-13").
dob("Lucas Bianchi", "0923-04-04").
dob("Lura Bianchi", "0945-08-20").
dob("Maragret Bianchi", "1000-02-09").
dob("Mauricio Vansickle", "0965-09-21").
dob("Minerva Pennington", "0992-06-19").
dob("Norris Sherrod", "1032-06-23").
dob("Ollie Bianchi", "0997-04-20").
dob("Philip Thrower", "0939-12-12").
dob("Pricilla Pennington", "0969-02-09").
dob("Raphael Ervin", "1032-04-29").
dob("Renea Thrower", "0969-02-09").
dob("Robby Pennington", "0968-05-13").
dob("Rosena Veilleux", "1039-12-18").
dob("Roxy Guay", "0969-01-11").
dob("Roy Najera", "0964-10-25").
dob("Sarita Bianchi", "0922-07-27").
dob("Shante Najera", "0999-05-20").
dob("Shizuko Veilleux", "1067-12-01").
dob("Shon Guay", "0915-06-10").
dob("Sylvester Sherrod", "1067-04-16").
dob("Twila Veilleux", "1091-12-30").
dob("Winnifred Sherrod", "1038-12-21").
dob("Zachary Guay", "0995-11-14").

:- 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("Abdul Felker", person).
type("Adolph Barbee", person).
type("Alice Lance", person).
type("Allie Barbee", person).
type("Allison Barbee", person).
type("Alvin Lance", person).
type("Andres Barbee", person).
type("Andrew Parkinson", person).
type("Brooks George", person).
type("Clint Rahman", person).
type("Colette Rahman", person).
type("Courtney Parkinson", person).
type("Dalton Parkinson", person).
type("Dollie Barbee", person).
type("Elicia Barbee", person).
type("Elyse Barbee", person).
type("Emma George", person).
type("Garth Kean", person).
type("Guadalupe Barbee", person).
type("Jenni Felker", person).
type("Karolyn Lance", person).
type("Kelley Barbee", person).
type("Kenny Barbee", person).
type("Kirk Lo", person).
type("Konstantin Barbee", person).
type("Korey Kean", person).
type("Krystle Barbee", person).
type("Kurt Parkinson", person).
type("Latosha Rahman", person).
type("Leonila Parkinson", person).
type("Lesley Barbee", person).
type("Lyndon Barbee", person).
type("Marvin Hope", person).
type("Merrill Kean", person).
type("Mitchel George", person).
type("Nettie Barbee", person).
type("Rocco Lance", person).
type("Rory George", person).
type("Royce Lo", person).
type("Rudy Barbee", person).
type("Solomon Rahman", person).
type("Tracey Kean", person).
type("Twyla Parkinson", person).
type("Tyrone Parkinson", person).
type("Wallace Ragland", person).
type("Walter Hope", person).
type("Wanda Lo", person).
type("Wanita Hope", person).
type("Willie Parkinson", person).
type("Yasmin Ragland", person).
type("Ahmad Vansickle", person).
type("Albertine Thrower", person).
type("Alejandrina Thrower", person).
type("Andre Vansickle", person).
type("Benny Guay", person).
type("Brain Thrower", person).
type("Candice Bianchi", person).
type("Carmen Bianchi", person).
type("Cesar Guay", person).
type("Chrissy Vansickle", person).
type("Concepcion Najera", person).
type("Edgar Bianchi", person).
type("Esperanza Bianchi", person).
type("Esperanza Ervin", person).
type("Eve Ervin", person).
type("Georgette Gebhart", person).
type("Gertrude Guay", person).
type("Hal Gebhart", person).
type("Jaime Veilleux", person).
type("Jim Bianchi", person).
type("Joshua Ervin", person).
type("Kendrick Sherrod", person).
type("Kristopher Veilleux", person).
type("Landon Ervin", person).
type("Laurel Bianchi", person).
type("Laurel Guay", person).
type("Linwood Thrower", person).
type("Loraine Vansickle", person).
type("Lucas Bianchi", person).
type("Lura Bianchi", person).
type("Maragret Bianchi", person).
type("Mauricio Vansickle", person).
type("Minerva Pennington", person).
type("Norris Sherrod", person).
type("Ollie Bianchi", person).
type("Philip Thrower", person).
type("Pricilla Pennington", person).
type("Raphael Ervin", person).
type("Renea Thrower", person).
type("Robby Pennington", person).
type("Rosena Veilleux", person).
type("Roxy Guay", person).
type("Roy Najera", person).
type("Sarita Bianchi", person).
type("Shante Najera", person).
type("Shizuko Veilleux", person).
type("Shon Guay", person).
type("Sylvester Sherrod", person).
type("Twila Veilleux", person).
type("Winnifred Sherrod", person).
type("Zachary Guay", 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").
attribute("newspaper journalist").
attribute("trade fair visiting").
attribute("customer service manager").
attribute("lapel pins").
attribute("public house manager").
attribute("rock balancing").
attribute("exercise physiologist").
attribute("breakdancing").
attribute("early years teacher").
attribute("audiophile").
attribute("chief executive officer").
attribute("dairy farming").
attribute("bookseller").
attribute("research").
attribute("physiotherapist").
attribute("mineral collecting").
attribute("occupational hygienist").
attribute("research").
attribute("advertising copywriter").
attribute("mineral collecting").
attribute("radiographer").
attribute("learning").
attribute("mining engineer").
attribute("magnet fishing").
attribute("warden").
attribute("whale watching").
attribute("regulatory affairs officer").
attribute("research").
attribute("location manager").
attribute("fusilately").
attribute("producer").
attribute("shortwave listening").
attribute("teaching laboratory technician").
attribute("microscopy").
attribute("orthoptist").
attribute("life science").
attribute("agricultural consultant").
attribute("meditation").
attribute("quarry manager").
attribute("science and technology studies").
attribute("risk analyst").
attribute("frisbee").
attribute("physiological scientist").
attribute("satellite watching").
attribute("equality and diversity officer").
attribute("chemistry").
attribute("firefighter").
attribute("ballet dancing").
attribute("purchasing manager").
attribute("antiquities").
attribute("illustrator").
attribute("rock balancing").
attribute("press photographer").
attribute("leaves").
attribute("legal executive").
attribute("table football").
attribute("neurosurgeon").
attribute("shogi").
attribute("IT sales professional").
attribute("learning").
attribute("quarry manager").
attribute("radio-controlled model playing").
attribute("veterinary surgeon").
attribute("whale watching").
attribute("merchandiser").
attribute("sociology").
attribute("clinical scientist").
attribute("people-watching").
attribute("equities trader").
attribute("bowling").
attribute("TEFL teacher").
attribute("city trip").
attribute("pension scheme manager").
attribute("ant farming").
attribute("outdoor activities manager").
attribute("whale watching").
attribute("musician").
attribute("button collecting").
attribute("artist").
attribute("archaeology").
attribute("customer service manager").
attribute("herping").
attribute("dancer").
attribute("audiophile").
attribute("educational psychologist").
attribute("fencing").
attribute("animator").
attribute("magnet fishing").
attribute("barrister's clerk").
attribute("mineral collecting").
attribute("oceanographer").
attribute("table tennis").
attribute("chemical engineer").
attribute("shortwave listening").
attribute("animator").
attribute("geocaching").
attribute("production designer").
attribute("physics").
attribute("surveyor").
attribute("polo").
attribute("animator").
attribute("lotology").
attribute("advice worker").
attribute("stone collecting").
attribute("sports coach").
attribute("flower collecting and pressing").
attribute("scientific laboratory technician").
attribute("research").
attribute("psychiatric nurse").
attribute("netball").
attribute("water engineer").
attribute("architecture").
attribute("professor emeritus").
attribute("bus spotting").
attribute("loss adjuster").
attribute("shortwave listening").
attribute("sales promotion account executive").
attribute("radio-controlled model playing").
attribute("telecommunications researcher").
attribute("archaeology").
attribute("music tutor").
attribute("geography").
attribute("software engineer").
attribute("audiophile").
attribute("film editor").
attribute("sea glass collecting").
attribute("therapist").
attribute("auto audiophilia").
attribute("quarry manager").
attribute("aircraft spotting").
attribute("bookseller").
attribute("stone collecting").
attribute("public affairs consultant").
attribute("fencing").
attribute("camera operator").
attribute("cribbage").
attribute("artist").
attribute("ant-keeping").
attribute("secondary school teacher").
attribute("skateboarding").
attribute("sports administrator").
attribute("herbalism").
attribute("radio producer").
attribute("satellite watching").
attribute("seismic interpreter").
attribute("airsoft").
attribute("charity fundraiser").
attribute("beekeeping").
attribute("museum education officer").
attribute("darts").
attribute("artist").
attribute("photography").

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_("Abdul Felker", "Carmen Bianchi").
friend_("Abdul Felker", "Norris Sherrod").
friend_("Abdul Felker", "Robby Pennington").
friend_("Adolph Barbee", "Allie Barbee").
friend_("Adolph Barbee", "Dalton Parkinson").
friend_("Adolph Barbee", "Solomon Rahman").
friend_("Adolph Barbee", "Twyla Parkinson").
friend_("Adolph Barbee", "Gertrude Guay").
friend_("Alice Lance", "Kirk Lo").
friend_("Alice Lance", "Leonila Parkinson").
friend_("Alice Lance", "Wanda Lo").
friend_("Alice Lance", "Raphael Ervin").
friend_("Alice Lance", "Twila Veilleux").
friend_("Allie Barbee", "Albertine Thrower").
friend_("Allie Barbee", "Brain Thrower").
friend_("Allison Barbee", "Rocco Lance").
friend_("Allison Barbee", "Linwood Thrower").
friend_("Alvin Lance", "Emma George").
friend_("Alvin Lance", "Joshua Ervin").
friend_("Andres Barbee", "Kirk Lo").
friend_("Andres Barbee", "Rocco Lance").
friend_("Andrew Parkinson", "Kirk Lo").
friend_("Andrew Parkinson", "Rocco Lance").
friend_("Andrew Parkinson", "Candice Bianchi").
friend_("Andrew Parkinson", "Esperanza Bianchi").
friend_("Andrew Parkinson", "Shizuko Veilleux").
friend_("Brooks George", "Minerva Pennington").
friend_("Clint Rahman", "Latosha Rahman").
friend_("Clint Rahman", "Wanda Lo").
friend_("Clint Rahman", "Alejandrina Thrower").
friend_("Colette Rahman", "Elyse Barbee").
friend_("Colette Rahman", "Latosha Rahman").
friend_("Colette Rahman", "Tracey Kean").
friend_("Colette Rahman", "Twyla Parkinson").
friend_("Colette Rahman", "Tyrone Parkinson").
friend_("Courtney Parkinson", "Tyrone Parkinson").
friend_("Courtney Parkinson", "Eve Ervin").
friend_("Courtney Parkinson", "Roy Najera").
friend_("Courtney Parkinson", "Twila Veilleux").
friend_("Dalton Parkinson", "Garth Kean").
friend_("Dalton Parkinson", "Walter Hope").
friend_("Dollie Barbee", "Karolyn Lance").
friend_("Dollie Barbee", "Ollie Bianchi").
friend_("Dollie Barbee", "Sarita Bianchi").
friend_("Dollie Barbee", "Shante Najera").
friend_("Elicia Barbee", "Krystle Barbee").
friend_("Elicia Barbee", "Esperanza Bianchi").
friend_("Elicia Barbee", "Philip Thrower").
friend_("Elicia Barbee", "Roy Najera").
friend_("Elyse Barbee", "Guadalupe Barbee").
friend_("Elyse Barbee", "Rudy Barbee").
friend_("Elyse Barbee", "Concepcion Najera").
friend_("Emma George", "Lesley Barbee").
friend_("Emma George", "Loraine Vansickle").
friend_("Garth Kean", "Albertine Thrower").
friend_("Garth Kean", "Zachary Guay").
friend_("Guadalupe Barbee", "Gertrude Guay").
friend_("Guadalupe Barbee", "Laurel Bianchi").
friend_("Guadalupe Barbee", "Lura Bianchi").
friend_("Jenni Felker", "Twyla Parkinson").
friend_("Jenni Felker", "Hal Gebhart").
friend_("Karolyn Lance", "Korey Kean").
friend_("Karolyn Lance", "Solomon Rahman").
friend_("Karolyn Lance", "Esperanza Ervin").
friend_("Karolyn Lance", "Jim Bianchi").
friend_("Karolyn Lance", "Pricilla Pennington").
friend_("Karolyn Lance", "Roy Najera").
friend_("Karolyn Lance", "Shante Najera").
friend_("Kelley Barbee", "Solomon Rahman").
friend_("Kelley Barbee", "Ollie Bianchi").
friend_("Kenny Barbee", "Kristopher Veilleux").
friend_("Konstantin Barbee", "Shante Najera").
friend_("Korey Kean", "Lesley Barbee").
friend_("Korey Kean", "Landon Ervin").
friend_("Krystle Barbee", "Zachary Guay").
friend_("Kurt Parkinson", "Laurel Bianchi").
friend_("Leonila Parkinson", "Merrill Kean").
friend_("Leonila Parkinson", "Wallace Ragland").
friend_("Leonila Parkinson", "Joshua Ervin").
friend_("Lesley Barbee", "Solomon Rahman").
friend_("Lesley Barbee", "Carmen Bianchi").
friend_("Lyndon Barbee", "Rudy Barbee").
friend_("Lyndon Barbee", "Yasmin Ragland").
friend_("Lyndon Barbee", "Eve Ervin").
friend_("Lyndon Barbee", "Shizuko Veilleux").
friend_("Marvin Hope", "Shon Guay").
friend_("Merrill Kean", "Rocco Lance").
friend_("Merrill Kean", "Tracey Kean").
friend_("Merrill Kean", "Linwood Thrower").
friend_("Merrill Kean", "Minerva Pennington").
friend_("Merrill Kean", "Shon Guay").
friend_("Mitchel George", "Mauricio Vansickle").
friend_("Mitchel George", "Sarita Bianchi").
friend_("Mitchel George", "Shon Guay").
friend_("Mitchel George", "Sylvester Sherrod").
friend_("Nettie Barbee", "Renea Thrower").
friend_("Rory George", "Winnifred Sherrod").
friend_("Royce Lo", "Benny Guay").
friend_("Rudy Barbee", "Shizuko Veilleux").
friend_("Solomon Rahman", "Twyla Parkinson").
friend_("Solomon Rahman", "Philip Thrower").
friend_("Solomon Rahman", "Rosena Veilleux").
friend_("Solomon Rahman", "Roxy Guay").
friend_("Solomon Rahman", "Shon Guay").
friend_("Tracey Kean", "Esperanza Bianchi").
friend_("Tracey Kean", "Georgette Gebhart").
friend_("Tracey Kean", "Gertrude Guay").
friend_("Tracey Kean", "Pricilla Pennington").
friend_("Twyla Parkinson", "Gertrude Guay").
friend_("Twyla Parkinson", "Pricilla Pennington").
friend_("Wallace Ragland", "Candice Bianchi").
friend_("Wallace Ragland", "Gertrude Guay").
friend_("Wallace Ragland", "Lucas Bianchi").
friend_("Walter Hope", "Cesar Guay").
friend_("Walter Hope", "Concepcion Najera").
friend_("Walter Hope", "Lucas Bianchi").
friend_("Walter Hope", "Ollie Bianchi").
friend_("Walter Hope", "Roy Najera").
friend_("Wanita Hope", "Concepcion Najera").
friend_("Wanita Hope", "Sarita Bianchi").
friend_("Willie Parkinson", "Ahmad Vansickle").
friend_("Ahmad Vansickle", "Chrissy Vansickle").
friend_("Ahmad Vansickle", "Edgar Bianchi").
friend_("Ahmad Vansickle", "Jim Bianchi").
friend_("Ahmad Vansickle", "Roxy Guay").
friend_("Albertine Thrower", "Alejandrina Thrower").
friend_("Albertine Thrower", "Laurel Bianchi").
friend_("Albertine Thrower", "Pricilla Pennington").
friend_("Alejandrina Thrower", "Roy Najera").
friend_("Benny Guay", "Linwood Thrower").
friend_("Benny Guay", "Roxy Guay").
friend_("Brain Thrower", "Eve Ervin").
friend_("Carmen Bianchi", "Concepcion Najera").
friend_("Carmen Bianchi", "Robby Pennington").
friend_("Cesar Guay", "Esperanza Ervin").
friend_("Cesar Guay", "Pricilla Pennington").
friend_("Edgar Bianchi", "Minerva Pennington").
friend_("Edgar Bianchi", "Zachary Guay").
friend_("Esperanza Ervin", "Roy Najera").
friend_("Georgette Gebhart", "Linwood Thrower").
friend_("Hal Gebhart", "Jim Bianchi").
friend_("Hal Gebhart", "Robby Pennington").
friend_("Jaime Veilleux", "Norris Sherrod").
friend_("Jaime Veilleux", "Ollie Bianchi").
friend_("Jaime Veilleux", "Raphael Ervin").
friend_("Jim Bianchi", "Maragret Bianchi").
friend_("Jim Bianchi", "Sarita Bianchi").
friend_("Joshua Ervin", "Sarita Bianchi").
friend_("Joshua Ervin", "Shizuko Veilleux").
friend_("Kendrick Sherrod", "Kristopher Veilleux").
friend_("Kristopher Veilleux", "Sylvester Sherrod").
friend_("Landon Ervin", "Philip Thrower").
friend_("Laurel Guay", "Lura Bianchi").
friend_("Lucas Bianchi", "Rosena Veilleux").
friend_("Lucas Bianchi", "Zachary Guay").
friend_("Maragret Bianchi", "Minerva Pennington").
friend_("Mauricio Vansickle", "Rosena Veilleux").
friend_("Minerva Pennington", "Rosena Veilleux").
friend_("Norris Sherrod", "Ollie Bianchi").
friend_("Norris Sherrod", "Rosena Veilleux").
friend_("Norris Sherrod", "Shon Guay").
friend_("Raphael Ervin", "Roxy Guay").
friend_("Raphael Ervin", "Sarita Bianchi").
friend_("Robby Pennington", "Shon Guay").
friend_("Roxy Guay", "Winnifred Sherrod").

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("Alice Lance", "Karolyn Lance").
parent("Alice Lance", "Rocco Lance").
parent("Allison Barbee", "Andres Barbee").
parent("Allison Barbee", "Dollie Barbee").
parent("Alvin Lance", "Karolyn Lance").
parent("Alvin Lance", "Rocco Lance").
parent("Andres Barbee", "Kelley Barbee").
parent("Andres Barbee", "Kenny Barbee").
parent("Andrew Parkinson", "Kurt Parkinson").
parent("Andrew Parkinson", "Leonila Parkinson").
parent("Brooks George", "Emma George").
parent("Brooks George", "Rory George").
parent("Clint Rahman", "Latosha Rahman").
parent("Clint Rahman", "Solomon Rahman").
parent("Courtney Parkinson", "Karolyn Lance").
parent("Courtney Parkinson", "Rocco Lance").
parent("Dalton Parkinson", "Courtney Parkinson").
parent("Dalton Parkinson", "Willie Parkinson").
parent("Dollie Barbee", "Wallace Ragland").
parent("Dollie Barbee", "Yasmin Ragland").
parent("Elicia Barbee", "Konstantin Barbee").
parent("Elicia Barbee", "Krystle Barbee").
parent("Emma George", "Courtney Parkinson").
parent("Emma George", "Willie Parkinson").
parent("Guadalupe Barbee", "Allie Barbee").
parent("Guadalupe Barbee", "Rudy Barbee").
parent("Jenni Felker", "Clint Rahman").
parent("Jenni Felker", "Colette Rahman").
parent("Karolyn Lance", "Abdul Felker").
parent("Karolyn Lance", "Jenni Felker").
parent("Kelley Barbee", "Karolyn Lance").
parent("Kelley Barbee", "Rocco Lance").
parent("Kenny Barbee", "Allie Barbee").
parent("Kenny Barbee", "Rudy Barbee").
parent("Kirk Lo", "Royce Lo").
parent("Kirk Lo", "Wanda Lo").
parent("Konstantin Barbee", "Andres Barbee").
parent("Konstantin Barbee", "Dollie Barbee").
parent("Korey Kean", "Garth Kean").
parent("Korey Kean", "Tracey Kean").
parent("Krystle Barbee", "Walter Hope").
parent("Krystle Barbee", "Wanita Hope").
parent("Lesley Barbee", "Elyse Barbee").
parent("Lesley Barbee", "Lyndon Barbee").
parent("Lyndon Barbee", "Konstantin Barbee").
parent("Lyndon Barbee", "Krystle Barbee").
parent("Marvin Hope", "Walter Hope").
parent("Marvin Hope", "Wanita Hope").
parent("Merrill Kean", "Garth Kean").
parent("Merrill Kean", "Tracey Kean").
parent("Mitchel George", "Emma George").
parent("Mitchel George", "Rory George").
parent("Nettie Barbee", "Konstantin Barbee").
parent("Nettie Barbee", "Krystle Barbee").
parent("Tracey Kean", "Karolyn Lance").
parent("Tracey Kean", "Rocco Lance").
parent("Twyla Parkinson", "Kurt Parkinson").
parent("Twyla Parkinson", "Leonila Parkinson").
parent("Tyrone Parkinson", "Courtney Parkinson").
parent("Tyrone Parkinson", "Willie Parkinson").
parent("Wanda Lo", "Elyse Barbee").
parent("Wanda Lo", "Lyndon Barbee").
parent("Willie Parkinson", "Kurt Parkinson").
parent("Willie Parkinson", "Leonila Parkinson").
parent("Ahmad Vansickle", "Loraine Vansickle").
parent("Ahmad Vansickle", "Mauricio Vansickle").
parent("Albertine Thrower", "Georgette Gebhart").
parent("Albertine Thrower", "Hal Gebhart").
parent("Andre Vansickle", "Ahmad Vansickle").
parent("Andre Vansickle", "Chrissy Vansickle").
parent("Benny Guay", "Cesar Guay").
parent("Benny Guay", "Laurel Guay").
parent("Candice Bianchi", "Albertine Thrower").
parent("Candice Bianchi", "Philip Thrower").
parent("Carmen Bianchi", "Edgar Bianchi").
parent("Carmen Bianchi", "Lura Bianchi").
parent("Cesar Guay", "Gertrude Guay").
parent("Cesar Guay", "Shon Guay").
parent("Chrissy Vansickle", "Pricilla Pennington").
parent("Chrissy Vansickle", "Robby Pennington").
parent("Concepcion Najera", "Edgar Bianchi").
parent("Concepcion Najera", "Lura Bianchi").
parent("Edgar Bianchi", "Lucas Bianchi").
parent("Edgar Bianchi", "Sarita Bianchi").
parent("Esperanza Ervin", "Candice Bianchi").
parent("Esperanza Ervin", "Carmen Bianchi").
parent("Joshua Ervin", "Eve Ervin").
parent("Joshua Ervin", "Landon Ervin").
parent("Kendrick Sherrod", "Norris Sherrod").
parent("Kendrick Sherrod", "Winnifred Sherrod").
parent("Kristopher Veilleux", "Jaime Veilleux").
parent("Kristopher Veilleux", "Rosena Veilleux").
parent("Laurel Bianchi", "Edgar Bianchi").
parent("Laurel Bianchi", "Lura Bianchi").
parent("Linwood Thrower", "Albertine Thrower").
parent("Linwood Thrower", "Philip Thrower").
parent("Lucas Bianchi", "Esperanza Bianchi").
parent("Lucas Bianchi", "Jim Bianchi").
parent("Maragret Bianchi", "Candice Bianchi").
parent("Maragret Bianchi", "Carmen Bianchi").
parent("Minerva Pennington", "Pricilla Pennington").
parent("Minerva Pennington", "Robby Pennington").
parent("Ollie Bianchi", "Candice Bianchi").
parent("Ollie Bianchi", "Carmen Bianchi").
parent("Philip Thrower", "Alejandrina Thrower").
parent("Philip Thrower", "Brain Thrower").
parent("Pricilla Pennington", "Albertine Thrower").
parent("Pricilla Pennington", "Philip Thrower").
parent("Raphael Ervin", "Esperanza Ervin").
parent("Raphael Ervin", "Joshua Ervin").
parent("Renea Thrower", "Albertine Thrower").
parent("Renea Thrower", "Philip Thrower").
parent("Rosena Veilleux", "Esperanza Ervin").
parent("Rosena Veilleux", "Joshua Ervin").
parent("Roxy Guay", "Albertine Thrower").
parent("Roxy Guay", "Philip Thrower").
parent("Shante Najera", "Concepcion Najera").
parent("Shante Najera", "Roy Najera").
parent("Sylvester Sherrod", "Norris Sherrod").
parent("Sylvester Sherrod", "Winnifred Sherrod").
parent("Twila Veilleux", "Kristopher Veilleux").
parent("Twila Veilleux", "Shizuko Veilleux").
parent("Winnifred Sherrod", "Esperanza Ervin").
parent("Winnifred Sherrod", "Joshua Ervin").
parent("Zachary Guay", "Benny Guay").
parent("Zachary Guay", "Roxy Guay").

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("Abdul Felker", "male").
gender("Adolph Barbee", "male").
gender("Alice Lance", "female").
gender("Allie Barbee", "female").
gender("Allison Barbee", "female").
gender("Alvin Lance", "male").
gender("Andres Barbee", "male").
gender("Andrew Parkinson", "male").
gender("Brooks George", "male").
gender("Clint Rahman", "male").
gender("Colette Rahman", "female").
gender("Courtney Parkinson", "female").
gender("Dalton Parkinson", "male").
gender("Dollie Barbee", "female").
gender("Elicia Barbee", "female").
gender("Elyse Barbee", "female").
gender("Emma George", "female").
gender("Garth Kean", "male").
gender("Guadalupe Barbee", "male").
gender("Jenni Felker", "female").
gender("Karolyn Lance", "female").
gender("Kelley Barbee", "female").
gender("Kenny Barbee", "male").
gender("Kirk Lo", "male").
gender("Konstantin Barbee", "male").
gender("Korey Kean", "male").
gender("Krystle Barbee", "female").
gender("Kurt Parkinson", "male").
gender("Latosha Rahman", "female").
gender("Leonila Parkinson", "female").
gender("Lesley Barbee", "male").
gender("Lyndon Barbee", "male").
gender("Marvin Hope", "male").
gender("Merrill Kean", "male").
gender("Mitchel George", "male").
gender("Nettie Barbee", "female").
gender("Rocco Lance", "male").
gender("Rory George", "male").
gender("Royce Lo", "male").
gender("Rudy Barbee", "male").
gender("Solomon Rahman", "male").
gender("Tracey Kean", "female").
gender("Twyla Parkinson", "female").
gender("Tyrone Parkinson", "male").
gender("Wallace Ragland", "male").
gender("Walter Hope", "male").
gender("Wanda Lo", "female").
gender("Wanita Hope", "female").
gender("Willie Parkinson", "male").
gender("Yasmin Ragland", "female").
gender("Ahmad Vansickle", "male").
gender("Albertine Thrower", "female").
gender("Alejandrina Thrower", "female").
gender("Andre Vansickle", "male").
gender("Benny Guay", "male").
gender("Brain Thrower", "male").
gender("Candice Bianchi", "female").
gender("Carmen Bianchi", "male").
gender("Cesar Guay", "male").
gender("Chrissy Vansickle", "female").
gender("Concepcion Najera", "female").
gender("Edgar Bianchi", "male").
gender("Esperanza Bianchi", "female").
gender("Esperanza Ervin", "female").
gender("Eve Ervin", "female").
gender("Georgette Gebhart", "female").
gender("Gertrude Guay", "female").
gender("Hal Gebhart", "male").
gender("Jaime Veilleux", "male").
gender("Jim Bianchi", "male").
gender("Joshua Ervin", "male").
gender("Kendrick Sherrod", "male").
gender("Kristopher Veilleux", "male").
gender("Landon Ervin", "male").
gender("Laurel Bianchi", "female").
gender("Laurel Guay", "female").
gender("Linwood Thrower", "male").
gender("Loraine Vansickle", "female").
gender("Lucas Bianchi", "male").
gender("Lura Bianchi", "female").
gender("Maragret Bianchi", "female").
gender("Mauricio Vansickle", "male").
gender("Minerva Pennington", "female").
gender("Norris Sherrod", "male").
gender("Ollie Bianchi", "female").
gender("Philip Thrower", "male").
gender("Pricilla Pennington", "female").
gender("Raphael Ervin", "male").
gender("Renea Thrower", "female").
gender("Robby Pennington", "male").
gender("Rosena Veilleux", "female").
gender("Roxy Guay", "female").
gender("Roy Najera", "male").
gender("Sarita Bianchi", "female").
gender("Shante Najera", "female").
gender("Shizuko Veilleux", "female").
gender("Shon Guay", "male").
gender("Sylvester Sherrod", "male").
gender("Twila Veilleux", "female").
gender("Winnifred Sherrod", "female").
gender("Zachary Guay", "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.