Question: Please help me, I don't know much about Answer set Prolog. 1.What is the English reading for each of the following rules? person(X) :-child(X). :-child(X),

Please help me, I don't know much about Answer set Prolog.

1.What is the English reading for each of the following rules?

person(X) :-child(X).

:-child(X), age(X, Y), Y >= 18.

-age(X, N) :-age(X, N1), N != N1.

age(leo, 35) | age(leo, 36).

adult(X) :-person(X),not child(X).

2.Write an ASP program that can determine if one person is a full brother, half-brother, or a step-brother of another person. The program you write should run with the DLV solver and should define three relations:

full_brother(X, Y)X is a full brother of Y, i.e., a brother born of the same mother and father

half_brother(X, Y)X is a half-brother of Y, i.e., a brother related through one parent only

step_brother(X, Y)X is a stepbrother of Y, i.e.,a son of one's stepparent by another partner

to test your program, use the family information provided in the starter file problem2.txt. Extend the starter file with your own rules for the three relations above. You may add helper predicates and rules as needed. Your solution may be tested on additional family trees.

person(mary). person(saul). person(monica). person(dan). person(melinda). person(andrew). person(ben). person(carmen). person(david). person(ethan). person(frank). sex(female). sex(male). sex_of(mary, female). sex_of(monica, female). sex_of(melinda, female). sex_of(carmen, female). % Closed World Assumption sex_of(X, male) :- person(X), not sex_of(X, female). mother(mary, andrew). mother(mary, ben). father(saul, andrew). father(saul, ben). mother(monica, carmen). mother(monica, david). mother(monica, ethan). father(dan, carmen). father(dan, david). father(dan, ethan). mother(melinda, frank). father(dan, frank). married(monica, saul). married(melinda, dan). % married is a symmetric relationmarried(X, Y) :- married(Y, X).

% ---------------------------------------------------% TODO: % full_brother(X, Y) X is a full brother of Y,% i.e., a brother with the same mother and father as Y

% TODO:

% half_brother(X, Y) X is a half-brother of Y,% i.e., a brother related through one parent only

% TODO

% step_brother(X, Y) X is a step brother of Y, i.e.,% a son of one's stepparent by another partner

% You can add helper predicates and rules as needed

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!