Example #1
0
 def test_properties(self):
     a = ba['2']
     self.assertIs(a.get_left_set(), Undef())
     self.assertIs(is_functional(a), Undef())
     self.assertIs(a.get_right_set(), Undef())
     self.assertIs(is_right_functional(a), Undef())
     self.assertIs(is_bijective(a), Undef())
     self.assertIs(is_reflexive(a), Undef())
     self.assertIs(is_symmetric(a), Undef())
     self.assertIs(is_transitive(a), Undef())
     self.assertIs(is_equivalence_relation(a), Undef())
 def test_properties(self):
     a = ba['2']
     self.assertIs(a.get_left_set(), Undef())
     self.assertIs(is_functional(a), Undef())
     self.assertIs(a.get_right_set(), Undef())
     self.assertIs(is_right_functional(a), Undef())
     self.assertIs(is_bijective(a), Undef())
     self.assertIs(is_reflexive(a), Undef())
     self.assertIs(is_symmetric(a), Undef())
     self.assertIs(is_transitive(a), Undef())
     self.assertIs(is_equivalence_relation(a), Undef())
Example #3
0
    def test_symmetric(self):
        self.assertTrue(is_symmetric(Set()))
        self.assertTrue(is_symmetric(Set([Couplet(s, c) for s, c in zip('abcd', 'badc')])))
        self.assertIs(is_symmetric(Set('a', 'b', 'c')), Undef())
        f = is_symmetric(basic_sets['not left func'])
        self.assertFalse(f)
        f = is_symmetric(basic_sets['diagonal'])
        self.assertTrue(f)
        f = is_symmetric(basic_clans['not left func'])
        self.assertFalse(f)
        f = is_symmetric(basic_clans['diagonal'])
        self.assertTrue(f)
        f = is_symmetric(basic_hordes['not left func'])
        self.assertFalse(f)
        f = is_symmetric(basic_hordes['diagonal'])
        self.assertTrue(f)

        s = basic_sets['diagonal']
        self.assertEqual(s.cached_symmetric, CacheStatus.IS)
        s = basic_sets['not left func']
        self.assertEqual(s.cached_symmetric, CacheStatus.IS_NOT)
    def test_symmetric(self):
        self.assertTrue(is_symmetric(Set()))
        self.assertTrue(is_symmetric(Set([Couplet(s, c) for s, c in zip("abcd", "badc")])))
        self.assertIs(is_symmetric(Set("a", "b", "c")), Undef())
        f = is_symmetric(basic_sets["not left func"])
        self.assertFalse(f)
        f = is_symmetric(basic_sets["diagonal"])
        self.assertTrue(f)
        f = is_symmetric(basic_clans["not left func"])
        self.assertFalse(f)
        f = is_symmetric(basic_clans["diagonal"])
        self.assertTrue(f)
        f = is_symmetric(basic_hordes["not left func"])
        self.assertFalse(f)
        f = is_symmetric(basic_hordes["diagonal"])
        self.assertTrue(f)

        s = basic_sets["diagonal"]
        self.assertEqual(s.cached_symmetric, CacheStatus.IS)
        s = basic_sets["not left func"]
        self.assertEqual(s.cached_symmetric, CacheStatus.IS_NOT)
    def test_symmetric(self):
        self.assertTrue(is_symmetric(Set()))
        self.assertTrue(is_symmetric(Set([Couplet(s, c) for s, c in zip('abcd', 'badc')])))
        self.assertIs(is_symmetric(Set('a', 'b', 'c')), Undef())
        f = is_symmetric(basic_sets['not left func'])
        self.assertFalse(f)
        f = is_symmetric(basic_sets['diagonal'])
        self.assertTrue(f)
        f = is_symmetric(basic_clans['not left func'])
        self.assertFalse(f)
        f = is_symmetric(basic_clans['diagonal'])
        self.assertTrue(f)
        f = is_symmetric(basic_hordes['not left func'])
        self.assertFalse(f)
        f = is_symmetric(basic_hordes['diagonal'])
        self.assertTrue(f)

        s = basic_sets['diagonal']
        self.assertEqual(s.cached_symmetric, CacheStatus.IS)
        s = basic_sets['not left func']
        self.assertEqual(s.cached_symmetric, CacheStatus.IS_NOT)