def test_derivable_with_empty_body_rules(self): baba = ExampleFrameworks.cow_framework() self.assertTrue(Semantics.derivable(baba, ExampleFrameworks.HOC, [])) self.assertFalse( Semantics.derivable(baba, ExampleFrameworks.not_HOC, [])) self.assertTrue( Semantics.derivable(baba, ExampleFrameworks.not_FM, [ExampleFrameworks.not_FM])) self.assertFalse( Semantics.derivable(baba, ExampleFrameworks.FM, [ExampleFrameworks.not_FM]))
def test_derivable(self): baba = ExampleFrameworks.with_chaining() self.assertTrue(Semantics.derivable(baba, a, [b, d, f])) self.assertTrue(Semantics.derivable(baba, a, [b, d, f, g])) self.assertTrue(Semantics.derivable(baba, g, [c])) self.assertTrue(Semantics.derivable(baba, g, [d, f])) self.assertFalse(Semantics.derivable(baba, g, [d])) self.assertFalse(Semantics.derivable(baba, a, [b, d])) self.assertFalse(Semantics.derivable(baba, a, [b, f, g]))
def test_derivable_with_random_variables(self): baba = ExampleFrameworks.r_framework() self.assertTrue(Semantics.derivable(baba, a, [a, b])) self.assertFalse(Semantics.derivable(baba, a, [])) self.assertFalse(Semantics.derivable(baba, ExampleFrameworks._c, []))
def test_derivable_trivially(self): baba = ExampleFrameworks.valid_BABA_framework() self.assertTrue(Semantics.derivable(baba, b, [b])) self.assertTrue(Semantics.derivable(baba, c, [c])) self.assertFalse(Semantics.derivable(baba, b, [])) self.assertFalse(Semantics.derivable(baba, c, []))