prolog predicate problems

From: nissan2000 (billie_at_campus.ie)
Date: 08/16/04


Date: Mon, 16 Aug 2004 08:39:22 -0400

Im trying to figure out how write a predicate which replaces any occurence
of a known person in a list with the word 'man'. Known colors: bob, jim,
joe.
Eg:

?-person([that,person,is,bob,they,are,jim,and,joe],R).

R=[that,person,is,man,they,are,man,and,man]
More(y/n)

Heres what i have, but i am unable to finish it.

is_man(bob).
is_man(jim).
is_man(joe).

person( [], [] ).

person( [ H | T1 ], [ choice | T2 ] :-
    ????,
    ????.

person( [ H | T1 ], [ H | T2 ] ) :-
    ????.

thanks in advance.



Relevant Pages

  • Re: atomic
    ... Joe ... This might mean that Bob is the father of the empty set of children. ... far as the predicate is concerned, this might be seen as contradictory ...
    (comp.databases.theory)
  • Re: Biggest Sell-Outs
    ... > i'm going to have to stand my bob ground here. ... > argument beyond, "hey, it's one occurence in a 40 year career", but ...
    (rec.music.phish)