Skip to content

Commit

Permalink
removing negative testcases
Browse files Browse the repository at this point in the history
  • Loading branch information
maxeeem committed Mar 14, 2024
1 parent b47fbbb commit 9aaef9e
Showing 1 changed file with 41 additions and 66 deletions.
107 changes: 41 additions & 66 deletions Tests/test_NAL/test_NAL6.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,46 @@ def test_variables(self):
self.assertAlmostEqual(t1, t2)
pass

# def test_parsing(self):
# tasks_derived = []
# tasks_derived.extend(
# process_two_premises(
# '<Sandy_is_a_dog --> dog>.',
# '<dog --> a>.',
# 10
# )
# )
# tasks_derived.extend(
# process_two_premises(
# '<dog --> [is]>.',
# '<Sandy --> dog>.',
# 10
# )
# )
# tasks_derived.extend(
# process_two_premises(
# '<Sandy_is_dirty --> [dirty]>.',
# '<[dirty] --> [is]>.',
# 10
# )
# )
# tasks_derived.extend(
# process_two_premises(
# '<Sandy --> [dirty]>.',
# None,
# 20
# )
# )
# for t in tasks_derived: print(t)
# print('---')
# tasks_derived = process_two_premises(
# '<Sandy --> ?who>?',
# None,
# 10
# )
# for t in tasks_derived: print(t)
# pass

def test_unification_0(self):
'''
'Variable unification
Expand Down Expand Up @@ -395,23 +435,6 @@ def test_elimination_3(self):
pass


def test_elimination_3_1(self):
'''
(&&,<C --> A>,<D --> B>). %1.00;0.90%
<M --> A>. %0.90;0.90%
'''
rules, task, belief, concept, task_link, term_link, result1, result2 = rule_map_two_premises(
'(&&,<C --> A>,<D --> B>). %1.00;0.90%',
'<M --> A>. %0.90;0.90%',
'A.'
)
rules = [] if rules is None else rules
rules_var = {rule for _, rule in VariableEngine.rule_map.map.data}
self.assertTrue(len(set(rules) & rules_var) == 0)

pass

def test_elimination_4(self):
'''
'Variable elimination
Expand Down Expand Up @@ -878,23 +901,6 @@ def test_second_level_variable_unification_1_0(self):
output_contains(tasks_derived, '<A ==> C>. %1.00;0.90%')
)
pass

def test_second_level_variable_unification_1_1(self):
'''
<A ==> (&&,<D --> B>,C)>. %1.00;0.90%
<M --> B>. %1.00;0.90%
'''
rules, task, belief, concept, task_link, term_link, result1, result2 = rule_map_two_premises(
'<A ==> (&&,<D --> B>,C)>. %1.00;0.90%',
'<M --> B>. %1.00;0.90%',
'B.'
)
rules = [] if rules is None else rules
rules_var = {rule for _, rule in VariableEngine.rule_map.map.data}
self.assertTrue(len(set(rules) & rules_var) == 0)



def test_variable_elimination_deduction(self):
Expand Down Expand Up @@ -942,22 +948,6 @@ def test_variable_elimination_deduction_0(self):
)
pass

def test_variable_elimination_deduction_1(self):
'''
<M --> A>. %1.00;0.90%
<(&&,<C --> A>,<D --> B>) ==> C>. %1.00;0.90%
'''
rules, task, belief, concept, task_link, term_link, result1, result2 = rule_map_two_premises(
'<(&&,<C --> A>,<D --> B>) ==> C>. %1.00;0.90%',
'<M --> A>. %1.00;0.90%',
'A.'
)
rules = [] if rules is None else rules
rules_var = {rule for _, rule in VariableEngine.rule_map.map.data}
self.assertTrue(len(set(rules) & rules_var) == 0)

pass


def test_abduction_with_variable_elimination_abduction(self):
'''
Expand Down Expand Up @@ -994,28 +984,13 @@ def test_abduction_with_variable_elimination_abduction_0(self):
tasks_derived = process_two_premises(
'<(&&,<#1 --> A>,<#1 --> B>) ==> C>. %1.00;0.90%',
'<<M --> A> ==> C>. %1.00;0.90%',
100
10
)

self.assertTrue(
output_contains(tasks_derived, '<M --> B>. %1.00;0.45%')
)

def test_abduction_with_variable_elimination_abduction_1(self):
'''
<<M --> A> ==> C>. %1.00;0.90%
<(&&,<D --> A>,<E --> B>) ==> C>. %1.00;0.90%
''outputMustContain('<M --> B>. %1.00;0.45%')
'''
tasks_derived = process_two_premises(
'<(&&,<D --> A>,<E --> B>) ==> C>. %1.00;0.90%',
'<<M --> A> ==> C>. %1.00;0.90%',
100
)
self.assertTrue(
output_contains(tasks_derived, '<M --> B>. %1.00;0.45%')
)

def test_birdClaimedByBob(self):
'''
Expand Down

0 comments on commit 9aaef9e

Please sign in to comment.