From fad73ece7d0c7c2b8756262aa5cb1769fb0f58fd Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Wed, 17 Feb 2021 17:32:46 -0500 Subject: Fixes up to test layer 5 --- spec/reference.bqn | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/spec/reference.bqn b/spec/reference.bqn index 62c790ac..9387590c 100644 --- a/spec/reference.bqn +++ b/spec/reference.bqn @@ -55,6 +55,9 @@ Fill # Enclosed fill value for 𝕩 ⍟ ← {𝕨𝔾◶⊢‿𝔽𝕩} # LIMITED to boolean right operand result IsArray←0=Type +Int←(1=Type)◶⟨0,⌊⊸=⟩ +Nat←(1=Type)◶⟨0,0⊸≤×⌊⊸=⟩ + ≢ ↩ IsArray◶⟨⟩‿≢ # LIMITED to monadic case # LIMITED to numeric arguments for arithmetic cases @@ -69,8 +72,8 @@ IsArray←0=Type ≠ ← Length ⊘ (¬=) = ↩ Rank ⊘ = × ↩ 0⊸(<->) ⊘ × -⌊ ↩ ⌊ ⊘ {(𝕨>𝕩)⊑𝕨‿𝕩} -⌈ ← -∘⌊∘- ⊘ {(𝕨<𝕩)⊑𝕨‿𝕩} +⌊ ↩ ⌊ ⊘ {𝕨{(𝕨>𝕩)⊑𝕨‿𝕩}_perv𝕩} +⌈ ← -∘⌊∘- ⊘ {𝕨{(𝕨<𝕩)⊑𝕨‿𝕩}_perv𝕩} ¨ ← _eachm # LIMITED to monadic case and array 𝕩 ´ ← _fold @@ -126,21 +129,18 @@ _eachd←{ } (>○=)◶⟨𝔽_e⋄𝔽˜_e˜⟩ } -_perv←{ # Pervasion - (⊢⊘∨○IsArray)◶⟨𝔽⋄𝔽{𝕨𝔽_perv𝕩}¨⟩ -} ⌜ ← {(𝔽_eachm)⊘(𝔽_table)○ToArray} ¨ ↩ {(𝔽_eachm)⊘(𝔽_eachd)○ToArray} +_perv←{ # Pervasion + (⊢⊘∨○IsArray)◶⟨𝔽⋄𝔽{𝕨𝔽_perv𝕩}¨⟩ +} #⌜ # LAYER 3: Remove other limits # Now all implementations are full except ∾; ↕ is monadic only -Int←(1=Type)◶⟨0,⌊⊸=⟩ -Nat←(1=Type)◶⟨0,0⊸≤×⌊⊸=⟩ - Deshape←IsArray◶{⟨𝕩⟩}‿⥊ Reshape←{ ! 1≥=𝕨 @@ -242,6 +242,7 @@ _rankOp_←{ c←×´s←𝕨Cell𝕩 f⥊⊑⟜(⥊𝕩)¨∘((s⥊↕c)+c×⊢)¨↕×´f } + Enc↩(>⟜0×1+≥⟜=)◶⟨<⊢,Enc,<⌜⊢⟩ > ((⊑k)Enc𝕨) 𝔽¨ ((1-˜≠)⊸⊑k)Enc𝕩 } _insert←{ -- cgit v1.2.3