def PCR5(a: BA, b: BA) -> BA: ts, fs, us, es = unwrapPairValues(a, b) c = conjunctive_rule(a, b) t = c.true + PCR5_f2(ts, fs) + PCR5_f2(ts, es) f = c.false + PCR5_f2(fs, ts) + PCR5_f2(fs, es) u = c.unknown + PCR5_f2(us, es) return BA(t, f, u)
def PCR3(a: BA, b: BA) -> BA: ts, fs, us, es = unwrapPairValues(a, b) c = conjunctive_rule(a, b) t = c.true + sum(ts) * (PCR3_f1(ts, fs) + PCR3_f1(ts, es)) f = c.false + sum(fs) * (PCR3_f1(fs, ts) + PCR3_f1(fs, es)) u = c.unknown + sum(us) * (PCR3_f1(us, es)) return BA(t, f, u) #TODO
def PCR1(a: BA, b: BA) -> BA: ts, fs, us, _ = unwrapPairValues(a, b) c = conjunctive_rule(a, b) se = c.empty d = sum(ts) + sum(fs) + sum(us) t = c.true + sum(ts) / d * se f = c.false + sum(fs) / d * se u = c.unknown + sum(us) / d * se return BA(t, f, u)
def conjunctive_rule(a: BA, b: BA) -> BA: ts, fs, us, _ = unwrapPairValues(a, b) t = cross(ts, us) + norm(ts) f = cross(fs, us) + norm(fs) u = norm(us) return BA(t, f, u)
def Dubois_Prades_rule(a: BA, b: BA) -> BA: ts, fs, us, _ = unwrapPairValues(a, b) t = cross(ts, us) + norm(ts) f = cross(fs, us) + norm(fs) u = norm(us) + cross(ts, fs) return BA(t, f, u)
def disjunctive_rule(a: BA, b: BA) -> BA: ts, fs, us, _ = unwrapPairValues(a, b) t = norm(ts) f = norm(fs) u = 1 - t - f return BA(t, f, u)
def PCR2_Weights(a: BA, b: BA) -> tuple: ts, fs, _, _ = unwrapPairValues(a, b) d = sum(ts) + sum(fs) return sum(ts) / d, sum(fs) / d