Skip to content
View aiml2704's full-sized avatar

Block or report aiml2704

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Please don't include any personal information such as legal names or email addresses. Maximum 250 characters, markdown supported. This note will be visible to only you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
aiml2704/README.md
  1. Program to find the minimum and maximum value between two inputs:

% min(X, Y, Min): Min is the minimum of X and Y min(X, Y, X) :- X =< Y. min(X, Y, Y) :- X > Y.

% max(X, Y, Max): Max is the maximum of X and Y max(X, Y, X) :- X >= Y. max(X, Y, Y) :- X < Y.

You can test the above rules with queries like: ?- min(5, 10, Min). Min = 5.

?- max(5, 10, Max). Max = 10. //////////////////////////////////////// 2)% Gender facts male(swarit). male(arnav). male(ayansh). male(meet). female(tirtha). female(viha). female(marvi). female(durva).

% Parent-child facts parent(swarit, tirtha). parent(swarit, arnav). parent(arnav, ayansh). parent(arnav, meet). parent(arnav, viha). parent(tirtha, marvi). parent(marvi, durva).

% Mother: A mother is a female parent mother(X, Y) :- female(X), parent(X, Y).

% Father: A father is a male parent father(X, Y) :- male(X), parent(X, Y).

% Sibling: Two people are siblings if they share a parent sibling(X, Y) :- parent(Z, X), parent(Z, Y), X = Y.

% Aunt: A female is an aunt if she is a sibling of a parent aunt(X, Y) :- female(X), sibling(X, Z), parent(Z, Y).

% Uncle: A male is an uncle if he is a sibling of a parent uncle(X, Y) :- male(X), sibling(X, Z), parent(Z, Y).

% Grandparent: A grandparent is a parent of a parent grandparent(X, Y) :- parent(X, Z), parent(Z, Y).

% Cousin: Two people are cousins if their parents are siblings cousin(X, Y) :- parent(Z, X), parent(W, Y), sibling(Z, W).

?- parent(swarit, Child). ?- sibling(arnav, Sibling). ?- grandparent(Grandparent, ayansh). ?- mother(marvi, durva). ?- uncle(Uncle, viha).

Popular repositories Loading

  1. aiml2704 aiml2704 Public

  2. op op Public

  3. Major-Project Major-Project Public