From 46601a2b8a14f612227a40706f655e44466abd13 Mon Sep 17 00:00:00 2001 From: "Andreas Koepf (aider)" Date: Thu, 23 Jan 2025 13:54:11 +0100 Subject: [PATCH] fix: Correct sequence generation by using previous number in PatternRule --- reasoning_gym/cognition/sequences.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reasoning_gym/cognition/sequences.py b/reasoning_gym/cognition/sequences.py index 51299e29..7666900d 100644 --- a/reasoning_gym/cognition/sequences.py +++ b/reasoning_gym/cognition/sequences.py @@ -46,7 +46,7 @@ class PatternRule: def apply(self, sequence: List[int], position: int) -> int: """Apply the rule to generate the next number""" - result = sequence[position] # Start with current number + result = sequence[position - 1] # Start with previous number for op, param in zip(self.operations, self.parameters): if op == Operation.ADD: