MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / mSeq

Function mSeq

src/compute-engine/rubi/match.ts:165–176  ·  view source on GitHub ↗
(
  pats: Pat[],
  exprs: ReadonlyArray<Expression>,
  x: Expression,
  env: Env,
  k: () => boolean
)

Source from the content-addressed store, hash-verified

163}
164
165// Power(base, m_.) vs a non-Power expression matches base with m → 1;
166// Add/Multiply nodes with exactly one non-optional operand match a
167// non-matching expression by defaulting the optionals.
168function mCollapse(
169 pat: { op: string; ops: Pat[]; ac: boolean },
170 expr: Expression,
171 x: Expression,
172 env: Env,
173 k: () => boolean
174): boolean {
175 const optionals = pat.ops.filter((p) => p.kind === 'optslot');
176 const others = pat.ops.filter((p) => p.kind !== 'optslot');
177 // collapsing is only justified when at least one optional defaults away;
178 // a node with no optionals must match its operator structurally
179 if (

Callers 1

mFunction · 0.85

Calls 3

kFunction · 0.85
mFunction · 0.70
sliceMethod · 0.65

Tested by

no test coverage detected