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)).

  • sebastiancarlos@lemmy.sdf.orgOP
    link
    fedilink
    arrow-up
    7
    ·
    6 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.