aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2021-09-24 21:40:27 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2021-09-24 21:40:27 -0400
commit501a0e838c5e92f2619f715bc755e213658d74f3 (patch)
treed52ca3443d6b5cd82dc07a75b148bdc9eca7773c /src
parentbbba31aedf5ce12d4a5eb24f477e3041cab1e27f (diff)
Support ˙ in structural Under
Diffstat (limited to 'src')
-rw-r--r--src/r1.bqn7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/r1.bqn b/src/r1.bqn
index 84c70046..0e3021b7 100644
--- a/src/r1.bqn
+++ b/src/r1.bqn
@@ -26,6 +26,7 @@ _glyphLookup_ ← {
}
_isGlyph ← { (glyphs _qSearch 𝕗) = {PrimInd𝕩} }
IsJoin ← '∾'_isGlyph
+DIsConst ← (4=0⊸⊑)◶0‿('˙'_isGlyph(≠-1˙)⊸⊑)
Split2 ← { s←2⊸×⌜↕(≠𝕩)÷2 ⋄ ⟨s⊏𝕩,(1⊸+⌜s)⊏𝕩⟩ }
_lookup_ ← {
@@ -471,7 +472,7 @@ structFn ← {
_sfn_ ← {(𝕎⊢)◶⟨𝕏, 𝕩‿𝕗‿𝕘{𝕨𝕏𝕗}⟩}
Mon←{𝕏⊘E} ⋄ Dy←{E⊘𝕏}
k‿v ← Split2 ⟨
- "⊢⊣˜∘○⊸⟜⊘◶", ⊢
+ "⊢⊣˜∘○⊸⟜⊘◶", ⊢ # ˙ handled specially
"=≠≢", Mon 1 _sfn_ 0
"<", Mon 0 _sfn_ 1
"≍", Mon 1 _sfn_ 1 # Dyad combines
@@ -493,7 +494,7 @@ structFn ← {
0⊸≤◶⟨3,2⊸≤◶⊢‿2⟩∘(0⊑⊢)◶⟨
SE ⊣ StructPrim 1⊑⊢ # 0 primitive
E˙ # 1 block
- 0⊸⊑ Recomp {𝕨˙⊸StructFn⌜1↓𝕩} # other operation
+ DIsConst∘⊢◶⟨0⊸⊑ Recomp {𝕨˙⊸StructFn⌜1↓𝕩}, SE{(1⊑𝕩)˙}⟩ # other operation
SE 1⊑⊢ # ¯1 constant
⟩⟜{Decompose𝕩}
}
@@ -776,7 +777,7 @@ ReorderAxesInv←{
_inv_ ← {𝕘⋄𝕨𝔽𝕩}
DNotInv ← (5=0⊸⊑)◶1‿(inv˙≢(≠-2˙)⊸⊑)
_undo ← {𝕗 (≢∧INF˙⊸≢)◶0‿(DNotInv∘Decompose⊢)◶⊢‿{𝕏_inv_(𝕎_invChk_𝕏)} Inverse 𝕗}
-IsConstant ← (3≤Type)◶⟨1 ⋄ (4=0⊸⊑)◶0‿('˙'_isGlyph(≠-1˙)⊸⊑)∘{Decompose𝕩}⊢⟩
+IsConstant ← (3≤Type)◶⟨1 ⋄ DIsConst∘{Decompose𝕩}⊢⟩
AtopInverse ← {(𝕏𝕎)⊘(𝕏⟜𝕎)}○{Inverse𝕩}
TrainInverse ← {
t‿f‿g‿h←𝕩