def run_test_8(): a = _SingleProjectiveRelation() a.add_rel(LS, BF) print(a.delta()) a = _SingleProjectiveRelation() a.add_rel(LS, BF, OU) print("bf:ls:ou, bf, bf:ou, ou, ls, bf:ls, ls:ou EXPECTED") print(a.delta())
def run_test_2(): a = _SingleProjectiveRelation(AF, LS, RS) b = _SingleProjectiveRelation() b.add_rel(RS, BF) multi = ProjectiveRelation() multi.add_rel(a) multi.add_rel(b) print(multi) multi.converse()
def run_test_6(): b = _SingleProjectiveRelation() b.add_rel(LS) b.add_rel(BF) print(b) print(b.get_relations()) for i in b: print(i) print(b)
def run_test_1(): print("creo una basic relation: in,ou,af,ls,rs") a = _SingleProjectiveRelation(IN, OU, AF, LS, RS) print(a) print() print("creo una basic relation: in,rs,ls") b = _SingleProjectiveRelation() b.add_rel(IN, RS, LS) print(b) print() print("creo una multi tile relation tra le due basic relation precedenti: ", a, b) c = _SingleProjectiveRelation(IN, RS) multi = ProjectiveRelation(a, b) print(multi) print() print("faccio il get dell'insieme della prima basic relation e della multi tile relation") print(a.get_relations()) print(multi.get_relations()) # print(multi.get_relations().pop().get_relations()) print() print("elimino in e ou dalla prima relazione") print(a) a.remove_relations("in", "ou") print(a) print() print("calcolo la converse della relazione: ", a) print(a.converse()) print(a.converse().get_relations()) print() print("aggiungo una rel a multi") multi.add_rel(a, b, c) print(a) print(b) print(multi)
def run_test_3(): a = _SingleProjectiveRelation() a.add_rel(IN) a.add_rel(OU, IN, BT) a.add_rel_from_str("rs") b = ProjectiveRelation() b.add_rel(a, a) b._add_rel_from_str("bf") b._add_rel_from_str("bf:af") print(b)