/* * Filename: mc3a.pro (marriage counsellor 3a) * * Programmer: Br. David Carlson * * Date of creation: September 15, 1993 * * Revised: December 11, 1999 to run under yap. * * Description: * * This program is used to predict whether or not two people have * (or will have) marriage problems. Use the goal: * problems(marriage, _). * to get a true or false answer. If you want to see the reasons for * a true answer, submit the goal: * problems(marriage, Reason). * The response will give a list or reasons for each way in which it * can be determined that the marriage has problems. * This program is a variation on mc3.pro. */ problems(marriage, [financial_problems | Reason]) :- problems(financial, Reason). problems(marriage, [sexual_problems | Reason]) :- problems(sexual, Reason). problems(marriage, [communications_problems | Reason]) :- problems(communications, Reason). problems(marriage, [psychological_problems | Reason]) :- problems(psychological, Reason). problems(marriage, [parental_divorce | Reason]) :- problems(parental_divorce, Reason). problems(financial, [unemployed_husband, unemployed_wife]) :- unemployed(husband), unemployed(wife). problems(financial, [unemployed_wife, underemployed_husband]) :- underemployed(husband), unemployed(wife). problems(financial, [unemployed_husband, underemployed_wife]) :- unemployed(husband), underemployed(wife). problems(sexual, [unfaithful_husband]) :- unfaithful(husband). problems(sexual, [unfaithful_wife]) :- unfaithful(wife). problems(sexual, [impotence_problems]) :- impotence. problems(communications, [domineering_husband]) :- domineering(husband). problems(communications, [domineering_wife]) :- domineering(wife). problems(communications, [abusive_husband]) :- abusive(husband). problems(communications, [abusive_wife]) :- abusive(wife). problems(communications, [reticent_husband]) :- reticent(husband). problems(communications, [reticent_wife]) :- reticent(wife). problems(psychological, [abusive_husband]) :- abusive(husband). problems(psychological, [abusive_wife]) :- abusive(wife). problems(psychological, [depressed_husband]) :- depressed(husband). problems(psychological, [depressed_wife]) :- depressed(wife). problems(parental_divorce, [parents_of_husband_divorced]) :- divorced_parents(husband). problems(parental_divorce, [parents_of_wife_divorced]) :- divorced_parents(wife). /* In the next section, fill in the data on the husband and wife to be * counselled. You need at least one entry for each predicate. */ unemployed(husband). underemployed(wife). unfaithful(husband) :- fail. unfaithful(wife) :- fail. impotence :- fail. domineering(husband). abusive(husband). reticent(husband) :- fail. reticent(wife). depressed(husband) :- fail. depressed(wife) :- fail. divorced_parents(husband) :- fail. divorced_parents(wife) :- fail.