% majors.pl does-well-in(john, math). is-interested-in(john, accounting). is-important-in(math, accounting). is-in-demand(accounting). should-major-in(Student, Discipline) :- is-interested-in(Student, Discipline), does-well-in(Student, Subject), is-important-in(Subject, Discipline), is-in-demand(Discipline).