Skip to content

Graph-Native Infrastructure for Context and Accountable AI Systems

fix(reasoning): Remove overwritten regex pattern and unreachable return

ZohaibHassan16060ff478266f
diff --git a/semantica/reasoning/reasoner.py b/semantica/reasoning/reasoner.py
index 2b452072..1c3199af 100644
--- a/semantica/reasoning/reasoner.py
+++ b/semantica/reasoning/reasoner.py
@@ -354,10 +354,6 @@ class Reasoner:
# Simple regex-based matcher for patterns like "Person(?x)" and facts like "Person(John)"
- p_regex = re.escape(pattern)
- p_regex = re.sub(r"\\\?(\w+)", r"(?P<\1>.+)", p_regex)
- p_regex = f"^{p_regex}$"
-
try:
match = re.match(p_regex, fact)
if match:
@@ -365,7 +361,6 @@ class Reasoner:
for var, value in match.groupdict().items():
if var in new_bindings and new_bindings[var] != value:
return None # Binding conflict
- return None # Binding conflict
new_bindings[var] = value
return new_bindings
except Exception: