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

Function boxSide

test/compute-engine/fungrim-loops.test.ts:165–181  ·  view source on GitHub ↗
(side: MathJSON, types: Record<string, string>)

Source from the content-addressed store, hash-verified

163 }
164
165 const boxSide = (side: MathJSON, types: Record<string, string>): string => {
166 ce.pushScope();
167 try {
168 for (const w of collectWildcards(side)) {
169 try {
170 ce.declare(w, types[w] ?? 'complex');
171 } catch {
172 /* tolerate */
173 }
174 }
175 const b = ce.box(side as never);
176 expect(b.isValid).toBe(true);
177 return JSON.stringify(b.json);
178 } finally {
179 ce.popScope();
180 }
181 };
182
183 /** Join two canonical sides, renaming wildcards jointly by order of
184 * first appearance — so `f(_a,_b) → g(_b)` and `f(_x,_y) → g(_y)` get

Callers 1

Calls 5

collectWildcardsFunction · 0.70
pushScopeMethod · 0.65
declareMethod · 0.65
boxMethod · 0.65
popScopeMethod · 0.65

Tested by

no test coverage detected