42

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
[-] sebastiancarlos 7 points 3 days ago

mother can be used in several ways. If both X and Y variables are uninitialized, then it looks for all mother relationships. If one of them is initialized, it looks for matching relationships. If both are initialized, it returns true if such a relationship exists.

this post was submitted on 03 Jan 2025
42 points (92.0% liked)

Programmer Humor

32706 readers
717 users here now

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

Rules:

founded 5 years ago
MODERATORS