def assert_transport_succeeds(self, bifunctor, left, right, transported): src = bifunctor.onObjects(formula.And(transported, left), right) tgt = bifunctor.onObjects(left, formula.And(transported, right)) nt = bifunctor.transport(transported) arrow = nt(left, right) self.assertEqual(src, arrow.src) self.assertEqual(tgt, arrow.tgt)
def assert_transport_duplicating_succeeds(self, bifunctor, right, transported): src = bifunctor.onObjects(transported, right) tgt = bifunctor.onObjects(transported, formula.And(transported, right)) nt = bifunctor.transport_duplicating(transported) arrow = nt(right) self.assertEqual(src, arrow.src) self.assertEqual(tgt, arrow.tgt)