예제 #1
0
 def test_simple_flatten(self):
     s = Substitution()
     s['A'] = Variable('B')
     s['B'] = Atomic(1)
     self.assertEquals(Variable('B'), s.get('A'))
     s.flatten()
     self.assertEquals(Atomic(1), s.get('A'))
     self.assertEquals(Atomic(1), s['B'])
예제 #2
0
 def test_flatten_with_compound(self):
     s = Substitution()
     s['A'] = Variable('I')
     s['B'] = Compound('p', Variable('A'))
     s.flatten()
     self.assertEquals(Compound('p', Variable('I')), s['B'])