this post was submitted on 03 Jan 2025
44 points (92.3% liked)

Programmer Humor

32866 readers
1077 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 

something is a person if it is either Adam or Eve, or if it has a mother. We can express this in a single rule as follows:

person(X) :- (X=adam; X=eve; mother(X, Y)).

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 4 points 1 week ago* (last edited 1 week ago) (1 children)

doesn’t this definition lack a recursive case to ensure that the mother is either Eve or a descendent of Eve

We don’t see the definition of mother. It might already encode that Y is a person.

And there should probably be a father case in there as well?

While every person does also have a father, it’s completely redundant, since being a person can fully be described by [Edit: ~~being~~ having] a mother (or being Adam or Eve).

[–] [email protected] 1 points 1 week ago (1 children)

since being a person can fully be described by being a mother

Can you explain how this is?

[–] [email protected] 1 points 1 week ago

Thanks for catching that. I fixed my comment.