Friday, February 5, 2010
Introduction to Cognitive Science-Program to find relation(parent,child etc.)
Domains
name=string
Predicates
parent(name,name)
grandparent(name,name)
married(name,name)
brother(name,name)
sister(name,name)
male(name)
female(name)
aunts(name,name)
sisterinlaw(name,name)
grandmother(name,name)
father(name)
notwife(name,name)
Clauses
married(bernd,maria).
married(michael,vera).
married(karl,monika).
married(thomas,berbel).
married(sven,beate).
married(uwe,tina).
parent(maria,michael).
parent(bernd,silke).
parent(bernd,michael).
parent(maria,silke).
parent(michael,monika).
parent(michael,thomas).
parent(michael,lars).
parent(vera,monika).
parent(vera,thomas).
parent(vera,lars).
parent(monika,clara).
parent(karl,clara).
parent(thomas,ute).
parent(thomas,sabine).
parent(berbel,ute).
parent(berbel,sabine).
parent(beate,tina).
parent(sven,tina).
parent(tina,hans).
parent(uwe,hans).
parent(tina,simone).
parent(uwe,simone).
father(bernd).
father(michael).
father(karl).
father(thomas).
father(sven).
father(uwe).
notwife(michael,silke).
notwife(karl,lars).
male(bernd).
male(michael).
male(karl).
male(thomas).
male(ute).
male(sven).
male(uwe).
male(hans).
male(simone).
female(maria).
female(vera).
female(silke).
female(monika).
female(berbel).
female(lars).
female(clara).
female(sabine).
female(beate).
female(tine).
grandparent(X,Y):-parent(X,W),parent(W,Y).
grandmother(X,Y):-parent(X,W),parent(W,Y),female(X).
brother(X,Y):-parent(U,X),parent(U,Y),male(Y),father(U).
sister(X,Y):-parent(U,X),parent(U,Y),female(Y),father(U).
aunts(X,Y):-parent(W,X),parent(W,V),sister(V,X),parent(V,Y).
sisterinlaw(X,Y):-married(X,W),sister(W,Y),notwife(X,Y).
Goal
grandparent(X,simone).
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment