Skip to content

Commit

Permalink
deepcopy Term when cloning; cache conversion from logic to term
Browse files Browse the repository at this point in the history
  • Loading branch information
maxeeem committed May 9, 2024
1 parent 605b213 commit 23339c9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions pynars/NARS/InferenceEngine/KanrenEngine/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ def logic(term: Term, rule=False, substitution=False, var_intro=False, structura
#################
# LOGIC TO TERM #
#################
@cache
def term(logic, root=True):
# additional variable handling
if root: vars_all.clear()
Expand Down
4 changes: 2 additions & 2 deletions pynars/Narsese/_py/Term.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@ def _build_vars(self):


def clone(self):
# clone = copy(self)
return self
clone = deepcopy(self)
return clone

def _normalize_variables(self):
''''''
Expand Down

0 comments on commit 23339c9

Please sign in to comment.