mirror of
https://github.com/open-thought/reasoning-gym.git
synced 2026-04-23 16:55:05 +00:00
fix: Correct rule composition in PatternRule to properly chain subrules
This commit is contained in:
parent
a2686341a3
commit
36c6905355
1 changed files with 3 additions and 3 deletions
|
|
@ -64,10 +64,10 @@ class PatternRule:
|
|||
if position > 0:
|
||||
result += sequence[position - 1]
|
||||
elif op == Operation.COMPOSE:
|
||||
# Apply each subrule in sequence
|
||||
temp_sequence = sequence[:position + 1]
|
||||
temp_sequence[-1] = result # Use current result as input
|
||||
# Apply each subrule in sequence, passing the result through
|
||||
for subrule in self.subrules:
|
||||
temp_sequence = sequence[:position + 1]
|
||||
temp_sequence[-1] = result # Use current result as input
|
||||
result = subrule.apply(temp_sequence, position)
|
||||
|
||||
return result
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue