Skip to content

Commit 124c4c6

Browse files
committed
fix a bug in under sided both
1 parent e3e26fa commit 124c4c6

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/compile/invert/under.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,9 @@ under!(BothPat, input, g_sig, inverse, asm, {
430430
);
431431
let (f_before, mut f_after) = f.under_inverse(inner_g_sig, inverse, asm)?;
432432

433-
let balanced = g_sig.args() <= g_sig.outputs() && !(val.is_some() && f.sig == (1, 1));
433+
let balanced = g_sig.args()
434+
<= g_sig.outputs() + sub.side.as_ref().map_or(0, |sided| sided.n.unwrap_or(1))
435+
&& !(val.is_some() && f.sig == (1, 1));
434436
// Make before
435437
let mut before = val.unwrap_or_default();
436438
before.push(if !inverse || balanced {

tests/under.ua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,10 @@
167167
⍤⤙≍ 5 ⍜∩(×.)+ 3 4
168168
⍤⤙≍ {6 5} [⍜∩°□˜⊙∘ □5 □6]
169169
⍤⤙≍ [9 9 5] ⍜⊡(⍜∩×↥∩⌟⊙∘) 2 ↯3 9 ¯1 5
170-
⍤⤙≍ [3 2] ⍜∩⌞▽◌ [1 0] [1 2] [3 4]
171170
⍤⤙≍ 0 ⧻ {⍜(∩(|1 ◌ °img&frab))∩∘ ."site/favicon.ico"}
172171
⍤⤙≍ [29 39] [⍜∩⌞+∩×₁₀ 1 2 3]
173172
⍤⤙≍ [39 48] [⍜∩⌟+∩×₁₀ 1 2 3]
173+
⍤⤙≍ [2_13 4_15] ⊟ ⍜⊙∩⌞⊡∩⌞+ 10 1 2_3 4_5
174174

175175
# On
176176
⍤⤙≍ [3 5] [⍜⟜×∘ 3 5]

0 commit comments

Comments
 (0)