:-dynamic at_work/0, unknown_number/0, boss_call/0, busy/0, family_call/0.

rule(r1, allow_call, []):-at_work.
rule(r2, deny_call, []):-at_work.
rule(p21a, prefer(r2, r1), []):- at_work, unknown_number.
rule(p21b, prefer(r2, r1), []):- at_work, busy.
rule(p12ba, prefer(r1, r2), []):- at_work, busy, family_call.
rule(c12ba, prefer(p12ba, p21b), []):- at_work, busy, family_call.
rule(p12bb, prefer(r1, r2), []):- at_work, busy, boss_call.
rule(c12bb, prefer(p12bb, p21b), []):- at_work, busy, boss_call.
complement(allow_call, deny_call).
complement(deny_call,allow_call).

