Skip to content

Commit

Permalink
cleaning up
Browse files Browse the repository at this point in the history
  • Loading branch information
maxeeem committed Feb 5, 2024
1 parent 5bdb587 commit bad7fe7
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 361 deletions.
6 changes: 3 additions & 3 deletions Tests/test_NAL/test_NAL1.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def test_deduction(self):
tasks_derived = process_two_premises(
'<bird --> animal>. %1.00;0.90%',
'<robin --> bird>. %1.00;0.90%',
10
20
)
self.assertTrue(
output_contains(tasks_derived, '<robin --> animal>. %1.00;0.81%')
Expand Down Expand Up @@ -96,7 +96,7 @@ def test_abduction(self):
tasks_derived = process_two_premises(
'<sport --> competition>. %1.00;0.90%',
'<chess --> competition>. %0.90;0.90%',
5
10
)
self.assertTrue(
output_contains(tasks_derived, '<sport --> chess>. %1.00;0.42%')
Expand Down Expand Up @@ -159,7 +159,7 @@ def test_exemplification(self):
tasks_derived = process_two_premises(
'<robin --> bird>. %1.00;0.90%',
'<bird --> animal>. %1.00;0.90%',
100
20
)
self.assertTrue(
output_contains(tasks_derived, '<animal --> robin>. %1.00;0.45%')
Expand Down
26 changes: 13 additions & 13 deletions Tests/test_NAL/test_NAL3.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ def test_compound_decomposition_intensional_intersection(self):
'''
tasks_derived = process_two_premises(
'<robin --> (|,bird,swimmer)>. %1.00;0.90%',
'<robin --> swimmer>. %0.00;0.90%',
200
'(--, <robin --> swimmer>). %1.00;0.90%',
100
)
self.assertTrue(
output_contains(tasks_derived, '<robin --> bird>. %1.00;0.81%')
Expand All @@ -160,9 +160,9 @@ def test_compound_decomposition_intensional_intersection(self):
nars.reset()

tasks_derived = process_two_premises(
'<robin --> swimmer>. %0.00;0.90%',
'(--, <robin --> swimmer>). %1.00;0.90%',
'<robin --> (|,bird,swimmer)>. %1.00;0.90%',
200
100
)
self.assertTrue(
output_contains(tasks_derived, '<robin --> bird>. %1.00;0.81%')
Expand All @@ -186,24 +186,24 @@ def test_compound_decomposition_extensional_difference(self):
''outputMustContain('<robin --> mammal>. %0.00;0.81%')
'''
tasks_derived = process_two_premises(
'<robin --> swimmer>. %0.00;0.90%',
'<robin --> (-,mammal,swimmer)>. %0.00;0.90%',
200
'(--, <robin --> swimmer>). %1.00;0.90%',
'(--, <robin --> (-,mammal,swimmer)>). %1.00;0.90%',
100
)
self.assertTrue(
output_contains(tasks_derived, '<robin --> mammal>. %0.00;0.81%')
output_contains(tasks_derived, '(--, <robin --> mammal>). %1.00;0.81%')
)

nars.reset()

tasks_derived = process_two_premises(
'<robin --> (-,mammal,swimmer)>. %0.00;0.90%',
'<robin --> swimmer>. %0.00;0.90%',
200
'(--, <robin --> (-,mammal,swimmer)>). %1.00;0.90%',
'(--, <robin --> swimmer>). %1.00;0.90%',
100
)
self.assertTrue(
output_contains(tasks_derived, '<robin --> mammal>. %0.00;0.81%')
)
output_contains(tasks_derived, '(--, <robin --> mammal>). %1.00;0.81%')
)

pass

Expand Down
8 changes: 4 additions & 4 deletions pynars/NARS/DataStructures/_py/Concept.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ def get_belief(self) -> Belief:

# return projectedBelief; // return the first satisfying belief
raise
# if self.belief_table.empty:
# for term_link in self.term_links:
# if not term_link.target.belief_table.empty:
# return term_link.target.belief_table.first()
if self.belief_table.empty:
for term_link in self.term_links:
if not term_link.target.belief_table.empty:
return term_link.target.belief_table.first()
return self.belief_table.first()

# def match_candidate(self, sentence: Sentence) -> Task | Belief:
Expand Down
118 changes: 0 additions & 118 deletions pynars/NARS/InferenceEngine/KanrenEngine/KanrenPlayground.ipynb

This file was deleted.

Loading

0 comments on commit bad7fe7

Please sign in to comment.