Skip to content

Commit 899b233

Browse files
author
Neumann, Jan
committedNov 18, 2024
Fix rule/fact name parser for test case without parentheses on the RHS.
1 parent c4d402a commit 899b233

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed
 

‎src/compute_graph_vectorize/facts/parser.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ def parse_rule_or_fact(rule: str) -> Rule | Fact:
205205
else:
206206
raise ValueError()
207207
elif state == 2:
208-
_fact = _parse_fact(tokens_iter)
208+
_fact = _parse_fact(tokens_iter, is_rule_rhs=True)
209209
rhs.append(_fact)
210210
state = 3
211211
elif state == 3:

‎tests/test_rule_fact_name_parser.py

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
("predict", "predict"),
1616
("{10, 7} atom_embed(X) :- node_feature(X). [transformation=identity]", "atom_embed"),
1717
("{10, 10} l2_embed(X) :- l1_embed(X). [transformation=identity]", "l2_embed"),
18+
("{1, 8} xor :- {8, 2} xy. [transformation=tanh]", "xor")
1819
]
1920

2021

1 commit comments

Comments
 (1)

neumannjan commented on Nov 18, 2024

@neumannjan
Owner

From #1

Please sign in to comment.