So I have this knowledge base
family(person(name(tom),surname(fox),date(7,may,1950),job(bbc,15200)),
person(name(ann),surname(fox),date(9,may,1951),job(unemployed)),
children[person(name(pat),surname(fox),date(5,may,1973),job(unemployed)),
person(name(jim),surname(fox),date(5,may,1973),job(unemployed))]).
family(person(name(john),surname(doe),date(7,july,1957),job(carpenter,12300)),
person(name(lucy),surname(doe),date(19,february,1969),job(clerk,13500)),
children[person(name(mary),surname(doe),date(17,january,1990),job(unemployed)),
person(name(mat),surname(doe),date(4,may,1991),job(unemployed)),
person(name(george),surname(doe),date(5,august,1993),job(unemployed))]).
family(person(name(nick),surname(brown),date(14,may,1955),job(trucker,16300)),
person(name(carmen),surname(brown),date(25,april,1957),job(unemployed)),
children[person(name(david),surname(brown),date(15,august,1977),job(unemployed)),
person(name(james),surname(brown),date(7,october,1980),job(unemployed))]).
family(person(name(daniel),surname(sturgess),date(19,november,1956),job(unemployed)),
person(name(susan),surname(sturgess),date(18,october,1957),job(manager,15400)),
children[person(name(mick),surname(sturgess),date(5,december,1982),job(unemployed))]).
And what I'm trying to do is figure out a way to create a predicate wife/1 that will return all the working wives, and a predicate exists/1 that will return all the unemployed parents that are born before 1963.
I'm quite new to Prolog (using the swi environment) so any help is welcome!
children([person(...),person(...)])
. I also have a bug in my answer: job(Title,Salary) will not match: see my edit... – CapelliC