:- dynamic business/1, at_family_outing/0, at_work/0, family/1, from_boss/1, from_son/1, in_meeting/0, son_at_school/0.
:-compile('C:/GorgiasB/gorgias-src-0.6d/lib/gorgias.pl').
:-compile('C:/GorgiasB/gorgias-src-0.6d/ext/lpwnf.pl').
:-consult('C:/GorgiasB/background.pl').
rule(r1(Call), allow(Call), []).
rule(r2(Call), deny(Call), []):-business(Call), at_family_outing.
rule(r3(Call), deny(Call), []):-at_work, family(Call).
rule(p1_r2_r1(Call), prefer(r2(Call), r1(Call)), []).
rule(p2_r1_r2(Call), prefer(r1(Call), r2(Call)), []):-from_boss(Call).
rule(p3_r1_r3(Call), prefer(r1(Call), r3(Call)), []):-from_son(Call).
rule(p4_r3_r1(Call), prefer(r3(Call), r1(Call)), []):-in_meeting.
rule(c1_p2_r1_r2_p1_r2_r1(Call), prefer(p2_r1_r2(Call), p1_r2_r1(Call)), []).
rule(c2_p3_r1_r3_p4_r3_r1(Call), prefer(p3_r1_r3(Call), p4_r3_r1(Call)), []):-son_at_school.
rule(c3_p4_r3_r1_p3_r1_r3(Call), prefer(p4_r3_r1(Call), p3_r1_r3(Call)), []).
rule(c4_c2_p3_r1_r3_p4_r3_r1_c3_p4_r3_r1_p3_r1_r3(Call), prefer(c2_p3_r1_r3_p4_r3_r1(Call), c3_p4_r3_r1_p3_r1_r3(Call)), [sonIsIll]).
rule(c5_c3_p4_r3_r1_p3_r1_r3_c2_p3_r1_r3_p4_r3_r1(Call), prefer(c3_p4_r3_r1_p3_r1_r3(Call), c2_p3_r1_r3_p4_r3_r1(Call)), [neg(sonIsIll)]).
complement(allow(Call), deny(Call)).
complement(deny(Call), allow(Call)).
abducible(sonIsIll, []).
abducible(neg(sonIsIll), []).