def setUp(self): self.p = UnnamedOpetopicSet.Typing( UnnamedOpetopicSet.Variable("p", UnnamedOpetope.Point()), UnnamedOpetopicSet.Type(UnnamedOpetopicSet.PastingDiagram.point(), None)) self.a = UnnamedOpetopicSet.Typing( UnnamedOpetopicSet.Variable("a", UnnamedOpetope.OpetopicInteger(0)), UnnamedOpetopicSet.Type( UnnamedOpetopicSet.PastingDiagram.degeneratePastingDiagram( UnnamedOpetope.OpetopicInteger(0), "p"), UnnamedOpetopicSet.Variable("p", UnnamedOpetope.Arrow()))) self.b = UnnamedOpetopicSet.Typing( UnnamedOpetopicSet.Variable("b", UnnamedOpetope.OpetopicInteger(0)), UnnamedOpetopicSet.Type( UnnamedOpetopicSet.PastingDiagram.degeneratePastingDiagram( UnnamedOpetope.OpetopicInteger(0), "p"), UnnamedOpetopicSet.Variable("p", UnnamedOpetope.Arrow()))) self.c = UnnamedOpetopicSet.Typing( UnnamedOpetopicSet.Variable("c", UnnamedOpetope.OpetopicInteger(2)), UnnamedOpetopicSet.Type( UnnamedOpetopicSet.PastingDiagram.nonDegeneratePastingDiagram( UnnamedOpetope.OpetopicInteger(2), { UnnamedOpetope.Address.epsilon(1): "x", UnnamedOpetope.Address.epsilon(0).shift(): "y" }), UnnamedOpetopicSet.Variable("z", UnnamedOpetope.Arrow()))) self.ctx = UnnamedOpetopicSet.Context() + self.p + self.a + self.c
def test___init__(self): UnnamedOpetopicSet.Typing( UnnamedOpetopicSet.Variable("x", UnnamedOpetope.OpetopicInteger(2)), self.t) with self.assertRaises(DerivationError): UnnamedOpetopicSet.Typing( UnnamedOpetopicSet.Variable("x", UnnamedOpetope.OpetopicInteger(3)), self.t)
def setUp(self): self.type_point = UnnamedOpetopicSet.Type( UnnamedOpetopicSet.PastingDiagram.point(), None) self.a = UnnamedOpetopicSet.Variable("a", UnnamedOpetope.Point()) self.b = UnnamedOpetopicSet.Variable("b", UnnamedOpetope.Point()) self.c = UnnamedOpetopicSet.Variable("c", UnnamedOpetope.Point()) self.d = UnnamedOpetopicSet.Variable("d", UnnamedOpetope.Point()) self.ab = UnnamedOpetopicSet.Variable("ab", UnnamedOpetope.Arrow()) self.ac = UnnamedOpetopicSet.Variable("ac", UnnamedOpetope.Arrow()) self.bc = UnnamedOpetopicSet.Variable("bc", UnnamedOpetope.Arrow()) self.cd = UnnamedOpetopicSet.Variable("cd", UnnamedOpetope.Arrow()) self.seq = UnnamedOpetopicSet.Sequent() self.seq.context = UnnamedOpetopicSet.Context() + \ UnnamedOpetopicSet.Typing(self.a, self.type_point) + \ UnnamedOpetopicSet.Typing(self.b, self.type_point) + \ UnnamedOpetopicSet.Typing(self.c, self.type_point) + \ UnnamedOpetopicSet.Typing(self.d, self.type_point) + \ UnnamedOpetopicSet.Typing( self.ab, self.type_arrow("a", self.b)) + \ UnnamedOpetopicSet.Typing( self.ac, self.type_arrow("a", self.c)) + \ UnnamedOpetopicSet.Typing( self.bc, self.type_arrow("b", self.c)) + \ UnnamedOpetopicSet.Typing( self.cd, self.type_arrow("c", self.d))