• Family tree prolog problem. There are 3 errors, which i have written be

    From The weeknd@21:1/5 to All on Sun Aug 8 09:22:09 2021
    male(dashrath).
    male(ram).
    male(laxman).
    male(bharat).
    male(luv).
    male(kush).
    male(son_of_laxman).

    female(kaushalya).
    female(sita).
    female(urmila).
    female(daughter_of_dashrath).

    father(dashrath,ram).
    father(dashrath,laxman).
    father(dashrath,bharat).
    father(ram,luv).
    father(ram,kush).
    father(laxman,son_of_laxman).
    father(dashrath,daughter_of_dashrath).

    husband(dashrath,kaushalya).
    husband(ram,sita).
    husband(laxman,urmila).

    mother(X,Y):- husband(Z,X),
    father(Z,Y).

    brother(X,Y):- father(Z,X),
    father(Z,Y),
    X<>Y, // operator expected
    male(X).

    sister(X,Y):- father(Z,X),
    father(Z,Y),
    X<>Y, // operator expected
    female(X).

    listbrothers(X) :- brother(Z,X),
    write(Z).

    listsisters(X):- sister(Z,X),
    write(Z).

    grandfather(X):- father(Y,Z), // end of file in quoted
    father(Z,X),
    write(Y, \" is the grandfather of \",X,\"\\n\").

    grandmother(X):- husband(Z,X),
    father(Z,V),
    father(V,Y),
    write(Y, \" is the grandmother of \",X,\"\\n\").


    listgrandsons(X):- father(X,Z),
    father(Z,Y),
    male(Y),
    write(Y,\"\\n\"),
    fail.

    listgrandsons(X):- husband(Y,X),
    father(Y,V),
    father(V,Z),
    male(Z),
    write(Z,\"\\n\"),
    fail.

    listgranddaughters(X):- father(X,Z),
    father(Z,Y),
    female(Y),
    write(Y,\"\\n\"),
    fail.

    listgranddaughters(X):- husband(Y,X),
    father(Y,V),
    father(V,Z),
    female(Z),
    write(Z,\"\\n\"),
    fail.

    uncle(X):- brother(Z,Y),
    father(Z,X),
    male(Y),
    write(Y,\"\\n\"),
    fail.

    aunt(X):- husband(Z,Y),
    brother(Z,V),
    father(V,X),
    write(Y,\"\\n\"),
    fail.

    cousin(X):- father(Z,X),
    father(V,Y),
    Z<>V,
    brother(V,Z),
    write(Y,\"\\n\").


    repeat.
    repeat:- repeat.

    action(1):- write(\"\\nEnter name of person whose father is to be found : \"),
    readln(X),
    write(\"\\n\"),
    write(\"Father of \",X,\" is:\"),
    father(Z,X),
    write(Z,\"\\n\"),
    fail.

    action(2):- write(\"\\nEnter name of person whose mother is to be found : \"),
    readln(X),
    write(\"\\n\"),
    write(\"Mother of \",X,\" is:\"),
    mother(Z,X),
    write(Z,\"\\n\"),
    fail.

    action(3):- write(\"\\nEnter name of person whose brothers are to be found : \"),
    readln(X),
    write(\"\\n\"),
    write(\"Brothers of \",X,\" are:\\n\"),
    listbrothers(X),
    write(\"\\n\"),
    fail.

    action(4):- write(\"\\nEnter name of person whose sisters are to be found : \"),
    readln(X),
    write(\"\\n\"),
    write(\"Sisters of \",X,\" are:\\n\"),
    listsisters(X),
    write(\"\\n\"),
    fail.

    action(5):- write(\"\\nEnter name of person whose grandsons are to be found : \"),
    readln(X),
    write(\"\\n\"),
    write(\"Grandsons of \",X,\" are:\\n\"),
    listgrandsons(X),
    write(\"\\n\"),
    fail.


    action(6):- write(\"\\nEnter name of person whose granddaughters are to be found : \"),
    readln(X),
    write(\"\\n\"),
    write(\"Granddaughters of \",X,\" are:\\n\"),
    listgranddaughters(X),
    write(\"\\n\"),
    fail.

    action(7):- write(\"\\nEnter name of person whose uncles are to be found : \"),
    readln(X),
    write(\"\\n\"),
    write(\"Uncles of \",X,\" are:\\n\"),
    uncle(X),
    write(\"\\n\"),
    fail.
    action(8):- write(\"\\nEnter name of person whose aunties are to be found : \"),
    readln(X),
    write(\"\\n\"),
    write(\"Aunties of \",X,\" are:\\n\"),
    aunt(X),
    write(\"\\n\"),
    fail.


    action(9):- write(\"\\nEnter name of person whose cousins are to be found : \"),
    readln(X),
    write(\"\\n\"),
    write(\"Cousins of \",X,\" are:\\n\"),
    cousin(X),
    write(\"\\n\"),
    fail.

    action(0).

    printmenu :-
    repeat,
    write(\"\\n1. Display Father of?\\n\"),
    write(\"2. Display Mother of?\\n\"),
    write(\"3. List all brothers of?\\n\"),
    write(\"4. List all sisters of?\\n\"),
    write(\"5. List all grandson of?\\n\"),
    write(\"6. List all granddaughter of?\\n\"),
    write(\"7. List all uncles of?\\n\"),
    write(\"8. List all aunty of?\\n\"),
    write(\"9. list all cousins of?\\n\"),
    write(\"0. exit\\n\"),
    write(\"Enter your choice : \"),
    readInt(Choice),
    action(Choice),
    write(\"\\n\"),
    repeat.


    makewindow(1,2,3,\"Family Tree\",0,0,25,80),
    printmenu.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)