mirror of
https://github.com/open-thought/reasoning-gym.git
synced 2026-04-23 16:55:05 +00:00
formatting
This commit is contained in:
parent
98988c8481
commit
20069b2a7d
37 changed files with 504 additions and 666 deletions
|
|
@ -23,14 +23,14 @@ def test_pattern_rule():
|
|||
# Test simple addition
|
||||
rule = PatternRule([Operation.ADD], [2])
|
||||
assert rule.apply([1, 3], 1) == 5
|
||||
|
||||
|
||||
# Test composition
|
||||
rule = PatternRule([Operation.DOUBLE, Operation.ADD], [0, 3])
|
||||
assert rule.apply([1, 4], 1) == 11 # (4 * 2) + 3
|
||||
|
||||
# Test rule composition
|
||||
rule1 = PatternRule([Operation.DOUBLE], [0]) # Double the number
|
||||
rule2 = PatternRule([Operation.ADD], [3]) # Add 3
|
||||
rule2 = PatternRule([Operation.ADD], [3]) # Add 3
|
||||
composed = PatternRule.compose([rule1, rule2])
|
||||
assert composed.apply([1, 4], 1) == 11 # (4 * 2) + 3
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue