@mark1russell7/vex-compiler 0.18.0 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"module-entry.js","names":["NOT_VALUES","within","formOf","testsOf","spaces"],"sources":["../src/fn-text.ts","../src/module-tidy.ts","../src/scope-key.ts","../src/sheet-order.ts","../src/module.ts"],"sourcesContent":["/**\n * The text of a function of a domain (COMPILE.MODULE.TEXT). JavaScript gives a text that depends on the loader.\n * A runner can keep the spaces of the types, drop parentheses or change a quote. A module copies such a text,\n * so this file parses it and prints the tree. Equal trees give equal bytes under each runner.\n */\nimport { parseExpressionAt } from \"acorn\";\nimport { GENERATOR, generate, type Generator, type State } from \"astring\";\n\n/** A node of the tree. The printer reads only these fields. */\ninterface TreeNode {\n readonly type: string;\n readonly value?: unknown;\n readonly name?: string;\n readonly callee?: TreeNode;\n readonly arguments?: readonly TreeNode[];\n}\n\n/** The printer of one kind of node. */\ntype Print = (node: TreeNode, state: State) => void;\n\n/** The printers of the kinds of nodes that the default printer does not change. */\nconst PRINTERS = GENERATOR as unknown as Readonly<Record<string, Print>>;\n\n/** This function tells if a call only names a function: the runner `tsx` wraps each named function in such a call. */\nfunction isNameCall(node: TreeNode): boolean {\n const [, name] = node.arguments as readonly TreeNode[];\n return node.callee?.name === \"__name\" && node.arguments?.length === 2 && typeof name?.value === \"string\";\n}\n\n/** The printers that give one form to each literal, and that remove a call that only names a function. */\nconst TEXT_PRINTERS: Readonly<Record<string, Print>> = {\n ...PRINTERS,\n Literal: (node, state) => {\n if (typeof node.value === \"string\") state.write(JSON.stringify(node.value));\n else if (typeof node.value === \"number\" && Number.isFinite(node.value)) state.write(String(node.value));\n else (PRINTERS[\"Literal\"] as Print)(node, state);\n },\n CallExpression(node, state) {\n const [fn] = node.arguments as readonly TreeNode[];\n if (isNameCall(node)) (TEXT_PRINTERS[(fn as TreeNode).type] as Print).call(TEXT_PRINTERS, fn as TreeNode, state);\n else (PRINTERS[\"CallExpression\"] as Print).call(TEXT_PRINTERS, node, state);\n },\n};\n\n/**\n * This function gives the text of a function, in one form for each runner. A text that does not parse as one expression\n * stays as it is, for example a method or a native function. A module refuses such a text when it tries the copy.\n */\nexport function functionText(f: (...a: never[]) => unknown): string {\n const raw = Function.prototype.toString.call(f);\n try {\n const tree = parseExpressionAt(raw, 0, { ecmaVersion: \"latest\" });\n if (tree.end !== raw.length) return raw;\n return generate(tree, { generator: TEXT_PRINTERS as unknown as Generator, indent: \"\", lineEnd: \" \" });\n } catch {\n return raw;\n }\n}\n","/**\n * The last pass of the printer of a module (`COMPILER.md` §4.4, COMPILE.MODULE.SIZE). This pass reads the lines of a\n * printed run, and it removes code that gives no value. It does not change the value of a run, an error of a run or a\n * refusal of the printer.\n *\n * The printer gives one statement on each line, and each block adds two spaces. A name with digits is a fresh name of\n * the printer. A text of a program can hold each word, so each count of a word here also counts the words in a text. A\n * count that is too high only stops a rule. A rule that writes code reads the tokens of the code (`rewritten`), so it\n * does not change a text.\n */\nimport { type Token, tokenizer, tokTypes } from \"acorn\";\n\n\n/** The parts of a module for the pass. */\nexport interface TidyParts {\n /** The helpers and the declarations at the top of the module, by name, in their order. */\n readonly decls: ReadonlyMap<string, string>;\n /** The statements of the run that this pass can change: the constants of the run and the body. */\n readonly lines: readonly string[];\n /** The other text of the module. This pass does not change it, and each name that it reads stays. */\n readonly kept: string;\n /** The globals that a function of an op can read at each place of the module. */\n readonly globals: ReadonlySet<string>;\n}\n\n/** The result of the pass: the declarations that stay, and the statements of the run. */\nexport interface Tidied {\n readonly decls: ReadonlyMap<string, string>;\n readonly lines: readonly string[];\n}\n\n/** The tokens that hold a text of the code: a string, a part of a template and a regular expression. */\nconst TEXT_TOKENS: ReadonlySet<unknown> = new Set([tokTypes.string, tokTypes.template, tokTypes.regexp]);\n\n/** A text of the code starts with one of these characters. A comment starts with the slash too. */\n// Stryker disable next-line Regex: `rewritten` calls `codeOf` on a line with a match, so a form that finds other characters also finds that line.\nconst TEXT_START = /[\"'`/]/;\n\n/** This function gives a line of code with spaces at the place of each text. Each other character keeps its offset. A line with no text needs no tokens. */\nfunction codeOf(line: string): string {\n if (!TEXT_START.test(line)) return line;\n let out = \"\";\n let at = 0;\n for (const token of tokenizer(line, { ecmaVersion: \"latest\" })) {\n if (!TEXT_TOKENS.has(token.type)) continue;\n out += line.slice(at, token.start) + \" \".repeat(token.end - token.start);\n at = token.end;\n }\n return out + line.slice(at);\n}\n\n/**\n * This function writes each match of `find` in the code of a line. A match in a text does not count, and each text\n * keeps its characters. `find` must have the flag `g`. A line with no match needs no tokens.\n */\nfunction rewritten(line: string, find: RegExp, write: (match: RegExpExecArray) => string): string {\n if (line.search(find) < 0) return line;\n let out = \"\";\n let at = 0;\n for (const match of codeOf(line).matchAll(find)) {\n out += line.slice(at, match.index) + write(match);\n at = match.index + match[0].length;\n }\n return out + line.slice(at);\n}\n\n/** This function gives the names in code. A word in a comment or in a text is not a name. */\nexport function namesOfCode(code: string): ReadonlySet<string> {\n const names = new Set<string>();\n for (const token of tokenizer(code, { ecmaVersion: \"latest\", sourceType: \"module\" })) if (token.type === tokTypes.name) names.add((token as Token & { readonly value: string }).value);\n return names;\n}\n\n/** The words of a text. */\nconst WORD = /[A-Za-z_$][\\w$]*/g;\n\n/** This function gives the words of a text. */\nexport const wordsOf = (text: string): readonly string[] => text.match(WORD) ?? [];\n\n/** This function gives the count of a word in some lines. A line without the text of the word needs no walk. */\nfunction countOf(lines: readonly string[], name: string): number {\n let sum = 0;\n for (const x of lines) {\n // Stryker disable next-line ConditionalExpression: a line without the text has no such word, so this test only saves the walk.\n if (x.includes(name)) sum += wordsOf(x).filter((w) => w === name).length;\n }\n return sum;\n}\n\n/** This function gives the number of spaces at the start of a line. */\nconst indentOf = (line: string): number => line.length - line.trimStart().length;\n\n/** This function gives the first line after `at` that is not in the block of the line `at`. */\nfunction blockEnd(lines: readonly string[], at: number): number {\n const indent = indentOf(lines[at] as string);\n let end = at + 1;\n while (end < lines.length && indentOf(lines[end] as string) >= indent) end++;\n return end;\n}\n\n/** This function gives the line that opens the block of the line `at`, or -1 at the top of the run. */\nfunction openerOf(lines: readonly string[], at: number): number {\n const indent = indentOf(lines[at] as string);\n let k = at - 1;\n while (k >= 0 && indentOf(lines[k] as string) >= indent) k--;\n return k;\n}\n\n/** The line of a function that a block opens. */\nconst FUNCTION_HEAD = /=> \\{$|\\bfunction\\b.*\\{$/;\n\n/** This function gives the line that opens the function of the line `at`, or -1 for the function of the run. */\nfunction functionOf(lines: readonly string[], at: number): number {\n let k = openerOf(lines, at);\n while (k >= 0 && !FUNCTION_HEAD.test(lines[k] as string)) k = openerOf(lines, k);\n return k;\n}\n\n/** The key of an item of a list in a loop. The head of the loop must come just before it (`deadKeys`). */\nconst KEY_READ = /^\\s*const (j\\d+) = ([A-Za-z]+\\d*)\\[(q\\d+)\\](\\[0\\])?;$/;\n\n/**\n * This function removes each read of a key that no code reads (COMPILE.MODULE.SIZE.KEY). The read must be the first line\n * of the loop of its position. A read of a pair must also have a loop over the length of its array. An item of a list\n * is a pair, so the read cannot throw.\n */\nexport function deadKeys(lines: readonly string[]): readonly string[] {\n return lines.filter((line, i) => {\n const m = KEY_READ.exec(line);\n if (m === null) return true;\n const [, key, array, position, pair] = m as unknown as readonly [string, string, string, string, string | undefined];\n const head = lines[i - 1] ?? \"\";\n const loop = head.trimStart().startsWith(`for (let ${position} = `) && (pair === undefined || new RegExp(`(?<![\\\\w$.])${array}\\\\.length`).test(head));\n return !loop || countOf(lines.slice(i + 1, blockEnd(lines, i)), key) > 0;\n });\n}\n\n/**\n * This function gives a line with each read of the name `from` as a read of the name `to`. A property, a key of an\n * object and a part of a longer word are not reads. A spread reads its name.\n */\nfunction renamed(line: string, from: string, to: string): string {\n const read = new RegExp(`(?<![\\\\w$])(?<!(?<!\\\\.\\\\.)\\\\.)(?:(?<![{,]\\\\s*)${from}|${from}(?!\\\\s*:))(?![\\\\w$])`, \"g\");\n return rewritten(line, read, () => to);\n}\n\n/** The writes to a name. The first group holds the name after `++` or `--`, and the second group the name before an operator. */\nconst WRITE = /(?:\\+\\+|--)\\s*([A-Za-z_$][\\w$]*)|(?<![\\w$.])(?<!\\b(?:const|let) )([A-Za-z_$][\\w$]*)\\s*(?:\\+\\+|--|(?:[-+*/%&|^]|<<|>>>?|\\*\\*|&&|\\|\\||\\?\\?)?=(?![=>]))/g;\n\n/** This function gives the lines that write to each name, without the line that declares the name. */\nfunction writesOf(lines: readonly string[]): ReadonlyMap<string, readonly number[]> {\n const writes = new Map<string, number[]>();\n for (const [i, line] of lines.entries()) {\n for (const m of line.matchAll(WRITE)) {\n const name = (m[1] ?? m[2]) as string;\n writes.set(name, [...(writes.get(name) ?? []), i]);\n }\n }\n return writes;\n}\n\n/** This function tells if a line declares a name, also as a parameter of a function. */\nfunction binds(line: string, name: string): boolean {\n // Stryker disable next-line ConditionalExpression: a line without the name has no declaration of it, so this test only saves the pattern.\n if (!line.includes(name)) return false;\n const word = `(?<![\\\\w$])${name}(?![\\\\w$])`;\n return new RegExp(`\\\\b(?:const|let)\\\\s+(?:[^;=]*,\\\\s*|\\\\[[^\\\\]]*)?${word}|\\\\([^()]*${word}[^()]*\\\\)\\\\s*=>|${word}\\\\s*=>|\\\\bfunction\\\\b[^(]*\\\\([^)]*${word}`).test(line);\n}\n\n/** A statement that gives a new name to a fresh name, or to `o`, the key of a run. */\nconst ALIAS = /^\\s*const ([A-Za-z]+\\d+) = ([A-Za-z]+\\d+|o);$/;\n\n/**\n * This function tells if the name `name` keeps its value from the line `at` to the line `end`. A name with no write\n * keeps its value. Else no line in that part can write to it. That part must also have no function, because a function\n * can read the name after a later write. Each other write and the declaration must be in the function of the line\n * `at`, because a call cannot then start them. A write in a line with a function has an unknown place.\n */\nfunction keeps(lines: readonly string[], writes: readonly number[], name: string, at: number, end: number): boolean {\n if (writes.length === 0) return true;\n if (writes.some((x) => x > at && x < end) || lines.slice(at, end).some((x) => x.includes(\"=>\") || /\\bfunction\\b/.test(x))) return false;\n const home = functionOf(lines, at);\n const declared = lines.flatMap((x, i) => (binds(x, name) ? [i] : []));\n return declared.length > 0 && [...writes, ...declared].every((x) => !(lines[x] as string).includes(\"=>\") && functionOf(lines, x) === home);\n}\n\n/**\n * This function removes each alias whose two names hold one value in the whole block of the alias. Each read of the\n * alias reads the first name (COMPILE.MODULE.SIZE.ALIAS).\n */\nexport function aliases(lines: readonly string[]): readonly string[] {\n const out = [...lines];\n const writes = writesOf(lines);\n const gone = new Set<number>();\n for (let i = 0; i < out.length; i++) {\n const m = ALIAS.exec(out[i] as string);\n if (m === null) continue;\n const [, alias, name] = m as unknown as readonly [string, string, string];\n const end = blockEnd(out, i);\n const block = out.slice(i + 1, end);\n // Each read of the alias must be in its block, and no line of that block can give either name another meaning. The\n // printer prints the steps of a stopped walk two times, so a nested block can declare the alias again (V-073).\n if (countOf(out, alias) !== 1 + countOf(block, alias) || block.some((x) => binds(x, name) || binds(x, alias)) || !keeps(out, writes.get(name) ?? [], name, i, end)) continue;\n for (let k = i + 1; k < end; k++) {\n const x = out[k] as string;\n // Stryker disable next-line ConditionalExpression: a line without the alias stays as it is, so this test only saves the pattern.\n if (x.includes(alias)) out[k] = renamed(x, alias, name);\n }\n gone.add(i);\n }\n return out.filter((_, i) => !gone.has(i));\n}\n\n/** The first line of a lazy cell of the run. */\nconst CELL = /^ {2}const (c\\d+) = L\\(\\(\\) => \\{$/;\n\n/** The first line of a lazy cell at each place. */\nconst ANY_CELL = /^\\s*const \\w+ = L\\(\\(\\) => \\{$/;\n\n/** The blocks that run each statement at most once, for one run of the block around them. */\nconst ONCE_BLOCK = /^\\s*(?:try \\{|\\} catch \\{|\\} else \\{|(?:\\} else )?if \\(.*\\) \\{)$/;\n\n/** The statements that can run a part of their line more than once. */\nconst LOOP_LINE = /^\\s*(?:for|while|do)\\b|=>/;\n\n/** This function tells if the statement at the line `at` runs at most once in a run. */\nfunction runsOnce(lines: readonly string[], at: number): boolean {\n if (LOOP_LINE.test(lines[at] as string)) return false;\n for (let k = openerOf(lines, at); k >= 0; k = openerOf(lines, k)) {\n const line = lines[k] as string;\n if (ANY_CELL.test(line)) return true;\n if (!ONCE_BLOCK.test(line)) return false;\n }\n return true;\n}\n\n/**\n * This function prints a lazy cell with one read at that read (COMPILE.MODULE.SIZE.ONCE). The cell must be one\n * `return`, and the read must be `G(c())`. The read must run at most once, so the value evaluates at most once and at\n * the same time. `G` stays, because the value can be the sentinel. Each catch of a module takes each exception.\n */\nexport function onceCells(lines: readonly string[]): readonly string[] {\n let out = lines;\n for (let i = 0; i + 2 < out.length; i++) {\n const name = CELL.exec(out[i] as string)?.[1];\n const value = /^ {4}return (.*);$/.exec(out[i + 1] as string)?.[1];\n if (name === undefined || value === undefined || out[i + 2] !== \" });\" || countOf(out, name) !== 2) continue;\n const read = new RegExp(`(?<![\\\\w$.])G\\\\(${name}\\\\(\\\\)\\\\)`, \"g\");\n const inlined = (x: string): string => rewritten(x, read, () => `G(${value})`);\n const site = out.findIndex((x) => inlined(x) !== x);\n if (site < 0 || !runsOnce(out, site)) continue;\n out = out.flatMap((x, k) => (k === site ? [inlined(x)] : k >= i && k <= i + 2 ? [] : [x]));\n i = -1;\n }\n return out;\n}\n\n/** A constant of the run on one line, with its name. */\nconst CONSTANT = /^ {2}const (c\\d+) = (?:T\\(\\(\\) => .*\\)|\\[\\]);$/;\n\n/** The first line of a constant of the run with a `try`, with its name. */\nconst HELD = /^ {2}let (c\\d+);$/;\n\n/** The first line of a column at each depth, with its indent and its name. A column does not run until a read calls it. */\nconst COLUMN = /^( *)const (col\\d+) = Q\\(\\(\\w+\\) => \\{$/;\n\n/** The variable of the pack of a column at each depth, with its name. */\nconst PACK = /^ *let (PK\\d+);$/;\n\n/** This function gives the name of the declaration at the line `at` and its last line, or `undefined` for another line. */\nfunction constantAt(lines: readonly string[], at: number): { readonly name: string; readonly last: number } | undefined {\n const line = lines[at] as string;\n const one = CONSTANT.exec(line)?.[1];\n if (one !== undefined) return { name: one, last: at };\n const lazy = CELL.exec(line)?.[1];\n if (lazy !== undefined) return { name: lazy, last: lines.indexOf(\" });\", at) };\n const column = COLUMN.exec(line);\n if (column !== null) return { name: column[2] as string, last: lines.indexOf(`${column[1] as string}});`, at) };\n const pack = PACK.exec(line)?.[1];\n if (pack !== undefined) return { name: pack, last: at };\n const held = HELD.exec(line)?.[1];\n return held === undefined || lines[at + 1] !== \" try {\" ? undefined : { name: held, last: lines.indexOf(\" }\", at) };\n}\n\n/** This function gives the count of each word of some lines. */\nfunction wordCounts(lines: readonly string[]): Map<string, number> {\n const counts = new Map<string, number>();\n for (const w of wordsOf(lines.join(\"\\n\"))) counts.set(w, (counts.get(w) ?? 0) + 1);\n return counts;\n}\n\n/**\n * This function removes each constant of the run that no code reads (COMPILE.MODULE.SIZE.DEAD). The code of a constant\n * has no effect, and the constant holds each failure of that code. A lazy cell with no read does not run. A print that\n * the printer drops leaves its columns and their packs, in the run and in a function, so the pass removes these too. The\n * parameters of a function come from the code that it keeps, so such a column can read a name with no declaration.\n */\nexport function deadConstants(lines: readonly string[]): readonly string[] {\n let out = lines;\n const counts = wordCounts(lines);\n for (let i = 0; i < out.length; i++) {\n const c = constantAt(out, i);\n if (c === undefined) continue;\n const own = wordCounts(out.slice(i, c.last + 1));\n if (counts.get(c.name) !== own.get(c.name)) continue;\n out = [...out.slice(0, i), ...out.slice(c.last + 1)];\n for (const [word, count] of own) counts.set(word, (counts.get(word) as number) - count);\n i = -1;\n }\n return out;\n}\n\n/** This function gives the declarations that the text `roots` reads, also through other declarations. */\nexport function liveDecls(decls: ReadonlyMap<string, string>, roots: string): ReadonlyMap<string, string> {\n const live = new Set<string>();\n const stack = [...wordsOf(roots)];\n for (let w = stack.pop(); w !== undefined; w = stack.pop()) {\n const text = decls.get(w);\n if (text === undefined || live.has(w)) continue;\n live.add(w);\n stack.push(...wordsOf(text));\n }\n return new Map([...decls].filter(([name]) => live.has(name)));\n}\n\n/** The tokens of the body of a function of an op. A body with another token has no inline form. */\nconst BODY_TOKEN = /\\s+|\"(?:[^\"\\\\\\n]|\\\\.)*\"|'(?:[^'\\\\\\n]|\\\\.)*'|\\.{3}|\\.\\d\\w*|\\d[\\w.]*|\\.[A-Za-z_$][\\w$]*|[A-Za-z_$][\\w$]*|===|!==|\\?\\?|&&|\\|\\||\\*\\*|<<|>>>|>>|==|!=|<=|>=|\\+\\+|--|=>|\\?\\.|[-+*/%<>!?:,&|^~()[\\]{}]/y;\n\n/** The tokens that change a value or start a function. */\nconst NOT_INLINE: ReadonlySet<string> = new Set([\"++\", \"--\", \"=>\"]);\n\n/** The words that an inline body can read at each place of a module. */\nconst PLAIN_WORDS: ReadonlySet<string> = new Set([\"true\", \"false\", \"null\", \"NaN\", \"Infinity\", \"typeof\", \"void\"]);\n\n/** The words that end no value, so a slash after them starts a regular expression. */\nconst NOT_VALUES: ReadonlySet<string> = new Set([\"typeof\", \"void\"]);\n\n/** This function gives the tokens of a body, or `undefined` for a body with another token. */\nfunction tokensOf(body: string): readonly string[] | undefined {\n const out: string[] = [];\n BODY_TOKEN.lastIndex = 0;\n while (BODY_TOKEN.lastIndex < body.length) {\n const m = BODY_TOKEN.exec(body);\n if (m === null || NOT_INLINE.has(m[0])) return undefined;\n out.push(m[0]);\n }\n return out;\n}\n\n/** This function tells if a token ends a value, so a slash after it is a division. */\nconst endsValue = (t: string): boolean => t === \")\" || t === \"]\" || t === \"}\" || (/^[\\w$.\"']/.test(t) && t !== \"...\" && !NOT_VALUES.has(t));\n\n/** This function tells if a token is a name or a word of the language. */\nconst isWord = (t: string): boolean => /^[A-Za-z_$]/.test(t);\n\n/** This function tells if a token is a space. */\nconst isSpace = (t: string): boolean => /^\\s/.test(t);\n\n/** The part of an inline body: a text, or the index of a parameter. */\ntype BodyPart = string | number;\n\n/**\n * This function gives the parts of the body of an arrow function, or `undefined` for a body that a site cannot hold.\n * The body must be an expression with no assignment and no function. Each of its words must be a parameter, a global or\n * a key of an object. Thus a local name of the site cannot take the place of a word of the body.\n */\nfunction bodyParts(params: readonly string[], body: string, globals: ReadonlySet<string>): readonly BodyPart[] | undefined {\n const tokens = tokensOf(body.trim());\n if (tokens === undefined || tokens[0] === \"{\") return undefined;\n const parts: BodyPart[] = [];\n const open: string[] = [];\n let last = \"\";\n for (const [i, t] of tokens.entries()) {\n if (isSpace(t)) {\n parts.push(\" \");\n continue;\n }\n const next = tokens.slice(i + 1).find((x) => !isSpace(x));\n if (t === \"/\" && !endsValue(last)) return undefined;\n if (t === \"(\" || t === \"[\" || t === \"{\") open.push(t);\n if (t === \")\" || t === \"]\" || t === \"}\") open.pop();\n const at = params.indexOf(t);\n const key = open.at(-1) === \"{\" && (last === \"{\" || last === \",\");\n if (!isWord(t) || (key && next === \":\")) parts.push(t);\n else if (key && next !== \",\" && next !== \"}\") return undefined;\n else if (at >= 0) parts.push(...(key ? [`${t}:`, at] : [at]));\n else if (PLAIN_WORDS.has(t) || globals.has(t)) parts.push(t);\n else return undefined;\n last = t;\n }\n return parts;\n}\n\n/** The declaration of a function of an op or of a check of a domain, as an arrow function. */\nconst OP_DECL = /^const ((?:op|v)_\\w+) = (?:\\(([\\w$,\\s]*)\\)|([A-Za-z_$][\\w$]*))\\s*=>([\\s\\S]*);$/;\n\n/** The name, the parameters and the parts of an inline form. */\ninterface OpForm {\n readonly name: string;\n readonly params: readonly string[];\n readonly parts: readonly BodyPart[];\n}\n\n/** This function gives the form of a declaration, or `undefined` for a declaration without one. */\nfunction opForm(text: string, globals: ReadonlySet<string>): OpForm | undefined {\n const m = OP_DECL.exec(text);\n if (m === null) return undefined;\n const params = (m[2] ?? m[3] ?? \"\").split(\",\").map((x) => x.trim()).filter((x) => x !== \"\");\n const parts = bodyParts(params, m[4] as string, globals);\n return parts === undefined || params.length === 0 ? undefined : { name: m[1] as string, params, parts };\n}\n\n/**\n * This function gives a text with the call of `f` as its body. It gives `undefined` when the text has no call with a\n * name for each argument.\n */\nfunction withSite(text: string, f: OpForm): string | undefined {\n const site = new RegExp(`(?<![\\\\w$.])${f.name}\\\\(([A-Za-z_$][\\\\w$]*(?:, [A-Za-z_$][\\\\w$]*)*)\\\\)`, \"g\");\n const out = rewritten(text, site, (match) => {\n const args = (match[1] as string).split(\", \");\n return args.length === f.params.length ? `(${f.parts.map((p) => (typeof p === \"number\" ? (args[p] as string) : p)).join(\"\")})` : match[0];\n });\n return out === text ? undefined : out;\n}\n\n/**\n * This function prints each function of an op with one call at that call (COMPILE.MODULE.SIZE.INLINE). Each argument\n * must be a name, so the arguments have no order, and a second read of a parameter reads the same value.\n */\nexport function inlineOps(parts: TidyParts): Tidied {\n const { kept, globals } = parts;\n const decls = new Map(parts.decls);\n const lines = [...parts.lines];\n const counts = new Map<string, number>();\n for (const w of wordsOf([kept, ...decls.values(), ...lines].join(\"\\n\"))) counts.set(w, (counts.get(w) ?? 0) + 1);\n for (const [name, text] of parts.decls) {\n const f = counts.get(name) === 2 ? opForm(text, globals) : undefined;\n if (f === undefined) continue;\n const at = lines.findIndex((x) => withSite(x, f) !== undefined);\n if (at >= 0) {\n lines[at] = withSite(lines[at] as string, f) as string;\n decls.delete(name);\n continue;\n }\n // A check of the result of an op calls the check of its domain.\n const check = [...decls].find(([k, x]) => k.startsWith(\"k_\") && withSite(x, f) !== undefined);\n if (check !== undefined) {\n decls.set(check[0], withSite(check[1], f) as string);\n decls.delete(name);\n }\n }\n return { decls, lines };\n}\n\n/** The helper of a catch that keeps only the error of Vex (COMPILE.MODULE.FAULT). */\nconst FAULT_KEEP = \"function FK(x) { if (x !== E) throw x; }\";\n/** The helper that gives the error of Vex for each exception of a copy of a function of a domain. */\nconst FAULT_WRAP = \"function FW(f) { return (...a) => { try { return f(...a); } catch { throw E; } }; }\";\n\n/** This function gives a line where each catch rethrows each value that is not the error of Vex. */\nfunction narrowCatches(line: string): string {\n return rewritten(line, /catch \\{/g, () => \"catch ($f) { FK($f);\");\n}\n\n/** This function gives the declaration of a copy of a function of a domain, inside the wrapper. */\nfunction wrapFaults(name: string, text: string): string {\n return `const ${name} = FW(${text.slice(`const ${name} = `.length, -1)});`;\n}\n\n/**\n * This function gives the form of a module where a catch keeps only the error of Vex (COMPILE.MODULE.FAULT). The start\n * of a fault tells the two cases. A copy of a function of a domain gives the error of Vex for each exception, as in the\n * interpreter. Another exception comes from the printed code, and it leaves the run.\n */\nexport function keepFaults(parts: Tidied, copies: ReadonlySet<string>): Tidied {\n const decls = new Map([...parts.decls].map(([name, text]) => [name, copies.has(name) ? wrapFaults(name, text) : narrowCatches(text)]));\n decls.set(\"FK\", FAULT_KEEP);\n decls.set(\"FW\", FAULT_WRAP);\n return { decls, lines: parts.lines.map(narrowCatches) };\n}\n\n/**\n * This function gives the smaller form of a module, with the same behavior (COMPILE.MODULE.SIZE). With `faults` at\n * `throw`, each function of a domain stays a declaration, so the wrapper of `keepFaults` holds each of its exceptions.\n */\nexport function tidy(parts: TidyParts, faults: \"value\" | \"throw\" = \"value\"): Tidied {\n const lines = deadConstants(onceCells(deadConstants(aliases(deadKeys(parts.lines)))));\n const live = liveDecls(parts.decls, [parts.kept, ...lines].join(\"\\n\"));\n const small = faults === \"throw\" ? { decls: live, lines } : inlineOps({ ...parts, decls: live, lines });\n return { decls: liveDecls(small.decls, [parts.kept, ...small.lines].join(\"\\n\")), lines: small.lines };\n}\n","/**\n * The key of an expression at a place of a module. Two expressions at their places have one key only if they have one\n * value. A key holds what each read of the expression means at that place. A read of a name that the expression binds\n * keeps its spelling, because the structure of the key holds its binder. Another read gives a token of its meaning.\n * The root and `./module` of this package do not export this file.\n *\n * A table walks each expression once and keeps its form. A form holds the number of its structure with a hole at each\n * read. It also holds the list of its reads in the order of the structure. So a key at a new place reads the list, and it\n * does not walk the expression again. The lists have shared parts, so the forms of a chain use memory linear in the chain. The\n * cost of a key at each place is linear in the reads and the binders of the expression. A key has a small text.\n *\n * A form depends on the nodes of the memo around it, so a table keeps the forms for each content of `keys`. The table has\n * no copy of the other maps of a scope, because each key reads them as they stand. The table seals a map of `keys` at its\n * first read. So a change of that map after a read is a refusal, and it does not give a wrong key.\n */\nimport type { Expr, ExprOf } from \"@mark1russell7/vex\";\n\n/** The error of a construct that a standalone module does not have. */\nexport class NotStandalone extends Error {}\n\n/** A variable of the code of a module. */\ninterface Variable {\n readonly code: string;\n}\n\n/** The place of an expression: what each name that the expression does not bind means there. */\nexport interface KeyScope {\n /** The nodes of the memo around the place, with the variable of each. */\n readonly keys: ReadonlyMap<Expr, Variable>;\n /** The names around the place. A name that is not in this map is a variable of the run. */\n readonly env: ReadonlyMap<string, Variable>;\n /** The functions around the place, with the number of the binding of each. */\n readonly fns: ReadonlyMap<string, { readonly id: number }>;\n /** The columns of the `fix` forms around the place. */\n readonly columns: ReadonlyMap<string, Variable>;\n}\n\n/** A hole of a form: a read of a name, of a round or of a function. */\ninterface Read {\n readonly hole: \"var\" | \"last\" | \"call\";\n readonly name: string;\n}\n\n/** The reads of a part of a form, with the names of a kind that a form binds around that part. */\ninterface Bound {\n readonly kind: \"names\" | \"rounds\";\n readonly names: readonly string[];\n readonly parts: readonly Reads[];\n}\n\n/** The reads of an expression, in the order of its structure. A form above an expression shares this object. */\ntype Reads = Read | Bound;\n\n/** The form of an expression: the key data of its structure, and its reads, if it has reads. */\ninterface Form {\n readonly data: unknown;\n readonly reads: Reads | undefined;\n}\n\n/** The forms of one content of `keys`. */\ninterface Forms {\n readonly table: KeyTable;\n readonly keys: ReadonlyMap<Expr, Variable>;\n readonly known: Map<Expr, Form>;\n}\n\n/** A place in the walk of an expression: the forms, and the reads of the form that the walk makes. */\ninterface At {\n readonly forms: Forms;\n readonly reads: Reads[];\n}\n\n/** This function refuses a change of a map that a table read. */\nfunction sealed(): never {\n throw new NotStandalone(\"a map of the memo changed after a read of its keys\");\n}\n\n/** The properties that seal a map. Each method that changes a map refuses. */\nconst SEAL: PropertyDescriptorMap = { set: { value: sealed, configurable: true }, delete: { value: sealed, configurable: true }, clear: { value: sealed, configurable: true } };\n\n/** This class holds the number of each structure and the forms of each content of `keys`, for the keys of one printer. */\nexport class KeyTable {\n readonly #numbers = new Map<string, number>();\n readonly #nodes = new WeakMap<Expr, number>();\n readonly #maps = new WeakMap<object, Forms>();\n readonly #forms = new Map<string, Forms>();\n\n /** This method gives the number of a structure. Two structures have one number only if they have one text. */\n numberOf(text: string): number {\n const known = this.#numbers.get(text);\n if (known !== undefined) return known;\n const fresh = this.#numbers.size;\n this.#numbers.set(text, fresh);\n return fresh;\n }\n\n /** This method gives the number of a node of the program, the same object. */\n #nodeId(e: Expr): number {\n const known = this.#nodes.get(e);\n if (known !== undefined) return known;\n const fresh = this.numberOf(`node ${String(this.#numbers.size)}`);\n this.#nodes.set(e, fresh);\n return fresh;\n }\n\n /** This method gives the forms of a map of `keys`, and seals the map. Two maps with one content have one record of forms. */\n formsOf(keys: ReadonlyMap<Expr, Variable>): Forms {\n const held = this.#maps.get(keys);\n if (held !== undefined) return held;\n const text = JSON.stringify([...keys].map(([e, value]) => [this.#nodeId(e), value.code]));\n const forms = this.#forms.get(text) ?? { table: this, keys, known: new Map() };\n this.#forms.set(text, forms);\n this.#maps.set(keys, forms);\n Object.defineProperties(keys, SEAL);\n return forms;\n }\n}\n\n/** The text of -0 in a key. JSON gives 0 for -0, and -0 is not 0. */\nconst NEGATIVE_ZERO = { \"-0\": 0 };\n\n/**\n * This function gives a text that is the same for two expressions with the same structure. -0 is not 0. A part with a\n * token gives the token, so the text does not depend on that part. A token is an object, and a literal of a module is\n * not, so a token is not the text of a literal.\n */\nexport function canonical(e: Expr, token: (x: unknown) => object | undefined): string {\n return JSON.stringify(e, (_name, x: unknown) => token(x) ?? (Object.is(x, -0) ? NEGATIVE_ZERO : x));\n}\n\n/** The token function of a text with no tokens. */\nconst NO_TOKEN = (): undefined => undefined;\n\n/** This function gives the text of a literal or of an extension. Only those parts hold data of the program, and a walk of that data finds each -0. */\nfunction leafText(e: ExprOf<\"lit\"> | ExprOf<\"ext\">): string {\n // Stryker disable next-line ConditionalExpression: a walk gives the same text as the plain form, so this test only saves the walk.\n if (e.tag === \"lit\" && typeof e.value !== \"object\" && !Object.is(e.value, -0)) return JSON.stringify(e);\n return canonical(e, NO_TOKEN);\n}\n\n/** This function gives the result of a part that sees more names of a kind, and keeps the reads of that part with those names. */\nfunction within<T>(at: At, kind: Bound[\"kind\"], names: readonly string[], part: (inner: At) => T): T {\n const inner: At = { forms: at.forms, reads: [] };\n const result = part(inner);\n if (inner.reads.length > 0) at.reads.push({ kind, names, parts: inner.reads });\n return result;\n}\n\n/** This function gives the key data of an object that is not an expression, for example an axis or a record of names. */\nfunction record(x: object, at: At): unknown {\n // A copy keeps each own property, also a property with the name `__proto__`.\n const out: Record<string, unknown> = { ...x };\n for (const name of Object.keys(out)) out[name] = data(out[name], at);\n return out;\n}\n\n/** This function gives the key data of a part of an expression. An array or a record keeps its form, and an expression gets its key data. */\nfunction data(x: unknown, at: At): unknown {\n if (Array.isArray(x)) return x.map((part) => data(part, at));\n if (typeof x !== \"object\" || x === null) return Object.is(x, -0) ? NEGATIVE_ZERO : x;\n return typeof (x as { tag?: unknown }).tag === \"string\" ? node(x as Expr, at) : record(x, at);\n}\n\n/** This function gives the key data of a hole, and adds the read to the reads of the form. */\nfunction hole(kind: Read[\"hole\"], name: string, at: At): unknown {\n at.reads.push({ hole: kind, name });\n return { \"?\": kind };\n}\n\n/** This function gives the key data of a loop over names: each part sees the names that its form gives it (LOOP.NAMES). */\nfunction loop(e: ExprOf<\"fold\"> | ExprOf<\"iterate\">, at: At): unknown {\n const outer = e.tag === \"fold\" ? { axis: data(e.axis, at), at: data(e.at, at) } : { limit: data(e.limit, at) };\n const init = record(e.init, at);\n const items = e.tag === \"fold\" ? (e.as ?? []) : [];\n const inner = within(at, \"names\", Object.keys(e.init), (x) => ({\n ...(e.tag === \"iterate\" ? { until: data(e.until, x) } : {}),\n step: within(x, \"names\", items, (y) => record(e.step, y)),\n result: node(e.result, x),\n }));\n return { ...e, ...outer, init, ...inner };\n}\n\n/**\n * This function gives the key data of the parts of an expression. The scope of each form is the scope of the interpreter.\n * Each number of an expression goes through `data`, so the plain text of this result keeps each -0.\n */\nfunction parts(e: Exclude<Expr, ExprOf<\"lit\"> | ExprOf<\"ext\">>, at: At): unknown {\n switch (e.tag) {\n case \"var\":\n case \"last\":\n return hole(e.tag, e.name, at);\n case \"call\":\n return { ...e, fn: hole(\"call\", e.fn, at), args: data(e.args, at) };\n case \"fn\":\n return { ...e, body: within(at, \"names\", e.params, (x) => node(e.body, x)) };\n case \"let\":\n // Each binding sees the outer names, so a binding does not see the other bindings (FN.BIND).\n return { ...e, bind: record(e.bind, at), body: within(at, \"names\", Object.keys(e.bind), (x) => node(e.body, x)) };\n case \"each\":\n return { ...e, axis: data(e.axis, at), at: data(e.at, at), body: within(at, \"names\", e.as ?? [], (x) => node(e.body, x)) };\n case \"fold\":\n case \"iterate\":\n return loop(e, at);\n case \"fix\":\n return { ...e, init: node(e.init, at), step: within(at, \"rounds\", [e.name], (x) => node(e.step, x)) };\n case \"ref\":\n case \"app\":\n case \"rec\":\n return record(e, at);\n }\n}\n\n/** This function gives the form of an expression from its walk. */\nfunction formOf(e: Expr, forms: Forms): Form {\n const own: At = { forms, reads: [] };\n const structure = { \"#\": forms.table.numberOf(e.tag === \"lit\" || e.tag === \"ext\" ? leafText(e) : JSON.stringify(parts(e, own))) };\n const [first, ...more] = own.reads;\n return { data: structure, reads: more.length === 0 ? first : { kind: \"names\", names: [], parts: own.reads } };\n}\n\n/** This function gives the key data of an expression: the number of its form, or the token of a node of the memo. */\nfunction node(e: Expr, at: At): unknown {\n const key = at.forms.keys.get(e);\n if (key !== undefined) return { \"@\": key.code };\n let form = at.forms.known.get(e);\n if (form === undefined) {\n form = formOf(e, at.forms);\n at.forms.known.set(e, form);\n }\n if (form.reads !== undefined) at.reads.push(form.reads);\n return form.data;\n}\n\n/** The names of each kind that a walk of the reads binds at this time. */\ninterface Binders {\n readonly names: Set<string>;\n readonly rounds: Set<string>;\n}\n\n/** This function gives the meaning of a read. A name of the run and a name of the code are two tokens, so one text in both does not give one key. */\nfunction meaning(x: Read, scope: KeyScope, bound: Binders): unknown {\n switch (x.hole) {\n case \"var\": {\n if (bound.names.has(x.name)) return { \"=\": x.name };\n const name = scope.env.get(x.name);\n return name === undefined ? { $$: x.name } : { $: name.code };\n }\n case \"last\":\n return bound.rounds.has(x.name) ? { \"=\": x.name } : { \"^\": scope.columns.get(x.name)?.code };\n case \"call\":\n // A call of a function around the place gives the number of its binding, so two functions with one name give two keys.\n return bound.names.has(x.name) ? { \"=\": x.name } : { \"()\": x.name, of: scope.fns.get(x.name)?.id };\n }\n}\n\n/** This function adds the meaning of each read to a list, in the order of the structure. */\nfunction meanings(reads: readonly Reads[], scope: KeyScope, bound: Binders, out: unknown[]): void {\n for (const x of reads) {\n if (\"hole\" in x) {\n out.push(meaning(x, scope, bound));\n continue;\n }\n const set = bound[x.kind];\n const fresh = x.names.filter((name) => !set.has(name));\n for (const name of fresh) set.add(name);\n meanings(x.parts, scope, bound, out);\n for (const name of fresh) set.delete(name);\n }\n}\n\n/**\n * This function gives the key of an expression at a place. Two keys of one table are equal only if the two expressions at\n * their places have one value. Two expressions with one value can have two keys, for example with two spellings of a\n * name that they bind.\n */\nexport function keyText(e: Expr, scope: KeyScope, table: KeyTable): string {\n const at: At = { forms: table.formsOf(scope.keys), reads: [] };\n const structure = node(e, at);\n if (at.reads.length === 0) return JSON.stringify(structure);\n const reads: unknown[] = [];\n meanings(at.reads, scope, { names: new Set(), rounds: new Set() }, reads);\n return JSON.stringify({ \"#\": table.numberOf(JSON.stringify([structure, reads])) });\n}\n","/**\n * The static order of the cells of a sheet in a module (COMPILE.MODULE.SHEET). It is the order of `SheetRun.fill` in\n * `packages/core/src/sheet.ts` (SHEET.FILL), and it uses `readsOf` and `isCellRef` of that file. The keys of a column\n * follow its reads from itself. The order changes only the speed, not a result (SHEET.ORDER).\n */\nimport { addrExprs, CELL_KIND, children, isCellRef, listOf, readsOf, shapeError, splitLimit, type Axis, type Direction, type Expr } from \"@mark1russell7/vex\";\n\n/** This function gives the tests of the `where` axes of an axis. */\nfunction testsOf(axis: Axis): readonly Expr[] {\n const tests: Expr[] = [];\n for (let x = axis; x.t === \"where\"; x = x.axis) tests.push(x.test);\n return tests;\n}\n\n/**\n * The order of the keys of a column, from the directions of its reads from itself. `reverse` reverses the key order. In\n * a tree, `post` puts the children before their parent, and `back` reverses the order of the siblings.\n */\nexport interface KeyOrder {\n readonly reverse: boolean;\n readonly post: boolean;\n readonly back: boolean;\n}\n\n/**\n * This function gives the order of the keys of a column. A read of a later key reverses the order. In a tree, a read of\n * the children puts the children before their parent, as `keyOrder` of `SheetRun` does.\n */\nexport function keyOrderOf(d: ReadonlySet<Direction>): KeyOrder {\n const reverse = d.has(\"after\") && !d.has(\"before\");\n const post = d.has(\"down\");\n return { reverse, post, back: post !== reverse };\n}\n\n/**\n * The place of a read of a cell, relative to the key of the formula. The place `key` is the key itself. The place\n * `children` is the body or a test of the axis `children` of the key. The place `unknown` is each other place.\n */\ntype ReadPlace = \"key\" | \"children\" | \"unknown\";\n\n/** This function gives the axis under the tests of `where` and under `reverse`. Both read the targets of that axis. */\nfunction baseOf(axis: Axis): Axis {\n let base = axis;\n while (base.t === \"where\" || base.t === \"reverse\") base = base.axis;\n return base;\n}\n\n/**\n * This function tells if each read of a cell of the column `self` reads a finished cell in the static order of the\n * fill (COMPILE.MODULE.SHEET.DIRECT). A read of a column before `self` in `order` reads a finished cell. A read of a\n * column that the sheet does not have also reads a finished cell. A read of `self` reads a finished cell only in\n * these three forms:\n * - in a tree in pre-order, at the move `parent` from the key,\n * - in an array in key order, at an offset of one negative step from the key,\n * - in a tree in post-order, at the key of a target of the axis `children` of the key.\n *\n * A read in the body of a function can evaluate at each place of a call, so it is not one of these forms.\n *\n * The columns of `fused` come before `self` in one loop over the keys (COMPILE.MODULE.ONCE). The loop evaluates each of\n * them at a key before `self` at that key. Thus a read of one of them reads a finished cell only at the key itself, or\n * in one of the three forms.\n */\nexport function readsFinished(columns: ReadonlyMap<string, Expr>, order: readonly string[], self: string, tree: boolean, fused: ReadonlySet<string> = new Set()): boolean {\n const formula = columns.get(self);\n if (formula === undefined || shapeError(formula) !== undefined) return false;\n const { reverse, post } = keyOrderOf(readsOf(columns, new Map(), self).directions);\n const position = order.indexOf(self);\n const todo: [Expr, ReadPlace][] = [[formula, \"key\"]];\n for (let item = todo.pop(); item !== undefined; item = todo.pop()) {\n const [e, place] = item;\n // A test of the axis of a data limit reads at each target, as the test of an `each` does.\n const split = e.tag === \"iterate\" ? splitLimit(e) : undefined;\n if (split !== undefined) for (const x of split) todo.push([x, place]);\n else if (e.tag === \"each\" || e.tag === \"fold\") {\n const inner: ReadPlace = place === \"key\" && (e.at === undefined || e.at.length === 0) && baseOf(e.axis).t === \"children\" ? \"children\" : \"unknown\";\n for (const x of [...(e.tag === \"each\" ? [e.body] : Object.values(e.step)), ...testsOf(e.axis)]) todo.push([x, inner]);\n const list = listOf(e.axis);\n for (const x of [...(e.tag === \"fold\" ? [...Object.values(e.init), e.result] : []), ...addrExprs(e.at), ...(list === undefined ? [] : [list])]) todo.push([x, place]);\n } else if (e.tag === \"fn\") todo.push([e.body, \"unknown\"]);\n // The parts of a column evaluate at each row, so a read in them has no place (FIX.ROUNDS).\n else if (e.tag === \"fix\") todo.push([e.init, \"unknown\"], [e.step, \"unknown\"]);\n else if (e.tag !== \"ext\") for (const child of children(e)) todo.push([child, place]);\n else if (e.kind === CELL_KIND && isCellRef(e.data)) {\n const { column, at } = e.data;\n const index = order.indexOf(column);\n if (index > position) return false;\n if (column !== self && !fused.has(column)) continue;\n const [move, ...rest] = at;\n // The cell of a fused column at the key itself is finished. The cell of `self` at the key is a cycle.\n const here = column !== self && place === \"key\" && at.every((m) => m.t === \"origin\");\n const ok =\n here ||\n (place === \"key\"\n ? move !== undefined && rest.length === 0 && ((tree && !post && move.t === \"parent\") || (!tree && !reverse && move.t === \"offset\" && move.d.length === 1 && (move.d[0] ?? 0) < 0))\n : place === \"children\" && tree && post && at.length === 0);\n if (!ok) return false;\n }\n }\n return true;\n}\n","/**\n * Standalone modules (docs/COMPILER.md §4.4 and §6). `emitModule` prints a program as an ES module that has no import of\n * Vex. A host that guarantees the kinds of its input uses it without the interpreter, for example ireko at build time.\n *\n * The module gives the results of the interpreter for each input that keeps the schema. It checks the schema once, at\n * the start of a run, and an input against the schema throws a `VexContractError`. An error of Vex is a value too:\n * the run gives `VEX_ERROR` at its key.\n *\n * The printer gives statements and loops, as a person writes them. A binding is a variable, and a list op is a `for`\n * loop with a running value. An error of Vex is a thrown sentinel. A binding, `ifError` and an item of a list op catch\n * it, as in the interpreter. A node of the memo and the key of the run catch it too. Each op is the function of its\n * domain, as text, so it has the bits of the interpreter (§4.2).\n *\n * A part of the program that depends on no key of the space is a constant of the run. The module evaluates it once,\n * before the loop over the keys. A node of the memo is one function of its other keys, with a map of its values. The\n * nodes with the same expression share the function.\n *\n * The printer takes a part of the language. It takes an array space, a tree space or a graph space of records, and\n * the fields and the variables of the schema. It takes the axes `all`, `others` and `window`. A tree space also has the\n * move `parent` and the axes of a tree (COMPILE.MODULE.TREE). A graph space has the axes of a graph\n * (COMPILE.MODULE.GRAPH). A list is an array of pairs of a key and a value. The list ops, `reduce`, list literals and\n * lists as names of loops are in a module (COMPILE.MODULE.LIST, COMPILE.MODULE.REDUCE). The value of a program can be a\n * list, and the run gives it as a `vex.list` (COMPILE.MODULE.LIST.RESULT). An op and a record get each list of an\n * argument or a field as a `vex.list` too (COMPILE.MODULE.LIST.ARG, COMPILE.MODULE.LIST.FIELD). The value of a call\n * can be a list (COMPILE.MODULE.LIST.CALL). A field of the schema can have a list kind, and the record then holds a\n * `vex.list` (COMPILE.MODULE.LIST.INPUT). The kinds of each op site must decide its op.\n * Another construct gives a reason, not code.\n *\n * `emitSheetModule` prints the formula columns of a sheet as one module (COMPILE.MODULE.SHEET). Each column is an array\n * of results, and the run fills the arrays in the static order of `SheetRun.fill`. A read of a cell that is not finished\n * starts the search of `SheetRun`. Thus each cell on a cycle gives the error of Vex. A cell can hold a list, and a\n * formula reads it with the list ops (COMPILE.MODULE.SHEET.LIST).\n */\nimport { addrExprs, type AnyDomain, app, type Axis, axisExprs, CELL_KIND, type CellFormulas, children, columnOrder, type Envelope, evaluate, type Expr, type ExprOf, fromDocument, isCellRef, isDocument, isFieldName, isListOp, isVexList, type ItemNames, joinKind, limitAxis, listOf, lit, MAX_ITERATIONS, monotoneError, type Move, moveExpr, type Names, nestingError, nestingOf, type PrimitiveKind, readsOf, rec, shapeError, sizeError, space as spaces, splitLimit, stepError, vexList, type VexList, type VexStep } from \"@mark1russell7/vex\";\nimport { factsOf, kindOfDomain, primitiveOf, type Facts, type Kind, type ListKind, type Schema } from \"./facts.ts\";\nimport { functionText } from \"./fn-text.ts\";\nimport { memoNodes } from \"./memo.ts\";\nimport { deadConstants, keepFaults, namesOfCode, tidy, type Tidied, wordsOf } from \"./module-tidy.ts\";\nimport { canonical, type KeyScope, KeyTable, keyText, NotStandalone } from \"./scope-key.ts\";\nimport { keyOrderOf, readsFinished } from \"./sheet-order.ts\";\nimport { originalOf, placesRead, unsharedAll } from \"./unshared.ts\";\n// This import is the last one. Before the import of `@mark1russell7/vex`, it cost 2 to 6 % on two rows of the module bench (V-093).\nimport { sameValue } from \"@mark1russell7/coeval\";\n\n/** The options of a standalone module. */\nexport interface ModuleOptions {\n readonly domains?: readonly AnyDomain[];\n /** The kinds of the fields of the records and of the variables. A module reads only the names of its schema. */\n readonly schema: Schema;\n /**\n * The name of the function that the module exports. The default is `run`. A reserved word, `VEX_ERROR` and\n * `VexContractError` are not names of the run (V-060). Each other name hides nothing from the code (COMPILE.MODULE.NAME).\n */\n readonly name?: string;\n /**\n * The space of the records. In each space, the key of a record is the text of its position, unless the option\n * `keys` is true. The default `array`\n * has no parents. A `tree` takes the parents as the third argument of the run (COMPILE.MODULE.TREE). Each entry\n * is the position of the parent of its record, or -1 for a root. A `graph` takes the edges as the third argument\n * (COMPILE.MODULE.GRAPH). Each entry is an array of the positions of the ends of the edges from its record, in order.\n */\n readonly space?: \"array\" | \"tree\" | \"graph\";\n /**\n * The highest step of the language that the host accepts (STEP.MAX). The default is B. A program that needs a higher\n * step gives a reason that names its step.\n */\n readonly maxStep?: VexStep;\n /**\n * True to fuse the chains of list ops into loops (`COMPILER.md` §7.6), and false for the code without fusion\n * (COMPILE.MODULE.FUSE.OFF). The default is true. In this version, the two values print the same code.\n */\n readonly fuse?: boolean;\n /**\n * The form of the lists of the input and of the result (COMPILE.MODULE.LIST.PLAIN). The default `envelope` gives each\n * list as a `vex.list`. With `plain`, a list is an array of the values of its items, and an error item is `VEX_ERROR`.\n * The key of an item of the input is the text of its position, and the result has no keys. A list in a record or in\n * an argument of an op stays a `vex.list`.\n */\n readonly lists?: \"envelope\" | \"plain\";\n /**\n * True when the run takes the keys of the records as its last argument (COMPILE.MODULE.KEYS). The argument is an array\n * with one text for each record, and each text is different. A program that reads no key ignores it and prints the\n * same text as without the option. The default is false.\n */\n readonly keys?: boolean;\n /**\n * What a catch of the module does with an exception that no function of a domain gives (COMPILE.MODULE.FAULT). The\n * default `value` gives the error of Vex for each exception. With `throw`, the exception leaves the run, so a fault\n * of the printed code does not become a value. An exception of a function of a domain stays an error of Vex.\n */\n readonly faults?: \"value\" | \"throw\";\n}\n\n/** The options of a module of a sheet (COMPILE.MODULE.SHEET): the options of a module, and the parts of a sheet. */\nexport interface SheetModuleOptions extends ModuleOptions {\n /** The cells with their own formula (SHEET.CELL.FORMULA). The formula of a cell replaces the formula of its column at its key. */\n readonly cells?: CellFormulas;\n /**\n * The kind of the values of each column. The printer prints each column after the columns that it reads. A column\n * that a formula reads before its own formula prints needs its kind here, for example a column that reads itself.\n * A column of lists has a `ListKind` (COMPILE.MODULE.SHEET.LIST).\n */\n readonly kinds?: Readonly<Record<string, Kind | ListKind>>;\n /** The budget of the stack of the search of a run, in estimated frames, as in `SheetRun`. The default is 3000. */\n readonly budget?: number;\n}\n\nexport type { ListKind } from \"./facts.ts\";\n\n/** The source of a standalone module, or the reason that the program cannot be one. */\nexport type Emitted = { readonly ok: true; readonly source: string } | { readonly ok: false; readonly reason: string };\n\n\n/**\n * The error that stops the second print of a fast sum (`#packed`) or of the steps of a fold (`#packedSteps`). Then the\n * loop keeps the code of its first print.\n */\nclass NoPack extends Error {}\n\n/**\n * The state of the second print of a fast sum (`#packed`) or of the steps of a fold (`#packedSteps`). It has the foci\n * of the loops whose reads of a column read its pack. It also has the local name of the pack of each column.\n */\ninterface Pack {\n readonly foci: Set<string>;\n /** True when a column of the function that the printer prints has a pack too, with a variable in that function. */\n readonly calls: boolean;\n readonly cols: Map<string, string>;\n /** The value locals that the second print makes. Each one is a local of its loop until a line of the run declares it. */\n readonly locals: Set<string>;\n /** The count of the calls that the second print puts at their place. A count over `INLINES` stops the print. */\n inlines: number;\n}\n\n/**\n * The state of the keys of one print (COMPILE.MODULE.KEYS). With `keyed`, the code uses the keys of the argument of the\n * run. The printer sets `read` when the program can show a key of a record to a part of the code or to the host.\n */\ninterface KeyPrint {\n readonly keyed: boolean;\n read: boolean;\n}\n\n/** The helpers that show the key of an item: a compare of keys, and a `vex.list` of a result, an argument or a field. */\nconst KEY_READS: ReadonlySet<string> = new Set([\"GT\", \"WO\", \"WOC\", \"LO\", \"LS\", \"LOC\", \"LSC\", \"LV\", \"LVC\", \"LC\"]);\n\n/** The most calls that the second print of a fast sum puts at their place. Thus a chain of calls stays linear. */\nconst INLINES = 64;\n\n/** The list ops that a fast sum can be: each one adds or compares numbers, and its step cannot throw (`#packed`). */\nconst PACK_OPS: ReadonlySet<string> = new Set([\"sum\", \"mean\", \"min\", \"max\"]);\n\n/**\n * A value of the printer: its code, its kind if the printer knows it, and true when its code cannot throw. A literal,\n * a variable of the schema and a field of the schema at the focus or at the origin cannot throw.\n */\ninterface Value {\n readonly code: string;\n readonly kind: Kind | undefined;\n readonly safe: boolean;\n /** For the read of a name that can hold the error sentinel: the name itself, which holds the value or the sentinel. */\n readonly held?: string;\n /**\n * The levels of the keys that the value depends on: 1 for the key of the run, and one more for each axis around it.\n * A value with no levels is a constant of the run.\n */\n readonly deps: ReadonlySet<number>;\n /** True for a literal and for the read of a name: a constant of the run with such code needs no variable of its own. */\n readonly plain?: boolean;\n /** For a list (LIST.VALUE): the kind of its items. The code is an array of pairs of a key and a value or the sentinel. */\n readonly list?: ListInfo | undefined;\n}\n\n/**\n * The facts of a list of the code: the kind of the values of its items, if the printer knows it. The key of an item is\n * the position of its record or the text of the key of a list literal (LIST.LITERAL). It can also be a position of `fill`.\n */\ninterface ListInfo {\n readonly item: Kind | undefined;\n /** For a list of lists (LIST.FLAT): the facts of each list that is the value of an item. Each item of such a list is an array. */\n readonly inner?: ListInfo | undefined;\n /** True when a key can be a key of a literal or of `fill`. The axis list cannot read a record at such a key. */\n readonly texts?: boolean;\n /** True for a list without items: the empty literal, and a list from it. Such a list fits each list. */\n readonly empty?: boolean;\n /** True when no item of the list holds the error sentinel (COMPILE.MODULE.FUSE.FACTS). Fusion uses this fact. */\n readonly clean?: boolean;\n /** True when no other part of the code holds the array of the list, so an op can take the array as its own. */\n readonly fresh?: boolean;\n}\n\n/** This function gives the facts of a list without the facts of fusion. A signature and a key of the memo use them. */\n/** The facts of the prints of one program about the names of loops that start with the empty list (COMPILE.MODULE.LOOP.EMPTY). */\ninterface EmptyStarts {\n /** The kinds of the items that the steps give, by the expression of the step of each name. */\n readonly found: Map<Expr, Pick<ListInfo, \"item\" | \"inner\">>;\n /** The expressions of a program with one object at each place. The prints use one set of copies, so `found` holds for each print. */\n readonly copies: Map<object, readonly Expr[]>;\n /** True for a print that only looks for these kinds. There, each name without a kind counts as an empty list. */\n readonly seek: boolean;\n}\n\nfunction plainList(l: ListInfo | undefined): ListInfo | undefined {\n if (l === undefined) return undefined;\n const { clean: _clean, fresh: _fresh, ...rest } = l;\n return { ...rest, inner: plainList(l.inner) };\n}\n\n/** This function gives the facts of a list that another part of the code can hold: the list is not fresh. */\nfunction heldList(l: ListInfo | undefined): ListInfo | undefined {\n return l?.fresh === true ? { ...l, fresh: false } : l;\n}\n\n/**\n * The facts of fusion of a list node of a program (COMPILE.MODULE.FUSE.FACTS). They are `clean` for the list and for\n * each level of its items, `fresh` and the count of the reads of its value. A count of `Infinity` tells that a loop, a\n * memo node or the loop over the keys reads the value again. The tests of the analysis read these facts.\n */\nexport interface ListFacts {\n readonly clean: boolean;\n /** The fact `clean` of each level of a list of lists, from the outside in. */\n readonly inner: readonly boolean[];\n readonly fresh: boolean;\n readonly reads: number;\n}\n\n/** The op of each step of `reduce` (COMPILE.MODULE.REDUCE): the name of the op, and the value of the option `domain`. */\ninterface Step {\n readonly op: string;\n readonly domain: unknown;\n}\n\n/** The code of a node: the statements before its value, and its value. `safe` covers the statements too. */\ninterface Code {\n readonly s: readonly string[];\n readonly v: Value;\n}\n\n/**\n * The code of a list in a fused loop (COMPILE.MODULE.FUSE). It has the statements that push its items into the output\n * of the loop, and their levels. It also has the fact that they cannot throw, and the facts of the list.\n */\ninterface Pushed {\n readonly s: readonly string[];\n readonly deps: ReadonlySet<number>;\n readonly safe: boolean;\n readonly list: ListInfo | undefined;\n}\n\n/**\n * The code of a list of `fill` that a loop or `count` reads only as a range (COMPILE.MODULE.FILL.RANGE). The module\n * makes no array for it. The count checks the arguments, as `FI` does. Each item has the key of its position and the\n * value `item`, a name or a literal. The statements come before the count, and `count.safe` covers them too.\n */\ninterface Range {\n readonly s: readonly string[];\n readonly count: Value;\n readonly item: string;\n readonly info: ListInfo;\n}\n\n/**\n * A part of a fused loop before the decision about the constants of the run (COMPILE.MODULE.FUSE). Its function `s`\n * gives its statements. With `settle`, a part that is a constant of the run evaluates once, before the loop over the keys.\n */\ninterface Part {\n readonly s: (settle: boolean) => readonly string[];\n readonly deps: ReadonlySet<number>;\n readonly safe: boolean;\n readonly list: ListInfo | undefined;\n}\n\n/** The tags of the nodes that can read at the focus. Only a node with one of them can be a column of the run. */\nconst FOCUS_TAGS: ReadonlySet<string> = new Set([\"ref\", \"ext\", \"call\", \"each\", \"fold\"]);\n\n/** This function tells if an expression has a node that can read at the focus. */\nconst readsFocus = (e: Expr): boolean => FOCUS_TAGS.has(e.tag) || (e.tag === \"iterate\" && limitAxis(e) !== undefined) || children(e).some(readsFocus);\n\n/**\n * This function tells if an expression has a node that can read a cell: a read of a cell or a call. The interpreter\n * evaluates each list of an append, also after an error. Thus a search of a sheet sees each read of a cell.\n */\nconst readsCells = (e: Expr): boolean => e.tag === \"ext\" || e.tag === \"call\" || children(e).some(readsCells);\n\n/** This function tells if an expression is the literal 1. */\n// Stryker disable next-line OptionalChaining: each caller gives an argument.\nconst isOne = (e: Expr | undefined): boolean => e?.tag === \"lit\" && e.value === 1;\n\n/** This function gives the value of a literal. For each other expression, it gives undefined, also for a node with an extra field `value`. */\nconst literalOf = (e: Expr): unknown => (e.tag === \"lit\" ? e.value : undefined);\n\n/** The kinds of a literal whose code is its value. A read of such code at each item costs nothing (COMPILE.MODULE.FILL.RANGE). */\nconst PLAIN_LITERALS: ReadonlySet<string> = new Set([\"number\", \"string\", \"boolean\"]);\n\n/** This function tells if an expression reads nothing of a run: it has only literals and ops. */\nconst isClosed = (e: Expr): boolean => e.tag === \"lit\" || (e.tag === \"app\" && e.args.every((x) => isClosed(x)));\n\n/** The space of the evaluation of an expression that reads nothing of a run. */\nconst ONE_RECORD = spaces.array([{}]);\n\n/** A name of the program in the code: its variable, its kind, true when it can hold the error sentinel, and its levels. */\ninterface Name {\n readonly code: string;\n readonly kind: Kind | undefined;\n readonly lazy: boolean;\n readonly deps: ReadonlySet<number>;\n readonly list?: ListInfo | undefined;\n}\n\n/** An argument of a call: its code, its kind, its levels and the facts of its list (COMPILE.MODULE.LIST.ARG). */\ninterface Arg {\n readonly code: string;\n readonly kind: Kind | undefined;\n readonly deps: ReadonlySet<number>;\n readonly list: ListInfo | undefined;\n}\n\n/** The levels of a constant of the run. */\nconst NO_DEPS: ReadonlySet<number> = new Set();\n\n/** The names of the items of a loop without `as` (COMPILE.MODULE.LIST.ITEM). */\nconst NO_NAMES: ReadonlyMap<string, Name> = new Map();\n\n/** This function gives the names of a body or of a step: the names `as` of the items hide the names outside (AXIS.LIST.SCOPE). */\nconst withNames = (env: ReadonlyMap<string, Name>, items: ReadonlyMap<string, Name>): ReadonlyMap<string, Name> => new Map([...env, ...items]);\n\n/**\n * The level of a read of a cell (COMPILE.MODULE.SHEET). The results of the cells change in a run. Thus a value that reads\n * a cell is not a constant or a column of the run. The level is far from the other levels.\n */\nconst CELLS = -1;\n\n/**\n * The level of a read of a column in its step (COMPILE.FIX.MODULE). A row changes in each round. Thus a value that reads\n * a row is not a constant or a column of the run. The `fix` node removes this level.\n */\nconst ROUNDS = -2;\n\n/** The name of the function of a run of a sheet that reads a cell: its column and its position. */\nconst READ_CELL = \"RC\";\n\n/** This pattern finds a read of a cell in the code of a value: the read, or a printed function that can read a cell. */\nconst READS_IN_CODE = /\\b(RC|fn\\d+)\\(/;\n\n/** The columns of a sheet for the printer (COMPILE.MODULE.SHEET). */\ninterface SheetInfo {\n /** The position of each column in the arrays of the run. */\n readonly columns: ReadonlyMap<string, number>;\n /** The kind of each column that the printer knows: a kind of the options, or the kind of a printed formula. */\n readonly kinds: Map<string, Kind | undefined>;\n /** The facts of the lists of each column of lists that the printer knows (COMPILE.MODULE.SHEET.LIST). */\n readonly lists: Map<string, ListInfo>;\n /** True when each read of a cell reads a finished cell, so a read starts no search (COMPILE.MODULE.SHEET.DIRECT). */\n readonly direct: boolean;\n}\n\n/** This function gives the levels of some codes together. */\nconst depsOf = (...xs: readonly Code[]): ReadonlySet<number> => new Set(xs.flatMap((x) => [...x.v.deps]));\n\n/** This function gives the statements of some codes, in order. */\nconst stmtsOf = (...xs: readonly Code[]): string[] => xs.flatMap((x) => x.s);\n\n/** This function indents some statements by one level. */\nconst ind = (xs: readonly string[]): string[] => xs.map((x) => ` ${x}`);\n\n/**\n * The lexical position of a node: the code of the index of its origin and of its focus, and its names. It also has the\n * keys of its node of the memo. A node of the memo reads neither its origin nor its focus, so these are undefined there.\n */\ninterface Ctx {\n readonly origin: string | undefined;\n readonly focus: string | undefined;\n /** The level of the focus: 1 at the key of the run, and one more in each axis. */\n readonly level: number;\n /** The level of the origin: 1 at the key of the run, and the marker of the origin in the body of a function. */\n readonly originLevel: number;\n readonly env: ReadonlyMap<string, Name>;\n readonly keys: ReadonlyMap<Expr, Name>;\n /** The bound functions (FN.BIND), with the context of their binding. */\n readonly fns: ReadonlyMap<string, BoundFn>;\n /** The columns of the steps around the node (COMPILE.FIX.MODULE): the name of the array of the last round, and its kind. */\n readonly columns: ReadonlyMap<string, FixColumn>;\n}\n\n/** A column in the step of its `fix`: the name of the array with the value of each row, and the kind of the values. */\ninterface FixColumn {\n readonly code: string;\n readonly kind: Kind;\n}\n\n/** The code of the step of one name of a loop: the statements of its new value and the statement that sets it. */\ninterface StepPart {\n readonly name: string;\n readonly s: readonly string[];\n readonly set: string;\n /** True when the value of the step cannot throw. */\n readonly safe: boolean;\n}\n\n/** The printed step of a loop: its statements, their levels, the names that append to their own lists, and the code of each name. */\ninterface LoopStep {\n readonly s: readonly string[];\n readonly deps: ReadonlySet<number>;\n readonly owners: readonly Owner[];\n readonly parts: readonly StepPart[];\n}\n\n/** The parts of a printed fold that its scan reads (COMPILE.MODULE.SCAN): its names, its targets, its test, its steps and its result. */\ninterface ScanParts {\n readonly loop: number;\n readonly names: { readonly s: readonly string[]; readonly vars: ReadonlyMap<string, Name>; readonly deps: ReadonlySet<number> };\n readonly t: { readonly s: readonly string[]; readonly j: string; readonly key: readonly string[]; readonly check: readonly string[]; readonly skip: string | undefined; readonly inner: Ctx; readonly tests: readonly Expr[] };\n readonly test: Code | undefined;\n readonly step: LoopStep;\n readonly result: Code;\n}\n\n/**\n * A name of a loop whose step appends to its own list (COMPILE.MODULE.APPEND.OWN). It has the name, its read in the\n * loop and the variable of the array of its last append. The printer makes the variable at the first append that uses it.\n * With `adopt`, the variable starts with the first list of the name, so the first append makes no copy\n * (COMPILE.MODULE.FUSE.ADOPT). With `sure`, each append of the name gets the array of the variable as its list. Then\n * an append of one item pushes the item with no check.\n */\ninterface Owner {\n readonly name: string;\n readonly read: Name;\n w: string | undefined;\n readonly adopt: boolean;\n readonly sure: boolean;\n}\n\n/**\n * A `let` in the result of a loop that binds the list of an owner to the name `bind` (COMPILE.MODULE.FUSE.ADOPT). The\n * append nodes in `nodes` append to the list of `bind` in the body of the let. They get the owner when the let prints.\n */\ninterface Relay {\n readonly bind: string;\n readonly nodes: readonly Expr[];\n}\n\n/**\n * A bound function of the printer (FN.BIND): its node and the context of its binding. It also has one printed\n * JavaScript function for each signature of the arguments of its calls.\n */\ninterface BoundFn {\n /** The number of the binding. Two functions with one name are two functions, so a key of a constant needs it. */\n readonly id: number;\n readonly fn: ExprOf<\"fn\">;\n readonly ctx: Ctx;\n /** The printed function for each signature: the kind of each argument. */\n readonly specs: Map<string, Spec>;\n /** The declarations of the printed functions that read names of the place of the binding. The let prints them. */\n readonly decls: string[];\n /** True when a printed function of the binding is at the place of the binding, not at the start of a run. */\n local: boolean;\n}\n\n/**\n * A function that the printer prints at this time. Its parameters, and the bindings at the root of its body, keep their\n * values for the whole call. Thus a part of a loop that reads only them and its target is a column of the call.\n */\ninterface CallScope {\n /** The marker of the parameters. */\n readonly param: number;\n /** The level of the focus of the function. A part at a higher level is in a loop of the function. */\n readonly focus: number;\n /** True when the body has a loop in a loop, so a call can read a part of a loop more than once. */\n readonly repeats: boolean;\n /** The variables that the start of the body can read: the parameters, and the bindings at the root of the body. */\n readonly names: Set<string>;\n /** The declarations of the columns of the call. The function prints them at the start of its body. */\n readonly decls: string[];\n /** The root of the body. A let at the root moves it to its body, because its bindings are at the start of the body. */\n root: Expr;\n}\n\n/**\n * A printed function. The levels of the value of its body have a marker for the origin, for the focus and for each\n * parameter. A call replaces each marker with the levels at the call.\n */\ninterface Spec {\n readonly name: string;\n readonly kind: Kind | undefined;\n /** The facts of the list of the body, for a function whose value is a list (COMPILE.MODULE.LIST.CALL). */\n readonly list: ListInfo | undefined;\n readonly safe: boolean;\n readonly deps: ReadonlySet<number>;\n readonly origin: number;\n readonly focus: number;\n readonly param: number;\n /** True when the body reads only constants of the run, its parameters and its position, so it is at the start of a run. */\n readonly global: boolean;\n}\n\n/** The name of a helper of the generated code. */\ntype Helper = \"F\" | \"C\" | \"T\" | \"L\" | \"Q\" | \"G\" | \"B\" | \"U\" | \"X\" | \"I\" | \"K\" | \"M\" | \"M1\" | \"S\" | \"V\" | \"SB\" | \"SK\" | \"TK\" | \"VW\" | \"NT\" | \"CT\" | \"FS\" | \"FI\" | \"FN\" | \"TN\" | \"LI\" | \"LA\" | \"LP\" | \"LS\" | \"KC\" | \"KP\" | BuildHelper | TreeHelper | GraphHelper | SheetHelper | CleanHelper | \"SBI\" | \"SKI\" | \"PF\" | \"QA\" | \"AI\" | \"AW\" | \"KS\";\n\n/**\n * The helpers of the clean form (COMPILE.MODULE.FUSE.CLEAN). Each one is the helper without the last letter `C`, for\n * lists that the facts prove clean. Thus it has no scan of `V`, no `VW` and no test of the sentinel.\n */\ntype CleanHelper = \"SBC\" | \"SKC\" | \"TKC\" | \"DRC\" | \"AOC\" | \"AIC\" | \"AWC\" | \"WOC\" | \"FLC\" | \"IXC\" | \"NTC\" | \"SNC\" | \"FSC\" | \"LOC\" | \"LSC\" | \"LVC\" | \"LPC\";\n\n/** The helpers of the list ops that build a list (LIST.BUILD), of `get` (LIST.GET) and of `indexOf` (LIST.INDEXOF). */\ntype BuildHelper = \"DR\" | \"AP\" | \"AO\" | \"WO\" | \"FL\" | \"GT\" | \"IX\" | \"SN\";\n\n/** The helpers of a tree space (COMPILE.MODULE.TREE). */\ntype TreeHelper = \"PT\" | \"CH\" | \"SG\" | \"PR\" | \"UP\" | \"SO\" | \"AN\" | \"BF\";\n\n/** The helpers of a graph space (COMPILE.MODULE.GRAPH). */\ntype GraphHelper = \"GR\" | \"GI\" | \"RB\";\n\n/** The helpers of a sheet (COMPILE.MODULE.SHEET): the state of a run of a sheet, and the order of the keys of a tree. */\ntype SheetHelper = \"SH\" | \"KO\" | \"DO\" | \"LO\" | \"LC\" | \"LV\" | \"LCP\";\n\n/** The helpers of the generated code. A module has only the helpers that it uses. */\nconst HELPERS: Readonly<Record<Exclude<Helper, \"S\">, string>> = {\n F: \"function F() { throw E; }\",\n C: \"function C(m) { throw new VexContractError(m); }\",\n // An exception of an op is an error of Vex too, as in the interpreter. Only the checks of the contract throw a\n // VexContractError, and they come before the run, so each catch of the run gives the sentinel.\n T: \"function T(f) { try { return f(); } catch { return E; } }\",\n // A constant of the run with a loop evaluates on its first read, so a loop in a branch that no run takes costs nothing.\n L: \"function L(f) { let done = false, v; return () => { if (!done) { done = true; try { v = f(); } catch { v = E; } } return v; }; }\",\n // A column of the run: the value of an expression at each record, on its first read.\n Q: \"function Q(f) { const m = []; return (j) => { let v = m[j]; if (v === undefined) { try { v = f(j); } catch { v = E; } m[j] = v; } return v; }; }\",\n G: \"function G(x) { return x === E ? F() : x; }\",\n // The pack of a column of the run: an array with the value of the column at each record (`#packed`).\n QA: \"function QA(n, f) { const a = []; for (let j = 0; j < n; j++) a.push(f(j)); return a; }\",\n // A fold over the targets before the origin, as a scan (COMPILE.MODULE.SCAN). The first call evaluates the first\n // state and the value of each target. When these values do not decrease, the targets of each origin are a prefix,\n // and each prefix keeps its state. NaN satisfies no test, so its target is in no prefix.\n PF: [\n \"function PF(n, init, key, test, step, result) {\",\n \" let ts, js, a0, bad, mono, pa;\",\n \" return (q) => {\",\n \" if (ts === undefined) {\",\n \" ts = [];\",\n \" js = [];\",\n \" bad = false;\",\n \" try { a0 = init(); } catch { a0 = E; }\",\n \" for (let j = 0; j < n; j++) {\",\n \" let t;\",\n \" try { t = key(j); } catch { bad = true; break; }\",\n \" if (t !== t) continue;\",\n \" ts.push(t);\",\n \" js.push(j);\",\n \" }\",\n \" mono = true;\",\n \" for (let i = 1; i < ts.length; i++) if (!(ts[i - 1] <= ts[i])) mono = false;\",\n \" pa = [a0];\",\n \" }\",\n \" if (a0 === E || bad || q === E) F();\",\n \" if (!mono) {\",\n \" let a = a0;\",\n \" for (let i = 0; i < ts.length; i++) if (test(ts[i], q)) a = step(a, js[i]);\",\n \" return result(a);\",\n \" }\",\n \" let lo = 0, hi = ts.length;\",\n \" while (lo < hi) {\",\n \" const h = (lo + hi) >> 1;\",\n \" if (test(ts[h], q)) lo = h + 1;\",\n \" else hi = h;\",\n \" }\",\n \" for (let i = pa.length - 1; i < lo; i++) pa.push(step(pa[i], js[i]));\",\n \" return result(pa[lo]);\",\n \" };\",\n \"}\",\n ].join(\"\\n\"),\n B: 'function B(x) { return typeof x === \"boolean\" ? x : F(); }',\n U: 'function U(x) { return typeof x === \"number\" ? x : F(); }',\n X: \"function X(t, n) { return t >= 0 && t < n ? t : F(); }\",\n // The index of a computed position, and of a computed key: a key of an array space is the text of its index.\n I: \"function I(t, n) { return Number.isInteger(t) && t >= 0 && t < n ? t : F(); }\",\n K: 'function K(k, n) { return typeof k === \"string\" && /^(0|[1-9]\\\\d*)$/.test(k) && +k < n ? +k : F(); }',\n // The ops on the order of a list (LIST.SORT, LIST.TAKE, LIST.NTH) work on the items with values. With strict, an\n // error item is the error of the op. A sort is stable, and the values are numbers without NaN or texts of one kind.\n // V gives a list without error items itself, so it is not copied (COMPILE.MODULE.LIST.SHARE). No op changes it. V does\n // not keep the cache of VW: a property on each new list made the list ops slower (ireko, vex-compiler 0.17.1).\n V: \"function V(l, s) { if (!l.some((x) => x[1] === E)) return l; if (s) F(); return l.filter((x) => x[1] !== E); }\",\n SB: [\n \"function SB(l, s) {\",\n \" const o = V(l, s);\",\n \" const t = o.length > 0 ? typeof o[0][1] : \\\"number\\\";\",\n \" for (const [, v] of o) if (typeof v !== t || (t !== \\\"number\\\" && t !== \\\"string\\\") || v !== v) F();\",\n \" return o.slice().sort((a, b) => (a[1] < b[1] ? -1 : a[1] > b[1] ? 1 : 0));\",\n \"}\",\n ].join(\"\\n\"),\n // The option by of sortBy (LIST.SORT.BY): the function f gives the sort value of each item with a value, in order.\n SK: [\n \"function SK(l, s, f) {\",\n \" const o = V(l, s).map((x) => [x, f(x[1])]);\",\n \" const t = o.length > 0 ? typeof o[0][1] : \\\"number\\\";\",\n \" for (const [, v] of o) if (typeof v !== t || (t !== \\\"number\\\" && t !== \\\"string\\\") || v !== v) F();\",\n \" return o.sort((a, b) => (a[1] < b[1] ? -1 : a[1] > b[1] ? 1 : 0)).map((x) => x[0]);\",\n \"}\",\n ].join(\"\\n\"),\n TK: \"function TK(l, n, s) { const o = V(l, s); return Number.isSafeInteger(n) && n >= 0 ? o.slice(0, n) : F(); }\",\n // The items with values of a list stay on its array, as GT keeps its index. Thus a loop that reads each item of a list\n // of n items with nth costs O(n), not O(n squared). count and first read them too (COMPILE.MODULE.NTH.INDEX).\n // A list without error items is its own array of items with values.\n VW: [\n \"function VW(l) {\",\n \" let o = l.vw;\",\n \" if (o === undefined) {\",\n \" o = l.some((x) => x[1] === E) ? l.filter((x) => x[1] !== E) : l;\",\n \" l.vw = o;\",\n \" }\",\n \" return o;\",\n \"}\",\n ].join(\"\\n\"),\n NT: [\n \"function NT(l, i, s) {\",\n \" const o = VW(l);\",\n \" if (s && o.length < l.length) F();\",\n \" return Number.isSafeInteger(i) && i >= 0 && i < o.length ? o[i][1] : F();\",\n \"}\",\n ].join(\"\\n\"),\n // count and first of a list that is not an each. With strict, an error item is the error of the op.\n CT: \"function CT(l, s) { const o = VW(l); return s && o.length < l.length ? F() : o.length; }\",\n FS: \"function FS(l, s) { const o = VW(l); return (s && o.length < l.length) || o.length === 0 ? F() : o[0][1]; }\",\n // fill (LIST.FILL, COMPILE.MODULE.FILL): n items with the value v, and the keys 0 to n - 1. A count that is not a whole\n // number from 0 to 100000, or a missing value, is the error of the interpreter. Each item can share the array of a list.\n // setNth (LIST.SETNTH, COMPILE.MODULE.SETNTH): a new array with a new pair at the position i. The item keeps its key.\n // V removes the error items, so the position counts the items with values. The old array and its pairs do not change.\n SN: [\n \"function SN(l, i, v, s) {\",\n \" const x = V(l, s);\",\n \" if (!(Number.isSafeInteger(i) && i >= 0 && i < x.length && v !== undefined)) F();\",\n \" const o = x.slice();\",\n \" o[i] = [x[i][0], v];\",\n \" return o;\",\n \"}\",\n ].join(\"\\n\"),\n FI: [\n \"function FI(n, v) {\",\n \" if (!(Number.isSafeInteger(n) && n >= 0 && n <= 100000 && v !== undefined)) F();\",\n \" const o = [];\",\n \" for (let i = 0; i < n; i++) o.push([i, v]);\",\n \" return o;\",\n \"}\",\n ].join(\"\\n\"),\n // A range of fill (COMPILE.MODULE.FILL.RANGE). FN gives the count of the items of `fill(n, v)` with the check of FI.\n // TN gives the count of `take` of a range with the check of TK. A sum with 0 changes -0 to 0, as the length does.\n FN: \"function FN(n, v) { return Number.isSafeInteger(n) && n >= 0 && n <= 100000 && v !== undefined ? n + 0 : F(); }\",\n TN: \"function TN(n, k) { return Number.isSafeInteger(k) && k >= 0 ? Math.min(n, k + 0) : F(); }\",\n // A list of a field of the input (COMPILE.MODULE.LIST.INPUT): the array of a `vex.list` whose items have lists to the\n // depth `h`, and values that pass the test `t`. The shape is the shape of `isVexList`. An error item holds the sentinel.\n // An input that is not such a list, or an error item of `#DEPTH!`, gives undefined, so the check of the run fails.\n LI: [\n \"function LI(x, h, t) {\",\n \" if (typeof x !== \\\"object\\\" || x === null || x.kind !== \\\"vex.list\\\" || !Array.isArray(x.items)) return undefined;\",\n \" const o = [];\",\n \" for (let i = 0; i < x.items.length; i++) {\",\n \" const it = x.items[i];\",\n \" const r = typeof it === \\\"object\\\" && it !== null ? it.result : undefined;\",\n \" if (typeof r !== \\\"object\\\" || r === null || typeof it.key !== \\\"string\\\") return undefined;\",\n \" if (r.ok === true) {\",\n \" const v = h > 0 ? LI(r.value, h - 1, t) : r.value !== undefined && t(r.value) ? r.value : undefined;\",\n \" if (v === undefined) return undefined;\",\n \" o.push([it.key, v]);\",\n \" } else {\",\n \" const e = r.error;\",\n \" if (r.ok !== false || typeof e !== \\\"object\\\" || e === null || typeof e.code !== \\\"string\\\" || typeof e.kind !== \\\"string\\\" || typeof e.message !== \\\"string\\\" || !Array.isArray(e.path) || e.kind === \\\"depth\\\") return undefined;\",\n \" o.push([it.key, E]);\",\n \" }\",\n \" }\",\n \" return o;\",\n \"}\",\n ].join(\"\\n\"),\n // A plain list of a field of the input (COMPILE.MODULE.LIST.PLAIN): an array of the values of the items, with arrays to\n // the depth `h`. The key of an item is its position. The value VEX_ERROR is an error item, also if `t` accepts it.\n // Another value gives undefined, so the check of the run fails.\n LA: [\n \"function LA(x, h, t) {\",\n \" if (!Array.isArray(x)) return undefined;\",\n \" const o = [];\",\n \" for (let i = 0; i < x.length; i++) {\",\n \" const y = x[i];\",\n \" if (y === VEX_ERROR) {\",\n \" o.push([i, E]);\",\n \" continue;\",\n \" }\",\n \" const v = h > 0 ? LA(y, h - 1, t) : y !== undefined && t(y) ? y : undefined;\",\n \" if (v === undefined) return undefined;\",\n \" o.push([i, v]);\",\n \" }\",\n \" return o;\",\n \"}\",\n ].join(\"\\n\"),\n // The ops that build a list (LIST.BUILD) keep the key and the value of each item. A key is a position or a text, so\n // `without` and `get` compare the text of each key. A list is an array that does not change after the op that makes it.\n // The one exception is the array of AO of a loop, which no other part reads (COMPILE.MODULE.APPEND.OWN).\n DR: \"function DR(l, n, s) { const o = V(l, s); return Number.isSafeInteger(n) && n >= 0 ? o.slice(n) : F(); }\",\n AP: \"function AP(l, o, s) { return V(l, s).concat(V(o, s)); }\",\n // append into the list of a name of a loop (COMPILE.MODULE.APPEND.OWN). w is the array of the last append of the name\n // in this run of the loop, and no other part reads it. Such an array has no error items, so VW of it is the array.\n // With fuse, w can start with a first list that is clean and fresh (COMPILE.MODULE.FUSE.ADOPT). An append in the result\n // of the loop can use w too, when no part reads the list after it.\n // Each other list gets the copy of AP. V(o, s) throws before the first push, so an error does not change l. The loop\n // reads n items, so it ends also if a is l.\n AO: \"function AO(l, o, s, w) { if (l !== w) return AP(l, o, s); const a = V(o, s), n = a.length; for (let i = 0; i < n; i++) l.push(a[i]); return l; }\",\n // The target of an append of an owner that pushes the items of its second list (COMPILE.MODULE.APPEND.PUSH). The\n // array w is the target. Each other list gets a copy without its error items, and with s an error item is an error.\n // AI pushes the one item x of fill(1, x) into the target. The code of x evaluates before the call, as in the interpreter.\n AW: \"function AW(l, s, w) { if (l === w) return l; const a = V(l, s), o = []; for (let i = 0; i < a.length; i++) o.push(a[i]); return o; }\",\n AI: \"function AI(l, x, s, w) { const o = AW(l, s, w); o.push(x); return o; }\",\n WO: [\n \"function WO(l, o, s) {\",\n \" const a = V(l, s), g = new Map();\",\n \" for (const [k] of V(o, s)) g.set(`${k}`, 1);\",\n \" return a.filter((x) => !g.has(`${x[0]}`));\",\n \"}\",\n ].join(\"\\n\"),\n FL: [\n \"function FL(l, s) {\",\n \" const o = [];\",\n \" for (const [, v] of V(l, s)) for (const x of V(v, s)) o.push(x);\",\n \" return o;\",\n \"}\",\n ].join(\"\\n\"),\n // The index of the keys of a list (LIST.GET): the value of the first item of each key. The array keeps its index, so a\n // step that reads each key of a list of n items costs O(n). The key E marks an error item, for strict.\n // The array of a loop gets a push after a read (COMPILE.MODULE.APPEND.LET), so `n` counts the items in the index.\n // A push only adds items at the end, so the index adds only the new items. No other change of an array has a read before it.\n GT: [\n \"function GT(l, k, s) {\",\n \" let x = l.ix;\",\n \" if (x === undefined) {\",\n \" x = new Map();\",\n \" x.n = 0;\",\n \" l.ix = x;\",\n \" }\",\n \" if (x.n !== l.length) {\",\n \" for (let i = x.n; i < l.length; i++) {\",\n \" const [q, v] = l[i], t = `${q}`;\",\n \" if (v === E) x.set(E, E);\",\n \" else if (!x.has(t)) x.set(t, v);\",\n \" }\",\n \" x.n = l.length;\",\n \" }\",\n ' return (s && x.has(E)) || typeof k !== \"string\" || !x.has(k) ? F() : x.get(k);',\n \"}\",\n ].join(\"\\n\"),\n // The position of the first value among the items with a value (LIST.INDEXOF). `===` compares the values.\n IX: [\n \"function IX(l, x, s) {\",\n \" const o = V(l, s);\",\n ' if (typeof x !== \"number\" && typeof x !== \"string\" && typeof x !== \"boolean\") F();',\n \" for (let i = 0; i < o.length; i++) if (o[i][1] === x) return i;\",\n \" return F();\",\n \"}\",\n ].join(\"\\n\"),\n // The keys of a run (COMPILE.MODULE.KEYS): a map of each key to its position. A key that is not a text, or a second\n // use of a key, is against the contract, because a space has no such keys.\n KC: [\n \"function KC(a, n) {\",\n ' if (!Array.isArray(a) || a.length !== n) C(\"the keys are not an array with one key for each record\");',\n \" const m = new Map();\",\n \" for (let i = 0; i < n; i++) {\",\n \" const k = a[i];\",\n ' if (typeof k !== \"string\" || m.has(k)) C(`the key ${i} is not a text of its own`);',\n \" m.set(k, i);\",\n \" }\",\n \" return m;\",\n \"}\",\n ].join(\"\\n\"),\n // The position of a key of a move. A value that is not a key of the space is an error of the move (NAV.KEY).\n KP: \"function KP(m, k) { const i = m.get(k); return i === undefined ? F() : i; }\",\n // The parents of a tree space: the position of the parent of each record, or -1 for a root. A walk up from each record\n // marks its keys, so a walk that meets a key of the same walk finds a cycle. Each key is in one walk, so the check is linear.\n PT: [\n \"function PT(p, n) {\",\n ' if (!Array.isArray(p) || p.length !== n) C(\"the parents are not an array with one parent for each record\");',\n \" const P = new Int32Array(n), s = new Uint8Array(n);\",\n \" for (let i = 0; i < n; i++) {\",\n \" const x = p[i];\",\n \" if (x !== -1 && !(Number.isInteger(x) && x >= 0 && x < n)) C(`the parent of the record ${i} is not -1 or the position of a record`);\",\n \" P[i] = x;\",\n \" }\",\n \" for (let i = 0; i < n; i++) {\",\n \" let k = i;\",\n \" while (k >= 0 && s[k] === 0) {\",\n \" s[k] = 1;\",\n \" k = P[k];\",\n \" }\",\n \" if (k >= 0 && s[k] === 1) C(`the parents of the record ${i} make a cycle`);\",\n \" for (k = i; k >= 0 && s[k] === 1; k = P[k]) s[k] = 2;\",\n \" }\",\n \" return P;\",\n \"}\",\n ].join(\"\\n\"),\n // The children of each record and the roots, in key order.\n CH: [\n \"function CH(P, n) {\",\n \" const h = [], r = [];\",\n \" for (let i = 0; i < n; i++) h.push([]);\",\n \" for (let i = 0; i < n; i++) (P[i] < 0 ? r : h[P[i]]).push(i);\",\n \" return [h, r];\",\n \"}\",\n ].join(\"\\n\"),\n // The siblings of each record with the record itself, and its position among them. The roots are the siblings of a root.\n SG: [\n \"function SG(P, h, r, n) {\",\n \" const g = [], s = new Int32Array(n);\",\n \" for (let i = 0; i < n; i++) g.push(P[i] < 0 ? r : h[P[i]]);\",\n \" for (const x of [r, ...h]) for (let q = 0; q < x.length; q++) s[x[q]] = q;\",\n \" return [g, s];\",\n \"}\",\n ].join(\"\\n\"),\n // The keys depth first, with each parent before its children, and the position and the size of the subtree of each\n // record. Thus the descendants of a record are the keys after it, as many as its subtree has under it.\n PR: [\n \"function PR(P, n) {\",\n \" const f = new Int32Array(n).fill(-1), x = new Int32Array(n), o = new Int32Array(n), at = new Int32Array(n), z = new Int32Array(n);\",\n \" let r = -1;\",\n \" for (let i = n - 1; i >= 0; i--) {\",\n \" const p = P[i];\",\n \" if (p < 0) {\",\n \" x[i] = r;\",\n \" r = i;\",\n \" } else {\",\n \" x[i] = f[p];\",\n \" f[p] = i;\",\n \" }\",\n \" }\",\n \" let m = 0;\",\n \" for (let k = r; k >= 0; ) {\",\n \" at[k] = m;\",\n \" o[m++] = k;\",\n \" if (f[k] >= 0) k = f[k];\",\n \" else {\",\n \" while (k >= 0 && x[k] < 0) k = P[k];\",\n \" if (k >= 0) k = x[k];\",\n \" }\",\n \" }\",\n \" for (let q = n - 1; q >= 0; q--) {\",\n \" const k = o[q], p = P[k];\",\n \" z[k]++;\",\n \" if (p >= 0) z[p] += z[k];\",\n \" }\",\n \" return [o, at, z];\",\n \"}\",\n ].join(\"\\n\"),\n UP: \"function UP(P, k) { const p = P[k]; return p < 0 ? F() : p; }\",\n SO: \"function SO(g, s, k, d) { const t = g[k][s[k] + d]; return t === undefined ? F() : t; }\",\n AN: \"function AN(P, k) { const o = []; for (let p = P[k]; p >= 0; p = P[p]) o.push(p); return o; }\",\n // The record and the keys under it, in the order of a breadth-first search. A tree has no cycle, so no key comes twice.\n BF: \"function BF(h, k) { const o = [k]; for (let i = 0; i < o.length; i++) for (const c of h[o[i]]) o.push(c); return o; }\",\n // The edges of a graph space: the positions of the ends of the edges from each record, in order. A second edge to the\n // same end is the same edge, as in the interpreter. The mark of an end is the number of its record plus 1.\n GR: [\n \"function GR(e, n) {\",\n ' if (!Array.isArray(e) || e.length !== n) C(\"the edges are not an array with the ends of the edges of each record\");',\n \" const O = [], s = new Int32Array(n);\",\n \" for (let i = 0; i < n; i++) {\",\n \" const x = e[i];\",\n \" if (!Array.isArray(x)) C(`the edges of the record ${i} are not an array`);\",\n \" const o = [];\",\n \" for (const t of x) {\",\n \" if (!(Number.isInteger(t) && t >= 0 && t < n)) C(`an edge of the record ${i} does not go to the position of a record`);\",\n \" if (s[t] !== i + 1) {\",\n \" s[t] = i + 1;\",\n \" o.push(t);\",\n \" }\",\n \" }\",\n \" O.push(o);\",\n \" }\",\n \" return O;\",\n \"}\",\n ].join(\"\\n\"),\n // The predecessors of each record of a graph, in key order: the records in key order, and the ends of the edges of each record.\n GI: \"function GI(O, n) { const I = []; for (let i = 0; i < n; i++) I.push([]); for (let i = 0; i < n; i++) for (const t of O[i]) I[t].push(i); return I; }\",\n // The record and the keys that a path of edges reaches from it, once, in the order of a breadth-first search.\n RB: \"function RB(O, k, n) { const s = new Uint8Array(n), o = [k]; s[k] = 1; for (let i = 0; i < o.length; i++) for (const c of O[o[i]]) if (s[c] === 0) { s[c] = 1; o.push(c); } return o; }\",\n // The state of a run of a sheet (COMPILE.MODULE.SHEET), as in SheetRun: the result of each finished cell, the search\n // of Tarjan with its stack, and the budget of the stack. `r` reads a cell, `f` fills a cell, and `o` gives a column.\n // A cell without a formula has the error sentinel from the start, as the error of its read.\n // A column of a direct fill (COMPILE.MODULE.SHEET.DIRECT): the error sentinel of a cell changes to VEX_ERROR.\n DO: \"function DO(d) { for (let k = 0; k < d.length; k++) if (d[k] === E) d[k] = VEX_ERROR; return d; }\",\n // A list of a result (COMPILE.MODULE.LIST.RESULT): a `vex.list` with a text key for each item. An error item has the\n // error VEX_ERROR. The depth `h` is the number of the levels of lists in the items. One key gets the list, so it is not frozen.\n LO: 'function LO(l, h) { return { kind: \"vex.list\", items: l.map(([k, v]) => ({ key: `${k}`, result: v === E ? { ok: false, error: VEX_ERROR } : { ok: true, value: h > 0 ? LO(v, h - 1) : v } })) }; }',\n // The list of a run that each key gets (COMPILE.MODULE.FUSE.OUT): LO, but frozen, because the keys share the object. LS\n // keeps no object on the array, because a property on each new list made the list ops slower (ireko, vex-compiler 0.17.1).\n LS: 'function LS(l, h) { return Object.freeze({ kind: \"vex.list\", items: Object.freeze(l.map(([k, v]) => ({ key: `${k}`, result: v === E ? { ok: false, error: VEX_ERROR } : { ok: true, value: h > 0 ? LS(v, h - 1) : v } }))) }); }',\n // A plain list of a result (COMPILE.MODULE.LIST.PLAIN): an array of the values of the items, with no keys. An error\n // item is VEX_ERROR. The depth `h` is the number of the levels of lists in the items.\n LP: \"function LP(l, h) { return l.map((x) => (x[1] === E ? VEX_ERROR : h > 0 ? LP(x[1], h - 1) : x[1])); }\",\n // A list in an argument of an op or in a field of a record (COMPILE.MODULE.LIST.ARG, COMPILE.MODULE.LIST.FIELD): a frozen\n // `vex.list`, as the interpreter gives. The array keeps it, so each later read of the list gives the same object.\n // The array of a loop gets a push after a read (COMPILE.MODULE.APPEND.LET). A push only adds items, so an object with\n // another count of items is old, and LV makes a new object.\n LV: [\n \"function LV(l, h) {\",\n \" let o = l.vl;\",\n \" if (o === undefined || o.items.length !== l.length) {\",\n ' o = Object.freeze({ kind: \"vex.list\", items: Object.freeze(l.map(([k, v]) => ({ key: `${k}`, result: v === E ? { ok: false, error: VEX_ERROR } : { ok: true, value: h > 0 ? LV(v, h - 1) : v } }))) });',\n \" l.vl = o;\",\n \" }\",\n \" return o;\",\n \"}\",\n ].join(\"\\n\"),\n // The clean form (COMPILE.MODULE.FUSE.CLEAN): the facts prove that no item of a list holds the sentinel. Thus V gives\n // the list itself, VW gives the list, and strict cannot fail. Each helper below is the helper without its last letter,\n // with no scan, no test of the sentinel and no option strict. The other checks stay, so each error stays an error.\n SBC: [\n \"function SBC(l) {\",\n \" const t = l.length > 0 ? typeof l[0][1] : \\\"number\\\";\",\n \" for (const [, v] of l) if (typeof v !== t || (t !== \\\"number\\\" && t !== \\\"string\\\") || v !== v) F();\",\n \" return l.slice().sort((a, b) => (a[1] < b[1] ? -1 : a[1] > b[1] ? 1 : 0));\",\n \"}\",\n ].join(\"\\n\"),\n SKC: [\n \"function SKC(l, f) {\",\n \" const o = l.map((x) => [x, f(x[1])]);\",\n \" const t = o.length > 0 ? typeof o[0][1] : \\\"number\\\";\",\n \" for (const [, v] of o) if (typeof v !== t || (t !== \\\"number\\\" && t !== \\\"string\\\") || v !== v) F();\",\n \" return o.sort((a, b) => (a[1] < b[1] ? -1 : a[1] > b[1] ? 1 : 0)).map((x) => x[0]);\",\n \"}\",\n ].join(\"\\n\"),\n // The sort in place (COMPILE.MODULE.FUSE): a clean list that is fresh is its own sort buffer, so the sort makes no\n // copy. No other part holds the array, so a failure leaves no changed list that a part reads. The sort is stable.\n // A list of 64 items or fewer gets an insertion sort (COMPILE.MODULE.FUSE.SORT), which calls no comparator function.\n // Its test \">\" moves an item only past a larger value, so equal values keep their order. A longer list gets the\n // stable sort of the engine. The kinds of the sort values go through the same check before each of the two sorts.\n SBI: [\n \"function SBI(l) {\",\n \" const n = l.length, t = n > 0 ? typeof l[0][1] : \\\"number\\\";\",\n \" for (let i = 0; i < n; i++) { const v = l[i][1]; if (typeof v !== t || (t !== \\\"number\\\" && t !== \\\"string\\\") || v !== v) F(); }\",\n \" if (n > 64) l.sort((a, b) => (a[1] < b[1] ? -1 : a[1] > b[1] ? 1 : 0));\",\n \" else for (let i = 1; i < n; i++) {\",\n \" const x = l[i], v = x[1];\",\n \" let j = i - 1;\",\n \" for (; j >= 0 && l[j][1] > v; j--) l[j + 1] = l[j];\",\n \" l[j + 1] = x;\",\n \" }\",\n \" return l;\",\n \"}\",\n ].join(\"\\n\"),\n // The option by: the array k holds the sort value of each item, so the sort makes no pair for an item. f runs once\n // for each item, in order, and the array l does not change before the check of the sort values. A long list sorts an\n // array of indices by k, and then reads the items from a copy of l.\n SKI: [\n \"function SKI(l, f) {\",\n \" const n = l.length, k = new Array(n);\",\n \" for (let i = 0; i < n; i++) k[i] = f(l[i][1]);\",\n \" const t = n > 0 ? typeof k[0] : \\\"number\\\";\",\n \" for (const v of k) if (typeof v !== t || (t !== \\\"number\\\" && t !== \\\"string\\\") || v !== v) F();\",\n \" if (n > 64) {\",\n \" const o = new Array(n), c = l.slice();\",\n \" for (let i = 0; i < n; i++) o[i] = i;\",\n \" o.sort((a, b) => (k[a] < k[b] ? -1 : k[a] > k[b] ? 1 : 0));\",\n \" for (let i = 0; i < n; i++) l[i] = c[o[i]];\",\n \" } else for (let i = 1; i < n; i++) {\",\n \" const v = k[i], x = l[i];\",\n \" let j = i - 1;\",\n \" for (; j >= 0 && k[j] > v; j--) { k[j + 1] = k[j]; l[j + 1] = l[j]; }\",\n \" k[j + 1] = v; l[j + 1] = x;\",\n \" }\",\n \" return l;\",\n \"}\",\n ].join(\"\\n\"),\n TKC: \"function TKC(l, n) { return Number.isSafeInteger(n) && n >= 0 ? l.slice(0, n) : F(); }\",\n DRC: \"function DRC(l, n) { return Number.isSafeInteger(n) && n >= 0 ? l.slice(n) : F(); }\",\n // The loop reads n items, so it ends also if o is l.\n AWC: \"function AWC(l, w) { if (l === w) return l; const o = []; for (let i = 0; i < l.length; i++) o.push(l[i]); return o; }\",\n AIC: \"function AIC(l, x, w) { if (l !== w) { const o = []; for (let i = 0; i < l.length; i++) o.push(l[i]); l = o; } l.push(x); return l; }\",\n // The end of a filter of the array of a loop in place (COMPILE.MODULE.APPEND.KEEP): the array keeps its first n items.\n // GT and LV count only the pushes of their array, so the filter removes their caches. VW of the array is the array.\n KS: \"function KS(l, n) { l.length = n; if (l.ix !== undefined) l.ix = undefined; if (l.vl !== undefined) l.vl = undefined; }\",\n AOC: \"function AOC(l, o, w) { if (l !== w) return l.concat(o); const n = o.length; for (let i = 0; i < n; i++) l.push(o[i]); return l; }\",\n WOC: [\n \"function WOC(l, o) {\",\n \" const g = new Map();\",\n \" for (const [k] of o) g.set(`${k}`, 1);\",\n \" return l.filter((x) => !g.has(`${x[0]}`));\",\n \"}\",\n ].join(\"\\n\"),\n FLC: \"function FLC(l) { const o = []; for (const [, v] of l) for (const x of v) o.push(x); return o; }\",\n IXC: [\n \"function IXC(l, x) {\",\n ' if (typeof x !== \"number\" && typeof x !== \"string\" && typeof x !== \"boolean\") F();',\n \" for (let i = 0; i < l.length; i++) if (l[i][1] === x) return i;\",\n \" return F();\",\n \"}\",\n ].join(\"\\n\"),\n NTC: \"function NTC(l, i) { return Number.isSafeInteger(i) && i >= 0 && i < l.length ? l[i][1] : F(); }\",\n SNC: [\n \"function SNC(l, i, v) {\",\n \" if (!(Number.isSafeInteger(i) && i >= 0 && i < l.length && v !== undefined)) F();\",\n \" const o = l.slice();\",\n \" o[i] = [l[i][0], v];\",\n \" return o;\",\n \"}\",\n ].join(\"\\n\"),\n FSC: \"function FSC(l) { return l.length === 0 ? F() : l[0][1]; }\",\n LOC: 'function LOC(l, h) { return { kind: \"vex.list\", items: l.map(([k, v]) => ({ key: `${k}`, result: { ok: true, value: h > 0 ? LOC(v, h - 1) : v } })) }; }',\n LSC: 'function LSC(l, h) { return Object.freeze({ kind: \"vex.list\", items: Object.freeze(l.map(([k, v]) => ({ key: `${k}`, result: { ok: true, value: h > 0 ? LSC(v, h - 1) : v } }))) }); }',\n LPC: \"function LPC(l, h) { return l.map(h > 0 ? (x) => LPC(x[1], h - 1) : (x) => x[1]); }\",\n // LV and LVC keep one object on the array. A clean list gives the same object from both.\n LVC: [\n \"function LVC(l, h) {\",\n \" let o = l.vl;\",\n \" if (o === undefined || o.items.length !== l.length) {\",\n ' o = Object.freeze({ kind: \"vex.list\", items: Object.freeze(l.map(([k, v]) => ({ key: `${k}`, result: { ok: true, value: h > 0 ? LVC(v, h - 1) : v } }))) });',\n \" l.vl = o;\",\n \" }\",\n \" return o;\",\n \"}\",\n ].join(\"\\n\"),\n // A column of lists (COMPILE.MODULE.SHEET.LIST): each cell with a list gives a `vex.list`. No two cells share it, so LC uses LO.\n LC: \"function LC(d, h) { for (let k = 0; k < d.length; k++) if (d[k] !== VEX_ERROR) d[k] = LO(d[k], h); return d; }\",\n // A plain column of lists (COMPILE.MODULE.LIST.PLAIN): each cell with a list gives an array.\n LCP: \"function LCP(d, h) { for (let k = 0; k < d.length; k++) if (d[k] !== VEX_ERROR) d[k] = LP(d[k], h); return d; }\",\n SH: [\n \"function SH(n, cols, own, budget) {\",\n \" const pg = (c, k) => {\",\n \" const o = own[c];\",\n \" const g = o === undefined ? undefined : o[k];\",\n \" return g === undefined ? cols[c] : g;\",\n \" };\",\n \" const D = [];\",\n \" for (let c = 0; c < cols.length; c++) {\",\n \" const d = new Array(n);\",\n \" for (let k = 0; k < n; k++) if (pg(c, k) === undefined) d[k] = E;\",\n \" D.push(d);\",\n \" }\",\n \" const seen = new Map(), stack = [], FILL = {};\",\n \" let top = FILL, missed = false, next = 0, used = 0;\",\n \" const start = (c, k) => {\",\n \" const i = next++;\",\n \" const v = { id: c * n + k, c, k, i, low: i, re: false, r: E, p: false, need: undefined };\",\n \" seen.set(v.id, v);\",\n \" stack.push(v);\",\n \" return v;\",\n \" };\",\n \" const ev = (v, g) => {\",\n \" const caller = top;\",\n \" v.p = false;\",\n \" v.need = undefined;\",\n \" top = v;\",\n \" used += g[1];\",\n \" const x = g[0](v.k);\",\n \" used -= g[1];\",\n \" top = caller;\",\n \" if (!v.p) v.r = x;\",\n \" };\",\n \" const end = (v, caller) => {\",\n \" if (v.low === v.i) {\",\n \" const ms = stack.splice(stack.lastIndexOf(v));\",\n \" const cycle = ms.length > 1 || v.re;\",\n \" for (const m of ms) {\",\n \" seen.delete(m.id);\",\n \" D[m.c][m.k] = cycle ? E : m.r;\",\n \" }\",\n \" } else if (caller !== undefined) caller.low = Math.min(caller.low, v.low);\",\n \" };\",\n \" const r = (c, k) => {\",\n \" const d = D[c][k];\",\n \" if (d !== undefined) return d;\",\n \" const caller = top;\",\n \" if (caller === FILL) {\",\n \" missed = true;\",\n \" return E;\",\n \" }\",\n \" if (caller.p) return E;\",\n \" const s = seen.get(c * n + k);\",\n \" if (s !== undefined) {\",\n \" caller.low = Math.min(caller.low, s.i);\",\n \" s.re = true;\",\n \" return E;\",\n \" }\",\n \" const g = pg(c, k);\",\n \" const v = start(c, k);\",\n \" if (used + g[1] > budget) {\",\n \" caller.p = true;\",\n \" caller.need = v;\",\n \" return E;\",\n \" }\",\n \" ev(v, g);\",\n \" if (v.p) {\",\n \" caller.p = true;\",\n \" caller.need = v;\",\n \" return E;\",\n \" }\",\n \" end(v, caller);\",\n \" const x = D[c][k];\",\n \" return x === undefined ? E : x;\",\n \" };\",\n \" const drive = (c, k) => {\",\n \" const work = [start(c, k)];\",\n \" for (let v = work[0]; v !== undefined; v = work[work.length - 1]) {\",\n \" ev(v, pg(v.c, v.k));\",\n \" if (v.p) {\",\n \" for (let q = v.need; q !== undefined; q = q.need) work.push(q);\",\n \" continue;\",\n \" }\",\n \" work.pop();\",\n \" end(v, work[work.length - 1]);\",\n \" }\",\n \" };\",\n \" const f = (c, k) => {\",\n \" if (D[c][k] !== undefined) return;\",\n \" missed = false;\",\n \" const x = pg(c, k)[0](k);\",\n \" if (missed) drive(c, k);\",\n \" else D[c][k] = x;\",\n \" };\",\n \" const o = (c) => {\",\n \" const d = D[c], out = new Array(n);\",\n \" for (let k = 0; k < n; k++) out[k] = d[k] === E ? VEX_ERROR : d[k];\",\n \" return out;\",\n \" };\",\n \" return { r, f, o };\",\n \"}\",\n ].join(\"\\n\"),\n // The keys of a tree in the order of a fill (SHEET.FILL): each parent before its children, or after them with `post`.\n // `back` reverses the order of the siblings.\n KO: [\n \"function KO(h, r, post, back) {\",\n \" const o = [], st = [];\",\n \" const push = (x) => {\",\n \" if (back) for (let q = 0; q < x.length; q++) st.push(x[q]);\",\n \" else for (let q = x.length - 1; q >= 0; q--) st.push(x[q]);\",\n \" };\",\n \" push(r);\",\n \" while (st.length > 0) {\",\n \" const k = st.pop();\",\n \" o.push(k);\",\n \" push(h[k]);\",\n \" }\",\n \" return post ? o.reverse() : o;\",\n \"}\",\n ].join(\"\\n\"),\n // The memo of a function of one key, and of more keys. -0 has its own entry, because an op can tell it from 0.\n M1: [\n \"function M1(f) {\",\n \" const m = new Map();\",\n \" return (k) => {\",\n \" const s = Object.is(k, -0) ? Z : k;\",\n \" let r = m.get(s);\",\n \" if (r === undefined) {\",\n \" try { r = f(k); } catch { r = E; }\",\n \" m.set(s, r);\",\n \" }\",\n \" return G(r);\",\n \" };\",\n \"}\",\n ].join(\"\\n\"),\n M: [\n \"function M(f) {\",\n \" const root = new Map();\",\n \" return (...k) => {\",\n \" let m = root;\",\n \" for (const x of k.slice(0, -1)) {\",\n \" const s = Object.is(x, -0) ? Z : x;\",\n \" let c = m.get(s);\",\n \" if (c === undefined) m.set(s, (c = new Map()));\",\n \" m = c;\",\n \" }\",\n \" const last = k.at(-1);\",\n \" const s = Object.is(last, -0) ? Z : last;\",\n \" let r = m.get(s);\",\n \" if (r === undefined) {\",\n \" try { r = f(...k); } catch { r = E; }\",\n \" m.set(s, r);\",\n \" }\",\n \" return G(r);\",\n \" };\",\n \"}\",\n ].join(\"\\n\"),\n};\n\n/**\n * This list has the globals of JavaScript that the code of a module reads. This code is the helpers, the run and the\n * copies of the ops of the test domains. A test reads the text of the modules of the golden files and checks this list (V-060).\n */\nexport const MODULE_GLOBALS: ReadonlySet<string> = new Set(\"Array Error Int32Array Map Math Number Object Uint8Array undefined\".split(\" \"));\n\n/** A part of the helper S that only some nodes need (helperS). */\ntype Feature = \"group\" | \"prefix\" | \"strict\" | \"ok\" | \"pre\";\n\n/**\n * This function gives the code of the helper S, a node of the memo that keeps its items (Printer.#cached). The helper\n * has only the parts that the nodes of the module need:\n *\n * - `group`: the groups of the values of the key (mode 1).\n * - `prefix`: the prefixes of the items (mode 2).\n * - `strict`: the option strict of a list op.\n * - `ok`: the check of the kind of a value.\n * - `pre`: the tests before the test of the key.\n *\n * The node gives `key` for the value of each item, and `val` for the value of an item from its index. It gives `test`\n * for the test of the key.\n */\nconst helperS = (has: ReadonlySet<Feature>): string => {\n const on = (f: Feature, ...lines: readonly string[]): readonly string[] => (has.has(f) ? lines : []);\n const strict = has.has(\"strict\");\n const ok = has.has(\"ok\");\n // The items that end the lookup with an error, and the items that the lookup skips.\n const fails = [...(strict ? [\"x === E\"] : []), ...(ok ? [\"x === W\"] : [])].join(\" || \");\n const skips = strict ? \"x === N || (x === E && !strict)\" : \"x === N || x === E\";\n return [\n \"function S(n, mode, strict, a0, step, result, key, val, test, pre, ok) {\",\n \" let ts, js, xs, bad, reach, gs, mono, pa, pc, pe;\",\n \" const value = (i) => {\",\n \" let x = xs[i];\",\n \" if (x === undefined) {\",\n \" x = val(js[i]);\",\n ...on(\"ok\", \" if (ok && x !== E && x !== N && !ok(x)) x = W;\"),\n \" xs[i] = x;\",\n \" }\",\n \" return x;\",\n \" };\",\n \" return M1((q) => {\",\n \" if (ts === undefined) {\",\n \" ts = [];\",\n \" js = [];\",\n \" xs = [];\",\n ...on(\"strict\", \" bad = false;\", \" reach = 0;\"),\n \" for (let j = 0; j < n; j++) {\",\n \" try {\",\n ...on(\"pre\", \" if (pre && !pre(j)) continue;\"),\n ...on(\"strict\", \" reach++;\"),\n \" const t = key(j);\",\n // NaN satisfies no test of a group or of a prefix, so its item is in none.\n \" if (mode && t !== t) continue;\",\n \" ts.push(t);\",\n \" js.push(j);\",\n \" } catch {\",\n ...on(\"strict\", \" bad = true;\"),\n \" }\",\n \" }\",\n ...on(\"group\", \" if (mode === 1) {\", \" gs = new Map();\", \" for (let i = 0; i < ts.length; i++) {\", \" let g = gs.get(ts[i]);\", \" if (g === undefined) gs.set(ts[i], (g = []));\", \" g.push(i);\", \" }\", \" }\"),\n ...on(\"prefix\", \" if (mode === 2) {\", \" mono = true;\", \" for (let i = 1; i < ts.length; i++) if (!(ts[i - 1] <= ts[i])) mono = false;\", \" pa = [a0];\", \" pc = [0];\", \" pe = [false];\", \" }\"),\n \" }\",\n // A key with an error makes an error item of each item that reaches the test of the key.\n strict ? \" if (q === E) return strict && (bad || reach > 0) ? F() : result(a0, 0);\" : \" if (q === E) return result(a0, 0);\",\n ...on(\"strict\", \" if (strict && bad) F();\"),\n \" let a = a0, c = 0;\",\n \" const add = (i) => {\",\n \" const x = value(i);\",\n ` if (${skips}) return;`,\n ...(fails === \"\" ? [] : [` if (${fails}) F();`]),\n \" a = step(a, c, x);\",\n \" c++;\",\n \" };\",\n ...on(\"group\", \" if (mode === 1) {\", \" const g = gs.get(q);\", \" if (g !== undefined) for (const i of g) add(i);\", \" return result(a, c);\", \" }\"),\n // The values t do not decrease, so the items whose test is true are a prefix. Each prefix keeps its running value.\n ...on(\n \"prefix\",\n \" if (mode === 2 && mono) {\",\n \" let lo = 0, hi = ts.length;\",\n \" while (lo < hi) {\",\n \" const h = (lo + hi) >> 1;\",\n \" if (test(ts[h], q)) lo = h + 1;\",\n \" else hi = h;\",\n \" }\",\n \" for (let i = pa.length - 1; i < lo; i++) {\",\n \" let x = value(i), b = pa[i], d = pc[i], err = pe[i];\",\n ...(fails === \"\" ? [\" if (x !== N && x !== E) {\"] : [` if (${fails.replace(\"x === E\", \"(x === E && strict)\")}) err = true;`, \" else if (x !== N && x !== E) {\"]),\n \" b = step(b, d, x);\",\n \" d++;\",\n \" }\",\n \" pa.push(b);\",\n \" pc.push(d);\",\n \" pe.push(err);\",\n \" }\",\n \" if (pe[lo]) F();\",\n \" return result(pa[lo], pc[lo]);\",\n \" }\",\n ),\n \" for (let i = 0; i < ts.length; i++) if (test(ts[i], q)) add(i);\",\n \" return result(a, c);\",\n \" });\",\n \"}\",\n ].join(\"\\n\");\n};\n\n/** The step of the running value of first and of count: the name of its function in a module, and its code. */\nconst FIRST_STEP: readonly [string, string] = [\"s_first\", \"(a, c, x) => (c === 0 ? x : a)\"];\n\n/** The step of the running value of each list op: the name of its function in a module, and its code. */\nconst STEPS: Readonly<Record<string, readonly [string, string]>> = {\n count: FIRST_STEP,\n first: FIRST_STEP,\n sum: [\"s_add\", \"(a, c, x) => a + x\"],\n mean: [\"s_add\", \"(a, c, x) => a + x\"],\n min: [\"s_min\", \"(a, c, x) => (c === 0 ? x : Math.min(a, x))\"],\n max: [\"s_max\", \"(a, c, x) => (c === 0 ? x : Math.max(a, x))\"],\n any: [\"s_or\", \"(a, c, x) => a || x\"],\n none: [\"s_or\", \"(a, c, x) => a || x\"],\n all: [\"s_and\", \"(a, c, x) => a && x\"],\n};\n\n/** The helpers that each helper uses. */\nconst NEEDS: Readonly<Record<Helper, readonly Helper[]>> = {\n F: [], C: [], T: [], L: [], Q: [], G: [\"F\"], PF: [\"F\"], B: [\"F\"], U: [\"F\"], X: [\"F\"], I: [\"F\"], K: [\"F\"], M: [\"G\"], M1: [\"G\"], S: [\"M1\", \"F\"],\n // Only the helpers of the list ops use V, and each of them needs F too, so the need of V only completes the list.\n // Stryker disable next-line ArrayDeclaration: see the comment above\n V: [\"F\"],\n SB: [\"V\", \"F\"], SK: [\"V\", \"F\"], TK: [\"V\", \"F\"], VW: [], NT: [\"VW\", \"F\"], CT: [\"VW\", \"F\"], FS: [\"VW\", \"F\"], FI: [\"F\"], FN: [\"F\"], TN: [\"F\"], LI: [], LA: [], LP: [],\n DR: [\"V\", \"F\"], AP: [\"V\"], AO: [\"AP\", \"V\"], WO: [\"V\"], FL: [\"V\"], GT: [\"F\"], IX: [\"V\", \"F\"], SN: [\"V\", \"F\"],\n // Each module has C, and each move uses F (#move), so these needs only complete the list.\n // Stryker disable next-line ArrayDeclaration: see the comment above\n PT: [\"C\"], GR: [\"C\"], UP: [\"F\"], SO: [\"F\"],\n CH: [], SG: [], PR: [], AN: [], BF: [],\n GI: [], RB: [],\n KC: [\"C\"], KP: [\"F\"], SH: [], KO: [], DO: [], LO: [], LS: [], LC: [\"LO\"], LV: [], LCP: [\"LP\"],\n SBC: [\"F\"], SKC: [\"F\"], TKC: [\"F\"], DRC: [\"F\"], AOC: [], WOC: [], FLC: [], IXC: [\"F\"], NTC: [\"F\"], SNC: [\"F\"], FSC: [\"F\"], LOC: [], LSC: [], LVC: [], LPC: [],\n SBI: [\"F\"], SKI: [\"F\"], QA: [], AW: [\"V\"], AI: [\"AW\"], AWC: [], AIC: [], KS: [],\n};\n\n/**\n * The forms of the helpers of the list fields, for a module where each list field has the depth 0. The test of the\n * value takes the place of the recursion, and the helper has no argument `h` (COMPILE.MODULE.SIZE.FLAT).\n */\nconst FLAT_LIST_HELPERS: Readonly<Record<\"LI\" | \"LA\", string>> = {\n LI: HELPERS.LI.replace(\"LI(x, h, t)\", \"LI(x, t)\").replace(\"h > 0 ? LI(r.value, h - 1, t) : \", \"\"),\n LA: HELPERS.LA.replace(\"LA(x, h, t)\", \"LA(x, t)\").replace(\"h > 0 ? LA(y, h - 1, t) : \", \"\"),\n};\n\n/** The clean form of each helper that gives a list of the code to the outside (COMPILE.MODULE.FUSE.CLEAN). */\nconst CLEAN_FORMS = { LO: \"LOC\", LS: \"LSC\", LV: \"LVC\", LP: \"LPC\" } as const;\n\n/** The parts of a tree that a run computes before the loop over its keys, if the program needs them. */\ntype TreePart = \"children\" | \"siblings\" | \"order\";\n\n/** The statement of each part of a tree in a run, with the helper that computes it. */\nconst TREE_PARTS: Readonly<Record<TreePart, readonly [TreeHelper, string]>> = {\n children: [\"CH\", \"const [H, RT] = CH(P, n);\"],\n siblings: [\"SG\", \"const [GP, SI] = SG(P, H, RT, n);\"],\n order: [\"PR\", \"const [PO, PI, SZ] = PR(P, n);\"],\n};\n\n/** An axis whose targets in a tree space are a range of an array of positions: an axis of a tree, or a window. */\ntype TreeAxis = Extract<Axis, { readonly t: \"children\" | \"ancestors\" | \"descendants\" | \"siblings\" | \"successors\" | \"predecessors\" | \"reachable\" | \"window\" }>;\n\n/** The axes of a tree space in a module, and the axes that a module of an array space does not have. */\nconst TREE_AXES: ReadonlySet<string> = new Set([\"children\", \"ancestors\", \"descendants\", \"siblings\", \"successors\", \"predecessors\", \"reachable\"]);\n\n/** This function tells if an axis has its targets in a range of an array of positions in a tree space. */\nconst isTreeAxis = (a: Axis): a is TreeAxis => a.t === \"window\" || TREE_AXES.has(a.t);\n\n/** The axes of a graph space in a module (COMPILE.MODULE.GRAPH), other than the axes of each space. */\nconst GRAPH_AXES: ReadonlySet<string> = new Set([\"successors\", \"predecessors\", \"reachable\"]);\n\n/**\n * The targets of an axis of a tree space: the statements before the loop, and the positions `a[q]` for `q` from `lo` up\n * to `hi`. The loop skips the key `skip`.\n */\ninterface TreeRange {\n readonly s: readonly string[];\n readonly a: string;\n readonly lo: string;\n readonly hi: string;\n readonly skip: string | undefined;\n}\n\n/** The list ops of a standalone module. */\nconst LIST_OPS: ReadonlySet<string> = new Set([\"count\", \"sum\", \"mean\", \"min\", \"max\", \"any\", \"all\", \"none\", \"first\"]);\n/** The list ops with a running value in a module: the list ops above, and `reduce` with the op of a domain (COMPILE.MODULE.REDUCE). */\nconst FOLD_OPS: ReadonlySet<string> = new Set([...LIST_OPS, \"reduce\"]);\nconst NUMBER_LIST_OPS: ReadonlySet<string> = new Set([\"count\", \"sum\", \"mean\", \"min\", \"max\"]);\nconst BOOLEAN_LIST_OPS: ReadonlySet<string> = new Set([\"any\", \"all\", \"none\"]);\n/** The list ops over lists of `#build`: append, without and flat (LIST.BUILD), get (LIST.GET) and indexOf (LIST.INDEXOF). */\nconst BUILD_OPS: ReadonlySet<string> = new Set([\"append\", \"without\", \"flat\", \"get\", \"indexOf\"]);\n\n/** The helper of each op of `#build`. */\nconst BUILD_HELPERS: Readonly<Record<string, BuildHelper>> = { append: \"AP\", without: \"WO\", flat: \"FL\", get: \"GT\", indexOf: \"IX\" };\n\n/**\n * The ops whose value is a list: the list ops of LIST.SORT, LIST.TAKE and LIST.BUILD, and `fill` (LIST.FILL). A domain\n * can have the op `fill`. Then the op of the domain gives no list, and the place of a list gives a reason.\n */\nconst LIST_RESULTS: ReadonlySet<string> = new Set([\"sortBy\", \"take\", \"setNth\", \"drop\", \"append\", \"without\", \"flat\", \"fill\"]);\n\n/** The list ops that give the value of an item (LIST.NTH, LIST.GET) and `first`. An item of a list of lists is a list. */\nconst ITEM_OPS: ReadonlySet<string> = new Set([\"nth\", \"first\", \"get\"]);\n\n/**\n * The scope of `listy`. `key` gives the name of a key of a node of the memo. `name`, `cell` and `field` tell if a name, a\n * cell or a field gives a list with `levels` levels (COMPILE.MODULE.LIST.INPUT). `op` tells if a domain declares a list as\n * the result of an op (COMPILE.MODULE.LIST.OP). `fn` gives the bound function of a name.\n */\ninterface ListScope {\n readonly key: (e: Expr) => Name | undefined;\n readonly op: (name: string) => boolean;\n readonly name: (name: string, levels: number) => boolean;\n readonly fn: (name: string) => ListFn | undefined;\n readonly cell: (e: ExprOf<\"ext\">, levels: number) => boolean;\n readonly field: (e: ExprOf<\"ref\">, levels: number) => boolean;\n}\n\n/** A bound function for `listy`: its node, and the scope of its binding (FN.BIND). */\ninterface ListFn {\n readonly fn: ExprOf<\"fn\">;\n readonly scope: ListScope;\n}\n\n/** This function tells if a list has `levels` levels of lists: 1 for each list, and 2 for a list of lists. */\nfunction hasLevels(l: ListInfo | undefined, levels: number): boolean {\n return l !== undefined && (levels === 1 || hasLevels(l.inner, levels - 1));\n}\n\n/**\n * This function tells if an expression gives a list with `levels` levels of lists (COMPILE.MODULE.LIST.NESTED). An each,\n * a list literal and a list op of `LIST_RESULTS` give a list. A name of a list, and a let or a loop whose result is a\n * list, give a list too. A call gives a list when the body of its function gives one (COMPILE.MODULE.LIST.CALL). An op of\n * `ITEM_OPS` gives one level less than its list. The scope tells the names and the functions outside the expression.\n */\nfunction listy(e: Expr, scope: ListScope, levels = 1): boolean {\n const key = scope.key(e);\n if (key !== undefined) return hasLevels(key.list, levels);\n switch (e.tag) {\n case \"each\":\n return levels === 1 || listy(e.body, itemsIn(e, scope), levels - 1);\n case \"lit\":\n // A module has no list literal with lists as items, so a literal has one level.\n return levels === 1 && isVexList(e.value);\n case \"app\":\n return listyApp(e, scope, levels);\n case \"var\":\n return scope.name(e.name, levels);\n case \"let\":\n return listy(e.body, scopeIn(e.bind, scope), levels);\n case \"fold\":\n case \"iterate\":\n return listy(e.result, scopeIn(e.init, scope), levels);\n // A column gives a boolean or a number (FIX.KIND).\n case \"fix\":\n case \"last\":\n return false;\n case \"ext\":\n return scope.cell(e, levels);\n case \"ref\":\n return scope.field(e, levels);\n case \"call\": {\n // A call of no function gives a reason in the printer. A value or a parameter with the name of a function makes\n // the printer give that reason too, so the scope does not hide the function.\n const f = scope.fn(e.fn);\n return f !== undefined && listy(f.fn.body, paramsIn(f, e.args, scope), levels);\n }\n case \"fn\":\n case \"rec\":\n return false;\n }\n}\n\n/** This function tells if an op gives a list with `levels` levels of lists (`listy`). */\nfunction listyApp(e: ExprOf<\"app\">, scope: ListScope, levels: number): boolean {\n const { op, args } = e;\n const argument = (i: number, change: number): boolean => args.slice(i, i + 1).some((x) => listy(x, scope, levels + change));\n // A branch of if and ifError can be a list (COMPILE.MODULE.LIST.RESULT).\n if (op === \"if\" || op === \"ifError\") return args.slice(op === \"if\" ? 1 : 0).some((x) => listy(x, scope, levels));\n // An op of a domain gives a list of values (COMPILE.MODULE.LIST.OP).\n if (levels === 1 && scope.op(op)) return true;\n if (ITEM_OPS.has(op)) return argument(0, 1);\n if (!LIST_RESULTS.has(op)) return false;\n if (levels === 1) return true;\n if (op === \"fill\") return argument(1, -1);\n if (op === \"flat\") return argument(0, 1);\n // An empty list literal takes the levels of the other list of append.\n return argument(0, 0) || (op === \"append\" && argument(1, 0));\n}\n\n/**\n * This function gives the scope of the body of an each. The first name `as` holds an item of the list of the axis, so it\n * has one level less than the list. The second name holds a position (COMPILE.MODULE.LIST.ITEM).\n */\nfunction itemsIn(e: ExprOf<\"each\">, scope: ListScope): ListScope {\n if (e.as === undefined) return scope;\n const [item, index] = e.as;\n // The kernel refuses names `as` over an axis without a list.\n const list = listOf(e.axis) as Expr;\n return { ...scope, name: (name, levels) => (name === item ? listy(list, scope, levels + 1) : name !== index && scope.name(name, levels)) };\n}\n\n/**\n * This function gives the scope of some bindings. A value hides a name outside, and a function is not a list. A\n * function sees the scope outside the bindings, so it cannot call itself.\n */\nfunction scopeIn(bind: Readonly<Record<string, Expr>>, scope: ListScope): ListScope {\n const fns = new Map<string, ListFn>();\n for (const [name, x] of Object.entries(bind)) if (x.tag === \"fn\") fns.set(name, { fn: x, scope });\n return { ...scope, name: (name, levels) => (Object.hasOwn(bind, name) ? listy(bind[name] as Expr, scope, levels) : scope.name(name, levels)), fn: (name) => fns.get(name) ?? scope.fn(name) };\n}\n\n/**\n * This function gives the scope of the body of a function at a call. The body sees the scope of the binding of the\n * function, and each parameter has the levels of its argument.\n */\nfunction paramsIn(f: ListFn, args: readonly Expr[], scope: ListScope): ListScope {\n const lists = new Map(args.map((x, i) => [f.fn.params[i], x]));\n return {\n ...f.scope,\n name: (name, levels) => {\n const arg = lists.get(name);\n return arg === undefined ? f.scope.name(name, levels) : listy(arg, scope, levels);\n },\n };\n}\n\n/**\n * This function tells if an expression has a list literal with an item (LIST.LITERAL), `fill` (LIST.FILL) or an op for\n * which `gives` is true (COMPILE.MODULE.LIST.OP). Then a key of a list of the expression can be a key that is not the\n * position of a record.\n */\nfunction hasTextKeys(e: Expr, gives: (name: string) => boolean): boolean {\n return (e.tag === \"lit\" && isVexList(e.value) && e.value.items.length > 0) || (e.tag === \"app\" && (e.op === \"fill\" || gives(e.op))) || children(e).some((x) => hasTextKeys(x, gives));\n}\n\n/**\n * This function gives the facts of the list of `append` from the facts of its two lists. It also gives the list of\n * `if` from its two branches. An empty list fits each list. The op `op` names the op in the reason.\n */\nfunction joinLists(a: ListInfo, b: ListInfo, op: string): ListInfo {\n // The value can be the array of the empty list, so it is fresh only when both lists are fresh.\n if (a.empty === true) return { ...b, clean: a.clean === true && b.clean === true, fresh: false };\n if (b.empty === true) return { ...a, clean: a.clean === true && b.clean === true, fresh: false };\n if ((a.inner === undefined) !== (b.inner === undefined)) throw new NotStandalone(`\"${op}\" of a list of lists and a list of values`);\n const texts = a.texts === true || b.texts === true;\n const inner = a.inner === undefined ? undefined : joinLists(a.inner, b.inner as ListInfo, op);\n return { item: join(a.item, b.item), inner, texts, clean: a.clean === true && b.clean === true, fresh: a.fresh === true && b.fresh === true };\n}\n\n/** This function gives the facts of the list of `if` or `ifError` from its two branches. Two values that are not lists give undefined. */\nfunction branchLists(op: string, a: ListInfo | undefined, b: ListInfo | undefined): ListInfo | undefined {\n if (a === undefined && b === undefined) return undefined;\n if (a === undefined || b === undefined) throw new NotStandalone(`\"${op}\" of a list and a value that is not a list`);\n return joinLists(a, b, op);\n}\n\n/**\n * This function tells if a list of a step fits the list of a name of a loop (LOOP.LIST). The items of the step have the\n * kind of the items of the name, if the name has one. The name also has the text keys and the lists of lists of the step.\n */\nfunction fits(name: ListInfo, step: ListInfo): boolean {\n if (step.empty === true) return true;\n if (name.item !== undefined && step.item !== name.item) return false;\n if (step.texts === true && name.texts !== true) return false;\n return name.inner === undefined ? step.inner === undefined : step.inner !== undefined && fits(name.inner, step.inner);\n}\n\n/**\n * This function gives the names of a loop with a clean list (COMPILE.MODULE.FUSE.FACTS). A name is clean when its first\n * list is clean and each step gives a clean list. The function first assumes the fact for each name with a clean first\n * list. Then it removes each name whose step does not prove the fact, until no name changes. A name of an item in\n * `items` hides each other name. `outer` gives the fact of a name outside the loop.\n */\nfunction cleanNames(firsts: ReadonlyMap<string, boolean>, step: Names, items: readonly string[], outer: (name: string) => boolean): ReadonlySet<string> {\n const clean = new Set([...firsts].flatMap(([name, c]) => (c ? [name] : [])));\n const fact = (name: string): boolean => !items.includes(name) && (firsts.has(name) ? clean.has(name) : outer(name));\n for (let changed = true; changed; ) {\n changed = false;\n for (const name of clean) {\n const x = step[name];\n if (x !== undefined && !cleanForm(x, fact)) {\n clean.delete(name);\n changed = true;\n }\n }\n }\n return clean;\n}\n\n/** The list ops whose value is clean, because `V` removes each error item or `FI` checks each value. */\nconst CLEAN_OPS: ReadonlySet<string> = new Set([\"append\", \"flat\", \"drop\", \"take\", \"setNth\", \"without\", \"sortBy\", \"fill\"]);\n\n/**\n * This function tells if the form of an expression proves that its list is clean, with the facts `fact` of the names.\n * It does not print the expression, so it knows only the clean ops, the literals, `if`, `ifError`, `let` and names.\n */\nfunction cleanForm(e: Expr, fact: (name: string) => boolean): boolean {\n switch (e.tag) {\n case \"app\":\n if (CLEAN_OPS.has(e.op)) return true;\n return (e.op === \"if\" || e.op === \"ifError\") && e.args.slice(e.op === \"if\" ? 1 : 0).every((x) => cleanForm(x, fact));\n case \"lit\":\n return isVexList(e.value) && e.value.items.every((it) => it.result.ok);\n case \"var\":\n return fact(e.name);\n case \"let\":\n // A binding sees the context of the let, so its form has the facts of the names outside.\n return cleanForm(e.body, (name) => (name in e.bind ? cleanForm(e.bind[name] as Expr, fact) : fact(name)));\n case \"fold\":\n case \"iterate\": {\n // The result of a loop sees the names of the loop, with the facts of their own fixpoint, and the names outside.\n const firsts = new Map(Object.entries(e.init).map(([name, x]): [string, boolean] => [name, cleanForm(x, fact)]));\n const clean = cleanNames(firsts, e.step, e.tag === \"fold\" ? (e.as ?? []) : [], fact);\n return cleanForm(e.result, (name) => (name in e.init ? clean.has(name) : fact(name)));\n }\n // Stryker disable StringLiteral,ConditionalExpression: without its case, the switch gives undefined, and each caller reads undefined as false.\n case \"call\":\n case \"each\":\n case \"ext\":\n case \"fix\":\n case \"fn\":\n case \"last\":\n case \"rec\":\n case \"ref\":\n // Stryker restore StringLiteral,ConditionalExpression\n return false;\n }\n}\n\n/** This function gives the count of the reads of a part that a loop or a function can evaluate again. */\nconst again = (n: number): number => (n > 0 ? Infinity : 0);\n\n/** This function adds the counts of the reads of the parts `xs`. */\nconst refsIn = (xs: readonly Expr[], name: string): number => xs.reduce((n, x) => n + refsOf(x, name), 0);\n\n/**\n * This function counts the reads of the name `name` in an expression. A read in the body of an `each`, of a step of\n * a loop or of a function counts `Infinity`. Such a part can evaluate many times. A name of the expression\n * hides the name.\n */\nfunction refsOf(e: Expr, name: string): number {\n switch (e.tag) {\n case \"var\":\n return e.name === name ? 1 : 0;\n case \"let\":\n return refsIn(Object.values(e.bind), name) + (name in e.bind ? 0 : refsOf(e.body, name));\n case \"fn\":\n return e.params.includes(name) ? 0 : again(refsOf(e.body, name));\n // The first values and the step evaluate at each row (FIX.ROUNDS).\n case \"fix\":\n return again(refsOf(e.init, name) + refsOf(e.step, name));\n case \"last\":\n return 0;\n case \"each\": {\n // Only the body sees the names of the items (AXIS.LIST.SCOPE). The tests of the axis evaluate for each item.\n const list = listOf(e.axis);\n const tests = axisExprs(e.axis).filter((x) => x !== list);\n const own = list === undefined ? [] : [list];\n return refsIn([...own, ...addrExprs(e.at)], name) + again(refsIn(tests, name)) + (e.as?.includes(name) === true ? 0 : again(refsOf(e.body, name)));\n }\n case \"fold\":\n case \"iterate\": {\n // The steps and the result see the names of the loop. The tests of a fold or of a data limit read only the names outside the loop.\n const hidden = name in e.init;\n const steps = [...Object.values(e.step), ...(e.tag === \"iterate\" && e.until !== undefined ? [e.until] : [])];\n const axis = e.tag === \"fold\" ? e.axis : limitAxis(e);\n const list = axis === undefined ? undefined : listOf(axis);\n const once = [...(list === undefined ? [] : [list]), ...(e.tag === \"fold\" ? addrExprs(e.at) : [])];\n // Stryker disable next-line ArrayDeclaration: refsOf of a string gives NaN, and again(NaN) gives 0.\n const tests = axis === undefined ? [] : axisExprs(axis).filter((x) => x !== list);\n const item = e.tag === \"fold\" && e.as?.includes(name) === true;\n return refsIn([...Object.values(e.init), ...once], name) + again(refsIn(tests, name)) + (hidden || item ? 0 : again(refsIn(steps, name))) + (hidden ? 0 : refsOf(e.result, name));\n }\n case \"app\":\n case \"call\":\n case \"ext\":\n case \"lit\":\n case \"rec\":\n case \"ref\":\n return refsIn(children(e), name);\n }\n}\n\n/**\n * This function counts the reads of the value of each node of a program, from its form (COMPILE.MODULE.FUSE.FACTS).\n * The parent of a node reads its value once. A branch of `if` and of `ifError`, the body of a `let` and the result of\n * a loop give their value to their parent. Thus they get the count of the parent. A loop reads its first values and its\n * steps at each step, so they get `Infinity`. A binding gets the count of the reads of its name. An argument of a call\n * gets the count of the reads of its parameter. The printer adds the parts that the code reads again (`#shared`).\n */\nfunction readCounts(root: Expr): ReadonlyMap<Expr, number> {\n const out = new Map<Expr, number>();\n const visit = (e: Expr, reads: number, fns: ReadonlyMap<string, ExprOf<\"fn\">>): void => {\n // A node at two places of the program evaluates at each place, so each place reads its own value.\n out.set(e, Math.max(out.get(e) ?? 0, reads));\n const all = (xs: readonly Expr[], n: number): void => {\n for (const x of xs) visit(x, n, fns);\n };\n switch (e.tag) {\n case \"app\": {\n // The branches of if and of ifError give their value to the parent.\n const first = e.op === \"if\" ? 1 : e.op === \"ifError\" ? 0 : e.args.length;\n e.args.forEach((x, i) => visit(x, i < first ? 1 : reads, fns));\n return;\n }\n case \"let\": {\n // A binding sees the context of the let, so a function cannot call itself. A value hides a function of its name.\n const inner = new Map(fns);\n for (const [name, x] of Object.entries(e.bind)) {\n if (x.tag === \"fn\") inner.set(name, x);\n else inner.delete(name);\n visit(x, x.tag === \"fn\" ? 1 : refsOf(e.body, name), fns);\n }\n visit(e.body, reads, inner);\n return;\n }\n case \"call\": {\n const fn = fns.get(e.fn);\n e.args.forEach((x, i) => {\n const param = fn?.params[i];\n visit(x, param === undefined ? Infinity : refsOf((fn as ExprOf<\"fn\">).body, param), fns);\n });\n return;\n }\n case \"fix\":\n all(children(e), Infinity);\n return;\n case \"fold\":\n case \"iterate\": {\n const names = new Set([...Object.values(e.init), ...Object.values(e.step)]);\n for (const x of children(e)) visit(x, x === e.result ? reads : names.has(x) ? Infinity : 1, fns);\n return;\n }\n case \"each\":\n // Stryker disable next-line StringLiteral: an extension has no children.\n case \"ext\":\n case \"last\":\n case \"fn\":\n // Stryker disable next-line StringLiteral: a literal has no children.\n case \"lit\":\n case \"rec\":\n case \"ref\":\n // Stryker disable next-line StringLiteral: a variable has no children.\n case \"var\":\n all(children(e), 1);\n }\n };\n visit(root, 1, new Map());\n return out;\n}\n\n/** This function tells if the step of a list op throws for a value of the kind `kind`, which is the wrong kind. */\nconst stepThrows = (op: string, kind: Kind | undefined): boolean => op === \"reduce\" || (NUMBER_STEPS.has(op) && kind !== \"number\") || (BOOLEAN_LIST_OPS.has(op) && kind !== \"boolean\");\n\n/** The list ops whose step takes a number. */\nconst NUMBER_STEPS: ReadonlySet<string> = new Set([\"sum\", \"mean\", \"min\", \"max\"]);\n\n/** This function gives the kind of the result of a list op: first gives the kind of its items. */\nconst listKind = (op: string, item: Kind | undefined): Kind | undefined => (NUMBER_LIST_OPS.has(op) ? \"number\" : BOOLEAN_LIST_OPS.has(op) ? \"boolean\" : item);\n\nconst LOOPS = new WeakMap<Expr, boolean>();\n\n/**\n * This function tells if the step of the name `name` of a loop appends to the list of the name (COMPILE.MODULE.APPEND.OWN).\n * It puts the append nodes of the form into `out`. The form is a read of the name,\n * `append(form, X)`, `if(c, form, form)` or a let with the form as its body. No other part of the form reads the name:\n * not `X`, not `c` and not a binding of a let.\n *\n * A let can also bind a form to a new name (COMPILE.MODULE.APPEND.LET). Then no other binding reads the name, and the\n * body does not read the old list. The body can read the new name in each way. Such a let goes into `lets`, because the\n * value of the step can then be another list.\n *\n * With `wide`, one branch of an `if` can be another list (COMPILE.MODULE.APPEND.OTHER). The body of such a let can\n * then be a form of the new name.\n */\nfunction ownForm(e: Expr, name: string, out: Expr[], lets: Expr[], wide = false): boolean {\n const free = (x: Expr): boolean => !namesOf(x).has(name);\n if (e.tag === \"var\") return e.name === name;\n if (e.tag === \"let\") {\n const held = Object.entries(e.bind).filter(([, x]) => !free(x));\n if (held.length === 0) return ownForm(e.body, name, out, lets, wide);\n const [bind, x] = held[0] as [string, Expr];\n // A binding of the name itself hides the old list in the body, so the body can read the name.\n if (held.length > 1 || (bind !== name && !free(e.body)) || !ownForm(x, name, out, lets, wide)) return false;\n lets.push(e);\n // The body can append to the new name (COMPILE.MODULE.APPEND.OTHER). Then these appends push into the array too.\n if (wide && bind !== name) {\n const relay: Expr[] = [];\n if (ownForm(e.body, bind, relay, lets, wide)) out.push(...relay);\n }\n return true;\n }\n if (e.tag !== \"app\" || e.args.length === 0) return false;\n const [head, ...rest] = e.args as [Expr, ...Expr[]];\n // An if without three arguments gives a reason (#if), so the form does not check the count.\n if (e.op === \"if\") {\n if (!free(head)) return false;\n const forms = rest.map((x) => ownForm(x, name, out, lets, wide));\n // One branch must be a form, so the step reads the name. The other branch can be another list.\n return forms.every(Boolean) || (forms.some(Boolean) && otherList(e, lets, wide));\n }\n if (e.op !== \"append\" || !rest.every(free) || !ownForm(head, name, out, lets, wide)) return false;\n out.push(e);\n return true;\n}\n\n/**\n * This function tells if the branch `x` of the `if` node `e` of a form is another list (COMPILE.MODULE.APPEND.OTHER).\n * Such a branch evaluates before each push of the step, so it can read the name in each way. Its value can be another\n * list, so the `if` goes into `lets`. The printer gives each place of the program an object of its own (`unsharedAll`).\n * Thus an append of the form is not also an append in such a branch.\n */\nfunction otherList(e: Expr, lets: Expr[], wide: boolean): boolean {\n if (wide) lets.push(e);\n return wide;\n}\n\n/**\n * This function gives the filters of the list of the name `name` in the branches of the `if` nodes in `lets`\n * (COMPILE.MODULE.APPEND.KEEP). These nodes are the branches of other lists of COMPILE.MODULE.APPEND.OTHER. A filter is\n * `flat` over an each over the axis `list` of the name. The body of the each does not read the name, so it does\n * not see the array while the filter changes it. The other nodes in `lets` are `let` nodes, and the test of an `if`\n * does not read the name.\n */\nfunction keepsOf(lets: readonly Expr[], name: string): readonly Expr[] {\n const keeps = (e: Expr): boolean => {\n const [each] = e.tag === \"app\" && e.op === \"flat\" ? e.args : [];\n return each?.tag === \"each\" && each.axis.t === \"list\" && each.axis.list.tag === \"var\" && each.axis.list.name === name && !namesOf(each.body).has(name);\n };\n return lets.flatMap((e) => (e.tag === \"app\" ? e.args.filter(keeps) : []));\n}\n\n/**\n * This function tells if each value of the list `e` has at most one item (COMPILE.MODULE.APPEND.KEEP). Such a list is\n * `fill(0, x)`, `fill(1, x)`, a literal of at most one item or an `if` of such lists. `fill` must be the op of the\n * language (`own`). A filter in place then puts at most one item for each item of its list, as the last statement of\n * the item. Thus a put does not come before the read of the item at its position.\n */\nfunction atMostOne(e: Expr, own: boolean): boolean {\n if (e.tag === \"lit\") return isVexList(e.value) && e.value.items.length <= 1;\n if (e.tag !== \"app\") return false;\n // An if without three arguments gives a reason (#if), so the function does not check the count.\n if (e.op === \"if\") return e.args.slice(1).every((x) => atMostOne(x, own));\n const [count] = e.args.map(literalOf);\n return own && e.op === \"fill\" && (count === 0 || count === 1);\n}\n\n/** The list ops whose value is a number or an item of the list, so the value cannot hold the array of the list. */\nconst READ_OPS: ReadonlySet<string> = new Set([\"count\", \"nth\", \"first\"]);\n\n/**\n * This function tells if each read of the name `name` in `e` only reads its list (COMPILE.MODULE.APPEND.READ). Such a\n * read is the list of `count`, `nth` or `first`, or the list of the axis `list` of a fold. These values are numbers,\n * items or the names of the fold, so they cannot hold the array of the list. A function that reads the name does not\n * read it.\n */\nfunction readsOnly(e: Expr, name: string): boolean {\n const reads = (x: Expr | undefined): boolean => x?.tag === \"var\" && x.name === name;\n if (reads(e) || (e.tag === \"fn\" && namesOf(e).has(name))) return false;\n if (e.tag === \"app\" && READ_OPS.has(e.op) && reads(e.args[0])) return e.args.slice(1).every((x) => readsOnly(x, name));\n const list = e.tag === \"fold\" && e.axis.t === \"list\" && reads(e.axis.list) ? e.axis.list : undefined;\n return children(e).every((x) => x === list || readsOnly(x, name));\n}\n\n/**\n * This function tells if the result of a loop appends to the list of the name `name` as its last reader\n * (COMPILE.MODULE.FUSE.ADOPT). It puts the append nodes of the form into `out`. The form is the form of `ownForm`. A\n * `let` can also bind the form to a new name. Then no other binding and not the body reads `name`, and the body is a\n * form of the new name. Such a let goes into `relays`. No other part of the form reads the name, so no part reads the\n * old list after an append.\n */\nfunction lastForm(e: Expr, name: string, out: Expr[], relays: Map<Expr, Relay>): boolean {\n const free = (x: Expr): boolean => !namesOf(x).has(name);\n if (e.tag === \"var\") return e.name === name;\n if (e.tag === \"let\") {\n const held = Object.entries(e.bind).filter(([, x]) => !free(x));\n // A binding of the name hides the name of the loop in the body.\n if (held.length === 0) return !Object.hasOwn(e.bind, name) && lastForm(e.body, name, out, relays);\n const [bind, x] = held[0] as [string, Expr];\n const nodes: Expr[] = [];\n if (held.length > 1 || (bind !== name && !free(e.body)) || !lastForm(x, name, out, relays) || !lastForm(e.body, bind, nodes, relays)) return false;\n relays.set(e, { bind, nodes });\n return true;\n }\n if (e.tag !== \"app\" || e.args.length === 0) return false;\n const [head, ...rest] = e.args as [Expr, ...Expr[]];\n if (e.op === \"if\") return free(head) && rest.every((x) => lastForm(x, name, out, relays));\n if (e.op !== \"append\" || !rest.every(free) || !lastForm(head, name, out, relays)) return false;\n out.push(e);\n return true;\n}\n\n/**\n * This function tells if a `let` of the form of `ownForm` binds the name `name` again. The appends under such a let\n * append to another list. Then the value of the step can be a list that is not the array of the name\n * (COMPILE.MODULE.FUSE.ADOPT).\n */\nfunction shadows(e: Expr, name: string): boolean {\n if (e.tag === \"let\") return Object.hasOwn(e.bind, name) || shadows(e.body, name);\n if (e.tag !== \"app\") return false;\n const [head, ...rest] = e.args as [Expr, ...Expr[]];\n return e.op === \"if\" ? rest.some((x) => shadows(x, name)) : shadows(head, name);\n}\n\n/**\n * This function tells if an append into the list of a name of a loop can take the first list as its own array\n * (COMPILE.MODULE.FUSE.ADOPT). No other part of the code holds a fresh array. AO does not scan the array that it\n * takes, so the list must also be clean.\n */\nfunction adoptable(l: ListInfo | undefined): boolean {\n if (l?.fresh !== true) return false;\n // Stryker disable next-line ConditionalExpression: each fresh list of the printer is clean, but the test keeps AO correct for a new fresh list\n return l.clean === true;\n}\n\n/** This function gives the names that an expression reads, also the names that it binds itself. */\nfunction namesOf(e: Expr, out = new Set<string>()): Set<string> {\n if (e.tag === \"var\") out.add(e.name);\n for (const x of children(e)) namesOf(x, out);\n return out;\n}\n\n/**\n * The smallest work of an expression in a column of the run. The work is the number of nodes. A node of the memo and a\n * constant of the run count as one node each. A part with less work costs less than the read of its column.\n */\nconst COLUMN_WORK = 10;\n\n/** The parts of the head of a loop over targets: the first value, the condition and the step. */\ninterface ForParts {\n readonly init: string;\n readonly cond: string;\n readonly next: string;\n}\n\n/** This function gives the parts of a loop over targets: from `lo` up to `hi`, or from `hi` down to `lo` in the reverse order. */\nconst forParts = (j: string, lo: string, hi: string, reverse: boolean): ForParts =>\n reverse ? { init: `${hi} - 1`, cond: `${j} >= ${lo}`, next: `${j}--` } : { init: lo, cond: `${j} < ${hi}`, next: `${j}++` };\n\n/** This function gives the head of a loop over targets from its parts. */\nconst forHead = (j: string, p: ForParts): string => `for (let ${j} = ${p.init}; ${p.cond}; ${p.next}) {`;\n\n/**\n * This function gives the value that stops the step `x` of the name `name` of a fold (COMPILE.MODULE.EXIT), or\n * undefined. The step `and(name, ...)` stops at false, and the step `or(name, ...)` stops at true. A name of `as` is\n * not a name of `init`, so the first argument reads the name of the fold.\n */\nconst stopOf = (x: Expr, name: string): boolean | undefined => {\n if (x.tag !== \"app\" || (x.op !== \"and\" && x.op !== \"or\")) return undefined;\n const [head] = x.args;\n return head?.tag === \"var\" && head.name === name ? x.op === \"or\" : undefined;\n};\n\n/** This function tells if an expression has a loop in a loop: an axis, a fold or an iteration in another one. */\nfunction nestsLoops(e: Expr, inLoop = false): boolean {\n const loop = e.tag === \"each\" || e.tag === \"fold\" || e.tag === \"iterate\";\n return (loop && inLoop) || children(e).some((x) => nestsLoops(x, inLoop || loop));\n}\n\n/** This function tells if an expression has a loop of names: a fold or an iteration. */\nfunction hasLoop(e: Expr): boolean {\n let found = LOOPS.get(e);\n if (found === undefined) {\n found = e.tag === \"fold\" || e.tag === \"iterate\" || e.tag === \"fix\" || children(e).some(hasLoop);\n LOOPS.set(e, found);\n }\n return found;\n}\n\n/**\n * This function tells if a node of the memo has a loop of its own. Such a loop is outside its keys and outside the nodes\n * of the memo in it. A node without one combines the values of other nodes, and a function of its own only costs time.\n */\nfunction ownLoop(e: Expr, root: Expr, memo: ReadonlyMap<Expr, readonly Expr[]>, keys: ReadonlySet<Expr>): boolean {\n if (e !== root && (memo.has(e) || keys.has(e))) return false;\n return e.tag === \"each\" || children(e).some((x) => ownLoop(x, root, memo, keys));\n}\n\n/** This function gives the nodes of the memo of an expression that have a loop of their own, with their keys. */\nfunction memoOf(expr: Expr): ReadonlyMap<Expr, readonly Expr[]> {\n const all = memoNodes(expr);\n return new Map([...all].filter(([e, keys]) => ownLoop(e, e, all, new Set(keys))));\n}\n\n/** This function tells if each level of `deps` is one of `levels`. */\nconst within = (deps: ReadonlySet<number>, levels: readonly number[]): boolean => [...deps].every((d) => levels.includes(d));\n\n/** This function tells if an expression contains the expression `x`, the same object. */\nfunction contains(e: Expr, x: Expr): boolean {\n return e === x || children(e).some((c) => contains(c, x));\n}\n\n/** This function gives the base of an axis and its tests in the order of evaluation. */\nfunction testsOf(axis: Axis): { readonly base: Axis; readonly tests: readonly Expr[] } {\n const tests: Expr[] = [];\n let base = axis;\n while (base.t === \"where\") {\n tests.unshift(base.test);\n base = base.axis;\n }\n return { base, tests };\n}\n\n/**\n * This function gives the parts of a test `and`, and of each part that is a test `and` too. `and` stops at the first\n * `false`, as a chain of tests does, and each part must be a boolean.\n */\nfunction partsOf(t: Expr): readonly Expr[] {\n return t.tag === \"app\" && t.op === \"and\" && t.args.length > 0 ? t.args.flatMap(partsOf) : [t];\n}\n\n/** This function gives the kind of two values in the branches of a form, if they have the same kind. */\nconst join = (a: Kind | undefined, b: Kind | undefined): Kind | undefined => (a === b ? a : undefined);\n\n/** This function gives a value that is a constant of the run, with plain code. */\nconst plainValue = (code: string, kind: Kind | undefined): Value => ({ code, kind, safe: true, deps: NO_DEPS, plain: true });\n\n/** This function gives the code of a value with no statements. */\nconst bare = (v: Value): Code => ({ s: [], v });\n\n/**\n * This function gives a domain in the form of a module (COMPILE.MODULE.FORM). Each part of the form replaces the part of\n * the domain, so the printer reads one domain of plain data. A domain without a form stays the same object.\n */\nfunction formOf(d: AnyDomain): AnyDomain {\n const form = d.moduleForm;\n if (form === undefined) return d;\n return { ...d, ...form, ops: Object.fromEntries(Object.entries(d.ops).map(([name, spec]) => [name, { ...spec, ...form.ops?.[name] }])) } as AnyDomain;\n}\n\n/** This function gives the code of a literal. A value that is not a finite number, a text, a boolean or null has no code. */\nfunction literal(value: unknown): Value {\n if (typeof value === \"number\") {\n if (!Number.isFinite(value)) throw new NotStandalone(\"a literal is a number that is not finite\");\n return plainValue(Object.is(value, -0) ? \"-0\" : String(value), \"number\");\n }\n if (typeof value === \"string\") return plainValue(JSON.stringify(value), \"string\");\n if (typeof value === \"boolean\") return plainValue(String(value), \"boolean\");\n if (value === null) return plainValue(\"null\", undefined);\n throw new NotStandalone(\"a literal is not a number, a text, a boolean or null\");\n}\n\n/** The values of each kind that `copied` gives to a function and to its copy. */\nconst SAMPLES: Readonly<Record<PrimitiveKind, readonly unknown[]>> = {\n number: [0, 1, -1, 2.5, -0, 1e300, -7],\n string: [\"\", \"a\", \"ab c\"],\n boolean: [true, false],\n};\n\n/** This function gives each list of arguments with one sample of each parameter, from the samples of each parameter. */\nfunction samples(each: readonly (readonly unknown[])[]): readonly (readonly unknown[])[] {\n return each.reduce<readonly (readonly unknown[])[]>((acc, values) => acc.flatMap((xs) => values.map((x) => [...xs, x])), [[]]);\n}\n\n/** This function tells if a value is an object. A function is not one here. */\nconst isObject = (x: unknown): x is object => typeof x === \"object\" && x !== null;\n\n/** This function gives the parts of a value of a class: the items of a `Map` or of a `Set`, or else the own fields. */\nconst partsOfInstance = (x: object): unknown => (x instanceof Map || x instanceof Set ? [...x] : { ...x });\n\n/**\n * This function is the rule of `same` for two objects. Two objects with different prototypes differ. Two values of a\n * class compare by their parts. The rules of `sameValue` compare each list and each plain record.\n */\nfunction sameObjects(a: unknown, b: unknown): boolean | undefined {\n if (!isObject(a) || !isObject(b)) return undefined;\n const proto: unknown = Object.getPrototypeOf(a);\n if (proto !== Object.getPrototypeOf(b)) return false;\n if (proto === null || proto === Object.prototype || Array.isArray(a)) return undefined;\n return sameValue(partsOfInstance(a), partsOfInstance(b), sameObjects);\n}\n\n/**\n * This function tells if two values are the same. The walk of `sameValue` sees each leaf with `Object.is`, so\n * `Infinity`, `NaN` and `undefined` differ from `null`, and `-0` differs from `0` (V-093). The JSON text sees the order of\n * the fields and the result of a `toJSON` function. A value that has no JSON text compares by the walk only.\n */\nfunction same(a: unknown, b: unknown): boolean {\n if (Object.is(a, b)) return true;\n if (!isObject(a) || !isObject(b)) return false;\n return call(() => JSON.stringify(a)).value === call(() => JSON.stringify(b)).value && sameValue(a, b, sameObjects);\n}\n\n/** This function gives the value of a call, or that it threw. */\nfunction call(f: () => unknown): { readonly threw: boolean; readonly value?: unknown } {\n try {\n return { threw: false, value: f() };\n } catch {\n return { threw: true };\n }\n}\n\n/** This function tells if two calls give the same: the same value, or an exception in both. */\nfunction sameCall(a: () => unknown, b: () => unknown): boolean {\n const x = call(a);\n const y = call(b);\n return x.threw === y.threw && same(x.value, y.value);\n}\n\n/**\n * This function gives the source of a function of a domain, for a copy in a module. The source must be an expression:\n * the source of a native function or of a method does not compile as one. A copy must give the values of the function:\n * a function that reads a name outside itself gives an exception in the copy. Thus the copy and the function must give\n * the same for the samples of their kinds.\n */\nfunction copied(f: (...a: never[]) => unknown, each: readonly (readonly unknown[])[], what: string): string {\n const src = functionText(f);\n let copy: (...a: unknown[]) => unknown;\n try {\n // oxlint-disable-next-line typescript/no-implied-eval -- the source is the source of a function of a domain.\n const make = new Function(`\"use strict\"; return (${src});`) as () => (...a: unknown[]) => unknown;\n copy = make();\n } catch {\n throw new NotStandalone(`${what} has no source that a module can copy`);\n }\n const fn = f as (...a: unknown[]) => unknown;\n if (!samples(each).every((xs) => sameCall(() => fn(...xs), () => copy(...xs)))) throw new NotStandalone(`${what} reads a name outside itself, so a module cannot copy it`);\n return src;\n}\n\n/** The functions that an inline form can use. They do not throw for numbers. */\nconst CALLS: ReadonlySet<string> = new Set([\n \"Math.abs\",\n \"Math.ceil\",\n \"Math.floor\",\n \"Math.round\",\n \"Math.trunc\",\n \"Math.sign\",\n \"Math.sqrt\",\n \"Math.cbrt\",\n \"Math.exp\",\n \"Math.log\",\n \"Math.log10\",\n \"Math.log2\",\n \"Math.min\",\n \"Math.max\",\n \"Math.pow\",\n \"Math.hypot\",\n \"Math.sin\",\n \"Math.cos\",\n \"Math.tan\",\n \"Math.atan2\",\n \"Number.isFinite\",\n]);\n\n/** The inline form of a function of an op: its parameters, and its body with a hole for each use of a parameter. */\ninterface InlineForm {\n readonly params: readonly string[];\n /** The parts of the body, and between two parts the index of a parameter. */\n readonly parts: readonly (string | number)[];\n /** The number of uses of each parameter. */\n readonly uses: readonly number[];\n}\n\n/**\n * The tokens of the text between the names of an inline form: digits, spaces, operators and parentheses. The tokenizer\n * takes the first token that matches at each position, as the tokenizer of JavaScript takes the longest operator. So\n * `<<=`, `>>=` and `>>>=` leave a lone `=`, and an assignment stops the inline form (V-058).\n */\nconst TOKEN = /\\d|\\.\\d|\\s|===?|!==?|<<|>>>?|<=|>=|[+\\-*/%<>!?:(),&|^~]/y;\n\n/**\n * This function tells if a text is a sequence of tokens. It takes one token at each step, so its time is linear in the\n * length of the text. A repeated group of the tokens can split `!==` in two ways, and its time is exponential (V-057).\n */\nfunction isTokens(t: string): boolean {\n TOKEN.lastIndex = 0;\n while (TOKEN.lastIndex < t.length) if (!TOKEN.test(t)) return false;\n return true;\n}\n\n/** The source of an arrow function with plain parameters: its parameters and its body. */\nconst ARROW = /^\\(?\\s*((?:[A-Za-z_$][\\w$]*\\s*,\\s*)*[A-Za-z_$][\\w$]*)\\s*\\)?\\s*=>\\s*([\\s\\S]*)/;\n\n/**\n * This function gives the inline form of the source of an arrow function. The body of the function must be an\n * expression of operators, numbers, its parameters and the functions of `CALLS`. Such a body cannot throw for primitive\n * values (§7.1). The inline form is the text of the function itself, so it has its bits.\n */\nfunction inlineForm(src: string): InlineForm | undefined {\n const m = ARROW.exec(src);\n if (m === null) return undefined;\n const params = (m[1] as string).split(\",\").map((x) => x.trim());\n const parts: (string | number)[] = [];\n const uses = params.map(() => 0);\n let text = \"\";\n // The even parts are the text between the names: numbers, operators and parentheses. An assignment, a call of a value\n // and another character, for example a quote, stop the inline form.\n const split = (m[2] as string).split(/([A-Za-z_$][\\w$]*(?:\\.[A-Za-z_$][\\w$]*)?)/);\n for (const [i, t] of split.entries()) {\n if (i % 2 === 0) {\n if (!isTokens(t) || /\\+\\+|--|\\)\\s*\\(/.test(t)) return undefined;\n text += t;\n } else if (CALLS.has(t)) text += t;\n else {\n const p = params.indexOf(t);\n if (p < 0 || /^\\s*\\(/.test(split[i + 1] as string)) return undefined;\n parts.push(text, p);\n text = \"\";\n uses[p] = (uses[p] as number) + 1;\n }\n }\n parts.push(text);\n return { params, parts, uses };\n}\n\n/** This function gives the text of an inline form without spaces, with `#i` for the parameter `at(i)`. */\nconst patternOf = (form: InlineForm, at: (p: number) => number): string => form.parts.map((p) => (typeof p === \"number\" ? `#${at(p)}` : p.replaceAll(/\\s/g, \"\"))).join(\"\");\n\n/** The results of an op that are not values (CALL.RESULT). */\nconst NOT_VALUES: readonly unknown[] = [undefined, null, Number.NaN, Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY];\n\n/** This function gives a text without the content of its parentheses, brackets and braces. */\nfunction outlineOf(t: string): string {\n let depth = 0;\n let out = \"\";\n for (const c of t) {\n if (\")]}\".includes(c)) depth--;\n if (depth === 0) out += c;\n if (\"([{\".includes(c)) depth++;\n }\n return out;\n}\n\n/** This function tells if each operator of a part of an expression is a comparison, so the part gives a boolean. */\nfunction isComparison(part: string): boolean {\n const operators = part.match(/>>>?=?|<<=?|[=!]==?|[<>]=?|[&|^?,=]+/g);\n return operators !== null && operators.every((x) => /^([=!]==?|[<>]=?)$/.test(x));\n}\n\n/** This function tells if an expression gives a boolean or an object. An object needs parentheses in an arrow body. */\nfunction isValueText(t: string, inParentheses: boolean): boolean {\n const outline = outlineOf(t);\n if (outline === \"{}\") return inParentheses;\n if (outline === \"()\") return isValueText(t.slice(1, -1).trim(), true);\n return outline.split(/&&|\\|\\|/).every((part) => isComparison(part) || /^\\s*!+[\\w$.()\\s]*$/.test(part));\n}\n\n/**\n * This function tells if the text of an op proves that its result is a value (COMPILE.MODULE.RESULT). The proofs are a\n * comparison, a negation, an `&&` or an `||` of these, and an object literal. A proof reads only the expression body of\n * an arrow function. A quote, a regular expression and a comment can hide a bracket, so they stop the proof.\n */\nfunction givesValue(src: string): boolean {\n const body = ARROW.exec(src)?.[2];\n return body !== undefined && !/[\"'`/]/.test(body) && isValueText(body.trim(), false);\n}\n\n/** This function tells if a check `valid` refuses a value: it gives false, or it throws. */\nfunction refuses(valid: (x: never) => boolean, value: unknown): boolean {\n try {\n return !valid(value as never);\n } catch {\n return true;\n }\n}\n\n/** The reserved words of the strict code of a module, and the two names that strict code does not bind. */\nconst RESERVED: ReadonlySet<string> = new Set(\n \"await break case catch class const continue debugger default delete do else enum export extends false finally for function if implements import in instanceof interface let new null package private protected public return static super switch this throw true try typeof var void while with yield arguments eval\".split(\" \"),\n);\n\n/** The names that each module exports. A run with such a name is a second export, and the module does not parse. */\nconst MODULE_EXPORTS: ReadonlySet<string> = new Set([\"VEX_ERROR\", \"VexContractError\"]);\n\n/** The comment of the class of a contract error in each module. */\nconst ERROR_NOTE = \"/** The error of a run whose input does not keep the schema of the program. */\";\n\n/** This function gives the reason that a name cannot be the name of the run, or `undefined` for a good name (V-060). */\nfunction nameReason(name: string): string | undefined {\n if (RESERVED.has(name)) return `the name \"${name}\" is a reserved word of JavaScript`;\n return MODULE_EXPORTS.has(name) ? `the name \"${name}\" is a name of the module` : undefined;\n}\n\n/**\n * This function gives the name of the function of the run (COMPILE.MODULE.NAME). A function with a name of the code hides\n * that name from the code. Thus the run of such a module has an internal name that the code does not have.\n */\nfunction innerName(name: string, code: ReadonlySet<string>): string {\n if (!code.has(name)) return name;\n let at = 0;\n while (code.has(`run$${String(at)}`)) at += 1;\n return `run$${String(at)}`;\n}\n\nclass Printer {\n readonly #facts: Facts;\n readonly #domains: readonly AnyDomain[];\n readonly #schema: Schema;\n readonly #memo: ReadonlyMap<Expr, readonly Expr[]>;\n readonly helpers = new Set<Helper>();\n /** The declarations at the top of the module: the functions of the domains and the checks of the results. */\n readonly top = new Map<string, string>();\n /** The names of `top` that hold a copy of a function of a domain (COMPILE.MODULE.FAULT). */\n readonly copies = new Set<string>();\n /** This value is true when the code reads the list of an op of a domain. That read gives the depth (COMPILE.MODULE.LIST.OP). */\n opList = false;\n /** The array of the lists of each field of the input that the program reads (COMPILE.MODULE.LIST.INPUT). */\n readonly inputs = new Map<string, string>();\n /** The statements at the start of a run: the constants of the run and the functions of the memo. */\n readonly run: string[] = [];\n /** The variables of the schema that the program reads. */\n readonly vars = new Map<string, string>();\n /** True when the module has a node of the memo, so it needs the key of -0. */\n memos = false;\n /** The parts of the helper S that the nodes of the memo that keep their items need (helperS). */\n readonly features = new Set<Feature>();\n /** True for a tree space, and the parts of the tree that the program reads (COMPILE.MODULE.TREE). */\n readonly #tree: boolean;\n readonly treeParts = new Set<TreePart>();\n /** True for a graph space, and true when the program reads the predecessors of a graph (COMPILE.MODULE.GRAPH). */\n readonly #graph: boolean;\n readonly #keys: KeyPrint;\n into = false;\n /** True when the code reads the keys of the run (COMPILE.MODULE.KEYS). */\n runKeys = false;\n /** The columns of a sheet, for a module of a sheet (COMPILE.MODULE.SHEET). */\n readonly #sheet: SheetInfo | undefined;\n readonly #starts: EmptyStarts;\n #names = 0;\n /** The number of the next bound function, and of the next printed function. */\n #fnIds = 0;\n #printed = 0;\n /** The level of the names of the next loop. It is far above the levels of the axes, so the two do not meet. */\n #loops = 1_000_000;\n /** The node of the memo whose function the printer prints, so it prints the node itself. */\n #inside: Expr | undefined;\n /** The owner of each append node of the step of a loop that the printer prints (COMPILE.MODULE.APPEND.OWN). */\n readonly #own = new Map<Expr, Owner>();\n /** The owner of each relay `let` of the result of a loop that the printer prints (COMPILE.MODULE.FUSE.ADOPT). */\n readonly #relays = new Map<Expr, Relay & { readonly owner: Owner }>();\n /**\n * The second lists of the appends of an owner that the printer prints (COMPILE.MODULE.FUSE.ADOPT). A list of\n * `fill(1, x)` gets the value of its print and the code of its one item. Such a print does not use `FI`, so a push of\n * the item needs no `FI`.\n */\n readonly #ones = new Map<Expr | undefined, { readonly v: Value; readonly item: string } | undefined>();\n /**\n * The owner of each filter of its list in a branch of another list (COMPILE.MODULE.APPEND.KEEP). The step of the owner\n * that the printer prints has these filters.\n */\n readonly #keeps = new Map<Expr, Owner>();\n /**\n * The outputs of the filters in place that the printer prints (COMPILE.MODULE.APPEND.KEEP). An item goes to the\n * position `n` of its output, and `n` then increases. `pair` is the pair of the item of the list, and `item` is the\n * code of its value. A pair with the key 0 is its own copy.\n */\n readonly #sinks = new Map<string, { readonly n: string; readonly pair: string; readonly item: string | undefined }>();\n readonly #structures = new Map<string, string>();\n readonly #kinds = new Map<string, Kind | undefined>();\n readonly #ops = new Map<string, number>();\n /** The inline form of each function of an op, or undefined for a function that the module calls. */\n readonly #forms = new Map<string, InlineForm | undefined>();\n /** The ops whose text does not prove that the result is a value, so their results get the check of a value. */\n readonly #unproved = new Set<string>();\n /** The functions of ops that the module calls, not in an inline form. */\n readonly #called = new Set<string>();\n /** The key of the expression of each code that is a constant of the run, and the read of each hoisted constant by key. */\n readonly #keyOf = new WeakMap<Code, string>();\n readonly #keyTable = new KeyTable();\n readonly #constants = new Map<string, Code>();\n /** The columns of the run, by the structure of their expression. */\n readonly #columns = new Map<string, string>();\n /** The expressions whose code is the read of a column of the run. */\n readonly #columned = new WeakSet<Expr>();\n /** The kind of each column at the start of a run that holds no list. A column of a call is not in this map. */\n readonly #runColumns = new Map<string, Kind | undefined>();\n /** The function and the kind of each column of a call that holds no list. Only a read in that function reads its pack. */\n readonly #callColumns = new Map<string, { readonly scope: CallScope; readonly kind: Kind | undefined; readonly deps: ReadonlySet<number> }>();\n /** The code of each printed function, by its name. A fast sum looks in it for the columns that a call reads. */\n readonly #specCode = new Map<string, string>();\n /** The module variable of the pack of each column of the run, by the name of the column. */\n readonly #packs = new Map<string, string>();\n /** The state of the second print of a fast sum, or undefined outside it. */\n #pack: Pack | undefined;\n /** The lazy constants of the run, and the printed functions that have a loop: code that reads one waits for its read. */\n readonly #deferred = new Set<string>();\n /** The functions that the printer prints at this time, the innermost last. */\n // Stryker disable next-line ArrayDeclaration: a value that is not a scope has no field repeats or root, so it acts as no scope\n readonly #scopes: CallScope[] = [];\n /** The work of the body of each bound function, by the number of its binding. */\n readonly #fnWork = new Map<number, number>();\n /** The expressions whose code is a constant of the run. Each entry is the original of a copy, so a second place of a shared list has the fact too. */\n readonly #constant = new WeakSet<Expr>();\n /** The expressions at a place that takes a list: a binding, the head of a list op and the list of an axis. */\n readonly #wantList = new WeakSet<Expr>();\n /** The facts of the list of each function of the memo whose value is a list. */\n readonly #lists = new Map<string, ListInfo | undefined>();\n /** True when a test of the analysis reads the facts of fusion (`listFactsOf`), and the facts of each list node. */\n readonly #noting: boolean;\n readonly #noted = new Map<Expr, Omit<ListFacts, \"reads\">>();\n /** The count of the reads of the value of each node, from the form of the program (`readCounts`). */\n readonly #reads: ReadonlyMap<Expr, number>;\n /** The nodes whose value the code reads again: a constant of the run, a column and a node of the memo. */\n readonly #shared = new Set<Expr>();\n /** The node of each code that `expr` gives, while the printer notes the facts of fusion. */\n readonly #nodeOf = new WeakMap<Code, Expr>();\n /** True when the printer prints the forms of fusion (COMPILE.MODULE.FUSE.OFF). `runOf` checks the option first. */\n readonly #fuse: boolean;\n /**\n * The code of each fused loop, with the index of the statement that declares its output (COMPILE.MODULE.FUSE). A chain\n * that reads the loop changes that statement, and then the loop pushes into the output of the chain.\n */\n readonly #outputs = new WeakMap<Code, number>();\n\n constructor(expr: Expr, options: ModuleOptions, keys: KeyPrint, starts: EmptyStarts, sheet?: SheetInfo) {\n this.#keys = keys;\n this.#fuse = options.fuse !== false;\n this.#starts = starts;\n this.#domains = (options.domains ?? []).map(formOf);\n this.#facts = factsOf({ domains: this.#domains });\n this.#schema = options.schema;\n this.#memo = memoOf(expr);\n this.#tree = options.space === \"tree\";\n this.#graph = options.space === \"graph\";\n this.#sheet = sheet;\n this.#noting = recorder !== undefined;\n this.#reads = this.#noting ? readCounts(expr) : new Map();\n recorder?.push(this);\n }\n\n /** This method gives the facts of fusion of each list node that the printer printed (COMPILE.MODULE.FUSE.FACTS). */\n listFacts(): ReadonlyMap<Expr, ListFacts> {\n const out = new Map<Expr, ListFacts>();\n // A part that the code reads again holds the array of the node, so the node is not fresh. Each node of a list is a\n // node of the program, but a node without a count gets the safe count. The copies of a shared object give one fact.\n for (const [e, f] of this.#noted) {\n const fact = this.#shared.has(e) ? { ...f, fresh: false, reads: Infinity } : { ...f, reads: this.#reads.get(e) ?? Infinity };\n const old = out.get(originalOf(e));\n out.set(originalOf(e), old === undefined ? fact : bothPlaces(old, fact));\n }\n return out;\n }\n\n /** This method notes the facts of fusion of the list of a node. A node that prints at two places gets the facts of both. */\n #note(e: Expr, c: Code, memo: boolean): void {\n const list = c.v.list;\n if (!this.#noting || list === undefined) return;\n this.#nodeOf.set(c, e);\n if (memo) this.#shared.add(e);\n const inner: boolean[] = [];\n for (let l = list.inner; l !== undefined; l = l.inner) inner.push(l.clean === true);\n const old = this.#noted.get(e);\n const clean = list.clean === true && (old?.clean ?? true);\n const fresh = list.fresh === true && (old?.fresh ?? true);\n this.#noted.set(e, { clean, inner: old === undefined ? inner : inner.map((x, i) => x && old.inner[i] === true), fresh });\n }\n\n use(name: Helper): string {\n if (KEY_READS.has(name)) this.#keys.read = true;\n this.helpers.add(name);\n return name;\n }\n\n /**\n * This method tells if the printer prints the clean form of a list (COMPILE.MODULE.FUSE.CLEAN). The option `fuse` must\n * be true, and the facts must prove the list clean. With `levels`, each level of a list of lists must be clean too.\n */\n #clean(l: ListInfo | undefined, levels = false): boolean {\n if (!this.#fuse) return false;\n for (let x = l; x !== undefined; x = levels ? x.inner : undefined) if (x.clean !== true) return false;\n return l !== undefined;\n }\n\n /**\n * This method gives the code of a list in the form of the helper `form`: a `vex.list`, or a plain array for `LP`\n * (COMPILE.MODULE.LIST.PLAIN). A list that the facts prove clean uses the clean form of the helper (COMPILE.MODULE.FUSE.CLEAN).\n */\n envelope(v: Value, form: keyof typeof CLEAN_FORMS): string {\n const list = v.list as ListInfo;\n const helper = this.#clean(list, true) ? CLEAN_FORMS[form] : form;\n return `${this.use(helper)}(${v.code}, ${String(depthOf(list))})`;\n }\n\n /**\n * This method gives the code of a list that is the value of the run at a key. With `fuse`, a `vex.list` that reads no\n * key evaluates once, on its first read, so each key gets one object (COMPILE.MODULE.FUSE.OUT). The keys share that\n * object, so only that object is frozen. A plain array stays one array for each key, because a host can change an array.\n */\n runList(v: Value, plain: boolean): string {\n if (plain || !this.#fuse || v.deps.size > 0) return this.envelope(v, plain ? \"LP\" : \"LO\");\n return this.#hoist(bare({ ...v, code: this.envelope(v, \"LS\"), plain: false }), true).v.code;\n }\n\n /** This method gives the name of a part of the tree, for example `H` for the children, and marks the part as read. */\n #part(part: TreePart, name: string): string {\n this.treeParts.add(part);\n return name;\n }\n\n /**\n * This method gives the check of a result of a kind, or undefined for a result that needs no check. A number must be\n * finite, and the domain of the kind can check the value with valid. The law checker of the test kit checks the\n * declaration `returns` of each op (KIND.RETURNS), so the module trusts the kind of each value. A result that is not a\n * value does not break the declaration, and `#value` gives its check (COMPILE.MODULE.RESULT).\n */\n check(kind: Kind): string | undefined {\n const d = this.#facts.checkOf(kind);\n // The kind is primitive here. A static site on a value of a domain has no domain without a primitive type before it.\n if (d === undefined) throw new NotStandalone(`a domain without a primitive type comes before the domain of a ${kind}`);\n // The name of a domain can have each character. For a name that is not a JavaScript name, the check has the index\n // of its domain in its name (V-061).\n const plain = `k_${kind.replace(\":\", \"_\")}`;\n const name = /^[\\w$]+$/.test(plain) ? plain : `k_d${String(d)}`;\n // Stryker disable next-line ConditionalExpression: a check of a kind is always the same, so the map only saves time\n if (!this.top.has(name)) {\n const domain = this.#domains[d];\n const valid = domain?.valid === undefined ? undefined : this.#valid(d, domain.name, kind, domain.valid);\n const conds = [...(kind === \"number\" ? [\"Number.isFinite(x)\"] : []), ...(valid === undefined ? [] : [`${valid}(x)`])];\n if (conds.length === 0) return undefined;\n this.top.set(name, `const ${name} = (x) => (${conds.join(\" && \")} ? x : ${this.use(\"F\")}());`);\n }\n return name;\n }\n\n /** This method gives the code of a result with its check, if it needs one. */\n #checked(kind: Kind, code: string): string {\n const k = this.check(kind);\n return k === undefined ? code : `${k}(${code})`;\n }\n\n /**\n * This method tells if the check of a kind can miss a result that is not a value. The check of a number finds each\n * such result, and a check `valid` finds them when it refuses each one.\n */\n #missesNoValue(kind: Kind): boolean {\n if (kind === \"number\") return false;\n const valid = this.#domains[this.#facts.checkOf(kind) as number]?.valid;\n return valid === undefined || !NOT_VALUES.every((x) => refuses(valid, x));\n }\n\n /**\n * This method gives the code of the result of the op `name` with the check of a value, if the op needs it. The\n * interpreter gives an error for `undefined`, `null` and a number that is not finite (CALL.RESULT).\n */\n #value(name: string, code: string): string {\n if (!this.#unproved.has(name)) return code;\n this.top.set(\"k_value\", `const k_value = (x) => (x === undefined || x === null || (typeof x === \"number\" && !Number.isFinite(x)) ? ${this.use(\"F\")}() : x);`);\n return `k_value(${code})`;\n }\n\n #valid(d: number, domain: string, kind: Kind, valid: (x: never) => boolean): string | undefined {\n const name = `v_${d}`;\n const src = copied(valid, [this.#samples(kind)], `the check \"valid\" of the domain ${domain}`);\n // A check that is Number.isFinite of a number adds nothing to the check of the result.\n const form = inlineForm(src);\n if (kind === \"number\" && form !== undefined && patternOf(form, (p) => p) === \"Number.isFinite(#0)\") return undefined;\n this.#copy(name, src);\n return name;\n }\n\n /** This method keeps the copy of a function of a domain as a declaration of the module. */\n #copy(name: string, src: string): void {\n this.top.set(name, `const ${name} = ${src};`);\n this.copies.add(name);\n }\n\n /** This method gives the samples of a kind: the samples of a primitive type, or the samples of a domain (KIND.DOMAIN). */\n #samples(kind: Kind): readonly unknown[] {\n const primitive = primitiveOf(kind);\n if (primitive !== undefined) return SAMPLES[primitive];\n const d = this.#domains.find((x) => kindOfDomain(x) === kind) as AnyDomain;\n if (d.samples === undefined) throw new NotStandalone(`the domain ${d.name} gives no samples, so a module cannot check a copy of its op`);\n return d.samples();\n }\n\n /**\n * This method gives the code of a check of the kind of an input. The check is a test of its JavaScript type, or the\n * copy of `is` of a domain. The code is true for an input against the kind.\n */\n against(kind: Kind, input: string): string {\n const primitive = primitiveOf(kind);\n return primitive === undefined ? `!${this.#isOf(kind)}(${input})` : `typeof ${input} !== \"${primitive}\"`;\n }\n\n /**\n * This method gives the name of a test of the kind of an item of a list of the input (COMPILE.MODULE.LIST.INPUT). The\n * test of a primitive type checks the JavaScript type, and the test of a domain is the copy of its `is`.\n */\n test(kind: Kind): string {\n const primitive = primitiveOf(kind);\n if (primitive === undefined) return this.#isOf(kind);\n const name = `is_${primitive}`;\n this.top.set(name, `const ${name} = (x) => typeof x === \"${primitive}\";`);\n return name;\n }\n\n /** This method gives the name of the copy of the test `is` of the domain of a kind. */\n #isOf(kind: Kind): string {\n const d = this.#domains.findIndex((x) => kindOfDomain(x) === kind);\n const domain = this.#domains[d];\n if (domain === undefined) throw new NotStandalone(`the schema has the kind ${kind}, and no domain has it`);\n const name = `is_${String(d)}`;\n if (!this.top.has(name)) {\n const src = copied(domain.is, [[...SAMPLES.number, ...SAMPLES.string, ...SAMPLES.boolean, null, {}, [], ...this.#samples(kind)]], `the test \"is\" of the domain ${domain.name}`);\n this.#copy(name, src);\n }\n return name;\n }\n\n /** This method gives a new name for the code. */\n fresh(prefix: string): string {\n const name = `${prefix}${this.#names++}`;\n if (prefix === \"b\") this.#pack?.locals.add(name);\n return name;\n }\n\n /** This method tells if code reads a lazy constant of the run, or calls a printed function that has a loop. */\n #defers(c: Code): boolean {\n return [c.v.code, ...c.s].some((line) => [...line.matchAll(/\\b(c\\d+|fn\\d+)\\(/g)].some((m) => this.#deferred.has(m[1] as string)));\n }\n\n /** This method gives the code of a name: a read that throws the error of its value, if it can hold an error. */\n #read(name: Name): Value {\n // A name holds its list, so a read of the name is not fresh.\n const base = { kind: name.kind, deps: name.deps, plain: true, list: heldList(name.list) };\n return name.lazy ? { ...base, code: `${this.use(\"G\")}(${name.code})`, safe: false, held: name.code } : { ...base, code: name.code, safe: true };\n }\n\n /** This method gives the name of a constant of the run, from the read of its value. */\n #nameOf(v: Value): Name {\n return { code: v.held ?? v.code, kind: v.kind, lazy: v.held !== undefined, deps: NO_DEPS, list: v.list };\n }\n\n /**\n * This method gives the statements that put the value of a code, or the error sentinel, into a new variable `name`.\n * A constant of the run without statements uses the helper `T`: it evaluates once, so its closure costs little.\n */\n #store(name: string, c: Code, run = false): string[] {\n if (c.v.safe) return [...c.s, `const ${name} = ${c.v.code};`];\n if (c.s.length === 0 && c.v.held !== undefined) return [`const ${name} = ${c.v.held};`];\n if (run && c.s.length === 0) return [`const ${name} = ${this.use(\"T\")}(() => ${c.v.code});`];\n return [`let ${name};`, \"try {\", ...ind(c.s), ` ${name} = ${c.v.code};`, \"} catch {\", ` ${name} = E;`, \"}\"];\n }\n\n /**\n * This method evaluates a constant of the run once, before the loop over the keys, and gives the read of its value. A\n * constant with a loop (`lazy`) evaluates on its first read instead, as a branch of the interpreter does. So does a\n * constant that reads a lazy constant or calls a function with a loop. Else it starts that loop before the run.\n */\n #hoist(c: Code, lazy = false): Code {\n if (c.v.deps.size > 0 || (c.v.plain === true && c.s.length === 0)) return c;\n // The loop over the keys reads each constant of the run again.\n const node = this.#nodeOf.get(c);\n if (node !== undefined) this.#shared.add(node);\n const key = this.#keyOf.get(c);\n const hit = key === undefined ? undefined : this.#constants.get(key);\n if (hit !== undefined) return hit;\n // A pack is a local of the loop of a second print, so a constant of the run cannot read it (V-077).\n this.#leavePack([c.v.code, ...c.s]);\n const name = this.fresh(\"c\");\n const deferred = lazy || this.#defers(c);\n if (deferred) {\n this.#deferred.add(name);\n this.run.push(`const ${name} = ${this.use(\"L\")}(() => {`, ...ind(c.s), ` return ${c.v.code};`, \"});\");\n } else this.run.push(...this.#store(name, c, true));\n const { list } = c.v;\n const read = bare(this.#read(deferred ? { code: `${name}()`, kind: c.v.kind, lazy: true, deps: NO_DEPS, list } : { code: name, kind: c.v.kind, lazy: !c.v.safe, deps: NO_DEPS, list }));\n if (key !== undefined) this.#constants.set(key, read);\n return read;\n }\n\n /**\n * This method gives the parts of a node with levels `deps`. When the node is not a constant of the run, each part that\n * is a constant evaluates once, before the loop. A node that is a constant keeps its parts, and its parent decides.\n */\n #settle(parts: readonly Code[], deps: ReadonlySet<number>, exprs: readonly Expr[] = []): readonly Code[] {\n return deps.size === 0 ? parts : parts.map((x, i) => this.#hoist(x, exprs[i] !== undefined && hasLoop(exprs[i])));\n }\n\n expr(e: Expr, ctx: Ctx): Code {\n if (!this.#starts.seek) return this.#exprCode(e, ctx);\n // A part of a step can read the items of its own name, so a search cannot print it yet. The rest of the step can\n // decide the kind, and the last print proves it (COMPILE.MODULE.LOOP.EMPTY). The search keeps no text, and the last\n // print gives each error again.\n try {\n return this.#exprCode(e, ctx);\n } catch {\n return bare({ code: \"E\", kind: undefined, safe: true, deps: NO_DEPS, list: { item: undefined, empty: true } });\n }\n }\n\n #exprCode(e: Expr, ctx: Ctx): Code {\n const key = ctx.keys.get(e);\n if (key !== undefined) return bare(this.#read(key));\n const keys = this.#memo.get(e);\n // In the second print of a fast sum, a column of the run at the item is the read of its pack, with no print of its parts.\n const packed = this.#packAt(ctx) && this.#columned.has(e) ? this.#packRead(this.#columns.get(this.#constKey(e, ctx)), ctx) : undefined;\n if (packed !== undefined) return packed;\n const c = keys !== undefined && this.#inside !== e ? this.#unpacked(() => this.#memoized(e, keys, ctx)) : this.#node(e, ctx);\n if (c.v.deps.size === 0) {\n // A constant of the run with the structure of an earlier one is that constant.\n this.#keyOf.set(c, this.#constKey(e, ctx));\n this.#constant.add(originalOf(e));\n }\n // A list is a value only at a place that takes a list: a result, a binding, an argument, a field and the body of a\n // function take one. A condition, an argument of and or of or, and a key of get take no list.\n if (c.v.list !== undefined && !this.#wantList.has(e)) throw new NotStandalone(\"a list is a value of the program\");\n const out = this.#columnar(e, c, ctx) ? this.#column(e, c, ctx) : c;\n this.#note(e, out, keys !== undefined);\n return out;\n }\n\n /** This method gives the code of a list at a place that takes a list (LIST.VALUE): an each, a name, sortBy or take. */\n #listOf(e: Expr, ctx: Ctx): Code {\n this.#wantList.add(e);\n const c = this.expr(e, ctx);\n if (c.v.list === undefined) throw new NotStandalone(\"a list op on a value that is not a list\");\n return c;\n }\n\n /** This method tells if an expression gives a list at a place that takes one (`listy`). */\n #isList(e: Expr, ctx: Ctx): boolean {\n return listy(e, this.#scopeOf(ctx));\n }\n\n /**\n * This method tells if the body of an each can give a list. The facts of the names `as` of its items come from its\n * list, which the printer prints only in the loop. So here each such name can hold a list. Then a list op goes over the\n * array of the each, and that array gives the value of the interpreter too (COMPILE.MODULE.LIST.ITEM).\n */\n #bodyList(e: ExprOf<\"each\">, ctx: Ctx): boolean {\n const scope = this.#scopeOf(ctx);\n if (e.as === undefined) return listy(e.body, scope);\n const names: readonly string[] = e.as;\n return listy(e.body, { ...scope, name: (name, levels) => names.includes(name) || scope.name(name, levels) });\n }\n\n /** This method gives the scope of `listy` at a node: the keys of its node of the memo, its names and its bound functions. */\n #scopeOf(ctx: Ctx): ListScope {\n return {\n // A key of a node of the memo is a name of its function, and the name keeps the facts of a list.\n key: (e) => ctx.keys.get(e),\n op: (name) => this.#facts.givesList(name),\n name: (name, levels) => {\n const bound = ctx.env.get(name);\n if (bound !== undefined) return hasLevels(bound.list, levels);\n const kind = this.#schema.vars?.[name];\n return typeof kind === \"object\" && hasLevels(listOfKind(kind), levels);\n },\n fn: (name) => {\n const bound = ctx.fns.get(name);\n return bound === undefined ? undefined : { fn: bound.fn, scope: this.#scopeOf(bound.ctx) };\n },\n cell: (x, levels) => hasLevels(this.#cellList(x), levels),\n field: (x, levels) => {\n const kind = this.#schema.fields?.[x.path.join(\".\")];\n return typeof kind === \"object\" && hasLevels(listOfKind(kind), levels);\n },\n };\n }\n\n /** This method gives the facts of the list of a read of a cell. A read of a column that holds no list gives undefined. */\n #cellList(e: ExprOf<\"ext\">): ListInfo | undefined {\n return e.kind === CELL_KIND && isCellRef(e.data) ? this.#sheet?.lists.get(e.data.column) : undefined;\n }\n\n /**\n * This method gives the code of a literal. A value of a domain with a module form is an object of plain data, with the\n * kind of its domain (COMPILE.MODULE.FORM). Such a value is a constant of the run, so it gets a variable.\n */\n #literal(value: unknown): Value {\n for (const d of this.#domains) {\n const data = d.moduleForm?.literal?.(value);\n if (data !== undefined) return { code: `({ ${Object.entries(data).map(([k, x]) => `${k}: ${literal(x).code}`).join(\", \")} })`, kind: kindOfDomain(d), safe: true, deps: NO_DEPS };\n }\n return literal(value);\n }\n\n /** This method prints a list literal (LIST.LITERAL) as an array of pairs of a key and a value. An error item holds the sentinel. */\n #listLiteral(l: VexList): Code {\n const values = l.items.map((it) => (it.result.ok ? this.#literal(it.result.value) : undefined));\n const kinds = values.flatMap((x) => (x === undefined ? [] : [x.kind]));\n const code = `[${l.items.map((it, i) => `[${JSON.stringify(it.key)}, ${values[i]?.code ?? \"E\"}]`).join(\", \")}]`;\n const has = l.items.length > 0;\n // An error item of the literal holds the sentinel, so only a literal without error items is clean.\n const clean = values.every((x) => x !== undefined);\n return bare({ code, kind: undefined, safe: true, deps: NO_DEPS, list: { item: kinds.reduce(join, kinds[0]), texts: has, empty: !has, clean } });\n }\n\n /**\n * This method tells if a part of a loop over the targets is a column of the run. Its value depends only on the\n * target and on the constants of the run, so each run computes it once for each record. Each name that it reads\n * from outside is a constant of the run, so its code can be outside the loop.\n */\n #columnar(e: Expr, c: Code, ctx: Ctx): boolean {\n // A node of the memo has the level 1, so a column has a focus. The results of the cells change in a run, so a part\n // that reads a cell is not a column. The rows of a column change in each round, so a part that reads one is not either.\n if (ctx.level < 2 || c.v.deps.has(CELLS) || c.v.deps.has(ROUNDS) || !c.v.deps.has(ctx.level) || this.#work(e, ctx.fns) < COLUMN_WORK) return false;\n const scope = this.#callScope(c, ctx);\n if (c.v.deps.size !== 1 && scope === undefined) return false;\n // A node of the memo with keys keeps its costly part for each value of its keys already.\n if (this.#keyed(e)) return false;\n const visible = (name: string): boolean => {\n const bound = ctx.env.get(name);\n return (bound?.deps.size ?? 0) === 0 || (scope?.names.has((bound as Name).code) ?? false);\n };\n return [...namesOf(e)].every(visible) && !this.#callsLocal(e, ctx);\n }\n\n /**\n * This method gives the function whose call can hold a column of a part. The part is in a loop of the function, and it\n * reads a parameter. The body of the function has a loop in a loop, so a call can read the part more than once. Each\n * name that the part reads is a parameter, a binding at the root of the body or a constant (`#columnar`). So the\n * part depends only on its target and on values that one call does not change. These are the parameters, the focus\n * and the origin. The levels in a node of the memo start at 1, far below the focus of a function. So a node of the\n * memo holds no column of a call.\n */\n #callScope(c: Code, ctx: Ctx): CallScope | undefined {\n const scope = this.#scopes.at(-1);\n // A part that reads a parameter reads a variable of this function, so its structure gives no column of another function.\n return scope !== undefined && scope.repeats && ctx.level > scope.focus && c.v.deps.has(scope.param) ? scope : undefined;\n }\n\n /** This method tells if an expression calls a function that is at the place of its binding, not at the start of a run. */\n #callsLocal(e: Expr, ctx: Ctx): boolean {\n // Stryker disable next-line ConditionalExpression: a node that is not a call has no field fn, so the map gives undefined\n if (e.tag === \"call\" && ctx.fns.get(e.fn)?.local === true) return true;\n return children(e).some((x) => this.#callsLocal(x, ctx));\n }\n\n /** This method tells if an expression has a node of the memo with keys in it. */\n #keyed(e: Expr): boolean {\n return (this.#memo.get(e)?.length ?? 0) > 0 || children(e).some((x) => this.#keyed(x));\n }\n\n /**\n * This method gives the work of an expression: a node of the memo and a constant of the run are one read each. A call\n * adds the work of the body of its function, because the body evaluates at each call.\n */\n #work(e: Expr, fns: ReadonlyMap<string, BoundFn>): number {\n if (this.#memo.has(e) || this.#constant.has(originalOf(e))) return 1;\n // Stryker disable next-line ConditionalExpression: a node that is not a call has no field fn, so the map gives undefined\n const body = e.tag === \"call\" ? this.#bodyWork(fns.get(e.fn)) : 0;\n return children(e).reduce((sum, x) => sum + this.#work(x, fns), 1 + body);\n }\n\n /**\n * This method gives the work of the body of a function, once for each function. Thus a chain of calls costs no more\n * than its functions. A body that is a column of the run is one read. A body sees the functions of the place of its\n * binding, and no function calls itself (FN.TOTAL).\n */\n #bodyWork(bound: BoundFn | undefined): number {\n if (bound === undefined) return 0;\n let work = this.#fnWork.get(bound.id);\n if (work === undefined) {\n work = this.#columned.has(bound.fn.body) ? 1 : this.#work(bound.fn.body, bound.ctx.fns);\n this.#fnWork.set(bound.id, work);\n }\n return work;\n }\n\n /**\n * This method stops the second print when some lines for the run read a local of its loop (V-077, V-094). That\n * local is a pack, or a value local that the lines do not declare. Else the declared locals go to the run too.\n */\n #leavePack(lines: readonly string[]): void {\n const pack = this.#pack;\n if (pack === undefined) return;\n const text = lines.join(\"\\n\");\n if ([...pack.cols.values()].some((local) => text.includes(`${local}[`))) throw new NoPack();\n // Stryker disable next-line ConditionalExpression: with no locals the scan below finds no read, so this return only saves the scan\n if (pack.locals.size === 0) return;\n const declared = new Set([...text.matchAll(/\\b(?:const|let) (b\\d+)\\b/gu)].map((m) => m[1]));\n // A call at its place keeps an argument in a local, and a read of that argument has no levels (V-094).\n if ([...text.matchAll(/\\bb\\d+\\b/gu)].some(([name]) => pack.locals.has(name) && !declared.has(name))) throw new NoPack();\n for (const name of declared) pack.locals.delete(name as string);\n }\n\n /**\n * This method adds some lines to the run. A pack is a local of the loop of a second print, so a line of the run\n * cannot read it (V-077, V-084). Then the second print stops, and the loop keeps its first print.\n */\n #intoRun(lines: readonly string[]): void {\n this.#leavePack(lines);\n this.run.push(...lines);\n }\n\n /** This method tells if a second print (`#packed`, `#packedSteps`) reads the packs of the columns at the focus of `ctx`. */\n #packAt(ctx: Ctx): boolean {\n return this.#pack !== undefined && ctx.focus !== undefined && this.#pack.foci.has(ctx.focus);\n }\n\n /**\n * This method gives the read of the pack of a column in a second print (`#packed`, `#packedSteps`), or undefined. The\n * column must be a column of the run, or a column of the function that the printer prints. The read must be at a\n * focus of the print. The read holds the value of the column or the sentinel, as a read of the column does.\n */\n #packRead(name: string | undefined, ctx: Ctx): Code | undefined {\n const pack = this.#pack;\n if (pack === undefined || name === undefined || !this.#packAt(ctx)) return undefined;\n const own = this.#callColumns.get(name);\n if (!this.#runColumns.has(name) && (!pack.calls || own?.scope !== this.#scopes.at(-1))) return undefined;\n let local = pack.cols.get(name);\n if (local === undefined) {\n local = this.fresh(\"pk\");\n pack.cols.set(name, local);\n }\n const held = `${local}[${ctx.focus as string}]`;\n // A column of a call can read a parameter, the focus and the origin of the function, so its read keeps these markers (V-081).\n const deps = new Set([ctx.level, ...(own?.deps ?? [])]);\n return bare({ code: `${this.use(\"G\")}(${held})`, kind: own === undefined ? this.#runColumns.get(name) : own.kind, safe: false, held, deps });\n }\n\n /** This method gives the read of a column of the run. Two parts with the same structure share one column. */\n #column(e: Expr, c: Code, ctx: Ctx): Code {\n const key = this.#constKey(e, ctx);\n let name = this.#columns.get(key);\n if (name === undefined) {\n // The first print of a fast sum makes each column of its term, so the second print makes none (`#packed`).\n if (this.#pack !== undefined) throw new NoPack();\n name = this.fresh(\"col\");\n // A column of a call is at the start of the body of its function, so each call has its own.\n const scope = this.#callScope(c, ctx);\n (scope?.decls ?? this.run).push(`const ${name} = ${this.use(\"Q\")}((${ctx.focus as string}) => {`, ...ind(c.s), ` return ${c.v.code};`, \"});\");\n if (c.v.list === undefined) {\n if (scope === undefined) this.#runColumns.set(name, c.v.kind);\n else this.#callColumns.set(name, { scope, kind: c.v.kind, deps: new Set([...c.v.deps].filter((d) => d !== ctx.level)) });\n }\n this.#columns.set(key, name);\n }\n this.#columned.add(e);\n // Each key of the column reads the array of the column again.\n this.#shared.add(e);\n return this.#packRead(name, ctx) ?? bare({ code: `${this.use(\"G\")}(${name}(${ctx.focus as string}))`, kind: c.v.kind, safe: false, deps: c.v.deps, list: heldList(c.v.list) });\n }\n\n #node(e: Expr, ctx: Ctx): Code {\n switch (e.tag) {\n case \"lit\":\n return isVexList(e.value) ? this.#listLiteral(e.value) : bare(this.#literal(e.value));\n case \"ref\":\n return this.#ref(e, ctx);\n case \"var\":\n return bare(this.#var(e.name, ctx));\n case \"let\":\n return this.#let(e, ctx);\n // A function is only a binding of let, so the check of the shape stops this node first.\n // Stryker disable next-line all: see the comment above\n /* v8 ignore next -- @preserve */\n case \"fn\": throw new NotStandalone(\"a function outside the bindings of a let\");\n case \"call\":\n return this.#call(e, ctx);\n case \"rec\": {\n const names = Object.keys(e.fields);\n const exprs = Object.values(e.fields);\n // A field can hold a list (COMPILE.MODULE.LIST.FIELD).\n for (const x of exprs) this.#wantList.add(x);\n const raw = exprs.map((x) => this.expr(x, ctx));\n const deps = depsOf(...raw);\n // The interpreter evaluates each field, also after an error.\n const fields = this.#inOrder(this.#settle(raw, deps, exprs), true);\n // A record of a module is a new object, so it needs no freeze.\n const code = `({ ${fields.map((x, i) => `${names[i] === \"__proto__\" ? '[\"__proto__\"]' : JSON.stringify(names[i])}: ${this.#plain(x.v)}`).join(\", \")} })`;\n return { s: stmtsOf(...fields), v: { code, kind: undefined, safe: fields.every((x) => x.v.safe), deps } };\n }\n case \"app\":\n return this.#app(e, ctx);\n case \"each\":\n return this.#eachList(e, ctx);\n case \"fold\":\n return this.#fold(e, ctx);\n case \"iterate\":\n return this.#iterate(e, ctx);\n case \"fix\":\n return this.#fix(e, ctx);\n case \"last\": {\n // The check of the program comes before the printer, so each read has its column (FIX.MONOTONE).\n const { code, kind } = ctx.columns.get(e.name) as FixColumn;\n return bare({ code: `${code}[${ctx.focus as string}]`, kind, safe: true, deps: new Set([ctx.level, ROUNDS]) });\n }\n case \"ext\":\n return this.#cell(e, ctx);\n }\n }\n\n /**\n * This method gives the code of a read of a cell in a module of a sheet (COMPILE.MODULE.SHEET). The value is the result\n * of the cell, which can be the error sentinel, so the read throws its error. A read that is not a cell reference, or\n * of a column that the sheet does not have, gives an error, as in `SheetRun`.\n */\n #cell(e: ExprOf<\"ext\">, ctx: Ctx): Code {\n const sheet = this.#sheet;\n if (sheet === undefined || e.kind !== CELL_KIND) throw new NotStandalone(`the extension \"${e.kind}\"`);\n const F = this.use(\"F\");\n if (!isCellRef(e.data)) return bare({ code: `${F}()`, kind: undefined, safe: false, deps: new Set([CELLS]) });\n const { column, at } = e.data;\n const deps = new Set([...this.#addressDeps(at, ctx, []), CELLS]);\n const index = sheet.columns.get(column);\n // The read of a column that the sheet does not have is an error. A kind of the options lets an op take it.\n const list = sheet.lists.get(column);\n if (index === undefined) return bare({ code: `${F}()`, kind: sheet.kinds.get(column), safe: false, deps, list });\n if (!sheet.kinds.has(column)) throw new NotStandalone(`a formula reads the column \"${column}\" before its formula, so the column needs its kind in the option kinds`);\n // A direct fill reads the array of the column. The search reads the cell with the function of its state.\n const address = this.#address(at, ctx, []);\n const read = sheet.direct ? `D[${String(index)}][${address}]` : `${READ_CELL}(${String(index)}, ${address})`;\n const v = { code: `${this.use(\"G\")}(${read})`, kind: sheet.kinds.get(column), safe: false, deps, list };\n // The read itself gives the result or the error sentinel. A move of the address can throw, so then the read is not\n // a value that holds the sentinel.\n return bare(at.every((m) => m.t === \"origin\") ? { ...v, held: read } : v);\n }\n\n /**\n * This method gives the parts of a node in the order of the interpreter, when a part reads a cell (COMPILE.MODULE.SHEET).\n * A read of a cell can start the search of the run, and the search decides the cycles. So the module must read each\n * cell that the interpreter reads. With `all`, the interpreter evaluates each part also after an error, so each part\n * goes into a variable that can hold the error. Else the first error stops the parts, so each part goes into a\n * variable before the next part starts.\n *\n * The statements of the parts come before the code of their values. The last part that reads a cell keeps its place\n * only if no statement after it can throw. Also, with `all`, a value before it must not throw, or the code of its value\n * must read no cell. With `held`, code before the parts can throw, so the last part also goes into a variable.\n */\n #inOrder(parts: readonly Code[], all: boolean, held = false): readonly Code[] {\n // A read of a finished cell starts no search, so the order of the reads does not change a result.\n if (this.#sheet?.direct === true) return parts;\n const last = parts.findLastIndex((x) => x.v.deps.has(CELLS));\n const after = parts.slice(last + 1).every((x) => x.s.length === 0 || x.v.safe);\n const before = !all || parts.slice(0, Math.max(last, 0)).every((x) => x.v.safe) || !READS_IN_CODE.test((parts[last] as Code).v.code);\n return parts.map((x, i) => {\n // A part after the last read of a cell cannot stop a read. A part that cannot throw and reads no cell cannot either.\n if (i > last || (x.v.safe && !x.v.deps.has(CELLS)) || (i === last && after && before && !held)) return x;\n const b = this.fresh(\"b\");\n if (all && !x.v.safe) return { s: this.#store(b, x), v: { ...x.v, code: `${this.use(\"G\")}(${b})`, held: b, plain: false } };\n return { s: [...x.s, `const ${b} = ${x.v.code};`], v: { kind: x.v.kind, deps: x.v.deps, list: x.v.list, code: b, safe: true, plain: true } };\n });\n }\n\n /**\n * This method gives the parts of the expressions of an address. The interpreter evaluates each expression before the\n * first move, but the code of an address has each expression after the moves before it. A move can fail, so it must\n * not stop a read of a cell in a later expression (COMPILE.MODULE.SHEET).\n */\n #addressParts(at: readonly Move[], values: readonly Code[], deps: ReadonlySet<number>): readonly Code[] {\n return this.#inOrder(this.#settle(values, deps), false, at.findLastIndex((m) => moveExpr(m) !== undefined) > 0);\n }\n\n /**\n * This method gives the code of the index of an address from the focus. `values` has the code of the value of each\n * computed move, in order (NAV.COMPUTED).\n */\n #address(at: readonly Move[], ctx: Ctx, values: readonly Code[]): string {\n let index = ctx.focus;\n let next = 0;\n // A move that can fail keeps its check when a later fixed key, index or origin replaces its index (V-052). The focus\n // and the origin cannot fail, and the code of a move from an index has the code of that index in it. In a tree,\n // the move parent is a move from an index.\n let fails = false;\n const checks: string[] = [];\n for (const m of at) {\n if (fails && index !== undefined && m.t !== \"offset\" && m.t !== \"other\" && (m.t !== \"parent\" || !this.#tree)) checks.push(index);\n index = moveExpr(m) === undefined ? this.#move(m, index, ctx.origin) : this.#computed(m, values[next++] as Code);\n fails = m.t !== \"origin\";\n }\n // A node of the memo reads neither its origin nor its focus (memo.ts), so the guards of this method do not fail.\n // Stryker disable next-line ConditionalExpression,StringLiteral: see the comment above\n /* v8 ignore next -- @preserve */\n if (index === undefined) throw new NotStandalone(\"a node of the memo reads its focus\");\n return checks.length === 0 ? index : `(${[...checks, index].join(\", \")})`;\n }\n\n /** This method gives the code of the index of a computed move, from the code of its value. */\n #computed(m: Move, value: Code): string {\n return (m.t === \"key\" ? this.#keyMove(value.v.code) : undefined) ?? `${this.use(m.t === \"key\" ? \"K\" : \"I\")}(${value.v.code}, n)`;\n }\n\n /** This method gives the code of the position of a key of a move in a keyed print, and undefined in each other print. */\n #keyMove(key: string): string | undefined {\n this.#keys.read = true;\n if (!this.#keys.keyed) return undefined;\n this.runKeys = true;\n return `${this.use(\"KP\")}(KM, ${key})`;\n }\n\n /** This method gives a reason for an offset of an array space with keys. The keys of a record space have no order (NAV.OFFSET). */\n #noOffset(): void {\n if (this.#keys.keyed) throw new NotStandalone('an offset or the axis \"window\" in an array space with the option \"keys\"');\n }\n\n /**\n * This method gives the key of the pair of an item at the target `j`. A keyed print puts the key of the record in the\n * pair, because `GT`, `WO` and `LO` read the pair as text (COMPILE.MODULE.KEYS). A target with text keys is that key.\n */\n #pairKey(j: string, texts: boolean): string {\n if (!this.#keys.keyed || texts) return j;\n this.runKeys = true;\n return `keys[${j}]`;\n }\n\n #move(m: Move, focus: string | undefined, origin: string | undefined): string {\n const F = this.use(\"F\");\n switch (m.t) {\n case \"origin\":\n // Stryker disable next-line ConditionalExpression,StringLiteral: see #address\n /* v8 ignore next -- @preserve */\n if (origin === undefined) throw new NotStandalone(\"a node of the memo reads its origin\");\n return origin;\n case \"key\":\n // A key of an array space is the text of its index, unless the run has its own keys.\n return this.#keyMove(JSON.stringify(m.key)) ?? (typeof m.key === \"string\" && /^(0|[1-9]\\d*)$/.test(m.key) ? `(${m.key} < n ? ${m.key} : ${F}())` : `${F}()`);\n case \"index\":\n return typeof m.i === \"number\" && Number.isInteger(m.i) && m.i >= 0 ? `(${m.i} < n ? ${m.i} : ${F}())` : `${F}()`;\n case \"offset\": {\n const [d, ...more] = m.d;\n // Stryker disable next-line ConditionalExpression,StringLiteral: see #address\n /* v8 ignore next -- @preserve */\n if (focus === undefined) throw new NotStandalone(\"a node of the memo reads its focus\");\n // A graph space has no offsets (NAV.OFFSET), so an offset fails at each key.\n if (this.#graph || d === undefined || more.length > 0 || !Number.isInteger(d)) return `${F}()`;\n // In a tree space, an offset goes among the siblings (NAV.OFFSET.TREE).\n if (this.#tree) return `${this.use(\"SO\")}(${this.#part(\"siblings\", \"GP\")}, SI, ${focus}, ${d})`;\n this.#noOffset();\n return `${this.use(\"X\")}(${focus} + ${d}, n)`;\n }\n case \"other\":\n // Stryker disable next-line ConditionalExpression,StringLiteral: see #address\n /* v8 ignore next -- @preserve */\n if (focus === undefined) throw new NotStandalone(\"a node of the memo reads its focus\");\n return `(n === 2 ? 1 - ${focus} : ${F}())`;\n case \"parent\":\n // Only a tree space has parents (NAV.PARENT).\n if (!this.#tree) return `${F}()`;\n // Stryker disable next-line ConditionalExpression,StringLiteral: see #address\n /* v8 ignore next -- @preserve */\n if (focus === undefined) throw new NotStandalone(\"a node of the memo reads its focus\");\n return `${this.use(\"UP\")}(P, ${focus})`;\n }\n }\n\n #ref(e: ExprOf<\"ref\">, ctx: Ctx): Code {\n const [field, ...more] = e.path;\n const kind = field === undefined ? undefined : this.#schema.fields?.[field];\n if (field === undefined || more.length > 0 || !isFieldName(field) || kind === undefined) throw new NotStandalone(`a read of a field that is not in the schema: \"${e.path.join(\".\")}\"`);\n // The check of the run keeps the array of each list of the input (COMPILE.MODULE.LIST.INPUT).\n const input = typeof kind === \"object\" ? this.#input(field) : undefined;\n // A move to the origin cannot fail, and the schema has the field in each record.\n const at = e.at ?? [];\n const safe = at.every((m) => m.t === \"origin\");\n const values = this.#addressValues(at, ctx);\n const deps = this.#addressDeps(at, ctx, values);\n // The interpreter evaluates the expressions of the address before its moves, and the first error stops them.\n const parts = this.#addressParts(at, values, deps);\n const address = this.#address(at, ctx, parts);\n if (typeof kind === \"object\") return { s: stmtsOf(...parts), v: { code: `${input as string}[${address}]`, kind: undefined, safe, deps, list: listOfKind(kind, true) } };\n return { s: stmtsOf(...parts), v: { code: `R[${address}][${JSON.stringify(field)}]`, kind, safe, deps } };\n }\n\n /** This method gives the name of the array of the lists of a field of the input. */\n #input(field: string): string {\n const known = this.inputs.get(field);\n if (known !== undefined) return known;\n const name = this.fresh(\"LF\");\n this.inputs.set(field, name);\n return name;\n }\n\n /** This method gives the code of the expressions of the computed moves of an address. They evaluate at the node. */\n #addressValues(at: readonly Move[], ctx: Ctx): readonly Code[] {\n return addrExprs(at).map((x) => this.expr(x, ctx));\n }\n\n /**\n * This method gives the levels of the key of an address. The focus and the origin have their level, and a fixed key\n * has no level. A computed move has the levels of its value.\n */\n #addressDeps(at: readonly Move[], ctx: Ctx, values: readonly Code[]): ReadonlySet<number> {\n let deps: ReadonlySet<number> = new Set([ctx.level]);\n let next = 0;\n // A move that can fail keeps the levels of its index when a later move replaces the index (V-052). An offset and\n // other keep the index, so their levels stay.\n let fails = false;\n const kept = new Set<number>();\n for (const m of at) {\n if (fails) for (const d of deps) kept.add(d);\n if (moveExpr(m) !== undefined) deps = (values[next++] as Code).v.deps;\n else if (m.t === \"origin\") deps = new Set([ctx.originLevel]);\n // The parent of a key of a tree depends on the key. Outside a tree, the move fails at each key.\n else if (m.t === \"key\" || m.t === \"index\" || (m.t === \"parent\" && !this.#tree)) deps = NO_DEPS;\n fails = m.t !== \"origin\";\n }\n return new Set([...deps, ...kept]);\n }\n\n #var(name: string, ctx: Ctx): Value {\n const bound = ctx.env.get(name);\n if (bound !== undefined) return this.#read(bound);\n // A name of a loop hides a function with its name, so this check comes after the names of the scope.\n if (ctx.fns.has(name)) throw new NotStandalone(`the name \"${name}\" is a function, not a value`);\n const kind = this.#schema.vars?.[name];\n if (kind === undefined) throw new NotStandalone(`a variable that is not in the schema: \"${name}\"`);\n let code = this.vars.get(name);\n if (code === undefined) {\n code = `v${this.vars.size}`;\n this.vars.set(name, code);\n }\n // The check of the run keeps the array of a list of the variables (COMPILE.MODULE.LIST.VAR).\n return typeof kind === \"object\" ? { ...plainValue(code, undefined), list: listOfKind(kind, true) } : plainValue(code, kind);\n }\n\n /**\n * A binding is a variable. A binding with an error is an error only where the body reads its name, so the variable\n * can hold the sentinel. A binding that is a constant of the run is the variable of that constant.\n */\n #let(e: ExprOf<\"let\">, ctx: Ctx, wrap?: (body: Expr) => Expr): Code {\n const env = new Map(ctx.env);\n const fns = new Map(ctx.fns);\n const s: string[] = [];\n let deps = new Set<number>();\n const bound: BoundFn[] = [];\n // The bindings of a let at the root of the body of a function are at the start of the body, so a column of the\n // call can read them. A let at the root that is a node of the memo binds variables of its function of the memo, but\n // the memo holds no column of a call (`#callScope`), so these names have no reader.\n const scope = this.#scopes.at(-1);\n const root = scope !== undefined && scope.root === e ? scope : undefined;\n for (const [name, x] of Object.entries(e.bind)) {\n // A binding sees the context of the let, so a function cannot call itself.\n if (x.tag === \"fn\") {\n // Stryker disable next-line UpdateOperator: the numbers of the bindings only need to be distinct\n const b: BoundFn = { id: this.#fnIds++, fn: x, ctx, specs: new Map(), decls: [], local: false };\n bound.push(b);\n fns.set(name, b);\n env.delete(name);\n continue;\n }\n // A binding takes a list (LIST.VALUE). A value hides a function of its name, because a read looks at the values first.\n this.#wantList.add(x);\n const c = this.#hoist(this.expr(x, ctx), hasLoop(x));\n if (c.v.deps.size === 0) {\n env.set(name, this.#nameOf(c.v));\n continue;\n }\n const b = this.fresh(\"b\");\n s.push(...this.#store(b, c));\n env.set(name, { code: b, kind: c.v.kind, lazy: !c.v.safe, deps: c.v.deps, list: c.v.list });\n root?.names.add(b);\n // The statements of the binding read its keys, so the let is not a constant of the run.\n deps = new Set([...deps, ...c.v.deps]);\n }\n // The body of a relay appends to the list of the bound name, into the array of the owner (COMPILE.MODULE.FUSE.ADOPT).\n // The binding of the relay is not a function, so the let binds its name.\n const relay = this.#relays.get(e);\n if (relay !== undefined) {\n const owner: Owner = { name: relay.bind, read: env.get(relay.bind) as Name, w: relay.owner.w, adopt: relay.owner.adopt, sure: relay.owner.sure };\n for (const node of relay.nodes) this.#own.set(node, owner);\n }\n // A list op over a let is the list op over its body, in the scope of its bindings (`#app`).\n const inner = wrap === undefined ? e.body : wrap(e.body);\n // A let at a place that takes a list gives its body there (LIST.VALUE).\n if (this.#wantList.has(e)) this.#wantList.add(inner);\n if (root !== undefined) root.root = inner;\n const body = this.expr(inner, { ...ctx, env, fns });\n // A function that reads names of the place of the binding comes after them, before the body.\n return { s: [...s, ...bound.flatMap((b) => b.decls), ...body.s], v: { ...body.v, deps: new Set([...deps, ...body.v.deps]) } };\n }\n\n /**\n * This method prints a call (FN.CALL). Each argument evaluates at the place of the call, as a binding of a let. The\n * call goes to the printed function of the signature of its arguments, with the focus and the origin if it reads them.\n */\n #call(e: ExprOf<\"call\">, ctx: Ctx): Code {\n const bound = ctx.env.has(e.fn) ? undefined : ctx.fns.get(e.fn);\n if (bound === undefined) throw new NotStandalone(`a call of \"${e.fn}\", which is not a function`);\n if (bound.fn.params.length !== e.args.length) throw new NotStandalone(`a call of \"${e.fn}\" with ${String(e.args.length)} arguments, not ${String(bound.fn.params.length)}`);\n // The second print of a fast sum puts the body of a function at the place of its call (`#inline`).\n if (this.#packAt(ctx)) return this.#inline(bound, e, ctx);\n const s: string[] = [];\n const args = e.args.map((x): Arg => {\n // An argument can be a list, as a binding of a let can (COMPILE.MODULE.LIST.ARG).\n this.#wantList.add(x);\n const c = this.#hoist(this.expr(x, ctx), hasLoop(x));\n const { kind, deps, list } = c.v;\n // A value that cannot throw is the argument itself. A read of a name that can hold the error passes the name.\n if (c.v.safe) {\n s.push(...c.s);\n return { code: c.v.code, kind, deps, list };\n }\n // Stryker disable next-line ConditionalExpression: the statements with a read of a name bind other names and do not throw, so the read alone has the same value\n if (c.s.length === 0 && c.v.held !== undefined) return { code: c.v.held, kind, deps, list };\n const b = this.fresh(\"b\");\n s.push(...this.#store(b, c));\n return { code: b, kind, deps, list };\n });\n // Each parameter can hold the error of its argument, so one function serves the arguments of one kind. The facts of\n // a list are a part of its kind. With fuse, the fact clean of each list is a part too (COMPILE.MODULE.FUSE.CLEAN).\n // The function of a list that is not clean also serves a clean list, so a call takes it if it exists.\n const sig = this.#signature(args, this.#fuse);\n const spec = bound.specs.get(sig) ?? bound.specs.get(this.#signature(args, false)) ?? this.#unpacked(() => this.#printFn(bound, args, sig));\n // Each marker becomes the levels at the call. The levels of the arguments count for each call, because their\n // statements read their keys, so the marker of the parameters gives no level.\n const levels = (d: number): readonly number[] => (d === spec.origin ? [ctx.originLevel] : d === spec.focus ? [ctx.level] : d === spec.param ? [] : [d]);\n const deps = new Set([...args.flatMap((a) => [...a.deps]), ...[...spec.deps].flatMap(levels)]);\n const position = [...(spec.deps.has(spec.focus) ? [ctx.focus] : []), ...(spec.deps.has(spec.origin) ? [ctx.origin] : [])];\n return { s, v: { code: `${spec.name}(${[...args.map((a) => a.code), ...position].join(\", \")})`, kind: spec.kind, safe: spec.safe, deps, list: heldList(spec.list) } };\n }\n\n /**\n * This method prints a call in the second print of a fast sum (`#packed`). The body of the function is at the place\n * of the call, as the body of a let. Each argument evaluates at the place of the call. The body sees the names of the\n * place of its binding (FN.CALL). Thus a read of a column in the body reads the pack of the column.\n */\n #inline(bound: BoundFn, e: ExprOf<\"call\">, ctx: Ctx): Code {\n // A function at the place of its binding reads names of that place, so its body stays in its function.\n if (bound.local || ++(this.#pack as Pack).inlines > INLINES) throw new NoPack();\n const s: string[] = [];\n const deps: number[] = [];\n const env = new Map(bound.ctx.env);\n bound.fn.params.forEach((p, i) => {\n const x = e.args[i] as Expr;\n this.#wantList.add(x);\n const c = this.#hoist(this.expr(x, ctx), hasLoop(x));\n if (c.v.list !== undefined) throw new NoPack();\n deps.push(...c.v.deps);\n // A short safe value is the read itself. A read of a name that can hold the error reads that name.\n let code = c.v.code;\n if (!c.v.safe && c.s.length === 0 && c.v.held !== undefined) code = c.v.held;\n else if (!c.v.safe || c.s.length > 0 || !/^[\\w$.]+$/.test(code)) {\n code = this.fresh(\"b\");\n s.push(...this.#store(code, c));\n }\n env.set(p, { code, kind: c.v.kind, lazy: !c.v.safe, deps: c.v.deps, list: undefined });\n });\n this.#wantList.add(bound.fn.body);\n const body = this.expr(bound.fn.body, { ...ctx, env, fns: bound.ctx.fns, keys: new Map() });\n if (body.v.list !== undefined) throw new NoPack();\n // The statements of an argument read their keys, also when the body does not read the parameter (V-081).\n return { s: [...s, ...body.s], v: { ...body.v, deps: new Set([...deps, ...body.v.deps]) } };\n }\n\n /** This method runs `f` outside the second print of a fast sum: a function and a node of the memo print as before. */\n #unpacked<T>(f: () => T): T {\n const pack = this.#pack;\n this.#pack = undefined;\n try {\n return f();\n } finally {\n this.#pack = pack;\n }\n }\n\n /**\n * This method prints a bound function for one signature of its arguments, as one JavaScript function. Its parameters\n * are the arguments, then the focus and the origin, if the body reads them. A function that reads a name of the place\n * of its binding is at that place. Each other function is at the start of a run, so a constant of the run can call it.\n */\n #printFn(bound: BoundFn, args: readonly Arg[], sig: string): Spec {\n // The markers are far from the levels of the axes and of the loops, so they do not meet them. They only need to be\n // distinct.\n // Stryker disable next-line ArithmeticOperator,UpdateOperator: see the comment above\n const origin = 2_000_000 + 1000 * this.#printed++;\n const focus = origin + 1;\n const param = -origin;\n const names = args.map(() => this.fresh(\"p\"));\n const k = this.fresh(\"k\");\n const o = this.fresh(\"o\");\n const env = new Map(bound.ctx.env);\n // A parameter hides a function of its name, because a read looks at the values first.\n bound.fn.params.forEach((p, i) => env.set(p, { code: names[i] as string, kind: (args[i] as Arg).kind, lazy: true, deps: new Set([param]), list: this.#paramList((args[i] as Arg).list, this.#fuse) }));\n const scope: CallScope = { param, focus, repeats: nestsLoops(bound.fn.body), names: new Set(names), decls: [], root: bound.fn.body };\n this.#scopes.push(scope);\n // The value of a call can be a list, as the value of a let can (COMPILE.MODULE.LIST.CALL). The call is at a place\n // that takes a list, or it gives the reason.\n this.#wantList.add(bound.fn.body);\n const body = this.expr(bound.fn.body, { origin: o, focus: k, level: focus, originLevel: origin, env, fns: bound.ctx.fns, keys: new Map(), columns: new Map() });\n this.#scopes.pop();\n const markers = new Set([origin, focus, param]);\n const global = [...body.v.deps].every((d) => markers.has(d));\n const name = this.fresh(\"fn\");\n if (hasLoop(bound.fn.body) || this.#defers(body)) this.#deferred.add(name);\n // A parameter is here only if the body reads it, so the text of a call reads only the levels of its deps (V-085).\n const position = [...(body.v.deps.has(focus) ? [k] : []), ...(body.v.deps.has(origin) ? [o] : [])];\n const head = `const ${name} = (${[...names, ...position].join(\", \")}) =>`;\n // The columns of the call come first. Each one reads a binding of the root only after the binding has its value.\n const s = [...scope.decls, ...body.s];\n const decl = s.length === 0 ? [`${head} ${body.v.code};`] : [`${head} {`, ...ind(s), ` return ${body.v.code};`, \"};\"];\n (global ? this.run : bound.decls).push(...decl);\n this.#specCode.set(name, decl.join(\"\\n\"));\n if (!global) bound.local = true;\n const spec: Spec = { name, kind: body.v.kind, list: body.v.list, safe: body.v.safe, deps: body.v.deps, origin, focus, param, global };\n bound.specs.set(sig, spec);\n return spec;\n }\n\n /**\n * This method gives the facts of the list of a parameter. Only the fact clean of the list itself stays, and only with\n * `clean`. The fact clean of the items of a list of lists makes more functions, so it does not stay. `fresh` does not\n * hold for a parameter, because the caller holds its argument.\n */\n #paramList(l: ListInfo | undefined, clean: boolean): ListInfo | undefined {\n const plain = plainList(l);\n return plain !== undefined && clean && l?.clean === true ? { ...plain, clean: true } : plain;\n }\n\n /** This method gives the signature of the arguments of a call: the kind of each one, with the facts of each list. */\n #signature(args: readonly Arg[], clean: boolean): string {\n return JSON.stringify(args.map((a) => (a.list === undefined ? (a.kind ?? null) : { list: this.#paramList(a.list, clean) })));\n }\n\n #boolean(v: Value): string {\n return v.kind === \"boolean\" ? v.code : `${this.use(\"B\")}(${v.code})`;\n }\n\n /** A condition is safe when it is a safe boolean. */\n #safeBoolean(v: Value): boolean {\n return v.safe && v.kind === \"boolean\";\n }\n\n #app(e: ExprOf<\"app\">, ctx: Ctx): Code {\n const { op, args } = e;\n // A branch of if and of ifError is at a place that takes a list when the node is.\n if ((op === \"if\" || op === \"ifError\") && this.#wantList.has(e)) for (const x of args.slice(op === \"if\" ? 1 : 0)) this.#wantList.add(x);\n if (op === \"if\") return this.#if(args, ctx);\n if (op === \"and\" || op === \"or\") return this.#andOr(op === \"and\", args, ctx);\n if (op === \"ifError\") return this.#ifError(args, ctx);\n const [head] = args;\n const rest = args.slice(1);\n // An each whose body is a list gives a list of lists (LIST.FLAT), so a list op over it goes over its array.\n if (FOLD_OPS.has(op) && head?.tag === \"each\" && !this.#bodyList(head, ctx)) return this.#list(op, head, rest, ctx);\n // A list op over a let with only literal options is the list op over the body of the let, so an each in the body\n // is one loop with a running value, not an array. A builder sheet prints such a let, for example `sum(let($0 = 0, each(…)))`.\n if (FOLD_OPS.has(op) && head?.tag === \"let\" && rest.every((x) => x.tag === \"lit\")) {\n // The list op over the body is a new node, and an item of a list can be a list. `expr` still examines the place of this op.\n this.#wantList.add(head);\n return this.#let(head, ctx, (body) => app(op, body, ...rest));\n }\n // sortBy and take are list ops for each receiver. Each other list op needs a list, and a domain can have its name.\n if (head !== undefined && (op === \"sortBy\" || op === \"take\" || (op === \"drop\" && this.#isList(head, ctx)))) return this.#order(op, head, rest, ctx);\n if (head !== undefined && op === \"setNth\" && this.#isList(head, ctx)) return this.#setNth(head, rest, ctx);\n // With fuse, flat over an each is one loop with one output (COMPILE.MODULE.FUSE).\n const strict = op === \"flat\" && head?.tag === \"each\" ? this.#fusedStrict(head, rest, ctx) : undefined;\n if (strict !== undefined) return this.#flatEach(head as ExprOf<\"each\">, strict, ctx, this.#keepOwner(e));\n // With fuse, a chain of append with a part that pushes its items is one output (COMPILE.MODULE.FUSE).\n const joined = op === \"append\" ? this.#appendStrict(e, ctx) : undefined;\n if (joined !== undefined && args.slice(0, 2).some((x) => this.#pushes(x, ctx))) return this.#appendChain(e, joined, ctx);\n if (head !== undefined && BUILD_OPS.has(op) && this.#isList(head, ctx)) return this.#build(op, head, rest, ctx, this.#own.get(e));\n if (head !== undefined && (FOLD_OPS.has(op) || op === \"nth\") && this.#isList(head, ctx)) return this.#overList(op, head, rest, ctx);\n // An argument can be a list (COMPILE.MODULE.LIST.ARG).\n for (const x of args) this.#wantList.add(x);\n const raw = args.map((x) => this.expr(x, ctx));\n const deps = depsOf(...raw);\n // The interpreter evaluates each argument, also after an error.\n const values = this.#inOrder(this.#settle(raw, deps, args), true);\n if (op === \"fill\" && this.#facts.own(op)) return this.#fill(e, values, deps);\n return this.#opCall(op, values, deps);\n }\n\n /**\n * This method prints `fill(n, value)` without a domain with the op (LIST.FILL, COMPILE.MODULE.FILL). The helper `FI`\n * gets each value, so an error of an argument after the value is the error of the op. The keys are not the positions\n * of records, so the axis `list` over the list cannot read a record at its keys.\n */\n #fill(e: ExprOf<\"app\">, values: readonly Code[], deps: ReadonlySet<number>): Code {\n const value = values[1]?.v;\n // FI gives a new array of checked values, so the list is clean and fresh.\n const list: ListInfo = { item: value?.kind, inner: heldList(value?.list), texts: true, clean: true, fresh: true };\n if (this.#fillsNothing(e, values[1])) {\n // The helper stays in the names of the module, so the option `name` has the same refusal. The last pass removes it.\n this.use(\"FI\");\n return { s: [], v: { code: \"[]\", kind: undefined, safe: true, deps, list } };\n }\n // The one item of an append of an owner has the key 0, as FI gives it (COMPILE.MODULE.FUSE.ADOPT). The append uses FI\n // only when it does not push the item.\n const one = this.#ones.has(e) && values.length === 2 && isOne(e.args[0]);\n const v: Value = { code: `${one ? \"FI\" : this.use(\"FI\")}(${values.map((x) => x.v.code).join(\", \")})`, kind: undefined, safe: false, deps, list };\n if (one) this.#ones.set(e, { v, item: `[0, ${(value as Value).code}]` });\n return { s: stmtsOf(...values), v };\n }\n\n /**\n * This method tells if `fill` gives no items and cannot fail, so `[]` is its code (COMPILE.MODULE.SIZE.FILL). The count\n * must be the literal 0. The code of the value cannot throw, or the value reads nothing of a run and the interpreter\n * gives the empty list. A value that fails keeps FI, so the list keeps its error. The option `fuse` must be true.\n */\n #fillsNothing(e: ExprOf<\"app\">, value: Code | undefined): boolean {\n const [count, x] = e.args;\n if (!this.#fuse || value === undefined || x === undefined || e.args.length !== 2 || count?.tag !== \"lit\" || count.value !== 0) return false;\n if (value.s.length === 0 && value.v.safe) return true;\n if (!isClosed(x)) return false;\n const r = evaluate(e, { space: ONE_RECORD, origin: \"0\", domains: this.#domains });\n return r.ok && isVexList(r.value) && r.value.items.length === 0;\n }\n\n /**\n * This method gives the range of a list that a loop or `count` reads, or undefined (COMPILE.MODULE.FILL.RANGE). The\n * list is `fill(n, v)` or `take(range, k)`, with no other argument. The option `fuse` must be true, and no domain can\n * have the op `fill`. Each other list keeps its array. So does a key of a node of the memo, which has a name.\n */\n #range(e: Expr, ctx: Ctx): Range | undefined {\n if (!this.#fuse || e.tag !== \"app\" || e.args.length !== 2 || !this.#facts.own(\"fill\") || ctx.keys.has(e)) return undefined;\n const [head, second] = e.args as readonly [Expr, Expr];\n if (e.op === \"take\") {\n const range = this.#range(head, ctx);\n if (range === undefined) return undefined;\n // TK checks its count after its list, so an error of the range comes first. A count that is a constant of the run\n // evaluates once, as in TK.\n const [n, k] = this.#inOrder([{ s: [], v: range.count }, this.#hoist(this.expr(second, ctx), hasLoop(second))], true) as readonly [Code, Code];\n const count: Value = { code: `${this.use(\"TN\")}(${n.v.code}, ${k.v.code})`, kind: \"number\", safe: false, deps: depsOf(n, k) };\n return { s: [...range.s, ...stmtsOf(n, k)], count, item: range.item, info: range.info };\n }\n const size = literalOf(head);\n // The empty fill has its own code (COMPILE.MODULE.SIZE.FILL).\n if (e.op !== \"fill\" || size === 0) return undefined;\n for (const x of e.args) this.#wantList.add(x);\n // The interpreter evaluates each argument, also after an error, as for FI. A loop at each key reads the range again,\n // so each argument that is a constant of the run evaluates once, before the loop over the keys.\n const raw = e.args.map((x) => this.#hoist(this.expr(x, ctx), hasLoop(x)));\n const deps = depsOf(...raw);\n const [n, v] = this.#inOrder(raw, true) as readonly [Code, Code];\n const s = stmtsOf(n, v);\n const info: ListInfo = { item: v.v.kind, inner: heldList(v.v.list), texts: true, clean: true, fresh: false };\n // Each item reads the value. Thus a value that is not a literal evaluates once, before the loop.\n const plain = PLAIN_LITERALS.has(typeof literalOf(second));\n const item = plain ? v.v.code : this.fresh(\"b\");\n // A literal count that FI takes needs no check, when the value cannot fail.\n if (Number.isSafeInteger(size) && (size as number) >= 1 && (size as number) <= 100000 && v.v.safe) {\n if (!plain) s.push(`const ${item} = ${v.v.code};`);\n return { s, count: { code: String(size), kind: \"number\", safe: true, deps, plain: true }, item, info };\n }\n // The count evaluates before the value, as in FI.\n const number = plain ? n.v.code : this.fresh(\"b\");\n if (!plain) s.push(`const ${number} = ${n.v.code};`, `const ${item} = ${v.v.code};`);\n return { s, count: { code: `${this.use(\"FN\")}(${number}, ${item})`, kind: \"number\", safe: false, deps }, item, info };\n }\n\n /**\n * This method gives the code of a value outside the list ops: a list is a `vex.list`, as in the interpreter\n * (COMPILE.MODULE.LIST.ARG, COMPILE.MODULE.LIST.FIELD). An error item has the error `VEX_ERROR`.\n */\n #plain(v: Value): string {\n return v.list === undefined ? v.code : this.envelope(v, \"LV\");\n }\n\n /** This method gives the samples of a list of the facts `l`: no items, items with values, and an error item. */\n #listSamples(l: ListInfo): readonly unknown[] {\n const values = l.inner !== undefined ? [vexList([])] : l.item === undefined ? SAMPLES.number : this.#samples(l.item);\n const items = values.map((value, i) => ({ key: String(i), result: { ok: true as const, value } }));\n // An error item of a module has the error VEX_ERROR, which is not an error value of the interpreter.\n return [vexList([]), vexList(items), vexList([{ key: \"0\", result: { ok: false, error: { vexError: true } as never } }])];\n }\n\n /**\n * This method gives the code of a number that an op lifts: the call of a copy of `fromScalar` of the domain (KIND.LIFT).\n * The op checks its result, as in the interpreter, so a lift that gives a value that is not valid needs no check here.\n */\n #lifted(x: Code, domain: number, d: AnyDomain): Code {\n const name = `lift_${domain}`;\n this.#copy(name, copied(d.fromScalar as (...a: never[]) => unknown, [SAMPLES.number], `the lift of the domain ${d.name}`));\n return { s: x.s, v: { ...x.v, code: `${name}(${x.v.code})`, kind: kindOfDomain(d), safe: false, plain: false } };\n }\n\n /** This method prints the call of the op of a domain on some values, from the static site of their kinds. */\n #opCall(op: string, given: readonly Code[], deps: ReadonlySet<number>): Code {\n const lists = new Set(given.flatMap((x, i) => (x.v.list === undefined ? [] : [i])));\n // A list op of the interpreter that a module does not have, and an op of a domain, cannot take a list as the receiver.\n if (lists.has(0)) throw new NotStandalone(isListOp(op) ? `the list op \"${op}\"` : `a list as the receiver of the op \"${op}\"`);\n const site = this.#facts.staticSite(op, given.map((x) => x.v.kind), lists, true);\n if (site?.t !== \"fn\") throw new NotStandalone(`the kinds of the values of \"${op}\" do not decide its op`);\n // LI gives a new array, and its keys are texts (COMPILE.MODULE.LIST.OP).\n const list: ListInfo | undefined = site.item === undefined ? undefined : { item: site.item, texts: true, fresh: true };\n if (site.bad) return { s: stmtsOf(...given), v: { code: `${this.use(\"F\")}()`, kind: site.returns, safe: false, deps, list } };\n if (site.returns === undefined && list === undefined) throw new NotStandalone(`the op \"${op}\" does not declare the kind of its result`);\n const d = this.#domains[site.domain] as AnyDomain;\n const lifted = site.lifted ?? [];\n const values = given.map((x, i) => (lifted.includes(i - 1) ? this.#lifted(x, site.domain, d) : x));\n const name = `op_${site.domain}_${this.#opIndex(op)}`;\n // Stryker disable next-line ConditionalExpression: the form of an op is always the same, so the map only saves time\n if (!this.#forms.has(name)) {\n // A static site of a domain has the function of the op of that domain.\n const fn = (d.ops[op] as { fn: (...a: never[]) => unknown }).fn;\n const kinds = values.map((x) => x.v.kind).filter((k): k is Kind => k !== undefined);\n const each = values.flatMap((x) => (x.v.list !== undefined ? [this.#listSamples(x.v.list)] : x.v.kind === undefined ? [] : [this.#samples(x.v.kind)]));\n const src = copied(fn, each, `the op \"${op}\" of the domain ${d.name}`);\n // An inline form cannot throw for primitive values only.\n this.#forms.set(name, lists.size === 0 && kinds.every((k) => primitiveOf(k) !== undefined) ? inlineForm(src) : undefined);\n if (site.returns !== undefined && !givesValue(src) && this.#missesNoValue(site.returns)) this.#unproved.add(name);\n this.#copy(name, src);\n }\n // The result is a `vex.list`. Its array of pairs comes from the helper of a list of the input, so a result that is not\n // a list of the declared kind is an error (COMPILE.MODULE.LIST.OP).\n if (list !== undefined) {\n this.#called.add(name);\n this.opList = true;\n const read = `${this.use(\"LI\")}(${name}(${values.map((x) => this.#plain(x.v)).join(\", \")}), 0, ${this.test(list.item as Kind)})`;\n return { s: stmtsOf(...values), v: { code: `(${read} ?? ${this.use(\"F\")}())`, kind: undefined, safe: false, deps, list } };\n }\n const form = this.#forms.get(name);\n // An inline form takes each argument once, or a plain argument more often, so each argument evaluates once.\n const inline = form !== undefined && lists.size === 0 && form.params.length === values.length && values.every((x, i) => form.uses[i] === 1 || (x.v.plain === true && x.v.safe && (form.uses[i] as number) > 0));\n if (inline) {\n const text = form.parts.map((x) => (typeof x === \"number\" ? `(${(values[x] as Code).v.code})` : x)).join(\"\");\n const checked = this.check(site.returns as Kind);\n const value = this.#value(name, text);\n const code = checked === undefined ? `(${value})` : `${checked}(${value})`;\n return { s: stmtsOf(...values), v: { code, kind: site.returns, safe: checked === undefined && value === text && values.every((x) => x.v.safe), deps } };\n }\n this.#called.add(name);\n // An exception of the op is an error of Vex: the boundary around the op catches it.\n const code = this.#checked(site.returns as Kind, this.#value(name, `${name}(${values.map((x) => this.#plain(x.v)).join(\", \")})`));\n return { s: stmtsOf(...values), v: { code, kind: site.returns, safe: false, deps } };\n }\n\n /** The condition must be a boolean. Only the branch that the condition selects is evaluated. */\n #if(args: readonly Expr[], ctx: Ctx): Code {\n if (args.length !== 3) throw new NotStandalone(\"an if without three arguments\");\n const [c, a, b] = args as [Expr, Expr, Expr];\n const raw = [this.expr(c, ctx), this.expr(a, ctx), this.expr(b, ctx)];\n const deps = depsOf(...raw);\n const [cond, yes, no] = this.#settle(raw, deps, [c, a, b]) as [Code, Code, Code];\n const v = { kind: join(yes.v.kind, no.v.kind), safe: this.#safeBoolean(cond.v) && yes.v.safe && no.v.safe, deps, list: branchLists(\"if\", yes.v.list, no.v.list) };\n if (yes.s.length === 0 && no.s.length === 0) return { s: cond.s, v: { ...v, code: `(${this.#boolean(cond.v)} ? ${yes.v.code} : ${no.v.code})` } };\n const t = this.fresh(\"t\");\n const s = [...cond.s, `let ${t};`, `if (${this.#boolean(cond.v)}) {`, ...ind(yes.s), ` ${t} = ${yes.v.code};`, \"} else {\", ...ind(no.s), ` ${t} = ${no.v.code};`, \"}\"];\n return { s, v: { ...v, code: t } };\n }\n\n /** `and` stops at the first `false`, and `or` at the first `true`. Each argument before the stop must be a boolean. */\n #andOr(and: boolean, args: readonly Expr[], ctx: Ctx): Code {\n if (args.length === 0) throw new NotStandalone(`an ${and ? \"and\" : \"or\"} without arguments`);\n const raw = args.map((x) => this.expr(x, ctx));\n const deps = depsOf(...raw);\n const parts = this.#settle(raw, deps, args);\n const v = { kind: \"boolean\" as const, safe: parts.every((x) => this.#safeBoolean(x.v)), deps };\n const [first, ...rest] = parts as [Code, ...Code[]];\n if (rest.every((x) => x.s.length === 0)) return { s: first.s, v: { ...v, code: `(${parts.map((x) => this.#boolean(x.v)).join(and ? \" && \" : \" || \")})` } };\n const t = this.fresh(\"t\");\n const s = [...first.s, `let ${t} = ${this.#boolean(first.v)};`];\n for (const x of rest) s.push(`if (${and ? \"\" : \"!\"}${t}) {`, ...ind(x.s), ` ${t} = ${this.#boolean(x.v)};`, \"}\");\n return { s, v: { ...v, code: t } };\n }\n\n /** The value of the first argument, or else the value of the second argument. */\n #ifError(args: readonly Expr[], ctx: Ctx): Code {\n if (args.length !== 2) throw new NotStandalone(\"an ifError without two arguments\");\n const [a, b] = args as [Expr, Expr];\n const raw = [this.expr(a, ctx), this.expr(b, ctx)];\n const deps = depsOf(...raw);\n const [first, second] = this.#settle(raw, deps, [a, b]) as [Code, Code];\n if (first.v.safe) return first;\n const t = this.fresh(\"t\");\n const s = [`let ${t};`, \"try {\", ...ind(first.s), ` ${t} = ${first.v.code};`, \"} catch {\", ...ind(second.s), ` ${t} = ${second.v.code};`, \"}\"];\n return { s, v: { code: t, kind: join(first.v.kind, second.v.kind), safe: second.v.safe, deps, list: branchLists(\"ifError\", first.v.list, second.v.list) } };\n }\n\n #opIndex(op: string): number {\n let i = this.#ops.get(op);\n if (i === undefined) {\n i = this.#ops.size;\n this.#ops.set(op, i);\n }\n return i;\n }\n\n /**\n * This method gives the option strict of a list op. The options must be one literal with only strict. Only a literal\n * has a value, so another expression gives the reason too.\n */\n #strict(op: string, rest: readonly Expr[], names: readonly string[] = [\"strict\"]): boolean {\n const [options, ...more] = rest;\n if (more.length > 0) throw new NotStandalone(`\"${op}\" with more than one option`);\n if (options === undefined) return false;\n const opts = (options as { readonly value?: unknown }).value;\n if (typeof opts !== \"object\" || opts === null || Object.keys(opts).some((k) => !names.includes(k))) throw new NotStandalone(`the options of \"${op}\" are not a literal with ${names.join(\" or \")}`);\n return (opts as { readonly strict?: unknown }).strict === true;\n }\n\n /**\n * This method gives the option strict of a list op. For `reduce`, it also gives the op of each step: the first\n * argument, a literal text, and the value of the option `domain` (COMPILE.MODULE.REDUCE).\n */\n #foldOptions(op: string, rest: readonly Expr[]): { readonly strict: boolean; readonly step: Step | undefined } {\n if (op !== \"reduce\") return { strict: this.#strict(op, rest), step: undefined };\n const [name, ...options] = rest;\n const value = (name as { readonly value?: unknown } | undefined)?.value;\n if (name?.tag !== \"lit\" || typeof value !== \"string\") throw new NotStandalone('\"reduce\" without a literal text as its op');\n const strict = this.#strict(op, options, [\"strict\", \"domain\"]);\n return { strict, step: { op: value, domain: (options[0] as { readonly value?: { readonly domain?: unknown } } | undefined)?.value?.domain } };\n }\n\n /**\n * A list op over an axis: one `for` loop with a running value. An item with an error is skipped, and with `strict` it\n * is an error of the list op. A value of the wrong kind is an error of the list op, as in the interpreter.\n */\n /**\n * This method prints a fixed point (COMPILE.FIX.MODULE). The column is an array with the value of each position. The\n * rows of `init` give its first values, and each round makes the array of the next values. A round without a change\n * ends the loop with the old array (FIX.ROUNDS). The last round that still changes a row throws (FIX.LIMIT). Each\n * error of a module is one sentinel, so the first row that fails can stop the column. A column that reads no key is\n * a constant of the run. It evaluates on its first read, as a branch of the interpreter does.\n */\n #fix(e: ExprOf<\"fix\">, ctx: Ctx): Code {\n const kind = joinKind(e.join);\n const old = this.fresh(\"fx\");\n const next = this.fresh(\"fx\");\n const changed = this.fresh(\"ch\");\n const round = this.fresh(\"k\");\n const first = this.#rows(e, e.init, ctx, (x, j) => [`${old}[${j}] = ${x};`]);\n const step = this.#rows(e, e.step, { ...ctx, columns: new Map([...ctx.columns, [e.name, { code: old, kind }]]) }, (x, j) => {\n const y = this.fresh(\"y\");\n const read = `${old}[${j}]`;\n const joined = e.join === \"or\" ? `${read} || ${x}` : e.join === \"and\" ? `${read} && ${x}` : `Math.${e.join}(${read}, ${x})`;\n return [`const ${y} = ${joined};`, `if (${y} !== ${read}) ${changed} = true;`, `${next}[${j}] = ${y};`];\n });\n const s = [\n `let ${old} = [];`,\n ...first.s,\n `for (let ${round} = 0; ; ${round}++) {`,\n ` if (${round} === Math.min(n + 1, ${MAX_ITERATIONS})) ${this.use(\"F\")}();`,\n ` const ${next} = [];`,\n ` let ${changed} = false;`,\n ...ind(step.s),\n ` if (!${changed}) break;`,\n ` ${old} = ${next};`,\n \"}\",\n ];\n const held = this.#hoist({ s, v: { code: old, kind: undefined, safe: false, deps: new Set([...first.deps, ...step.deps]) } }, true);\n return { s: held.s, v: { code: `${held.v.code}[${ctx.focus as string}]`, kind, safe: false, deps: new Set([...held.v.deps, ctx.level]) } };\n }\n\n /**\n * This method prints the loop over the rows of a column: the evaluation of `x` and the check of its kind (FIX.KIND).\n * `store` gives the statements of a good value. A search of a sheet must see each read of a cell, so a row that reads\n * a cell does not stop the loop (FIX.ERROR). A flag holds the failure until the end of the loop.\n */\n #rows(e: ExprOf<\"fix\">, x: Expr, ctx: Ctx, store: (value: string, row: string) => readonly string[]): { readonly s: readonly string[]; readonly deps: ReadonlySet<number> } {\n const { j, head, inner } = this.#targetLoop({ t: \"all\" }, [], ctx);\n // A list has the wrong kind for a column, and the check of the row gives the failure (FIX.KIND).\n this.#wantList.add(x);\n const c = this.#hoist(this.expr(x, inner), hasLoop(x));\n const v = this.fresh(\"x\");\n const F = this.use(\"F\");\n const boolean = joinKind(e.join) === \"boolean\";\n const row = [...c.s, `const ${v} = ${boolean ? this.#boolean(c.v) : c.v.code};`, ...(boolean ? [] : [`if (!Number.isFinite(${v})) ${F}();`]), ...store(v, j)];\n const deps = new Set([...c.v.deps].filter((d) => d !== inner.level && d !== ROUNDS));\n if (!c.v.deps.has(CELLS)) return { s: [head, ...ind(row), \"}\"], deps };\n const failed = this.fresh(\"f\");\n return { s: [`let ${failed} = false;`, head, ...ind([\"try {\", ...ind(row), \"} catch {\", ` ${failed} = true;`, \"}\"]), \"}\", `if (${failed}) ${F}();`], deps };\n }\n\n /**\n * This method gives the loop over the targets of an axis: the statements before it, its bounds and the key that it\n * skips. `start` has the levels of the address, and `inner` is the position at a target. The axes all, others,\n * window and list have a loop. In a tree space, the axes of a tree have a loop too. With `as`, a loop over the axis\n * list binds the value and the index of each item after its check (COMPILE.MODULE.LIST.ITEM).\n */\n #targetLoop(axis: Axis, at: readonly Move[], ctx: Ctx, as?: ItemNames): {\n readonly s: string[];\n readonly j: string;\n /** The head of the loop, and the statements at the start of each item before the try and inside it. */\n readonly head: string;\n /** The parts of the head. An early exit (COMPILE.MODULE.EXIT) goes on from the next target with them. */\n readonly parts: ForParts;\n readonly key: readonly string[];\n readonly check: readonly string[];\n readonly skip: string | undefined;\n readonly fixed: boolean;\n readonly start: ReadonlySet<number>;\n /** True when the statements before the loop cannot throw. */\n readonly startSafe: boolean;\n /** True when the statements of `check` cannot throw: no item is an error item (COMPILE.MODULE.FUSE.CLEAN). */\n readonly checkSafe: boolean;\n readonly tests: readonly Expr[];\n readonly inner: Ctx;\n /** True when a target can be a key that is not the position of a record: a key of a literal or of `fill`. */\n readonly texts: boolean;\n /** The names `as` of the items, and their level. Only the body of an each and the steps of a fold read them. */\n readonly items: ReadonlyMap<string, Name>;\n readonly item: number | undefined;\n /** The array of a loop over the array of a list, and the pair of the item in it (COMPILE.MODULE.APPEND.KEEP). */\n readonly array?: { readonly a: string; readonly pair: string };\n } {\n const { base: outer, tests } = testsOf(axis);\n // The reverse order of an axis is a loop from its end (AXIS.REVERSE). The validation keeps a base axis inside.\n const reverse = outer.t === \"reverse\";\n const base = outer.t === \"reverse\" ? outer.axis : outer;\n const j = this.fresh(\"j\");\n const inner: Ctx = { ...ctx, focus: j, level: ctx.level + 1 };\n // The axis list goes over the array of its list (AXIS.LIST). The list evaluates at the node, before the loop, and an\n // error item is an item that fails.\n if (base.t === \"list\") {\n if (at.length > 0) throw new NotStandalone('the axis \"list\" with an address');\n // A range of fill is a loop over its count, with no array (COMPILE.MODULE.FILL.RANGE). The key is the position.\n const range = this.#range(base.list, ctx);\n if (range !== undefined) {\n const a = this.fresh(\"A\");\n const q = this.fresh(\"q\");\n const parts = forParts(q, \"0\", a, reverse);\n const s = [...range.s, `const ${a} = ${range.count.code};`];\n const named = as === undefined ? undefined : this.#itemNames(as, range.info, range.item, () => a, reverse);\n if (named !== undefined) s.push(...named.s);\n return { s, j, head: forHead(q, parts), parts, key: [`const ${j} = ${q};`], check: [...(named?.check ?? [])], checkSafe: true, skip: undefined, fixed: false, start: range.count.deps, startSafe: range.count.safe, tests, inner, texts: true, items: named?.items ?? NO_NAMES, item: named?.level };\n }\n const list = this.#hoist(this.#listOf(base.list, ctx), hasLoop(base.list));\n // A key of a literal or of fill is not the position of a record. Such a focus is a key of a list of the code only.\n const texts = (list.v.list as ListInfo).texts === true;\n const a = this.fresh(\"A\");\n const q = this.fresh(\"q\");\n const parts = forParts(q, \"0\", `${a}.length`, reverse);\n const head = forHead(q, parts);\n // The pair of a keyed print holds the key of its record, and the loop reads the position of that record.\n const read = `${a}[${q}][0]`;\n const key = [`const ${j} = ${this.#pairKey(j, texts) === j ? read : `KM.get(${read})`};`];\n // The loop over a clean list has no test of the sentinel (COMPILE.MODULE.FUSE.CLEAN).\n const clean = this.#clean(list.v.list);\n const check = clean ? [] : [`if (${a}[${q}][1] === E) ${this.use(\"F\")}();`];\n const s = [...list.s, `const ${a} = ${list.v.code};`];\n // The count of a clean list is its length (COMPILE.MODULE.FUSE.CLEAN).\n const count = (): string => (clean ? `${a}.length` : `${this.use(\"CT\")}(${a}, false)`);\n const named = as === undefined ? undefined : this.#itemNames(as, list.v.list as ListInfo, `${a}[${q}][1]`, count, reverse);\n if (named !== undefined) {\n s.push(...named.s);\n check.push(...named.check);\n }\n return { s, j, head, parts, key, check, checkSafe: clean, skip: undefined, fixed: false, start: list.v.deps, startSafe: list.v.safe, tests, inner, texts, items: named?.items ?? NO_NAMES, item: named?.level, array: { a, pair: `${a}[${q}]` } };\n }\n // The focus of each other axis is the position of a record, so a loop in a second print reads the packs there too.\n this.#pack?.foci.add(j);\n const s: string[] = [];\n let lo = \"0\";\n let hi = \"n\";\n let skip: string | undefined;\n // The targets of the axis all depend on no key, but its address can fail (V-051). The other axes start at their\n // address.\n let start: ReadonlySet<number> = NO_DEPS;\n const f = base.t === \"all\" && at.length === 0 ? undefined : this.fresh(\"f\");\n if (f !== undefined) {\n const values = this.#addressValues(at, ctx);\n start = this.#addressDeps(at, ctx, values);\n const parts = this.#addressParts(at, values, start);\n s.push(...stmtsOf(...parts), `const ${f} = ${this.#address(at, ctx, parts)};`);\n }\n const startSafe = at.every((m) => m.t === \"origin\");\n if (base.t === \"window\" && (!Number.isInteger(base.from) || !Number.isInteger(base.to))) throw new NotStandalone('the axis \"window\" with a bound that is not an integer');\n // The ancestors are a walk up the parents, with no array (COMPILE.MODULE.TREE.ALLOC). The reverse order needs the array.\n if (this.#tree && base.t === \"ancestors\" && !reverse) {\n const parts = { init: `P[${f as string}]`, cond: `${j} >= 0`, next: `${j} = P[${j}]` };\n return { s, j, head: forHead(j, parts), parts, key: [], check: [], checkSafe: true, skip: undefined, fixed: false, start, startSafe, tests, inner, texts: false, items: NO_NAMES, item: undefined };\n }\n // In a tree space, the targets of a tree axis and of a window are a range of an array of positions.\n if (this.#tree && isTreeAxis(base)) {\n const range = this.#treeRange(base, f as string);\n const q = this.fresh(\"q\");\n return { s: [...s, ...range.s], j, head: forHead(q, forParts(q, range.lo, range.hi, reverse)), parts: forParts(q, range.lo, range.hi, reverse), key: [`const ${j} = ${range.a}[${q}];`], check: [], checkSafe: true, skip: range.skip, fixed: false, start, startSafe, tests, inner, texts: false, items: NO_NAMES, item: undefined };\n }\n // In a graph space, the targets of an axis of a graph are an array of positions. A graph has no offsets and no tree.\n if (this.#graph && GRAPH_AXES.has(base.t)) {\n const range = this.#graphRange(base.t, f as string);\n const q = this.fresh(\"q\");\n return { s: [...s, ...range.s], j, head: forHead(q, forParts(q, range.lo, range.hi, reverse)), parts: forParts(q, range.lo, range.hi, reverse), key: [`const ${j} = ${range.a}[${q}];`], check: [], checkSafe: true, skip: undefined, fixed: false, start, startSafe, tests, inner, texts: false, items: NO_NAMES, item: undefined };\n }\n if (this.#graph && base.t === \"window\") throw new NotStandalone('the axis \"window\" in a graph space');\n if (base.t === \"others\") skip = f;\n else if (base.t === \"window\") {\n this.#noOffset();\n const h = this.fresh(\"h\");\n lo = `Math.max(0, ${f as string} + Math.max(${base.from}, -n))`;\n s.push(`const ${h} = Math.min(n, ${f as string} + Math.min(${base.to}, n) + 1);`);\n hi = h;\n } else if (base.t !== \"all\") throw new NotStandalone(`the axis \"${base.t}\"`);\n return { s, j, head: forHead(j, forParts(j, lo, hi, reverse)), parts: forParts(j, lo, hi, reverse), key: [], check: [], checkSafe: true, skip, fixed: f === undefined, start, startSafe, tests, inner, texts: false, items: NO_NAMES, item: undefined };\n }\n\n /**\n * This method binds the names `as` of a loop over the axis list (COMPILE.MODULE.LIST.ITEM). The statements come after\n * the check of the item, so an error item fails before they bind a name (AXIS.LIST.ITEM). The first name holds the\n * value of the item, with the facts of its list. The index counts the items with a value in the order of the list, as\n * `nth` does (AXIS.LIST.INDEX). In the reverse order, it counts down from the number of these items. The names have a\n * level of their own. Thus a part that reads them stays in the loop, and a key of a literal can still be a target.\n */\n #itemNames(as: ItemNames, info: ListInfo, value: string, count: () => string, reverse: boolean): { readonly s: readonly string[]; readonly check: readonly string[]; readonly items: ReadonlyMap<string, Name>; readonly level: number } {\n // A search cannot know the items of a name that starts empty. The part gives an empty list (COMPILE.MODULE.LOOP.EMPTY).\n if (this.#starts.seek && info.empty === true) throw new NotStandalone(\"a search reads the items of an empty list\");\n // Stryker disable next-line UpdateOperator: a level of a loop is a name, so a count down gives other names, and the same code\n const level = this.#loops++;\n const deps = new Set([level]);\n const [item, index] = as;\n const y = this.fresh(\"y\");\n const items = new Map<string, Name>([[item, { code: y, kind: info.item, lazy: false, deps, list: info.inner }]]);\n const check = [`const ${y} = ${value};`];\n const s: string[] = [];\n if (index !== undefined) {\n const i = this.fresh(\"i\");\n const z = this.fresh(\"z\");\n // The check before the index throws for an error item, so the count skips it.\n const total = count();\n s.push(`let ${z} = ${reverse ? total : \"0\"};`);\n check.push(`const ${i} = ${reverse ? `--${z}` : `${z}++`};`);\n items.set(index, { code: i, kind: \"number\", lazy: false, deps });\n }\n return { s, check, items, level };\n }\n\n /**\n * This method gives a reason when a part of a loop of the axis `list` reads at a target that is not a record. The\n * interpreter reads the record of such a key, and a module has no record for it.\n */\n #readsNoTarget(texts: boolean, level: number, deps: readonly ReadonlySet<number>[]): void {\n if (texts && deps.some((d) => d.has(level))) throw new NotStandalone('the axis \"list\" reads a record at a key of a literal or of \"fill\"');\n }\n\n /**\n * This method gives the targets of an axis of a graph space at the position `f` (AXIS.GRAPH). They are the positions\n * `a[q]` for `q` from `lo` up to `hi`. The first key of the search of `reachable` is the focus, which is not a target.\n */\n #graphRange(t: string, f: string): TreeRange {\n const a = this.fresh(\"A\");\n const range = (code: string, lo = \"0\"): TreeRange => ({ s: [`const ${a} = ${code};`], a, lo, hi: `${a}.length`, skip: undefined });\n if (t === \"successors\") return range(`GO[${f}]`);\n if (t === \"predecessors\") {\n this.into = true;\n return range(`GN[${f}]`);\n }\n return range(`${this.use(\"RB\")}(GO, ${f}, n)`, \"1\");\n }\n\n /**\n * This method gives the targets of an axis of a tree space at the position `f`. They are the positions `a[q]` for `q`\n * from `lo` up to `hi`, without the key that the loop skips. The axes come from AXIS.TREE, AXIS.GRAPH and AXIS.WINDOW.\n */\n #treeRange(base: TreeAxis, f: string): TreeRange {\n const a = this.fresh(\"A\");\n const all = (code: string, lo = \"0\", skip?: string): TreeRange => ({ s: [`const ${a} = ${code};`], a, lo, hi: `${a}.length`, skip });\n switch (base.t) {\n // In a tree, the edges go from a parent to its children.\n case \"children\":\n case \"successors\":\n return all(`${this.#part(\"children\", \"H\")}[${f}]`);\n case \"siblings\":\n return all(`${this.#part(\"siblings\", \"GP\")}[${f}]`, \"0\", f);\n case \"ancestors\":\n return all(`${this.use(\"AN\")}(P, ${f})`);\n case \"predecessors\":\n return all(`(P[${f}] < 0 ? [] : [P[${f}]])`);\n case \"reachable\":\n // The first key of the search is the focus, which is not a target.\n return all(`${this.use(\"BF\")}(${this.#part(\"children\", \"H\")}, ${f})`, \"1\");\n case \"descendants\": {\n // The descendants of a key are the keys after it in the order depth first, as many as its subtree has under it.\n const h = this.fresh(\"h\");\n return { s: [`const ${a} = ${this.#part(\"order\", \"PI\")}[${f}] + 1;`, `const ${h} = ${a} + SZ[${f}] - 1;`], a: \"PO\", lo: a, hi: h, skip: undefined };\n }\n case \"window\": {\n // The offsets among the siblings, from `from` to `to`. The bounds are integers (#targetLoop).\n const { from, to } = base;\n const l = this.fresh(\"h\");\n const h = this.fresh(\"h\");\n const s = [`const ${a} = ${this.#part(\"siblings\", \"GP\")}[${f}];`, `const ${l} = Math.max(0, SI[${f}] + ${String(from)});`, `const ${h} = Math.min(${a}.length, SI[${f}] + ${String(to)} + 1);`];\n return { s, a, lo: l, hi: h, skip: undefined };\n }\n }\n }\n\n #list(op: string, target: ExprOf<\"each\">, rest: readonly Expr[], ctx: Ctx): Code {\n const { strict, step } = this.#foldOptions(op, rest);\n const at = target.at ?? [];\n const { s, j, head, key, check, checkSafe, skip, fixed, start, startSafe, tests, inner, texts, items, item: own } = this.#targetLoop(target.axis, at, ctx, target.as);\n const { level } = inner;\n // Inside the loop, a constant of the run evaluates once, before the loop over the keys of the run. The tests do not\n // see the names of the items, and the body sees them (AXIS.LIST.SCOPE).\n const testCodes = tests.map((t) => this.#hoist(this.expr(t, inner), hasLoop(t)));\n const body = this.#hoist(this.expr(target.body, { ...inner, env: withNames(inner.env, items) }), hasLoop(target.body));\n this.#readsNoTarget(texts, level, [body, ...testCodes].map((x) => x.v.deps));\n // A count of all the items, whose body cannot fail, is the count of the records. A safe body covers its statements.\n // V-063: a body that reads a cell keeps its loop. The search of the run must see each read, so a cell that reads\n // itself gives `#CYCLE!`.\n if (op === \"count\" && fixed && tests.length === 0 && body.v.safe && !body.v.deps.has(CELLS)) return bare(plainValue(\"n\", \"number\"));\n const deps = new Set([...start, ...[body, ...testCodes].flatMap((x) => [...x.v.deps])].filter((d) => d !== level && d !== own));\n const r = this.#reduction(op, body.v.kind, step);\n const { v } = r;\n s.push(r.init);\n const item = [...check, ...testCodes.flatMap((t) => [...t.s, `if (!${this.#boolean(t.v)}) continue;`]), ...body.s];\n // An item whose tests and body cannot fail needs no try.\n const safeItem = checkSafe && body.v.safe && testCodes.every((t) => this.#safeBoolean(t.v));\n // The interpreter evaluates each item before the list op (COMPILE.MODULE.SHEET). When an item reads a cell, an error\n // of an item or of a step must not stop the reads of the next items. So the items go into an array first.\n if ([body, ...testCodes].some((x) => x.v.deps.has(CELLS)) && (strict || stepThrows(op, body.v.kind))) {\n const list = this.fresh(\"L\");\n const x = this.fresh(\"x\");\n const all = [...key, ...(skip === undefined ? [] : [`if (${j} === ${skip}) continue;`]), `let ${x};`, \"try {\", ...ind(item), ` ${x} = ${body.v.code};`, \"} catch {\", ` ${x} = E;`, \"}\", `${list}.push(${x});`];\n const reduce = [`for (const ${v} of ${list}) {`, ` if (${v} === E) ${strict ? `${this.use(\"F\")}();` : \"continue;\"}`, ` ${r.step}`, \"}\"];\n return { s: [...s, `const ${list} = [];`, head, ...ind(all), \"}\", ...reduce], v: { code: r.result, kind: r.kind, safe: false, deps } };\n }\n // A sum over all the records whose term reads columns of the run can read their packs (`#packed`).\n const packed = fixed && tests.length === 0 && testsOf(target.axis).base.t === \"all\" ? this.#packed(op, step, strict, target, inner, body, r) : undefined;\n if (packed !== undefined) return { s: [...s, ...packed], v: { code: r.result, kind: r.kind, safe: false, deps } };\n const loop = [\n ...key,\n ...(skip === undefined ? [] : [`if (${j} === ${skip}) continue;`]),\n ...(safeItem\n ? [...item, `const ${v} = ${body.v.code};`]\n : [`let ${v};`, \"try {\", ...ind(item), ` ${v} = ${body.v.code};`, \"} catch {\", strict ? ` ${this.use(\"F\")}();` : \" continue;\", \"}\"]),\n r.step,\n ];\n s.push(head, ...ind(loop), \"}\");\n // A count without strict, and any, all and none over booleans without strict, cannot fail. The address of the axis\n // can fail, except at the focus or at the origin.\n const safe = startSafe && !strict && (op === \"count\" || (BOOLEAN_LIST_OPS.has(op) && body.v.kind === \"boolean\"));\n return { s, v: { code: r.result, kind: r.kind, safe, deps } };\n }\n\n /**\n * This method gives the fast loop of a sum, a mean, a min or a max over all the records, or undefined. The term must\n * be a number that reads values of the record only through columns of the run. It must have no loop, no cell and no\n * function of its own. Then the term prints again, with the body of each call at the place of the call (`#inline`).\n * Each read of a column at the item reads the pack of the column: an array of its values. The first sum of a run\n * makes it. The pack holds the sentinel for an error value, as the column does. Thus each read gives the value of the\n * column. One try covers all the items. An item that throws stops the inner loop, and the outer loop continues after\n * that item. The step comes after the value of the item, and it cannot throw.\n */\n #packed(op: string, step: Step | undefined, strict: boolean, target: ExprOf<\"each\">, inner: Ctx, body: Code, r: { readonly v: string; readonly step: string }): string[] | undefined {\n if (this.#pack !== undefined || !PACK_OPS.has(op) || step !== undefined || body.v.kind !== \"number\") return undefined;\n if (!this.#packable(target.body, inner.fns, new Set()) || !this.#reaches(body)) return undefined;\n const j = inner.focus as string;\n const pack: Pack = { foci: new Set([j]), calls: false, cols: new Map(), locals: new Set(), inlines: 0 };\n const scopes = this.#scopes.length;\n const outer = this.#inside;\n this.#pack = pack;\n let second: Code;\n try {\n second = this.expr(target.body, inner);\n } catch (err) {\n if (!(err instanceof NoPack || err instanceof NotStandalone)) throw err;\n this.#scopes.length = scopes;\n this.#inside = outer;\n return undefined;\n } finally {\n this.#pack = undefined;\n }\n // A part of the term that is a column reads its pack, so the packs that the code of that part read are not in the term.\n const text = [second.v.code, ...second.s].join(\"\\n\");\n const used = [...pack.cols].filter(([, local]) => text.includes(`${local}[`));\n if (used.length === 0) return undefined;\n // Each other read of the item is a value that no column holds, so the term keeps its first code.\n const rest = text.replaceAll(new RegExp(String.raw`\\b(?:${used.map(([, local]) => local).join(\"|\")})\\[${j}\\]`, \"g\"), \"\");\n if (new RegExp(String.raw`\\b${j}\\b`).test(rest)) return undefined;\n const lets = this.#packLets(used);\n const items = [...second.s, `const ${r.v} = ${second.v.code};`, r.step];\n const head = `for (let ${j} = 0; ${j} < n; ${j}++) {`;\n if (strict) return [...lets, \"try {\", ...ind([head, ...ind(items), \"}\"]), \"} catch {\", ` ${this.use(\"F\")}();`, \"}\"];\n return [...lets, head, ...ind([\"try {\", ...ind([`for (; ${j} < n; ${j}++) {`, ...ind(items), \"}\"]), \"} catch {}\"]), \"}\"];\n }\n\n /**\n * This method gives the statements that read the packs of some columns before a loop. Each pair has a column and its\n * local name. The first loop that reads a pack makes it. The variable of the pack of a column of the run is in the\n * run. The variable of the pack of a column of a call is in the function of the call.\n */\n #packLets(used: readonly (readonly [string, string])[]): string[] {\n return used.map(([col, local]) => {\n let name = this.#packs.get(col);\n if (name === undefined) {\n name = this.fresh(\"PK\");\n this.#packs.set(col, name);\n (this.#callColumns.get(col)?.scope.decls ?? this.run).push(`let ${name};`);\n }\n return `const ${local} = ${name} || (${name} = ${this.use(\"QA\")}(n, ${col}));`;\n });\n }\n\n /**\n * This method tells if the term of a fast sum can print at the place of its loop (`#packed`). It has no loop, no cell,\n * no node of the memo and no function of its own. Each function that it calls is at the start of a run, and its body\n * is such a term too. A part that is a column is one read, so the parts in it do not count.\n */\n #packable(e: Expr, fns: ReadonlyMap<string, BoundFn>, seen: Set<number>): boolean {\n if (this.#columned.has(e)) return true;\n if (e.tag === \"each\" || e.tag === \"fold\" || e.tag === \"iterate\" || e.tag === \"fix\" || e.tag === \"ext\" || this.#memo.has(e)) return false;\n if (e.tag === \"let\" && Object.values(e.bind).some((x) => x.tag === \"fn\")) return false;\n if (e.tag === \"call\") {\n const bound = fns.get(e.fn);\n if (bound === undefined || bound.local) return false;\n if (!seen.has(bound.id)) {\n seen.add(bound.id);\n if (!this.#packable(bound.fn.body, bound.ctx.fns, seen)) return false;\n }\n }\n return children(e).every((x) => this.#packable(x, fns, seen));\n }\n\n /** This method tells if code reads a column of the run, itself or in a printed function that it calls. */\n #reaches(c: Code): boolean {\n const seen = new Set<string>();\n const todo = [[c.v.code, ...c.s].join(\"\\n\")];\n for (let text = todo.pop(); text !== undefined; text = todo.pop()) {\n for (const [name] of text.matchAll(/\\b(?:col|fn)\\d+\\b/g)) {\n if (this.#runColumns.has(name)) return true;\n const code = this.#specCode.get(name);\n if (code !== undefined && !seen.has(name)) {\n seen.add(name);\n todo.push(code);\n }\n }\n }\n return false;\n }\n\n /**\n * This method gives the parts of a list op that reduces the values of its items. The parts are the variable `v` of\n * the value of an item, the first statement, the step and the result. A value of the wrong kind is an error of the op.\n */\n #reduction(op: string, kind: Kind | undefined, step?: Step): { readonly v: string; readonly init: string; readonly step: string; readonly result: string; readonly kind: Kind | undefined } {\n const a = this.fresh(\"a\");\n const n = this.fresh(\"n\");\n const v = this.fresh(\"x\");\n if (step !== undefined) return { v, init: `let ${a}, ${n} = 0;`, ...this.#reduceStep(step, kind, a, n, v) };\n const num = kind === \"number\" ? v : `${this.use(\"U\")}(${v})`;\n const bool = kind === \"boolean\" ? v : `${this.use(\"B\")}(${v})`;\n const inits: Readonly<Record<string, string>> = {\n count: `let ${n} = 0;`,\n sum: `let ${a} = 0;`,\n mean: `let ${a} = 0, ${n} = 0;`,\n any: `let ${a} = false;`,\n none: `let ${a} = false;`,\n all: `let ${a} = true;`,\n };\n const steps: Readonly<Record<string, string>> = {\n count: `${n}++;`,\n sum: `${a} += ${num};`,\n mean: `${a} += ${num}; ${n}++;`,\n min: `${a} = ${n}++ === 0 ? ${num} : Math.min(${a}, ${num});`,\n max: `${a} = ${n}++ === 0 ? ${num} : Math.max(${a}, ${num});`,\n any: `if (${bool}) ${a} = true;`,\n none: `if (${bool}) ${a} = true;`,\n all: `if (!${bool}) ${a} = false;`,\n first: `if (${n}++ === 0) ${a} = ${v};`,\n };\n const F = this.use(\"F\");\n const results: Readonly<Record<string, string>> = {\n count: n,\n sum: this.#checked(\"number\", a),\n mean: `(${n} === 0 ? ${F}() : ${this.#checked(\"number\", `${a} / ${n}`)})`,\n any: a,\n all: a,\n none: `!${a}`,\n };\n return { v, init: inits[op] ?? `let ${a}, ${n} = 0;`, step: steps[op] as string, result: results[op] ?? `(${n} === 0 ? ${F}() : ${a})`, kind: listKind(op, kind) };\n }\n\n /**\n * This method gives the step and the result of `reduce` (COMPILE.MODULE.REDUCE), as in the interpreter. The first item\n * is the first running value. Each later item goes into the op of the domain of the running value. The kinds of the\n * items decide that op, and the op must give a value of the same kind. No items give the identity of the op.\n */\n #reduceStep(step: Step, kind: Kind | undefined, a: string, n: string, v: string): { readonly step: string; readonly result: string; readonly kind: Kind | undefined } {\n const arg = (code: string): Code => bare({ code, kind, safe: true, deps: NO_DEPS, plain: true });\n const opCode = this.#opCall(step.op, [arg(a), arg(v)], NO_DEPS);\n if (opCode.v.kind !== kind) throw new NotStandalone(`the op \"${step.op}\" of \"reduce\" gives a value of the kind ${kindText(opCode.v.kind)}, not of the kind ${kindText(kind)} of the items`);\n const empty = this.#identity(step);\n // The identity of another domain is a value of another kind, so the kind of the result is not known.\n return { step: `${a} = ${n}++ === 0 ? ${v} : ${opCode.v.code};`, result: `(${n} === 0 ? ${empty.code} : ${a})`, kind: empty.kind === undefined || empty.kind === kind ? kind : undefined };\n }\n\n /**\n * This method gives the code of `reduce` over no items, as in the interpreter. The code is the identity of the op in\n * the one domain that has one, or in the domain of the option `domain`. Another case is an error. The kind is the kind\n * of the domain.\n */\n #identity(step: Step): { readonly code: string; readonly kind: Kind | undefined } {\n const { op, domain } = step;\n const fail = { code: `${this.use(\"F\")}()`, kind: undefined };\n // A name of a domain that the program does not have leaves no domain, so it gives the error too.\n const found = [...this.#domains.entries()].filter(([, d]) => Object.hasOwn(d.ops, op) && (d.ops[op] as { readonly identity?: unknown }).identity !== undefined && (domain === undefined || d.name === domain));\n const [only, second] = found;\n if (only === undefined || second !== undefined) return fail;\n const [i, d] = only;\n const name = `id_${String(i)}_${String(this.#opIndex(op))}`;\n // Stryker disable next-line ConditionalExpression: the copy of an identity is always the same, so the test only saves time\n if (!this.top.has(name)) this.#copy(name, copied((d.ops[op] as { readonly identity: () => unknown }).identity, [], `the identity of the op \"${op}\" of the domain ${d.name}`));\n return { code: `${name}()`, kind: kindOfDomain(d) };\n }\n\n /**\n * This method prints a list as an array (LIST.VALUE): a pair of the key and the value of each item. A test that\n * fails, a body that fails and an error item of the axis list give the error sentinel as the value.\n */\n #eachList(e: ExprOf<\"each\">, ctx: Ctx): Code {\n const alias = this.#sameList(e, ctx);\n if (alias !== undefined) return alias;\n const at = e.at ?? [];\n const { s, j, head, key, check, checkSafe, skip, start, startSafe, tests, inner, texts, items, item: own } = this.#targetLoop(e.axis, at, ctx, e.as);\n const testCodes = tests.map((t) => this.#hoist(this.expr(t, inner), hasLoop(t)));\n // The value of an item can be a list, for flat (LIST.FLAT). The facts of the list tell it.\n if (this.#wantList.has(e)) this.#wantList.add(e.body);\n // Only the body sees the names of the items (AXIS.LIST.SCOPE).\n const body = this.#hoist(this.expr(e.body, { ...inner, env: withNames(inner.env, items) }), hasLoop(e.body));\n this.#readsNoTarget(texts, inner.level, [body, ...testCodes].map((x) => x.v.deps));\n const deps = new Set([...start, ...[body, ...testCodes].flatMap((x) => [...x.v.deps])].filter((d) => d !== inner.level && d !== own));\n const list = this.fresh(\"L\");\n const v = this.fresh(\"x\");\n const pair = this.#pairKey(j, texts);\n const item = [...check, ...testCodes.flatMap((t) => [...t.s, `if (!${this.#boolean(t.v)}) continue;`]), ...body.s];\n const safeItem = checkSafe && body.v.safe && testCodes.every((t) => this.#safeBoolean(t.v));\n const loop = [\n ...key,\n ...(skip === undefined ? [] : [`if (${j} === ${skip}) continue;`]),\n ...(safeItem ? [...item, `${list}.push([${pair}, ${body.v.code}]);`] : [`let ${v};`, \"try {\", ...ind(item), ` ${v} = ${body.v.code};`, \"} catch {\", ` ${v} = E;`, \"}\", `${list}.push([${pair}, ${v}]);`]),\n ];\n // Only the catch of an item puts the sentinel into the list, so a safe item gives a clean list.\n const facts: ListInfo = { item: body.v.kind, inner: heldList(body.v.list), texts, clean: safeItem };\n return { s: [...s, `const ${list} = [];`, head, ...ind(loop), \"}\"], v: { code: list, kind: undefined, safe: startSafe, deps, list: facts } };\n }\n\n /**\n * This method gives the code of an each that gives its list again (COMPILE.MODULE.EACH.SAME), and undefined for each\n * other each. The axis is `list`, with no `where`, no `reverse` and no address. The body is a read of the name of the\n * item. Such an each gives the key and the value of each item, and an error item stays an error item. Thus its value\n * is the array of its list, with no copy. The option `fuse` must be true.\n *\n * The value is not fresh, because the list holds the same array. Thus no op changes the array in place: an append\n * copies it, and `sortBy` sorts a copy.\n */\n #sameList(e: ExprOf<\"each\">, ctx: Ctx): Code | undefined {\n // The check of the document refuses two names `as` that are the same name, so the body reads the value of the item.\n if (!this.#fuse || e.axis.t !== \"list\" || (e.at ?? []).length > 0 || e.body.tag !== \"var\" || e.body.name !== e.as?.[0]) return undefined;\n const list = this.#hoist(this.#listOf(e.axis.list, ctx), hasLoop(e.axis.list));\n const info = list.v.list as ListInfo;\n // A search cannot know the items of a name that starts empty, as for each other read of the items (#itemNames).\n if (this.#starts.seek && info.empty === true) throw new NotStandalone(\"a search reads the items of an empty list\");\n // The facts are the facts of the each of the loop: its items keep the facts of the items of the list. A list of\n // lists holds each list of its items, so the facts of an item are not fresh.\n const facts: ListInfo = { item: info.item, inner: info.inner, texts: info.texts === true, clean: this.#clean(info) };\n return { s: list.s, v: { ...list.v, list: facts } };\n }\n\n /**\n * This method gives the option strict of `flat` over the each `e` when the two ops fuse (COMPILE.MODULE.FUSE), and\n * undefined when they do not fuse. The option `fuse` must be true, and the body of the each must give a list. The\n * code reads a node of the memo again. It also reads a constant of the run that the module printed before. Thus these\n * nodes do not fuse. Options that are not a literal give the reason of `flat`, so they do not fuse either.\n */\n #fusedStrict(e: ExprOf<\"each\">, rest: readonly Expr[], ctx: Ctx): boolean | undefined {\n if (!this.#fuse || this.#memo.has(e) || ctx.keys.has(e) || this.#constant.has(originalOf(e)) || !this.#bodyList(e, ctx)) return undefined;\n try {\n return this.#strict(\"flat\", rest);\n } catch {\n return undefined;\n }\n }\n\n /**\n * This method prints `flat` over an each as one loop with one output array (COMPILE.MODULE.FUSE). The body pushes the\n * items of its list into the output. Thus the each has no array of its own, and `FL` and `V` do not scan a list.\n *\n * - The loop keeps the length of the output before each item. An item that fails sets the length back, so it adds no\n * item (COMPILE.MODULE.FUSE.ITEM). With `strict`, the failure is the error of `flat`.\n * - An error item of the source fails at the check of the item, as in the each without fusion.\n * - When an item reads a cell, a strict failure does not stop the loop. The search of the run must see each read, as\n * in the loop of an aggregate. Thus a flag holds the failure until the end of the loop.\n *\n * The output has only items with values, and no other part holds its array, so it is clean and fresh.\n *\n * With `owner`, the each is a filter of the list of the owner (COMPILE.MODULE.APPEND.KEEP). When the list is the array\n * `w` of the owner, that array is the output. The loop then moves each kept item down in place, and `KS` sets the\n * length. Each other list gets a new output. This output is not fresh, because the loop can hold it.\n */\n #flatEach(e: ExprOf<\"each\">, strict: boolean, ctx: Ctx, owner?: Owner): Code {\n const { s, j, head, key, check, checkSafe, skip, start, startSafe, tests, inner, texts, items, item: own, array } = this.#targetLoop(e.axis, e.at ?? [], ctx, e.as);\n const testCodes = tests.map((t) => this.#hoist(this.expr(t, inner), hasLoop(t)));\n const o = this.fresh(\"o\");\n // The axis of a filter is the axis list of the name of the owner, so the loop goes over an array.\n const place = owner !== undefined && array !== undefined ? { w: (owner.w ??= this.fresh(\"w\")), n: this.fresh(\"n\"), a: array.a } : undefined;\n if (place !== undefined) this.#sinks.set(o, { n: place.n, pair: (array as { readonly pair: string }).pair, item: e.as === undefined ? undefined : items.get(e.as[0])?.code });\n // Only the body sees the names of the items (AXIS.LIST.SCOPE).\n let body: Pushed;\n try {\n body = this.#push(e.body, { ...inner, env: withNames(inner.env, items) }, o, strict);\n } finally {\n this.#sinks.delete(o);\n }\n const parts = [body.deps, ...testCodes.map((x) => x.v.deps)];\n this.#readsNoTarget(texts, inner.level, parts);\n const deps = new Set([...start, ...parts.flatMap((d) => [...d])].filter((d) => d !== inner.level && d !== own));\n const item = [...testCodes.flatMap((t) => [...t.s, `if (!${this.#boolean(t.v)}) continue;`]), ...body.s];\n const safeItem = checkSafe && body.safe && testCodes.every((t) => this.#safeBoolean(t.v));\n // The output keeps the key of each item of the body. Thus the loop needs the key of its target only for a read at\n // the target, or for the target that the axis skips.\n const at = new RegExp(String.raw`\\b${j}\\b`);\n const skips = skip === undefined ? [] : [`if (${j} === ${skip}) continue;`];\n const lead = [...([...skips, ...item].some((x) => at.test(x)) ? key : []), ...skips];\n const flag = strict && !safeItem && parts.some((d) => d.has(CELLS)) ? this.fresh(\"f\") : undefined;\n let loop: string[];\n if (safeItem) loop = [...lead, ...check, ...item];\n else {\n // An item of a filter in place puts at most one item, at its end. Thus an item that fails puts no item.\n const m = strict || place !== undefined ? undefined : this.fresh(\"m\");\n const caught = flag !== undefined ? [`${flag} = true;`] : strict ? [`${this.use(\"F\")}();`] : m === undefined ? [] : [`${o}.length = ${m};`];\n // A check that cannot throw comes before the try.\n const [before, inside] = checkSafe ? [check, item] : [[], [...check, ...item]];\n loop = [...lead, ...before, ...(m === undefined ? [] : [`const ${m} = ${o}.length;`]), \"try {\", ...ind(inside), \"} catch {\", ...ind(caught), \"}\"];\n }\n // The output of a filter in place is the array of the list only when that array is w (COMPILE.MODULE.APPEND.KEEP).\n const first = place === undefined ? [`const ${o} = [];`] : [`const ${o} = ${place.a} === ${place.w} ? ${place.a} : [];`, `let ${place.n} = 0;`];\n const last = place === undefined ? [] : [`${this.use(\"KS\")}(${o}, ${place.n});`];\n const out = [...s, ...first, ...(flag === undefined ? [] : [`let ${flag} = false;`]), head, ...ind(loop), \"}\", ...last, ...(flag === undefined ? [] : [`if (${flag}) ${this.use(\"F\")}();`])];\n const facts: ListInfo = { ...(body.list as ListInfo), clean: true, fresh: place === undefined };\n const c: Code = { s: out, v: { code: o, kind: undefined, safe: startSafe && (safeItem || !strict), deps, list: facts } };\n // A fused loop around a filter in place cannot push into its output, because the output can be the array w.\n // Stryker disable next-line ConditionalExpression: a filter in place is a branch of a step, and no fused loop pushes it\n if (place === undefined) this.#outputs.set(c, s.length);\n return c;\n }\n\n /**\n * This method gives the owner of the filter `e` when the filter compacts the array of the owner in place\n * (COMPILE.MODULE.APPEND.KEEP). For each other node, it gives undefined. `#loopStep` finds the filter in a branch of\n * another list. Each place of the program has an object of its own (`unsharedAll`), so the node is at that branch\n * only. Each item of the body gives at most one item.\n */\n #keepOwner(e: ExprOf<\"app\">): Owner | undefined {\n const owner = this.#keeps.get(e);\n return owner !== undefined && atMostOne((e.args[0] as ExprOf<\"each\">).body, this.#facts.own(\"fill\")) ? owner : undefined;\n }\n\n /**\n * This method gives the option strict of the append `e` for a fused chain (COMPILE.MODULE.FUSE). This method gives\n * undefined when the append cannot be a part of a chain. The option `fuse` must be true, both arguments must be lists, and the options must be\n * a literal. An append into the list of its name keeps `AO` (COMPILE.MODULE.APPEND.OWN). In a sheet with a search, an\n * append that can read a cell does not fuse, because the fused chain stops at the first failure.\n */\n #appendStrict(e: ExprOf<\"app\">, ctx: Ctx): boolean | undefined {\n const [a, b] = e.args;\n if (!this.#fuse || a === undefined || b === undefined || this.#own.has(e) || !this.#isList(a, ctx) || !this.#isList(b, ctx)) return undefined;\n if (this.#sheet !== undefined && !this.#sheet.direct && readsCells(e)) return undefined;\n try {\n return this.#strict(\"append\", e.args.slice(2));\n } catch {\n return undefined;\n }\n }\n\n /** This method gives the node `e` when a fused loop can print it as a stage, and undefined when the loop reads its array. */\n #stageOf(e: Expr, ctx: Ctx): ExprOf<\"app\"> | undefined {\n return e.tag === \"app\" && !this.#memo.has(e) && !ctx.keys.has(e) && !this.#constant.has(originalOf(e)) && (this.#work(e, ctx.fns) < COLUMN_WORK || !readsFocus(e)) ? e : undefined;\n }\n\n /**\n * This method gives the option strict of the append `e` when it is a link of a fused chain, and undefined when it is\n * not. A node of the memo, a key of a column and a constant of the run keep their arrays, because other parts read them.\n */\n #link(e: Expr, ctx: Ctx): boolean | undefined {\n if (e.tag !== \"app\" || e.op !== \"append\" || this.#memo.has(e) || ctx.keys.has(e) || this.#constant.has(originalOf(e))) return undefined;\n return this.#appendStrict(e, ctx);\n }\n\n /**\n * This method tells if a part of an append pushes its items with no array of its own (COMPILE.MODULE.FUSE). These\n * parts are `fill(1, v)`, `flat` over an each that fuses, and an append or an `if` with such a part. An append of two\n * arrays keeps `concat`, because a loop that copies the items costs more. A `flat` and an append print their own\n * loops, so they need no test of a stage.\n */\n #pushes(e: Expr, ctx: Ctx): boolean {\n if (e.tag !== \"app\" || this.#memo.has(e) || ctx.keys.has(e) || this.#constant.has(originalOf(e))) return false;\n const [head, ...rest] = e.args;\n if (e.op === \"flat\") return head?.tag === \"each\" && this.#fusedStrict(head, rest, ctx) !== undefined;\n if (e.op === \"append\") return this.#link(e, ctx) !== undefined && e.args.slice(0, 2).some((x) => this.#pushes(x, ctx));\n if (this.#stageOf(e, ctx) === undefined) return false;\n if (e.op === \"fill\") return rest.length === 1 && isOne(head) && this.#facts.own(\"fill\");\n return e.op === \"if\" && rest.length === 2 && rest.every((x) => this.#isList(x, ctx)) && rest.some((x) => this.#pushes(x, ctx));\n }\n\n /**\n * This method prints a chain of append as one output array (COMPILE.MODULE.FUSE). Each part pushes its items into the\n * output, in order. A part that fails is the error of the chain, as the error of a list is the error of append. The\n * output has only items with values, and no other part holds its array, so it is clean and fresh.\n */\n #appendChain(e: ExprOf<\"app\">, strict: boolean, ctx: Ctx): Code {\n const o = this.fresh(\"o\");\n const parts = this.#pushAppend(e, strict, ctx, o);\n const c: Code = { s: [`const ${o} = [];`, ...parts.s], v: { code: o, kind: undefined, safe: parts.safe, deps: parts.deps, list: { ...(parts.list as ListInfo), clean: true, fresh: true } } };\n this.#outputs.set(c, 0);\n return c;\n }\n\n /**\n * This method prints the statements that push the items of the lists of an append into the output `o`, in order. An\n * append that is a stage gives the parts of its lists. The option `strict` of each append applies to the error items of\n * its lists (LIST.BUILD).\n *\n * Each part prints before the decision about the constants of the run. A chain that is a constant of the run keeps its\n * parts in its own code, because the module evaluates the chain once. In each other chain, and with `settle`, a part\n * that is a constant of the run evaluates once, before the loop over the keys.\n */\n #pushAppend(e: ExprOf<\"app\">, strict: boolean, ctx: Ctx, o: string, settle?: boolean): Pushed {\n const lists: { readonly e: Expr; readonly strict: boolean }[] = [];\n const walk = (x: Expr, s: boolean): void => {\n const joined = this.#link(x, ctx);\n if (joined === undefined) lists.push({ e: x, strict: s });\n else for (const y of (x as ExprOf<\"app\">).args.slice(0, 2)) walk(y, joined);\n };\n for (const x of e.args.slice(0, 2)) walk(x, strict);\n const parts = lists.map((x) => this.#pushPart(x.e, ctx, o, x.strict));\n const deps = new Set(parts.flatMap((x) => [...x.deps]));\n const now = settle ?? deps.size > 0;\n const list = parts.map((x) => x.list as ListInfo).reduce((a, b) => joinLists(a, b, \"append\"));\n return { s: parts.flatMap((x) => x.s(now)), deps, safe: parts.every((x) => x.safe), list };\n }\n\n /**\n * This method prints the statements that push the items of the list of `e` into the output `o` of a fused loop\n * (COMPILE.MODULE.FUSE). The forms of a stage are these:\n *\n * - `if` with two lists pushes the items of the branch that its condition selects.\n * - `fill(1, x)` pushes one item with the key 0, as `FI` gives it.\n * - The empty literal pushes no item.\n * - `append` pushes the items of its first list, then the items of its second list.\n *\n * Each other list prints its array, and a loop pushes its items (`#pushPart`).\n */\n #push(e: Expr, ctx: Ctx, o: string, strict: boolean): Pushed {\n const joined = this.#link(e, ctx);\n if (joined !== undefined) return this.#pushAppend(e as ExprOf<\"app\">, joined, ctx, o, true);\n const stage = this.#stageOf(e, ctx);\n if (stage?.op === \"if\" && stage.args.length === 3 && stage.args.slice(1).every((x) => this.#isList(x, ctx))) {\n const [c, a, b] = stage.args as [Expr, Expr, Expr];\n // The condition evaluates once for each run when it is a constant of the run.\n const cond = this.#hoist(this.expr(c, ctx), hasLoop(c));\n const yes = this.#push(a, ctx, o, strict);\n const no = this.#push(b, ctx, o, strict);\n // A branch that pushes nothing prints no block.\n const s = [...cond.s, `if (${this.#boolean(cond.v)}) {`, ...ind(yes.s), ...(no.s.length === 0 ? [] : [\"} else {\", ...ind(no.s)]), \"}\"];\n return { s, deps: new Set([...cond.v.deps, ...yes.deps, ...no.deps]), safe: this.#safeBoolean(cond.v) && yes.safe && no.safe, list: branchLists(\"if\", yes.list, no.list) };\n }\n const part = this.#pushPart(e, ctx, o, strict);\n return { ...part, s: part.s(true) };\n }\n\n /**\n * This method prints a part of a fused loop that is not `if` or `append`: `fill(1, x)`, the empty literal or a list.\n * The code of the part comes from `s`. With `settle`, a part that is a constant of the run evaluates once.\n *\n * A list prints its array, and a loop pushes its items. A list that is not clean can hold error items. The loop skips\n * them, and with `strict` such an item is an error.\n *\n * A node of the memo also prints its array. So does a constant of the\n * run that the module printed before, and a node that can be a column of the run. Thus the module keeps these values\n * for each read. A fused loop that the module does not keep pushes into `o` itself.\n */\n #pushPart(e: Expr, ctx: Ctx, o: string, strict: boolean): Part {\n const stage = this.#stageOf(e, ctx);\n if (stage?.op === \"fill\" && stage.args.length === 2 && isOne(stage.args[0]) && this.#facts.own(\"fill\")) {\n const x = stage.args[1] as Expr;\n // The value can be a list, so fill gives a list of lists (COMPILE.MODULE.FILL).\n this.#wantList.add(x);\n const raw = this.expr(x, ctx);\n const list: ListInfo = { item: raw.v.kind, inner: heldList(raw.v.list), texts: true };\n const s = (settle: boolean): readonly string[] => {\n const value = settle ? this.#hoist(raw, hasLoop(x)) : raw;\n return [...value.s, this.#put(o, `[0, ${value.v.code}]`, value.v)];\n };\n return { s, deps: raw.v.deps, safe: raw.v.safe, list };\n }\n if (e.tag === \"lit\" && isVexList(e.value) && e.value.items.length === 0) {\n const empty = this.#listLiteral(e.value);\n // A literal is a constant of the module, as at each other place, so its facts tell that each run reads it.\n this.#note(e, empty, true);\n return { s: () => [], deps: NO_DEPS, safe: true, list: empty.v.list };\n }\n const raw = this.#listOf(e, ctx);\n // A `fill` that gives no items pushes nothing (COMPILE.MODULE.SIZE.FILL).\n if (raw.v.code === \"[]\") return { s: () => [], deps: raw.v.deps, safe: true, list: raw.v.list };\n const clean = this.#clean(raw.v.list);\n const s = (settle: boolean): readonly string[] => {\n const c = settle ? this.#hoist(raw, hasLoop(e)) : raw;\n // The output of a fused loop has only items with values, so the loop can push into `o` in place of its own output.\n // A filter in place puts each item at its position, so it keeps the output of the part (COMPILE.MODULE.APPEND.KEEP).\n const at = this.#outputs.get(c);\n // Stryker disable next-line ConditionalExpression: atMostOne gives no fused loop in the body of a filter in place\n if (at !== undefined && !this.#sinks.has(o)) return c.s.map((x, i) => (i === at ? `const ${c.v.code} = ${o};` : x));\n const z = this.fresh(\"z\");\n const put = this.#put(o, `${z}[i]`);\n const each = clean ? put : strict ? `{ if (${z}[i][1] === E) ${this.use(\"F\")}(); ${put} }` : `if (${z}[i][1] !== E) ${put}`;\n return [...c.s, `const ${z} = ${c.v.code};`, `for (let i = 0; i < ${z}.length; i++) ${each}`];\n };\n return { s, deps: raw.v.deps, safe: raw.v.safe && (clean || !strict), list: raw.v.list };\n }\n\n /**\n * This method gives the statement that puts the pair `pair` into the output `o` of a fused loop. `value` is the value\n * of a pair of `fill`. A filter in place puts the pair at the next position of its output (COMPILE.MODULE.APPEND.KEEP).\n * There the item of the list keeps its pair when its key is 0, the key of `fill`. Each other output gets a push.\n */\n #put(o: string, pair: string, value?: { readonly code: string; readonly safe: boolean }): string {\n const sink = this.#sinks.get(o);\n if (sink === undefined) return `${o}.push(${pair});`;\n if (value !== undefined && value.code === sink.item) return `${o}[${sink.n}++] = ${sink.pair}[0] === 0 ? ${sink.pair} : ${pair};`;\n // JavaScript increments n before it gets the value of the pair. Thus a value that can fail increments n after the put.\n return value === undefined || value.safe ? `${o}[${sink.n}++] = ${pair};` : `${o}[${sink.n}] = ${pair}; ${sink.n}++;`;\n }\n\n /**\n * This method prints sortBy, take and drop (LIST.SORT, LIST.TAKE, LIST.DROP): a new array from the array of a list. An\n * error item is not in the new list, and with strict it is the error of the op.\n */\n #order(op: \"sortBy\" | \"take\" | \"drop\", head: Expr, rest: readonly Expr[], ctx: Ctx): Code {\n const list = this.#listOf(head, ctx);\n // A missing count is the literal null, which is not a whole number, so take and drop give their error.\n const exprs = [head, ...(op === \"sortBy\" ? [] : [rest[0] ?? lit(null)])];\n const options = rest.slice(exprs.length - 1);\n const strict = this.#strict(op, options, op === \"sortBy\" ? [\"strict\", \"by\"] : [\"strict\"]);\n const by = op === \"sortBy\" ? this.#sortValue(options, list.v.list as ListInfo) : undefined;\n const raw = [list, ...exprs.slice(1).map((x) => this.expr(x, ctx))];\n const deps = depsOf(...raw);\n const parts = this.#inOrder(this.#settle(raw, deps, exprs), true);\n const plain = by !== undefined ? \"SK\" : op === \"sortBy\" ? \"SB\" : op === \"take\" ? \"TK\" : \"DR\";\n // The clean form has no scan of V and no option strict (COMPILE.MODULE.FUSE.CLEAN).\n const clean = this.#clean(list.v.list);\n // sortBy is the sink of a chain: a clean list that is fresh is its own sort buffer (COMPILE.MODULE.FUSE).\n const inPlace = op === \"sortBy\" && clean && list.v.list?.fresh === true;\n const helper = inPlace ? (by === undefined ? \"SBI\" : \"SKI\") : clean ? (`${plain}C` as const) : plain;\n const args = [...parts.map((x) => x.v.code), ...(clean ? [] : [String(strict)]), ...(by === undefined ? [] : [by])];\n // The new list has some items of the list, so it keeps the facts of the list. V removes each error item. A sort in\n // place gives the array of its list, which no other part holds.\n const facts: ListInfo = { ...(list.v.list as ListInfo), clean: true, fresh: inPlace };\n return { s: stmtsOf(...parts), v: { code: `${this.use(helper)}(${args.join(\", \")})`, kind: undefined, safe: false, deps, list: facts } };\n }\n\n /**\n * This method prints `setNth` (LIST.SETNTH, COMPILE.MODULE.SETNTH): a new array with a new value at a position. An\n * error item is not in the new list, and with strict it is the error of the op. The value can be a list, as for `fill`.\n */\n #setNth(head: Expr, rest: readonly Expr[], ctx: Ctx): Code {\n const [position, value, ...options] = rest;\n // Without a position or a value the op gives an error at each run, so a module refuses the program.\n if (position === undefined || value === undefined) throw new NotStandalone('\"setNth\" without a position and a value');\n const strict = this.#strict(\"setNth\", options);\n const list = this.#listOf(head, ctx);\n this.#wantList.add(value);\n const raw = [list, this.expr(position, ctx), this.expr(value, ctx)];\n const deps = depsOf(...raw);\n const [from, at, put] = this.#inOrder(this.#settle(raw, deps, [head, position, value]), true) as [Code, Code, Code];\n const info = list.v.list as ListInfo;\n // The clean form has no scan of V and no option strict (COMPILE.MODULE.FUSE.CLEAN).\n const clean = this.#clean(info);\n const args = [from.v.code, at.v.code, put.v.code, ...(clean ? [] : [String(strict)])];\n // The items have the facts of the list and of the value. V removes each error item, and the value is not the sentinel.\n const facts: ListInfo = { ...joinLists(info, { item: put.v.kind, inner: heldList(put.v.list) }, \"setNth\"), clean: true, fresh: false };\n return { s: stmtsOf(from, at, put), v: { code: `${this.use(clean ? \"SNC\" : \"SN\")}(${args.join(\", \")})`, kind: undefined, safe: false, deps, list: facts } };\n }\n\n /**\n * This method gives the function of the option `by` of `sortBy` (COMPILE.MODULE.SORT.BY), or undefined without the\n * option. The function applies the op of the static site of the kind of the items. An empty list applies no op.\n */\n #sortValue(options: readonly Expr[], info: ListInfo): string | undefined {\n const by = (options[0] as { readonly value?: { readonly by?: unknown } } | undefined)?.value?.by;\n if (by === undefined) return undefined;\n if (typeof by !== \"string\") throw new NotStandalone('the option \"by\" of \"sortBy\" is not a literal text');\n if (info.empty === true) return undefined;\n if (info.item === undefined) throw new NotStandalone(`the kinds of the items of \"sortBy\" do not decide the op \"${by}\" of the option by`);\n const x = this.fresh(\"x\");\n const value = this.#opCall(by, [bare({ code: x, kind: info.item, safe: true, deps: NO_DEPS, plain: true })], NO_DEPS);\n return `((${x}) => ${value.v.code})`;\n }\n\n /**\n * This method prints append, without and flat (LIST.BUILD), get (LIST.GET) and indexOf (LIST.INDEXOF) over the array\n * of a list. Each list that the op reads follows LIST.LENIENT, as in the interpreter. An append with an owner appends\n * into the array of its name, if the name in the context is the name of the loop (COMPILE.MODULE.APPEND.OWN).\n */\n #build(op: string, head: Expr, rest: readonly Expr[], ctx: Ctx, owner: Owner | undefined): Code {\n const list = this.#listOf(head, ctx);\n const info = list.v.list as ListInfo;\n const two = op === \"append\" || op === \"without\";\n // A missing key of get, or value of indexOf, is the literal null. It is not a text or a value of indexOf, so the op\n // gives its error. A missing second list of append and without is not a list, so it gives a reason.\n const exprs = [head, ...(op === \"flat\" ? [] : [rest[0] ?? lit(null)])];\n const strict = this.#strict(op, rest.slice(exprs.length - 1));\n // A function of the program can share a node with the step, but its body has its own names (FN.BIND).\n const owned = owner !== undefined && ctx.env.get(owner.name) === owner.read;\n // With fuse, an append of an owner pushes the items of a list that a fused loop pushes, with no array of that list\n // (COMPILE.MODULE.APPEND.PUSH). The one item of `fill(1, x)` goes through `#ones` below.\n const pushed = op === \"append\" && owned && this.#fuse ? this.#ownPush(list, exprs[1] as Expr, strict, ctx, owner) : undefined;\n if (pushed !== undefined) return pushed;\n // With fuse, an append of an owner can push the one item of `fill(1, x)` (COMPILE.MODULE.FUSE.ADOPT). Only `#fill`\n // reads the mark of the node. An error of a print stops the module, so the mark needs no `finally`.\n const right = owned && this.#fuse ? exprs[1] : undefined;\n this.#ones.set(right, undefined);\n const raw = [list, ...exprs.slice(1).map((x) => (two ? this.#listOf(x, ctx) : this.expr(x, ctx)))];\n const one = this.#ones.get(right);\n this.#ones.delete(right);\n const deps = depsOf(...raw);\n const parts = this.#inOrder(this.#settle(raw, deps, exprs), true);\n const w = owned ? (owner.w ??= this.fresh(\"w\")) : undefined;\n // The item is the item of the list of the append only if no other part holds the value of fill. The list of a sure\n // owner is the array of w. Each other list can be another array, so AI or AIC selects the push or a copy with the push.\n const item = one !== undefined && (parts[1] as Code).v === one.v ? one.item : undefined;\n if (one !== undefined && item === undefined) this.use(\"FI\");\n const code = this.#buildCode(op, parts, strict, w, item === undefined ? undefined : { item, sure: (owner as Owner).sure });\n const value = (kind: Kind | undefined, facts: ListInfo | undefined): Code => ({ s: stmtsOf(...parts), v: { code, kind, safe: false, deps, list: facts } });\n if (op === \"get\") return value(info.item, info.inner);\n if (op === \"indexOf\") return value(\"number\", undefined);\n // V removes each error item, so the value of without, append and flat is clean.\n const built = (facts: ListInfo): Code => value(undefined, { ...facts, clean: true, fresh: false });\n if (op === \"without\") return built(info);\n if (op === \"append\") return built(joinLists(info, (parts[1] as Code).v.list as ListInfo, op));\n // flat: the value of each item must be a list, so a list of values gives a reason. An empty list gives an empty list.\n if (info.empty === true) return built(info);\n if (info.inner === undefined) throw new NotStandalone('\"flat\" over a list whose items are not lists');\n return built(info.inner);\n }\n\n /**\n * This method prints an append of an owner whose second list a fused loop pushes (COMPILE.MODULE.APPEND.PUSH). Such a\n * list is an append chain, an `if` or a fused `flat` over an each (`#pushes`). The items go into the target, with no array\n * of that list. The target is the array `w` when the first list is `w`. Each other first list gets one copy, as the\n * fused chain of the version before COMPILE.MODULE.APPEND.OTHER does. `fill(1, x)` keeps the expression of AIC, and\n * this method gives undefined for it.\n *\n * The second list does not read the name (`ownForm`), so no part of it reads the target. A push of a part that\n * fails stops the step, and an error of a step is the error of the loop. Thus no part reads such a target after it.\n * The target goes into `w` after the last push, so an error before it does not change `w`.\n */\n #ownPush(list: Code, right: Expr, strict: boolean, ctx: Ctx, owner: Owner): Code | undefined {\n if ((right.tag === \"app\" && right.op === \"fill\") || !this.#pushes(right, ctx)) return undefined;\n // In a sheet with a search, a part that reads a cell does not fuse, as in `#appendStrict`.\n if (this.#sheet !== undefined && !this.#sheet.direct && readsCells(right)) return undefined;\n const w = (owner.w ??= this.fresh(\"w\"));\n const o = this.fresh(\"o\");\n const info = list.v.list as ListInfo;\n const target = owner.sure ? list.v.code : this.#clean(info) ? `${this.use(\"AWC\")}(${list.v.code}, ${w})` : `${this.use(\"AW\")}(${list.v.code}, ${String(strict)}, ${w})`;\n const items = this.#push(right, ctx, o, strict);\n const s = [...list.s, `const ${o} = ${target};`, ...items.s, ...(owner.sure ? [] : [`${w} = ${o};`])];\n // The target has only items with values, and the loop holds it, so it is clean and not fresh.\n const facts: ListInfo = { ...joinLists(info, items.list as ListInfo, \"append\"), clean: true, fresh: false };\n return { s, v: { code: o, kind: undefined, safe: false, deps: new Set([...list.v.deps, ...items.deps]), list: facts } };\n }\n\n /**\n * This method gives the code of a list op of `#build`, with the variable `w` of an append into its own list. The clean\n * form applies when the facts prove each list that the helper scans clean (COMPILE.MODULE.FUSE.CLEAN). Then the\n * helper has no scan of V and no option strict. The append of two clean lists is `concat`. `get` scans no list, so\n * it has no clean form.\n */\n #buildCode(op: string, parts: readonly Code[], strict: boolean, w: string | undefined, push?: { readonly item: string; readonly sure: boolean }): string {\n const [l, o] = parts as [Code, Code | undefined];\n const codes = parts.map((x) => x.v.code);\n const info = l.v.list as ListInfo;\n // flat scans the list and each list of its items. An empty list has no items.\n const clean = op === \"flat\" ? this.#clean(info) && (info.inner === undefined || this.#clean(info.inner)) : op !== \"get\" && this.#clean(info) && (o?.v.list === undefined || this.#clean(o.v.list));\n if (w !== undefined) {\n // A list that is the array of w gets the one item with a push (COMPILE.MODULE.FUSE.ADOPT). With `sure`, the list is\n // that array. Else AI or AIC pushes the item into w, or into a copy of another list, with no list of fill\n // (COMPILE.MODULE.APPEND.PUSH).\n if (push?.sure === true) return `(${l.v.code}.push(${push.item}), ${w})`;\n if (push !== undefined) return clean ? `(${w} = ${this.use(\"AIC\")}(${l.v.code}, ${push.item}, ${w}))` : `(${w} = ${this.use(\"AI\")}(${l.v.code}, ${push.item}, ${String(strict)}, ${w}))`;\n return clean ? `(${w} = ${this.use(\"AOC\")}(${[...codes, w].join(\", \")}))` : `(${w} = ${this.use(\"AO\")}(${[...codes, String(strict), w].join(\", \")}))`;\n }\n if (!clean) return `${this.use(BUILD_HELPERS[op] as BuildHelper)}(${[...codes, String(strict)].join(\", \")})`;\n if (op === \"append\") return `${l.v.code}.concat(${(o as Code).v.code})`;\n return `${this.use(`${BUILD_HELPERS[op] as \"WO\" | \"FL\" | \"IX\"}C`)}(${codes.join(\", \")})`;\n }\n\n /** This method prints a list op over a list that is not an each: a loop over its array, and nth (LIST.NTH). */\n #overList(op: string, head: Expr, rest: readonly Expr[], ctx: Ctx): Code {\n // The count of a range of fill is the checked count, with no array (COMPILE.MODULE.FILL.RANGE).\n const range = op === \"count\" && rest.length === 0 ? this.#range(head, ctx) : undefined;\n if (range !== undefined) return { s: range.s, v: { ...range.count, list: undefined } };\n const list = this.#listOf(head, ctx);\n // A missing position is the literal null, which is not a whole number, so nth gives its error.\n const exprs = [head, ...(op === \"nth\" ? [rest[0] ?? lit(null)] : [])];\n const { strict, step } = this.#foldOptions(op, rest.slice(exprs.length - 1));\n const raw = [list, ...exprs.slice(1).map((x) => this.expr(x, ctx))];\n const deps = depsOf(...raw);\n const parts = this.#inOrder(this.#settle(raw, deps, exprs), true);\n const [l] = parts as [Code];\n const { item, inner } = list.v.list as ListInfo;\n // A clean list is its own array of items with values, so the clean form reads it with no VW and no test of the\n // sentinel (COMPILE.MODULE.FUSE.CLEAN). strict cannot fail.\n const clean = this.#clean(list.v.list);\n // The value of an item of a list of lists is a list, so nth and first give a list (LIST.FLAT).\n if (op === \"nth\") return { s: stmtsOf(...parts), v: { code: clean ? `${this.use(\"NTC\")}(${parts.map((x) => x.v.code).join(\", \")})` : `${this.use(\"NT\")}(${[...parts.map((x) => x.v.code), String(strict)].join(\", \")})`, kind: item, safe: false, deps, list: inner } };\n // count and first read the items with values on the array of the list, as nth does (COMPILE.MODULE.NTH.INDEX). Thus\n // a step of a loop that counts a list of n items costs O(1) after the first count. The length of an array cannot throw.\n if (op === \"count\") return { s: l.s, v: clean ? { code: `${l.v.code}.length`, kind: \"number\", safe: l.v.safe, deps, list: undefined } : { code: `${this.use(\"CT\")}(${l.v.code}, ${String(strict)})`, kind: \"number\", safe: false, deps, list: undefined } };\n if (op === \"first\") return { s: l.s, v: { code: clean ? `${this.use(\"FSC\")}(${l.v.code})` : `${this.use(\"FS\")}(${l.v.code}, ${String(strict)})`, kind: item, safe: false, deps, list: inner } };\n const r = this.#reduction(op, item, step);\n const { v } = r;\n const test = clean ? [] : [` if (${v} === E) ${strict ? `${this.use(\"F\")}();` : \"continue;\"}`];\n const s = [...l.s, r.init, `for (const [, ${v}] of ${l.v.code}) {`, ...test, ` ${r.step}`, \"}\"];\n return { s, v: { code: r.result, kind: r.kind, safe: false, deps, list: op === \"first\" ? inner : undefined } };\n }\n\n /**\n * This method gives the names of a loop (LOOP.NAMES): a variable for each name of `init`, with its first value at the\n * node. Inside the loop, each name has the level `loop`. Thus a part that reads a name stays in the loop. A loop that\n * reads no key of the run is a constant of the run.\n */\n #loopNames(init: Names, step: Names, ctx: Ctx, loop: number, items: readonly string[] = []): { readonly s: string[]; readonly env: Map<string, Name>; readonly vars: ReadonlyMap<string, Name>; readonly deps: Set<number>; readonly adopt: ReadonlySet<string> } {\n const s: string[] = [];\n const env = new Map(ctx.env);\n const vars = new Map<string, Name>();\n const deps = new Set<number>();\n // A step with a list literal, fill or an op with a list result can give a name keys that are not positions (LOOP.LIST).\n const keyed = Object.values(step).some((x) => hasTextKeys(x, (name) => this.#facts.givesList(name)));\n const firsts = Object.entries(init).map(([name, x]): [string, Code, string] => {\n // A name of a loop can hold a list (LOOP.LIST). Its first list fixes the kind of the items, if it has one.\n this.#wantList.add(x);\n const c = this.expr(x, ctx);\n if (c.v.kind === undefined && c.v.list === undefined) throw new NotStandalone(`the first value of the name \"${name}\" of a loop has no kind`);\n const v = this.fresh(\"l\");\n s.push(...c.s, `let ${v} = ${c.v.code};`);\n for (const d of c.v.deps) deps.add(d);\n return [name, c, v];\n });\n const clean = cleanNames(new Map(firsts.map(([name, c]) => [name, c.v.list?.clean === true])), step, items, (name) => ctx.env.get(name)?.list?.clean === true);\n for (const [name, c, v] of firsts) {\n const facts = c.v.list;\n // A step can give the items of a list a new value, so the facts of fusion of the items do not stay.\n const list = facts === undefined ? undefined : { ...this.#startItems(facts, step[name] as Expr), texts: facts.texts === true || keyed, clean: clean.has(name) };\n const read: Name = { code: v, kind: c.v.kind, lazy: false, deps: new Set([loop]), list };\n env.set(name, read);\n vars.set(name, read);\n }\n // With fuse, an append into the list of a name can take a first list that is clean and fresh as its own array\n // (COMPILE.MODULE.FUSE.ADOPT).\n const adopt = new Set(this.#fuse ? firsts.flatMap(([name, c]) => (adoptable(c.v.list) ? [name] : [])) : []);\n return { s, env, vars, deps, adopt };\n }\n\n /**\n * This method gives the facts of the items of a name of a loop with the first list `facts` and the step `x`. The step\n * can decide the items of an empty first list (COMPILE.MODULE.LOOP.EMPTY).\n */\n #startItems(facts: ListInfo, x: Expr): Pick<ListInfo, \"item\" | \"inner\" | \"empty\"> {\n const start = facts.empty === true;\n const { item, inner } = (start ? this.#starts.found.get(x) : undefined) ?? facts;\n return { item, inner: plainList(inner), empty: start && this.#starts.seek };\n }\n\n /**\n * This method gives the statements of one step of a loop: each new value first, and then each name gets its value.\n * `owners` has each name that appends to its own list (COMPILE.MODULE.APPEND.OWN). Each such name has the form of\n * `ownForm`, and no `until` reads it. The tests of a fold read only the names outside the fold, so they cannot read it.\n * A name in `adopt` has a first list that its appends can take (COMPILE.MODULE.FUSE.ADOPT).\n *\n * A step of another name can read it only before the step of the name, and only by `readsOnly`\n * (COMPILE.MODULE.APPEND.READ). The steps print in their order, so such a read ends before the first push.\n *\n * A step that is not such a form can be a wide form of `ownForm` with an append (COMPILE.MODULE.APPEND.OTHER). Each\n * step of another name that reads it must read it by `readsOnly`. A step of the name that such a read follows prints\n * after the other steps (COMPILE.MODULE.APPEND.LATE). The order must keep each read of each owner before its step.\n * These wide forms apply only with fuse.\n */\n #loopStep(step: Names, inner: Ctx, vars: ReadonlyMap<string, Name>, adopt: ReadonlySet<string>, until?: Expr): LoopStep {\n const owners: Owner[] = [];\n const nodes: Expr[] = [];\n const steps = Object.entries(step);\n const keys = steps.map(([k]) => k);\n const found = new Map<string, { readonly own: readonly Expr[]; readonly lets: readonly Expr[] }>();\n const wide: { readonly name: string; readonly own: readonly Expr[]; readonly lets: readonly Expr[]; readonly late: boolean }[] = [];\n for (const [i, [name, x]] of steps.entries()) {\n const own: Expr[] = [];\n const lets: Expr[] = [];\n const read = (y: Expr): boolean => namesOf(y).has(name);\n if (until !== undefined && read(until)) continue;\n const others = steps.filter(([k, y], j) => k !== name && read(y) && !(j < i && readsOnly(y, name)));\n if (ownForm(x, name, own, lets) && others.length === 0) {\n found.set(name, { own, lets });\n continue;\n }\n // The wide forms need fuse, so fuse false prints the module of the version before fusion (COMPILE.MODULE.FUSE.OFF).\n if (!this.#fuse || !steps.every(([k, y]) => k === name || !read(y) || readsOnly(y, name))) continue;\n const more: Expr[] = [];\n const moreLets: Expr[] = [];\n if (!ownForm(x, name, more, moreLets, true) || more.length === 0) continue;\n wide.push({ name, own: more, lets: moreLets, late: steps.some(([k, y], j) => j > i && k !== name && read(y)) });\n }\n // The steps of the late names print last, in their order. Each read of an owner must come before its step.\n const orderOf = (late: readonly string[]): readonly string[] => [...keys.filter((k) => !late.includes(k)), ...late];\n const keepsReads = (names: readonly string[], order: readonly string[]): boolean =>\n names.every((n) => steps.every(([k, y]) => k === n || !namesOf(y).has(n) || order.indexOf(k) < order.indexOf(n)));\n let late: readonly string[] = [];\n for (const w of wide) {\n const next = w.late ? [...late, w.name] : late;\n if (!keepsReads([...found.keys(), w.name], orderOf(next))) continue;\n found.set(w.name, w);\n late = next;\n }\n for (const [name, x] of steps) {\n const f = found.get(name);\n if (f === undefined) continue;\n // The variable starts with the first list, and each value of the step is that list or the value of an append that\n // pushes into it. Thus each append of the name gets the array of the variable (COMPILE.MODULE.FUSE.ADOPT). The body\n // of a let of COMPILE.MODULE.APPEND.LET can give another list.\n const owner: Owner = { name, read: vars.get(name) as Name, w: undefined, adopt: adopt.has(name), sure: adopt.has(name) && f.lets.length === 0 && !shadows(x, name) };\n for (const node of f.own) this.#own.set(node, owner);\n owners.push(owner);\n nodes.push(...f.own);\n // A branch of another list can be a filter of the list of the name (COMPILE.MODULE.APPEND.KEEP).\n for (const node of keepsOf(f.lets, name)) {\n this.#keeps.set(node, owner);\n nodes.push(node);\n }\n }\n try {\n return { ...this.#steps(step, inner, vars, orderOf(late)), owners };\n } finally {\n for (const node of nodes) {\n this.#own.delete(node);\n this.#keeps.delete(node);\n }\n }\n }\n\n /**\n * This method prints the result of a loop. With fuse, an append of the result to the list of an owner appends into\n * the array of the loop (COMPILE.MODULE.FUSE.ADOPT). The form of the result is the form of `lastForm`, so no part\n * reads the old list after the append. Only an owner whose step made its variable can do so, because the variable\n * holds only arrays that no other part holds. Each part of the result outside the form does not read the name. Thus\n * an inner loop there has no node and no relay of the form.\n */\n #loopResult(result: Expr, ctx: Ctx, owners: readonly Owner[]): Code {\n const nodes: Expr[] = [];\n const lets: Expr[] = [];\n for (const owner of this.#fuse ? owners : []) {\n const own: Expr[] = [];\n const relays = new Map<Expr, Relay>();\n if (owner.w === undefined || !lastForm(result, owner.name, own, relays)) continue;\n for (const node of own) this.#own.set(node, owner);\n for (const [l, r] of relays) this.#relays.set(l, { ...r, owner });\n nodes.push(...own);\n lets.push(...relays.keys());\n }\n try {\n return this.expr(result, ctx);\n } finally {\n for (const node of nodes) this.#own.delete(node);\n for (const l of lets) {\n for (const node of (this.#relays.get(l) as Relay).nodes) this.#own.delete(node);\n this.#relays.delete(l);\n }\n }\n }\n\n /**\n * This method gives the statements before a loop: the variable of each owner that its appends use. The variable of an\n * owner with `adopt` starts with the array of the first list (COMPILE.MODULE.FUSE.ADOPT), and each other one with null.\n */\n #ownVars(owners: readonly Owner[]): readonly string[] {\n return owners.flatMap((o) => (o.w === undefined ? [] : [`let ${o.w} = ${o.adopt ? o.read.code : \"null\"};`]));\n }\n\n /**\n * This method gives the statements of one step of a loop, without the variables of COMPILE.MODULE.APPEND.OWN. It also\n * gives the statements of each name alone, for the rest of a fold after its exit (`#foldExit`). The steps print in the\n * order of `order` (COMPILE.MODULE.APPEND.LATE).\n */\n #steps(step: Names, inner: Ctx, vars: ReadonlyMap<string, Name>, order: readonly string[]): { readonly s: string[]; readonly deps: ReadonlySet<number>; readonly parts: readonly StepPart[] } {\n const s: string[] = [];\n const sets: string[] = [];\n const parts: StepPart[] = [];\n const deps = new Set<number>();\n for (const name of order) {\n const x = step[name] as Expr;\n this.#wantList.add(x);\n const c = this.#hoist(this.expr(x, inner), hasLoop(x));\n const v = vars.get(name) as Name;\n if (c.v.kind !== v.kind || (c.v.list === undefined) !== (v.list === undefined)) throw new NotStandalone(`a step of a loop changes the kind of the name \"${name}\"`);\n if (v.list?.empty === true) this.#noteStart(x, c.v.list as ListInfo);\n if (v.list !== undefined && !fits(v.list, c.v.list as ListInfo)) throw new NotStandalone(`a step of a loop gives the name \"${name}\" a list that does not fit its first list`);\n const t = this.fresh(\"t\");\n const value = [...c.s, `const ${t} = ${c.v.code};`];\n s.push(...value);\n sets.push(`${v.code} = ${t};`);\n parts.push({ name, s: value, set: `${v.code} = ${t};`, safe: c.v.safe });\n for (const d of c.v.deps) deps.add(d);\n }\n return { s: [...s, ...sets], deps, parts };\n }\n\n /** This method keeps the items of the list that the step `x` gives to a name that starts empty (COMPILE.MODULE.LOOP.EMPTY). */\n #noteStart(x: Expr, list: ListInfo): void {\n if (list.item !== undefined || list.inner !== undefined) this.#starts.found.set(x, { item: list.item, inner: list.inner });\n }\n\n /**\n * An iteration (ITERATE.LIMIT, ITERATE.UNTIL): a `for` loop with a variable for each name. An error of a value, of the\n * test or of the result throws, so it is the value of the iteration.\n */\n #iterate(e: ExprOf<\"iterate\">, ctx: Ctx): Code {\n // Stryker disable next-line UpdateOperator: a level of a loop is a name, so a count down gives other names, and the same code\n const loop = this.#loops++;\n const names = this.#loopNames(e.init, e.step, ctx, loop);\n const inner: Ctx = { ...ctx, env: names.env };\n // The data limit reads the names outside the loop, after the first values (ITERATE.LIMIT.DATA).\n const limit = this.#limit(e, ctx);\n // A loop at a place that takes a list gives its result there (LOOP.LIST).\n if (this.#wantList.has(e)) this.#wantList.add(e.result);\n const until = e.until === undefined ? undefined : this.expr(e.until, inner);\n const step = this.#loopStep(e.step, inner, names.vars, names.adopt, e.until);\n const result = this.#loopResult(e.result, inner, step.owners);\n const k = this.fresh(\"k\");\n const body = [\n ...(until === undefined ? [] : [...until.s, `if (${this.#boolean(until.v)}) break;`]),\n `if (${k} === ${limit.code}) ${until === undefined ? \"break;\" : `${this.use(\"F\")}();`}`,\n ...step.s,\n ];\n const inside = [...(until?.v.deps ?? []), ...step.deps, ...result.v.deps].filter((d) => d !== loop);\n const deps = new Set([...names.deps, ...limit.deps, ...inside]);\n return { s: [...names.s, ...limit.s, ...this.#ownVars(step.owners), `for (let ${k} = 0; ; ${k}++) {`, ...ind(body), \"}\", ...result.s], v: { code: result.v.code, kind: result.v.kind, safe: false, deps, list: result.v.list } };\n }\n\n /**\n * The number of steps of an iteration. A data limit is the strict count of the targets of its axis. An error of the\n * axis, of a test or of an item throws. A count above the cap throws too (ITERATE.LIMIT.ERROR). A count that reads no\n * key is a constant of the run, so each key reads one value and not the targets (COMPILE.MODULE.LIMIT.ONCE).\n */\n #limit(e: ExprOf<\"iterate\">, ctx: Ctx): { readonly s: readonly string[]; readonly code: string; readonly deps: ReadonlySet<number> } {\n const [targets] = splitLimit(e) ?? [];\n if (targets === undefined) {\n const limit = e.limit as number;\n return { s: [], code: String(limit), deps: new Set() };\n }\n const count = this.#hoist(this.expr(app(\"count\", targets, lit({ strict: true })), ctx), true);\n const n = this.fresh(\"n\");\n return { s: [...count.s, `const ${n} = ${count.v.code};`, `if (${n} > ${String(MAX_ITERATIONS)}) ${this.use(\"F\")}();`], code: n, deps: count.v.deps };\n }\n\n /**\n * A fold (FOLD.ORDER, FOLD.ERROR): the loop over the targets of an axis, with a variable for each name. The tests read\n * only the names outside the fold. An error throws, so it is the value of the fold.\n */\n #fold(e: ExprOf<\"fold\">, ctx: Ctx): Code {\n // Stryker disable next-line UpdateOperator: a level of a loop is a name, so a count down gives other names, and the same code\n const loop = this.#loops++;\n // The names of the items hide the names outside the fold in the steps (AXIS.LIST.SCOPE).\n const names = this.#loopNames(e.init, e.step, ctx, loop, e.as);\n if (this.#wantList.has(e)) this.#wantList.add(e.result);\n const t = this.#targetLoop(e.axis, e.at ?? [], ctx, e.as);\n const tests = t.tests.map((x) => this.#hoist(this.expr(x, t.inner), hasLoop(x)));\n // The interpreter evaluates the tests at each target before the first step, so a module of a sheet does not have them.\n if (tests.some((x) => x.v.deps.has(CELLS))) throw new NotStandalone(\"a test of the axis of a fold reads a cell\");\n // Only the steps see the names of the items (AXIS.LIST.SCOPE). A name of `as` is not a name of `init`, so the read of\n // each name of the fold stays its read, and an append into its own list keeps its owner (COMPILE.MODULE.APPEND.OWN).\n const stepCtx: Ctx = { ...t.inner, env: withNames(names.env, t.items) };\n const first = this.#loopStep(e.step, stepCtx, names.vars, names.adopt);\n this.#readsNoTarget(t.texts, t.inner.level, [...tests.map((x) => x.v.deps), first.deps]);\n const result = this.#loopResult(e.result, { ...ctx, env: names.env }, first.owners);\n const scan = this.#scan(e, { loop, names, t, test: tests[0], step: first, result });\n if (scan !== undefined) return scan;\n // A fold over all the records can read the packs of its columns (COMPILE.MODULE.PAIRS).\n const packed = this.#packedSteps(e, t, stepCtx, names, first);\n const step = packed?.step ?? first;\n const item = [\n ...t.key,\n ...(t.skip === undefined ? [] : [`if (${t.j} === ${t.skip}) continue;`]),\n ...t.check,\n ...tests.flatMap((c) => [...c.s, `if (!${this.#boolean(c.v)}) continue;`]),\n ];\n const body = [...item, ...step.s, ...this.#foldExit(e, t, item, tests, step, names.vars, result)];\n const inside = [...tests.flatMap((c) => [...c.v.deps]), ...step.deps].filter((d) => d !== loop && d !== t.inner.level && d !== t.item);\n const deps = new Set([...names.deps, ...t.start, ...inside, ...[...result.v.deps].filter((d) => d !== loop)]);\n return { s: [...names.s, ...this.#ownVars(step.owners), ...t.s, ...(packed?.lets ?? []), t.head, ...ind(body), \"}\", ...result.s], v: { code: result.v.code, kind: result.v.kind, safe: false, deps, list: result.v.list } };\n }\n\n /**\n * This method gives the second print of the steps of a fold over all the records (COMPILE.MODULE.PAIRS), or\n * undefined. The axis has no test, no address and no reverse order, and no name holds a list. The second print reads\n * the pack of a column at the focus of the fold and of each loop in its steps. A column of the function that the\n * printer prints has a pack too, which each call makes again.\n *\n * Each call at such a focus is the body of its function at the place of the call (`#inline`). A pack holds the value\n * or the sentinel of the column at each record. Thus each read gives the value of a read of the column. Where the\n * second print fails, the fold keeps its first print.\n */\n #packedSteps(e: ExprOf<\"fold\">, t: { readonly j: string; readonly fixed: boolean; readonly tests: readonly Expr[] }, inner: Ctx, names: { readonly vars: ReadonlyMap<string, Name>; readonly adopt: ReadonlySet<string> }, first: LoopStep): { readonly step: LoopStep; readonly lets: readonly string[] } | undefined {\n if (this.#pack !== undefined || testsOf(e.axis).base.t !== \"all\" || !t.fixed || t.tests.length > 0 || first.owners.length > 0) return undefined;\n if ([...names.vars.values()].some((x) => x.list !== undefined)) return undefined;\n // The first print must read a column that can have a pack: a column of the run, or a column of this function.\n const scope = this.#scopes.at(-1);\n const read = first.s.join(\"\\n\");\n const columns = [...this.#runColumns.keys(), ...[...this.#callColumns].flatMap(([name, c]) => (c.scope === scope ? [name] : []))];\n if (!columns.some((name) => read.includes(`${name}(`))) return undefined;\n const pack: Pack = { foci: new Set([t.j]), calls: true, cols: new Map(), locals: new Set(), inlines: 0 };\n const scopes = this.#scopes.length;\n const outer = this.#inside;\n this.#pack = pack;\n let step: LoopStep;\n try {\n step = this.#loopStep(e.step, inner, names.vars, names.adopt);\n } catch (err) {\n if (!(err instanceof NoPack || err instanceof NotStandalone)) throw err;\n this.#scopes.length = scopes;\n this.#inside = outer;\n return undefined;\n } finally {\n this.#pack = undefined;\n }\n const text = step.s.join(\"\\n\");\n return { step, lets: this.#packLets([...pack.cols].filter(([, local]) => text.includes(`${local}[`))) };\n }\n\n /**\n * This method gives the exit of a fold (COMPILE.MODULE.EXIT): the statements after each step, or none. A name whose\n * step is `and(name, ...)` stops at false, and a name whose step is `or(name, ...)` stops at true. Then each later\n * step of the name gives the same value and evaluates no other argument. When each such name stops, the loop leaves.\n * The rest of the targets runs only the steps of the other names, with the checks and the tests of each target. Thus\n * an error of a later target is still the error of the fold. When these steps cannot throw and the result does not\n * read their names, the loop leaves at once.\n */\n #foldExit(e: ExprOf<\"fold\">, t: { readonly parts: ForParts; readonly checkSafe: boolean }, item: readonly string[], tests: readonly Code[], step: LoopStep, vars: ReadonlyMap<string, Name>, result: Code): string[] {\n if (step.owners.length > 0) return [];\n const stops: string[] = [];\n const rest: StepPart[] = [];\n for (const p of step.parts) {\n const stop = stopOf(e.step[p.name] as Expr, p.name);\n if (stop === undefined) rest.push(p);\n else stops.push(`${stop ? \"\" : \"!\"}${(vars.get(p.name) as Name).code}`);\n }\n if (stops.length === 0) return [];\n const test = stops.join(\" && \");\n const reads = [result.v.code, ...result.s].join(\"\\n\");\n // A part with statements of its own can have a loop or a try block, so only a part with one statement is quiet.\n const quiet =\n t.checkSafe &&\n tests.every((c) => c.s.length === 0 && this.#safeBoolean(c.v)) &&\n rest.every((p) => p.safe && p.s.length === 1 && !new RegExp(String.raw`\\b${(vars.get(p.name) as Name).code}\\b`).test(reads));\n if (quiet) return [`if (${test}) break;`];\n // The rest goes on from the next target, in the order of the loop, with the parts of the head of the loop.\n const { cond, next } = t.parts;\n const residual = [...item, ...rest.flatMap((p) => p.s), ...rest.map((p) => p.set)];\n return [`if (${test}) {`, ...ind([`for (${next}; ${cond}; ${next}) {`, ...ind(residual), \"}\", \"break;\"]), \"}\"];\n }\n\n /**\n * This method gives the code of a fold over the targets before the origin as a scan (COMPILE.MODULE.SCAN), or\n * undefined. The axis is `where(all, test)`, and the test compares a value `T` of the target with a key of the origin\n * by `<` or `<=`. The first values, the steps and the result read no key of the run. A run evaluates `T` once at\n * each record, and each step once at each record. When the values `T` do not decrease, the targets of each origin are\n * a prefix. A binary search finds it, and each prefix keeps its state. The steps run in the order of the fold, so the\n * result has the bits of the loop.\n */\n #scan(e: ExprOf<\"fold\">, p: ScanParts): Code | undefined {\n const { loop, names, t, test, step, result } = p;\n const level = t.inner.level;\n const [x] = t.tests;\n const { base } = testsOf(e.axis);\n if (base.t !== \"all\" || (e.at ?? []).length > 0 || e.as !== undefined || t.tests.length !== 1 || x?.tag !== \"app\" || x.args.length !== 2 || test === undefined) return undefined;\n // Stryker disable next-line all: for the axis all with no address, #targetLoop gives no statements, key, check or skip, so this test is always false\n if (t.s.length > 0 || t.key.length > 0 || t.check.length > 0 || t.skip !== undefined) return undefined;\n // The test reads the target and a key of the origin. The rest reads only the target, the names of the fold and the\n // constants of the run, so it can evaluate once for each run.\n if (!test.v.deps.has(level) || within(test.v.deps, [level]) || names.deps.size > 0 || step.owners.length > 0 || !within(step.deps, [loop, level]) || !within(result.v.deps, [loop])) return undefined;\n if ([...names.vars.values()].some((v) => v.list !== undefined) || result.v.list !== undefined) return undefined;\n const sides = x.args.map((a) => this.#hoist(this.expr(a, t.inner), hasLoop(a)));\n const at = sides.findIndex((c) => c.v.deps.size > 0 && !c.v.deps.has(level));\n const key = sides[at];\n const value = sides[1 - at];\n // The search needs an order of the values: `<=` of two numbers or of two texts.\n if (key === undefined || value === undefined || !within(value.v.deps, [level]) || (value.v.kind !== \"number\" && value.v.kind !== \"string\")) return undefined;\n // The test is an op whose inline form cannot fail, as for the prefixes of a node that keeps its items (`#cached`).\n const site = this.#facts.staticSite(x.op, sides.map((c) => c.v.kind));\n if (site?.t !== \"fn\" || site.bad || site.returns !== \"boolean\" || this.check(\"boolean\") !== undefined) return undefined;\n const form = inlineForm(functionText(((this.#domains[site.domain] as AnyDomain).ops[x.op] as { fn: (...a: never[]) => unknown }).fn));\n if (form?.params.length !== 2) return undefined;\n // `#0` is the value of the target and `#1` is the key, in the order of the parameters of the op.\n const pattern = patternOf(form, (i) => (at === 0 ? 1 - i : i));\n if (![\"#0<#1\", \"#0<=#1\", \"#1>#0\", \"#1>=#0\"].includes(pattern)) return undefined;\n const keyTest = form.parts.map((part) => (typeof part === \"number\" ? `(${at === 0 ? [\"q\", \"t\"][part] : [\"t\", \"q\"][part]})` : part)).join(\"\");\n const vars = [...names.vars.values()].map((v) => v.code);\n const s = this.fresh(\"s\");\n const pack = vars.length === 1 ? (vars[0] as string) : `[${vars.join(\", \")}]`;\n const unpack = vars.length === 1 ? [`let ${vars[0] as string} = ${s};`] : vars.map((v, i) => `let ${v} = ${s}[${String(i)}];`);\n const arrow = (params: string, lines: readonly string[], code: string): readonly string[] => (lines.length === 0 ? [`(${params}) => ${code}`] : [`(${params}) => {`, ...ind(lines), ` return ${code};`, \"}\"]);\n const fns = [arrow(\"\", names.s, pack), arrow(t.j, value.s, value.v.code), [`(t, q) => ${keyTest}`], arrow(`${s}, ${t.j}`, [...unpack, ...step.s], pack), arrow(s, [...unpack, ...result.s], result.v.code)];\n const name = this.fresh(\"P\");\n this.#intoRun([`const ${name} = ${this.use(\"PF\")}(n,`, ...ind(fns.flatMap((f, i) => [...f.slice(0, -1), `${f.at(-1) as string}${i < fns.length - 1 ? \",\" : \"\"}`])), \");\"]);\n const q = this.fresh(\"q\");\n return { s: this.#store(q, key), v: { code: `${name}(${q})`, kind: result.v.kind, safe: false, deps: key.v.deps } };\n }\n\n /**\n * A node of the memo: one function of its keys for each structure, with an entry for each value of the keys. A key\n * that is a constant of the run is the variable of that constant, not a key of the function. A node with no other key\n * is a constant of the run itself.\n */\n #memoized(e: Expr, keys: readonly Expr[], ctx: Ctx): Code {\n // A key can be a list, for example the list of a let that nth reads in the node (COMPILE.MODULE.NTH.INDEX).\n for (const k of keys) this.#wantList.add(k);\n const values = keys.map((k) => this.#hoist(this.expr(k, ctx)));\n const varying = keys.filter((_k, i) => (values[i] as Code).v.deps.size > 0);\n const params = varying.map(() => this.fresh(\"q\"));\n const names = new Map(\n keys.map((k, i): [Expr, Name] => {\n const x = (values[i] as Code).v;\n const p = varying.indexOf(k);\n return [k, p < 0 ? this.#nameOf(x) : { code: params[p] as string, kind: x.kind, lazy: true, deps: new Set([1]), list: plainList(x.list) }];\n }),\n );\n const outer = this.#inside;\n this.#inside = e;\n const bodyCtx: Ctx = { origin: undefined, focus: undefined, level: 1, originLevel: 1, env: new Map(), fns: new Map(), keys: names, columns: new Map() };\n if (varying.length === 0) {\n const body = this.#hoist(this.expr(e, bodyCtx));\n this.#inside = outer;\n return body;\n }\n // The kinds of the keys decide the ops in the node, so they are a part of the structure. Each key of the function\n // can hold the error sentinel, so the nodes with a safe key and the nodes without one share it.\n const tokens = new Map(keys.map((k, i): [Expr, object] => [k, varying.includes(k) ? { \"#\": varying.indexOf(k), kind: (values[i] as Code).v.kind, list: plainList((values[i] as Code).v.list) } : { \"@\": (names.get(k) as Name).code }]));\n const structure = canonical(e, (x) => tokens.get(x as Expr));\n let fn = this.#structures.get(structure);\n if (fn === undefined) {\n fn = this.fresh(\"m\");\n this.memos = true;\n const cached = varying.length === 1 ? this.#cached(e, varying[0] as Expr, bodyCtx, fn) : undefined;\n if (cached !== undefined) {\n this.#kinds.set(fn, cached.kind);\n this.#intoRun(cached.lines);\n } else {\n // The loop of the node gives statements.\n const body = this.expr(e, bodyCtx);\n this.#kinds.set(fn, body.v.kind);\n this.#lists.set(fn, heldList(body.v.list));\n this.#intoRun([`const ${fn} = ${this.use(params.length === 1 ? \"M1\" : \"M\")}((${params.join(\", \")}) => {`, ...ind(body.s), ` return ${body.v.code};`, \"});\"]);\n }\n this.#structures.set(structure, fn);\n }\n this.#inside = outer;\n // Each key of the function gets its value, or the error sentinel.\n const s: string[] = [];\n const args = varying.map((k) => {\n const c = values[keys.indexOf(k)] as Code;\n if (c.v.safe && c.s.length === 0) return c.v.code;\n if (c.s.length === 0 && c.v.held !== undefined) return c.v.held;\n const t = this.fresh(\"k\");\n s.push(...this.#store(t, c));\n return t;\n });\n return { s, v: { code: `${fn}(${args.join(\", \")})`, kind: this.#kinds.get(fn), safe: false, deps: depsOf(...values), list: this.#lists.get(fn) } };\n }\n\n /**\n * This method gives the code of a node of the memo whose key is only in one test of a list op: `test(T, key)`. Such a\n * node keeps its items in the helper `S`. One pass gives the tests before the test of the key and the value `T` of each\n * item. The rest of an item evaluates once, at the first key whose test is true.\n *\n * With the test `===`, each value `T` has a group of items. With `<` or `<=` and values `T` that do not decrease, the\n * items whose test is true are a prefix. Each prefix keeps its running value. The values add in the order of the items, so the result has the bits of the interpreter. An error before the test\n * of the key is an error of the item at each key. An error after it is an error at the keys whose test is true.\n */\n #cached(e: Expr, key: Expr, bodyCtx: Ctx, fn: string): { readonly lines: readonly string[]; readonly kind: Kind | undefined } | undefined {\n // Only an app has an op, and a node of the memo has a loop, so a list op has its target.\n const { op, args } = e as ExprOf<\"app\">;\n if (!LIST_OPS.has(op)) return undefined;\n const [target, ...rest] = args as [Expr, ...Expr[]];\n if (target.tag !== \"each\" || (target.at ?? []).length > 0) return undefined;\n const strict = this.#strict(op, rest);\n const kind = (bodyCtx.keys.get(key) as Name).kind;\n const { base, tests: raw } = testsOf(target.axis);\n const tests = raw.flatMap(partsOf);\n const at = tests.findIndex((t) => contains(t, key));\n const test = tests[at];\n if (base.t !== \"all\" || test?.tag !== \"app\" || test.args.length !== 2 || contains(target.body, key) || tests.some((t, i) => i !== at && contains(t, key))) return undefined;\n const [l, r] = test.args as [Expr, Expr];\n const keyFirst = l === key;\n const other = keyFirst ? r : l;\n if ((!keyFirst && r !== key) || contains(other, key)) return undefined;\n const j = this.fresh(\"j\");\n const loop: Ctx = { ...bodyCtx, focus: j, level: 2 };\n const t = this.#hoist(this.expr(other, loop));\n // The test of the key is an op whose inline form cannot fail: then the loop over the items needs no try.\n const site = this.#facts.staticSite(test.op, keyFirst ? [kind, t.v.kind] : [t.v.kind, kind]);\n if (site?.t !== \"fn\" || site.bad || site.returns !== \"boolean\" || this.check(\"boolean\") !== undefined) return undefined;\n // A static site of a domain has the function of the op of that domain.\n const src = functionText(((this.#domains[site.domain] as AnyDomain).ops[test.op] as { fn: (...a: never[]) => unknown }).fn);\n const form = inlineForm(src);\n if (form?.params.length !== 2 || !givesValue(src)) return undefined;\n const before = tests.slice(0, at).map((x) => this.#hoist(this.expr(x, loop)));\n const after = tests.slice(at + 1).map((x) => this.#hoist(this.expr(x, loop)));\n const body = this.#hoist(this.expr(target.body, loop));\n const B = (v: Value): string => this.#boolean(v);\n // The kind of the test of the key: `===` gives the groups of equal values, and `<` or `<=` from T to the key gives\n // the prefixes of the items when T does not decrease. NaN satisfies neither test, so its item is in no group.\n const pattern = patternOf(form, (p) => (keyFirst ? 1 - p : p));\n const mode = pattern === \"#0===#1\" || pattern === \"#1===#0\" ? 1 : [\"#0<#1\", \"#0<=#1\", \"#1>#0\", \"#1>=#0\"].includes(pattern) ? 2 : 0;\n const testArgs = keyFirst ? [\"q\", \"t\"] : [\"t\", \"q\"];\n const keyTest = form.parts.map((p) => (typeof p === \"number\" ? `(${testArgs[p] as string})` : p)).join(\"\");\n if (mode === 1) this.features.add(\"group\");\n if (mode === 2) this.features.add(\"prefix\");\n if (strict) this.features.add(\"strict\");\n const F = this.use(\"F\");\n // A function of the index of an item, from its statements and its value.\n const arrow = (lines: readonly string[], code: string): readonly string[] => (lines.length === 0 ? [`(${j}) => ${code}`] : [`(${j}) => {`, ...ind(lines), ` return ${code};`, \"}\"]);\n const pre = before.length === 0 ? undefined : before.every((x) => x.s.length === 0) ? arrow([], before.map((x) => B(x.v)).join(\" && \")) : arrow(before.flatMap((x, i) => [...x.s, ...(i < before.length - 1 ? [`if (!${B(x.v)}) return false;`] : [])]), B((before.at(-1) as Code).v));\n // The value of an item: the tests after the test of the key, and the body. N is an item that a later test excludes,\n // and E is an error.\n const value =\n after.length === 0 && body.v.safe && body.s.length === 0\n ? arrow([], body.v.code)\n : [`(${j}) => {`, \" try {\", ...ind(ind([...after.flatMap((x) => [...x.s, `if (!${B(x.v)}) return N;`]), ...body.s])), ` return ${body.v.code};`, \" } catch {\", \" return E;\", \" }\", \"}\"];\n const [stepName, stepCode] = STEPS[op] as readonly [string, string];\n this.top.set(stepName, `const ${stepName} = ${stepCode};`);\n // A sum has the check of a number, and only a sum or a mean needs that check.\n const results: Readonly<Record<string, () => readonly [string, string]>> = {\n count: () => [\"r_count\", \"(a, c) => c\"],\n sum: () => [this.check(\"number\") ?? \"r_id\", \"(a) => a\"],\n mean: () => [\"r_mean\", `(a, c) => (c === 0 ? ${F}() : ${this.#checked(\"number\", \"a / c\")})`],\n any: () => [\"r_id\", \"(a) => a\"],\n all: () => [\"r_id\", \"(a) => a\"],\n none: () => [\"r_not\", \"(a) => !a\"],\n };\n const [resultName, resultCode] = results[op]?.() ?? [\"r_one\", `(a, c) => (c === 0 ? ${F}() : a)`];\n if (!this.top.has(resultName)) this.top.set(resultName, `const ${resultName} = ${resultCode};`);\n const a0 = op === \"sum\" || op === \"mean\" ? \"0\" : op === \"all\" ? \"true\" : BOOLEAN_LIST_OPS.has(op) ? \"false\" : \"undefined\";\n // The values of an op of numbers or of booleans have that kind, or the result is an error. Count takes each kind.\n const needs = op === \"count\" ? undefined : listKind(op, undefined);\n const ok = needs === undefined || body.v.kind === needs ? [] : [`(x) => typeof x === \"${needs}\"`];\n if (ok.length > 0) this.features.add(\"ok\");\n if (pre !== undefined) this.features.add(\"pre\");\n const fns = [arrow(t.s, t.v.code), value, [`(t, q) => ${keyTest}`], ...(pre === undefined && ok.length === 0 ? [] : [pre ?? [\"undefined\"]]), ...(ok.length === 0 ? [] : [ok])];\n const lines = fns.flatMap((x, i) => [...x.slice(0, -1), `${x.at(-1) ?? \"\"}${i < fns.length - 1 ? \",\" : \"\"}`]);\n return { lines: [`const ${fn} = ${this.use(\"S\")}(n, ${mode}, ${String(strict)}, ${a0}, ${stepName}, ${resultName},`, ...ind(lines), \");\"], kind: listKind(op, body.v.kind) };\n }\n\n /** This method gives the code of the program at the key of the run. A constant of the run evaluates once. */\n /** This method gives the code of a program at the key `o` of the run. A sheet has one program for each formula. */\n root(expr: Expr): Code {\n // The value of a program and of a cell can be a list (COMPILE.MODULE.LIST.RESULT).\n this.#wantList.add(expr);\n return this.#hoist(this.expr(expr, { origin: \"o\", focus: \"o\", level: 1, originLevel: 1, env: new Map(), fns: new Map(), keys: new Map(), columns: new Map() }));\n }\n\n /** This method removes the declarations that no code reads, after the last program. */\n finish(): void {\n // A function of an op with an inline form at each of its sites needs no declaration.\n for (const [name, form] of this.#forms) if (form !== undefined && !this.#called.has(name)) this.top.delete(name);\n }\n\n /** This method gives the key of an expression at the place of `ctx`. Two expressions with one key have one value. */\n #constKey(e: Expr, ctx: Ctx): string {\n const key = keyText(e, ctx, this.#keyTable);\n keyProbe?.(e, ctx, key, this.#keyTable);\n return key;\n }\n}\n\n/** The function that sees each key of a constant or a column. */\nexport type KeyProbe = (e: Expr, scope: KeyScope, key: string, table: KeyTable) => void;\n\n/** The function that a test of the keys gives, or undefined when no such test runs. */\nlet keyProbe: KeyProbe | undefined;\n\n/** This function gives the result of `emit`, and `probe` sees each key of its printers, after each outer probe. The tests of the keys use it. The probe does not change the printed code. */\nexport function withKeyProbe<T>(probe: KeyProbe, emit: () => T): T {\n const outer = keyProbe;\n keyProbe = (e, scope, key, table): void => {\n outer?.(e, scope, key, table);\n probe(e, scope, key, table);\n };\n try {\n return emit();\n } finally {\n keyProbe = outer;\n }\n}\n\n/** The printers that `listFactsOf` collects, or undefined when no test of the analysis runs. */\nlet recorder: Printer[] | undefined;\n\n/**\n * This function gives the facts of fusion of each list node of the modules that `emit` prints (COMPILE.MODULE.FUSE.FACTS),\n * and the result of `emit`. The tests of the analysis use it. The facts do not change the printed code.\n */\nexport function listFactsOf(emit: () => Emitted): { readonly emitted: Emitted; readonly facts: ReadonlyMap<Expr, ListFacts> } {\n const printers: Printer[] = [];\n recorder = printers;\n try {\n const emitted = emit();\n return { emitted, facts: new Map(printers.flatMap((p) => [...p.listFacts()])) };\n } finally {\n recorder = undefined;\n }\n}\n\n/** This function gives the name of the function of a module, and its space, or the reason that the options are not valid. */\nfunction runOf(options: ModuleOptions): Run | { readonly reason: string } {\n const name = options.name ?? \"run\";\n if (!/^[A-Za-z_$][\\w$]*$/.test(name)) return { reason: `the name \"${name}\" is not a JavaScript name` };\n const space = options.space ?? \"array\";\n if (space !== \"array\" && space !== \"tree\" && space !== \"graph\") return { reason: `the space \"${String(space)}\" is not \"array\", \"tree\" or \"graph\"` };\n // The option fuse changes no code in this version, but a value that is not a boolean is an error of the caller.\n const fuse: unknown = options.fuse ?? true;\n if (typeof fuse !== \"boolean\") return { reason: `the option \"fuse\" is ${String(fuse)}, not true or false` };\n const lists: unknown = options.lists ?? \"envelope\";\n if (lists !== \"envelope\" && lists !== \"plain\") return { reason: `the option \"lists\" is ${String(lists)}, not \"envelope\" or \"plain\"` };\n const keys: unknown = options.keys ?? false;\n if (typeof keys !== \"boolean\") return { reason: `the option \"keys\" is ${String(keys)}, not true or false` };\n return { name, tree: space === \"tree\", graph: space === \"graph\", plain: lists === \"plain\" };\n}\n\n/** The function of a module: its name, its space, and true for the plain form of the lists (COMPILE.MODULE.LIST.PLAIN). */\ninterface Run {\n readonly name: string;\n readonly tree: boolean;\n readonly graph: boolean;\n readonly plain: boolean;\n}\n\n/** This function gives the reason of an error of the printer. Another exception is a defect, so it goes to the caller. */\nfunction reasonOf(thrown: unknown): Emitted {\n if (!(thrown instanceof NotStandalone)) throw thrown;\n return { ok: false, reason: thrown.message };\n}\n\n/**\n * This function gives the code of the check of a field of a record `r` at the position `i`. The check of a list keeps\n * the array of the list when the program reads the field (COMPILE.MODULE.LIST.INPUT). With `plain`, the field holds a\n * plain list (COMPILE.MODULE.LIST.PLAIN). With `flat`, the helper has no argument for the depth. The code is true for a\n * field against the schema.\n */\nfunction fieldCheck(p: Printer, field: string, kind: Kind | ListKind, plain: boolean, flat: boolean): string {\n const input = `r[${JSON.stringify(field)}]`;\n if (typeof kind !== \"object\") return p.against(kind, input);\n const read = listRead(p, input, kind, plain, flat);\n const keep = p.inputs.get(field);\n return `${keep === undefined ? read : `(${keep}[i] = ${read})`} === undefined`;\n}\n\n/** This function gives the code that reads a list of the input with the helper of its form. With `flat`, the helper has no argument for the depth. */\nfunction listRead(p: Printer, input: string, kind: ListKind, plain: boolean, flat: boolean): string {\n const depth = flat ? \"\" : `${String(depthOf(listOfKind(kind)))}, `;\n return `${p.use(plain ? \"LA\" : \"LI\")}(${input}, ${depth}${p.test(leafOf(kind))})`;\n}\n\n/**\n * This function gives the code of the check of a variable of the run. The check of a list keeps the array of the list\n * in the variable of the code when the program reads the variable (COMPILE.MODULE.LIST.VAR). The code is true for a\n * variable against the schema.\n */\nfunction varCheck(p: Printer, name: string, kind: Kind | ListKind, plain: boolean, flat: boolean): string {\n const input = `vars[${JSON.stringify(name)}]`;\n if (typeof kind !== \"object\") return p.against(kind, input);\n const read = listRead(p, input, kind, plain, flat);\n const keep = p.vars.get(name);\n return `${keep === undefined ? read : `(${keep} = ${read})`} === undefined`;\n}\n\n/**\n * This function gives the text of a module: the declarations, the helpers, and the function of the run. The run checks\n * its input, computes the parts of the tree and the constants of the run, and then gives the statements `body`.\n */\nfunction printModule(p: Printer, options: ModuleOptions, run: Run, body: readonly string[]): Emitted {\n p.use(\"C\");\n const helpers = new Set<Helper>();\n // A helper comes after the helpers that it needs. A set keeps the first place of each helper.\n const add = (h: Helper): void => {\n for (const x of NEEDS[h]) add(x);\n helpers.add(h);\n };\n const fields = Object.entries(options.schema.fields ?? {});\n const vars = Object.entries(options.schema.vars ?? {});\n // With no other depth, the list helpers have no argument for the depth (COMPILE.MODULE.SIZE.FLAT).\n const flat = options.fuse !== false && !p.opList && [...fields, ...vars].every(([, k]) => typeof k !== \"object\" || depthOf(listOfKind(k)) === 0);\n let fieldChecks: string;\n let varChecks: string;\n try {\n fieldChecks = fields.map(([f, k]) => ` || ${fieldCheck(p, f, k, run.plain, flat)}`).join(\"\");\n varChecks = vars.map(([v, k]) => ` || ${varCheck(p, v, k, run.plain, flat)}`).join(\"\");\n } catch (thrown) {\n return reasonOf(thrown);\n }\n const { name, tree, graph } = run;\n const isListVar = (v: string): boolean => typeof options.schema.vars?.[v] === \"object\";\n // A tree checks its parents, and it computes the parts that the program reads. The siblings need the children. The\n // order reads only the parents (COMPILE.MODULE.TREE.ALLOC).\n if (tree) p.use(\"PT\");\n if (p.treeParts.has(\"siblings\")) p.treeParts.add(\"children\");\n const parts = ([\"children\", \"siblings\", \"order\"] as const).filter((x) => p.treeParts.has(x));\n for (const x of parts) p.use(TREE_PARTS[x][0]);\n // A graph checks its edges, and it computes the predecessors if the program reads them.\n if (graph) p.use(\"GR\");\n if (p.into) p.use(\"GI\");\n if (p.runKeys) p.use(\"KC\");\n [...p.helpers].toSorted().forEach(add);\n const bad = nameReason(name);\n if (bad !== undefined) return { ok: false, reason: bad };\n const textOf = (h: Helper): string => (h === \"S\" ? helperS(p.features) : flat && (h === \"LI\" || h === \"LA\") ? FLAT_LIST_HELPERS[h] : HELPERS[h]);\n const params = `(records, vars${tree ? \", parents\" : graph ? \", edges\" : \"\"}${p.runKeys ? \", keys\" : \"\"}) {`;\n const start = [\n ' if (!Array.isArray(records)) C(\"the records are not an array\");',\n \" const R = records;\",\n \" const n = R.length;\",\n ...[...p.inputs.values()].map((x) => ` const ${x} = [];`),\n \" for (let i = 0; i < n; i++) {\",\n \" const r = R[i];\",\n ` if (typeof r !== \"object\" || r === null${fieldChecks}) C(\\`the record \\${i} does not keep the schema\\`);`,\n \" }\",\n ...[...p.vars].filter(([v]) => isListVar(v)).map(([, code]) => ` let ${code};`),\n ` if (typeof vars !== \"object\" || vars === null${varChecks}) C(\"the variables do not keep the schema\");`,\n ...(tree ? [\" const P = PT(parents, n);\", ...parts.map((x) => ` ${TREE_PARTS[x][1]}`)] : []),\n ...(graph ? [\" const GO = GR(edges, n);\", ...(p.into ? [\" const GN = GI(GO, n);\"] : [])] : []),\n ...(p.runKeys ? [\" const KM = KC(keys, n);\"] : []),\n ...[...p.vars].filter(([v]) => !isListVar(v)).map(([v, code]) => ` const ${code} = vars[${JSON.stringify(v)}];`),\n ];\n const all: Tidied = { decls: new Map<string, string>([...[...helpers].map((h) => [h as string, textOf(h)] as const), ...p.top]), lines: [...ind(p.run), ...ind(body)] };\n // The text with fuse false stays the form of the version before this pass (COMPILE.MODULE.FUSE.OFF). A dropped print still goes, because it can read a name with no declaration (V-086).\n const small = options.fuse === false ? { ...all, lines: deadConstants(all.lines) } : tidy({ ...all, kept: start.join(\"\\n\"), globals: MODULE_GLOBALS }, options.faults);\n const { decls, lines: statements } = options.faults === \"throw\" ? keepFaults(small, p.copies) : small;\n const textWith = (head: string, tail: readonly string[]): string => [\n \"// Generated by @mark1russell7/vex-compiler from a Vex program. Do not edit.\",\n ERROR_NOTE,\n \"export class VexContractError extends Error {}\",\n \"/** The value of a key where the program gives an error of Vex. */\",\n \"export const VEX_ERROR = Object.freeze({ vexError: true });\",\n \"const E = {};\",\n ...(p.memos ? [\"const Z = {};\"] : []),\n // The values of an item of a node that keeps its items: excluded by a later test, and of the wrong kind.\n ...(decls.has(\"S\") ? [\"const N = {}, W = {};\"] : []),\n ...decls.values(),\n `${head}${params}`,\n ...start,\n ...statements,\n \"}\",\n ...tail,\n \"\",\n ].join(\"\\n\");\n // The check reads each line of the module, with the copies of the ops. The function of the run has no name in that text.\n const code = textWith(\"function\", []);\n // The parse of the names takes time, so it starts only for a name that is a word of the code. The fixed note holds the word `run`.\n const inner = wordsOf(code.replace(ERROR_NOTE, \"\")).includes(name) ? innerName(name, namesOfCode(code)) : name;\n return { ok: true, source: inner === name ? textWith(`export function ${name}`, []) : textWith(`function ${inner}`, [`export { ${inner} as ${name} };`]) };\n}\n\n/**\n * This function gives the module of a print (COMPILE.MODULE.LOOP.EMPTY). The first print keeps the text of each program\n * that it can print. After a reason, more prints look for the kinds that the steps give to the names that start empty.\n * Each print can find more kinds, because a step can read another such name. The last print uses the kinds, so its\n * checks of the steps prove them. A program without such a kind gets the reason of the first print.\n */\nfunction settledPrint(print: (starts: EmptyStarts) => Emitted): Emitted {\n const found: EmptyStarts[\"found\"] = new Map();\n const copies: EmptyStarts[\"copies\"] = new Map();\n const first = print({ found, copies, seek: false });\n if (first.ok) return first;\n for (let size = -1; size !== found.size; ) {\n size = found.size;\n print({ found, copies, seek: true });\n }\n return print({ found, copies, seek: false });\n}\n\n/** This function gives the facts of a node from the facts of two of its places. */\nconst bothPlaces = (a: ListFacts, b: ListFacts): ListFacts => ({ clean: a.clean && b.clean, fresh: a.fresh && b.fresh, inner: b.inner.map((x, i) => x && a.inner[i] === true), reads: Math.max(a.reads, b.reads) });\n\n/** This function gives the expressions of a program with one object at each place, the same copies for each print of the program. */\nfunction copiesOf(program: object, exprs: readonly Expr[], starts: EmptyStarts, shares: boolean): readonly Expr[] {\n const copies = starts.copies.get(program) ?? unsharedAll(exprs, shares);\n starts.copies.set(program, copies);\n return copies;\n}\n\n/**\n * This function prints a module. With the option `keys`, it prints again with the keys of the run when the first print\n * reads a key (COMPILE.MODULE.KEYS). Thus a program that reads no key keeps its text.\n */\nfunction keyedPrint(options: ModuleOptions, print: (keys: KeyPrint) => Emitted): Emitted {\n const keys = { keyed: false, read: false };\n const first = print(keys);\n return keys.read && options.keys === true ? print({ keyed: true, read: true }) : first;\n}\n\n/**\n * This function prints a program as a standalone ES module. The module exports `VexContractError`, `VEX_ERROR` and a\n * function that takes the records and the variables and gives the value at each key. A module of a tree space takes\n * the parents too. The function is pure, so a build can use it. The program can be an expression or a document\n * (DOC.ENTRY).\n *\n * This function is a tool of a build. A print of one module of ireko takes 16 to 172 ms on a CI runner, at 0.833 to\n * 1.149 times the fixed base of COMPILE.MODULE.COST. `docs/COMPILER.md` gives the ms and the ratio of each module. A\n * limit of that gate holds the cost of today. The target of 1.10 for each module is not proven. A caller on a request\n * path keeps the printed module, and it does not print for each request.\n */\nexport function emitModule(source: Expr | Envelope, options: ModuleOptions): Emitted {\n return keyedPrint(options, (keys) => settledPrint((starts) => printProgram(source, options, keys, starts)));\n}\n\n/** This function prints a program for one state of the keys, with the facts `starts`, for `emitModule`. */\nfunction printProgram(source: Expr | Envelope, options: ModuleOptions, keys: KeyPrint, starts: EmptyStarts): Emitted {\n const run = runOf(options);\n if (\"reason\" in run) return { ok: false, reason: run.reason };\n // DOC.ENTRY: a document gives its expression first, or the reason that it is not valid.\n const read = isDocument(source) ? fromDocument(source, options.domains) : { ok: true as const, value: source };\n if (!read.ok) return { ok: false, reason: read.error.message };\n const expr = read.value;\n // COMPILE.PLACES: the walks below take the time of the places, so the count comes first.\n const places = placesRead([expr]);\n if (places.error !== undefined) return { ok: false, reason: places.error };\n // EVAL.SHAPE: a module of an expression that is not valid has no use, so the printer gives the reason.\n const shape = shapeError(expr);\n if (shape !== undefined) return { ok: false, reason: shape };\n // COMPILE.MODULE.NESTING, LOOP.SIZE, STEP.MAX: a module refuses the programs that the interpreter refuses.\n const size = nestingError(expr) ?? sizeError(expr, options) ?? stepError(expr, options) ?? monotoneError(expr, options);\n if (size !== undefined) return { ok: false, reason: size };\n const plain = copiesOf(expr, [expr], starts, places.shares)[0] as Expr;\n const p = new Printer(plain, options, keys, starts);\n let value: Code;\n try {\n value = p.root(plain);\n p.finish();\n } catch (thrown) {\n return reasonOf(thrown);\n }\n // A list gives a vex.list (COMPILE.MODULE.LIST.RESULT), or a plain array (COMPILE.MODULE.LIST.PLAIN).\n const result = value.v.list === undefined ? value.v.code : p.runList(value.v, run.plain);\n const body = [\"const out = new Array(n);\", \"for (let o = 0; o < n; o++) {\", \" try {\", ...ind(ind(value.s)), ` out[o] = ${result};`, \" } catch {\", \" out[o] = VEX_ERROR;\", \" }\", \"}\", \"return out;\"];\n return printModule(p, options, run, body);\n}\n\n/** The budget of the stack of the search of a run of a sheet, as `STACK_BUDGET` of `SheetRun`. */\nconst SHEET_BUDGET = 3000;\n\n/** A formula of a sheet: its column, the position of its cell (undefined for the formula of the column) and its expression. */\ninterface Formula {\n readonly column: string;\n readonly key: number | undefined;\n readonly expr: Expr;\n}\n\n/** This function gives the words for a formula in a reason: the formula of a column, or of one cell. */\nconst formulaText = (f: Formula): string => (f.key === undefined ? `the formula of the column \"${f.column}\"` : `the formula of the cell \"${f.column}\" at \"${String(f.key)}\"`);\n\n/** This function gives the words for a kind in a reason. A list gives the kind of its items. */\nconst kindText = (k: Kind | undefined, l?: ListInfo): string => (l === undefined ? (k ?? \"that the printer does not know\") : `list of ${l.inner === undefined ? kindText(l.item) : kindText(undefined, l.inner)}`);\n\n/** This function gives the number of the levels of lists in the items of a list: 0 for a list of values. */\nconst depthOf = (l: ListInfo): number => (l.inner === undefined ? 0 : 1 + depthOf(l.inner));\n\n/** This function gives the facts of the lists of a column from the kind of the option `kinds` (COMPILE.MODULE.SHEET.LIST). */\nconst listOfKind = (k: ListKind, all = false): ListInfo => {\n const texts = all || k.texts === true;\n return typeof k.list === \"object\" ? { item: undefined, inner: listOfKind(k.list, all), texts } : { item: k.list, texts };\n};\n\n/** This function gives the kind of the items at the bottom of a list kind. */\nconst leafOf = (k: ListKind): Kind => (typeof k.list === \"object\" ? leafOf(k.list) : k.list);\n\n/**\n * This function gives the facts of the lists of a column from the list of its first formula. The other cells of the\n * column can have other formulas. Thus a list without items does not tell that each list of the column is empty.\n */\nconst columnList = (l: ListInfo): ListInfo => ({ item: l.item, inner: l.inner === undefined ? undefined : columnList(l.inner), texts: l.texts === true });\n\n/**\n * This function prints the formula columns of a sheet as a standalone ES module (COMPILE.MODULE.SHEET). The function of\n * the module takes the records and the variables, and the parents for a tree. It gives an object with an array for\n * each column: the result of the column at each key, or `VEX_ERROR`. The results are the results of `SheetRun`.\n *\n * The run fills the columns in the order of `SheetRun.fill`. A read of a finished cell is the read of an array. A read\n * of a cell that is not finished starts the search of `SheetRun`, with the same budget of the stack. Each cell on a\n * cycle of reads gives `VEX_ERROR`.\n */\nexport function emitSheetModule(columns: ReadonlyMap<string, Expr>, options: SheetModuleOptions): Emitted {\n return keyedPrint(options, (keys) => settledPrint((starts) => printSheet(columns, options, keys, starts)));\n}\n\n/** This function prints the columns of a sheet for one state of the keys, with the facts `starts`, for `emitSheetModule`. */\nfunction printSheet(columns: ReadonlyMap<string, Expr>, options: SheetModuleOptions, keyPrint: KeyPrint, starts: EmptyStarts): Emitted {\n const run = runOf(options);\n if (\"reason\" in run) return { ok: false, reason: run.reason };\n const budget = options.budget ?? SHEET_BUDGET;\n if (!Number.isSafeInteger(budget) || budget < 0) return { ok: false, reason: `the budget ${String(budget)} is not a whole number of 0 or more` };\n const cells: CellFormulas = options.cells ?? new Map();\n // A formula of a cell has a position as its key at the time of the build, and the keys of a run come later.\n if (options.keys === true && cells.size > 0) return { ok: false, reason: 'the option \"keys\" with formulas of cells' };\n // COMPILE.PLACES: the walks below take the time of the places, so the count comes first.\n const places = placesRead([...columns.values(), ...[...cells.values()].flatMap((own) => [...own.values()])]);\n if (places.error !== undefined) return { ok: false, reason: places.error };\n const names = [...new Set([...columns.keys(), ...cells.keys()])];\n const order = columnOrder(columns, cells);\n // The formulas in the order of the columns. A key of a cell that is not the text of a position is not a key of the\n // space, so no read finds its formula.\n const formulas: Formula[] = order.flatMap((column): Formula[] => {\n const own = [...(cells.get(column) ?? [])].filter(([k]) => /^(0|[1-9]\\d*)$/.test(k) && Number.isSafeInteger(Number(k)));\n const formula = columns.get(column);\n return [...(formula === undefined ? [] : [{ column, key: undefined, expr: formula }]), ...own.map(([k, expr]) => ({ column, key: Number(k), expr }))];\n });\n for (const f of formulas) {\n // EVAL.SHAPE: the printer gives the reason for an expression that is not valid.\n const shape = shapeError(f.expr);\n const reason = shape ?? nestingError(f.expr) ?? sizeError(f.expr, options) ?? stepError(f.expr, options) ?? monotoneError(f.expr, options);\n if (reason !== undefined) return { ok: false, reason: `${formulaText(f)}: ${reason}` };\n }\n const kinds = new Map<string, Kind | undefined>();\n const lists = new Map<string, ListInfo>();\n for (const [c, k] of Object.entries(options.kinds ?? {})) {\n kinds.set(c, typeof k === \"object\" ? undefined : k);\n if (typeof k === \"object\") lists.set(c, listOfKind(k));\n }\n const index = new Map(names.map((c, i) => [c, i]));\n // The memo of the printer covers each formula, so the formulas share their nodes of the memo.\n // A sheet whose reads all read finished cells needs no search: each cell is the value of its formula\n // (COMPILE.MODULE.SHEET.DIRECT). A sheet with formulas of cells always has the search.\n const direct = formulas.every((f) => f.key === undefined) && order.every((c) => readsFinished(columns, order, c, run.tree));\n const plain = copiesOf(columns, formulas.map((f) => f.expr), starts, places.shares);\n const p = new Printer(rec(Object.fromEntries(plain.map((expr, i) => [`f${String(i)}`, expr]))), options, keyPrint, starts, { columns: index, kinds, lists, direct });\n const fns: string[] = [];\n const decls: string[] = [];\n // The statements that put the value of each formula into the array of its column at the key `o`, for a direct fill.\n const blocks = new Map<string, readonly string[]>();\n try {\n for (const [i, f] of formulas.entries()) {\n const code = p.root(plain[i] as Expr);\n const { kind, list } = code.v;\n // The first formula of a column without a kind of the options gives the kind of the column. Each other formula\n // must give a value of that kind, or a list that fits the lists of the column (COMPILE.MODULE.SHEET.LIST).\n if (!kinds.has(f.column)) {\n kinds.set(f.column, kind);\n if (list !== undefined) lists.set(f.column, columnList(list));\n } else {\n const known = lists.get(f.column);\n if (kinds.get(f.column) !== kind || (known === undefined) !== (list === undefined) || (known !== undefined && !fits(known, list as ListInfo))) {\n throw new NotStandalone(`${formulaText(f)} gives a value of the kind ${kindText(kind, list)}, not of the kind ${kindText(kinds.get(f.column), known)} of its column`);\n }\n }\n // COMPILE.MODULE.ONCE: a direct fill has the code of each formula in its loop over the keys, with no function.\n if (direct) {\n const at = `D[${String(index.get(f.column))}][o]`;\n blocks.set(f.column, code.v.safe && code.s.length === 0 ? [`${at} = ${code.v.code};`] : [\"try {\", ...ind(code.s), ` ${at} = ${code.v.code};`, \"} catch {\", ` ${at} = E;`, \"}\"]);\n continue;\n }\n const fn = p.fresh(\"cf\");\n fns.push(fn);\n decls.push(...(code.v.safe && code.s.length === 0 ? [`const ${fn} = (o) => ${code.v.code};`] : [`const ${fn} = (o) => {`, \" try {\", ...ind(ind(code.s)), ` return ${code.v.code};`, \" } catch {\", \" return E;\", \" }\", \"};\"]));\n }\n p.finish();\n } catch (thrown) {\n return reasonOf(thrown);\n }\n p.use(direct ? \"DO\" : \"SH\");\n // A tree gives the keys in the order of a fill with the helper KO, once for each order.\n const orders = new Map<string, string>();\n const headOf = (c: string): string => {\n const { reverse, post, back } = keyOrderOf(readsOf(columns, cells, c).directions);\n if (!run.tree) return reverse ? \"for (let o = n - 1; o >= 0; o--)\" : \"for (let o = 0; o < n; o++)\";\n const args = `${p.use(\"KO\")}(H, RT, ${String(post)}, ${String(back)})`;\n let keys = orders.get(args);\n if (keys === undefined) {\n keys = p.fresh(\"K\");\n orders.set(args, keys);\n }\n return `for (const o of ${keys})`;\n };\n let fill: string[];\n if (direct) {\n // COMPILE.MODULE.ONCE: the columns that follow each other in the order share one loop over the keys when they have\n // the same order of the keys, and each read of a column of the loop reads a finished cell.\n const loops: { head: string; columns: string[] }[] = [];\n for (const c of order) {\n const head = headOf(c);\n const last = loops.at(-1);\n if (last?.head === head && readsFinished(columns, order, c, run.tree, new Set(last.columns))) last.columns.push(c);\n else loops.push({ head, columns: [c] });\n }\n fill = [];\n for (const { head, columns: cs } of loops) fill.push(`${head} {`, ...cs.flatMap((c) => ind(blocks.get(c) as readonly string[])), \"}\");\n } else {\n // The program of each column, and of each cell with its own formula, with its cost in estimated frames, as in SheetRun.\n const entry = (i: number): string => `[${fns[i] as string}, ${String(3 * nestingOf((formulas[i] as Formula).expr) + 16)}]`;\n const own = names.map((c) => {\n const at = formulas.flatMap((f, i) => (f.column === c && f.key !== undefined ? [`${String(f.key)}: ${entry(i)}`] : []));\n return at.length === 0 ? \"undefined\" : `{ ${at.join(\", \")} }`;\n });\n const cols = names.map((c) => {\n const i = formulas.findIndex((f) => f.column === c && f.key === undefined);\n return i < 0 ? \"undefined\" : entry(i);\n });\n decls.push(`const SS = SH(n, [${cols.join(\", \")}], [${own.join(\", \")}], ${String(budget)});`, `const ${READ_CELL} = SS.r;`);\n fill = order.map((c) => `${headOf(c)} SS.f(${String(index.get(c))}, o);`);\n }\n if (run.tree) p.treeParts.add(\"children\");\n // A column of lists gives a vex.list in each cell with a list (COMPILE.MODULE.LIST.RESULT), or a plain array\n // (COMPILE.MODULE.LIST.PLAIN).\n const resultOf = (c: string, read: string): string => {\n const l = lists.get(c);\n return l === undefined ? read : `${p.use(run.plain ? \"LCP\" : \"LC\")}(${read}, ${String(depthOf(l))})`;\n };\n const body = [\n ...(direct ? [`const D = [${names.map(() => \"new Array(n)\").join(\", \")}];`] : decls),\n ...[...orders].map(([args, keys]) => `const ${keys} = ${args};`),\n ...fill,\n `return { ${names.map((c, i) => `${JSON.stringify(c)}: ${resultOf(c, direct ? `DO(D[${String(i)}])` : `SS.o(${String(i)})`)}`).join(\", \")} };`,\n ];\n return printModule(p, options, run, body);\n}\n"],"mappings":";;;;;;;;;;;;AAqBA,MAAM,WAAW;;AAGjB,SAAS,WAAW,MAAyB;CAC3C,MAAM,GAAG,QAAQ,KAAK;CACtB,OAAO,KAAK,QAAQ,SAAS,YAAY,K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A;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,IAAI;CACX,IAAI;CAIJ,IAAI;EACF;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,IAAI;CACX,IAAI;EACF;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,IAAI;CAEX,IAAI;CACJ,IAAI;CAKJ,IAAI;EACF;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,IAAI;CACX,IAAI;EACF;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,IAAI;CAGX,IAAI;CACJ,IAAI;CAIJ,IAAI;EACF;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,IAAI;CAIX,IAAI;EACF;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,IAAI;CAIX,IAAI;CACJ,IAAI;CAOJ,IAAI;CAIJ,IAAI;CACJ,IAAI;CACJ,IAAI;EACF;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,IAAI;CACX,IAAI;EACF;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,IAAI;CAKX,IAAI;EACF;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,IAAI;CAEX,IAAI;EACF;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,IAAI;CAGX,IAAI;EACF;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,IAAI;CAEX,IAAI;CAGJ,IAAI;EACF;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,IAAI;CAEX,IAAI;EACF;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,IAAI;CAEX,IAAI;EACF;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,IAAI;CAGX,IAAI;EACF;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,IAAI;CACX,IAAI;CACJ,IAAI;CACJ,IAAI;CAEJ,IAAI;CAGJ,IAAI;EACF;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,IAAI;CAEX,IAAI;CAEJ,IAAI;CAKJ,IAAI;CAGJ,IAAI;CAGJ,IAAI;CAGJ,IAAI;CAKJ,IAAI;EACF;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,IAAI;CAIX,KAAK;EACH;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,IAAI;CACX,KAAK;EACH;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,IAAI;CAMX,KAAK;EACH;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,IAAI;CAIX,KAAK;EACH;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,IAAI;CACX,KAAK;CACL,KAAK;CAEL,KAAK;CACL,KAAK;CAGL,IAAI;CACJ,KAAK;CACL,KAAK;EACH;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,IAAI;CACX,KAAK;CACL,KAAK;EACH;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,IAAI;CACX,KAAK;CACL,KAAK;EACH;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,IAAI;CACX,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CAEL,KAAK;EACH;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,IAAI;CAEX,IAAI;CAEJ,KAAK;CACL,IAAI;EACF;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,IAAI;CAGX,IAAI;EACF;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,IAAI;CAEX,IAAI;EACF;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,IAAI;CACX,GAAG;EACD;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,IAAI;AACb;;;;;AAMA,MAAa,iBAAsC,IAAI,IAAI,qEAAqE,MAAM,GAAG,CAAC;;;;;;;;;;;;;;AAkB1I,MAAM,WAAW,QAAsC;CACrD,M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AK,EAAE;EAC/D,GAAG;EACH,YAAY,MAAM,KAAK,GAAG,MAAM,GAAG,KAAK,UAAU,CAAC,EAAE,IAAI,SAAS,GAAG,SAAS,QAAQ,OAAO,CAAC,EAAE,MAAM,QAAQ,OAAO,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,KAAK,IAAI,EAAE;CAErG,CAAC;AAC1C"}
1
+ {"version":3,"file":"module-entry.js","names":["NOT_VALUES","within","formOf","testsOf","spaces"],"sources":["../src/fn-text.ts","../src/module-tidy.ts","../src/scope-key.ts","../src/sheet-order.ts","../src/module.ts"],"sourcesContent":["/**\n * The text of a function of a domain (COMPILE.MODULE.TEXT). JavaScript gives a text that depends on the loader.\n * A runner can keep the spaces of the types, drop parentheses or change a quote. A module copies such a text,\n * so this file parses it and prints the tree. Equal trees give equal bytes under each runner.\n */\nimport { parseExpressionAt } from \"acorn\";\nimport { GENERATOR, generate, type Generator, type State } from \"astring\";\n\n/** A node of the tree. The printer reads only these fields. */\ninterface TreeNode {\n readonly type: string;\n readonly value?: unknown;\n readonly name?: string;\n readonly callee?: TreeNode;\n readonly arguments?: readonly TreeNode[];\n}\n\n/** The printer of one kind of node. */\ntype Print = (node: TreeNode, state: State) => void;\n\n/** The printers of the kinds of nodes that the default printer does not change. */\nconst PRINTERS = GENERATOR as unknown as Readonly<Record<string, Print>>;\n\n/** This function tells if a call only names a function: the runner `tsx` wraps each named function in such a call. */\nfunction isNameCall(node: TreeNode): boolean {\n const [, name] = node.arguments as readonly TreeNode[];\n return node.callee?.name === \"__name\" && node.arguments?.length === 2 && typeof name?.value === \"string\";\n}\n\n/** The printers that give one form to each literal, and that remove a call that only names a function. */\nconst TEXT_PRINTERS: Readonly<Record<string, Print>> = {\n ...PRINTERS,\n Literal: (node, state) => {\n if (typeof node.value === \"string\") state.write(JSON.stringify(node.value));\n else if (typeof node.value === \"number\" && Number.isFinite(node.value)) state.write(String(node.value));\n else (PRINTERS[\"Literal\"] as Print)(node, state);\n },\n CallExpression(node, state) {\n const [fn] = node.arguments as readonly TreeNode[];\n if (isNameCall(node)) (TEXT_PRINTERS[(fn as TreeNode).type] as Print).call(TEXT_PRINTERS, fn as TreeNode, state);\n else (PRINTERS[\"CallExpression\"] as Print).call(TEXT_PRINTERS, node, state);\n },\n};\n\n/**\n * This function gives the text of a function, in one form for each runner. A text that does not parse as one expression\n * stays as it is, for example a method or a native function. A module refuses such a text when it tries the copy.\n */\nexport function functionText(f: (...a: never[]) => unknown): string {\n const raw = Function.prototype.toString.call(f);\n try {\n const tree = parseExpressionAt(raw, 0, { ecmaVersion: \"latest\" });\n if (tree.end !== raw.length) return raw;\n return generate(tree, { generator: TEXT_PRINTERS as unknown as Generator, indent: \"\", lineEnd: \" \" });\n } catch {\n return raw;\n }\n}\n","/**\n * The last pass of the printer of a module (`COMPILER.md` §4.4, COMPILE.MODULE.SIZE). This pass reads the lines of a\n * printed run, and it removes code that gives no value. It does not change the value of a run, an error of a run or a\n * refusal of the printer.\n *\n * The printer gives one statement on each line, and each block adds two spaces. A name with digits is a fresh name of\n * the printer. A text of a program can hold each word, so each count of a word here also counts the words in a text. A\n * count that is too high only stops a rule. A rule that writes code reads the tokens of the code (`rewritten`), so it\n * does not change a text.\n */\nimport { type Token, tokenizer, tokTypes } from \"acorn\";\n\n\n/** The parts of a module for the pass. */\nexport interface TidyParts {\n /** The helpers and the declarations at the top of the module, by name, in their order. */\n readonly decls: ReadonlyMap<string, string>;\n /** The statements of the run that this pass can change: the constants of the run and the body. */\n readonly lines: readonly string[];\n /** The other text of the module. This pass does not change it, and each name that it reads stays. */\n readonly kept: string;\n /** The globals that a function of an op can read at each place of the module. */\n readonly globals: ReadonlySet<string>;\n}\n\n/** The result of the pass: the declarations that stay, and the statements of the run. */\nexport interface Tidied {\n readonly decls: ReadonlyMap<string, string>;\n readonly lines: readonly string[];\n}\n\n/** The tokens that hold a text of the code: a string, a part of a template and a regular expression. */\nconst TEXT_TOKENS: ReadonlySet<unknown> = new Set([tokTypes.string, tokTypes.template, tokTypes.regexp]);\n\n// Each pattern of this file is a function that gives a new regular expression. Thus a mutant of a pattern starts only the\n// tests that use the pattern, not each test of the mutation lane (LANE.STATIC).\n\n/** A text of the code starts with one of these characters. A comment starts with the slash too. */\n// Stryker disable next-line Regex: `rewritten` calls `codeOf` on a line with a match, so a form that finds other characters also finds that line.\nconst TEXT_START = (): RegExp => /[\"'`/]/;\n\n/** This function gives a line of code with spaces at the place of each text. Each other character keeps its offset. A line with no text needs no tokens. */\nfunction codeOf(line: string): string {\n if (!TEXT_START().test(line)) return line;\n let out = \"\";\n let at = 0;\n for (const token of tokenizer(line, { ecmaVersion: \"latest\" })) {\n if (!TEXT_TOKENS.has(token.type)) continue;\n out += line.slice(at, token.start) + \" \".repeat(token.end - token.start);\n at = token.end;\n }\n return out + line.slice(at);\n}\n\n/**\n * This function writes each match of `find` in the code of a line. A match in a text does not count, and each text\n * keeps its characters. `find` must have the flag `g`. A line with no match needs no tokens.\n */\nfunction rewritten(line: string, find: RegExp, write: (match: RegExpExecArray) => string): string {\n if (line.search(find) < 0) return line;\n let out = \"\";\n let at = 0;\n for (const match of codeOf(line).matchAll(find)) {\n out += line.slice(at, match.index) + write(match);\n at = match.index + match[0].length;\n }\n return out + line.slice(at);\n}\n\n/** This function gives the names in code. A word in a comment or in a text is not a name. */\nexport function namesOfCode(code: string): ReadonlySet<string> {\n const names = new Set<string>();\n for (const token of tokenizer(code, { ecmaVersion: \"latest\", sourceType: \"module\" })) if (token.type === tokTypes.name) names.add((token as Token & { readonly value: string }).value);\n return names;\n}\n\n/** The words of a text. */\nconst WORD = (): RegExp => /[A-Za-z_$][\\w$]*/g;\n\n/** This function gives the words of a text. */\nexport const wordsOf = (text: string): readonly string[] => text.match(WORD()) ?? [];\n\n/** This function gives the count of a word in some lines. A line without the text of the word needs no walk. */\nfunction countOf(lines: readonly string[], name: string): number {\n let sum = 0;\n for (const x of lines) {\n // Stryker disable next-line ConditionalExpression: a line without the text has no such word, so this test only saves the walk.\n if (x.includes(name)) sum += wordsOf(x).filter((w) => w === name).length;\n }\n return sum;\n}\n\n/** This function gives the number of spaces at the start of a line. */\nconst indentOf = (line: string): number => line.length - line.trimStart().length;\n\n/** This function gives the first line after `at` that is not in the block of the line `at`. */\nfunction blockEnd(lines: readonly string[], at: number): number {\n const indent = indentOf(lines[at] as string);\n let end = at + 1;\n while (end < lines.length && indentOf(lines[end] as string) >= indent) end++;\n return end;\n}\n\n/** This function gives the line that opens the block of the line `at`, or -1 at the top of the run. */\nfunction openerOf(lines: readonly string[], at: number): number {\n const indent = indentOf(lines[at] as string);\n let k = at - 1;\n while (k >= 0 && indentOf(lines[k] as string) >= indent) k--;\n return k;\n}\n\n/** The line of a function that a block opens. */\nconst FUNCTION_HEAD = (): RegExp => /=> \\{$|\\bfunction\\b.*\\{$/;\n\n/** This function gives the line that opens the function of the line `at`, or -1 for the function of the run. */\nfunction functionOf(lines: readonly string[], at: number): number {\n const head = FUNCTION_HEAD();\n let k = openerOf(lines, at);\n while (k >= 0 && !head.test(lines[k] as string)) k = openerOf(lines, k);\n return k;\n}\n\n/** The key of an item of a list in a loop. The head of the loop must come just before it (`deadKeys`). */\nconst KEY_READ = (): RegExp => /^\\s*const (j\\d+) = ([A-Za-z]+\\d*)\\[(q\\d+)\\](\\[0\\])?;$/;\n\n/**\n * This function removes each read of a key that no code reads (COMPILE.MODULE.SIZE.KEY). The read must be the first line\n * of the loop of its position. A read of a pair must also have a loop over the length of its array. An item of a list\n * is a pair, so the read cannot throw.\n */\nexport function deadKeys(lines: readonly string[]): readonly string[] {\n const keyRead = KEY_READ();\n return lines.filter((line, i) => {\n const m = keyRead.exec(line);\n if (m === null) return true;\n const [, key, array, position, pair] = m as unknown as readonly [string, string, string, string, string | undefined];\n const head = lines[i - 1] ?? \"\";\n const loop = head.trimStart().startsWith(`for (let ${position} = `) && (pair === undefined || new RegExp(`(?<![\\\\w$.])${array}\\\\.length`).test(head));\n return !loop || countOf(lines.slice(i + 1, blockEnd(lines, i)), key) > 0;\n });\n}\n\n/**\n * This function gives a line with each read of the name `from` as a read of the name `to`. A property, a key of an\n * object and a part of a longer word are not reads. A spread reads its name.\n */\nfunction renamed(line: string, from: string, to: string): string {\n const read = new RegExp(`(?<![\\\\w$])(?<!(?<!\\\\.\\\\.)\\\\.)(?:(?<![{,]\\\\s*)${from}|${from}(?!\\\\s*:))(?![\\\\w$])`, \"g\");\n return rewritten(line, read, () => to);\n}\n\n/** The writes to a name. The first group holds the name after `++` or `--`, and the second group the name before an operator. */\nconst WRITE = (): RegExp => /(?:\\+\\+|--)\\s*([A-Za-z_$][\\w$]*)|(?<![\\w$.])(?<!\\b(?:const|let) )([A-Za-z_$][\\w$]*)\\s*(?:\\+\\+|--|(?:[-+*/%&|^]|<<|>>>?|\\*\\*|&&|\\|\\||\\?\\?)?=(?![=>]))/g;\n\n/** This function gives the lines that write to each name, without the line that declares the name. */\nfunction writesOf(lines: readonly string[]): ReadonlyMap<string, readonly number[]> {\n const writes = new Map<string, number[]>();\n const write = WRITE();\n for (const [i, line] of lines.entries()) {\n for (const m of line.matchAll(write)) {\n const name = (m[1] ?? m[2]) as string;\n writes.set(name, [...(writes.get(name) ?? []), i]);\n }\n }\n return writes;\n}\n\n/** This function tells if a line declares a name, also as a parameter of a function. */\nfunction binds(line: string, name: string): boolean {\n // Stryker disable next-line ConditionalExpression: a line without the name has no declaration of it, so this test only saves the pattern.\n if (!line.includes(name)) return false;\n const word = `(?<![\\\\w$])${name}(?![\\\\w$])`;\n return new RegExp(`\\\\b(?:const|let)\\\\s+(?:[^;=]*,\\\\s*|\\\\[[^\\\\]]*)?${word}|\\\\([^()]*${word}[^()]*\\\\)\\\\s*=>|${word}\\\\s*=>|\\\\bfunction\\\\b[^(]*\\\\([^)]*${word}`).test(line);\n}\n\n/** A statement that gives a new name to a fresh name, or to `o`, the key of a run. */\nconst ALIAS = (): RegExp => /^\\s*const ([A-Za-z]+\\d+) = ([A-Za-z]+\\d+|o);$/;\n\n/**\n * This function tells if the name `name` keeps its value from the line `at` to the line `end`. A name with no write\n * keeps its value. Else no line in that part can write to it. That part must also have no function, because a function\n * can read the name after a later write. Each other write and the declaration must be in the function of the line\n * `at`, because a call cannot then start them. A write in a line with a function has an unknown place.\n */\nfunction keeps(lines: readonly string[], writes: readonly number[], name: string, at: number, end: number): boolean {\n if (writes.length === 0) return true;\n if (writes.some((x) => x > at && x < end) || lines.slice(at, end).some((x) => x.includes(\"=>\") || /\\bfunction\\b/.test(x))) return false;\n const home = functionOf(lines, at);\n const declared = lines.flatMap((x, i) => (binds(x, name) ? [i] : []));\n return declared.length > 0 && [...writes, ...declared].every((x) => !(lines[x] as string).includes(\"=>\") && functionOf(lines, x) === home);\n}\n\n/**\n * This function removes each alias whose two names hold one value in the whole block of the alias. Each read of the\n * alias reads the first name (COMPILE.MODULE.SIZE.ALIAS).\n */\nexport function aliases(lines: readonly string[]): readonly string[] {\n const out = [...lines];\n const writes = writesOf(lines);\n const gone = new Set<number>();\n const statement = ALIAS();\n for (let i = 0; i < out.length; i++) {\n const m = statement.exec(out[i] as string);\n if (m === null) continue;\n const [, alias, name] = m as unknown as readonly [string, string, string];\n const end = blockEnd(out, i);\n const block = out.slice(i + 1, end);\n // Each read of the alias must be in its block, and no line of that block can give either name another meaning. The\n // printer prints the steps of a stopped walk two times, so a nested block can declare the alias again (V-073).\n if (countOf(out, alias) !== 1 + countOf(block, alias) || block.some((x) => binds(x, name) || binds(x, alias)) || !keeps(out, writes.get(name) ?? [], name, i, end)) continue;\n for (let k = i + 1; k < end; k++) {\n const x = out[k] as string;\n // Stryker disable next-line ConditionalExpression: a line without the alias stays as it is, so this test only saves the pattern.\n if (x.includes(alias)) out[k] = renamed(x, alias, name);\n }\n gone.add(i);\n }\n return out.filter((_, i) => !gone.has(i));\n}\n\n/** The first line of a lazy cell of the run. */\nconst CELL = (): RegExp => /^ {2}const (c\\d+) = L\\(\\(\\) => \\{$/;\n\n/** The first line of a lazy cell at each place. */\nconst ANY_CELL = (): RegExp => /^\\s*const \\w+ = L\\(\\(\\) => \\{$/;\n\n/** The blocks that run each statement at most once, for one run of the block around them. */\nconst ONCE_BLOCK = (): RegExp => /^\\s*(?:try \\{|\\} catch \\{|\\} else \\{|(?:\\} else )?if \\(.*\\) \\{)$/;\n\n/** The statements that can run a part of their line more than once. */\nconst LOOP_LINE = (): RegExp => /^\\s*(?:for|while|do)\\b|=>/;\n\n/** This function tells if the statement at the line `at` runs at most once in a run. */\nfunction runsOnce(lines: readonly string[], at: number): boolean {\n if (LOOP_LINE().test(lines[at] as string)) return false;\n const cell = ANY_CELL();\n const once = ONCE_BLOCK();\n for (let k = openerOf(lines, at); k >= 0; k = openerOf(lines, k)) {\n const line = lines[k] as string;\n if (cell.test(line)) return true;\n if (!once.test(line)) return false;\n }\n return true;\n}\n\n/**\n * This function prints a lazy cell with one read at that read (COMPILE.MODULE.SIZE.ONCE). The cell must be one\n * `return`, and the read must be `G(c())`. The read must run at most once, so the value evaluates at most once and at\n * the same time. `G` stays, because the value can be the sentinel. Each catch of a module takes each exception.\n */\nexport function onceCells(lines: readonly string[]): readonly string[] {\n let out = lines;\n const cell = CELL();\n for (let i = 0; i + 2 < out.length; i++) {\n const name = cell.exec(out[i] as string)?.[1];\n const value = /^ {4}return (.*);$/.exec(out[i + 1] as string)?.[1];\n if (name === undefined || value === undefined || out[i + 2] !== \" });\" || countOf(out, name) !== 2) continue;\n const read = new RegExp(`(?<![\\\\w$.])G\\\\(${name}\\\\(\\\\)\\\\)`, \"g\");\n const inlined = (x: string): string => rewritten(x, read, () => `G(${value})`);\n const site = out.findIndex((x) => inlined(x) !== x);\n if (site < 0 || !runsOnce(out, site)) continue;\n out = out.flatMap((x, k) => (k === site ? [inlined(x)] : k >= i && k <= i + 2 ? [] : [x]));\n i = -1;\n }\n return out;\n}\n\n/** A constant of the run on one line, with its name. */\nconst CONSTANT = (): RegExp => /^ {2}const (c\\d+) = (?:T\\(\\(\\) => .*\\)|\\[\\]);$/;\n\n/** The first line of a constant of the run with a `try`, with its name. */\nconst HELD = (): RegExp => /^ {2}let (c\\d+);$/;\n\n/** The first line of a column at each depth, with its indent and its name. A column does not run until a read calls it. */\nconst COLUMN = (): RegExp => /^( *)const (col\\d+) = Q\\(\\(\\w+\\) => \\{$/;\n\n/** The variable of the pack of a column at each depth, with its name. */\nconst PACK = (): RegExp => /^ *let (PK\\d+);$/;\n\n/** This function gives the name of the declaration at the line `at` and its last line, or `undefined` for another line. */\nfunction constantAt(lines: readonly string[], at: number): { readonly name: string; readonly last: number } | undefined {\n const line = lines[at] as string;\n const one = CONSTANT().exec(line)?.[1];\n if (one !== undefined) return { name: one, last: at };\n const lazy = CELL().exec(line)?.[1];\n if (lazy !== undefined) return { name: lazy, last: lines.indexOf(\" });\", at) };\n const column = COLUMN().exec(line);\n if (column !== null) return { name: column[2] as string, last: lines.indexOf(`${column[1] as string}});`, at) };\n const pack = PACK().exec(line)?.[1];\n if (pack !== undefined) return { name: pack, last: at };\n const held = HELD().exec(line)?.[1];\n return held === undefined || lines[at + 1] !== \" try {\" ? undefined : { name: held, last: lines.indexOf(\" }\", at) };\n}\n\n/** This function gives the count of each word of some lines. */\nfunction wordCounts(lines: readonly string[]): Map<string, number> {\n const counts = new Map<string, number>();\n for (const w of wordsOf(lines.join(\"\\n\"))) counts.set(w, (counts.get(w) ?? 0) + 1);\n return counts;\n}\n\n/**\n * This function removes each constant of the run that no code reads (COMPILE.MODULE.SIZE.DEAD). The code of a constant\n * has no effect, and the constant holds each failure of that code. A lazy cell with no read does not run. A print that\n * the printer drops leaves its columns and their packs, in the run and in a function, so the pass removes these too. The\n * parameters of a function come from the code that it keeps, so such a column can read a name with no declaration.\n */\nexport function deadConstants(lines: readonly string[]): readonly string[] {\n let out = lines;\n const counts = wordCounts(lines);\n for (let i = 0; i < out.length; i++) {\n const c = constantAt(out, i);\n if (c === undefined) continue;\n const own = wordCounts(out.slice(i, c.last + 1));\n if (counts.get(c.name) !== own.get(c.name)) continue;\n out = [...out.slice(0, i), ...out.slice(c.last + 1)];\n for (const [word, count] of own) counts.set(word, (counts.get(word) as number) - count);\n i = -1;\n }\n return out;\n}\n\n/** This function gives the declarations that the text `roots` reads, also through other declarations. */\nexport function liveDecls(decls: ReadonlyMap<string, string>, roots: string): ReadonlyMap<string, string> {\n const live = new Set<string>();\n const stack = [...wordsOf(roots)];\n for (let w = stack.pop(); w !== undefined; w = stack.pop()) {\n const text = decls.get(w);\n if (text === undefined || live.has(w)) continue;\n live.add(w);\n stack.push(...wordsOf(text));\n }\n return new Map([...decls].filter(([name]) => live.has(name)));\n}\n\n/** The tokens of the body of a function of an op. A body with another token has no inline form. */\nconst BODY_TOKEN = (): RegExp => /\\s+|\"(?:[^\"\\\\\\n]|\\\\.)*\"|'(?:[^'\\\\\\n]|\\\\.)*'|\\.{3}|\\.\\d\\w*|\\d[\\w.]*|\\.[A-Za-z_$][\\w$]*|[A-Za-z_$][\\w$]*|===|!==|\\?\\?|&&|\\|\\||\\*\\*|<<|>>>|>>|==|!=|<=|>=|\\+\\+|--|=>|\\?\\.|[-+*/%<>!?:,&|^~()[\\]{}]/y;\n\n/** The tokens that change a value or start a function. */\nconst NOT_INLINE: ReadonlySet<string> = new Set([\"++\", \"--\", \"=>\"]);\n\n/** The words that an inline body can read at each place of a module. */\nconst PLAIN_WORDS: ReadonlySet<string> = new Set([\"true\", \"false\", \"null\", \"NaN\", \"Infinity\", \"typeof\", \"void\"]);\n\n/** The words that end no value, so a slash after them starts a regular expression. */\nconst NOT_VALUES: ReadonlySet<string> = new Set([\"typeof\", \"void\"]);\n\n/** This function gives the tokens of a body, or `undefined` for a body with another token. */\nfunction tokensOf(body: string): readonly string[] | undefined {\n const out: string[] = [];\n const token = BODY_TOKEN();\n while (token.lastIndex < body.length) {\n const m = token.exec(body);\n if (m === null || NOT_INLINE.has(m[0])) return undefined;\n out.push(m[0]);\n }\n return out;\n}\n\n/** This function tells if a token ends a value, so a slash after it is a division. */\nconst endsValue = (t: string): boolean => t === \")\" || t === \"]\" || t === \"}\" || (/^[\\w$.\"']/.test(t) && t !== \"...\" && !NOT_VALUES.has(t));\n\n/** This function tells if a token is a name or a word of the language. */\nconst isWord = (t: string): boolean => /^[A-Za-z_$]/.test(t);\n\n/** This function tells if a token is a space. */\nconst isSpace = (t: string): boolean => /^\\s/.test(t);\n\n/** The part of an inline body: a text, or the index of a parameter. */\ntype BodyPart = string | number;\n\n/**\n * This function gives the parts of the body of an arrow function, or `undefined` for a body that a site cannot hold.\n * The body must be an expression with no assignment and no function. Each of its words must be a parameter, a global or\n * a key of an object. Thus a local name of the site cannot take the place of a word of the body.\n */\nfunction bodyParts(params: readonly string[], body: string, globals: ReadonlySet<string>): readonly BodyPart[] | undefined {\n const tokens = tokensOf(body.trim());\n if (tokens === undefined || tokens[0] === \"{\") return undefined;\n const parts: BodyPart[] = [];\n const open: string[] = [];\n let last = \"\";\n for (const [i, t] of tokens.entries()) {\n if (isSpace(t)) {\n parts.push(\" \");\n continue;\n }\n const next = tokens.slice(i + 1).find((x) => !isSpace(x));\n if (t === \"/\" && !endsValue(last)) return undefined;\n if (t === \"(\" || t === \"[\" || t === \"{\") open.push(t);\n if (t === \")\" || t === \"]\" || t === \"}\") open.pop();\n const at = params.indexOf(t);\n const key = open.at(-1) === \"{\" && (last === \"{\" || last === \",\");\n // A word after an optional chain is the name of a key, as the token `.x` of a plain read (V-098).\n if (!isWord(t) || last === \"?.\" || (key && next === \":\")) parts.push(t);\n else if (key && next !== \",\" && next !== \"}\") return undefined;\n else if (at >= 0) parts.push(...(key ? [`${t}:`, at] : [at]));\n else if (PLAIN_WORDS.has(t) || globals.has(t)) parts.push(t);\n else return undefined;\n last = t;\n }\n return parts;\n}\n\n/** The declaration of a function of an op or of a check of a domain, as an arrow function. */\nconst OP_DECL = (): RegExp => /^const ((?:op|v)_\\w+) = (?:\\(([\\w$,\\s]*)\\)|([A-Za-z_$][\\w$]*))\\s*=>([\\s\\S]*);$/;\n\n/** The name, the parameters and the parts of an inline form. */\ninterface OpForm {\n readonly name: string;\n readonly params: readonly string[];\n readonly parts: readonly BodyPart[];\n}\n\n/** This function gives the form of a declaration, or `undefined` for a declaration without one. */\nfunction opForm(text: string, globals: ReadonlySet<string>): OpForm | undefined {\n const m = OP_DECL().exec(text);\n if (m === null) return undefined;\n const params = (m[2] ?? m[3] ?? \"\").split(\",\").map((x) => x.trim()).filter((x) => x !== \"\");\n const parts = bodyParts(params, m[4] as string, globals);\n return parts === undefined || params.length === 0 ? undefined : { name: m[1] as string, params, parts };\n}\n\n/**\n * This function gives a text with the call of `f` as its body. It gives `undefined` when the text has no call with a\n * name for each argument.\n */\nfunction withSite(text: string, f: OpForm): string | undefined {\n const site = new RegExp(`(?<![\\\\w$.])${f.name}\\\\(([A-Za-z_$][\\\\w$]*(?:, [A-Za-z_$][\\\\w$]*)*)\\\\)`, \"g\");\n const out = rewritten(text, site, (match) => {\n const args = (match[1] as string).split(\", \");\n return args.length === f.params.length ? `(${f.parts.map((p) => (typeof p === \"number\" ? (args[p] as string) : p)).join(\"\")})` : match[0];\n });\n return out === text ? undefined : out;\n}\n\n/**\n * This function prints each function of an op with one call at that call (COMPILE.MODULE.SIZE.INLINE). Each argument\n * must be a name, so the arguments have no order, and a second read of a parameter reads the same value.\n */\nexport function inlineOps(parts: TidyParts): Tidied {\n const { kept, globals } = parts;\n const decls = new Map(parts.decls);\n const lines = [...parts.lines];\n const counts = new Map<string, number>();\n for (const w of wordsOf([kept, ...decls.values(), ...lines].join(\"\\n\"))) counts.set(w, (counts.get(w) ?? 0) + 1);\n for (const [name, text] of parts.decls) {\n const f = counts.get(name) === 2 ? opForm(text, globals) : undefined;\n if (f === undefined) continue;\n const at = lines.findIndex((x) => withSite(x, f) !== undefined);\n if (at >= 0) {\n lines[at] = withSite(lines[at] as string, f) as string;\n decls.delete(name);\n continue;\n }\n // A check of the result of an op calls the check of its domain.\n const check = [...decls].find(([k, x]) => k.startsWith(\"k_\") && withSite(x, f) !== undefined);\n if (check !== undefined) {\n decls.set(check[0], withSite(check[1], f) as string);\n decls.delete(name);\n }\n }\n return { decls, lines };\n}\n\n/** The helper of a catch that keeps only the error of Vex (COMPILE.MODULE.FAULT). */\nconst FAULT_KEEP = \"function FK(x) { if (x !== E) throw x; }\";\n/** The helper that gives the error of Vex for each exception of a copy of a function of a domain. */\nconst FAULT_WRAP = \"function FW(f) { return (...a) => { try { return f(...a); } catch { throw E; } }; }\";\n\n/** This function gives a line where each catch rethrows each value that is not the error of Vex. */\nfunction narrowCatches(line: string): string {\n return rewritten(line, /catch \\{/g, () => \"catch ($f) { FK($f);\");\n}\n\n/** This function gives the declaration of a copy of a function of a domain, inside the wrapper. */\nfunction wrapFaults(name: string, text: string): string {\n return `const ${name} = FW(${text.slice(`const ${name} = `.length, -1)});`;\n}\n\n/**\n * This function gives the form of a module where a catch keeps only the error of Vex (COMPILE.MODULE.FAULT). The start\n * of a fault tells the two cases. A copy of a function of a domain gives the error of Vex for each exception, as in the\n * interpreter. Another exception comes from the printed code, and it leaves the run.\n */\nexport function keepFaults(parts: Tidied, copies: ReadonlySet<string>): Tidied {\n const decls = new Map([...parts.decls].map(([name, text]) => [name, copies.has(name) ? wrapFaults(name, text) : narrowCatches(text)]));\n decls.set(\"FK\", FAULT_KEEP);\n decls.set(\"FW\", FAULT_WRAP);\n return { decls, lines: parts.lines.map(narrowCatches) };\n}\n\n/**\n * This function gives the smaller form of a module, with the same behavior (COMPILE.MODULE.SIZE). With `faults` at\n * `throw`, each function of a domain stays a declaration, so the wrapper of `keepFaults` holds each of its exceptions.\n */\nexport function tidy(parts: TidyParts, faults: \"value\" | \"throw\" = \"value\"): Tidied {\n const lines = deadConstants(onceCells(deadConstants(aliases(deadKeys(parts.lines)))));\n const live = liveDecls(parts.decls, [parts.kept, ...lines].join(\"\\n\"));\n const small = faults === \"throw\" ? { decls: live, lines } : inlineOps({ ...parts, decls: live, lines });\n return { decls: liveDecls(small.decls, [parts.kept, ...small.lines].join(\"\\n\")), lines: small.lines };\n}\n","/**\n * The key of an expression at a place of a module. Two expressions at their places have one key only if they have one\n * value. A key holds what each read of the expression means at that place. A read of a name that the expression binds\n * keeps its spelling, because the structure of the key holds its binder. Another read gives a token of its meaning.\n * The root and `./module` of this package do not export this file.\n *\n * A table walks each expression once and keeps its form. A form holds the number of its structure with a hole at each\n * read. It also holds the list of its reads in the order of the structure. So a key at a new place reads the list, and it\n * does not walk the expression again. The lists have shared parts, so the forms of a chain use memory linear in the chain. The\n * cost of a key at each place is linear in the reads and the binders of the expression. A key has a small text.\n *\n * A form depends on the nodes of the memo around it, so a table keeps the forms for each content of `keys`. The table has\n * no copy of the other maps of a scope, because each key reads them as they stand. The table seals a map of `keys` at its\n * first read. So a change of that map after a read is a refusal, and it does not give a wrong key.\n */\nimport type { Expr, ExprOf } from \"@mark1russell7/vex\";\n\n/** The error of a construct that a standalone module does not have. */\nexport class NotStandalone extends Error {}\n\n/** A variable of the code of a module. */\ninterface Variable {\n readonly code: string;\n}\n\n/** The place of an expression: what each name that the expression does not bind means there. */\nexport interface KeyScope {\n /** The nodes of the memo around the place, with the variable of each. */\n readonly keys: ReadonlyMap<Expr, Variable>;\n /** The names around the place. A name that is not in this map is a variable of the run. */\n readonly env: ReadonlyMap<string, Variable>;\n /** The functions around the place, with the number of the binding of each. */\n readonly fns: ReadonlyMap<string, { readonly id: number }>;\n /** The columns of the `fix` forms around the place. */\n readonly columns: ReadonlyMap<string, Variable>;\n}\n\n/** A hole of a form: a read of a name, of a round or of a function. */\ninterface Read {\n readonly hole: \"var\" | \"last\" | \"call\";\n readonly name: string;\n}\n\n/** The reads of a part of a form, with the names of a kind that a form binds around that part. */\ninterface Bound {\n readonly kind: \"names\" | \"rounds\";\n readonly names: readonly string[];\n readonly parts: readonly Reads[];\n}\n\n/** The reads of an expression, in the order of its structure. A form above an expression shares this object. */\ntype Reads = Read | Bound;\n\n/** The form of an expression: the key data of its structure, and its reads, if it has reads. */\ninterface Form {\n readonly data: unknown;\n readonly reads: Reads | undefined;\n}\n\n/** The forms of one content of `keys`. */\ninterface Forms {\n readonly table: KeyTable;\n readonly keys: ReadonlyMap<Expr, Variable>;\n readonly known: Map<Expr, Form>;\n}\n\n/** A place in the walk of an expression: the forms, and the reads of the form that the walk makes. */\ninterface At {\n readonly forms: Forms;\n readonly reads: Reads[];\n}\n\n/** This function refuses a change of a map that a table read. */\nfunction sealed(): never {\n throw new NotStandalone(\"a map of the memo changed after a read of its keys\");\n}\n\n/** The properties that seal a map. Each method that changes a map refuses. */\nconst SEAL: PropertyDescriptorMap = { set: { value: sealed, configurable: true }, delete: { value: sealed, configurable: true }, clear: { value: sealed, configurable: true } };\n\n/** This class holds the number of each structure and the forms of each content of `keys`, for the keys of one printer. */\nexport class KeyTable {\n readonly #numbers = new Map<string, number>();\n readonly #nodes = new WeakMap<Expr, number>();\n readonly #maps = new WeakMap<object, Forms>();\n readonly #forms = new Map<string, Forms>();\n\n /** This method gives the number of a structure. Two structures have one number only if they have one text. */\n numberOf(text: string): number {\n const known = this.#numbers.get(text);\n if (known !== undefined) return known;\n const fresh = this.#numbers.size;\n this.#numbers.set(text, fresh);\n return fresh;\n }\n\n /** This method gives the number of a node of the program, the same object. */\n #nodeId(e: Expr): number {\n const known = this.#nodes.get(e);\n if (known !== undefined) return known;\n const fresh = this.numberOf(`node ${String(this.#numbers.size)}`);\n this.#nodes.set(e, fresh);\n return fresh;\n }\n\n /** This method gives the forms of a map of `keys`, and seals the map. Two maps with one content have one record of forms. */\n formsOf(keys: ReadonlyMap<Expr, Variable>): Forms {\n const held = this.#maps.get(keys);\n if (held !== undefined) return held;\n const text = JSON.stringify([...keys].map(([e, value]) => [this.#nodeId(e), value.code]));\n const forms = this.#forms.get(text) ?? { table: this, keys, known: new Map() };\n this.#forms.set(text, forms);\n this.#maps.set(keys, forms);\n Object.defineProperties(keys, SEAL);\n return forms;\n }\n}\n\n/** The text of -0 in a key. JSON gives 0 for -0, and -0 is not 0. */\nconst NEGATIVE_ZERO = { \"-0\": 0 };\n\n/**\n * This function gives a text that is the same for two expressions with the same structure. -0 is not 0. A part with a\n * token gives the token, so the text does not depend on that part. A token is an object, and a literal of a module is\n * not, so a token is not the text of a literal.\n */\nexport function canonical(e: Expr, token: (x: unknown) => object | undefined): string {\n return JSON.stringify(e, (_name, x: unknown) => token(x) ?? (Object.is(x, -0) ? NEGATIVE_ZERO : x));\n}\n\n/** The token function of a text with no tokens. */\nconst NO_TOKEN = (): undefined => undefined;\n\n/** This function gives the text of a literal or of an extension. Only those parts hold data of the program, and a walk of that data finds each -0. */\nfunction leafText(e: ExprOf<\"lit\"> | ExprOf<\"ext\">): string {\n // Stryker disable next-line ConditionalExpression: a walk gives the same text as the plain form, so this test only saves the walk.\n if (e.tag === \"lit\" && typeof e.value !== \"object\" && !Object.is(e.value, -0)) return JSON.stringify(e);\n return canonical(e, NO_TOKEN);\n}\n\n/** This function gives the result of a part that sees more names of a kind, and keeps the reads of that part with those names. */\nfunction within<T>(at: At, kind: Bound[\"kind\"], names: readonly string[], part: (inner: At) => T): T {\n const inner: At = { forms: at.forms, reads: [] };\n const result = part(inner);\n if (inner.reads.length > 0) at.reads.push({ kind, names, parts: inner.reads });\n return result;\n}\n\n/** This function gives the key data of an object that is not an expression, for example an axis or a record of names. */\nfunction record(x: object, at: At): unknown {\n // A copy keeps each own property, also a property with the name `__proto__`.\n const out: Record<string, unknown> = { ...x };\n for (const name of Object.keys(out)) out[name] = data(out[name], at);\n return out;\n}\n\n/** This function gives the key data of a part of an expression. An array or a record keeps its form, and an expression gets its key data. */\nfunction data(x: unknown, at: At): unknown {\n if (Array.isArray(x)) return x.map((part) => data(part, at));\n if (typeof x !== \"object\" || x === null) return Object.is(x, -0) ? NEGATIVE_ZERO : x;\n return typeof (x as { tag?: unknown }).tag === \"string\" ? node(x as Expr, at) : record(x, at);\n}\n\n/** This function gives the key data of a hole, and adds the read to the reads of the form. */\nfunction hole(kind: Read[\"hole\"], name: string, at: At): unknown {\n at.reads.push({ hole: kind, name });\n return { \"?\": kind };\n}\n\n/** This function gives the key data of a loop over names: each part sees the names that its form gives it (LOOP.NAMES). */\nfunction loop(e: ExprOf<\"fold\"> | ExprOf<\"iterate\">, at: At): unknown {\n const outer = e.tag === \"fold\" ? { axis: data(e.axis, at), at: data(e.at, at) } : { limit: data(e.limit, at) };\n const init = record(e.init, at);\n const items = e.tag === \"fold\" ? (e.as ?? []) : [];\n const inner = within(at, \"names\", Object.keys(e.init), (x) => ({\n ...(e.tag === \"iterate\" ? { until: data(e.until, x) } : {}),\n step: within(x, \"names\", items, (y) => record(e.step, y)),\n result: node(e.result, x),\n }));\n return { ...e, ...outer, init, ...inner };\n}\n\n/**\n * This function gives the key data of the parts of an expression. The scope of each form is the scope of the interpreter.\n * Each number of an expression goes through `data`, so the plain text of this result keeps each -0.\n */\nfunction parts(e: Exclude<Expr, ExprOf<\"lit\"> | ExprOf<\"ext\">>, at: At): unknown {\n switch (e.tag) {\n case \"var\":\n case \"last\":\n return hole(e.tag, e.name, at);\n case \"call\":\n return { ...e, fn: hole(\"call\", e.fn, at), args: data(e.args, at) };\n case \"fn\":\n return { ...e, body: within(at, \"names\", e.params, (x) => node(e.body, x)) };\n case \"let\":\n // Each binding sees the outer names, so a binding does not see the other bindings (FN.BIND).\n return { ...e, bind: record(e.bind, at), body: within(at, \"names\", Object.keys(e.bind), (x) => node(e.body, x)) };\n case \"each\":\n return { ...e, axis: data(e.axis, at), at: data(e.at, at), body: within(at, \"names\", e.as ?? [], (x) => node(e.body, x)) };\n case \"fold\":\n case \"iterate\":\n return loop(e, at);\n case \"fix\":\n return { ...e, init: node(e.init, at), step: within(at, \"rounds\", [e.name], (x) => node(e.step, x)) };\n case \"ref\":\n case \"app\":\n case \"rec\":\n return record(e, at);\n }\n}\n\n/** This function gives the form of an expression from its walk. */\nfunction formOf(e: Expr, forms: Forms): Form {\n const own: At = { forms, reads: [] };\n const structure = { \"#\": forms.table.numberOf(e.tag === \"lit\" || e.tag === \"ext\" ? leafText(e) : JSON.stringify(parts(e, own))) };\n const [first, ...more] = own.reads;\n return { data: structure, reads: more.length === 0 ? first : { kind: \"names\", names: [], parts: own.reads } };\n}\n\n/** This function gives the key data of an expression: the number of its form, or the token of a node of the memo. */\nfunction node(e: Expr, at: At): unknown {\n const key = at.forms.keys.get(e);\n if (key !== undefined) return { \"@\": key.code };\n let form = at.forms.known.get(e);\n if (form === undefined) {\n form = formOf(e, at.forms);\n at.forms.known.set(e, form);\n }\n if (form.reads !== undefined) at.reads.push(form.reads);\n return form.data;\n}\n\n/** The names of each kind that a walk of the reads binds at this time. */\ninterface Binders {\n readonly names: Set<string>;\n readonly rounds: Set<string>;\n}\n\n/** This function gives the meaning of a read. A name of the run and a name of the code are two tokens, so one text in both does not give one key. */\nfunction meaning(x: Read, scope: KeyScope, bound: Binders): unknown {\n switch (x.hole) {\n case \"var\": {\n if (bound.names.has(x.name)) return { \"=\": x.name };\n const name = scope.env.get(x.name);\n return name === undefined ? { $$: x.name } : { $: name.code };\n }\n case \"last\":\n return bound.rounds.has(x.name) ? { \"=\": x.name } : { \"^\": scope.columns.get(x.name)?.code };\n case \"call\":\n // A call of a function around the place gives the number of its binding, so two functions with one name give two keys.\n return bound.names.has(x.name) ? { \"=\": x.name } : { \"()\": x.name, of: scope.fns.get(x.name)?.id };\n }\n}\n\n/** This function adds the meaning of each read to a list, in the order of the structure. */\nfunction meanings(reads: readonly Reads[], scope: KeyScope, bound: Binders, out: unknown[]): void {\n for (const x of reads) {\n if (\"hole\" in x) {\n out.push(meaning(x, scope, bound));\n continue;\n }\n const set = bound[x.kind];\n const fresh = x.names.filter((name) => !set.has(name));\n for (const name of fresh) set.add(name);\n meanings(x.parts, scope, bound, out);\n for (const name of fresh) set.delete(name);\n }\n}\n\n/**\n * This function gives the key of an expression at a place. Two keys of one table are equal only if the two expressions at\n * their places have one value. Two expressions with one value can have two keys, for example with two spellings of a\n * name that they bind.\n */\nexport function keyText(e: Expr, scope: KeyScope, table: KeyTable): string {\n const at: At = { forms: table.formsOf(scope.keys), reads: [] };\n const structure = node(e, at);\n if (at.reads.length === 0) return JSON.stringify(structure);\n const reads: unknown[] = [];\n meanings(at.reads, scope, { names: new Set(), rounds: new Set() }, reads);\n return JSON.stringify({ \"#\": table.numberOf(JSON.stringify([structure, reads])) });\n}\n","/**\n * The static order of the cells of a sheet in a module (COMPILE.MODULE.SHEET). It is the order of `SheetRun.fill` in\n * `packages/core/src/sheet.ts` (SHEET.FILL), and it uses `readsOf` and `isCellRef` of that file. The keys of a column\n * follow its reads from itself. The order changes only the speed, not a result (SHEET.ORDER).\n */\nimport { addrExprs, CELL_KIND, children, isCellRef, listOf, readsOf, shapeError, splitLimit, type Axis, type Direction, type Expr } from \"@mark1russell7/vex\";\n\n/** This function gives the tests of the `where` axes of an axis. */\nfunction testsOf(axis: Axis): readonly Expr[] {\n const tests: Expr[] = [];\n for (let x = axis; x.t === \"where\"; x = x.axis) tests.push(x.test);\n return tests;\n}\n\n/**\n * The order of the keys of a column, from the directions of its reads from itself. `reverse` reverses the key order. In\n * a tree, `post` puts the children before their parent, and `back` reverses the order of the siblings.\n */\nexport interface KeyOrder {\n readonly reverse: boolean;\n readonly post: boolean;\n readonly back: boolean;\n}\n\n/**\n * This function gives the order of the keys of a column. A read of a later key reverses the order. In a tree, a read of\n * the children puts the children before their parent, as `keyOrder` of `SheetRun` does.\n */\nexport function keyOrderOf(d: ReadonlySet<Direction>): KeyOrder {\n const reverse = d.has(\"after\") && !d.has(\"before\");\n const post = d.has(\"down\");\n return { reverse, post, back: post !== reverse };\n}\n\n/**\n * The place of a read of a cell, relative to the key of the formula. The place `key` is the key itself. The place\n * `children` is the body or a test of the axis `children` of the key. The place `unknown` is each other place.\n */\ntype ReadPlace = \"key\" | \"children\" | \"unknown\";\n\n/** This function gives the axis under the tests of `where` and under `reverse`. Both read the targets of that axis. */\nfunction baseOf(axis: Axis): Axis {\n let base = axis;\n while (base.t === \"where\" || base.t === \"reverse\") base = base.axis;\n return base;\n}\n\n/**\n * This function tells if each read of a cell of the column `self` reads a finished cell in the static order of the\n * fill (COMPILE.MODULE.SHEET.DIRECT). A read of a column before `self` in `order` reads a finished cell. A read of a\n * column that the sheet does not have also reads a finished cell. A read of `self` reads a finished cell only in\n * these three forms:\n * - in a tree in pre-order, at the move `parent` from the key,\n * - in an array in key order, at an offset of one negative step from the key,\n * - in a tree in post-order, at the key of a target of the axis `children` of the key.\n *\n * A read in the body of a function can evaluate at each place of a call, so it is not one of these forms.\n *\n * The columns of `fused` come before `self` in one loop over the keys (COMPILE.MODULE.ONCE). The loop evaluates each of\n * them at a key before `self` at that key. Thus a read of one of them reads a finished cell only at the key itself, or\n * in one of the three forms.\n */\nexport function readsFinished(columns: ReadonlyMap<string, Expr>, order: readonly string[], self: string, tree: boolean, fused: ReadonlySet<string> = new Set()): boolean {\n const formula = columns.get(self);\n if (formula === undefined || shapeError(formula) !== undefined) return false;\n const { reverse, post } = keyOrderOf(readsOf(columns, new Map(), self).directions);\n const position = order.indexOf(self);\n const todo: [Expr, ReadPlace][] = [[formula, \"key\"]];\n for (let item = todo.pop(); item !== undefined; item = todo.pop()) {\n const [e, place] = item;\n // A test of the axis of a data limit reads at each target, as the test of an `each` does.\n const split = e.tag === \"iterate\" ? splitLimit(e) : undefined;\n if (split !== undefined) for (const x of split) todo.push([x, place]);\n else if (e.tag === \"each\" || e.tag === \"fold\") {\n const inner: ReadPlace = place === \"key\" && (e.at === undefined || e.at.length === 0) && baseOf(e.axis).t === \"children\" ? \"children\" : \"unknown\";\n for (const x of [...(e.tag === \"each\" ? [e.body] : Object.values(e.step)), ...testsOf(e.axis)]) todo.push([x, inner]);\n const list = listOf(e.axis);\n for (const x of [...(e.tag === \"fold\" ? [...Object.values(e.init), e.result] : []), ...addrExprs(e.at), ...(list === undefined ? [] : [list])]) todo.push([x, place]);\n } else if (e.tag === \"fn\") todo.push([e.body, \"unknown\"]);\n // The parts of a column evaluate at each row, so a read in them has no place (FIX.ROUNDS).\n else if (e.tag === \"fix\") todo.push([e.init, \"unknown\"], [e.step, \"unknown\"]);\n else if (e.tag !== \"ext\") for (const child of children(e)) todo.push([child, place]);\n else if (e.kind === CELL_KIND && isCellRef(e.data)) {\n const { column, at } = e.data;\n const index = order.indexOf(column);\n if (index > position) return false;\n if (column !== self && !fused.has(column)) continue;\n const [move, ...rest] = at;\n // The cell of a fused column at the key itself is finished. The cell of `self` at the key is a cycle.\n const here = column !== self && place === \"key\" && at.every((m) => m.t === \"origin\");\n const ok =\n here ||\n (place === \"key\"\n ? move !== undefined && rest.length === 0 && ((tree && !post && move.t === \"parent\") || (!tree && !reverse && move.t === \"offset\" && move.d.length === 1 && (move.d[0] ?? 0) < 0))\n : place === \"children\" && tree && post && at.length === 0);\n if (!ok) return false;\n }\n }\n return true;\n}\n","/**\n * Standalone modules (docs/COMPILER.md §4.4 and §6). `emitModule` prints a program as an ES module that has no import of\n * Vex. A host that guarantees the kinds of its input uses it without the interpreter, for example ireko at build time.\n *\n * The module gives the results of the interpreter for each input that keeps the schema. It checks the schema once, at\n * the start of a run, and an input against the schema throws a `VexContractError`. An error of Vex is a value too:\n * the run gives `VEX_ERROR` at its key.\n *\n * The printer gives statements and loops, as a person writes them. A binding is a variable, and a list op is a `for`\n * loop with a running value. An error of Vex is a thrown sentinel. A binding, `ifError` and an item of a list op catch\n * it, as in the interpreter. A node of the memo and the key of the run catch it too. Each op is the function of its\n * domain, as text, so it has the bits of the interpreter (§4.2).\n *\n * A part of the program that depends on no key of the space is a constant of the run. The module evaluates it once,\n * before the loop over the keys. A node of the memo is one function of its other keys, with a map of its values. The\n * nodes with the same expression share the function.\n *\n * The printer takes a part of the language. It takes an array space, a tree space or a graph space of records, and\n * the fields and the variables of the schema. It takes the axes `all`, `others` and `window`. A tree space also has the\n * move `parent` and the axes of a tree (COMPILE.MODULE.TREE). A graph space has the axes of a graph\n * (COMPILE.MODULE.GRAPH). A list is an array of pairs of a key and a value. The list ops, `reduce`, list literals and\n * lists as names of loops are in a module (COMPILE.MODULE.LIST, COMPILE.MODULE.REDUCE). The value of a program can be a\n * list, and the run gives it as a `vex.list` (COMPILE.MODULE.LIST.RESULT). An op and a record get each list of an\n * argument or a field as a `vex.list` too (COMPILE.MODULE.LIST.ARG, COMPILE.MODULE.LIST.FIELD). The value of a call\n * can be a list (COMPILE.MODULE.LIST.CALL). A field of the schema can have a list kind, and the record then holds a\n * `vex.list` (COMPILE.MODULE.LIST.INPUT). The kinds of each op site must decide its op.\n * Another construct gives a reason, not code.\n *\n * `emitSheetModule` prints the formula columns of a sheet as one module (COMPILE.MODULE.SHEET). Each column is an array\n * of results, and the run fills the arrays in the static order of `SheetRun.fill`. A read of a cell that is not finished\n * starts the search of `SheetRun`. Thus each cell on a cycle gives the error of Vex. A cell can hold a list, and a\n * formula reads it with the list ops (COMPILE.MODULE.SHEET.LIST).\n */\nimport { addrExprs, type AnyDomain, app, type Axis, axisExprs, CELL_KIND, type CellFormulas, children, columnOrder, type Envelope, evaluate, type Expr, type ExprOf, fromDocument, isCellRef, isDocument, isFieldName, isListOp, isVexList, type ItemNames, joinKind, limitAxis, listOf, lit, MAX_ITERATIONS, monotoneError, type Move, moveExpr, type Names, nestingError, nestingOf, type PrimitiveKind, readsOf, rec, shapeError, sizeError, space as spaces, splitLimit, stepError, vexList, type VexList, type VexStep } from \"@mark1russell7/vex\";\nimport { factsOf, kindOfDomain, primitiveOf, type Facts, type Kind, type ListKind, type Schema } from \"./facts.ts\";\nimport { functionText } from \"./fn-text.ts\";\nimport { memoNodes } from \"./memo.ts\";\nimport { deadConstants, keepFaults, namesOfCode, tidy, type Tidied, wordsOf } from \"./module-tidy.ts\";\nimport { canonical, type KeyScope, KeyTable, keyText, NotStandalone } from \"./scope-key.ts\";\nimport { keyOrderOf, readsFinished } from \"./sheet-order.ts\";\nimport { originalOf, placesRead, unsharedAll } from \"./unshared.ts\";\n// This import is the last one. Before the import of `@mark1russell7/vex`, it cost 2 to 6 % on two rows of the module bench (V-093).\nimport { sameValue } from \"@mark1russell7/coeval\";\n\n/** The options of a standalone module. */\nexport interface ModuleOptions {\n readonly domains?: readonly AnyDomain[];\n /** The kinds of the fields of the records and of the variables. A module reads only the names of its schema. */\n readonly schema: Schema;\n /**\n * The name of the function that the module exports. The default is `run`. A reserved word, `VEX_ERROR` and\n * `VexContractError` are not names of the run (V-060). Each other name hides nothing from the code (COMPILE.MODULE.NAME).\n */\n readonly name?: string;\n /**\n * The space of the records. In each space, the key of a record is the text of its position, unless the option\n * `keys` is true. The default `array`\n * has no parents. A `tree` takes the parents as the third argument of the run (COMPILE.MODULE.TREE). Each entry\n * is the position of the parent of its record, or -1 for a root. A `graph` takes the edges as the third argument\n * (COMPILE.MODULE.GRAPH). Each entry is an array of the positions of the ends of the edges from its record, in order.\n */\n readonly space?: \"array\" | \"tree\" | \"graph\";\n /**\n * The highest step of the language that the host accepts (STEP.MAX). The default is B. A program that needs a higher\n * step gives a reason that names its step.\n */\n readonly maxStep?: VexStep;\n /**\n * True to fuse the chains of list ops into loops (`COMPILER.md` §7.6), and false for the code without fusion\n * (COMPILE.MODULE.FUSE.OFF). The default is true. In this version, the two values print the same code.\n */\n readonly fuse?: boolean;\n /**\n * The form of the lists of the input and of the result (COMPILE.MODULE.LIST.PLAIN). The default `envelope` gives each\n * list as a `vex.list`. With `plain`, a list is an array of the values of its items, and an error item is `VEX_ERROR`.\n * The key of an item of the input is the text of its position, and the result has no keys. A list in a record or in\n * an argument of an op stays a `vex.list`.\n */\n readonly lists?: \"envelope\" | \"plain\";\n /**\n * True when the run takes the keys of the records as its last argument (COMPILE.MODULE.KEYS). The argument is an array\n * with one text for each record, and each text is different. A program that reads no key ignores it and prints the\n * same text as without the option. The default is false.\n */\n readonly keys?: boolean;\n /**\n * What a catch of the module does with an exception that no function of a domain gives (COMPILE.MODULE.FAULT). The\n * default `value` gives the error of Vex for each exception. With `throw`, the exception leaves the run, so a fault\n * of the printed code does not become a value. An exception of a function of a domain stays an error of Vex.\n */\n readonly faults?: \"value\" | \"throw\";\n}\n\n/** The options of a module of a sheet (COMPILE.MODULE.SHEET): the options of a module, and the parts of a sheet. */\nexport interface SheetModuleOptions extends ModuleOptions {\n /** The cells with their own formula (SHEET.CELL.FORMULA). The formula of a cell replaces the formula of its column at its key. */\n readonly cells?: CellFormulas;\n /**\n * The kind of the values of each column. The printer prints each column after the columns that it reads. A column\n * that a formula reads before its own formula prints needs its kind here, for example a column that reads itself.\n * A column of lists has a `ListKind` (COMPILE.MODULE.SHEET.LIST).\n */\n readonly kinds?: Readonly<Record<string, Kind | ListKind>>;\n /** The budget of the stack of the search of a run, in estimated frames, as in `SheetRun`. The default is 3000. */\n readonly budget?: number;\n}\n\nexport type { ListKind } from \"./facts.ts\";\n\n/** The source of a standalone module, or the reason that the program cannot be one. */\nexport type Emitted = { readonly ok: true; readonly source: string } | { readonly ok: false; readonly reason: string };\n\n\n/**\n * The error that stops the second print of a fast sum (`#packed`) or of the steps of a fold (`#packedSteps`). Then the\n * loop keeps the code of its first print.\n */\nclass NoPack extends Error {}\n\n/**\n * The state of the second print of a fast sum (`#packed`) or of the steps of a fold (`#packedSteps`). It has the foci\n * of the loops whose reads of a column read its pack. It also has the local name of the pack of each column.\n */\ninterface Pack {\n readonly foci: Set<string>;\n /** True when a column of the function that the printer prints has a pack too, with a variable in that function. */\n readonly calls: boolean;\n readonly cols: Map<string, string>;\n /** The value locals that the second print makes. Each one is a local of its loop until a line of the run declares it. */\n readonly locals: Set<string>;\n /** The count of the calls that the second print puts at their place. A count over `INLINES` stops the print. */\n inlines: number;\n}\n\n/**\n * The state of the keys of one print (COMPILE.MODULE.KEYS). With `keyed`, the code uses the keys of the argument of the\n * run. The printer sets `read` when the program can show a key of a record to a part of the code or to the host.\n */\ninterface KeyPrint {\n readonly keyed: boolean;\n read: boolean;\n}\n\n/** The helpers that show the key of an item: a compare of keys, and a `vex.list` of a result, an argument or a field. */\nconst KEY_READS: ReadonlySet<string> = new Set([\"GT\", \"WO\", \"WOC\", \"LO\", \"LS\", \"LOC\", \"LSC\", \"LV\", \"LVC\", \"LC\"]);\n\n/** The most calls that the second print of a fast sum puts at their place. Thus a chain of calls stays linear. */\nconst INLINES = 64;\n\n/** The list ops that a fast sum can be: each one adds or compares numbers, and its step cannot throw (`#packed`). */\nconst PACK_OPS: ReadonlySet<string> = new Set([\"sum\", \"mean\", \"min\", \"max\"]);\n\n/**\n * A value of the printer: its code, its kind if the printer knows it, and true when its code cannot throw. A literal,\n * a variable of the schema and a field of the schema at the focus or at the origin cannot throw.\n */\ninterface Value {\n readonly code: string;\n readonly kind: Kind | undefined;\n readonly safe: boolean;\n /** For the read of a name that can hold the error sentinel: the name itself, which holds the value or the sentinel. */\n readonly held?: string;\n /**\n * The levels of the keys that the value depends on: 1 for the key of the run, and one more for each axis around it.\n * A value with no levels is a constant of the run.\n */\n readonly deps: ReadonlySet<number>;\n /** True for a literal and for the read of a name: a constant of the run with such code needs no variable of its own. */\n readonly plain?: boolean;\n /** For a list (LIST.VALUE): the kind of its items. The code is an array of pairs of a key and a value or the sentinel. */\n readonly list?: ListInfo | undefined;\n}\n\n/**\n * The facts of a list of the code: the kind of the values of its items, if the printer knows it. The key of an item is\n * the position of its record or the text of the key of a list literal (LIST.LITERAL). It can also be a position of `fill`.\n */\ninterface ListInfo {\n readonly item: Kind | undefined;\n /** For a list of lists (LIST.FLAT): the facts of each list that is the value of an item. Each item of such a list is an array. */\n readonly inner?: ListInfo | undefined;\n /** True when a key can be a key of a literal or of `fill`. The axis list cannot read a record at such a key. */\n readonly texts?: boolean;\n /** True for a list without items: the empty literal, and a list from it. Such a list fits each list. */\n readonly empty?: boolean;\n /** True when no item of the list holds the error sentinel (COMPILE.MODULE.FUSE.FACTS). Fusion uses this fact. */\n readonly clean?: boolean;\n /** True when no other part of the code holds the array of the list, so an op can take the array as its own. */\n readonly fresh?: boolean;\n}\n\n/** This function gives the facts of a list without the facts of fusion. A signature and a key of the memo use them. */\n/** The facts of the prints of one program about the names of loops that start with the empty list (COMPILE.MODULE.LOOP.EMPTY). */\ninterface EmptyStarts {\n /** The kinds of the items that the steps give, by the expression of the step of each name. */\n readonly found: Map<Expr, Pick<ListInfo, \"item\" | \"inner\">>;\n /** The expressions of a program with one object at each place. The prints use one set of copies, so `found` holds for each print. */\n readonly copies: Map<object, readonly Expr[]>;\n /** True for a print that only looks for these kinds. There, each name without a kind counts as an empty list. */\n readonly seek: boolean;\n}\n\nfunction plainList(l: ListInfo | undefined): ListInfo | undefined {\n if (l === undefined) return undefined;\n const { clean: _clean, fresh: _fresh, ...rest } = l;\n return { ...rest, inner: plainList(l.inner) };\n}\n\n/** This function gives the facts of a list that another part of the code can hold: the list is not fresh. */\nfunction heldList(l: ListInfo | undefined): ListInfo | undefined {\n return l?.fresh === true ? { ...l, fresh: false } : l;\n}\n\n/**\n * The facts of fusion of a list node of a program (COMPILE.MODULE.FUSE.FACTS). They are `clean` for the list and for\n * each level of its items, `fresh` and the count of the reads of its value. A count of `Infinity` tells that a loop, a\n * memo node or the loop over the keys reads the value again. The tests of the analysis read these facts.\n */\nexport interface ListFacts {\n readonly clean: boolean;\n /** The fact `clean` of each level of a list of lists, from the outside in. */\n readonly inner: readonly boolean[];\n readonly fresh: boolean;\n readonly reads: number;\n}\n\n/** The op of each step of `reduce` (COMPILE.MODULE.REDUCE): the name of the op, and the value of the option `domain`. */\ninterface Step {\n readonly op: string;\n readonly domain: unknown;\n}\n\n/** The code of a node: the statements before its value, and its value. `safe` covers the statements too. */\ninterface Code {\n readonly s: readonly string[];\n readonly v: Value;\n}\n\n/**\n * The code of a list in a fused loop (COMPILE.MODULE.FUSE). It has the statements that push its items into the output\n * of the loop, and their levels. It also has the fact that they cannot throw, and the facts of the list.\n */\ninterface Pushed {\n readonly s: readonly string[];\n readonly deps: ReadonlySet<number>;\n readonly safe: boolean;\n readonly list: ListInfo | undefined;\n}\n\n/**\n * The code of a list of `fill` that a loop or `count` reads only as a range (COMPILE.MODULE.FILL.RANGE). The module\n * makes no array for it. The count checks the arguments, as `FI` does. Each item has the key of its position and the\n * value `item`, a name or a literal. The statements come before the count, and `count.safe` covers them too.\n */\ninterface Range {\n readonly s: readonly string[];\n readonly count: Value;\n readonly item: string;\n readonly info: ListInfo;\n}\n\n/**\n * A part of a fused loop before the decision about the constants of the run (COMPILE.MODULE.FUSE). Its function `s`\n * gives its statements. With `settle`, a part that is a constant of the run evaluates once, before the loop over the keys.\n */\ninterface Part {\n readonly s: (settle: boolean) => readonly string[];\n readonly deps: ReadonlySet<number>;\n readonly safe: boolean;\n readonly list: ListInfo | undefined;\n}\n\n/** The tags of the nodes that can read at the focus. Only a node with one of them can be a column of the run. */\nconst FOCUS_TAGS: ReadonlySet<string> = new Set([\"ref\", \"ext\", \"call\", \"each\", \"fold\"]);\n\n/** This function tells if an expression has a node that can read at the focus. */\nconst readsFocus = (e: Expr): boolean => FOCUS_TAGS.has(e.tag) || (e.tag === \"iterate\" && limitAxis(e) !== undefined) || children(e).some(readsFocus);\n\n/**\n * This function tells if an expression has a node that can read a cell: a read of a cell or a call. The interpreter\n * evaluates each list of an append, also after an error. Thus a search of a sheet sees each read of a cell.\n */\nconst readsCells = (e: Expr): boolean => e.tag === \"ext\" || e.tag === \"call\" || children(e).some(readsCells);\n\n/** This function tells if an expression is the literal 1. */\n// Stryker disable next-line OptionalChaining: each caller gives an argument.\nconst isOne = (e: Expr | undefined): boolean => e?.tag === \"lit\" && e.value === 1;\n\n/** This function gives the value of a literal. For each other expression, it gives undefined, also for a node with an extra field `value`. */\nconst literalOf = (e: Expr): unknown => (e.tag === \"lit\" ? e.value : undefined);\n\n/** The kinds of a literal whose code is its value. A read of such code at each item costs nothing (COMPILE.MODULE.FILL.RANGE). */\nconst PLAIN_LITERALS: ReadonlySet<string> = new Set([\"number\", \"string\", \"boolean\"]);\n\n/** This function tells if an expression reads nothing of a run: it has only literals and ops. */\nconst isClosed = (e: Expr): boolean => e.tag === \"lit\" || (e.tag === \"app\" && e.args.every((x) => isClosed(x)));\n\n/** The space of the evaluation of an expression that reads nothing of a run. */\nconst ONE_RECORD = spaces.array([{}]);\n\n/** A name of the program in the code: its variable, its kind, true when it can hold the error sentinel, and its levels. */\ninterface Name {\n readonly code: string;\n readonly kind: Kind | undefined;\n readonly lazy: boolean;\n readonly deps: ReadonlySet<number>;\n readonly list?: ListInfo | undefined;\n}\n\n/** An argument of a call: its code, its kind, its levels and the facts of its list (COMPILE.MODULE.LIST.ARG). */\ninterface Arg {\n readonly code: string;\n readonly kind: Kind | undefined;\n readonly deps: ReadonlySet<number>;\n readonly list: ListInfo | undefined;\n}\n\n/** The levels of a constant of the run. */\nconst NO_DEPS: ReadonlySet<number> = new Set();\n\n/** The names of the items of a loop without `as` (COMPILE.MODULE.LIST.ITEM). */\nconst NO_NAMES: ReadonlyMap<string, Name> = new Map();\n\n/** This function gives the names of a body or of a step: the names `as` of the items hide the names outside (AXIS.LIST.SCOPE). */\nconst withNames = (env: ReadonlyMap<string, Name>, items: ReadonlyMap<string, Name>): ReadonlyMap<string, Name> => new Map([...env, ...items]);\n\n/**\n * The level of a read of a cell (COMPILE.MODULE.SHEET). The results of the cells change in a run. Thus a value that reads\n * a cell is not a constant or a column of the run. The level is far from the other levels.\n */\nconst CELLS = -1;\n\n/**\n * The level of a read of a column in its step (COMPILE.FIX.MODULE). A row changes in each round. Thus a value that reads\n * a row is not a constant or a column of the run. The `fix` node removes this level.\n */\nconst ROUNDS = -2;\n\n/** The name of the function of a run of a sheet that reads a cell: its column and its position. */\nconst READ_CELL = \"RC\";\n\n/** This pattern finds a read of a cell in the code of a value: the read, or a printed function that can read a cell. */\nconst READS_IN_CODE = /\\b(RC|fn\\d+)\\(/;\n\n/** The columns of a sheet for the printer (COMPILE.MODULE.SHEET). */\ninterface SheetInfo {\n /** The position of each column in the arrays of the run. */\n readonly columns: ReadonlyMap<string, number>;\n /** The kind of each column that the printer knows: a kind of the options, or the kind of a printed formula. */\n readonly kinds: Map<string, Kind | undefined>;\n /** The facts of the lists of each column of lists that the printer knows (COMPILE.MODULE.SHEET.LIST). */\n readonly lists: Map<string, ListInfo>;\n /** True when each read of a cell reads a finished cell, so a read starts no search (COMPILE.MODULE.SHEET.DIRECT). */\n readonly direct: boolean;\n}\n\n/** This function gives the levels of some codes together. */\nconst depsOf = (...xs: readonly Code[]): ReadonlySet<number> => new Set(xs.flatMap((x) => [...x.v.deps]));\n\n/** This function gives the statements of some codes, in order. */\nconst stmtsOf = (...xs: readonly Code[]): string[] => xs.flatMap((x) => x.s);\n\n/** This function indents some statements by one level. */\nconst ind = (xs: readonly string[]): string[] => xs.map((x) => ` ${x}`);\n\n/**\n * The lexical position of a node: the code of the index of its origin and of its focus, and its names. It also has the\n * keys of its node of the memo. A node of the memo reads neither its origin nor its focus, so these are undefined there.\n */\ninterface Ctx {\n readonly origin: string | undefined;\n readonly focus: string | undefined;\n /** The level of the focus: 1 at the key of the run, and one more in each axis. */\n readonly level: number;\n /** The level of the origin: 1 at the key of the run, and the marker of the origin in the body of a function. */\n readonly originLevel: number;\n readonly env: ReadonlyMap<string, Name>;\n readonly keys: ReadonlyMap<Expr, Name>;\n /** The bound functions (FN.BIND), with the context of their binding. */\n readonly fns: ReadonlyMap<string, BoundFn>;\n /** The columns of the steps around the node (COMPILE.FIX.MODULE): the name of the array of the last round, and its kind. */\n readonly columns: ReadonlyMap<string, FixColumn>;\n}\n\n/** A column in the step of its `fix`: the name of the array with the value of each row, and the kind of the values. */\ninterface FixColumn {\n readonly code: string;\n readonly kind: Kind;\n}\n\n/** The code of the step of one name of a loop: the statements of its new value and the statement that sets it. */\ninterface StepPart {\n readonly name: string;\n readonly s: readonly string[];\n readonly set: string;\n /** True when the value of the step cannot throw. */\n readonly safe: boolean;\n}\n\n/** The printed step of a loop: its statements, their levels, the names that append to their own lists, and the code of each name. */\ninterface LoopStep {\n readonly s: readonly string[];\n readonly deps: ReadonlySet<number>;\n readonly owners: readonly Owner[];\n readonly parts: readonly StepPart[];\n}\n\n/** The parts of a printed fold that its scan reads (COMPILE.MODULE.SCAN): its names, its targets, its test, its steps and its result. */\ninterface ScanParts {\n readonly loop: number;\n readonly names: { readonly s: readonly string[]; readonly vars: ReadonlyMap<string, Name>; readonly deps: ReadonlySet<number> };\n readonly t: { readonly s: readonly string[]; readonly j: string; readonly key: readonly string[]; readonly check: readonly string[]; readonly skip: string | undefined; readonly inner: Ctx; readonly tests: readonly Expr[] };\n readonly test: Code | undefined;\n readonly step: LoopStep;\n readonly result: Code;\n}\n\n/**\n * A name of a loop whose step appends to its own list (COMPILE.MODULE.APPEND.OWN). It has the name, its read in the\n * loop and the variable of the array of its last append. The printer makes the variable at the first append that uses it.\n * With `adopt`, the variable starts with the first list of the name, so the first append makes no copy\n * (COMPILE.MODULE.FUSE.ADOPT). With `sure`, each append of the name gets the array of the variable as its list. Then\n * an append of one item pushes the item with no check.\n */\ninterface Owner {\n readonly name: string;\n readonly read: Name;\n w: string | undefined;\n readonly adopt: boolean;\n readonly sure: boolean;\n}\n\n/**\n * A `let` in the result of a loop that binds the list of an owner to the name `bind` (COMPILE.MODULE.FUSE.ADOPT). The\n * append nodes in `nodes` append to the list of `bind` in the body of the let. They get the owner when the let prints.\n */\ninterface Relay {\n readonly bind: string;\n readonly nodes: readonly Expr[];\n}\n\n/**\n * A bound function of the printer (FN.BIND): its node and the context of its binding. It also has one printed\n * JavaScript function for each signature of the arguments of its calls.\n */\ninterface BoundFn {\n /** The number of the binding. Two functions with one name are two functions, so a key of a constant needs it. */\n readonly id: number;\n readonly fn: ExprOf<\"fn\">;\n readonly ctx: Ctx;\n /** The printed function for each signature: the kind of each argument. */\n readonly specs: Map<string, Spec>;\n /** The declarations of the printed functions that read names of the place of the binding. The let prints them. */\n readonly decls: string[];\n /** True when a printed function of the binding is at the place of the binding, not at the start of a run. */\n local: boolean;\n}\n\n/**\n * A function that the printer prints at this time. Its parameters, and the bindings at the root of its body, keep their\n * values for the whole call. Thus a part of a loop that reads only them and its target is a column of the call.\n */\ninterface CallScope {\n /** The marker of the parameters. */\n readonly param: number;\n /** The level of the focus of the function. A part at a higher level is in a loop of the function. */\n readonly focus: number;\n /** True when the body has a loop in a loop, so a call can read a part of a loop more than once. */\n readonly repeats: boolean;\n /** The variables that the start of the body can read: the parameters, and the bindings at the root of the body. */\n readonly names: Set<string>;\n /** The declarations of the columns of the call. The function prints them at the start of its body. */\n readonly decls: string[];\n /** The root of the body. A let at the root moves it to its body, because its bindings are at the start of the body. */\n root: Expr;\n}\n\n/**\n * A printed function. The levels of the value of its body have a marker for the origin, for the focus and for each\n * parameter. A call replaces each marker with the levels at the call.\n */\ninterface Spec {\n readonly name: string;\n readonly kind: Kind | undefined;\n /** The facts of the list of the body, for a function whose value is a list (COMPILE.MODULE.LIST.CALL). */\n readonly list: ListInfo | undefined;\n readonly safe: boolean;\n readonly deps: ReadonlySet<number>;\n readonly origin: number;\n readonly focus: number;\n readonly param: number;\n /** True when the body reads only constants of the run, its parameters and its position, so it is at the start of a run. */\n readonly global: boolean;\n}\n\n/** The name of a helper of the generated code. */\ntype Helper = \"F\" | \"C\" | \"T\" | \"L\" | \"Q\" | \"G\" | \"B\" | \"U\" | \"X\" | \"I\" | \"K\" | \"M\" | \"M1\" | \"S\" | \"V\" | \"SB\" | \"SK\" | \"TK\" | \"VW\" | \"NT\" | \"CT\" | \"FS\" | \"FI\" | \"FN\" | \"TN\" | \"LI\" | \"LA\" | \"LP\" | \"LS\" | \"KC\" | \"KP\" | BuildHelper | TreeHelper | GraphHelper | SheetHelper | CleanHelper | \"SBI\" | \"SKI\" | \"PF\" | \"QA\" | \"AI\" | \"AW\" | \"KS\";\n\n/**\n * The helpers of the clean form (COMPILE.MODULE.FUSE.CLEAN). Each one is the helper without the last letter `C`, for\n * lists that the facts prove clean. Thus it has no scan of `V`, no `VW` and no test of the sentinel.\n */\ntype CleanHelper = \"SBC\" | \"SKC\" | \"TKC\" | \"DRC\" | \"AOC\" | \"AIC\" | \"AWC\" | \"WOC\" | \"FLC\" | \"IXC\" | \"NTC\" | \"SNC\" | \"FSC\" | \"LOC\" | \"LSC\" | \"LVC\" | \"LPC\";\n\n/** The helpers of the list ops that build a list (LIST.BUILD), of `get` (LIST.GET) and of `indexOf` (LIST.INDEXOF). */\ntype BuildHelper = \"DR\" | \"AP\" | \"AO\" | \"WO\" | \"FL\" | \"GT\" | \"IX\" | \"SN\";\n\n/** The helpers of a tree space (COMPILE.MODULE.TREE). */\ntype TreeHelper = \"PT\" | \"CH\" | \"SG\" | \"PR\" | \"UP\" | \"SO\" | \"AN\" | \"BF\";\n\n/** The helpers of a graph space (COMPILE.MODULE.GRAPH). */\ntype GraphHelper = \"GR\" | \"GI\" | \"RB\";\n\n/** The helpers of a sheet (COMPILE.MODULE.SHEET): the state of a run of a sheet, and the order of the keys of a tree. */\ntype SheetHelper = \"SH\" | \"KO\" | \"DO\" | \"LO\" | \"LC\" | \"LV\" | \"LCP\";\n\n/**\n * The texts of a part of the helpers. The object `HELPERS` joins the parts, and its type asks for each helper. Each part is\n * a function, and its closing line ends a segment of the cost map. Thus the mutation lane can cut the helpers into parts.\n */\ntype HelperTexts = Readonly<Partial<Record<Exclude<Helper, \"S\">, () => string>>>;\n\n/** This function gives a part of the texts of the helpers, in the order of `HELPERS`. */\nfunction helperTexts1() {\n return {\n F: () => \"function F() { throw E; }\",\n C: () => \"function C(m) { throw new VexContractError(m); }\",\n // An exception of an op is an error of Vex too, as in the interpreter. Only the checks of the contract throw a\n // VexContractError, and they come before the run, so each catch of the run gives the sentinel.\n T: () => \"function T(f) { try { return f(); } catch { return E; } }\",\n // A constant of the run with a loop evaluates on its first read, so a loop in a branch that no run takes costs nothing.\n L: () => \"function L(f) { let done = false, v; return () => { if (!done) { done = true; try { v = f(); } catch { v = E; } } return v; }; }\",\n // A column of the run: the value of an expression at each record, on its first read.\n Q: () => \"function Q(f) { const m = []; return (j) => { let v = m[j]; if (v === undefined) { try { v = f(j); } catch { v = E; } m[j] = v; } return v; }; }\",\n G: () => \"function G(x) { return x === E ? F() : x; }\",\n // The pack of a column of the run: an array with the value of the column at each record (`#packed`).\n QA: () => \"function QA(n, f) { const a = []; for (let j = 0; j < n; j++) a.push(f(j)); return a; }\",\n // A fold over the targets before the origin, as a scan (COMPILE.MODULE.SCAN). The first call evaluates the first\n // state and the value of each target. When these values do not decrease, the targets of each origin are a prefix,\n // and each prefix keeps its state. NaN satisfies no test, so its target is in no prefix.\n PF: () => [\n \"function PF(n, init, key, test, step, result) {\",\n \" let ts, js, a0, bad, mono, pa;\",\n \" return (q) => {\",\n \" if (ts === undefined) {\",\n \" ts = [];\",\n \" js = [];\",\n \" bad = false;\",\n \" try { a0 = init(); } catch { a0 = E; }\",\n \" for (let j = 0; j < n; j++) {\",\n \" let t;\",\n \" try { t = key(j); } catch { bad = true; break; }\",\n \" if (t !== t) continue;\",\n \" ts.push(t);\",\n \" js.push(j);\",\n \" }\",\n \" mono = true;\",\n \" for (let i = 1; i < ts.length; i++) if (!(ts[i - 1] <= ts[i])) mono = false;\",\n \" pa = [a0];\",\n \" }\",\n \" if (a0 === E || bad || q === E) F();\",\n \" if (!mono) {\",\n \" let a = a0;\",\n \" for (let i = 0; i < ts.length; i++) if (test(ts[i], q)) a = step(a, js[i]);\",\n \" return result(a);\",\n \" }\",\n \" let lo = 0, hi = ts.length;\",\n \" while (lo < hi) {\",\n \" const h = (lo + hi) >> 1;\",\n \" if (test(ts[h], q)) lo = h + 1;\",\n \" else hi = h;\",\n \" }\",\n \" for (let i = pa.length - 1; i < lo; i++) pa.push(step(pa[i], js[i]));\",\n \" return result(pa[lo]);\",\n \" };\",\n \"}\",\n ].join(\"\\n\"),\n B: () => 'function B(x) { return typeof x === \"boolean\" ? x : F(); }',\n U: () => 'function U(x) { return typeof x === \"number\" ? x : F(); }',\n X: () => \"function X(t, n) { return t >= 0 && t < n ? t : F(); }\",\n // The index of a computed position, and of a computed key: a key of an array space is the text of its index.\n I: () => \"function I(t, n) { return Number.isInteger(t) && t >= 0 && t < n ? t : F(); }\",\n K: () => 'function K(k, n) { return typeof k === \"string\" && /^(0|[1-9]\\\\d*)$/.test(k) && +k < n ? +k : F(); }',\n // The ops on the order of a list (LIST.SORT, LIST.TAKE, LIST.NTH) work on the items with values. With strict, an\n // error item is the error of the op. A sort is stable, and the values are numbers without NaN or texts of one kind.\n // V gives a list without error items itself, so it is not copied (COMPILE.MODULE.LIST.SHARE). No op changes it. V does\n // not keep the cache of VW: a property on each new list made the list ops slower (ireko, vex-compiler 0.17.1).\n V: () => \"function V(l, s) { if (!l.some((x) => x[1] === E)) return l; if (s) F(); return l.filter((x) => x[1] !== E); }\",\n SB: () => [\n \"function SB(l, s) {\",\n \" const o = V(l, s);\",\n \" const t = o.length > 0 ? typeof o[0][1] : \\\"number\\\";\",\n \" for (const [, v] of o) if (typeof v !== t || (t !== \\\"number\\\" && t !== \\\"string\\\") || v !== v) F();\",\n \" return o.slice().sort((a, b) => (a[1] < b[1] ? -1 : a[1] > b[1] ? 1 : 0));\",\n \"}\",\n ].join(\"\\n\"),\n // The option by of sortBy (LIST.SORT.BY): the function f gives the sort value of each item with a value, in order.\n SK: () => [\n \"function SK(l, s, f) {\",\n \" const o = V(l, s).map((x) => [x, f(x[1])]);\",\n \" const t = o.length > 0 ? typeof o[0][1] : \\\"number\\\";\",\n \" for (const [, v] of o) if (typeof v !== t || (t !== \\\"number\\\" && t !== \\\"string\\\") || v !== v) F();\",\n \" return o.sort((a, b) => (a[1] < b[1] ? -1 : a[1] > b[1] ? 1 : 0)).map((x) => x[0]);\",\n \"}\",\n ].join(\"\\n\"),\n TK: () => \"function TK(l, n, s) { const o = V(l, s); return Number.isSafeInteger(n) && n >= 0 ? o.slice(0, n) : F(); }\",\n // The items with values of a list stay on its array, as GT keeps its index. Thus a loop that reads each item of a list\n // of n items with nth costs O(n), not O(n squared). count and first read them too (COMPILE.MODULE.NTH.INDEX).\n // A list without error items is its own array of items with values.\n VW: () => [\n \"function VW(l) {\",\n \" let o = l.vw;\",\n \" if (o === undefined) {\",\n \" o = l.some((x) => x[1] === E) ? l.filter((x) => x[1] !== E) : l;\",\n \" l.vw = o;\",\n \" }\",\n \" return o;\",\n \"}\",\n ].join(\"\\n\"),\n NT: () => [\n \"function NT(l, i, s) {\",\n \" const o = VW(l);\",\n \" if (s && o.length < l.length) F();\",\n \" return Number.isSafeInteger(i) && i >= 0 && i < o.length ? o[i][1] : F();\",\n \"}\",\n ].join(\"\\n\"),\n // count and first of a list that is not an each. With strict, an error item is the error of the op.\n CT: () => \"function CT(l, s) { const o = VW(l); return s && o.length < l.length ? F() : o.length; }\",\n FS: () => \"function FS(l, s) { const o = VW(l); return (s && o.length < l.length) || o.length === 0 ? F() : o[0][1]; }\",\n // fill (LIST.FILL, COMPILE.MODULE.FILL): n items with the value v, and the keys 0 to n - 1. A count that is not a whole\n // number from 0 to 100000, or a missing value, is the error of the interpreter. Each item can share the array of a list.\n // setNth (LIST.SETNTH, COMPILE.MODULE.SETNTH): a new array with a new pair at the position i. The item keeps its key.\n // V removes the error items, so the position counts the items with values. The old array and its pairs do not change.\n SN: () => [\n \"function SN(l, i, v, s) {\",\n \" const x = V(l, s);\",\n \" if (!(Number.isSafeInteger(i) && i >= 0 && i < x.length && v !== undefined)) F();\",\n \" const o = x.slice();\",\n \" o[i] = [x[i][0], v];\",\n \" return o;\",\n \"}\",\n ].join(\"\\n\"),\n FI: () => [\n \"function FI(n, v) {\",\n \" if (!(Number.isSafeInteger(n) && n >= 0 && n <= 100000 && v !== undefined)) F();\",\n \" const o = [];\",\n \" for (let i = 0; i < n; i++) o.push([i, v]);\",\n \" return o;\",\n \"}\",\n ].join(\"\\n\"),\n // A range of fill (COMPILE.MODULE.FILL.RANGE). FN gives the count of the items of `fill(n, v)` with the check of FI.\n // TN gives the count of `take` of a range with the check of TK. A sum with 0 changes -0 to 0, as the length does.\n FN: () => \"function FN(n, v) { return Number.isSafeInteger(n) && n >= 0 && n <= 100000 && v !== undefined ? n + 0 : F(); }\",\n TN: () => \"function TN(n, k) { return Number.isSafeInteger(k) && k >= 0 ? Math.min(n, k + 0) : F(); }\",\n } satisfies HelperTexts;\n}\n\n/** This function gives a part of the texts of the helpers, in the order of `HELPERS`. */\nfunction helperTexts2() {\n return {\n // A list of a field of the input (COMPILE.MODULE.LIST.INPUT): the array of a `vex.list` whose items have lists to the\n // depth `h`, and values that pass the test `t`. The shape is the shape of `isVexList`. An error item holds the sentinel.\n // An input that is not such a list, or an error item of `#DEPTH!`, gives undefined, so the check of the run fails.\n LI: () => [\n \"function LI(x, h, t) {\",\n \" if (typeof x !== \\\"object\\\" || x === null || x.kind !== \\\"vex.list\\\" || !Array.isArray(x.items)) return undefined;\",\n \" const o = [];\",\n \" for (let i = 0; i < x.items.length; i++) {\",\n \" const it = x.items[i];\",\n \" const r = typeof it === \\\"object\\\" && it !== null ? it.result : undefined;\",\n \" if (typeof r !== \\\"object\\\" || r === null || typeof it.key !== \\\"string\\\") return undefined;\",\n \" if (r.ok === true) {\",\n \" const v = h > 0 ? LI(r.value, h - 1, t) : r.value !== undefined && t(r.value) ? r.value : undefined;\",\n \" if (v === undefined) return undefined;\",\n \" o.push([it.key, v]);\",\n \" } else {\",\n \" const e = r.error;\",\n \" if (r.ok !== false || typeof e !== \\\"object\\\" || e === null || typeof e.code !== \\\"string\\\" || typeof e.kind !== \\\"string\\\" || typeof e.message !== \\\"string\\\" || !Array.isArray(e.path) || e.kind === \\\"depth\\\") return undefined;\",\n \" o.push([it.key, E]);\",\n \" }\",\n \" }\",\n \" return o;\",\n \"}\",\n ].join(\"\\n\"),\n // A plain list of a field of the input (COMPILE.MODULE.LIST.PLAIN): an array of the values of the items, with arrays to\n // the depth `h`. The key of an item is its position. The value VEX_ERROR is an error item, also if `t` accepts it.\n // Another value gives undefined, so the check of the run fails.\n LA: () => [\n \"function LA(x, h, t) {\",\n \" if (!Array.isArray(x)) return undefined;\",\n \" const o = [];\",\n \" for (let i = 0; i < x.length; i++) {\",\n \" const y = x[i];\",\n \" if (y === VEX_ERROR) {\",\n \" o.push([i, E]);\",\n \" continue;\",\n \" }\",\n \" const v = h > 0 ? LA(y, h - 1, t) : y !== undefined && t(y) ? y : undefined;\",\n \" if (v === undefined) return undefined;\",\n \" o.push([i, v]);\",\n \" }\",\n \" return o;\",\n \"}\",\n ].join(\"\\n\"),\n // The ops that build a list (LIST.BUILD) keep the key and the value of each item. A key is a position or a text, so\n // `without` and `get` compare the text of each key. A list is an array that does not change after the op that makes it.\n // The one exception is the array of AO of a loop, which no other part reads (COMPILE.MODULE.APPEND.OWN).\n DR: () => \"function DR(l, n, s) { const o = V(l, s); return Number.isSafeInteger(n) && n >= 0 ? o.slice(n) : F(); }\",\n AP: () => \"function AP(l, o, s) { return V(l, s).concat(V(o, s)); }\",\n // append into the list of a name of a loop (COMPILE.MODULE.APPEND.OWN). w is the array of the last append of the name\n // in this run of the loop, and no other part reads it. Such an array has no error items, so VW of it is the array.\n // With fuse, w can start with a first list that is clean and fresh (COMPILE.MODULE.FUSE.ADOPT). An append in the result\n // of the loop can use w too, when no part reads the list after it.\n // Each other list gets the copy of AP. V(o, s) throws before the first push, so an error does not change l. The loop\n // reads n items, so it ends also if a is l.\n AO: () => \"function AO(l, o, s, w) { if (l !== w) return AP(l, o, s); const a = V(o, s), n = a.length; for (let i = 0; i < n; i++) l.push(a[i]); return l; }\",\n // The target of an append of an owner that pushes the items of its second list (COMPILE.MODULE.APPEND.PUSH). The\n // array w is the target. Each other list gets a copy without its error items, and with s an error item is an error.\n // AI pushes the one item x of fill(1, x) into the target. The code of x evaluates before the call, as in the interpreter.\n AW: () => \"function AW(l, s, w) { if (l === w) return l; const a = V(l, s), o = []; for (let i = 0; i < a.length; i++) o.push(a[i]); return o; }\",\n AI: () => \"function AI(l, x, s, w) { const o = AW(l, s, w); o.push(x); return o; }\",\n WO: () => [\n \"function WO(l, o, s) {\",\n \" const a = V(l, s), g = new Map();\",\n \" for (const [k] of V(o, s)) g.set(`${k}`, 1);\",\n \" return a.filter((x) => !g.has(`${x[0]}`));\",\n \"}\",\n ].join(\"\\n\"),\n FL: () => [\n \"function FL(l, s) {\",\n \" const o = [];\",\n \" for (const [, v] of V(l, s)) for (const x of V(v, s)) o.push(x);\",\n \" return o;\",\n \"}\",\n ].join(\"\\n\"),\n // The index of the keys of a list (LIST.GET): the value of the first item of each key. The array keeps its index, so a\n // step that reads each key of a list of n items costs O(n). The key E marks an error item, for strict.\n // The array of a loop gets a push after a read (COMPILE.MODULE.APPEND.LET), so `n` counts the items in the index.\n // A push only adds items at the end, so the index adds only the new items. No other change of an array has a read before it.\n GT: () => [\n \"function GT(l, k, s) {\",\n \" let x = l.ix;\",\n \" if (x === undefined) {\",\n \" x = new Map();\",\n \" x.n = 0;\",\n \" l.ix = x;\",\n \" }\",\n \" if (x.n !== l.length) {\",\n \" for (let i = x.n; i < l.length; i++) {\",\n \" const [q, v] = l[i], t = `${q}`;\",\n \" if (v === E) x.set(E, E);\",\n \" else if (!x.has(t)) x.set(t, v);\",\n \" }\",\n \" x.n = l.length;\",\n \" }\",\n ' return (s && x.has(E)) || typeof k !== \"string\" || !x.has(k) ? F() : x.get(k);',\n \"}\",\n ].join(\"\\n\"),\n // The position of the first value among the items with a value (LIST.INDEXOF). `===` compares the values.\n IX: () => [\n \"function IX(l, x, s) {\",\n \" const o = V(l, s);\",\n ' if (typeof x !== \"number\" && typeof x !== \"string\" && typeof x !== \"boolean\") F();',\n \" for (let i = 0; i < o.length; i++) if (o[i][1] === x) return i;\",\n \" return F();\",\n \"}\",\n ].join(\"\\n\"),\n // The keys of a run (COMPILE.MODULE.KEYS): a map of each key to its position. A key that is not a text, or a second\n // use of a key, is against the contract, because a space has no such keys.\n KC: () => [\n \"function KC(a, n) {\",\n ' if (!Array.isArray(a) || a.length !== n) C(\"the keys are not an array with one key for each record\");',\n \" const m = new Map();\",\n \" for (let i = 0; i < n; i++) {\",\n \" const k = a[i];\",\n ' if (typeof k !== \"string\" || m.has(k)) C(`the key ${i} is not a text of its own`);',\n \" m.set(k, i);\",\n \" }\",\n \" return m;\",\n \"}\",\n ].join(\"\\n\"),\n // The position of a key of a move. A value that is not a key of the space is an error of the move (NAV.KEY).\n KP: () => \"function KP(m, k) { const i = m.get(k); return i === undefined ? F() : i; }\",\n } satisfies HelperTexts;\n}\n\n/** This function gives a part of the texts of the helpers, in the order of `HELPERS`. */\nfunction helperTexts3() {\n return {\n // The parents of a tree space: the position of the parent of each record, or -1 for a root. A walk up from each record\n // marks its keys, so a walk that meets a key of the same walk finds a cycle. Each key is in one walk, so the check is linear.\n PT: () => [\n \"function PT(p, n) {\",\n ' if (!Array.isArray(p) || p.length !== n) C(\"the parents are not an array with one parent for each record\");',\n \" const P = new Int32Array(n), s = new Uint8Array(n);\",\n \" for (let i = 0; i < n; i++) {\",\n \" const x = p[i];\",\n \" if (x !== -1 && !(Number.isInteger(x) && x >= 0 && x < n)) C(`the parent of the record ${i} is not -1 or the position of a record`);\",\n \" P[i] = x;\",\n \" }\",\n \" for (let i = 0; i < n; i++) {\",\n \" let k = i;\",\n \" while (k >= 0 && s[k] === 0) {\",\n \" s[k] = 1;\",\n \" k = P[k];\",\n \" }\",\n \" if (k >= 0 && s[k] === 1) C(`the parents of the record ${i} make a cycle`);\",\n \" for (k = i; k >= 0 && s[k] === 1; k = P[k]) s[k] = 2;\",\n \" }\",\n \" return P;\",\n \"}\",\n ].join(\"\\n\"),\n // The children of each record and the roots, in key order.\n CH: () => [\n \"function CH(P, n) {\",\n \" const h = [], r = [];\",\n \" for (let i = 0; i < n; i++) h.push([]);\",\n \" for (let i = 0; i < n; i++) (P[i] < 0 ? r : h[P[i]]).push(i);\",\n \" return [h, r];\",\n \"}\",\n ].join(\"\\n\"),\n // The siblings of each record with the record itself, and its position among them. The roots are the siblings of a root.\n SG: () => [\n \"function SG(P, h, r, n) {\",\n \" const g = [], s = new Int32Array(n);\",\n \" for (let i = 0; i < n; i++) g.push(P[i] < 0 ? r : h[P[i]]);\",\n \" for (const x of [r, ...h]) for (let q = 0; q < x.length; q++) s[x[q]] = q;\",\n \" return [g, s];\",\n \"}\",\n ].join(\"\\n\"),\n // The keys depth first, with each parent before its children, and the position and the size of the subtree of each\n // record. Thus the descendants of a record are the keys after it, as many as its subtree has under it.\n PR: () => [\n \"function PR(P, n) {\",\n \" const f = new Int32Array(n).fill(-1), x = new Int32Array(n), o = new Int32Array(n), at = new Int32Array(n), z = new Int32Array(n);\",\n \" let r = -1;\",\n \" for (let i = n - 1; i >= 0; i--) {\",\n \" const p = P[i];\",\n \" if (p < 0) {\",\n \" x[i] = r;\",\n \" r = i;\",\n \" } else {\",\n \" x[i] = f[p];\",\n \" f[p] = i;\",\n \" }\",\n \" }\",\n \" let m = 0;\",\n \" for (let k = r; k >= 0; ) {\",\n \" at[k] = m;\",\n \" o[m++] = k;\",\n \" if (f[k] >= 0) k = f[k];\",\n \" else {\",\n \" while (k >= 0 && x[k] < 0) k = P[k];\",\n \" if (k >= 0) k = x[k];\",\n \" }\",\n \" }\",\n \" for (let q = n - 1; q >= 0; q--) {\",\n \" const k = o[q], p = P[k];\",\n \" z[k]++;\",\n \" if (p >= 0) z[p] += z[k];\",\n \" }\",\n \" return [o, at, z];\",\n \"}\",\n ].join(\"\\n\"),\n UP: () => \"function UP(P, k) { const p = P[k]; return p < 0 ? F() : p; }\",\n SO: () => \"function SO(g, s, k, d) { const t = g[k][s[k] + d]; return t === undefined ? F() : t; }\",\n AN: () => \"function AN(P, k) { const o = []; for (let p = P[k]; p >= 0; p = P[p]) o.push(p); return o; }\",\n // The record and the keys under it, in the order of a breadth-first search. A tree has no cycle, so no key comes twice.\n BF: () => \"function BF(h, k) { const o = [k]; for (let i = 0; i < o.length; i++) for (const c of h[o[i]]) o.push(c); return o; }\",\n // The edges of a graph space: the positions of the ends of the edges from each record, in order. A second edge to the\n // same end is the same edge, as in the interpreter. The mark of an end is the number of its record plus 1.\n GR: () => [\n \"function GR(e, n) {\",\n ' if (!Array.isArray(e) || e.length !== n) C(\"the edges are not an array with the ends of the edges of each record\");',\n \" const O = [], s = new Int32Array(n);\",\n \" for (let i = 0; i < n; i++) {\",\n \" const x = e[i];\",\n \" if (!Array.isArray(x)) C(`the edges of the record ${i} are not an array`);\",\n \" const o = [];\",\n \" for (const t of x) {\",\n \" if (!(Number.isInteger(t) && t >= 0 && t < n)) C(`an edge of the record ${i} does not go to the position of a record`);\",\n \" if (s[t] !== i + 1) {\",\n \" s[t] = i + 1;\",\n \" o.push(t);\",\n \" }\",\n \" }\",\n \" O.push(o);\",\n \" }\",\n \" return O;\",\n \"}\",\n ].join(\"\\n\"),\n // The predecessors of each record of a graph, in key order: the records in key order, and the ends of the edges of each record.\n GI: () => \"function GI(O, n) { const I = []; for (let i = 0; i < n; i++) I.push([]); for (let i = 0; i < n; i++) for (const t of O[i]) I[t].push(i); return I; }\",\n // The record and the keys that a path of edges reaches from it, once, in the order of a breadth-first search.\n RB: () => \"function RB(O, k, n) { const s = new Uint8Array(n), o = [k]; s[k] = 1; for (let i = 0; i < o.length; i++) for (const c of O[o[i]]) if (s[c] === 0) { s[c] = 1; o.push(c); } return o; }\",\n // The state of a run of a sheet (COMPILE.MODULE.SHEET), as in SheetRun: the result of each finished cell, the search\n // of Tarjan with its stack, and the budget of the stack. `r` reads a cell, `f` fills a cell, and `o` gives a column.\n // A cell without a formula has the error sentinel from the start, as the error of its read.\n // A column of a direct fill (COMPILE.MODULE.SHEET.DIRECT): the error sentinel of a cell changes to VEX_ERROR.\n DO: () => \"function DO(d) { for (let k = 0; k < d.length; k++) if (d[k] === E) d[k] = VEX_ERROR; return d; }\",\n // A list of a result (COMPILE.MODULE.LIST.RESULT): a `vex.list` with a text key for each item. An error item has the\n // error VEX_ERROR. The depth `h` is the number of the levels of lists in the items. One key gets the list, so it is not frozen.\n LO: () => 'function LO(l, h) { return { kind: \"vex.list\", items: l.map(([k, v]) => ({ key: `${k}`, result: v === E ? { ok: false, error: VEX_ERROR } : { ok: true, value: h > 0 ? LO(v, h - 1) : v } })) }; }',\n // The list of a run that each key gets (COMPILE.MODULE.FUSE.OUT): LO, but frozen, because the keys share the object. LS\n // keeps no object on the array, because a property on each new list made the list ops slower (ireko, vex-compiler 0.17.1).\n LS: () => 'function LS(l, h) { return Object.freeze({ kind: \"vex.list\", items: Object.freeze(l.map(([k, v]) => ({ key: `${k}`, result: v === E ? { ok: false, error: VEX_ERROR } : { ok: true, value: h > 0 ? LS(v, h - 1) : v } }))) }); }',\n // A plain list of a result (COMPILE.MODULE.LIST.PLAIN): an array of the values of the items, with no keys. An error\n // item is VEX_ERROR. The depth `h` is the number of the levels of lists in the items.\n LP: () => \"function LP(l, h) { return l.map((x) => (x[1] === E ? VEX_ERROR : h > 0 ? LP(x[1], h - 1) : x[1])); }\",\n // A list in an argument of an op or in a field of a record (COMPILE.MODULE.LIST.ARG, COMPILE.MODULE.LIST.FIELD): a frozen\n // `vex.list`, as the interpreter gives. The array keeps it, so each later read of the list gives the same object.\n // The array of a loop gets a push after a read (COMPILE.MODULE.APPEND.LET). A push only adds items, so an object with\n // another count of items is old, and LV makes a new object.\n LV: () => [\n \"function LV(l, h) {\",\n \" let o = l.vl;\",\n \" if (o === undefined || o.items.length !== l.length) {\",\n ' o = Object.freeze({ kind: \"vex.list\", items: Object.freeze(l.map(([k, v]) => ({ key: `${k}`, result: v === E ? { ok: false, error: VEX_ERROR } : { ok: true, value: h > 0 ? LV(v, h - 1) : v } }))) });',\n \" l.vl = o;\",\n \" }\",\n \" return o;\",\n \"}\",\n ].join(\"\\n\"),\n // The clean form (COMPILE.MODULE.FUSE.CLEAN): the facts prove that no item of a list holds the sentinel. Thus V gives\n // the list itself, VW gives the list, and strict cannot fail. Each helper below is the helper without its last letter,\n // with no scan, no test of the sentinel and no option strict. The other checks stay, so each error stays an error.\n SBC: () => [\n \"function SBC(l) {\",\n \" const t = l.length > 0 ? typeof l[0][1] : \\\"number\\\";\",\n \" for (const [, v] of l) if (typeof v !== t || (t !== \\\"number\\\" && t !== \\\"string\\\") || v !== v) F();\",\n \" return l.slice().sort((a, b) => (a[1] < b[1] ? -1 : a[1] > b[1] ? 1 : 0));\",\n \"}\",\n ].join(\"\\n\"),\n } satisfies HelperTexts;\n}\n\n/** This function gives a part of the texts of the helpers, in the order of `HELPERS`. */\nfunction helperTexts4() {\n return {\n SKC: () => [\n \"function SKC(l, f) {\",\n \" const o = l.map((x) => [x, f(x[1])]);\",\n \" const t = o.length > 0 ? typeof o[0][1] : \\\"number\\\";\",\n \" for (const [, v] of o) if (typeof v !== t || (t !== \\\"number\\\" && t !== \\\"string\\\") || v !== v) F();\",\n \" return o.sort((a, b) => (a[1] < b[1] ? -1 : a[1] > b[1] ? 1 : 0)).map((x) => x[0]);\",\n \"}\",\n ].join(\"\\n\"),\n // The sort in place (COMPILE.MODULE.FUSE): a clean list that is fresh is its own sort buffer, so the sort makes no\n // copy. No other part holds the array, so a failure leaves no changed list that a part reads. The sort is stable.\n // A list of 64 items or fewer gets an insertion sort (COMPILE.MODULE.FUSE.SORT), which calls no comparator function.\n // Its test \">\" moves an item only past a larger value, so equal values keep their order. A longer list gets the\n // stable sort of the engine. The kinds of the sort values go through the same check before each of the two sorts.\n SBI: () => [\n \"function SBI(l) {\",\n \" const n = l.length, t = n > 0 ? typeof l[0][1] : \\\"number\\\";\",\n \" for (let i = 0; i < n; i++) { const v = l[i][1]; if (typeof v !== t || (t !== \\\"number\\\" && t !== \\\"string\\\") || v !== v) F(); }\",\n \" if (n > 64) l.sort((a, b) => (a[1] < b[1] ? -1 : a[1] > b[1] ? 1 : 0));\",\n \" else for (let i = 1; i < n; i++) {\",\n \" const x = l[i], v = x[1];\",\n \" let j = i - 1;\",\n \" for (; j >= 0 && l[j][1] > v; j--) l[j + 1] = l[j];\",\n \" l[j + 1] = x;\",\n \" }\",\n \" return l;\",\n \"}\",\n ].join(\"\\n\"),\n // The option by: the array k holds the sort value of each item, so the sort makes no pair for an item. f runs once\n // for each item, in order, and the array l does not change before the check of the sort values. A long list sorts an\n // array of indices by k, and then reads the items from a copy of l.\n SKI: () => [\n \"function SKI(l, f) {\",\n \" const n = l.length, k = new Array(n);\",\n \" for (let i = 0; i < n; i++) k[i] = f(l[i][1]);\",\n \" const t = n > 0 ? typeof k[0] : \\\"number\\\";\",\n \" for (const v of k) if (typeof v !== t || (t !== \\\"number\\\" && t !== \\\"string\\\") || v !== v) F();\",\n \" if (n > 64) {\",\n \" const o = new Array(n), c = l.slice();\",\n \" for (let i = 0; i < n; i++) o[i] = i;\",\n \" o.sort((a, b) => (k[a] < k[b] ? -1 : k[a] > k[b] ? 1 : 0));\",\n \" for (let i = 0; i < n; i++) l[i] = c[o[i]];\",\n \" } else for (let i = 1; i < n; i++) {\",\n \" const v = k[i], x = l[i];\",\n \" let j = i - 1;\",\n \" for (; j >= 0 && k[j] > v; j--) { k[j + 1] = k[j]; l[j + 1] = l[j]; }\",\n \" k[j + 1] = v; l[j + 1] = x;\",\n \" }\",\n \" return l;\",\n \"}\",\n ].join(\"\\n\"),\n TKC: () => \"function TKC(l, n) { return Number.isSafeInteger(n) && n >= 0 ? l.slice(0, n) : F(); }\",\n DRC: () => \"function DRC(l, n) { return Number.isSafeInteger(n) && n >= 0 ? l.slice(n) : F(); }\",\n // The loop reads n items, so it ends also if o is l.\n AWC: () => \"function AWC(l, w) { if (l === w) return l; const o = []; for (let i = 0; i < l.length; i++) o.push(l[i]); return o; }\",\n AIC: () => \"function AIC(l, x, w) { if (l !== w) { const o = []; for (let i = 0; i < l.length; i++) o.push(l[i]); l = o; } l.push(x); return l; }\",\n // The end of a filter of the array of a loop in place (COMPILE.MODULE.APPEND.KEEP): the array keeps its first n items.\n // GT and LV count only the pushes of their array, so the filter removes their caches. VW of the array is the array.\n KS: () => \"function KS(l, n) { l.length = n; if (l.ix !== undefined) l.ix = undefined; if (l.vl !== undefined) l.vl = undefined; }\",\n AOC: () => \"function AOC(l, o, w) { if (l !== w) return l.concat(o); const n = o.length; for (let i = 0; i < n; i++) l.push(o[i]); return l; }\",\n WOC: () => [\n \"function WOC(l, o) {\",\n \" const g = new Map();\",\n \" for (const [k] of o) g.set(`${k}`, 1);\",\n \" return l.filter((x) => !g.has(`${x[0]}`));\",\n \"}\",\n ].join(\"\\n\"),\n FLC: () => \"function FLC(l) { const o = []; for (const [, v] of l) for (const x of v) o.push(x); return o; }\",\n IXC: () => [\n \"function IXC(l, x) {\",\n ' if (typeof x !== \"number\" && typeof x !== \"string\" && typeof x !== \"boolean\") F();',\n \" for (let i = 0; i < l.length; i++) if (l[i][1] === x) return i;\",\n \" return F();\",\n \"}\",\n ].join(\"\\n\"),\n NTC: () => \"function NTC(l, i) { return Number.isSafeInteger(i) && i >= 0 && i < l.length ? l[i][1] : F(); }\",\n SNC: () => [\n \"function SNC(l, i, v) {\",\n \" if (!(Number.isSafeInteger(i) && i >= 0 && i < l.length && v !== undefined)) F();\",\n \" const o = l.slice();\",\n \" o[i] = [l[i][0], v];\",\n \" return o;\",\n \"}\",\n ].join(\"\\n\"),\n FSC: () => \"function FSC(l) { return l.length === 0 ? F() : l[0][1]; }\",\n LOC: () => 'function LOC(l, h) { return { kind: \"vex.list\", items: l.map(([k, v]) => ({ key: `${k}`, result: { ok: true, value: h > 0 ? LOC(v, h - 1) : v } })) }; }',\n LSC: () => 'function LSC(l, h) { return Object.freeze({ kind: \"vex.list\", items: Object.freeze(l.map(([k, v]) => ({ key: `${k}`, result: { ok: true, value: h > 0 ? LSC(v, h - 1) : v } }))) }); }',\n LPC: () => \"function LPC(l, h) { return l.map(h > 0 ? (x) => LPC(x[1], h - 1) : (x) => x[1]); }\",\n // LV and LVC keep one object on the array. A clean list gives the same object from both.\n LVC: () => [\n \"function LVC(l, h) {\",\n \" let o = l.vl;\",\n \" if (o === undefined || o.items.length !== l.length) {\",\n ' o = Object.freeze({ kind: \"vex.list\", items: Object.freeze(l.map(([k, v]) => ({ key: `${k}`, result: { ok: true, value: h > 0 ? LVC(v, h - 1) : v } }))) });',\n \" l.vl = o;\",\n \" }\",\n \" return o;\",\n \"}\",\n ].join(\"\\n\"),\n // A column of lists (COMPILE.MODULE.SHEET.LIST): each cell with a list gives a `vex.list`. No two cells share it, so LC uses LO.\n LC: () => \"function LC(d, h) { for (let k = 0; k < d.length; k++) if (d[k] !== VEX_ERROR) d[k] = LO(d[k], h); return d; }\",\n // A plain column of lists (COMPILE.MODULE.LIST.PLAIN): each cell with a list gives an array.\n LCP: () => \"function LCP(d, h) { for (let k = 0; k < d.length; k++) if (d[k] !== VEX_ERROR) d[k] = LP(d[k], h); return d; }\",\n } satisfies HelperTexts;\n}\n\n/** This function gives a part of the texts of the helpers, in the order of `HELPERS`. */\nfunction helperTexts5() {\n return {\n SH: () => [\n \"function SH(n, cols, own, budget) {\",\n \" const pg = (c, k) => {\",\n \" const o = own[c];\",\n \" const g = o === undefined ? undefined : o[k];\",\n \" return g === undefined ? cols[c] : g;\",\n \" };\",\n \" const D = [];\",\n \" for (let c = 0; c < cols.length; c++) {\",\n \" const d = new Array(n);\",\n \" for (let k = 0; k < n; k++) if (pg(c, k) === undefined) d[k] = E;\",\n \" D.push(d);\",\n \" }\",\n \" const seen = new Map(), stack = [], FILL = {};\",\n \" let top = FILL, missed = false, next = 0, used = 0;\",\n \" const start = (c, k) => {\",\n \" const i = next++;\",\n \" const v = { id: c * n + k, c, k, i, low: i, re: false, r: E, p: false, need: undefined };\",\n \" seen.set(v.id, v);\",\n \" stack.push(v);\",\n \" return v;\",\n \" };\",\n \" const ev = (v, g) => {\",\n \" const caller = top;\",\n \" v.p = false;\",\n \" v.need = undefined;\",\n \" top = v;\",\n \" used += g[1];\",\n \" const x = g[0](v.k);\",\n \" used -= g[1];\",\n \" top = caller;\",\n \" if (!v.p) v.r = x;\",\n \" };\",\n \" const end = (v, caller) => {\",\n \" if (v.low === v.i) {\",\n \" const ms = stack.splice(stack.lastIndexOf(v));\",\n \" const cycle = ms.length > 1 || v.re;\",\n \" for (const m of ms) {\",\n \" seen.delete(m.id);\",\n \" D[m.c][m.k] = cycle ? E : m.r;\",\n \" }\",\n \" } else if (caller !== undefined) caller.low = Math.min(caller.low, v.low);\",\n \" };\",\n \" const r = (c, k) => {\",\n \" const d = D[c][k];\",\n \" if (d !== undefined) return d;\",\n \" const caller = top;\",\n \" if (caller === FILL) {\",\n \" missed = true;\",\n \" return E;\",\n \" }\",\n \" if (caller.p) return E;\",\n \" const s = seen.get(c * n + k);\",\n \" if (s !== undefined) {\",\n \" caller.low = Math.min(caller.low, s.i);\",\n \" s.re = true;\",\n \" return E;\",\n \" }\",\n \" const g = pg(c, k);\",\n \" const v = start(c, k);\",\n \" if (used + g[1] > budget) {\",\n \" caller.p = true;\",\n \" caller.need = v;\",\n \" return E;\",\n \" }\",\n \" ev(v, g);\",\n \" if (v.p) {\",\n \" caller.p = true;\",\n \" caller.need = v;\",\n \" return E;\",\n \" }\",\n \" end(v, caller);\",\n \" const x = D[c][k];\",\n \" return x === undefined ? E : x;\",\n \" };\",\n \" const drive = (c, k) => {\",\n \" const work = [start(c, k)];\",\n \" for (let v = work[0]; v !== undefined; v = work[work.length - 1]) {\",\n \" ev(v, pg(v.c, v.k));\",\n \" if (v.p) {\",\n \" for (let q = v.need; q !== undefined; q = q.need) work.push(q);\",\n \" continue;\",\n \" }\",\n \" work.pop();\",\n \" end(v, work[work.length - 1]);\",\n \" }\",\n \" };\",\n \" const f = (c, k) => {\",\n \" if (D[c][k] !== undefined) return;\",\n \" missed = false;\",\n \" const x = pg(c, k)[0](k);\",\n \" if (missed) drive(c, k);\",\n \" else D[c][k] = x;\",\n \" };\",\n \" const o = (c) => {\",\n \" const d = D[c], out = new Array(n);\",\n \" for (let k = 0; k < n; k++) out[k] = d[k] === E ? VEX_ERROR : d[k];\",\n \" return out;\",\n \" };\",\n \" return { r, f, o };\",\n \"}\",\n ].join(\"\\n\"),\n // The keys of a tree in the order of a fill (SHEET.FILL): each parent before its children, or after them with `post`.\n // `back` reverses the order of the siblings.\n KO: () => [\n \"function KO(h, r, post, back) {\",\n \" const o = [], st = [];\",\n \" const push = (x) => {\",\n \" if (back) for (let q = 0; q < x.length; q++) st.push(x[q]);\",\n \" else for (let q = x.length - 1; q >= 0; q--) st.push(x[q]);\",\n \" };\",\n \" push(r);\",\n \" while (st.length > 0) {\",\n \" const k = st.pop();\",\n \" o.push(k);\",\n \" push(h[k]);\",\n \" }\",\n \" return post ? o.reverse() : o;\",\n \"}\",\n ].join(\"\\n\"),\n // The memo of a function of one key, and of more keys. -0 has its own entry, because an op can tell it from 0.\n M1: () => [\n \"function M1(f) {\",\n \" const m = new Map();\",\n \" return (k) => {\",\n \" const s = Object.is(k, -0) ? Z : k;\",\n \" let r = m.get(s);\",\n \" if (r === undefined) {\",\n \" try { r = f(k); } catch { r = E; }\",\n \" m.set(s, r);\",\n \" }\",\n \" return G(r);\",\n \" };\",\n \"}\",\n ].join(\"\\n\"),\n M: () => [\n \"function M(f) {\",\n \" const root = new Map();\",\n \" return (...k) => {\",\n \" let m = root;\",\n \" for (const x of k.slice(0, -1)) {\",\n \" const s = Object.is(x, -0) ? Z : x;\",\n \" let c = m.get(s);\",\n \" if (c === undefined) m.set(s, (c = new Map()));\",\n \" m = c;\",\n \" }\",\n \" const last = k.at(-1);\",\n \" const s = Object.is(last, -0) ? Z : last;\",\n \" let r = m.get(s);\",\n \" if (r === undefined) {\",\n \" try { r = f(...k); } catch { r = E; }\",\n \" m.set(s, r);\",\n \" }\",\n \" return G(r);\",\n \" };\",\n \"}\",\n ].join(\"\\n\"),\n } satisfies HelperTexts;\n}\n\n/** The helpers of the generated code. A module has only the helpers that it uses. Each entry is a function, so the mutation lane gives the text of a helper to the tests that emit it, not to all tests. */\nconst HELPERS: Readonly<Record<Exclude<Helper, \"S\">, () => string>> = { ...helperTexts1(), ...helperTexts2(), ...helperTexts3(), ...helperTexts4(), ...helperTexts5() };\n\n/**\n * This list has the globals of JavaScript that the code of a module reads. This code is the helpers, the run and the\n * copies of the ops of the test domains. A test reads the text of the modules of the golden files and checks this list (V-060).\n */\nexport const MODULE_GLOBALS: ReadonlySet<string> = new Set(\"Array Error Int32Array Map Math Number Object Uint8Array undefined\".split(\" \"));\n\n/** A part of the helper S that only some nodes need (helperS). */\ntype Feature = \"group\" | \"prefix\" | \"strict\" | \"ok\" | \"pre\";\n\n/**\n * This function gives the code of the helper S, a node of the memo that keeps its items (Printer.#cached). The helper\n * has only the parts that the nodes of the module need:\n *\n * - `group`: the groups of the values of the key (mode 1).\n * - `prefix`: the prefixes of the items (mode 2).\n * - `strict`: the option strict of a list op.\n * - `ok`: the check of the kind of a value.\n * - `pre`: the tests before the test of the key.\n *\n * The node gives `key` for the value of each item, and `val` for the value of an item from its index. It gives `test`\n * for the test of the key.\n */\nconst helperS = (has: ReadonlySet<Feature>): string => {\n const on = (f: Feature, ...lines: readonly string[]): readonly string[] => (has.has(f) ? lines : []);\n const strict = has.has(\"strict\");\n const ok = has.has(\"ok\");\n // The items that end the lookup with an error, and the items that the lookup skips.\n const fails = [...(strict ? [\"x === E\"] : []), ...(ok ? [\"x === W\"] : [])].join(\" || \");\n const skips = strict ? \"x === N || (x === E && !strict)\" : \"x === N || x === E\";\n return [\n \"function S(n, mode, strict, a0, step, result, key, val, test, pre, ok) {\",\n \" let ts, js, xs, bad, reach, gs, mono, pa, pc, pe;\",\n \" const value = (i) => {\",\n \" let x = xs[i];\",\n \" if (x === undefined) {\",\n \" x = val(js[i]);\",\n ...on(\"ok\", \" if (ok && x !== E && x !== N && !ok(x)) x = W;\"),\n \" xs[i] = x;\",\n \" }\",\n \" return x;\",\n \" };\",\n \" return M1((q) => {\",\n \" if (ts === undefined) {\",\n \" ts = [];\",\n \" js = [];\",\n \" xs = [];\",\n ...on(\"strict\", \" bad = false;\", \" reach = 0;\"),\n \" for (let j = 0; j < n; j++) {\",\n \" try {\",\n ...on(\"pre\", \" if (pre && !pre(j)) continue;\"),\n ...on(\"strict\", \" reach++;\"),\n \" const t = key(j);\",\n // NaN satisfies no test of a group or of a prefix, so its item is in none.\n \" if (mode && t !== t) continue;\",\n \" ts.push(t);\",\n \" js.push(j);\",\n \" } catch {\",\n ...on(\"strict\", \" bad = true;\"),\n \" }\",\n \" }\",\n ...on(\"group\", \" if (mode === 1) {\", \" gs = new Map();\", \" for (let i = 0; i < ts.length; i++) {\", \" let g = gs.get(ts[i]);\", \" if (g === undefined) gs.set(ts[i], (g = []));\", \" g.push(i);\", \" }\", \" }\"),\n ...on(\"prefix\", \" if (mode === 2) {\", \" mono = true;\", \" for (let i = 1; i < ts.length; i++) if (!(ts[i - 1] <= ts[i])) mono = false;\", \" pa = [a0];\", \" pc = [0];\", \" pe = [false];\", \" }\"),\n \" }\",\n // A key with an error makes an error item of each item that reaches the test of the key.\n strict ? \" if (q === E) return strict && (bad || reach > 0) ? F() : result(a0, 0);\" : \" if (q === E) return result(a0, 0);\",\n ...on(\"strict\", \" if (strict && bad) F();\"),\n \" let a = a0, c = 0;\",\n \" const add = (i) => {\",\n \" const x = value(i);\",\n ` if (${skips}) return;`,\n ...(fails === \"\" ? [] : [` if (${fails}) F();`]),\n \" a = step(a, c, x);\",\n \" c++;\",\n \" };\",\n ...on(\"group\", \" if (mode === 1) {\", \" const g = gs.get(q);\", \" if (g !== undefined) for (const i of g) add(i);\", \" return result(a, c);\", \" }\"),\n // The values t do not decrease, so the items whose test is true are a prefix. Each prefix keeps its running value.\n ...on(\n \"prefix\",\n \" if (mode === 2 && mono) {\",\n \" let lo = 0, hi = ts.length;\",\n \" while (lo < hi) {\",\n \" const h = (lo + hi) >> 1;\",\n \" if (test(ts[h], q)) lo = h + 1;\",\n \" else hi = h;\",\n \" }\",\n \" for (let i = pa.length - 1; i < lo; i++) {\",\n \" let x = value(i), b = pa[i], d = pc[i], err = pe[i];\",\n ...(fails === \"\" ? [\" if (x !== N && x !== E) {\"] : [` if (${fails.replace(\"x === E\", \"(x === E && strict)\")}) err = true;`, \" else if (x !== N && x !== E) {\"]),\n \" b = step(b, d, x);\",\n \" d++;\",\n \" }\",\n \" pa.push(b);\",\n \" pc.push(d);\",\n \" pe.push(err);\",\n \" }\",\n \" if (pe[lo]) F();\",\n \" return result(pa[lo], pc[lo]);\",\n \" }\",\n ),\n \" for (let i = 0; i < ts.length; i++) if (test(ts[i], q)) add(i);\",\n \" return result(a, c);\",\n \" });\",\n \"}\",\n ].join(\"\\n\");\n};\n\n/** The step of the running value of first and of count: the name of its function in a module, and its code. */\nconst FIRST_STEP: readonly [string, string] = [\"s_first\", \"(a, c, x) => (c === 0 ? x : a)\"];\n\n/** The step of the running value of each list op: the name of its function in a module, and its code. */\nconst STEPS: Readonly<Record<string, readonly [string, string]>> = {\n count: FIRST_STEP,\n first: FIRST_STEP,\n sum: [\"s_add\", \"(a, c, x) => a + x\"],\n mean: [\"s_add\", \"(a, c, x) => a + x\"],\n min: [\"s_min\", \"(a, c, x) => (c === 0 ? x : Math.min(a, x))\"],\n max: [\"s_max\", \"(a, c, x) => (c === 0 ? x : Math.max(a, x))\"],\n any: [\"s_or\", \"(a, c, x) => a || x\"],\n none: [\"s_or\", \"(a, c, x) => a || x\"],\n all: [\"s_and\", \"(a, c, x) => a && x\"],\n};\n\n/** The helpers that each helper uses. */\nconst NEEDS: Readonly<Record<Helper, readonly Helper[]>> = {\n F: [], C: [], T: [], L: [], Q: [], G: [\"F\"], PF: [\"F\"], B: [\"F\"], U: [\"F\"], X: [\"F\"], I: [\"F\"], K: [\"F\"], M: [\"G\"], M1: [\"G\"], S: [\"M1\", \"F\"],\n // Only the helpers of the list ops use V, and each of them needs F too, so the need of V only completes the list.\n // Stryker disable next-line ArrayDeclaration: see the comment above\n V: [\"F\"],\n SB: [\"V\", \"F\"], SK: [\"V\", \"F\"], TK: [\"V\", \"F\"], VW: [], NT: [\"VW\", \"F\"], CT: [\"VW\", \"F\"], FS: [\"VW\", \"F\"], FI: [\"F\"], FN: [\"F\"], TN: [\"F\"], LI: [], LA: [], LP: [],\n DR: [\"V\", \"F\"], AP: [\"V\"], AO: [\"AP\", \"V\"], WO: [\"V\"], FL: [\"V\"], GT: [\"F\"], IX: [\"V\", \"F\"], SN: [\"V\", \"F\"],\n // Each module has C, and each move uses F (#move), so these needs only complete the list.\n // Stryker disable next-line ArrayDeclaration: see the comment above\n PT: [\"C\"], GR: [\"C\"], UP: [\"F\"], SO: [\"F\"],\n CH: [], SG: [], PR: [], AN: [], BF: [],\n GI: [], RB: [],\n KC: [\"C\"], KP: [\"F\"], SH: [], KO: [], DO: [], LO: [], LS: [], LC: [\"LO\"], LV: [], LCP: [\"LP\"],\n SBC: [\"F\"], SKC: [\"F\"], TKC: [\"F\"], DRC: [\"F\"], AOC: [], WOC: [], FLC: [], IXC: [\"F\"], NTC: [\"F\"], SNC: [\"F\"], FSC: [\"F\"], LOC: [], LSC: [], LVC: [], LPC: [],\n SBI: [\"F\"], SKI: [\"F\"], QA: [], AW: [\"V\"], AI: [\"AW\"], AWC: [], AIC: [], KS: [],\n};\n\n/**\n * The forms of the helpers of the list fields, for a module where each list field has the depth 0. The test of the\n * value takes the place of the recursion, and the helper has no argument `h` (COMPILE.MODULE.SIZE.FLAT).\n */\nconst FLAT_LIST_HELPERS: Readonly<Record<\"LI\" | \"LA\", () => string>> = {\n LI: () => HELPERS.LI().replace(\"LI(x, h, t)\", \"LI(x, t)\").replace(\"h > 0 ? LI(r.value, h - 1, t) : \", \"\"),\n LA: () => HELPERS.LA().replace(\"LA(x, h, t)\", \"LA(x, t)\").replace(\"h > 0 ? LA(y, h - 1, t) : \", \"\"),\n};\n\n/** The clean form of each helper that gives a list of the code to the outside (COMPILE.MODULE.FUSE.CLEAN). */\nconst CLEAN_FORMS = { LO: \"LOC\", LS: \"LSC\", LV: \"LVC\", LP: \"LPC\" } as const;\n\n/** The parts of a tree that a run computes before the loop over its keys, if the program needs them. */\ntype TreePart = \"children\" | \"siblings\" | \"order\";\n\n/** The statement of each part of a tree in a run, with the helper that computes it. */\nconst TREE_PARTS: Readonly<Record<TreePart, readonly [TreeHelper, string]>> = {\n children: [\"CH\", \"const [H, RT] = CH(P, n);\"],\n siblings: [\"SG\", \"const [GP, SI] = SG(P, H, RT, n);\"],\n order: [\"PR\", \"const [PO, PI, SZ] = PR(P, n);\"],\n};\n\n/** An axis whose targets in a tree space are a range of an array of positions: an axis of a tree, or a window. */\ntype TreeAxis = Extract<Axis, { readonly t: \"children\" | \"ancestors\" | \"descendants\" | \"siblings\" | \"successors\" | \"predecessors\" | \"reachable\" | \"window\" }>;\n\n/** The axes of a tree space in a module, and the axes that a module of an array space does not have. */\nconst TREE_AXES: ReadonlySet<string> = new Set([\"children\", \"ancestors\", \"descendants\", \"siblings\", \"successors\", \"predecessors\", \"reachable\"]);\n\n/** This function tells if an axis has its targets in a range of an array of positions in a tree space. */\nconst isTreeAxis = (a: Axis): a is TreeAxis => a.t === \"window\" || TREE_AXES.has(a.t);\n\n/** The axes of a graph space in a module (COMPILE.MODULE.GRAPH), other than the axes of each space. */\nconst GRAPH_AXES: ReadonlySet<string> = new Set([\"successors\", \"predecessors\", \"reachable\"]);\n\n/**\n * The targets of an axis of a tree space: the statements before the loop, and the positions `a[q]` for `q` from `lo` up\n * to `hi`. The loop skips the key `skip`.\n */\ninterface TreeRange {\n readonly s: readonly string[];\n readonly a: string;\n readonly lo: string;\n readonly hi: string;\n readonly skip: string | undefined;\n}\n\n/** The list ops of a standalone module. */\nconst LIST_OPS: ReadonlySet<string> = new Set([\"count\", \"sum\", \"mean\", \"min\", \"max\", \"any\", \"all\", \"none\", \"first\"]);\n/** The list ops with a running value in a module: the list ops above, and `reduce` with the op of a domain (COMPILE.MODULE.REDUCE). */\nconst FOLD_OPS: ReadonlySet<string> = new Set([...LIST_OPS, \"reduce\"]);\nconst NUMBER_LIST_OPS: ReadonlySet<string> = new Set([\"count\", \"sum\", \"mean\", \"min\", \"max\"]);\nconst BOOLEAN_LIST_OPS: ReadonlySet<string> = new Set([\"any\", \"all\", \"none\"]);\n/** The list ops over lists of `#build`: append, without and flat (LIST.BUILD), get (LIST.GET) and indexOf (LIST.INDEXOF). */\nconst BUILD_OPS: ReadonlySet<string> = new Set([\"append\", \"without\", \"flat\", \"get\", \"indexOf\"]);\n\n/** The helper of each op of `#build`. */\nconst BUILD_HELPERS: Readonly<Record<string, BuildHelper>> = { append: \"AP\", without: \"WO\", flat: \"FL\", get: \"GT\", indexOf: \"IX\" };\n\n/**\n * The ops whose value is a list: the list ops of LIST.SORT, LIST.TAKE and LIST.BUILD, and `fill` (LIST.FILL). A domain\n * can have the op `fill`. Then the op of the domain gives no list, and the place of a list gives a reason.\n */\nconst LIST_RESULTS: ReadonlySet<string> = new Set([\"sortBy\", \"take\", \"setNth\", \"drop\", \"append\", \"without\", \"flat\", \"fill\"]);\n\n/** The list ops that give the value of an item (LIST.NTH, LIST.GET) and `first`. An item of a list of lists is a list. */\nconst ITEM_OPS: ReadonlySet<string> = new Set([\"nth\", \"first\", \"get\"]);\n\n/**\n * The scope of `listy`. `key` gives the name of a key of a node of the memo. `name`, `cell` and `field` tell if a name, a\n * cell or a field gives a list with `levels` levels (COMPILE.MODULE.LIST.INPUT). `op` tells if a domain declares a list as\n * the result of an op (COMPILE.MODULE.LIST.OP). `fn` gives the bound function of a name.\n */\ninterface ListScope {\n readonly key: (e: Expr) => Name | undefined;\n readonly op: (name: string) => boolean;\n readonly name: (name: string, levels: number) => boolean;\n readonly fn: (name: string) => ListFn | undefined;\n readonly cell: (e: ExprOf<\"ext\">, levels: number) => boolean;\n readonly field: (e: ExprOf<\"ref\">, levels: number) => boolean;\n}\n\n/** A bound function for `listy`: its node, and the scope of its binding (FN.BIND). */\ninterface ListFn {\n readonly fn: ExprOf<\"fn\">;\n readonly scope: ListScope;\n}\n\n/** This function tells if a list has `levels` levels of lists: 1 for each list, and 2 for a list of lists. */\nfunction hasLevels(l: ListInfo | undefined, levels: number): boolean {\n return l !== undefined && (levels === 1 || hasLevels(l.inner, levels - 1));\n}\n\n/**\n * This function tells if an expression gives a list with `levels` levels of lists (COMPILE.MODULE.LIST.NESTED). An each,\n * a list literal and a list op of `LIST_RESULTS` give a list. A name of a list, and a let or a loop whose result is a\n * list, give a list too. A call gives a list when the body of its function gives one (COMPILE.MODULE.LIST.CALL). An op of\n * `ITEM_OPS` gives one level less than its list. The scope tells the names and the functions outside the expression.\n */\nfunction listy(e: Expr, scope: ListScope, levels = 1): boolean {\n const key = scope.key(e);\n if (key !== undefined) return hasLevels(key.list, levels);\n switch (e.tag) {\n case \"each\":\n return levels === 1 || listy(e.body, itemsIn(e, scope), levels - 1);\n case \"lit\":\n // A module has no list literal with lists as items, so a literal has one level.\n return levels === 1 && isVexList(e.value);\n case \"app\":\n return listyApp(e, scope, levels);\n case \"var\":\n return scope.name(e.name, levels);\n case \"let\":\n return listy(e.body, scopeIn(e.bind, scope), levels);\n case \"fold\":\n case \"iterate\":\n return listy(e.result, scopeIn(e.init, scope), levels);\n // A column gives a boolean or a number (FIX.KIND).\n case \"fix\":\n case \"last\":\n return false;\n case \"ext\":\n return scope.cell(e, levels);\n case \"ref\":\n return scope.field(e, levels);\n case \"call\": {\n // A call of no function gives a reason in the printer. A value or a parameter with the name of a function makes\n // the printer give that reason too, so the scope does not hide the function.\n const f = scope.fn(e.fn);\n return f !== undefined && listy(f.fn.body, paramsIn(f, e.args, scope), levels);\n }\n case \"fn\":\n case \"rec\":\n return false;\n }\n}\n\n/** This function tells if an op gives a list with `levels` levels of lists (`listy`). */\nfunction listyApp(e: ExprOf<\"app\">, scope: ListScope, levels: number): boolean {\n const { op, args } = e;\n const argument = (i: number, change: number): boolean => args.slice(i, i + 1).some((x) => listy(x, scope, levels + change));\n // A branch of if and ifError can be a list (COMPILE.MODULE.LIST.RESULT).\n if (op === \"if\" || op === \"ifError\") return args.slice(op === \"if\" ? 1 : 0).some((x) => listy(x, scope, levels));\n // An op of a domain gives a list of values (COMPILE.MODULE.LIST.OP).\n if (levels === 1 && scope.op(op)) return true;\n if (ITEM_OPS.has(op)) return argument(0, 1);\n if (!LIST_RESULTS.has(op)) return false;\n if (levels === 1) return true;\n if (op === \"fill\") return argument(1, -1);\n if (op === \"flat\") return argument(0, 1);\n // An empty list literal takes the levels of the other list of append.\n return argument(0, 0) || (op === \"append\" && argument(1, 0));\n}\n\n/**\n * This function gives the scope of the body of an each. The first name `as` holds an item of the list of the axis, so it\n * has one level less than the list. The second name holds a position (COMPILE.MODULE.LIST.ITEM).\n */\nfunction itemsIn(e: ExprOf<\"each\">, scope: ListScope): ListScope {\n if (e.as === undefined) return scope;\n const [item, index] = e.as;\n // The kernel refuses names `as` over an axis without a list.\n const list = listOf(e.axis) as Expr;\n return { ...scope, name: (name, levels) => (name === item ? listy(list, scope, levels + 1) : name !== index && scope.name(name, levels)) };\n}\n\n/**\n * This function gives the scope of some bindings. A value hides a name outside, and a function is not a list. A\n * function sees the scope outside the bindings, so it cannot call itself.\n */\nfunction scopeIn(bind: Readonly<Record<string, Expr>>, scope: ListScope): ListScope {\n const fns = new Map<string, ListFn>();\n for (const [name, x] of Object.entries(bind)) if (x.tag === \"fn\") fns.set(name, { fn: x, scope });\n return { ...scope, name: (name, levels) => (Object.hasOwn(bind, name) ? listy(bind[name] as Expr, scope, levels) : scope.name(name, levels)), fn: (name) => fns.get(name) ?? scope.fn(name) };\n}\n\n/**\n * This function gives the scope of the body of a function at a call. The body sees the scope of the binding of the\n * function, and each parameter has the levels of its argument.\n */\nfunction paramsIn(f: ListFn, args: readonly Expr[], scope: ListScope): ListScope {\n const lists = new Map(args.map((x, i) => [f.fn.params[i], x]));\n return {\n ...f.scope,\n name: (name, levels) => {\n const arg = lists.get(name);\n return arg === undefined ? f.scope.name(name, levels) : listy(arg, scope, levels);\n },\n };\n}\n\n/**\n * This function tells if an expression has a list literal with an item (LIST.LITERAL), `fill` (LIST.FILL) or an op for\n * which `gives` is true (COMPILE.MODULE.LIST.OP). Then a key of a list of the expression can be a key that is not the\n * position of a record.\n */\nfunction hasTextKeys(e: Expr, gives: (name: string) => boolean): boolean {\n return (e.tag === \"lit\" && isVexList(e.value) && e.value.items.length > 0) || (e.tag === \"app\" && (e.op === \"fill\" || gives(e.op))) || children(e).some((x) => hasTextKeys(x, gives));\n}\n\n/**\n * This function gives the facts of the list of `append` from the facts of its two lists. It also gives the list of\n * `if` from its two branches. An empty list fits each list. The op `op` names the op in the reason.\n */\nfunction joinLists(a: ListInfo, b: ListInfo, op: string): ListInfo {\n // The value can be the array of the empty list, so it is fresh only when both lists are fresh.\n if (a.empty === true) return { ...b, clean: a.clean === true && b.clean === true, fresh: false };\n if (b.empty === true) return { ...a, clean: a.clean === true && b.clean === true, fresh: false };\n if ((a.inner === undefined) !== (b.inner === undefined)) throw new NotStandalone(`\"${op}\" of a list of lists and a list of values`);\n const texts = a.texts === true || b.texts === true;\n const inner = a.inner === undefined ? undefined : joinLists(a.inner, b.inner as ListInfo, op);\n return { item: join(a.item, b.item), inner, texts, clean: a.clean === true && b.clean === true, fresh: a.fresh === true && b.fresh === true };\n}\n\n/** This function gives the facts of the list of `if` or `ifError` from its two branches. Two values that are not lists give undefined. */\nfunction branchLists(op: string, a: ListInfo | undefined, b: ListInfo | undefined): ListInfo | undefined {\n if (a === undefined && b === undefined) return undefined;\n if (a === undefined || b === undefined) throw new NotStandalone(`\"${op}\" of a list and a value that is not a list`);\n return joinLists(a, b, op);\n}\n\n/**\n * This function tells if a list of a step fits the list of a name of a loop (LOOP.LIST). The items of the step have the\n * kind of the items of the name, if the name has one. The name also has the text keys and the lists of lists of the step.\n */\nfunction fits(name: ListInfo, step: ListInfo): boolean {\n if (step.empty === true) return true;\n if (name.item !== undefined && step.item !== name.item) return false;\n if (step.texts === true && name.texts !== true) return false;\n return name.inner === undefined ? step.inner === undefined : step.inner !== undefined && fits(name.inner, step.inner);\n}\n\n/**\n * This function gives the names of a loop with a clean list (COMPILE.MODULE.FUSE.FACTS). A name is clean when its first\n * list is clean and each step gives a clean list. The function first assumes the fact for each name with a clean first\n * list. Then it removes each name whose step does not prove the fact, until no name changes. A name of an item in\n * `items` hides each other name. `outer` gives the fact of a name outside the loop.\n */\nfunction cleanNames(firsts: ReadonlyMap<string, boolean>, step: Names, items: readonly string[], outer: (name: string) => boolean): ReadonlySet<string> {\n const clean = new Set([...firsts].flatMap(([name, c]) => (c ? [name] : [])));\n const fact = (name: string): boolean => !items.includes(name) && (firsts.has(name) ? clean.has(name) : outer(name));\n for (let changed = true; changed; ) {\n changed = false;\n for (const name of clean) {\n const x = step[name];\n if (x !== undefined && !cleanForm(x, fact)) {\n clean.delete(name);\n changed = true;\n }\n }\n }\n return clean;\n}\n\n/** The list ops whose value is clean, because `V` removes each error item or `FI` checks each value. */\nconst CLEAN_OPS: ReadonlySet<string> = new Set([\"append\", \"flat\", \"drop\", \"take\", \"setNth\", \"without\", \"sortBy\", \"fill\"]);\n\n/**\n * This function tells if the form of an expression proves that its list is clean, with the facts `fact` of the names.\n * It does not print the expression, so it knows only the clean ops, the literals, `if`, `ifError`, `let` and names.\n */\nfunction cleanForm(e: Expr, fact: (name: string) => boolean): boolean {\n switch (e.tag) {\n case \"app\":\n if (CLEAN_OPS.has(e.op)) return true;\n return (e.op === \"if\" || e.op === \"ifError\") && e.args.slice(e.op === \"if\" ? 1 : 0).every((x) => cleanForm(x, fact));\n case \"lit\":\n return isVexList(e.value) && e.value.items.every((it) => it.result.ok);\n case \"var\":\n return fact(e.name);\n case \"let\":\n // A binding sees the context of the let, so its form has the facts of the names outside.\n return cleanForm(e.body, (name) => (name in e.bind ? cleanForm(e.bind[name] as Expr, fact) : fact(name)));\n case \"fold\":\n case \"iterate\": {\n // The result of a loop sees the names of the loop, with the facts of their own fixpoint, and the names outside.\n const firsts = new Map(Object.entries(e.init).map(([name, x]): [string, boolean] => [name, cleanForm(x, fact)]));\n const clean = cleanNames(firsts, e.step, e.tag === \"fold\" ? (e.as ?? []) : [], fact);\n return cleanForm(e.result, (name) => (name in e.init ? clean.has(name) : fact(name)));\n }\n // Stryker disable StringLiteral,ConditionalExpression: without its case, the switch gives undefined, and each caller reads undefined as false.\n case \"call\":\n case \"each\":\n case \"ext\":\n case \"fix\":\n case \"fn\":\n case \"last\":\n case \"rec\":\n case \"ref\":\n // Stryker restore StringLiteral,ConditionalExpression\n return false;\n }\n}\n\n/** This function gives the count of the reads of a part that a loop or a function can evaluate again. */\nconst again = (n: number): number => (n > 0 ? Infinity : 0);\n\n/** This function adds the counts of the reads of the parts `xs`. */\nconst refsIn = (xs: readonly Expr[], name: string): number => xs.reduce((n, x) => n + refsOf(x, name), 0);\n\n/**\n * This function counts the reads of the name `name` in an expression. A read in the body of an `each`, of a step of\n * a loop or of a function counts `Infinity`. Such a part can evaluate many times. A name of the expression\n * hides the name.\n */\nfunction refsOf(e: Expr, name: string): number {\n switch (e.tag) {\n case \"var\":\n return e.name === name ? 1 : 0;\n case \"let\":\n return refsIn(Object.values(e.bind), name) + (name in e.bind ? 0 : refsOf(e.body, name));\n case \"fn\":\n return e.params.includes(name) ? 0 : again(refsOf(e.body, name));\n // The first values and the step evaluate at each row (FIX.ROUNDS).\n case \"fix\":\n return again(refsOf(e.init, name) + refsOf(e.step, name));\n case \"last\":\n return 0;\n case \"each\": {\n // Only the body sees the names of the items (AXIS.LIST.SCOPE). The tests of the axis evaluate for each item.\n const list = listOf(e.axis);\n const tests = axisExprs(e.axis).filter((x) => x !== list);\n const own = list === undefined ? [] : [list];\n return refsIn([...own, ...addrExprs(e.at)], name) + again(refsIn(tests, name)) + (e.as?.includes(name) === true ? 0 : again(refsOf(e.body, name)));\n }\n case \"fold\":\n case \"iterate\": {\n // The steps and the result see the names of the loop. The tests of a fold or of a data limit read only the names outside the loop.\n const hidden = name in e.init;\n const steps = [...Object.values(e.step), ...(e.tag === \"iterate\" && e.until !== undefined ? [e.until] : [])];\n const axis = e.tag === \"fold\" ? e.axis : limitAxis(e);\n const list = axis === undefined ? undefined : listOf(axis);\n const once = [...(list === undefined ? [] : [list]), ...(e.tag === \"fold\" ? addrExprs(e.at) : [])];\n // Stryker disable next-line ArrayDeclaration: refsOf of a string gives NaN, and again(NaN) gives 0.\n const tests = axis === undefined ? [] : axisExprs(axis).filter((x) => x !== list);\n const item = e.tag === \"fold\" && e.as?.includes(name) === true;\n return refsIn([...Object.values(e.init), ...once], name) + again(refsIn(tests, name)) + (hidden || item ? 0 : again(refsIn(steps, name))) + (hidden ? 0 : refsOf(e.result, name));\n }\n case \"app\":\n case \"call\":\n case \"ext\":\n case \"lit\":\n case \"rec\":\n case \"ref\":\n return refsIn(children(e), name);\n }\n}\n\n/**\n * This function counts the reads of the value of each node of a program, from its form (COMPILE.MODULE.FUSE.FACTS).\n * The parent of a node reads its value once. A branch of `if` and of `ifError`, the body of a `let` and the result of\n * a loop give their value to their parent. Thus they get the count of the parent. A loop reads its first values and its\n * steps at each step, so they get `Infinity`. A binding gets the count of the reads of its name. An argument of a call\n * gets the count of the reads of its parameter. The printer adds the parts that the code reads again (`#shared`).\n */\nfunction readCounts(root: Expr): ReadonlyMap<Expr, number> {\n const out = new Map<Expr, number>();\n const visit = (e: Expr, reads: number, fns: ReadonlyMap<string, ExprOf<\"fn\">>): void => {\n // A node at two places of the program evaluates at each place, so each place reads its own value.\n out.set(e, Math.max(out.get(e) ?? 0, reads));\n const all = (xs: readonly Expr[], n: number): void => {\n for (const x of xs) visit(x, n, fns);\n };\n switch (e.tag) {\n case \"app\": {\n // The branches of if and of ifError give their value to the parent.\n const first = e.op === \"if\" ? 1 : e.op === \"ifError\" ? 0 : e.args.length;\n e.args.forEach((x, i) => visit(x, i < first ? 1 : reads, fns));\n return;\n }\n case \"let\": {\n // A binding sees the context of the let, so a function cannot call itself. A value hides a function of its name.\n const inner = new Map(fns);\n for (const [name, x] of Object.entries(e.bind)) {\n if (x.tag === \"fn\") inner.set(name, x);\n else inner.delete(name);\n visit(x, x.tag === \"fn\" ? 1 : refsOf(e.body, name), fns);\n }\n visit(e.body, reads, inner);\n return;\n }\n case \"call\": {\n const fn = fns.get(e.fn);\n e.args.forEach((x, i) => {\n const param = fn?.params[i];\n visit(x, param === undefined ? Infinity : refsOf((fn as ExprOf<\"fn\">).body, param), fns);\n });\n return;\n }\n case \"fix\":\n all(children(e), Infinity);\n return;\n case \"fold\":\n case \"iterate\": {\n const names = new Set([...Object.values(e.init), ...Object.values(e.step)]);\n for (const x of children(e)) visit(x, x === e.result ? reads : names.has(x) ? Infinity : 1, fns);\n return;\n }\n case \"each\":\n // Stryker disable next-line StringLiteral: an extension has no children.\n case \"ext\":\n case \"last\":\n case \"fn\":\n // Stryker disable next-line StringLiteral: a literal has no children.\n case \"lit\":\n case \"rec\":\n case \"ref\":\n // Stryker disable next-line StringLiteral: a variable has no children.\n case \"var\":\n all(children(e), 1);\n }\n };\n visit(root, 1, new Map());\n return out;\n}\n\n/** This function tells if the step of a list op throws for a value of the kind `kind`, which is the wrong kind. */\nconst stepThrows = (op: string, kind: Kind | undefined): boolean => op === \"reduce\" || (NUMBER_STEPS.has(op) && kind !== \"number\") || (BOOLEAN_LIST_OPS.has(op) && kind !== \"boolean\");\n\n/** The list ops whose step takes a number. */\nconst NUMBER_STEPS: ReadonlySet<string> = new Set([\"sum\", \"mean\", \"min\", \"max\"]);\n\n/** This function gives the kind of the result of a list op: first gives the kind of its items. */\nconst listKind = (op: string, item: Kind | undefined): Kind | undefined => (NUMBER_LIST_OPS.has(op) ? \"number\" : BOOLEAN_LIST_OPS.has(op) ? \"boolean\" : item);\n\nconst LOOPS = new WeakMap<Expr, boolean>();\n\n/**\n * This function tells if the step of the name `name` of a loop appends to the list of the name (COMPILE.MODULE.APPEND.OWN).\n * It puts the append nodes of the form into `out`. The form is a read of the name,\n * `append(form, X)`, `if(c, form, form)` or a let with the form as its body. No other part of the form reads the name:\n * not `X`, not `c` and not a binding of a let.\n *\n * A let can also bind a form to a new name (COMPILE.MODULE.APPEND.LET). Then no other binding reads the name, and the\n * body does not read the old list. The body can read the new name in each way. Such a let goes into `lets`, because the\n * value of the step can then be another list.\n *\n * With `wide`, one branch of an `if` can be another list (COMPILE.MODULE.APPEND.OTHER). The body of such a let can\n * then be a form of the new name.\n */\nfunction ownForm(e: Expr, name: string, out: Expr[], lets: Expr[], wide = false): boolean {\n const free = (x: Expr): boolean => !namesOf(x).has(name);\n if (e.tag === \"var\") return e.name === name;\n if (e.tag === \"let\") {\n const held = Object.entries(e.bind).filter(([, x]) => !free(x));\n if (held.length === 0) return ownForm(e.body, name, out, lets, wide);\n const [bind, x] = held[0] as [string, Expr];\n // A binding of the name itself hides the old list in the body, so the body can read the name.\n if (held.length > 1 || (bind !== name && !free(e.body)) || !ownForm(x, name, out, lets, wide)) return false;\n lets.push(e);\n // The body can append to the new name (COMPILE.MODULE.APPEND.OTHER). Then these appends push into the array too.\n if (wide && bind !== name) {\n const relay: Expr[] = [];\n if (ownForm(e.body, bind, relay, lets, wide)) out.push(...relay);\n }\n return true;\n }\n if (e.tag !== \"app\" || e.args.length === 0) return false;\n const [head, ...rest] = e.args as [Expr, ...Expr[]];\n // An if without three arguments gives a reason (#if), so the form does not check the count.\n if (e.op === \"if\") {\n if (!free(head)) return false;\n const forms = rest.map((x) => ownForm(x, name, out, lets, wide));\n // One branch must be a form, so the step reads the name. The other branch can be another list.\n return forms.every(Boolean) || (forms.some(Boolean) && otherList(e, lets, wide));\n }\n if (e.op !== \"append\" || !rest.every(free) || !ownForm(head, name, out, lets, wide)) return false;\n out.push(e);\n return true;\n}\n\n/**\n * This function tells if the branch `x` of the `if` node `e` of a form is another list (COMPILE.MODULE.APPEND.OTHER).\n * Such a branch evaluates before each push of the step, so it can read the name in each way. Its value can be another\n * list, so the `if` goes into `lets`. The printer gives each place of the program an object of its own (`unsharedAll`).\n * Thus an append of the form is not also an append in such a branch.\n */\nfunction otherList(e: Expr, lets: Expr[], wide: boolean): boolean {\n if (wide) lets.push(e);\n return wide;\n}\n\n/**\n * This function gives the filters of the list of the name `name` in the branches of the `if` nodes in `lets`\n * (COMPILE.MODULE.APPEND.KEEP). These nodes are the branches of other lists of COMPILE.MODULE.APPEND.OTHER. A filter is\n * `flat` over an each over the axis `list` of the name. The body of the each does not read the name, so it does\n * not see the array while the filter changes it. The other nodes in `lets` are `let` nodes, and the test of an `if`\n * does not read the name.\n */\nfunction keepsOf(lets: readonly Expr[], name: string): readonly Expr[] {\n const keeps = (e: Expr): boolean => {\n const [each] = e.tag === \"app\" && e.op === \"flat\" ? e.args : [];\n return each?.tag === \"each\" && each.axis.t === \"list\" && each.axis.list.tag === \"var\" && each.axis.list.name === name && !namesOf(each.body).has(name);\n };\n return lets.flatMap((e) => (e.tag === \"app\" ? e.args.filter(keeps) : []));\n}\n\n/**\n * This function tells if each value of the list `e` has at most one item (COMPILE.MODULE.APPEND.KEEP). Such a list is\n * `fill(0, x)`, `fill(1, x)`, a literal of at most one item or an `if` of such lists. `fill` must be the op of the\n * language (`own`). A filter in place then puts at most one item for each item of its list, as the last statement of\n * the item. Thus a put does not come before the read of the item at its position.\n */\nfunction atMostOne(e: Expr, own: boolean): boolean {\n if (e.tag === \"lit\") return isVexList(e.value) && e.value.items.length <= 1;\n if (e.tag !== \"app\") return false;\n // An if without three arguments gives a reason (#if), so the function does not check the count.\n if (e.op === \"if\") return e.args.slice(1).every((x) => atMostOne(x, own));\n const [count] = e.args.map(literalOf);\n return own && e.op === \"fill\" && (count === 0 || count === 1);\n}\n\n/** The list ops whose value is a number or an item of the list, so the value cannot hold the array of the list. */\nconst READ_OPS: ReadonlySet<string> = new Set([\"count\", \"nth\", \"first\"]);\n\n/**\n * This function tells if each read of the name `name` in `e` only reads its list (COMPILE.MODULE.APPEND.READ). Such a\n * read is the list of `count`, `nth` or `first`, or the list of the axis `list` of a fold. These values are numbers,\n * items or the names of the fold, so they cannot hold the array of the list. A function that reads the name does not\n * read it.\n */\nfunction readsOnly(e: Expr, name: string): boolean {\n const reads = (x: Expr | undefined): boolean => x?.tag === \"var\" && x.name === name;\n if (reads(e) || (e.tag === \"fn\" && namesOf(e).has(name))) return false;\n if (e.tag === \"app\" && READ_OPS.has(e.op) && reads(e.args[0])) return e.args.slice(1).every((x) => readsOnly(x, name));\n const list = e.tag === \"fold\" && e.axis.t === \"list\" && reads(e.axis.list) ? e.axis.list : undefined;\n return children(e).every((x) => x === list || readsOnly(x, name));\n}\n\n/**\n * This function tells if the result of a loop appends to the list of the name `name` as its last reader\n * (COMPILE.MODULE.FUSE.ADOPT). It puts the append nodes of the form into `out`. The form is the form of `ownForm`. A\n * `let` can also bind the form to a new name. Then no other binding and not the body reads `name`, and the body is a\n * form of the new name. Such a let goes into `relays`. No other part of the form reads the name, so no part reads the\n * old list after an append.\n */\nfunction lastForm(e: Expr, name: string, out: Expr[], relays: Map<Expr, Relay>): boolean {\n const free = (x: Expr): boolean => !namesOf(x).has(name);\n if (e.tag === \"var\") return e.name === name;\n if (e.tag === \"let\") {\n const held = Object.entries(e.bind).filter(([, x]) => !free(x));\n // A binding of the name hides the name of the loop in the body.\n if (held.length === 0) return !Object.hasOwn(e.bind, name) && lastForm(e.body, name, out, relays);\n const [bind, x] = held[0] as [string, Expr];\n const nodes: Expr[] = [];\n if (held.length > 1 || (bind !== name && !free(e.body)) || !lastForm(x, name, out, relays) || !lastForm(e.body, bind, nodes, relays)) return false;\n relays.set(e, { bind, nodes });\n return true;\n }\n if (e.tag !== \"app\" || e.args.length === 0) return false;\n const [head, ...rest] = e.args as [Expr, ...Expr[]];\n if (e.op === \"if\") return free(head) && rest.every((x) => lastForm(x, name, out, relays));\n if (e.op !== \"append\" || !rest.every(free) || !lastForm(head, name, out, relays)) return false;\n out.push(e);\n return true;\n}\n\n/**\n * This function tells if a `let` of the form of `ownForm` binds the name `name` again. The appends under such a let\n * append to another list. Then the value of the step can be a list that is not the array of the name\n * (COMPILE.MODULE.FUSE.ADOPT).\n */\nfunction shadows(e: Expr, name: string): boolean {\n if (e.tag === \"let\") return Object.hasOwn(e.bind, name) || shadows(e.body, name);\n if (e.tag !== \"app\") return false;\n const [head, ...rest] = e.args as [Expr, ...Expr[]];\n return e.op === \"if\" ? rest.some((x) => shadows(x, name)) : shadows(head, name);\n}\n\n/**\n * This function tells if an append into the list of a name of a loop can take the first list as its own array\n * (COMPILE.MODULE.FUSE.ADOPT). No other part of the code holds a fresh array. AO does not scan the array that it\n * takes, so the list must also be clean.\n */\nfunction adoptable(l: ListInfo | undefined): boolean {\n if (l?.fresh !== true) return false;\n // Stryker disable next-line ConditionalExpression: each fresh list of the printer is clean, but the test keeps AO correct for a new fresh list\n return l.clean === true;\n}\n\n/** This function gives the names that an expression reads, also the names that it binds itself. */\nfunction namesOf(e: Expr, out = new Set<string>()): Set<string> {\n if (e.tag === \"var\") out.add(e.name);\n for (const x of children(e)) namesOf(x, out);\n return out;\n}\n\n/**\n * The smallest work of an expression in a column of the run. The work is the number of nodes. A node of the memo and a\n * constant of the run count as one node each. A part with less work costs less than the read of its column.\n */\nconst COLUMN_WORK = 10;\n\n/** The parts of the head of a loop over targets: the first value, the condition and the step. */\ninterface ForParts {\n readonly init: string;\n readonly cond: string;\n readonly next: string;\n}\n\n/** This function gives the parts of a loop over targets: from `lo` up to `hi`, or from `hi` down to `lo` in the reverse order. */\nconst forParts = (j: string, lo: string, hi: string, reverse: boolean): ForParts =>\n reverse ? { init: `${hi} - 1`, cond: `${j} >= ${lo}`, next: `${j}--` } : { init: lo, cond: `${j} < ${hi}`, next: `${j}++` };\n\n/** This function gives the head of a loop over targets from its parts. */\nconst forHead = (j: string, p: ForParts): string => `for (let ${j} = ${p.init}; ${p.cond}; ${p.next}) {`;\n\n/**\n * This function gives the value that stops the step `x` of the name `name` of a fold (COMPILE.MODULE.EXIT), or\n * undefined. The step `and(name, ...)` stops at false, and the step `or(name, ...)` stops at true. A name of `as` is\n * not a name of `init`, so the first argument reads the name of the fold.\n */\nconst stopOf = (x: Expr, name: string): boolean | undefined => {\n if (x.tag !== \"app\" || (x.op !== \"and\" && x.op !== \"or\")) return undefined;\n const [head] = x.args;\n return head?.tag === \"var\" && head.name === name ? x.op === \"or\" : undefined;\n};\n\n/** This function tells if an expression has a loop in a loop: an axis, a fold or an iteration in another one. */\nfunction nestsLoops(e: Expr, inLoop = false): boolean {\n const loop = e.tag === \"each\" || e.tag === \"fold\" || e.tag === \"iterate\";\n return (loop && inLoop) || children(e).some((x) => nestsLoops(x, inLoop || loop));\n}\n\n/** This function tells if an expression has a loop of names: a fold or an iteration. */\nfunction hasLoop(e: Expr): boolean {\n let found = LOOPS.get(e);\n if (found === undefined) {\n found = e.tag === \"fold\" || e.tag === \"iterate\" || e.tag === \"fix\" || children(e).some(hasLoop);\n LOOPS.set(e, found);\n }\n return found;\n}\n\n/**\n * This function tells if a node of the memo has a loop of its own. Such a loop is outside its keys and outside the nodes\n * of the memo in it. A node without one combines the values of other nodes, and a function of its own only costs time.\n */\nfunction ownLoop(e: Expr, root: Expr, memo: ReadonlyMap<Expr, readonly Expr[]>, keys: ReadonlySet<Expr>): boolean {\n if (e !== root && (memo.has(e) || keys.has(e))) return false;\n return e.tag === \"each\" || children(e).some((x) => ownLoop(x, root, memo, keys));\n}\n\n/** This function gives the nodes of the memo of an expression that have a loop of their own, with their keys. */\nfunction memoOf(expr: Expr): ReadonlyMap<Expr, readonly Expr[]> {\n const all = memoNodes(expr);\n return new Map([...all].filter(([e, keys]) => ownLoop(e, e, all, new Set(keys))));\n}\n\n/** This function tells if each level of `deps` is one of `levels`. */\nconst within = (deps: ReadonlySet<number>, levels: readonly number[]): boolean => [...deps].every((d) => levels.includes(d));\n\n/** This function tells if an expression contains the expression `x`, the same object. */\nfunction contains(e: Expr, x: Expr): boolean {\n return e === x || children(e).some((c) => contains(c, x));\n}\n\n/** This function gives the base of an axis and its tests in the order of evaluation. */\nfunction testsOf(axis: Axis): { readonly base: Axis; readonly tests: readonly Expr[] } {\n const tests: Expr[] = [];\n let base = axis;\n while (base.t === \"where\") {\n tests.unshift(base.test);\n base = base.axis;\n }\n return { base, tests };\n}\n\n/**\n * This function gives the parts of a test `and`, and of each part that is a test `and` too. `and` stops at the first\n * `false`, as a chain of tests does, and each part must be a boolean.\n */\nfunction partsOf(t: Expr): readonly Expr[] {\n return t.tag === \"app\" && t.op === \"and\" && t.args.length > 0 ? t.args.flatMap(partsOf) : [t];\n}\n\n/** This function gives the kind of two values in the branches of a form, if they have the same kind. */\nconst join = (a: Kind | undefined, b: Kind | undefined): Kind | undefined => (a === b ? a : undefined);\n\n/** This function gives a value that is a constant of the run, with plain code. */\nconst plainValue = (code: string, kind: Kind | undefined): Value => ({ code, kind, safe: true, deps: NO_DEPS, plain: true });\n\n/** This function gives the code of a value with no statements. */\nconst bare = (v: Value): Code => ({ s: [], v });\n\n/**\n * This function gives a domain in the form of a module (COMPILE.MODULE.FORM). Each part of the form replaces the part of\n * the domain, so the printer reads one domain of plain data. A domain without a form stays the same object.\n */\nfunction formOf(d: AnyDomain): AnyDomain {\n const form = d.moduleForm;\n if (form === undefined) return d;\n return { ...d, ...form, ops: Object.fromEntries(Object.entries(d.ops).map(([name, spec]) => [name, { ...spec, ...form.ops?.[name] }])) } as AnyDomain;\n}\n\n/** This function gives the code of a literal. A value that is not a finite number, a text, a boolean or null has no code. */\nfunction literal(value: unknown): Value {\n if (typeof value === \"number\") {\n if (!Number.isFinite(value)) throw new NotStandalone(\"a literal is a number that is not finite\");\n return plainValue(Object.is(value, -0) ? \"-0\" : String(value), \"number\");\n }\n if (typeof value === \"string\") return plainValue(JSON.stringify(value), \"string\");\n if (typeof value === \"boolean\") return plainValue(String(value), \"boolean\");\n if (value === null) return plainValue(\"null\", undefined);\n throw new NotStandalone(\"a literal is not a number, a text, a boolean or null\");\n}\n\n/** The values of each kind that `copied` gives to a function and to its copy. */\nconst SAMPLES: Readonly<Record<PrimitiveKind, readonly unknown[]>> = {\n number: [0, 1, -1, 2.5, -0, 1e300, -7],\n string: [\"\", \"a\", \"ab c\"],\n boolean: [true, false],\n};\n\n/** This function gives each list of arguments with one sample of each parameter, from the samples of each parameter. */\nfunction samples(each: readonly (readonly unknown[])[]): readonly (readonly unknown[])[] {\n return each.reduce<readonly (readonly unknown[])[]>((acc, values) => acc.flatMap((xs) => values.map((x) => [...xs, x])), [[]]);\n}\n\n/** This function tells if a value is an object. A function is not one here. */\nconst isObject = (x: unknown): x is object => typeof x === \"object\" && x !== null;\n\n/** This function gives the parts of a value of a class: the items of a `Map` or of a `Set`, or else the own fields. */\nconst partsOfInstance = (x: object): unknown => (x instanceof Map || x instanceof Set ? [...x] : { ...x });\n\n/**\n * This function is the rule of `same` for two objects. Two objects with different prototypes differ. Two values of a\n * class compare by their parts. The rules of `sameValue` compare each list and each plain record.\n */\nfunction sameObjects(a: unknown, b: unknown): boolean | undefined {\n if (!isObject(a) || !isObject(b)) return undefined;\n const proto: unknown = Object.getPrototypeOf(a);\n if (proto !== Object.getPrototypeOf(b)) return false;\n if (proto === null || proto === Object.prototype || Array.isArray(a)) return undefined;\n return sameValue(partsOfInstance(a), partsOfInstance(b), sameObjects);\n}\n\n/**\n * This function tells if two values are the same. The walk of `sameValue` sees each leaf with `Object.is`, so\n * `Infinity`, `NaN` and `undefined` differ from `null`, and `-0` differs from `0` (V-093). The JSON text sees the order of\n * the fields and the result of a `toJSON` function. A value that has no JSON text compares by the walk only.\n */\nfunction same(a: unknown, b: unknown): boolean {\n if (Object.is(a, b)) return true;\n if (!isObject(a) || !isObject(b)) return false;\n return call(() => JSON.stringify(a)).value === call(() => JSON.stringify(b)).value && sameValue(a, b, sameObjects);\n}\n\n/** This function gives the value of a call, or that it threw. */\nfunction call(f: () => unknown): { readonly threw: boolean; readonly value?: unknown } {\n try {\n return { threw: false, value: f() };\n } catch {\n return { threw: true };\n }\n}\n\n/** This function tells if two calls give the same: the same value, or an exception in both. */\nfunction sameCall(a: () => unknown, b: () => unknown): boolean {\n const x = call(a);\n const y = call(b);\n return x.threw === y.threw && same(x.value, y.value);\n}\n\n/**\n * This function gives the source of a function of a domain, for a copy in a module. The source must be an expression:\n * the source of a native function or of a method does not compile as one. A copy must give the values of the function:\n * a function that reads a name outside itself gives an exception in the copy. Thus the copy and the function must give\n * the same for the samples of their kinds.\n */\nfunction copied(f: (...a: never[]) => unknown, each: readonly (readonly unknown[])[], what: string): string {\n const src = functionText(f);\n let copy: (...a: unknown[]) => unknown;\n try {\n // oxlint-disable-next-line typescript/no-implied-eval -- the source is the source of a function of a domain.\n const make = new Function(`\"use strict\"; return (${src});`) as () => (...a: unknown[]) => unknown;\n copy = make();\n } catch {\n throw new NotStandalone(`${what} has no source that a module can copy`);\n }\n const fn = f as (...a: unknown[]) => unknown;\n if (!samples(each).every((xs) => sameCall(() => fn(...xs), () => copy(...xs)))) throw new NotStandalone(`${what} reads a name outside itself, so a module cannot copy it`);\n return src;\n}\n\n/** The functions that an inline form can use. They do not throw for numbers. */\nconst CALLS: ReadonlySet<string> = new Set([\n \"Math.abs\",\n \"Math.ceil\",\n \"Math.floor\",\n \"Math.round\",\n \"Math.trunc\",\n \"Math.sign\",\n \"Math.sqrt\",\n \"Math.cbrt\",\n \"Math.exp\",\n \"Math.log\",\n \"Math.log10\",\n \"Math.log2\",\n \"Math.min\",\n \"Math.max\",\n \"Math.pow\",\n \"Math.hypot\",\n \"Math.sin\",\n \"Math.cos\",\n \"Math.tan\",\n \"Math.atan2\",\n \"Number.isFinite\",\n]);\n\n/** The inline form of a function of an op: its parameters, and its body with a hole for each use of a parameter. */\ninterface InlineForm {\n readonly params: readonly string[];\n /** The parts of the body, and between two parts the index of a parameter. */\n readonly parts: readonly (string | number)[];\n /** The number of uses of each parameter. */\n readonly uses: readonly number[];\n}\n\n/**\n * The tokens of the text between the names of an inline form: digits, spaces, operators and parentheses. The tokenizer\n * takes the first token that matches at each position, as the tokenizer of JavaScript takes the longest operator. So\n * `<<=`, `>>=` and `>>>=` leave a lone `=`, and an assignment stops the inline form (V-058).\n */\nconst TOKEN = /\\d|\\.\\d|\\s|===?|!==?|<<|>>>?|<=|>=|[+\\-*/%<>!?:(),&|^~]/y;\n\n/**\n * This function tells if a text is a sequence of tokens. It takes one token at each step, so its time is linear in the\n * length of the text. A repeated group of the tokens can split `!==` in two ways, and its time is exponential (V-057).\n */\nfunction isTokens(t: string): boolean {\n TOKEN.lastIndex = 0;\n while (TOKEN.lastIndex < t.length) if (!TOKEN.test(t)) return false;\n return true;\n}\n\n/** The source of an arrow function with plain parameters: its parameters and its body. */\nconst ARROW = /^\\(?\\s*((?:[A-Za-z_$][\\w$]*\\s*,\\s*)*[A-Za-z_$][\\w$]*)\\s*\\)?\\s*=>\\s*([\\s\\S]*)/;\n\n/**\n * This function gives the inline form of the source of an arrow function. The body of the function must be an\n * expression of operators, numbers, its parameters and the functions of `CALLS`. Such a body cannot throw for primitive\n * values (§7.1). The inline form is the text of the function itself, so it has its bits.\n */\nfunction inlineForm(src: string): InlineForm | undefined {\n const m = ARROW.exec(src);\n if (m === null) return undefined;\n const params = (m[1] as string).split(\",\").map((x) => x.trim());\n const parts: (string | number)[] = [];\n const uses = params.map(() => 0);\n let text = \"\";\n // The even parts are the text between the names: numbers, operators and parentheses. An assignment, a call of a value\n // and another character, for example a quote, stop the inline form.\n const split = (m[2] as string).split(/([A-Za-z_$][\\w$]*(?:\\.[A-Za-z_$][\\w$]*)?)/);\n for (const [i, t] of split.entries()) {\n if (i % 2 === 0) {\n if (!isTokens(t) || /\\+\\+|--|\\)\\s*\\(/.test(t)) return undefined;\n text += t;\n } else if (CALLS.has(t)) text += t;\n else {\n const p = params.indexOf(t);\n if (p < 0 || /^\\s*\\(/.test(split[i + 1] as string)) return undefined;\n parts.push(text, p);\n text = \"\";\n uses[p] = (uses[p] as number) + 1;\n }\n }\n parts.push(text);\n return { params, parts, uses };\n}\n\n/** This function gives the text of an inline form without spaces, with `#i` for the parameter `at(i)`. */\nconst patternOf = (form: InlineForm, at: (p: number) => number): string => form.parts.map((p) => (typeof p === \"number\" ? `#${at(p)}` : p.replaceAll(/\\s/g, \"\"))).join(\"\");\n\n/** The results of an op that are not values (CALL.RESULT). */\nconst NOT_VALUES: readonly unknown[] = [undefined, null, Number.NaN, Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY];\n\n/** This function gives a text without the content of its parentheses, brackets and braces. */\nfunction outlineOf(t: string): string {\n let depth = 0;\n let out = \"\";\n for (const c of t) {\n if (\")]}\".includes(c)) depth--;\n if (depth === 0) out += c;\n if (\"([{\".includes(c)) depth++;\n }\n return out;\n}\n\n/** This function tells if each operator of a part of an expression is a comparison, so the part gives a boolean. */\nfunction isComparison(part: string): boolean {\n const operators = part.match(/>>>?=?|<<=?|[=!]==?|[<>]=?|[&|^?,=]+/g);\n return operators !== null && operators.every((x) => /^([=!]==?|[<>]=?)$/.test(x));\n}\n\n/** This function tells if an expression gives a boolean or an object. An object needs parentheses in an arrow body. */\nfunction isValueText(t: string, inParentheses: boolean): boolean {\n const outline = outlineOf(t);\n if (outline === \"{}\") return inParentheses;\n if (outline === \"()\") return isValueText(t.slice(1, -1).trim(), true);\n return outline.split(/&&|\\|\\|/).every((part) => isComparison(part) || /^\\s*!+[\\w$.()\\s]*$/.test(part));\n}\n\n/**\n * This function tells if the text of an op proves that its result is a value (COMPILE.MODULE.RESULT). The proofs are a\n * comparison, a negation, an `&&` or an `||` of these, and an object literal. A proof reads only the expression body of\n * an arrow function. A quote, a regular expression and a comment can hide a bracket, so they stop the proof.\n */\nfunction givesValue(src: string): boolean {\n const body = ARROW.exec(src)?.[2];\n return body !== undefined && !/[\"'`/]/.test(body) && isValueText(body.trim(), false);\n}\n\n/** This function tells if a check `valid` refuses a value: it gives false, or it throws. */\nfunction refuses(valid: (x: never) => boolean, value: unknown): boolean {\n try {\n return !valid(value as never);\n } catch {\n return true;\n }\n}\n\n/** The reserved words of the strict code of a module, and the two names that strict code does not bind. */\nconst RESERVED: ReadonlySet<string> = new Set(\n \"await break case catch class const continue debugger default delete do else enum export extends false finally for function if implements import in instanceof interface let new null package private protected public return static super switch this throw true try typeof var void while with yield arguments eval\".split(\" \"),\n);\n\n/** The names that each module exports. A run with such a name is a second export, and the module does not parse. */\nconst MODULE_EXPORTS: ReadonlySet<string> = new Set([\"VEX_ERROR\", \"VexContractError\"]);\n\n/** The comment of the class of a contract error in each module. */\nconst ERROR_NOTE = \"/** The error of a run whose input does not keep the schema of the program. */\";\n\n/** This function gives the reason that a name cannot be the name of the run, or `undefined` for a good name (V-060). */\nfunction nameReason(name: string): string | undefined {\n if (RESERVED.has(name)) return `the name \"${name}\" is a reserved word of JavaScript`;\n return MODULE_EXPORTS.has(name) ? `the name \"${name}\" is a name of the module` : undefined;\n}\n\n/**\n * This function gives the name of the function of the run (COMPILE.MODULE.NAME). A function with a name of the code hides\n * that name from the code. Thus the run of such a module has an internal name that the code does not have.\n */\nfunction innerName(name: string, code: ReadonlySet<string>): string {\n if (!code.has(name)) return name;\n let at = 0;\n while (code.has(`run$${String(at)}`)) at += 1;\n return `run$${String(at)}`;\n}\n\nclass Printer {\n readonly #facts: Facts;\n readonly #domains: readonly AnyDomain[];\n readonly #schema: Schema;\n readonly #memo: ReadonlyMap<Expr, readonly Expr[]>;\n readonly helpers = new Set<Helper>();\n /** The declarations at the top of the module: the functions of the domains and the checks of the results. */\n readonly top = new Map<string, string>();\n /** The names of `top` that hold a copy of a function of a domain (COMPILE.MODULE.FAULT). */\n readonly copies = new Set<string>();\n /** This value is true when the code reads the list of an op of a domain. That read gives the depth (COMPILE.MODULE.LIST.OP). */\n opList = false;\n /** The array of the lists of each field of the input that the program reads (COMPILE.MODULE.LIST.INPUT). */\n readonly inputs = new Map<string, string>();\n /** The statements at the start of a run: the constants of the run and the functions of the memo. */\n readonly run: string[] = [];\n /** The variables of the schema that the program reads. */\n readonly vars = new Map<string, string>();\n /** True when the module has a node of the memo, so it needs the key of -0. */\n memos = false;\n /** The parts of the helper S that the nodes of the memo that keep their items need (helperS). */\n readonly features = new Set<Feature>();\n /** True for a tree space, and the parts of the tree that the program reads (COMPILE.MODULE.TREE). */\n readonly #tree: boolean;\n readonly treeParts = new Set<TreePart>();\n /** True for a graph space, and true when the program reads the predecessors of a graph (COMPILE.MODULE.GRAPH). */\n readonly #graph: boolean;\n readonly #keys: KeyPrint;\n into = false;\n /** True when the code reads the keys of the run (COMPILE.MODULE.KEYS). */\n runKeys = false;\n /** The columns of a sheet, for a module of a sheet (COMPILE.MODULE.SHEET). */\n readonly #sheet: SheetInfo | undefined;\n readonly #starts: EmptyStarts;\n #names = 0;\n /** The number of the next bound function, and of the next printed function. */\n #fnIds = 0;\n #printed = 0;\n /** The level of the names of the next loop. It is far above the levels of the axes, so the two do not meet. */\n #loops = 1_000_000;\n /** The node of the memo whose function the printer prints, so it prints the node itself. */\n #inside: Expr | undefined;\n /** The owner of each append node of the step of a loop that the printer prints (COMPILE.MODULE.APPEND.OWN). */\n readonly #own = new Map<Expr, Owner>();\n /** The owner of each relay `let` of the result of a loop that the printer prints (COMPILE.MODULE.FUSE.ADOPT). */\n readonly #relays = new Map<Expr, Relay & { readonly owner: Owner }>();\n /**\n * The second lists of the appends of an owner that the printer prints (COMPILE.MODULE.FUSE.ADOPT). A list of\n * `fill(1, x)` gets the value of its print and the code of its one item. Such a print does not use `FI`, so a push of\n * the item needs no `FI`.\n */\n readonly #ones = new Map<Expr | undefined, { readonly v: Value; readonly item: string } | undefined>();\n /**\n * The owner of each filter of its list in a branch of another list (COMPILE.MODULE.APPEND.KEEP). The step of the owner\n * that the printer prints has these filters.\n */\n readonly #keeps = new Map<Expr, Owner>();\n /**\n * The outputs of the filters in place that the printer prints (COMPILE.MODULE.APPEND.KEEP). An item goes to the\n * position `n` of its output, and `n` then increases. `pair` is the pair of the item of the list, and `item` is the\n * code of its value. A pair with the key 0 is its own copy.\n */\n readonly #sinks = new Map<string, { readonly n: string; readonly pair: string; readonly item: string | undefined }>();\n readonly #structures = new Map<string, string>();\n readonly #kinds = new Map<string, Kind | undefined>();\n readonly #ops = new Map<string, number>();\n /** The inline form of each function of an op, or undefined for a function that the module calls. */\n readonly #forms = new Map<string, InlineForm | undefined>();\n /** The ops whose text does not prove that the result is a value, so their results get the check of a value. */\n readonly #unproved = new Set<string>();\n /** The functions of ops that the module calls, not in an inline form. */\n readonly #called = new Set<string>();\n /** The key of the expression of each code that is a constant of the run, and the read of each hoisted constant by key. */\n readonly #keyOf = new WeakMap<Code, string>();\n readonly #keyTable = new KeyTable();\n readonly #constants = new Map<string, Code>();\n /** The columns of the run, by the structure of their expression. */\n readonly #columns = new Map<string, string>();\n /** The expressions whose code is the read of a column of the run. */\n readonly #columned = new WeakSet<Expr>();\n /** The kind of each column at the start of a run that holds no list. A column of a call is not in this map. */\n readonly #runColumns = new Map<string, Kind | undefined>();\n /** The function and the kind of each column of a call that holds no list. Only a read in that function reads its pack. */\n readonly #callColumns = new Map<string, { readonly scope: CallScope; readonly kind: Kind | undefined; readonly deps: ReadonlySet<number> }>();\n /** The code of each printed function, by its name. A fast sum looks in it for the columns that a call reads. */\n readonly #specCode = new Map<string, string>();\n /** The module variable of the pack of each column of the run, by the name of the column. */\n readonly #packs = new Map<string, string>();\n /** The state of the second print of a fast sum, or undefined outside it. */\n #pack: Pack | undefined;\n /** The lazy constants of the run, and the printed functions that have a loop: code that reads one waits for its read. */\n readonly #deferred = new Set<string>();\n /** The functions that the printer prints at this time, the innermost last. */\n // Stryker disable next-line ArrayDeclaration: a value that is not a scope has no field repeats or root, so it acts as no scope\n readonly #scopes: CallScope[] = [];\n /** The work of the body of each bound function, by the number of its binding. */\n readonly #fnWork = new Map<number, number>();\n /** The expressions whose code is a constant of the run. Each entry is the original of a copy, so a second place of a shared list has the fact too. */\n readonly #constant = new WeakSet<Expr>();\n /** The expressions at a place that takes a list: a binding, the head of a list op and the list of an axis. */\n readonly #wantList = new WeakSet<Expr>();\n /** The facts of the list of each function of the memo whose value is a list. */\n readonly #lists = new Map<string, ListInfo | undefined>();\n /** True when a test of the analysis reads the facts of fusion (`listFactsOf`), and the facts of each list node. */\n readonly #noting: boolean;\n readonly #noted = new Map<Expr, Omit<ListFacts, \"reads\">>();\n /** The count of the reads of the value of each node, from the form of the program (`readCounts`). */\n readonly #reads: ReadonlyMap<Expr, number>;\n /** The nodes whose value the code reads again: a constant of the run, a column and a node of the memo. */\n readonly #shared = new Set<Expr>();\n /** The node of each code that `expr` gives, while the printer notes the facts of fusion. */\n readonly #nodeOf = new WeakMap<Code, Expr>();\n /** True when the printer prints the forms of fusion (COMPILE.MODULE.FUSE.OFF). `runOf` checks the option first. */\n readonly #fuse: boolean;\n /**\n * The code of each fused loop, with the index of the statement that declares its output (COMPILE.MODULE.FUSE). A chain\n * that reads the loop changes that statement, and then the loop pushes into the output of the chain.\n */\n readonly #outputs = new WeakMap<Code, number>();\n\n constructor(expr: Expr, options: ModuleOptions, keys: KeyPrint, starts: EmptyStarts, sheet?: SheetInfo) {\n this.#keys = keys;\n this.#fuse = options.fuse !== false;\n this.#starts = starts;\n this.#domains = (options.domains ?? []).map(formOf);\n this.#facts = factsOf({ domains: this.#domains });\n this.#schema = options.schema;\n this.#memo = memoOf(expr);\n this.#tree = options.space === \"tree\";\n this.#graph = options.space === \"graph\";\n this.#sheet = sheet;\n this.#noting = recorder !== undefined;\n this.#reads = this.#noting ? readCounts(expr) : new Map();\n recorder?.push(this);\n }\n\n /** This method gives the facts of fusion of each list node that the printer printed (COMPILE.MODULE.FUSE.FACTS). */\n listFacts(): ReadonlyMap<Expr, ListFacts> {\n const out = new Map<Expr, ListFacts>();\n // A part that the code reads again holds the array of the node, so the node is not fresh. Each node of a list is a\n // node of the program, but a node without a count gets the safe count. The copies of a shared object give one fact.\n for (const [e, f] of this.#noted) {\n const fact = this.#shared.has(e) ? { ...f, fresh: false, reads: Infinity } : { ...f, reads: this.#reads.get(e) ?? Infinity };\n const old = out.get(originalOf(e));\n out.set(originalOf(e), old === undefined ? fact : bothPlaces(old, fact));\n }\n return out;\n }\n\n /** This method notes the facts of fusion of the list of a node. A node that prints at two places gets the facts of both. */\n #note(e: Expr, c: Code, memo: boolean): void {\n const list = c.v.list;\n if (!this.#noting || list === undefined) return;\n this.#nodeOf.set(c, e);\n if (memo) this.#shared.add(e);\n const inner: boolean[] = [];\n for (let l = list.inner; l !== undefined; l = l.inner) inner.push(l.clean === true);\n const old = this.#noted.get(e);\n const clean = list.clean === true && (old?.clean ?? true);\n const fresh = list.fresh === true && (old?.fresh ?? true);\n this.#noted.set(e, { clean, inner: old === undefined ? inner : inner.map((x, i) => x && old.inner[i] === true), fresh });\n }\n\n use(name: Helper): string {\n if (KEY_READS.has(name)) this.#keys.read = true;\n this.helpers.add(name);\n return name;\n }\n\n /**\n * This method tells if the printer prints the clean form of a list (COMPILE.MODULE.FUSE.CLEAN). The option `fuse` must\n * be true, and the facts must prove the list clean. With `levels`, each level of a list of lists must be clean too.\n */\n #clean(l: ListInfo | undefined, levels = false): boolean {\n if (!this.#fuse) return false;\n for (let x = l; x !== undefined; x = levels ? x.inner : undefined) if (x.clean !== true) return false;\n return l !== undefined;\n }\n\n /**\n * This method gives the code of a list in the form of the helper `form`: a `vex.list`, or a plain array for `LP`\n * (COMPILE.MODULE.LIST.PLAIN). A list that the facts prove clean uses the clean form of the helper (COMPILE.MODULE.FUSE.CLEAN).\n */\n envelope(v: Value, form: keyof typeof CLEAN_FORMS): string {\n const list = v.list as ListInfo;\n const helper = this.#clean(list, true) ? CLEAN_FORMS[form] : form;\n return `${this.use(helper)}(${v.code}, ${String(depthOf(list))})`;\n }\n\n /**\n * This method gives the code of a list that is the value of the run at a key. With `fuse`, a `vex.list` that reads no\n * key evaluates once, on its first read, so each key gets one object (COMPILE.MODULE.FUSE.OUT). The keys share that\n * object, so only that object is frozen. A plain array stays one array for each key, because a host can change an array.\n */\n runList(v: Value, plain: boolean): string {\n if (plain || !this.#fuse || v.deps.size > 0) return this.envelope(v, plain ? \"LP\" : \"LO\");\n return this.#hoist(bare({ ...v, code: this.envelope(v, \"LS\"), plain: false }), true).v.code;\n }\n\n /** This method gives the name of a part of the tree, for example `H` for the children, and marks the part as read. */\n #part(part: TreePart, name: string): string {\n this.treeParts.add(part);\n return name;\n }\n\n /**\n * This method gives the check of a result of a kind, or undefined for a result that needs no check. A number must be\n * finite, and the domain of the kind can check the value with valid. The law checker of the test kit checks the\n * declaration `returns` of each op (KIND.RETURNS), so the module trusts the kind of each value. A result that is not a\n * value does not break the declaration, and `#value` gives its check (COMPILE.MODULE.RESULT).\n */\n check(kind: Kind): string | undefined {\n const d = this.#facts.checkOf(kind);\n // The kind is primitive here. A static site on a value of a domain has no domain without a primitive type before it.\n if (d === undefined) throw new NotStandalone(`a domain without a primitive type comes before the domain of a ${kind}`);\n // The name of a domain can have each character. For a name that is not a JavaScript name, the check has the index\n // of its domain in its name (V-061).\n const plain = `k_${kind.replace(\":\", \"_\")}`;\n const name = /^[\\w$]+$/.test(plain) ? plain : `k_d${String(d)}`;\n // Stryker disable next-line ConditionalExpression: a check of a kind is always the same, so the map only saves time\n if (!this.top.has(name)) {\n const domain = this.#domains[d];\n const valid = domain?.valid === undefined ? undefined : this.#valid(d, domain.name, kind, domain.valid);\n const conds = [...(kind === \"number\" ? [\"Number.isFinite(x)\"] : []), ...(valid === undefined ? [] : [`${valid}(x)`])];\n if (conds.length === 0) return undefined;\n this.top.set(name, `const ${name} = (x) => (${conds.join(\" && \")} ? x : ${this.use(\"F\")}());`);\n }\n return name;\n }\n\n /** This method gives the code of a result with its check, if it needs one. */\n #checked(kind: Kind, code: string): string {\n const k = this.check(kind);\n return k === undefined ? code : `${k}(${code})`;\n }\n\n /**\n * This method tells if the check of a kind can miss a result that is not a value. The check of a number finds each\n * such result, and a check `valid` finds them when it refuses each one.\n */\n #missesNoValue(kind: Kind): boolean {\n if (kind === \"number\") return false;\n const valid = this.#domains[this.#facts.checkOf(kind) as number]?.valid;\n return valid === undefined || !NOT_VALUES.every((x) => refuses(valid, x));\n }\n\n /**\n * This method gives the code of the result of the op `name` with the check of a value, if the op needs it. The\n * interpreter gives an error for `undefined`, `null` and a number that is not finite (CALL.RESULT).\n */\n #value(name: string, code: string): string {\n if (!this.#unproved.has(name)) return code;\n this.top.set(\"k_value\", `const k_value = (x) => (x === undefined || x === null || (typeof x === \"number\" && !Number.isFinite(x)) ? ${this.use(\"F\")}() : x);`);\n return `k_value(${code})`;\n }\n\n #valid(d: number, domain: string, kind: Kind, valid: (x: never) => boolean): string | undefined {\n const name = `v_${d}`;\n const src = copied(valid, [this.#samples(kind)], `the check \"valid\" of the domain ${domain}`);\n // A check that is Number.isFinite of a number adds nothing to the check of the result.\n const form = inlineForm(src);\n if (kind === \"number\" && form !== undefined && patternOf(form, (p) => p) === \"Number.isFinite(#0)\") return undefined;\n this.#copy(name, src);\n return name;\n }\n\n /** This method keeps the copy of a function of a domain as a declaration of the module. */\n #copy(name: string, src: string): void {\n this.top.set(name, `const ${name} = ${src};`);\n this.copies.add(name);\n }\n\n /** This method gives the samples of a kind: the samples of a primitive type, or the samples of a domain (KIND.DOMAIN). */\n #samples(kind: Kind): readonly unknown[] {\n const primitive = primitiveOf(kind);\n if (primitive !== undefined) return SAMPLES[primitive];\n const d = this.#domains.find((x) => kindOfDomain(x) === kind) as AnyDomain;\n if (d.samples === undefined) throw new NotStandalone(`the domain ${d.name} gives no samples, so a module cannot check a copy of its op`);\n return d.samples();\n }\n\n /**\n * This method gives the code of a check of the kind of an input. The check is a test of its JavaScript type, or the\n * copy of `is` of a domain. The code is true for an input against the kind.\n */\n against(kind: Kind, input: string): string {\n const primitive = primitiveOf(kind);\n return primitive === undefined ? `!${this.#isOf(kind)}(${input})` : `typeof ${input} !== \"${primitive}\"`;\n }\n\n /**\n * This method gives the name of a test of the kind of an item of a list of the input (COMPILE.MODULE.LIST.INPUT). The\n * test of a primitive type checks the JavaScript type, and the test of a domain is the copy of its `is`.\n */\n test(kind: Kind): string {\n const primitive = primitiveOf(kind);\n if (primitive === undefined) return this.#isOf(kind);\n const name = `is_${primitive}`;\n this.top.set(name, `const ${name} = (x) => typeof x === \"${primitive}\";`);\n return name;\n }\n\n /** This method gives the name of the copy of the test `is` of the domain of a kind. */\n #isOf(kind: Kind): string {\n const d = this.#domains.findIndex((x) => kindOfDomain(x) === kind);\n const domain = this.#domains[d];\n if (domain === undefined) throw new NotStandalone(`the schema has the kind ${kind}, and no domain has it`);\n const name = `is_${String(d)}`;\n if (!this.top.has(name)) {\n const src = copied(domain.is, [[...SAMPLES.number, ...SAMPLES.string, ...SAMPLES.boolean, null, {}, [], ...this.#samples(kind)]], `the test \"is\" of the domain ${domain.name}`);\n this.#copy(name, src);\n }\n return name;\n }\n\n /** This method gives a new name for the code. */\n fresh(prefix: string): string {\n const name = `${prefix}${this.#names++}`;\n if (prefix === \"b\") this.#pack?.locals.add(name);\n return name;\n }\n\n /** This method tells if code reads a lazy constant of the run, or calls a printed function that has a loop. */\n #defers(c: Code): boolean {\n return [c.v.code, ...c.s].some((line) => [...line.matchAll(/\\b(c\\d+|fn\\d+)\\(/g)].some((m) => this.#deferred.has(m[1] as string)));\n }\n\n /** This method gives the code of a name: a read that throws the error of its value, if it can hold an error. */\n #read(name: Name): Value {\n // A name holds its list, so a read of the name is not fresh.\n const base = { kind: name.kind, deps: name.deps, plain: true, list: heldList(name.list) };\n return name.lazy ? { ...base, code: `${this.use(\"G\")}(${name.code})`, safe: false, held: name.code } : { ...base, code: name.code, safe: true };\n }\n\n /** This method gives the name of a constant of the run, from the read of its value. */\n #nameOf(v: Value): Name {\n return { code: v.held ?? v.code, kind: v.kind, lazy: v.held !== undefined, deps: NO_DEPS, list: v.list };\n }\n\n /**\n * This method gives the statements that put the value of a code, or the error sentinel, into a new variable `name`.\n * A constant of the run without statements uses the helper `T`: it evaluates once, so its closure costs little.\n */\n #store(name: string, c: Code, run = false): string[] {\n if (c.v.safe) return [...c.s, `const ${name} = ${c.v.code};`];\n if (c.s.length === 0 && c.v.held !== undefined) return [`const ${name} = ${c.v.held};`];\n if (run && c.s.length === 0) return [`const ${name} = ${this.use(\"T\")}(() => ${c.v.code});`];\n return [`let ${name};`, \"try {\", ...ind(c.s), ` ${name} = ${c.v.code};`, \"} catch {\", ` ${name} = E;`, \"}\"];\n }\n\n /**\n * This method evaluates a constant of the run once, before the loop over the keys, and gives the read of its value. A\n * constant with a loop (`lazy`) evaluates on its first read instead, as a branch of the interpreter does. So does a\n * constant that reads a lazy constant or calls a function with a loop. Else it starts that loop before the run.\n */\n #hoist(c: Code, lazy = false): Code {\n if (c.v.deps.size > 0 || (c.v.plain === true && c.s.length === 0)) return c;\n // The loop over the keys reads each constant of the run again.\n const node = this.#nodeOf.get(c);\n if (node !== undefined) this.#shared.add(node);\n const key = this.#keyOf.get(c);\n const hit = key === undefined ? undefined : this.#constants.get(key);\n if (hit !== undefined) return hit;\n // A pack is a local of the loop of a second print, so a constant of the run cannot read it (V-077).\n this.#leavePack([c.v.code, ...c.s]);\n const name = this.fresh(\"c\");\n const deferred = lazy || this.#defers(c);\n if (deferred) {\n this.#deferred.add(name);\n this.run.push(`const ${name} = ${this.use(\"L\")}(() => {`, ...ind(c.s), ` return ${c.v.code};`, \"});\");\n } else this.run.push(...this.#store(name, c, true));\n const { list } = c.v;\n const read = bare(this.#read(deferred ? { code: `${name}()`, kind: c.v.kind, lazy: true, deps: NO_DEPS, list } : { code: name, kind: c.v.kind, lazy: !c.v.safe, deps: NO_DEPS, list }));\n if (key !== undefined) this.#constants.set(key, read);\n return read;\n }\n\n /**\n * This method gives the parts of a node with levels `deps`. When the node is not a constant of the run, each part that\n * is a constant evaluates once, before the loop. A node that is a constant keeps its parts, and its parent decides.\n */\n #settle(parts: readonly Code[], deps: ReadonlySet<number>, exprs: readonly Expr[] = []): readonly Code[] {\n return deps.size === 0 ? parts : parts.map((x, i) => this.#hoist(x, exprs[i] !== undefined && hasLoop(exprs[i])));\n }\n\n expr(e: Expr, ctx: Ctx): Code {\n if (!this.#starts.seek) return this.#exprCode(e, ctx);\n // A part of a step can read the items of its own name, so a search cannot print it yet. The rest of the step can\n // decide the kind, and the last print proves it (COMPILE.MODULE.LOOP.EMPTY). The search keeps no text, and the last\n // print gives each error again.\n try {\n return this.#exprCode(e, ctx);\n } catch {\n return bare({ code: \"E\", kind: undefined, safe: true, deps: NO_DEPS, list: { item: undefined, empty: true } });\n }\n }\n\n #exprCode(e: Expr, ctx: Ctx): Code {\n const key = ctx.keys.get(e);\n if (key !== undefined) return bare(this.#read(key));\n const keys = this.#memo.get(e);\n // In the second print of a fast sum, a column of the run at the item is the read of its pack, with no print of its parts.\n const packed = this.#packAt(ctx) && this.#columned.has(e) ? this.#packRead(this.#columns.get(this.#constKey(e, ctx)), ctx) : undefined;\n if (packed !== undefined) return packed;\n const c = keys !== undefined && this.#inside !== e ? this.#unpacked(() => this.#memoized(e, keys, ctx)) : this.#node(e, ctx);\n if (c.v.deps.size === 0) {\n // A constant of the run with the structure of an earlier one is that constant.\n this.#keyOf.set(c, this.#constKey(e, ctx));\n this.#constant.add(originalOf(e));\n }\n // A list is a value only at a place that takes a list: a result, a binding, an argument, a field and the body of a\n // function take one. A condition, an argument of and or of or, and a key of get take no list.\n if (c.v.list !== undefined && !this.#wantList.has(e)) throw new NotStandalone(\"a list is a value of the program\");\n const out = this.#columnar(e, c, ctx) ? this.#column(e, c, ctx) : c;\n this.#note(e, out, keys !== undefined);\n return out;\n }\n\n /** This method gives the code of a list at a place that takes a list (LIST.VALUE): an each, a name, sortBy or take. */\n #listOf(e: Expr, ctx: Ctx): Code {\n this.#wantList.add(e);\n const c = this.expr(e, ctx);\n if (c.v.list === undefined) throw new NotStandalone(\"a list op on a value that is not a list\");\n return c;\n }\n\n /** This method tells if an expression gives a list at a place that takes one (`listy`). */\n #isList(e: Expr, ctx: Ctx): boolean {\n return listy(e, this.#scopeOf(ctx));\n }\n\n /**\n * This method tells if the body of an each can give a list. The facts of the names `as` of its items come from its\n * list, which the printer prints only in the loop. So here each such name can hold a list. Then a list op goes over the\n * array of the each, and that array gives the value of the interpreter too (COMPILE.MODULE.LIST.ITEM).\n */\n #bodyList(e: ExprOf<\"each\">, ctx: Ctx): boolean {\n const scope = this.#scopeOf(ctx);\n if (e.as === undefined) return listy(e.body, scope);\n const names: readonly string[] = e.as;\n return listy(e.body, { ...scope, name: (name, levels) => names.includes(name) || scope.name(name, levels) });\n }\n\n /** This method gives the scope of `listy` at a node: the keys of its node of the memo, its names and its bound functions. */\n #scopeOf(ctx: Ctx): ListScope {\n return {\n // A key of a node of the memo is a name of its function, and the name keeps the facts of a list.\n key: (e) => ctx.keys.get(e),\n op: (name) => this.#facts.givesList(name),\n name: (name, levels) => {\n const bound = ctx.env.get(name);\n if (bound !== undefined) return hasLevels(bound.list, levels);\n const kind = this.#schema.vars?.[name];\n return typeof kind === \"object\" && hasLevels(listOfKind(kind), levels);\n },\n fn: (name) => {\n const bound = ctx.fns.get(name);\n return bound === undefined ? undefined : { fn: bound.fn, scope: this.#scopeOf(bound.ctx) };\n },\n cell: (x, levels) => hasLevels(this.#cellList(x), levels),\n field: (x, levels) => {\n const kind = this.#schema.fields?.[x.path.join(\".\")];\n return typeof kind === \"object\" && hasLevels(listOfKind(kind), levels);\n },\n };\n }\n\n /** This method gives the facts of the list of a read of a cell. A read of a column that holds no list gives undefined. */\n #cellList(e: ExprOf<\"ext\">): ListInfo | undefined {\n return e.kind === CELL_KIND && isCellRef(e.data) ? this.#sheet?.lists.get(e.data.column) : undefined;\n }\n\n /**\n * This method gives the code of a literal. A value of a domain with a module form is an object of plain data, with the\n * kind of its domain (COMPILE.MODULE.FORM). Such a value is a constant of the run, so it gets a variable.\n */\n #literal(value: unknown): Value {\n for (const d of this.#domains) {\n const data = d.moduleForm?.literal?.(value);\n if (data !== undefined) return { code: `({ ${Object.entries(data).map(([k, x]) => `${k}: ${literal(x).code}`).join(\", \")} })`, kind: kindOfDomain(d), safe: true, deps: NO_DEPS };\n }\n return literal(value);\n }\n\n /** This method prints a list literal (LIST.LITERAL) as an array of pairs of a key and a value. An error item holds the sentinel. */\n #listLiteral(l: VexList): Code {\n const values = l.items.map((it) => (it.result.ok ? this.#literal(it.result.value) : undefined));\n const kinds = values.flatMap((x) => (x === undefined ? [] : [x.kind]));\n const code = `[${l.items.map((it, i) => `[${JSON.stringify(it.key)}, ${values[i]?.code ?? \"E\"}]`).join(\", \")}]`;\n const has = l.items.length > 0;\n // An error item of the literal holds the sentinel, so only a literal without error items is clean.\n const clean = values.every((x) => x !== undefined);\n return bare({ code, kind: undefined, safe: true, deps: NO_DEPS, list: { item: kinds.reduce(join, kinds[0]), texts: has, empty: !has, clean } });\n }\n\n /**\n * This method tells if a part of a loop over the targets is a column of the run. Its value depends only on the\n * target and on the constants of the run, so each run computes it once for each record. Each name that it reads\n * from outside is a constant of the run, so its code can be outside the loop.\n */\n #columnar(e: Expr, c: Code, ctx: Ctx): boolean {\n // A node of the memo has the level 1, so a column has a focus. The results of the cells change in a run, so a part\n // that reads a cell is not a column. The rows of a column change in each round, so a part that reads one is not either.\n if (ctx.level < 2 || c.v.deps.has(CELLS) || c.v.deps.has(ROUNDS) || !c.v.deps.has(ctx.level) || this.#work(e, ctx.fns) < COLUMN_WORK) return false;\n const scope = this.#callScope(c, ctx);\n if (c.v.deps.size !== 1 && scope === undefined) return false;\n // A node of the memo with keys keeps its costly part for each value of its keys already.\n if (this.#keyed(e)) return false;\n const visible = (name: string): boolean => {\n const bound = ctx.env.get(name);\n return (bound?.deps.size ?? 0) === 0 || (scope?.names.has((bound as Name).code) ?? false);\n };\n return [...namesOf(e)].every(visible) && !this.#callsLocal(e, ctx);\n }\n\n /**\n * This method gives the function whose call can hold a column of a part. The part is in a loop of the function, and it\n * reads a parameter. The body of the function has a loop in a loop, so a call can read the part more than once. Each\n * name that the part reads is a parameter, a binding at the root of the body or a constant (`#columnar`). So the\n * part depends only on its target and on values that one call does not change. These are the parameters, the focus\n * and the origin. The levels in a node of the memo start at 1, far below the focus of a function. So a node of the\n * memo holds no column of a call.\n */\n #callScope(c: Code, ctx: Ctx): CallScope | undefined {\n const scope = this.#scopes.at(-1);\n // A part that reads a parameter reads a variable of this function, so its structure gives no column of another function.\n return scope !== undefined && scope.repeats && ctx.level > scope.focus && c.v.deps.has(scope.param) ? scope : undefined;\n }\n\n /** This method tells if an expression calls a function that is at the place of its binding, not at the start of a run. */\n #callsLocal(e: Expr, ctx: Ctx): boolean {\n // Stryker disable next-line ConditionalExpression: a node that is not a call has no field fn, so the map gives undefined\n if (e.tag === \"call\" && ctx.fns.get(e.fn)?.local === true) return true;\n return children(e).some((x) => this.#callsLocal(x, ctx));\n }\n\n /** This method tells if an expression has a node of the memo with keys in it. */\n #keyed(e: Expr): boolean {\n return (this.#memo.get(e)?.length ?? 0) > 0 || children(e).some((x) => this.#keyed(x));\n }\n\n /**\n * This method gives the work of an expression: a node of the memo and a constant of the run are one read each. A call\n * adds the work of the body of its function, because the body evaluates at each call.\n */\n #work(e: Expr, fns: ReadonlyMap<string, BoundFn>): number {\n if (this.#memo.has(e) || this.#constant.has(originalOf(e))) return 1;\n // Stryker disable next-line ConditionalExpression: a node that is not a call has no field fn, so the map gives undefined\n const body = e.tag === \"call\" ? this.#bodyWork(fns.get(e.fn)) : 0;\n return children(e).reduce((sum, x) => sum + this.#work(x, fns), 1 + body);\n }\n\n /**\n * This method gives the work of the body of a function, once for each function. Thus a chain of calls costs no more\n * than its functions. A body that is a column of the run is one read. A body sees the functions of the place of its\n * binding, and no function calls itself (FN.TOTAL).\n */\n #bodyWork(bound: BoundFn | undefined): number {\n if (bound === undefined) return 0;\n let work = this.#fnWork.get(bound.id);\n if (work === undefined) {\n work = this.#columned.has(bound.fn.body) ? 1 : this.#work(bound.fn.body, bound.ctx.fns);\n this.#fnWork.set(bound.id, work);\n }\n return work;\n }\n\n /**\n * This method stops the second print when some lines for the run read a local of its loop (V-077, V-094). That\n * local is a pack, or a value local that the lines do not declare. Else the declared locals go to the run too.\n */\n #leavePack(lines: readonly string[]): void {\n const pack = this.#pack;\n if (pack === undefined) return;\n const text = lines.join(\"\\n\");\n if ([...pack.cols.values()].some((local) => text.includes(`${local}[`))) throw new NoPack();\n // Stryker disable next-line ConditionalExpression: with no locals the scan below finds no read, so this return only saves the scan\n if (pack.locals.size === 0) return;\n const declared = new Set([...text.matchAll(/\\b(?:const|let) (b\\d+)\\b/gu)].map((m) => m[1]));\n // A call at its place keeps an argument in a local, and a read of that argument has no levels (V-094).\n if ([...text.matchAll(/\\bb\\d+\\b/gu)].some(([name]) => pack.locals.has(name) && !declared.has(name))) throw new NoPack();\n for (const name of declared) pack.locals.delete(name as string);\n }\n\n /**\n * This method adds some lines to the run. A pack is a local of the loop of a second print, so a line of the run\n * cannot read it (V-077, V-084). Then the second print stops, and the loop keeps its first print.\n */\n #intoRun(lines: readonly string[]): void {\n this.#leavePack(lines);\n this.run.push(...lines);\n }\n\n /** This method tells if a second print (`#packed`, `#packedSteps`) reads the packs of the columns at the focus of `ctx`. */\n #packAt(ctx: Ctx): boolean {\n return this.#pack !== undefined && ctx.focus !== undefined && this.#pack.foci.has(ctx.focus);\n }\n\n /**\n * This method gives the read of the pack of a column in a second print (`#packed`, `#packedSteps`), or undefined. The\n * column must be a column of the run, or a column of the function that the printer prints. The read must be at a\n * focus of the print. The read holds the value of the column or the sentinel, as a read of the column does.\n */\n #packRead(name: string | undefined, ctx: Ctx): Code | undefined {\n const pack = this.#pack;\n if (pack === undefined || name === undefined || !this.#packAt(ctx)) return undefined;\n const own = this.#callColumns.get(name);\n if (!this.#runColumns.has(name) && (!pack.calls || own?.scope !== this.#scopes.at(-1))) return undefined;\n let local = pack.cols.get(name);\n if (local === undefined) {\n local = this.fresh(\"pk\");\n pack.cols.set(name, local);\n }\n const held = `${local}[${ctx.focus as string}]`;\n // A column of a call can read a parameter, the focus and the origin of the function, so its read keeps these markers (V-081).\n const deps = new Set([ctx.level, ...(own?.deps ?? [])]);\n return bare({ code: `${this.use(\"G\")}(${held})`, kind: own === undefined ? this.#runColumns.get(name) : own.kind, safe: false, held, deps });\n }\n\n /** This method gives the read of a column of the run. Two parts with the same structure share one column. */\n #column(e: Expr, c: Code, ctx: Ctx): Code {\n const key = this.#constKey(e, ctx);\n let name = this.#columns.get(key);\n if (name === undefined) {\n // The first print of a fast sum makes each column of its term, so the second print makes none (`#packed`).\n if (this.#pack !== undefined) throw new NoPack();\n name = this.fresh(\"col\");\n // A column of a call is at the start of the body of its function, so each call has its own.\n const scope = this.#callScope(c, ctx);\n (scope?.decls ?? this.run).push(`const ${name} = ${this.use(\"Q\")}((${ctx.focus as string}) => {`, ...ind(c.s), ` return ${c.v.code};`, \"});\");\n if (c.v.list === undefined) {\n if (scope === undefined) this.#runColumns.set(name, c.v.kind);\n else this.#callColumns.set(name, { scope, kind: c.v.kind, deps: new Set([...c.v.deps].filter((d) => d !== ctx.level)) });\n }\n this.#columns.set(key, name);\n }\n this.#columned.add(e);\n // Each key of the column reads the array of the column again.\n this.#shared.add(e);\n return this.#packRead(name, ctx) ?? bare({ code: `${this.use(\"G\")}(${name}(${ctx.focus as string}))`, kind: c.v.kind, safe: false, deps: c.v.deps, list: heldList(c.v.list) });\n }\n\n #node(e: Expr, ctx: Ctx): Code {\n switch (e.tag) {\n case \"lit\":\n return isVexList(e.value) ? this.#listLiteral(e.value) : bare(this.#literal(e.value));\n case \"ref\":\n return this.#ref(e, ctx);\n case \"var\":\n return bare(this.#var(e.name, ctx));\n case \"let\":\n return this.#let(e, ctx);\n // A function is only a binding of let, so the check of the shape stops this node first.\n // Stryker disable next-line all: see the comment above\n /* v8 ignore next -- @preserve */\n case \"fn\": throw new NotStandalone(\"a function outside the bindings of a let\");\n case \"call\":\n return this.#call(e, ctx);\n case \"rec\": {\n const names = Object.keys(e.fields);\n const exprs = Object.values(e.fields);\n // A field can hold a list (COMPILE.MODULE.LIST.FIELD).\n for (const x of exprs) this.#wantList.add(x);\n const raw = exprs.map((x) => this.expr(x, ctx));\n const deps = depsOf(...raw);\n // The interpreter evaluates each field, also after an error.\n const fields = this.#inOrder(this.#settle(raw, deps, exprs), true);\n // A record of a module is a new object, so it needs no freeze.\n const code = `({ ${fields.map((x, i) => `${names[i] === \"__proto__\" ? '[\"__proto__\"]' : JSON.stringify(names[i])}: ${this.#plain(x.v)}`).join(\", \")} })`;\n return { s: stmtsOf(...fields), v: { code, kind: undefined, safe: fields.every((x) => x.v.safe), deps } };\n }\n case \"app\":\n return this.#app(e, ctx);\n case \"each\":\n return this.#eachList(e, ctx);\n case \"fold\":\n return this.#fold(e, ctx);\n case \"iterate\":\n return this.#iterate(e, ctx);\n case \"fix\":\n return this.#fix(e, ctx);\n case \"last\": {\n // The check of the program comes before the printer, so each read has its column (FIX.MONOTONE).\n const { code, kind } = ctx.columns.get(e.name) as FixColumn;\n return bare({ code: `${code}[${ctx.focus as string}]`, kind, safe: true, deps: new Set([ctx.level, ROUNDS]) });\n }\n case \"ext\":\n return this.#cell(e, ctx);\n }\n }\n\n /**\n * This method gives the code of a read of a cell in a module of a sheet (COMPILE.MODULE.SHEET). The value is the result\n * of the cell, which can be the error sentinel, so the read throws its error. A read that is not a cell reference, or\n * of a column that the sheet does not have, gives an error, as in `SheetRun`.\n */\n #cell(e: ExprOf<\"ext\">, ctx: Ctx): Code {\n const sheet = this.#sheet;\n if (sheet === undefined || e.kind !== CELL_KIND) throw new NotStandalone(`the extension \"${e.kind}\"`);\n const F = this.use(\"F\");\n if (!isCellRef(e.data)) return bare({ code: `${F}()`, kind: undefined, safe: false, deps: new Set([CELLS]) });\n const { column, at } = e.data;\n const deps = new Set([...this.#addressDeps(at, ctx, []), CELLS]);\n const index = sheet.columns.get(column);\n // The read of a column that the sheet does not have is an error. A kind of the options lets an op take it.\n const list = sheet.lists.get(column);\n if (index === undefined) return bare({ code: `${F}()`, kind: sheet.kinds.get(column), safe: false, deps, list });\n if (!sheet.kinds.has(column)) throw new NotStandalone(`a formula reads the column \"${column}\" before its formula, so the column needs its kind in the option kinds`);\n // A direct fill reads the array of the column. The search reads the cell with the function of its state.\n const address = this.#address(at, ctx, []);\n const read = sheet.direct ? `D[${String(index)}][${address}]` : `${READ_CELL}(${String(index)}, ${address})`;\n const v = { code: `${this.use(\"G\")}(${read})`, kind: sheet.kinds.get(column), safe: false, deps, list };\n // The read itself gives the result or the error sentinel. A move of the address can throw, so then the read is not\n // a value that holds the sentinel.\n return bare(at.every((m) => m.t === \"origin\") ? { ...v, held: read } : v);\n }\n\n /**\n * This method gives the parts of a node in the order of the interpreter, when a part reads a cell (COMPILE.MODULE.SHEET).\n * A read of a cell can start the search of the run, and the search decides the cycles. So the module must read each\n * cell that the interpreter reads. With `all`, the interpreter evaluates each part also after an error, so each part\n * goes into a variable that can hold the error. Else the first error stops the parts, so each part goes into a\n * variable before the next part starts.\n *\n * The statements of the parts come before the code of their values. The last part that reads a cell keeps its place\n * only if no statement after it can throw. Also, with `all`, a value before it must not throw, or the code of its value\n * must read no cell. With `held`, code before the parts can throw, so the last part also goes into a variable.\n */\n #inOrder(parts: readonly Code[], all: boolean, held = false): readonly Code[] {\n // A read of a finished cell starts no search, so the order of the reads does not change a result.\n if (this.#sheet?.direct === true) return parts;\n const last = parts.findLastIndex((x) => x.v.deps.has(CELLS));\n const after = parts.slice(last + 1).every((x) => x.s.length === 0 || x.v.safe);\n const before = !all || parts.slice(0, Math.max(last, 0)).every((x) => x.v.safe) || !READS_IN_CODE.test((parts[last] as Code).v.code);\n return parts.map((x, i) => {\n // A part after the last read of a cell cannot stop a read. A part that cannot throw and reads no cell cannot either.\n if (i > last || (x.v.safe && !x.v.deps.has(CELLS)) || (i === last && after && before && !held)) return x;\n const b = this.fresh(\"b\");\n if (all && !x.v.safe) return { s: this.#store(b, x), v: { ...x.v, code: `${this.use(\"G\")}(${b})`, held: b, plain: false } };\n return { s: [...x.s, `const ${b} = ${x.v.code};`], v: { kind: x.v.kind, deps: x.v.deps, list: x.v.list, code: b, safe: true, plain: true } };\n });\n }\n\n /**\n * This method gives the parts of the expressions of an address. The interpreter evaluates each expression before the\n * first move, but the code of an address has each expression after the moves before it. A move can fail, so it must\n * not stop a read of a cell in a later expression (COMPILE.MODULE.SHEET).\n */\n #addressParts(at: readonly Move[], values: readonly Code[], deps: ReadonlySet<number>): readonly Code[] {\n return this.#inOrder(this.#settle(values, deps), false, at.findLastIndex((m) => moveExpr(m) !== undefined) > 0);\n }\n\n /**\n * This method gives the code of the index of an address from the focus. `values` has the code of the value of each\n * computed move, in order (NAV.COMPUTED).\n */\n #address(at: readonly Move[], ctx: Ctx, values: readonly Code[]): string {\n let index = ctx.focus;\n let next = 0;\n // A move that can fail keeps its check when a later fixed key, index or origin replaces its index (V-052). The focus\n // and the origin cannot fail, and the code of a move from an index has the code of that index in it. In a tree,\n // the move parent is a move from an index.\n let fails = false;\n const checks: string[] = [];\n for (const m of at) {\n if (fails && index !== undefined && m.t !== \"offset\" && m.t !== \"other\" && (m.t !== \"parent\" || !this.#tree)) checks.push(index);\n index = moveExpr(m) === undefined ? this.#move(m, index, ctx.origin) : this.#computed(m, values[next++] as Code);\n fails = m.t !== \"origin\";\n }\n // A node of the memo reads neither its origin nor its focus (memo.ts), so the guards of this method do not fail.\n // Stryker disable next-line ConditionalExpression,StringLiteral: see the comment above\n /* v8 ignore next -- @preserve */\n if (index === undefined) throw new NotStandalone(\"a node of the memo reads its focus\");\n return checks.length === 0 ? index : `(${[...checks, index].join(\", \")})`;\n }\n\n /** This method gives the code of the index of a computed move, from the code of its value. */\n #computed(m: Move, value: Code): string {\n return (m.t === \"key\" ? this.#keyMove(value.v.code) : undefined) ?? `${this.use(m.t === \"key\" ? \"K\" : \"I\")}(${value.v.code}, n)`;\n }\n\n /** This method gives the code of the position of a key of a move in a keyed print, and undefined in each other print. */\n #keyMove(key: string): string | undefined {\n this.#keys.read = true;\n if (!this.#keys.keyed) return undefined;\n this.runKeys = true;\n return `${this.use(\"KP\")}(KM, ${key})`;\n }\n\n /** This method gives a reason for an offset of an array space with keys. The keys of a record space have no order (NAV.OFFSET). */\n #noOffset(): void {\n if (this.#keys.keyed) throw new NotStandalone('an offset or the axis \"window\" in an array space with the option \"keys\"');\n }\n\n /**\n * This method gives the key of the pair of an item at the target `j`. A keyed print puts the key of the record in the\n * pair, because `GT`, `WO` and `LO` read the pair as text (COMPILE.MODULE.KEYS). A target with text keys is that key.\n */\n #pairKey(j: string, texts: boolean): string {\n if (!this.#keys.keyed || texts) return j;\n this.runKeys = true;\n return `keys[${j}]`;\n }\n\n #move(m: Move, focus: string | undefined, origin: string | undefined): string {\n const F = this.use(\"F\");\n switch (m.t) {\n case \"origin\":\n // Stryker disable next-line ConditionalExpression,StringLiteral: see #address\n /* v8 ignore next -- @preserve */\n if (origin === undefined) throw new NotStandalone(\"a node of the memo reads its origin\");\n return origin;\n case \"key\":\n // A key of an array space is the text of its index, unless the run has its own keys.\n return this.#keyMove(JSON.stringify(m.key)) ?? (typeof m.key === \"string\" && /^(0|[1-9]\\d*)$/.test(m.key) ? `(${m.key} < n ? ${m.key} : ${F}())` : `${F}()`);\n case \"index\":\n return typeof m.i === \"number\" && Number.isInteger(m.i) && m.i >= 0 ? `(${m.i} < n ? ${m.i} : ${F}())` : `${F}()`;\n case \"offset\": {\n const [d, ...more] = m.d;\n // Stryker disable next-line ConditionalExpression,StringLiteral: see #address\n /* v8 ignore next -- @preserve */\n if (focus === undefined) throw new NotStandalone(\"a node of the memo reads its focus\");\n // A graph space has no offsets (NAV.OFFSET), so an offset fails at each key.\n if (this.#graph || d === undefined || more.length > 0 || !Number.isInteger(d)) return `${F}()`;\n // In a tree space, an offset goes among the siblings (NAV.OFFSET.TREE).\n if (this.#tree) return `${this.use(\"SO\")}(${this.#part(\"siblings\", \"GP\")}, SI, ${focus}, ${d})`;\n this.#noOffset();\n return `${this.use(\"X\")}(${focus} + ${d}, n)`;\n }\n case \"other\":\n // Stryker disable next-line ConditionalExpression,StringLiteral: see #address\n /* v8 ignore next -- @preserve */\n if (focus === undefined) throw new NotStandalone(\"a node of the memo reads its focus\");\n return `(n === 2 ? 1 - ${focus} : ${F}())`;\n case \"parent\":\n // Only a tree space has parents (NAV.PARENT).\n if (!this.#tree) return `${F}()`;\n // Stryker disable next-line ConditionalExpression,StringLiteral: see #address\n /* v8 ignore next -- @preserve */\n if (focus === undefined) throw new NotStandalone(\"a node of the memo reads its focus\");\n return `${this.use(\"UP\")}(P, ${focus})`;\n }\n }\n\n #ref(e: ExprOf<\"ref\">, ctx: Ctx): Code {\n const [field, ...more] = e.path;\n const kind = field === undefined ? undefined : this.#schema.fields?.[field];\n if (field === undefined || more.length > 0 || !isFieldName(field) || kind === undefined) throw new NotStandalone(`a read of a field that is not in the schema: \"${e.path.join(\".\")}\"`);\n // The check of the run keeps the array of each list of the input (COMPILE.MODULE.LIST.INPUT).\n const input = typeof kind === \"object\" ? this.#input(field) : undefined;\n // A move to the origin cannot fail, and the schema has the field in each record.\n const at = e.at ?? [];\n const safe = at.every((m) => m.t === \"origin\");\n const values = this.#addressValues(at, ctx);\n const deps = this.#addressDeps(at, ctx, values);\n // The interpreter evaluates the expressions of the address before its moves, and the first error stops them.\n const parts = this.#addressParts(at, values, deps);\n const address = this.#address(at, ctx, parts);\n if (typeof kind === \"object\") return { s: stmtsOf(...parts), v: { code: `${input as string}[${address}]`, kind: undefined, safe, deps, list: listOfKind(kind, true) } };\n return { s: stmtsOf(...parts), v: { code: `R[${address}][${JSON.stringify(field)}]`, kind, safe, deps } };\n }\n\n /** This method gives the name of the array of the lists of a field of the input. */\n #input(field: string): string {\n const known = this.inputs.get(field);\n if (known !== undefined) return known;\n const name = this.fresh(\"LF\");\n this.inputs.set(field, name);\n return name;\n }\n\n /** This method gives the code of the expressions of the computed moves of an address. They evaluate at the node. */\n #addressValues(at: readonly Move[], ctx: Ctx): readonly Code[] {\n return addrExprs(at).map((x) => this.expr(x, ctx));\n }\n\n /**\n * This method gives the levels of the key of an address. The focus and the origin have their level, and a fixed key\n * has no level. A computed move has the levels of its value.\n */\n #addressDeps(at: readonly Move[], ctx: Ctx, values: readonly Code[]): ReadonlySet<number> {\n let deps: ReadonlySet<number> = new Set([ctx.level]);\n let next = 0;\n // A move that can fail keeps the levels of its index when a later move replaces the index (V-052). An offset and\n // other keep the index, so their levels stay.\n let fails = false;\n const kept = new Set<number>();\n for (const m of at) {\n if (fails) for (const d of deps) kept.add(d);\n if (moveExpr(m) !== undefined) deps = (values[next++] as Code).v.deps;\n else if (m.t === \"origin\") deps = new Set([ctx.originLevel]);\n // The parent of a key of a tree depends on the key. Outside a tree, the move fails at each key.\n else if (m.t === \"key\" || m.t === \"index\" || (m.t === \"parent\" && !this.#tree)) deps = NO_DEPS;\n fails = m.t !== \"origin\";\n }\n return new Set([...deps, ...kept]);\n }\n\n #var(name: string, ctx: Ctx): Value {\n const bound = ctx.env.get(name);\n if (bound !== undefined) return this.#read(bound);\n // A name of a loop hides a function with its name, so this check comes after the names of the scope.\n if (ctx.fns.has(name)) throw new NotStandalone(`the name \"${name}\" is a function, not a value`);\n const kind = this.#schema.vars?.[name];\n if (kind === undefined) throw new NotStandalone(`a variable that is not in the schema: \"${name}\"`);\n let code = this.vars.get(name);\n if (code === undefined) {\n code = `v${this.vars.size}`;\n this.vars.set(name, code);\n }\n // The check of the run keeps the array of a list of the variables (COMPILE.MODULE.LIST.VAR).\n return typeof kind === \"object\" ? { ...plainValue(code, undefined), list: listOfKind(kind, true) } : plainValue(code, kind);\n }\n\n /**\n * A binding is a variable. A binding with an error is an error only where the body reads its name, so the variable\n * can hold the sentinel. A binding that is a constant of the run is the variable of that constant.\n */\n #let(e: ExprOf<\"let\">, ctx: Ctx, wrap?: (body: Expr) => Expr): Code {\n const env = new Map(ctx.env);\n const fns = new Map(ctx.fns);\n const s: string[] = [];\n let deps = new Set<number>();\n const bound: BoundFn[] = [];\n // The bindings of a let at the root of the body of a function are at the start of the body, so a column of the\n // call can read them. A let at the root that is a node of the memo binds variables of its function of the memo, but\n // the memo holds no column of a call (`#callScope`), so these names have no reader.\n const scope = this.#scopes.at(-1);\n const root = scope !== undefined && scope.root === e ? scope : undefined;\n for (const [name, x] of Object.entries(e.bind)) {\n // A binding sees the context of the let, so a function cannot call itself.\n if (x.tag === \"fn\") {\n // Stryker disable next-line UpdateOperator: the numbers of the bindings only need to be distinct\n const b: BoundFn = { id: this.#fnIds++, fn: x, ctx, specs: new Map(), decls: [], local: false };\n bound.push(b);\n fns.set(name, b);\n env.delete(name);\n continue;\n }\n // A binding takes a list (LIST.VALUE). A value hides a function of its name, because a read looks at the values first.\n this.#wantList.add(x);\n const c = this.#hoist(this.expr(x, ctx), hasLoop(x));\n if (c.v.deps.size === 0) {\n env.set(name, this.#nameOf(c.v));\n continue;\n }\n const b = this.fresh(\"b\");\n s.push(...this.#store(b, c));\n env.set(name, { code: b, kind: c.v.kind, lazy: !c.v.safe, deps: c.v.deps, list: c.v.list });\n root?.names.add(b);\n // The statements of the binding read its keys, so the let is not a constant of the run.\n deps = new Set([...deps, ...c.v.deps]);\n }\n // The body of a relay appends to the list of the bound name, into the array of the owner (COMPILE.MODULE.FUSE.ADOPT).\n // The binding of the relay is not a function, so the let binds its name.\n const relay = this.#relays.get(e);\n if (relay !== undefined) {\n const owner: Owner = { name: relay.bind, read: env.get(relay.bind) as Name, w: relay.owner.w, adopt: relay.owner.adopt, sure: relay.owner.sure };\n for (const node of relay.nodes) this.#own.set(node, owner);\n }\n // A list op over a let is the list op over its body, in the scope of its bindings (`#app`).\n const inner = wrap === undefined ? e.body : wrap(e.body);\n // A let at a place that takes a list gives its body there (LIST.VALUE).\n if (this.#wantList.has(e)) this.#wantList.add(inner);\n if (root !== undefined) root.root = inner;\n const body = this.expr(inner, { ...ctx, env, fns });\n // A function that reads names of the place of the binding comes after them, before the body.\n return { s: [...s, ...bound.flatMap((b) => b.decls), ...body.s], v: { ...body.v, deps: new Set([...deps, ...body.v.deps]) } };\n }\n\n /**\n * This method prints a call (FN.CALL). Each argument evaluates at the place of the call, as a binding of a let. The\n * call goes to the printed function of the signature of its arguments, with the focus and the origin if it reads them.\n */\n #call(e: ExprOf<\"call\">, ctx: Ctx): Code {\n const bound = ctx.env.has(e.fn) ? undefined : ctx.fns.get(e.fn);\n if (bound === undefined) throw new NotStandalone(`a call of \"${e.fn}\", which is not a function`);\n if (bound.fn.params.length !== e.args.length) throw new NotStandalone(`a call of \"${e.fn}\" with ${String(e.args.length)} arguments, not ${String(bound.fn.params.length)}`);\n // The second print of a fast sum puts the body of a function at the place of its call (`#inline`).\n if (this.#packAt(ctx)) return this.#inline(bound, e, ctx);\n const s: string[] = [];\n const args = e.args.map((x): Arg => {\n // An argument can be a list, as a binding of a let can (COMPILE.MODULE.LIST.ARG).\n this.#wantList.add(x);\n const c = this.#hoist(this.expr(x, ctx), hasLoop(x));\n const { kind, deps, list } = c.v;\n // A value that cannot throw is the argument itself. A read of a name that can hold the error passes the name.\n if (c.v.safe) {\n s.push(...c.s);\n return { code: c.v.code, kind, deps, list };\n }\n // Stryker disable next-line ConditionalExpression: the statements with a read of a name bind other names and do not throw, so the read alone has the same value\n if (c.s.length === 0 && c.v.held !== undefined) return { code: c.v.held, kind, deps, list };\n const b = this.fresh(\"b\");\n s.push(...this.#store(b, c));\n return { code: b, kind, deps, list };\n });\n // Each parameter can hold the error of its argument, so one function serves the arguments of one kind. The facts of\n // a list are a part of its kind. With fuse, the fact clean of each list is a part too (COMPILE.MODULE.FUSE.CLEAN).\n // The function of a list that is not clean also serves a clean list, so a call takes it if it exists.\n const sig = this.#signature(args, this.#fuse);\n const spec = bound.specs.get(sig) ?? bound.specs.get(this.#signature(args, false)) ?? this.#unpacked(() => this.#printFn(bound, args, sig));\n // Each marker becomes the levels at the call. The levels of the arguments count for each call, because their\n // statements read their keys, so the marker of the parameters gives no level.\n const levels = (d: number): readonly number[] => (d === spec.origin ? [ctx.originLevel] : d === spec.focus ? [ctx.level] : d === spec.param ? [] : [d]);\n const deps = new Set([...args.flatMap((a) => [...a.deps]), ...[...spec.deps].flatMap(levels)]);\n const position = [...(spec.deps.has(spec.focus) ? [ctx.focus] : []), ...(spec.deps.has(spec.origin) ? [ctx.origin] : [])];\n return { s, v: { code: `${spec.name}(${[...args.map((a) => a.code), ...position].join(\", \")})`, kind: spec.kind, safe: spec.safe, deps, list: heldList(spec.list) } };\n }\n\n /**\n * This method prints a call in the second print of a fast sum (`#packed`). The body of the function is at the place\n * of the call, as the body of a let. Each argument evaluates at the place of the call. The body sees the names of the\n * place of its binding (FN.CALL). Thus a read of a column in the body reads the pack of the column.\n */\n #inline(bound: BoundFn, e: ExprOf<\"call\">, ctx: Ctx): Code {\n // A function at the place of its binding reads names of that place, so its body stays in its function.\n if (bound.local || ++(this.#pack as Pack).inlines > INLINES) throw new NoPack();\n const s: string[] = [];\n const deps: number[] = [];\n const env = new Map(bound.ctx.env);\n bound.fn.params.forEach((p, i) => {\n const x = e.args[i] as Expr;\n this.#wantList.add(x);\n const c = this.#hoist(this.expr(x, ctx), hasLoop(x));\n if (c.v.list !== undefined) throw new NoPack();\n deps.push(...c.v.deps);\n // A short safe value is the read itself. A read of a name that can hold the error reads that name.\n let code = c.v.code;\n if (!c.v.safe && c.s.length === 0 && c.v.held !== undefined) code = c.v.held;\n else if (!c.v.safe || c.s.length > 0 || !/^[\\w$.]+$/.test(code)) {\n code = this.fresh(\"b\");\n s.push(...this.#store(code, c));\n }\n env.set(p, { code, kind: c.v.kind, lazy: !c.v.safe, deps: c.v.deps, list: undefined });\n });\n this.#wantList.add(bound.fn.body);\n const body = this.expr(bound.fn.body, { ...ctx, env, fns: bound.ctx.fns, keys: new Map() });\n if (body.v.list !== undefined) throw new NoPack();\n // The statements of an argument read their keys, also when the body does not read the parameter (V-081).\n return { s: [...s, ...body.s], v: { ...body.v, deps: new Set([...deps, ...body.v.deps]) } };\n }\n\n /** This method runs `f` outside the second print of a fast sum: a function and a node of the memo print as before. */\n #unpacked<T>(f: () => T): T {\n const pack = this.#pack;\n this.#pack = undefined;\n try {\n return f();\n } finally {\n this.#pack = pack;\n }\n }\n\n /**\n * This method prints a bound function for one signature of its arguments, as one JavaScript function. Its parameters\n * are the arguments, then the focus and the origin, if the body reads them. A function that reads a name of the place\n * of its binding is at that place. Each other function is at the start of a run, so a constant of the run can call it.\n */\n #printFn(bound: BoundFn, args: readonly Arg[], sig: string): Spec {\n // The markers are far from the levels of the axes and of the loops, so they do not meet them. They only need to be\n // distinct.\n // Stryker disable next-line ArithmeticOperator,UpdateOperator: see the comment above\n const origin = 2_000_000 + 1000 * this.#printed++;\n const focus = origin + 1;\n const param = -origin;\n const names = args.map(() => this.fresh(\"p\"));\n const k = this.fresh(\"k\");\n const o = this.fresh(\"o\");\n const env = new Map(bound.ctx.env);\n // A parameter hides a function of its name, because a read looks at the values first.\n bound.fn.params.forEach((p, i) => env.set(p, { code: names[i] as string, kind: (args[i] as Arg).kind, lazy: true, deps: new Set([param]), list: this.#paramList((args[i] as Arg).list, this.#fuse) }));\n const scope: CallScope = { param, focus, repeats: nestsLoops(bound.fn.body), names: new Set(names), decls: [], root: bound.fn.body };\n this.#scopes.push(scope);\n // The value of a call can be a list, as the value of a let can (COMPILE.MODULE.LIST.CALL). The call is at a place\n // that takes a list, or it gives the reason.\n this.#wantList.add(bound.fn.body);\n const body = this.expr(bound.fn.body, { origin: o, focus: k, level: focus, originLevel: origin, env, fns: bound.ctx.fns, keys: new Map(), columns: new Map() });\n this.#scopes.pop();\n const markers = new Set([origin, focus, param]);\n const global = [...body.v.deps].every((d) => markers.has(d));\n const name = this.fresh(\"fn\");\n if (hasLoop(bound.fn.body) || this.#defers(body)) this.#deferred.add(name);\n // A parameter is here only if the body reads it, so the text of a call reads only the levels of its deps (V-085).\n const position = [...(body.v.deps.has(focus) ? [k] : []), ...(body.v.deps.has(origin) ? [o] : [])];\n const head = `const ${name} = (${[...names, ...position].join(\", \")}) =>`;\n // The columns of the call come first. Each one reads a binding of the root only after the binding has its value.\n const s = [...scope.decls, ...body.s];\n const decl = s.length === 0 ? [`${head} ${body.v.code};`] : [`${head} {`, ...ind(s), ` return ${body.v.code};`, \"};\"];\n (global ? this.run : bound.decls).push(...decl);\n this.#specCode.set(name, decl.join(\"\\n\"));\n if (!global) bound.local = true;\n const spec: Spec = { name, kind: body.v.kind, list: body.v.list, safe: body.v.safe, deps: body.v.deps, origin, focus, param, global };\n bound.specs.set(sig, spec);\n return spec;\n }\n\n /**\n * This method gives the facts of the list of a parameter. Only the fact clean of the list itself stays, and only with\n * `clean`. The fact clean of the items of a list of lists makes more functions, so it does not stay. `fresh` does not\n * hold for a parameter, because the caller holds its argument.\n */\n #paramList(l: ListInfo | undefined, clean: boolean): ListInfo | undefined {\n const plain = plainList(l);\n return plain !== undefined && clean && l?.clean === true ? { ...plain, clean: true } : plain;\n }\n\n /** This method gives the signature of the arguments of a call: the kind of each one, with the facts of each list. */\n #signature(args: readonly Arg[], clean: boolean): string {\n return JSON.stringify(args.map((a) => (a.list === undefined ? (a.kind ?? null) : { list: this.#paramList(a.list, clean) })));\n }\n\n #boolean(v: Value): string {\n return v.kind === \"boolean\" ? v.code : `${this.use(\"B\")}(${v.code})`;\n }\n\n /** A condition is safe when it is a safe boolean. */\n #safeBoolean(v: Value): boolean {\n return v.safe && v.kind === \"boolean\";\n }\n\n #app(e: ExprOf<\"app\">, ctx: Ctx): Code {\n const { op, args } = e;\n // A branch of if and of ifError is at a place that takes a list when the node is.\n if ((op === \"if\" || op === \"ifError\") && this.#wantList.has(e)) for (const x of args.slice(op === \"if\" ? 1 : 0)) this.#wantList.add(x);\n if (op === \"if\") return this.#if(args, ctx);\n if (op === \"and\" || op === \"or\") return this.#andOr(op === \"and\", args, ctx);\n if (op === \"ifError\") return this.#ifError(args, ctx);\n const [head] = args;\n const rest = args.slice(1);\n // An each whose body is a list gives a list of lists (LIST.FLAT), so a list op over it goes over its array.\n if (FOLD_OPS.has(op) && head?.tag === \"each\" && !this.#bodyList(head, ctx)) return this.#list(op, head, rest, ctx);\n // A list op over a let with only literal options is the list op over the body of the let, so an each in the body\n // is one loop with a running value, not an array. A builder sheet prints such a let, for example `sum(let($0 = 0, each(…)))`.\n if (FOLD_OPS.has(op) && head?.tag === \"let\" && rest.every((x) => x.tag === \"lit\")) {\n // The list op over the body is a new node, and an item of a list can be a list. `expr` still examines the place of this op.\n this.#wantList.add(head);\n return this.#let(head, ctx, (body) => app(op, body, ...rest));\n }\n // sortBy and take are list ops for each receiver. Each other list op needs a list, and a domain can have its name.\n if (head !== undefined && (op === \"sortBy\" || op === \"take\" || (op === \"drop\" && this.#isList(head, ctx)))) return this.#order(op, head, rest, ctx);\n if (head !== undefined && op === \"setNth\" && this.#isList(head, ctx)) return this.#setNth(head, rest, ctx);\n // With fuse, flat over an each is one loop with one output (COMPILE.MODULE.FUSE).\n const strict = op === \"flat\" && head?.tag === \"each\" ? this.#fusedStrict(head, rest, ctx) : undefined;\n if (strict !== undefined) return this.#flatEach(head as ExprOf<\"each\">, strict, ctx, this.#keepOwner(e));\n // With fuse, a chain of append with a part that pushes its items is one output (COMPILE.MODULE.FUSE).\n const joined = op === \"append\" ? this.#appendStrict(e, ctx) : undefined;\n if (joined !== undefined && args.slice(0, 2).some((x) => this.#pushes(x, ctx))) return this.#appendChain(e, joined, ctx);\n if (head !== undefined && BUILD_OPS.has(op) && this.#isList(head, ctx)) return this.#build(op, head, rest, ctx, this.#own.get(e));\n if (head !== undefined && (FOLD_OPS.has(op) || op === \"nth\") && this.#isList(head, ctx)) return this.#overList(op, head, rest, ctx);\n // An argument can be a list (COMPILE.MODULE.LIST.ARG).\n for (const x of args) this.#wantList.add(x);\n const raw = args.map((x) => this.expr(x, ctx));\n const deps = depsOf(...raw);\n // The interpreter evaluates each argument, also after an error.\n const values = this.#inOrder(this.#settle(raw, deps, args), true);\n if (op === \"fill\" && this.#facts.own(op)) return this.#fill(e, values, deps);\n return this.#opCall(op, values, deps);\n }\n\n /**\n * This method prints `fill(n, value)` without a domain with the op (LIST.FILL, COMPILE.MODULE.FILL). The helper `FI`\n * gets each value, so an error of an argument after the value is the error of the op. The keys are not the positions\n * of records, so the axis `list` over the list cannot read a record at its keys.\n */\n #fill(e: ExprOf<\"app\">, values: readonly Code[], deps: ReadonlySet<number>): Code {\n const value = values[1]?.v;\n // FI gives a new array of checked values, so the list is clean and fresh.\n const list: ListInfo = { item: value?.kind, inner: heldList(value?.list), texts: true, clean: true, fresh: true };\n if (this.#fillsNothing(e, values[1])) {\n // The helper stays in the names of the module, so the option `name` has the same refusal. The last pass removes it.\n this.use(\"FI\");\n return { s: [], v: { code: \"[]\", kind: undefined, safe: true, deps, list } };\n }\n // The one item of an append of an owner has the key 0, as FI gives it (COMPILE.MODULE.FUSE.ADOPT). The append uses FI\n // only when it does not push the item.\n const one = this.#ones.has(e) && values.length === 2 && isOne(e.args[0]);\n const v: Value = { code: `${one ? \"FI\" : this.use(\"FI\")}(${values.map((x) => x.v.code).join(\", \")})`, kind: undefined, safe: false, deps, list };\n if (one) this.#ones.set(e, { v, item: `[0, ${(value as Value).code}]` });\n return { s: stmtsOf(...values), v };\n }\n\n /**\n * This method tells if `fill` gives no items and cannot fail, so `[]` is its code (COMPILE.MODULE.SIZE.FILL). The count\n * must be the literal 0. The code of the value cannot throw, or the value reads nothing of a run and the interpreter\n * gives the empty list. A value that fails keeps FI, so the list keeps its error. The option `fuse` must be true.\n */\n #fillsNothing(e: ExprOf<\"app\">, value: Code | undefined): boolean {\n const [count, x] = e.args;\n if (!this.#fuse || value === undefined || x === undefined || e.args.length !== 2 || count?.tag !== \"lit\" || count.value !== 0) return false;\n if (value.s.length === 0 && value.v.safe) return true;\n if (!isClosed(x)) return false;\n const r = evaluate(e, { space: ONE_RECORD, origin: \"0\", domains: this.#domains });\n return r.ok && isVexList(r.value) && r.value.items.length === 0;\n }\n\n /**\n * This method gives the range of a list that a loop or `count` reads, or undefined (COMPILE.MODULE.FILL.RANGE). The\n * list is `fill(n, v)` or `take(range, k)`, with no other argument. The option `fuse` must be true, and no domain can\n * have the op `fill`. Each other list keeps its array. So does a key of a node of the memo, which has a name.\n */\n #range(e: Expr, ctx: Ctx): Range | undefined {\n if (!this.#fuse || e.tag !== \"app\" || e.args.length !== 2 || !this.#facts.own(\"fill\") || ctx.keys.has(e)) return undefined;\n const [head, second] = e.args as readonly [Expr, Expr];\n if (e.op === \"take\") {\n const range = this.#range(head, ctx);\n if (range === undefined) return undefined;\n // TK checks its count after its list, so an error of the range comes first. A count that is a constant of the run\n // evaluates once, as in TK.\n const [n, k] = this.#inOrder([{ s: [], v: range.count }, this.#hoist(this.expr(second, ctx), hasLoop(second))], true) as readonly [Code, Code];\n const count: Value = { code: `${this.use(\"TN\")}(${n.v.code}, ${k.v.code})`, kind: \"number\", safe: false, deps: depsOf(n, k) };\n return { s: [...range.s, ...stmtsOf(n, k)], count, item: range.item, info: range.info };\n }\n const size = literalOf(head);\n // The empty fill has its own code (COMPILE.MODULE.SIZE.FILL).\n if (e.op !== \"fill\" || size === 0) return undefined;\n for (const x of e.args) this.#wantList.add(x);\n // The interpreter evaluates each argument, also after an error, as for FI. A loop at each key reads the range again,\n // so each argument that is a constant of the run evaluates once, before the loop over the keys.\n const raw = e.args.map((x) => this.#hoist(this.expr(x, ctx), hasLoop(x)));\n const deps = depsOf(...raw);\n const [n, v] = this.#inOrder(raw, true) as readonly [Code, Code];\n const s = stmtsOf(n, v);\n const info: ListInfo = { item: v.v.kind, inner: heldList(v.v.list), texts: true, clean: true, fresh: false };\n // Each item reads the value. Thus a value that is not a literal evaluates once, before the loop.\n const plain = PLAIN_LITERALS.has(typeof literalOf(second));\n const item = plain ? v.v.code : this.fresh(\"b\");\n // A literal count that FI takes needs no check, when the value cannot fail.\n if (Number.isSafeInteger(size) && (size as number) >= 1 && (size as number) <= 100000 && v.v.safe) {\n if (!plain) s.push(`const ${item} = ${v.v.code};`);\n return { s, count: { code: String(size), kind: \"number\", safe: true, deps, plain: true }, item, info };\n }\n // The count evaluates before the value, as in FI.\n const number = plain ? n.v.code : this.fresh(\"b\");\n if (!plain) s.push(`const ${number} = ${n.v.code};`, `const ${item} = ${v.v.code};`);\n return { s, count: { code: `${this.use(\"FN\")}(${number}, ${item})`, kind: \"number\", safe: false, deps }, item, info };\n }\n\n /**\n * This method gives the code of a value outside the list ops: a list is a `vex.list`, as in the interpreter\n * (COMPILE.MODULE.LIST.ARG, COMPILE.MODULE.LIST.FIELD). An error item has the error `VEX_ERROR`.\n */\n #plain(v: Value): string {\n return v.list === undefined ? v.code : this.envelope(v, \"LV\");\n }\n\n /** This method gives the samples of a list of the facts `l`: no items, items with values, and an error item. */\n #listSamples(l: ListInfo): readonly unknown[] {\n const values = l.inner !== undefined ? [vexList([])] : l.item === undefined ? SAMPLES.number : this.#samples(l.item);\n const items = values.map((value, i) => ({ key: String(i), result: { ok: true as const, value } }));\n // An error item of a module has the error VEX_ERROR, which is not an error value of the interpreter.\n return [vexList([]), vexList(items), vexList([{ key: \"0\", result: { ok: false, error: { vexError: true } as never } }])];\n }\n\n /**\n * This method gives the code of a number that an op lifts: the call of a copy of `fromScalar` of the domain (KIND.LIFT).\n * The op checks its result, as in the interpreter, so a lift that gives a value that is not valid needs no check here.\n */\n #lifted(x: Code, domain: number, d: AnyDomain): Code {\n const name = `lift_${domain}`;\n this.#copy(name, copied(d.fromScalar as (...a: never[]) => unknown, [SAMPLES.number], `the lift of the domain ${d.name}`));\n return { s: x.s, v: { ...x.v, code: `${name}(${x.v.code})`, kind: kindOfDomain(d), safe: false, plain: false } };\n }\n\n /** This method prints the call of the op of a domain on some values, from the static site of their kinds. */\n #opCall(op: string, given: readonly Code[], deps: ReadonlySet<number>): Code {\n const lists = new Set(given.flatMap((x, i) => (x.v.list === undefined ? [] : [i])));\n // A list op of the interpreter that a module does not have, and an op of a domain, cannot take a list as the receiver.\n if (lists.has(0)) throw new NotStandalone(isListOp(op) ? `the list op \"${op}\"` : `a list as the receiver of the op \"${op}\"`);\n const site = this.#facts.staticSite(op, given.map((x) => x.v.kind), lists, true);\n if (site?.t !== \"fn\") throw new NotStandalone(`the kinds of the values of \"${op}\" do not decide its op`);\n // LI gives a new array, and its keys are texts (COMPILE.MODULE.LIST.OP).\n const list: ListInfo | undefined = site.item === undefined ? undefined : { item: site.item, texts: true, fresh: true };\n if (site.bad) return { s: stmtsOf(...given), v: { code: `${this.use(\"F\")}()`, kind: site.returns, safe: false, deps, list } };\n if (site.returns === undefined && list === undefined) throw new NotStandalone(`the op \"${op}\" does not declare the kind of its result`);\n const d = this.#domains[site.domain] as AnyDomain;\n const lifted = site.lifted ?? [];\n const values = given.map((x, i) => (lifted.includes(i - 1) ? this.#lifted(x, site.domain, d) : x));\n const name = `op_${site.domain}_${this.#opIndex(op)}`;\n // Stryker disable next-line ConditionalExpression: the form of an op is always the same, so the map only saves time\n if (!this.#forms.has(name)) {\n // A static site of a domain has the function of the op of that domain.\n const fn = (d.ops[op] as { fn: (...a: never[]) => unknown }).fn;\n const kinds = values.map((x) => x.v.kind).filter((k): k is Kind => k !== undefined);\n const each = values.flatMap((x) => (x.v.list !== undefined ? [this.#listSamples(x.v.list)] : x.v.kind === undefined ? [] : [this.#samples(x.v.kind)]));\n const src = copied(fn, each, `the op \"${op}\" of the domain ${d.name}`);\n // An inline form cannot throw for primitive values only.\n this.#forms.set(name, lists.size === 0 && kinds.every((k) => primitiveOf(k) !== undefined) ? inlineForm(src) : undefined);\n if (site.returns !== undefined && !givesValue(src) && this.#missesNoValue(site.returns)) this.#unproved.add(name);\n this.#copy(name, src);\n }\n // The result is a `vex.list`. Its array of pairs comes from the helper of a list of the input, so a result that is not\n // a list of the declared kind is an error (COMPILE.MODULE.LIST.OP).\n if (list !== undefined) {\n this.#called.add(name);\n this.opList = true;\n const read = `${this.use(\"LI\")}(${name}(${values.map((x) => this.#plain(x.v)).join(\", \")}), 0, ${this.test(list.item as Kind)})`;\n return { s: stmtsOf(...values), v: { code: `(${read} ?? ${this.use(\"F\")}())`, kind: undefined, safe: false, deps, list } };\n }\n const form = this.#forms.get(name);\n // An inline form takes each argument once, or a plain argument more often, so each argument evaluates once.\n const inline = form !== undefined && lists.size === 0 && form.params.length === values.length && values.every((x, i) => form.uses[i] === 1 || (x.v.plain === true && x.v.safe && (form.uses[i] as number) > 0));\n if (inline) {\n const text = form.parts.map((x) => (typeof x === \"number\" ? `(${(values[x] as Code).v.code})` : x)).join(\"\");\n const checked = this.check(site.returns as Kind);\n const value = this.#value(name, text);\n const code = checked === undefined ? `(${value})` : `${checked}(${value})`;\n return { s: stmtsOf(...values), v: { code, kind: site.returns, safe: checked === undefined && value === text && values.every((x) => x.v.safe), deps } };\n }\n this.#called.add(name);\n // An exception of the op is an error of Vex: the boundary around the op catches it.\n const code = this.#checked(site.returns as Kind, this.#value(name, `${name}(${values.map((x) => this.#plain(x.v)).join(\", \")})`));\n return { s: stmtsOf(...values), v: { code, kind: site.returns, safe: false, deps } };\n }\n\n /** The condition must be a boolean. Only the branch that the condition selects is evaluated. */\n #if(args: readonly Expr[], ctx: Ctx): Code {\n if (args.length !== 3) throw new NotStandalone(\"an if without three arguments\");\n const [c, a, b] = args as [Expr, Expr, Expr];\n const raw = [this.expr(c, ctx), this.expr(a, ctx), this.expr(b, ctx)];\n const deps = depsOf(...raw);\n const [cond, yes, no] = this.#settle(raw, deps, [c, a, b]) as [Code, Code, Code];\n const v = { kind: join(yes.v.kind, no.v.kind), safe: this.#safeBoolean(cond.v) && yes.v.safe && no.v.safe, deps, list: branchLists(\"if\", yes.v.list, no.v.list) };\n if (yes.s.length === 0 && no.s.length === 0) return { s: cond.s, v: { ...v, code: `(${this.#boolean(cond.v)} ? ${yes.v.code} : ${no.v.code})` } };\n const t = this.fresh(\"t\");\n const s = [...cond.s, `let ${t};`, `if (${this.#boolean(cond.v)}) {`, ...ind(yes.s), ` ${t} = ${yes.v.code};`, \"} else {\", ...ind(no.s), ` ${t} = ${no.v.code};`, \"}\"];\n return { s, v: { ...v, code: t } };\n }\n\n /** `and` stops at the first `false`, and `or` at the first `true`. Each argument before the stop must be a boolean. */\n #andOr(and: boolean, args: readonly Expr[], ctx: Ctx): Code {\n if (args.length === 0) throw new NotStandalone(`an ${and ? \"and\" : \"or\"} without arguments`);\n const raw = args.map((x) => this.expr(x, ctx));\n const deps = depsOf(...raw);\n const parts = this.#settle(raw, deps, args);\n const v = { kind: \"boolean\" as const, safe: parts.every((x) => this.#safeBoolean(x.v)), deps };\n const [first, ...rest] = parts as [Code, ...Code[]];\n if (rest.every((x) => x.s.length === 0)) return { s: first.s, v: { ...v, code: `(${parts.map((x) => this.#boolean(x.v)).join(and ? \" && \" : \" || \")})` } };\n const t = this.fresh(\"t\");\n const s = [...first.s, `let ${t} = ${this.#boolean(first.v)};`];\n for (const x of rest) s.push(`if (${and ? \"\" : \"!\"}${t}) {`, ...ind(x.s), ` ${t} = ${this.#boolean(x.v)};`, \"}\");\n return { s, v: { ...v, code: t } };\n }\n\n /** The value of the first argument, or else the value of the second argument. */\n #ifError(args: readonly Expr[], ctx: Ctx): Code {\n if (args.length !== 2) throw new NotStandalone(\"an ifError without two arguments\");\n const [a, b] = args as [Expr, Expr];\n const raw = [this.expr(a, ctx), this.expr(b, ctx)];\n const deps = depsOf(...raw);\n const [first, second] = this.#settle(raw, deps, [a, b]) as [Code, Code];\n if (first.v.safe) return first;\n const t = this.fresh(\"t\");\n const s = [`let ${t};`, \"try {\", ...ind(first.s), ` ${t} = ${first.v.code};`, \"} catch {\", ...ind(second.s), ` ${t} = ${second.v.code};`, \"}\"];\n return { s, v: { code: t, kind: join(first.v.kind, second.v.kind), safe: second.v.safe, deps, list: branchLists(\"ifError\", first.v.list, second.v.list) } };\n }\n\n #opIndex(op: string): number {\n let i = this.#ops.get(op);\n if (i === undefined) {\n i = this.#ops.size;\n this.#ops.set(op, i);\n }\n return i;\n }\n\n /**\n * This method gives the option strict of a list op. The options must be one literal with only strict. Only a literal\n * has a value, so another expression gives the reason too.\n */\n #strict(op: string, rest: readonly Expr[], names: readonly string[] = [\"strict\"]): boolean {\n const [options, ...more] = rest;\n if (more.length > 0) throw new NotStandalone(`\"${op}\" with more than one option`);\n if (options === undefined) return false;\n const opts = (options as { readonly value?: unknown }).value;\n if (typeof opts !== \"object\" || opts === null || Object.keys(opts).some((k) => !names.includes(k))) throw new NotStandalone(`the options of \"${op}\" are not a literal with ${names.join(\" or \")}`);\n return (opts as { readonly strict?: unknown }).strict === true;\n }\n\n /**\n * This method gives the option strict of a list op. For `reduce`, it also gives the op of each step: the first\n * argument, a literal text, and the value of the option `domain` (COMPILE.MODULE.REDUCE).\n */\n #foldOptions(op: string, rest: readonly Expr[]): { readonly strict: boolean; readonly step: Step | undefined } {\n if (op !== \"reduce\") return { strict: this.#strict(op, rest), step: undefined };\n const [name, ...options] = rest;\n const value = (name as { readonly value?: unknown } | undefined)?.value;\n if (name?.tag !== \"lit\" || typeof value !== \"string\") throw new NotStandalone('\"reduce\" without a literal text as its op');\n const strict = this.#strict(op, options, [\"strict\", \"domain\"]);\n return { strict, step: { op: value, domain: (options[0] as { readonly value?: { readonly domain?: unknown } } | undefined)?.value?.domain } };\n }\n\n /**\n * A list op over an axis: one `for` loop with a running value. An item with an error is skipped, and with `strict` it\n * is an error of the list op. A value of the wrong kind is an error of the list op, as in the interpreter.\n */\n /**\n * This method prints a fixed point (COMPILE.FIX.MODULE). The column is an array with the value of each position. The\n * rows of `init` give its first values, and each round makes the array of the next values. A round without a change\n * ends the loop with the old array (FIX.ROUNDS). The last round that still changes a row throws (FIX.LIMIT). Each\n * error of a module is one sentinel, so the first row that fails can stop the column. A column that reads no key is\n * a constant of the run. It evaluates on its first read, as a branch of the interpreter does.\n */\n #fix(e: ExprOf<\"fix\">, ctx: Ctx): Code {\n const kind = joinKind(e.join);\n const old = this.fresh(\"fx\");\n const next = this.fresh(\"fx\");\n const changed = this.fresh(\"ch\");\n const round = this.fresh(\"k\");\n const first = this.#rows(e, e.init, ctx, (x, j) => [`${old}[${j}] = ${x};`]);\n const step = this.#rows(e, e.step, { ...ctx, columns: new Map([...ctx.columns, [e.name, { code: old, kind }]]) }, (x, j) => {\n const y = this.fresh(\"y\");\n const read = `${old}[${j}]`;\n const joined = e.join === \"or\" ? `${read} || ${x}` : e.join === \"and\" ? `${read} && ${x}` : `Math.${e.join}(${read}, ${x})`;\n return [`const ${y} = ${joined};`, `if (${y} !== ${read}) ${changed} = true;`, `${next}[${j}] = ${y};`];\n });\n const s = [\n `let ${old} = [];`,\n ...first.s,\n `for (let ${round} = 0; ; ${round}++) {`,\n ` if (${round} === Math.min(n + 1, ${MAX_ITERATIONS})) ${this.use(\"F\")}();`,\n ` const ${next} = [];`,\n ` let ${changed} = false;`,\n ...ind(step.s),\n ` if (!${changed}) break;`,\n ` ${old} = ${next};`,\n \"}\",\n ];\n const held = this.#hoist({ s, v: { code: old, kind: undefined, safe: false, deps: new Set([...first.deps, ...step.deps]) } }, true);\n return { s: held.s, v: { code: `${held.v.code}[${ctx.focus as string}]`, kind, safe: false, deps: new Set([...held.v.deps, ctx.level]) } };\n }\n\n /**\n * This method prints the loop over the rows of a column: the evaluation of `x` and the check of its kind (FIX.KIND).\n * `store` gives the statements of a good value. A search of a sheet must see each read of a cell, so a row that reads\n * a cell does not stop the loop (FIX.ERROR). A flag holds the failure until the end of the loop.\n */\n #rows(e: ExprOf<\"fix\">, x: Expr, ctx: Ctx, store: (value: string, row: string) => readonly string[]): { readonly s: readonly string[]; readonly deps: ReadonlySet<number> } {\n const { j, head, inner } = this.#targetLoop({ t: \"all\" }, [], ctx);\n // A list has the wrong kind for a column, and the check of the row gives the failure (FIX.KIND).\n this.#wantList.add(x);\n const c = this.#hoist(this.expr(x, inner), hasLoop(x));\n const v = this.fresh(\"x\");\n const F = this.use(\"F\");\n const boolean = joinKind(e.join) === \"boolean\";\n const row = [...c.s, `const ${v} = ${boolean ? this.#boolean(c.v) : c.v.code};`, ...(boolean ? [] : [`if (!Number.isFinite(${v})) ${F}();`]), ...store(v, j)];\n const deps = new Set([...c.v.deps].filter((d) => d !== inner.level && d !== ROUNDS));\n if (!c.v.deps.has(CELLS)) return { s: [head, ...ind(row), \"}\"], deps };\n const failed = this.fresh(\"f\");\n return { s: [`let ${failed} = false;`, head, ...ind([\"try {\", ...ind(row), \"} catch {\", ` ${failed} = true;`, \"}\"]), \"}\", `if (${failed}) ${F}();`], deps };\n }\n\n /**\n * This method gives the loop over the targets of an axis: the statements before it, its bounds and the key that it\n * skips. `start` has the levels of the address, and `inner` is the position at a target. The axes all, others,\n * window and list have a loop. In a tree space, the axes of a tree have a loop too. With `as`, a loop over the axis\n * list binds the value and the index of each item after its check (COMPILE.MODULE.LIST.ITEM).\n */\n #targetLoop(axis: Axis, at: readonly Move[], ctx: Ctx, as?: ItemNames): {\n readonly s: string[];\n readonly j: string;\n /** The head of the loop, and the statements at the start of each item before the try and inside it. */\n readonly head: string;\n /** The parts of the head. An early exit (COMPILE.MODULE.EXIT) goes on from the next target with them. */\n readonly parts: ForParts;\n readonly key: readonly string[];\n readonly check: readonly string[];\n readonly skip: string | undefined;\n readonly fixed: boolean;\n readonly start: ReadonlySet<number>;\n /** True when the statements before the loop cannot throw. */\n readonly startSafe: boolean;\n /** True when the statements of `check` cannot throw: no item is an error item (COMPILE.MODULE.FUSE.CLEAN). */\n readonly checkSafe: boolean;\n readonly tests: readonly Expr[];\n readonly inner: Ctx;\n /** True when a target can be a key that is not the position of a record: a key of a literal or of `fill`. */\n readonly texts: boolean;\n /** The names `as` of the items, and their level. Only the body of an each and the steps of a fold read them. */\n readonly items: ReadonlyMap<string, Name>;\n readonly item: number | undefined;\n /** The array of a loop over the array of a list, and the pair of the item in it (COMPILE.MODULE.APPEND.KEEP). */\n readonly array?: { readonly a: string; readonly pair: string };\n } {\n const { base: outer, tests } = testsOf(axis);\n // The reverse order of an axis is a loop from its end (AXIS.REVERSE). The validation keeps a base axis inside.\n const reverse = outer.t === \"reverse\";\n const base = outer.t === \"reverse\" ? outer.axis : outer;\n const j = this.fresh(\"j\");\n const inner: Ctx = { ...ctx, focus: j, level: ctx.level + 1 };\n // The axis list goes over the array of its list (AXIS.LIST). The list evaluates at the node, before the loop, and an\n // error item is an item that fails.\n if (base.t === \"list\") {\n if (at.length > 0) throw new NotStandalone('the axis \"list\" with an address');\n // A range of fill is a loop over its count, with no array (COMPILE.MODULE.FILL.RANGE). The key is the position.\n const range = this.#range(base.list, ctx);\n if (range !== undefined) {\n const a = this.fresh(\"A\");\n const q = this.fresh(\"q\");\n const parts = forParts(q, \"0\", a, reverse);\n const s = [...range.s, `const ${a} = ${range.count.code};`];\n const named = as === undefined ? undefined : this.#itemNames(as, range.info, range.item, () => a, reverse);\n if (named !== undefined) s.push(...named.s);\n return { s, j, head: forHead(q, parts), parts, key: [`const ${j} = ${q};`], check: [...(named?.check ?? [])], checkSafe: true, skip: undefined, fixed: false, start: range.count.deps, startSafe: range.count.safe, tests, inner, texts: true, items: named?.items ?? NO_NAMES, item: named?.level };\n }\n const list = this.#hoist(this.#listOf(base.list, ctx), hasLoop(base.list));\n // A key of a literal or of fill is not the position of a record. Such a focus is a key of a list of the code only.\n const texts = (list.v.list as ListInfo).texts === true;\n const a = this.fresh(\"A\");\n const q = this.fresh(\"q\");\n const parts = forParts(q, \"0\", `${a}.length`, reverse);\n const head = forHead(q, parts);\n // The pair of a keyed print holds the key of its record, and the loop reads the position of that record.\n const read = `${a}[${q}][0]`;\n const key = [`const ${j} = ${this.#pairKey(j, texts) === j ? read : `KM.get(${read})`};`];\n // The loop over a clean list has no test of the sentinel (COMPILE.MODULE.FUSE.CLEAN).\n const clean = this.#clean(list.v.list);\n const check = clean ? [] : [`if (${a}[${q}][1] === E) ${this.use(\"F\")}();`];\n const s = [...list.s, `const ${a} = ${list.v.code};`];\n // The count of a clean list is its length (COMPILE.MODULE.FUSE.CLEAN).\n const count = (): string => (clean ? `${a}.length` : `${this.use(\"CT\")}(${a}, false)`);\n const named = as === undefined ? undefined : this.#itemNames(as, list.v.list as ListInfo, `${a}[${q}][1]`, count, reverse);\n if (named !== undefined) {\n s.push(...named.s);\n check.push(...named.check);\n }\n return { s, j, head, parts, key, check, checkSafe: clean, skip: undefined, fixed: false, start: list.v.deps, startSafe: list.v.safe, tests, inner, texts, items: named?.items ?? NO_NAMES, item: named?.level, array: { a, pair: `${a}[${q}]` } };\n }\n // The focus of each other axis is the position of a record, so a loop in a second print reads the packs there too.\n this.#pack?.foci.add(j);\n const s: string[] = [];\n let lo = \"0\";\n let hi = \"n\";\n let skip: string | undefined;\n // The targets of the axis all depend on no key, but its address can fail (V-051). The other axes start at their\n // address.\n let start: ReadonlySet<number> = NO_DEPS;\n const f = base.t === \"all\" && at.length === 0 ? undefined : this.fresh(\"f\");\n if (f !== undefined) {\n const values = this.#addressValues(at, ctx);\n start = this.#addressDeps(at, ctx, values);\n const parts = this.#addressParts(at, values, start);\n s.push(...stmtsOf(...parts), `const ${f} = ${this.#address(at, ctx, parts)};`);\n }\n const startSafe = at.every((m) => m.t === \"origin\");\n if (base.t === \"window\" && (!Number.isInteger(base.from) || !Number.isInteger(base.to))) throw new NotStandalone('the axis \"window\" with a bound that is not an integer');\n // The ancestors are a walk up the parents, with no array (COMPILE.MODULE.TREE.ALLOC). The reverse order needs the array.\n if (this.#tree && base.t === \"ancestors\" && !reverse) {\n const parts = { init: `P[${f as string}]`, cond: `${j} >= 0`, next: `${j} = P[${j}]` };\n return { s, j, head: forHead(j, parts), parts, key: [], check: [], checkSafe: true, skip: undefined, fixed: false, start, startSafe, tests, inner, texts: false, items: NO_NAMES, item: undefined };\n }\n // In a tree space, the targets of a tree axis and of a window are a range of an array of positions.\n if (this.#tree && isTreeAxis(base)) {\n const range = this.#treeRange(base, f as string);\n const q = this.fresh(\"q\");\n return { s: [...s, ...range.s], j, head: forHead(q, forParts(q, range.lo, range.hi, reverse)), parts: forParts(q, range.lo, range.hi, reverse), key: [`const ${j} = ${range.a}[${q}];`], check: [], checkSafe: true, skip: range.skip, fixed: false, start, startSafe, tests, inner, texts: false, items: NO_NAMES, item: undefined };\n }\n // In a graph space, the targets of an axis of a graph are an array of positions. A graph has no offsets and no tree.\n if (this.#graph && GRAPH_AXES.has(base.t)) {\n const range = this.#graphRange(base.t, f as string);\n const q = this.fresh(\"q\");\n return { s: [...s, ...range.s], j, head: forHead(q, forParts(q, range.lo, range.hi, reverse)), parts: forParts(q, range.lo, range.hi, reverse), key: [`const ${j} = ${range.a}[${q}];`], check: [], checkSafe: true, skip: undefined, fixed: false, start, startSafe, tests, inner, texts: false, items: NO_NAMES, item: undefined };\n }\n if (this.#graph && base.t === \"window\") throw new NotStandalone('the axis \"window\" in a graph space');\n if (base.t === \"others\") skip = f;\n else if (base.t === \"window\") {\n this.#noOffset();\n const h = this.fresh(\"h\");\n lo = `Math.max(0, ${f as string} + Math.max(${base.from}, -n))`;\n s.push(`const ${h} = Math.min(n, ${f as string} + Math.min(${base.to}, n) + 1);`);\n hi = h;\n } else if (base.t !== \"all\") throw new NotStandalone(`the axis \"${base.t}\"`);\n return { s, j, head: forHead(j, forParts(j, lo, hi, reverse)), parts: forParts(j, lo, hi, reverse), key: [], check: [], checkSafe: true, skip, fixed: f === undefined, start, startSafe, tests, inner, texts: false, items: NO_NAMES, item: undefined };\n }\n\n /**\n * This method binds the names `as` of a loop over the axis list (COMPILE.MODULE.LIST.ITEM). The statements come after\n * the check of the item, so an error item fails before they bind a name (AXIS.LIST.ITEM). The first name holds the\n * value of the item, with the facts of its list. The index counts the items with a value in the order of the list, as\n * `nth` does (AXIS.LIST.INDEX). In the reverse order, it counts down from the number of these items. The names have a\n * level of their own. Thus a part that reads them stays in the loop, and a key of a literal can still be a target.\n */\n #itemNames(as: ItemNames, info: ListInfo, value: string, count: () => string, reverse: boolean): { readonly s: readonly string[]; readonly check: readonly string[]; readonly items: ReadonlyMap<string, Name>; readonly level: number } {\n // A search cannot know the items of a name that starts empty. The part gives an empty list (COMPILE.MODULE.LOOP.EMPTY).\n if (this.#starts.seek && info.empty === true) throw new NotStandalone(\"a search reads the items of an empty list\");\n // Stryker disable next-line UpdateOperator: a level of a loop is a name, so a count down gives other names, and the same code\n const level = this.#loops++;\n const deps = new Set([level]);\n const [item, index] = as;\n const y = this.fresh(\"y\");\n const items = new Map<string, Name>([[item, { code: y, kind: info.item, lazy: false, deps, list: info.inner }]]);\n const check = [`const ${y} = ${value};`];\n const s: string[] = [];\n if (index !== undefined) {\n const i = this.fresh(\"i\");\n const z = this.fresh(\"z\");\n // The check before the index throws for an error item, so the count skips it.\n const total = count();\n s.push(`let ${z} = ${reverse ? total : \"0\"};`);\n check.push(`const ${i} = ${reverse ? `--${z}` : `${z}++`};`);\n items.set(index, { code: i, kind: \"number\", lazy: false, deps });\n }\n return { s, check, items, level };\n }\n\n /**\n * This method gives a reason when a part of a loop of the axis `list` reads at a target that is not a record. The\n * interpreter reads the record of such a key, and a module has no record for it.\n */\n #readsNoTarget(texts: boolean, level: number, deps: readonly ReadonlySet<number>[]): void {\n if (texts && deps.some((d) => d.has(level))) throw new NotStandalone('the axis \"list\" reads a record at a key of a literal or of \"fill\"');\n }\n\n /**\n * This method gives the targets of an axis of a graph space at the position `f` (AXIS.GRAPH). They are the positions\n * `a[q]` for `q` from `lo` up to `hi`. The first key of the search of `reachable` is the focus, which is not a target.\n */\n #graphRange(t: string, f: string): TreeRange {\n const a = this.fresh(\"A\");\n const range = (code: string, lo = \"0\"): TreeRange => ({ s: [`const ${a} = ${code};`], a, lo, hi: `${a}.length`, skip: undefined });\n if (t === \"successors\") return range(`GO[${f}]`);\n if (t === \"predecessors\") {\n this.into = true;\n return range(`GN[${f}]`);\n }\n return range(`${this.use(\"RB\")}(GO, ${f}, n)`, \"1\");\n }\n\n /**\n * This method gives the targets of an axis of a tree space at the position `f`. They are the positions `a[q]` for `q`\n * from `lo` up to `hi`, without the key that the loop skips. The axes come from AXIS.TREE, AXIS.GRAPH and AXIS.WINDOW.\n */\n #treeRange(base: TreeAxis, f: string): TreeRange {\n const a = this.fresh(\"A\");\n const all = (code: string, lo = \"0\", skip?: string): TreeRange => ({ s: [`const ${a} = ${code};`], a, lo, hi: `${a}.length`, skip });\n switch (base.t) {\n // In a tree, the edges go from a parent to its children.\n case \"children\":\n case \"successors\":\n return all(`${this.#part(\"children\", \"H\")}[${f}]`);\n case \"siblings\":\n return all(`${this.#part(\"siblings\", \"GP\")}[${f}]`, \"0\", f);\n case \"ancestors\":\n return all(`${this.use(\"AN\")}(P, ${f})`);\n case \"predecessors\":\n return all(`(P[${f}] < 0 ? [] : [P[${f}]])`);\n case \"reachable\":\n // The first key of the search is the focus, which is not a target.\n return all(`${this.use(\"BF\")}(${this.#part(\"children\", \"H\")}, ${f})`, \"1\");\n case \"descendants\": {\n // The descendants of a key are the keys after it in the order depth first, as many as its subtree has under it.\n const h = this.fresh(\"h\");\n return { s: [`const ${a} = ${this.#part(\"order\", \"PI\")}[${f}] + 1;`, `const ${h} = ${a} + SZ[${f}] - 1;`], a: \"PO\", lo: a, hi: h, skip: undefined };\n }\n case \"window\": {\n // The offsets among the siblings, from `from` to `to`. The bounds are integers (#targetLoop).\n const { from, to } = base;\n const l = this.fresh(\"h\");\n const h = this.fresh(\"h\");\n const s = [`const ${a} = ${this.#part(\"siblings\", \"GP\")}[${f}];`, `const ${l} = Math.max(0, SI[${f}] + ${String(from)});`, `const ${h} = Math.min(${a}.length, SI[${f}] + ${String(to)} + 1);`];\n return { s, a, lo: l, hi: h, skip: undefined };\n }\n }\n }\n\n #list(op: string, target: ExprOf<\"each\">, rest: readonly Expr[], ctx: Ctx): Code {\n const { strict, step } = this.#foldOptions(op, rest);\n const at = target.at ?? [];\n const { s, j, head, key, check, checkSafe, skip, fixed, start, startSafe, tests, inner, texts, items, item: own } = this.#targetLoop(target.axis, at, ctx, target.as);\n const { level } = inner;\n // Inside the loop, a constant of the run evaluates once, before the loop over the keys of the run. The tests do not\n // see the names of the items, and the body sees them (AXIS.LIST.SCOPE).\n const testCodes = tests.map((t) => this.#hoist(this.expr(t, inner), hasLoop(t)));\n const body = this.#hoist(this.expr(target.body, { ...inner, env: withNames(inner.env, items) }), hasLoop(target.body));\n this.#readsNoTarget(texts, level, [body, ...testCodes].map((x) => x.v.deps));\n // A count of all the items, whose body cannot fail, is the count of the records. A safe body covers its statements.\n // V-063: a body that reads a cell keeps its loop. The search of the run must see each read, so a cell that reads\n // itself gives `#CYCLE!`.\n if (op === \"count\" && fixed && tests.length === 0 && body.v.safe && !body.v.deps.has(CELLS)) return bare(plainValue(\"n\", \"number\"));\n const deps = new Set([...start, ...[body, ...testCodes].flatMap((x) => [...x.v.deps])].filter((d) => d !== level && d !== own));\n const r = this.#reduction(op, body.v.kind, step);\n const { v } = r;\n s.push(r.init);\n const item = [...check, ...testCodes.flatMap((t) => [...t.s, `if (!${this.#boolean(t.v)}) continue;`]), ...body.s];\n // An item whose tests and body cannot fail needs no try.\n const safeItem = checkSafe && body.v.safe && testCodes.every((t) => this.#safeBoolean(t.v));\n // The interpreter evaluates each item before the list op (COMPILE.MODULE.SHEET). When an item reads a cell, an error\n // of an item or of a step must not stop the reads of the next items. So the items go into an array first.\n if ([body, ...testCodes].some((x) => x.v.deps.has(CELLS)) && (strict || stepThrows(op, body.v.kind))) {\n const list = this.fresh(\"L\");\n const x = this.fresh(\"x\");\n const all = [...key, ...(skip === undefined ? [] : [`if (${j} === ${skip}) continue;`]), `let ${x};`, \"try {\", ...ind(item), ` ${x} = ${body.v.code};`, \"} catch {\", ` ${x} = E;`, \"}\", `${list}.push(${x});`];\n const reduce = [`for (const ${v} of ${list}) {`, ` if (${v} === E) ${strict ? `${this.use(\"F\")}();` : \"continue;\"}`, ` ${r.step}`, \"}\"];\n return { s: [...s, `const ${list} = [];`, head, ...ind(all), \"}\", ...reduce], v: { code: r.result, kind: r.kind, safe: false, deps } };\n }\n // A sum over all the records whose term reads columns of the run can read their packs (`#packed`).\n const packed = fixed && tests.length === 0 && testsOf(target.axis).base.t === \"all\" ? this.#packed(op, step, strict, target, inner, body, r) : undefined;\n if (packed !== undefined) return { s: [...s, ...packed], v: { code: r.result, kind: r.kind, safe: false, deps } };\n const loop = [\n ...key,\n ...(skip === undefined ? [] : [`if (${j} === ${skip}) continue;`]),\n ...(safeItem\n ? [...item, `const ${v} = ${body.v.code};`]\n : [`let ${v};`, \"try {\", ...ind(item), ` ${v} = ${body.v.code};`, \"} catch {\", strict ? ` ${this.use(\"F\")}();` : \" continue;\", \"}\"]),\n r.step,\n ];\n s.push(head, ...ind(loop), \"}\");\n // A count without strict, and any, all and none over booleans without strict, cannot fail. The address of the axis\n // can fail, except at the focus or at the origin.\n const safe = startSafe && !strict && (op === \"count\" || (BOOLEAN_LIST_OPS.has(op) && body.v.kind === \"boolean\"));\n return { s, v: { code: r.result, kind: r.kind, safe, deps } };\n }\n\n /**\n * This method gives the fast loop of a sum, a mean, a min or a max over all the records, or undefined. The term must\n * be a number that reads values of the record only through columns of the run. It must have no loop, no cell and no\n * function of its own. Then the term prints again, with the body of each call at the place of the call (`#inline`).\n * Each read of a column at the item reads the pack of the column: an array of its values. The first sum of a run\n * makes it. The pack holds the sentinel for an error value, as the column does. Thus each read gives the value of the\n * column. One try covers all the items. An item that throws stops the inner loop, and the outer loop continues after\n * that item. The step comes after the value of the item, and it cannot throw.\n */\n #packed(op: string, step: Step | undefined, strict: boolean, target: ExprOf<\"each\">, inner: Ctx, body: Code, r: { readonly v: string; readonly step: string }): string[] | undefined {\n if (this.#pack !== undefined || !PACK_OPS.has(op) || step !== undefined || body.v.kind !== \"number\") return undefined;\n if (!this.#packable(target.body, inner.fns, new Set()) || !this.#reaches(body)) return undefined;\n const j = inner.focus as string;\n const pack: Pack = { foci: new Set([j]), calls: false, cols: new Map(), locals: new Set(), inlines: 0 };\n const scopes = this.#scopes.length;\n const outer = this.#inside;\n this.#pack = pack;\n let second: Code;\n try {\n second = this.expr(target.body, inner);\n } catch (err) {\n if (!(err instanceof NoPack || err instanceof NotStandalone)) throw err;\n this.#scopes.length = scopes;\n this.#inside = outer;\n return undefined;\n } finally {\n this.#pack = undefined;\n }\n // A part of the term that is a column reads its pack, so the packs that the code of that part read are not in the term.\n const text = [second.v.code, ...second.s].join(\"\\n\");\n const used = [...pack.cols].filter(([, local]) => text.includes(`${local}[`));\n if (used.length === 0) return undefined;\n // Each other read of the item is a value that no column holds, so the term keeps its first code.\n const rest = text.replaceAll(new RegExp(String.raw`\\b(?:${used.map(([, local]) => local).join(\"|\")})\\[${j}\\]`, \"g\"), \"\");\n if (new RegExp(String.raw`\\b${j}\\b`).test(rest)) return undefined;\n const lets = this.#packLets(used);\n const items = [...second.s, `const ${r.v} = ${second.v.code};`, r.step];\n const head = `for (let ${j} = 0; ${j} < n; ${j}++) {`;\n if (strict) return [...lets, \"try {\", ...ind([head, ...ind(items), \"}\"]), \"} catch {\", ` ${this.use(\"F\")}();`, \"}\"];\n return [...lets, head, ...ind([\"try {\", ...ind([`for (; ${j} < n; ${j}++) {`, ...ind(items), \"}\"]), \"} catch {}\"]), \"}\"];\n }\n\n /**\n * This method gives the statements that read the packs of some columns before a loop. Each pair has a column and its\n * local name. The first loop that reads a pack makes it. The variable of the pack of a column of the run is in the\n * run. The variable of the pack of a column of a call is in the function of the call.\n */\n #packLets(used: readonly (readonly [string, string])[]): string[] {\n return used.map(([col, local]) => {\n let name = this.#packs.get(col);\n if (name === undefined) {\n name = this.fresh(\"PK\");\n this.#packs.set(col, name);\n (this.#callColumns.get(col)?.scope.decls ?? this.run).push(`let ${name};`);\n }\n return `const ${local} = ${name} || (${name} = ${this.use(\"QA\")}(n, ${col}));`;\n });\n }\n\n /**\n * This method tells if the term of a fast sum can print at the place of its loop (`#packed`). It has no loop, no cell,\n * no node of the memo and no function of its own. Each function that it calls is at the start of a run, and its body\n * is such a term too. A part that is a column is one read, so the parts in it do not count.\n */\n #packable(e: Expr, fns: ReadonlyMap<string, BoundFn>, seen: Set<number>): boolean {\n if (this.#columned.has(e)) return true;\n if (e.tag === \"each\" || e.tag === \"fold\" || e.tag === \"iterate\" || e.tag === \"fix\" || e.tag === \"ext\" || this.#memo.has(e)) return false;\n if (e.tag === \"let\" && Object.values(e.bind).some((x) => x.tag === \"fn\")) return false;\n if (e.tag === \"call\") {\n const bound = fns.get(e.fn);\n if (bound === undefined || bound.local) return false;\n if (!seen.has(bound.id)) {\n seen.add(bound.id);\n if (!this.#packable(bound.fn.body, bound.ctx.fns, seen)) return false;\n }\n }\n return children(e).every((x) => this.#packable(x, fns, seen));\n }\n\n /** This method tells if code reads a column of the run, itself or in a printed function that it calls. */\n #reaches(c: Code): boolean {\n const seen = new Set<string>();\n const todo = [[c.v.code, ...c.s].join(\"\\n\")];\n for (let text = todo.pop(); text !== undefined; text = todo.pop()) {\n for (const [name] of text.matchAll(/\\b(?:col|fn)\\d+\\b/g)) {\n if (this.#runColumns.has(name)) return true;\n const code = this.#specCode.get(name);\n if (code !== undefined && !seen.has(name)) {\n seen.add(name);\n todo.push(code);\n }\n }\n }\n return false;\n }\n\n /**\n * This method gives the parts of a list op that reduces the values of its items. The parts are the variable `v` of\n * the value of an item, the first statement, the step and the result. A value of the wrong kind is an error of the op.\n */\n #reduction(op: string, kind: Kind | undefined, step?: Step): { readonly v: string; readonly init: string; readonly step: string; readonly result: string; readonly kind: Kind | undefined } {\n const a = this.fresh(\"a\");\n const n = this.fresh(\"n\");\n const v = this.fresh(\"x\");\n if (step !== undefined) return { v, init: `let ${a}, ${n} = 0;`, ...this.#reduceStep(step, kind, a, n, v) };\n const num = kind === \"number\" ? v : `${this.use(\"U\")}(${v})`;\n const bool = kind === \"boolean\" ? v : `${this.use(\"B\")}(${v})`;\n const inits: Readonly<Record<string, string>> = {\n count: `let ${n} = 0;`,\n sum: `let ${a} = 0;`,\n mean: `let ${a} = 0, ${n} = 0;`,\n any: `let ${a} = false;`,\n none: `let ${a} = false;`,\n all: `let ${a} = true;`,\n };\n const steps: Readonly<Record<string, string>> = {\n count: `${n}++;`,\n sum: `${a} += ${num};`,\n mean: `${a} += ${num}; ${n}++;`,\n min: `${a} = ${n}++ === 0 ? ${num} : Math.min(${a}, ${num});`,\n max: `${a} = ${n}++ === 0 ? ${num} : Math.max(${a}, ${num});`,\n any: `if (${bool}) ${a} = true;`,\n none: `if (${bool}) ${a} = true;`,\n all: `if (!${bool}) ${a} = false;`,\n first: `if (${n}++ === 0) ${a} = ${v};`,\n };\n const F = this.use(\"F\");\n const results: Readonly<Record<string, string>> = {\n count: n,\n sum: this.#checked(\"number\", a),\n mean: `(${n} === 0 ? ${F}() : ${this.#checked(\"number\", `${a} / ${n}`)})`,\n any: a,\n all: a,\n none: `!${a}`,\n };\n return { v, init: inits[op] ?? `let ${a}, ${n} = 0;`, step: steps[op] as string, result: results[op] ?? `(${n} === 0 ? ${F}() : ${a})`, kind: listKind(op, kind) };\n }\n\n /**\n * This method gives the step and the result of `reduce` (COMPILE.MODULE.REDUCE), as in the interpreter. The first item\n * is the first running value. Each later item goes into the op of the domain of the running value. The kinds of the\n * items decide that op, and the op must give a value of the same kind. No items give the identity of the op.\n */\n #reduceStep(step: Step, kind: Kind | undefined, a: string, n: string, v: string): { readonly step: string; readonly result: string; readonly kind: Kind | undefined } {\n const arg = (code: string): Code => bare({ code, kind, safe: true, deps: NO_DEPS, plain: true });\n const opCode = this.#opCall(step.op, [arg(a), arg(v)], NO_DEPS);\n if (opCode.v.kind !== kind) throw new NotStandalone(`the op \"${step.op}\" of \"reduce\" gives a value of the kind ${kindText(opCode.v.kind)}, not of the kind ${kindText(kind)} of the items`);\n const empty = this.#identity(step);\n // The identity of another domain is a value of another kind, so the kind of the result is not known.\n return { step: `${a} = ${n}++ === 0 ? ${v} : ${opCode.v.code};`, result: `(${n} === 0 ? ${empty.code} : ${a})`, kind: empty.kind === undefined || empty.kind === kind ? kind : undefined };\n }\n\n /**\n * This method gives the code of `reduce` over no items, as in the interpreter. The code is the identity of the op in\n * the one domain that has one, or in the domain of the option `domain`. Another case is an error. The kind is the kind\n * of the domain.\n */\n #identity(step: Step): { readonly code: string; readonly kind: Kind | undefined } {\n const { op, domain } = step;\n const fail = { code: `${this.use(\"F\")}()`, kind: undefined };\n // A name of a domain that the program does not have leaves no domain, so it gives the error too.\n const found = [...this.#domains.entries()].filter(([, d]) => Object.hasOwn(d.ops, op) && (d.ops[op] as { readonly identity?: unknown }).identity !== undefined && (domain === undefined || d.name === domain));\n const [only, second] = found;\n if (only === undefined || second !== undefined) return fail;\n const [i, d] = only;\n const name = `id_${String(i)}_${String(this.#opIndex(op))}`;\n // Stryker disable next-line ConditionalExpression: the copy of an identity is always the same, so the test only saves time\n if (!this.top.has(name)) this.#copy(name, copied((d.ops[op] as { readonly identity: () => unknown }).identity, [], `the identity of the op \"${op}\" of the domain ${d.name}`));\n return { code: `${name}()`, kind: kindOfDomain(d) };\n }\n\n /**\n * This method prints a list as an array (LIST.VALUE): a pair of the key and the value of each item. A test that\n * fails, a body that fails and an error item of the axis list give the error sentinel as the value.\n */\n #eachList(e: ExprOf<\"each\">, ctx: Ctx): Code {\n const alias = this.#sameList(e, ctx);\n if (alias !== undefined) return alias;\n const at = e.at ?? [];\n const { s, j, head, key, check, checkSafe, skip, start, startSafe, tests, inner, texts, items, item: own } = this.#targetLoop(e.axis, at, ctx, e.as);\n const testCodes = tests.map((t) => this.#hoist(this.expr(t, inner), hasLoop(t)));\n // The value of an item can be a list, for flat (LIST.FLAT). The facts of the list tell it.\n if (this.#wantList.has(e)) this.#wantList.add(e.body);\n // Only the body sees the names of the items (AXIS.LIST.SCOPE).\n const body = this.#hoist(this.expr(e.body, { ...inner, env: withNames(inner.env, items) }), hasLoop(e.body));\n this.#readsNoTarget(texts, inner.level, [body, ...testCodes].map((x) => x.v.deps));\n const deps = new Set([...start, ...[body, ...testCodes].flatMap((x) => [...x.v.deps])].filter((d) => d !== inner.level && d !== own));\n const list = this.fresh(\"L\");\n const v = this.fresh(\"x\");\n const pair = this.#pairKey(j, texts);\n const item = [...check, ...testCodes.flatMap((t) => [...t.s, `if (!${this.#boolean(t.v)}) continue;`]), ...body.s];\n const safeItem = checkSafe && body.v.safe && testCodes.every((t) => this.#safeBoolean(t.v));\n const loop = [\n ...key,\n ...(skip === undefined ? [] : [`if (${j} === ${skip}) continue;`]),\n ...(safeItem ? [...item, `${list}.push([${pair}, ${body.v.code}]);`] : [`let ${v};`, \"try {\", ...ind(item), ` ${v} = ${body.v.code};`, \"} catch {\", ` ${v} = E;`, \"}\", `${list}.push([${pair}, ${v}]);`]),\n ];\n // Only the catch of an item puts the sentinel into the list, so a safe item gives a clean list.\n const facts: ListInfo = { item: body.v.kind, inner: heldList(body.v.list), texts, clean: safeItem };\n return { s: [...s, `const ${list} = [];`, head, ...ind(loop), \"}\"], v: { code: list, kind: undefined, safe: startSafe, deps, list: facts } };\n }\n\n /**\n * This method gives the code of an each that gives its list again (COMPILE.MODULE.EACH.SAME), and undefined for each\n * other each. The axis is `list`, with no `where`, no `reverse` and no address. The body is a read of the name of the\n * item. Such an each gives the key and the value of each item, and an error item stays an error item. Thus its value\n * is the array of its list, with no copy. The option `fuse` must be true.\n *\n * The value is not fresh, because the list holds the same array. Thus no op changes the array in place: an append\n * copies it, and `sortBy` sorts a copy.\n */\n #sameList(e: ExprOf<\"each\">, ctx: Ctx): Code | undefined {\n // The check of the document refuses two names `as` that are the same name, so the body reads the value of the item.\n if (!this.#fuse || e.axis.t !== \"list\" || (e.at ?? []).length > 0 || e.body.tag !== \"var\" || e.body.name !== e.as?.[0]) return undefined;\n const list = this.#hoist(this.#listOf(e.axis.list, ctx), hasLoop(e.axis.list));\n const info = list.v.list as ListInfo;\n // A search cannot know the items of a name that starts empty, as for each other read of the items (#itemNames).\n if (this.#starts.seek && info.empty === true) throw new NotStandalone(\"a search reads the items of an empty list\");\n // The facts are the facts of the each of the loop: its items keep the facts of the items of the list. A list of\n // lists holds each list of its items, so the facts of an item are not fresh.\n const facts: ListInfo = { item: info.item, inner: info.inner, texts: info.texts === true, clean: this.#clean(info) };\n return { s: list.s, v: { ...list.v, list: facts } };\n }\n\n /**\n * This method gives the option strict of `flat` over the each `e` when the two ops fuse (COMPILE.MODULE.FUSE), and\n * undefined when they do not fuse. The option `fuse` must be true, and the body of the each must give a list. The\n * code reads a node of the memo again. It also reads a constant of the run that the module printed before. Thus these\n * nodes do not fuse. Options that are not a literal give the reason of `flat`, so they do not fuse either.\n */\n #fusedStrict(e: ExprOf<\"each\">, rest: readonly Expr[], ctx: Ctx): boolean | undefined {\n if (!this.#fuse || this.#memo.has(e) || ctx.keys.has(e) || this.#constant.has(originalOf(e)) || !this.#bodyList(e, ctx)) return undefined;\n try {\n return this.#strict(\"flat\", rest);\n } catch {\n return undefined;\n }\n }\n\n /**\n * This method prints `flat` over an each as one loop with one output array (COMPILE.MODULE.FUSE). The body pushes the\n * items of its list into the output. Thus the each has no array of its own, and `FL` and `V` do not scan a list.\n *\n * - The loop keeps the length of the output before each item. An item that fails sets the length back, so it adds no\n * item (COMPILE.MODULE.FUSE.ITEM). With `strict`, the failure is the error of `flat`.\n * - An error item of the source fails at the check of the item, as in the each without fusion.\n * - When an item reads a cell, a strict failure does not stop the loop. The search of the run must see each read, as\n * in the loop of an aggregate. Thus a flag holds the failure until the end of the loop.\n *\n * The output has only items with values, and no other part holds its array, so it is clean and fresh.\n *\n * With `owner`, the each is a filter of the list of the owner (COMPILE.MODULE.APPEND.KEEP). When the list is the array\n * `w` of the owner, that array is the output. The loop then moves each kept item down in place, and `KS` sets the\n * length. Each other list gets a new output. This output is not fresh, because the loop can hold it.\n */\n #flatEach(e: ExprOf<\"each\">, strict: boolean, ctx: Ctx, owner?: Owner): Code {\n const { s, j, head, key, check, checkSafe, skip, start, startSafe, tests, inner, texts, items, item: own, array } = this.#targetLoop(e.axis, e.at ?? [], ctx, e.as);\n const testCodes = tests.map((t) => this.#hoist(this.expr(t, inner), hasLoop(t)));\n const o = this.fresh(\"o\");\n // The axis of a filter is the axis list of the name of the owner, so the loop goes over an array.\n const place = owner !== undefined && array !== undefined ? { w: (owner.w ??= this.fresh(\"w\")), n: this.fresh(\"n\"), a: array.a } : undefined;\n if (place !== undefined) this.#sinks.set(o, { n: place.n, pair: (array as { readonly pair: string }).pair, item: e.as === undefined ? undefined : items.get(e.as[0])?.code });\n // Only the body sees the names of the items (AXIS.LIST.SCOPE).\n let body: Pushed;\n try {\n body = this.#push(e.body, { ...inner, env: withNames(inner.env, items) }, o, strict);\n } finally {\n this.#sinks.delete(o);\n }\n const parts = [body.deps, ...testCodes.map((x) => x.v.deps)];\n this.#readsNoTarget(texts, inner.level, parts);\n const deps = new Set([...start, ...parts.flatMap((d) => [...d])].filter((d) => d !== inner.level && d !== own));\n const item = [...testCodes.flatMap((t) => [...t.s, `if (!${this.#boolean(t.v)}) continue;`]), ...body.s];\n const safeItem = checkSafe && body.safe && testCodes.every((t) => this.#safeBoolean(t.v));\n // The output keeps the key of each item of the body. Thus the loop needs the key of its target only for a read at\n // the target, or for the target that the axis skips.\n const at = new RegExp(String.raw`\\b${j}\\b`);\n const skips = skip === undefined ? [] : [`if (${j} === ${skip}) continue;`];\n const lead = [...([...skips, ...item].some((x) => at.test(x)) ? key : []), ...skips];\n const flag = strict && !safeItem && parts.some((d) => d.has(CELLS)) ? this.fresh(\"f\") : undefined;\n let loop: string[];\n if (safeItem) loop = [...lead, ...check, ...item];\n else {\n // An item of a filter in place puts at most one item, at its end. Thus an item that fails puts no item.\n const m = strict || place !== undefined ? undefined : this.fresh(\"m\");\n const caught = flag !== undefined ? [`${flag} = true;`] : strict ? [`${this.use(\"F\")}();`] : m === undefined ? [] : [`${o}.length = ${m};`];\n // A check that cannot throw comes before the try.\n const [before, inside] = checkSafe ? [check, item] : [[], [...check, ...item]];\n loop = [...lead, ...before, ...(m === undefined ? [] : [`const ${m} = ${o}.length;`]), \"try {\", ...ind(inside), \"} catch {\", ...ind(caught), \"}\"];\n }\n // The output of a filter in place is the array of the list only when that array is w (COMPILE.MODULE.APPEND.KEEP).\n const first = place === undefined ? [`const ${o} = [];`] : [`const ${o} = ${place.a} === ${place.w} ? ${place.a} : [];`, `let ${place.n} = 0;`];\n const last = place === undefined ? [] : [`${this.use(\"KS\")}(${o}, ${place.n});`];\n const out = [...s, ...first, ...(flag === undefined ? [] : [`let ${flag} = false;`]), head, ...ind(loop), \"}\", ...last, ...(flag === undefined ? [] : [`if (${flag}) ${this.use(\"F\")}();`])];\n const facts: ListInfo = { ...(body.list as ListInfo), clean: true, fresh: place === undefined };\n const c: Code = { s: out, v: { code: o, kind: undefined, safe: startSafe && (safeItem || !strict), deps, list: facts } };\n // A fused loop around a filter in place cannot push into its output, because the output can be the array w.\n // Stryker disable next-line ConditionalExpression: a filter in place is a branch of a step, and no fused loop pushes it\n if (place === undefined) this.#outputs.set(c, s.length);\n return c;\n }\n\n /**\n * This method gives the owner of the filter `e` when the filter compacts the array of the owner in place\n * (COMPILE.MODULE.APPEND.KEEP). For each other node, it gives undefined. `#loopStep` finds the filter in a branch of\n * another list. Each place of the program has an object of its own (`unsharedAll`), so the node is at that branch\n * only. Each item of the body gives at most one item.\n */\n #keepOwner(e: ExprOf<\"app\">): Owner | undefined {\n const owner = this.#keeps.get(e);\n return owner !== undefined && atMostOne((e.args[0] as ExprOf<\"each\">).body, this.#facts.own(\"fill\")) ? owner : undefined;\n }\n\n /**\n * This method gives the option strict of the append `e` for a fused chain (COMPILE.MODULE.FUSE). This method gives\n * undefined when the append cannot be a part of a chain. The option `fuse` must be true, both arguments must be lists, and the options must be\n * a literal. An append into the list of its name keeps `AO` (COMPILE.MODULE.APPEND.OWN). In a sheet with a search, an\n * append that can read a cell does not fuse, because the fused chain stops at the first failure.\n */\n #appendStrict(e: ExprOf<\"app\">, ctx: Ctx): boolean | undefined {\n const [a, b] = e.args;\n if (!this.#fuse || a === undefined || b === undefined || this.#own.has(e) || !this.#isList(a, ctx) || !this.#isList(b, ctx)) return undefined;\n if (this.#sheet !== undefined && !this.#sheet.direct && readsCells(e)) return undefined;\n try {\n return this.#strict(\"append\", e.args.slice(2));\n } catch {\n return undefined;\n }\n }\n\n /** This method gives the node `e` when a fused loop can print it as a stage, and undefined when the loop reads its array. */\n #stageOf(e: Expr, ctx: Ctx): ExprOf<\"app\"> | undefined {\n return e.tag === \"app\" && !this.#memo.has(e) && !ctx.keys.has(e) && !this.#constant.has(originalOf(e)) && (this.#work(e, ctx.fns) < COLUMN_WORK || !readsFocus(e)) ? e : undefined;\n }\n\n /**\n * This method gives the option strict of the append `e` when it is a link of a fused chain, and undefined when it is\n * not. A node of the memo, a key of a column and a constant of the run keep their arrays, because other parts read them.\n */\n #link(e: Expr, ctx: Ctx): boolean | undefined {\n if (e.tag !== \"app\" || e.op !== \"append\" || this.#memo.has(e) || ctx.keys.has(e) || this.#constant.has(originalOf(e))) return undefined;\n return this.#appendStrict(e, ctx);\n }\n\n /**\n * This method tells if a part of an append pushes its items with no array of its own (COMPILE.MODULE.FUSE). These\n * parts are `fill(1, v)`, `flat` over an each that fuses, and an append or an `if` with such a part. An append of two\n * arrays keeps `concat`, because a loop that copies the items costs more. A `flat` and an append print their own\n * loops, so they need no test of a stage.\n */\n #pushes(e: Expr, ctx: Ctx): boolean {\n if (e.tag !== \"app\" || this.#memo.has(e) || ctx.keys.has(e) || this.#constant.has(originalOf(e))) return false;\n const [head, ...rest] = e.args;\n if (e.op === \"flat\") return head?.tag === \"each\" && this.#fusedStrict(head, rest, ctx) !== undefined;\n if (e.op === \"append\") return this.#link(e, ctx) !== undefined && e.args.slice(0, 2).some((x) => this.#pushes(x, ctx));\n if (this.#stageOf(e, ctx) === undefined) return false;\n if (e.op === \"fill\") return rest.length === 1 && isOne(head) && this.#facts.own(\"fill\");\n return e.op === \"if\" && rest.length === 2 && rest.every((x) => this.#isList(x, ctx)) && rest.some((x) => this.#pushes(x, ctx));\n }\n\n /**\n * This method prints a chain of append as one output array (COMPILE.MODULE.FUSE). Each part pushes its items into the\n * output, in order. A part that fails is the error of the chain, as the error of a list is the error of append. The\n * output has only items with values, and no other part holds its array, so it is clean and fresh.\n */\n #appendChain(e: ExprOf<\"app\">, strict: boolean, ctx: Ctx): Code {\n const o = this.fresh(\"o\");\n const parts = this.#pushAppend(e, strict, ctx, o);\n const c: Code = { s: [`const ${o} = [];`, ...parts.s], v: { code: o, kind: undefined, safe: parts.safe, deps: parts.deps, list: { ...(parts.list as ListInfo), clean: true, fresh: true } } };\n this.#outputs.set(c, 0);\n return c;\n }\n\n /**\n * This method prints the statements that push the items of the lists of an append into the output `o`, in order. An\n * append that is a stage gives the parts of its lists. The option `strict` of each append applies to the error items of\n * its lists (LIST.BUILD).\n *\n * Each part prints before the decision about the constants of the run. A chain that is a constant of the run keeps its\n * parts in its own code, because the module evaluates the chain once. In each other chain, and with `settle`, a part\n * that is a constant of the run evaluates once, before the loop over the keys.\n */\n #pushAppend(e: ExprOf<\"app\">, strict: boolean, ctx: Ctx, o: string, settle?: boolean): Pushed {\n const lists: { readonly e: Expr; readonly strict: boolean }[] = [];\n const walk = (x: Expr, s: boolean): void => {\n const joined = this.#link(x, ctx);\n if (joined === undefined) lists.push({ e: x, strict: s });\n else for (const y of (x as ExprOf<\"app\">).args.slice(0, 2)) walk(y, joined);\n };\n for (const x of e.args.slice(0, 2)) walk(x, strict);\n const parts = lists.map((x) => this.#pushPart(x.e, ctx, o, x.strict));\n const deps = new Set(parts.flatMap((x) => [...x.deps]));\n const now = settle ?? deps.size > 0;\n const list = parts.map((x) => x.list as ListInfo).reduce((a, b) => joinLists(a, b, \"append\"));\n return { s: parts.flatMap((x) => x.s(now)), deps, safe: parts.every((x) => x.safe), list };\n }\n\n /**\n * This method prints the statements that push the items of the list of `e` into the output `o` of a fused loop\n * (COMPILE.MODULE.FUSE). The forms of a stage are these:\n *\n * - `if` with two lists pushes the items of the branch that its condition selects.\n * - `fill(1, x)` pushes one item with the key 0, as `FI` gives it.\n * - The empty literal pushes no item.\n * - `append` pushes the items of its first list, then the items of its second list.\n *\n * Each other list prints its array, and a loop pushes its items (`#pushPart`).\n */\n #push(e: Expr, ctx: Ctx, o: string, strict: boolean): Pushed {\n const joined = this.#link(e, ctx);\n if (joined !== undefined) return this.#pushAppend(e as ExprOf<\"app\">, joined, ctx, o, true);\n const stage = this.#stageOf(e, ctx);\n if (stage?.op === \"if\" && stage.args.length === 3 && stage.args.slice(1).every((x) => this.#isList(x, ctx))) {\n const [c, a, b] = stage.args as [Expr, Expr, Expr];\n // The condition evaluates once for each run when it is a constant of the run.\n const cond = this.#hoist(this.expr(c, ctx), hasLoop(c));\n const yes = this.#push(a, ctx, o, strict);\n const no = this.#push(b, ctx, o, strict);\n // A branch that pushes nothing prints no block.\n const s = [...cond.s, `if (${this.#boolean(cond.v)}) {`, ...ind(yes.s), ...(no.s.length === 0 ? [] : [\"} else {\", ...ind(no.s)]), \"}\"];\n return { s, deps: new Set([...cond.v.deps, ...yes.deps, ...no.deps]), safe: this.#safeBoolean(cond.v) && yes.safe && no.safe, list: branchLists(\"if\", yes.list, no.list) };\n }\n const part = this.#pushPart(e, ctx, o, strict);\n return { ...part, s: part.s(true) };\n }\n\n /**\n * This method prints a part of a fused loop that is not `if` or `append`: `fill(1, x)`, the empty literal or a list.\n * The code of the part comes from `s`. With `settle`, a part that is a constant of the run evaluates once.\n *\n * A list prints its array, and a loop pushes its items. A list that is not clean can hold error items. The loop skips\n * them, and with `strict` such an item is an error.\n *\n * A node of the memo also prints its array. So does a constant of the\n * run that the module printed before, and a node that can be a column of the run. Thus the module keeps these values\n * for each read. A fused loop that the module does not keep pushes into `o` itself.\n */\n #pushPart(e: Expr, ctx: Ctx, o: string, strict: boolean): Part {\n const stage = this.#stageOf(e, ctx);\n if (stage?.op === \"fill\" && stage.args.length === 2 && isOne(stage.args[0]) && this.#facts.own(\"fill\")) {\n const x = stage.args[1] as Expr;\n // The value can be a list, so fill gives a list of lists (COMPILE.MODULE.FILL).\n this.#wantList.add(x);\n const raw = this.expr(x, ctx);\n const list: ListInfo = { item: raw.v.kind, inner: heldList(raw.v.list), texts: true };\n const s = (settle: boolean): readonly string[] => {\n const value = settle ? this.#hoist(raw, hasLoop(x)) : raw;\n return [...value.s, this.#put(o, `[0, ${value.v.code}]`, value.v)];\n };\n return { s, deps: raw.v.deps, safe: raw.v.safe, list };\n }\n if (e.tag === \"lit\" && isVexList(e.value) && e.value.items.length === 0) {\n const empty = this.#listLiteral(e.value);\n // A literal is a constant of the module, as at each other place, so its facts tell that each run reads it.\n this.#note(e, empty, true);\n return { s: () => [], deps: NO_DEPS, safe: true, list: empty.v.list };\n }\n const raw = this.#listOf(e, ctx);\n // A `fill` that gives no items pushes nothing (COMPILE.MODULE.SIZE.FILL).\n if (raw.v.code === \"[]\") return { s: () => [], deps: raw.v.deps, safe: true, list: raw.v.list };\n const clean = this.#clean(raw.v.list);\n const s = (settle: boolean): readonly string[] => {\n const c = settle ? this.#hoist(raw, hasLoop(e)) : raw;\n // The output of a fused loop has only items with values, so the loop can push into `o` in place of its own output.\n // A filter in place puts each item at its position, so it keeps the output of the part (COMPILE.MODULE.APPEND.KEEP).\n const at = this.#outputs.get(c);\n // Stryker disable next-line ConditionalExpression: atMostOne gives no fused loop in the body of a filter in place\n if (at !== undefined && !this.#sinks.has(o)) return c.s.map((x, i) => (i === at ? `const ${c.v.code} = ${o};` : x));\n const z = this.fresh(\"z\");\n const put = this.#put(o, `${z}[i]`);\n const each = clean ? put : strict ? `{ if (${z}[i][1] === E) ${this.use(\"F\")}(); ${put} }` : `if (${z}[i][1] !== E) ${put}`;\n return [...c.s, `const ${z} = ${c.v.code};`, `for (let i = 0; i < ${z}.length; i++) ${each}`];\n };\n return { s, deps: raw.v.deps, safe: raw.v.safe && (clean || !strict), list: raw.v.list };\n }\n\n /**\n * This method gives the statement that puts the pair `pair` into the output `o` of a fused loop. `value` is the value\n * of a pair of `fill`. A filter in place puts the pair at the next position of its output (COMPILE.MODULE.APPEND.KEEP).\n * There the item of the list keeps its pair when its key is 0, the key of `fill`. Each other output gets a push.\n */\n #put(o: string, pair: string, value?: { readonly code: string; readonly safe: boolean }): string {\n const sink = this.#sinks.get(o);\n if (sink === undefined) return `${o}.push(${pair});`;\n if (value !== undefined && value.code === sink.item) return `${o}[${sink.n}++] = ${sink.pair}[0] === 0 ? ${sink.pair} : ${pair};`;\n // JavaScript increments n before it gets the value of the pair. Thus a value that can fail increments n after the put.\n return value === undefined || value.safe ? `${o}[${sink.n}++] = ${pair};` : `${o}[${sink.n}] = ${pair}; ${sink.n}++;`;\n }\n\n /**\n * This method prints sortBy, take and drop (LIST.SORT, LIST.TAKE, LIST.DROP): a new array from the array of a list. An\n * error item is not in the new list, and with strict it is the error of the op.\n */\n #order(op: \"sortBy\" | \"take\" | \"drop\", head: Expr, rest: readonly Expr[], ctx: Ctx): Code {\n const list = this.#listOf(head, ctx);\n // A missing count is the literal null, which is not a whole number, so take and drop give their error.\n const exprs = [head, ...(op === \"sortBy\" ? [] : [rest[0] ?? lit(null)])];\n const options = rest.slice(exprs.length - 1);\n const strict = this.#strict(op, options, op === \"sortBy\" ? [\"strict\", \"by\"] : [\"strict\"]);\n const by = op === \"sortBy\" ? this.#sortValue(options, list.v.list as ListInfo) : undefined;\n const raw = [list, ...exprs.slice(1).map((x) => this.expr(x, ctx))];\n const deps = depsOf(...raw);\n const parts = this.#inOrder(this.#settle(raw, deps, exprs), true);\n const plain = by !== undefined ? \"SK\" : op === \"sortBy\" ? \"SB\" : op === \"take\" ? \"TK\" : \"DR\";\n // The clean form has no scan of V and no option strict (COMPILE.MODULE.FUSE.CLEAN).\n const clean = this.#clean(list.v.list);\n // sortBy is the sink of a chain: a clean list that is fresh is its own sort buffer (COMPILE.MODULE.FUSE).\n const inPlace = op === \"sortBy\" && clean && list.v.list?.fresh === true;\n const helper = inPlace ? (by === undefined ? \"SBI\" : \"SKI\") : clean ? (`${plain}C` as const) : plain;\n const args = [...parts.map((x) => x.v.code), ...(clean ? [] : [String(strict)]), ...(by === undefined ? [] : [by])];\n // The new list has some items of the list, so it keeps the facts of the list. V removes each error item. A sort in\n // place gives the array of its list, which no other part holds.\n const facts: ListInfo = { ...(list.v.list as ListInfo), clean: true, fresh: inPlace };\n return { s: stmtsOf(...parts), v: { code: `${this.use(helper)}(${args.join(\", \")})`, kind: undefined, safe: false, deps, list: facts } };\n }\n\n /**\n * This method prints `setNth` (LIST.SETNTH, COMPILE.MODULE.SETNTH): a new array with a new value at a position. An\n * error item is not in the new list, and with strict it is the error of the op. The value can be a list, as for `fill`.\n */\n #setNth(head: Expr, rest: readonly Expr[], ctx: Ctx): Code {\n const [position, value, ...options] = rest;\n // Without a position or a value the op gives an error at each run, so a module refuses the program.\n if (position === undefined || value === undefined) throw new NotStandalone('\"setNth\" without a position and a value');\n const strict = this.#strict(\"setNth\", options);\n const list = this.#listOf(head, ctx);\n this.#wantList.add(value);\n const raw = [list, this.expr(position, ctx), this.expr(value, ctx)];\n const deps = depsOf(...raw);\n const [from, at, put] = this.#inOrder(this.#settle(raw, deps, [head, position, value]), true) as [Code, Code, Code];\n const info = list.v.list as ListInfo;\n // The clean form has no scan of V and no option strict (COMPILE.MODULE.FUSE.CLEAN).\n const clean = this.#clean(info);\n const args = [from.v.code, at.v.code, put.v.code, ...(clean ? [] : [String(strict)])];\n // The items have the facts of the list and of the value. V removes each error item, and the value is not the sentinel.\n const facts: ListInfo = { ...joinLists(info, { item: put.v.kind, inner: heldList(put.v.list) }, \"setNth\"), clean: true, fresh: false };\n return { s: stmtsOf(from, at, put), v: { code: `${this.use(clean ? \"SNC\" : \"SN\")}(${args.join(\", \")})`, kind: undefined, safe: false, deps, list: facts } };\n }\n\n /**\n * This method gives the function of the option `by` of `sortBy` (COMPILE.MODULE.SORT.BY), or undefined without the\n * option. The function applies the op of the static site of the kind of the items. An empty list applies no op.\n */\n #sortValue(options: readonly Expr[], info: ListInfo): string | undefined {\n const by = (options[0] as { readonly value?: { readonly by?: unknown } } | undefined)?.value?.by;\n if (by === undefined) return undefined;\n if (typeof by !== \"string\") throw new NotStandalone('the option \"by\" of \"sortBy\" is not a literal text');\n if (info.empty === true) return undefined;\n if (info.item === undefined) throw new NotStandalone(`the kinds of the items of \"sortBy\" do not decide the op \"${by}\" of the option by`);\n const x = this.fresh(\"x\");\n const value = this.#opCall(by, [bare({ code: x, kind: info.item, safe: true, deps: NO_DEPS, plain: true })], NO_DEPS);\n return `((${x}) => ${value.v.code})`;\n }\n\n /**\n * This method prints append, without and flat (LIST.BUILD), get (LIST.GET) and indexOf (LIST.INDEXOF) over the array\n * of a list. Each list that the op reads follows LIST.LENIENT, as in the interpreter. An append with an owner appends\n * into the array of its name, if the name in the context is the name of the loop (COMPILE.MODULE.APPEND.OWN).\n */\n #build(op: string, head: Expr, rest: readonly Expr[], ctx: Ctx, owner: Owner | undefined): Code {\n const list = this.#listOf(head, ctx);\n const info = list.v.list as ListInfo;\n const two = op === \"append\" || op === \"without\";\n // A missing key of get, or value of indexOf, is the literal null. It is not a text or a value of indexOf, so the op\n // gives its error. A missing second list of append and without is not a list, so it gives a reason.\n const exprs = [head, ...(op === \"flat\" ? [] : [rest[0] ?? lit(null)])];\n const strict = this.#strict(op, rest.slice(exprs.length - 1));\n // A function of the program can share a node with the step, but its body has its own names (FN.BIND).\n const owned = owner !== undefined && ctx.env.get(owner.name) === owner.read;\n // With fuse, an append of an owner pushes the items of a list that a fused loop pushes, with no array of that list\n // (COMPILE.MODULE.APPEND.PUSH). The one item of `fill(1, x)` goes through `#ones` below.\n const pushed = op === \"append\" && owned && this.#fuse ? this.#ownPush(list, exprs[1] as Expr, strict, ctx, owner) : undefined;\n if (pushed !== undefined) return pushed;\n // With fuse, an append of an owner can push the one item of `fill(1, x)` (COMPILE.MODULE.FUSE.ADOPT). Only `#fill`\n // reads the mark of the node. An error of a print stops the module, so the mark needs no `finally`.\n const right = owned && this.#fuse ? exprs[1] : undefined;\n this.#ones.set(right, undefined);\n const raw = [list, ...exprs.slice(1).map((x) => (two ? this.#listOf(x, ctx) : this.expr(x, ctx)))];\n const one = this.#ones.get(right);\n this.#ones.delete(right);\n const deps = depsOf(...raw);\n const parts = this.#inOrder(this.#settle(raw, deps, exprs), true);\n const w = owned ? (owner.w ??= this.fresh(\"w\")) : undefined;\n // The item is the item of the list of the append only if no other part holds the value of fill. The list of a sure\n // owner is the array of w. Each other list can be another array, so AI or AIC selects the push or a copy with the push.\n const item = one !== undefined && (parts[1] as Code).v === one.v ? one.item : undefined;\n if (one !== undefined && item === undefined) this.use(\"FI\");\n const code = this.#buildCode(op, parts, strict, w, item === undefined ? undefined : { item, sure: (owner as Owner).sure });\n const value = (kind: Kind | undefined, facts: ListInfo | undefined): Code => ({ s: stmtsOf(...parts), v: { code, kind, safe: false, deps, list: facts } });\n if (op === \"get\") return value(info.item, info.inner);\n if (op === \"indexOf\") return value(\"number\", undefined);\n // V removes each error item, so the value of without, append and flat is clean.\n const built = (facts: ListInfo): Code => value(undefined, { ...facts, clean: true, fresh: false });\n if (op === \"without\") return built(info);\n if (op === \"append\") return built(joinLists(info, (parts[1] as Code).v.list as ListInfo, op));\n // flat: the value of each item must be a list, so a list of values gives a reason. An empty list gives an empty list.\n if (info.empty === true) return built(info);\n if (info.inner === undefined) throw new NotStandalone('\"flat\" over a list whose items are not lists');\n return built(info.inner);\n }\n\n /**\n * This method prints an append of an owner whose second list a fused loop pushes (COMPILE.MODULE.APPEND.PUSH). Such a\n * list is an append chain, an `if` or a fused `flat` over an each (`#pushes`). The items go into the target, with no array\n * of that list. The target is the array `w` when the first list is `w`. Each other first list gets one copy, as the\n * fused chain of the version before COMPILE.MODULE.APPEND.OTHER does. `fill(1, x)` keeps the expression of AIC, and\n * this method gives undefined for it.\n *\n * The second list does not read the name (`ownForm`), so no part of it reads the target. A push of a part that\n * fails stops the step, and an error of a step is the error of the loop. Thus no part reads such a target after it.\n * The target goes into `w` after the last push, so an error before it does not change `w`.\n */\n #ownPush(list: Code, right: Expr, strict: boolean, ctx: Ctx, owner: Owner): Code | undefined {\n if ((right.tag === \"app\" && right.op === \"fill\") || !this.#pushes(right, ctx)) return undefined;\n // In a sheet with a search, a part that reads a cell does not fuse, as in `#appendStrict`.\n if (this.#sheet !== undefined && !this.#sheet.direct && readsCells(right)) return undefined;\n const w = (owner.w ??= this.fresh(\"w\"));\n const o = this.fresh(\"o\");\n const info = list.v.list as ListInfo;\n const target = owner.sure ? list.v.code : this.#clean(info) ? `${this.use(\"AWC\")}(${list.v.code}, ${w})` : `${this.use(\"AW\")}(${list.v.code}, ${String(strict)}, ${w})`;\n const items = this.#push(right, ctx, o, strict);\n const s = [...list.s, `const ${o} = ${target};`, ...items.s, ...(owner.sure ? [] : [`${w} = ${o};`])];\n // The target has only items with values, and the loop holds it, so it is clean and not fresh.\n const facts: ListInfo = { ...joinLists(info, items.list as ListInfo, \"append\"), clean: true, fresh: false };\n return { s, v: { code: o, kind: undefined, safe: false, deps: new Set([...list.v.deps, ...items.deps]), list: facts } };\n }\n\n /**\n * This method gives the code of a list op of `#build`, with the variable `w` of an append into its own list. The clean\n * form applies when the facts prove each list that the helper scans clean (COMPILE.MODULE.FUSE.CLEAN). Then the\n * helper has no scan of V and no option strict. The append of two clean lists is `concat`. `get` scans no list, so\n * it has no clean form.\n */\n #buildCode(op: string, parts: readonly Code[], strict: boolean, w: string | undefined, push?: { readonly item: string; readonly sure: boolean }): string {\n const [l, o] = parts as [Code, Code | undefined];\n const codes = parts.map((x) => x.v.code);\n const info = l.v.list as ListInfo;\n // flat scans the list and each list of its items. An empty list has no items.\n const clean = op === \"flat\" ? this.#clean(info) && (info.inner === undefined || this.#clean(info.inner)) : op !== \"get\" && this.#clean(info) && (o?.v.list === undefined || this.#clean(o.v.list));\n if (w !== undefined) {\n // A list that is the array of w gets the one item with a push (COMPILE.MODULE.FUSE.ADOPT). With `sure`, the list is\n // that array. Else AI or AIC pushes the item into w, or into a copy of another list, with no list of fill\n // (COMPILE.MODULE.APPEND.PUSH).\n if (push?.sure === true) return `(${l.v.code}.push(${push.item}), ${w})`;\n if (push !== undefined) return clean ? `(${w} = ${this.use(\"AIC\")}(${l.v.code}, ${push.item}, ${w}))` : `(${w} = ${this.use(\"AI\")}(${l.v.code}, ${push.item}, ${String(strict)}, ${w}))`;\n return clean ? `(${w} = ${this.use(\"AOC\")}(${[...codes, w].join(\", \")}))` : `(${w} = ${this.use(\"AO\")}(${[...codes, String(strict), w].join(\", \")}))`;\n }\n if (!clean) return `${this.use(BUILD_HELPERS[op] as BuildHelper)}(${[...codes, String(strict)].join(\", \")})`;\n if (op === \"append\") return `${l.v.code}.concat(${(o as Code).v.code})`;\n return `${this.use(`${BUILD_HELPERS[op] as \"WO\" | \"FL\" | \"IX\"}C`)}(${codes.join(\", \")})`;\n }\n\n /** This method prints a list op over a list that is not an each: a loop over its array, and nth (LIST.NTH). */\n #overList(op: string, head: Expr, rest: readonly Expr[], ctx: Ctx): Code {\n // The count of a range of fill is the checked count, with no array (COMPILE.MODULE.FILL.RANGE).\n const range = op === \"count\" && rest.length === 0 ? this.#range(head, ctx) : undefined;\n if (range !== undefined) return { s: range.s, v: { ...range.count, list: undefined } };\n const list = this.#listOf(head, ctx);\n // A missing position is the literal null, which is not a whole number, so nth gives its error.\n const exprs = [head, ...(op === \"nth\" ? [rest[0] ?? lit(null)] : [])];\n const { strict, step } = this.#foldOptions(op, rest.slice(exprs.length - 1));\n const raw = [list, ...exprs.slice(1).map((x) => this.expr(x, ctx))];\n const deps = depsOf(...raw);\n const parts = this.#inOrder(this.#settle(raw, deps, exprs), true);\n const [l] = parts as [Code];\n const { item, inner } = list.v.list as ListInfo;\n // A clean list is its own array of items with values, so the clean form reads it with no VW and no test of the\n // sentinel (COMPILE.MODULE.FUSE.CLEAN). strict cannot fail.\n const clean = this.#clean(list.v.list);\n // The value of an item of a list of lists is a list, so nth and first give a list (LIST.FLAT).\n if (op === \"nth\") return { s: stmtsOf(...parts), v: { code: clean ? `${this.use(\"NTC\")}(${parts.map((x) => x.v.code).join(\", \")})` : `${this.use(\"NT\")}(${[...parts.map((x) => x.v.code), String(strict)].join(\", \")})`, kind: item, safe: false, deps, list: inner } };\n // count and first read the items with values on the array of the list, as nth does (COMPILE.MODULE.NTH.INDEX). Thus\n // a step of a loop that counts a list of n items costs O(1) after the first count. The length of an array cannot throw.\n if (op === \"count\") return { s: l.s, v: clean ? { code: `${l.v.code}.length`, kind: \"number\", safe: l.v.safe, deps, list: undefined } : { code: `${this.use(\"CT\")}(${l.v.code}, ${String(strict)})`, kind: \"number\", safe: false, deps, list: undefined } };\n if (op === \"first\") return { s: l.s, v: { code: clean ? `${this.use(\"FSC\")}(${l.v.code})` : `${this.use(\"FS\")}(${l.v.code}, ${String(strict)})`, kind: item, safe: false, deps, list: inner } };\n const r = this.#reduction(op, item, step);\n const { v } = r;\n const test = clean ? [] : [` if (${v} === E) ${strict ? `${this.use(\"F\")}();` : \"continue;\"}`];\n const s = [...l.s, r.init, `for (const [, ${v}] of ${l.v.code}) {`, ...test, ` ${r.step}`, \"}\"];\n return { s, v: { code: r.result, kind: r.kind, safe: false, deps, list: op === \"first\" ? inner : undefined } };\n }\n\n /**\n * This method gives the names of a loop (LOOP.NAMES): a variable for each name of `init`, with its first value at the\n * node. Inside the loop, each name has the level `loop`. Thus a part that reads a name stays in the loop. A loop that\n * reads no key of the run is a constant of the run.\n */\n #loopNames(init: Names, step: Names, ctx: Ctx, loop: number, items: readonly string[] = []): { readonly s: string[]; readonly env: Map<string, Name>; readonly vars: ReadonlyMap<string, Name>; readonly deps: Set<number>; readonly adopt: ReadonlySet<string> } {\n const s: string[] = [];\n const env = new Map(ctx.env);\n const vars = new Map<string, Name>();\n const deps = new Set<number>();\n // A step with a list literal, fill or an op with a list result can give a name keys that are not positions (LOOP.LIST).\n const keyed = Object.values(step).some((x) => hasTextKeys(x, (name) => this.#facts.givesList(name)));\n const firsts = Object.entries(init).map(([name, x]): [string, Code, string] => {\n // A name of a loop can hold a list (LOOP.LIST). Its first list fixes the kind of the items, if it has one.\n this.#wantList.add(x);\n const c = this.expr(x, ctx);\n if (c.v.kind === undefined && c.v.list === undefined) throw new NotStandalone(`the first value of the name \"${name}\" of a loop has no kind`);\n const v = this.fresh(\"l\");\n s.push(...c.s, `let ${v} = ${c.v.code};`);\n for (const d of c.v.deps) deps.add(d);\n return [name, c, v];\n });\n const clean = cleanNames(new Map(firsts.map(([name, c]) => [name, c.v.list?.clean === true])), step, items, (name) => ctx.env.get(name)?.list?.clean === true);\n for (const [name, c, v] of firsts) {\n const facts = c.v.list;\n // A step can give the items of a list a new value, so the facts of fusion of the items do not stay.\n const list = facts === undefined ? undefined : { ...this.#startItems(facts, step[name] as Expr), texts: facts.texts === true || keyed, clean: clean.has(name) };\n const read: Name = { code: v, kind: c.v.kind, lazy: false, deps: new Set([loop]), list };\n env.set(name, read);\n vars.set(name, read);\n }\n // With fuse, an append into the list of a name can take a first list that is clean and fresh as its own array\n // (COMPILE.MODULE.FUSE.ADOPT).\n const adopt = new Set(this.#fuse ? firsts.flatMap(([name, c]) => (adoptable(c.v.list) ? [name] : [])) : []);\n return { s, env, vars, deps, adopt };\n }\n\n /**\n * This method gives the facts of the items of a name of a loop with the first list `facts` and the step `x`. The step\n * can decide the items of an empty first list (COMPILE.MODULE.LOOP.EMPTY).\n */\n #startItems(facts: ListInfo, x: Expr): Pick<ListInfo, \"item\" | \"inner\" | \"empty\"> {\n const start = facts.empty === true;\n const { item, inner } = (start ? this.#starts.found.get(x) : undefined) ?? facts;\n return { item, inner: plainList(inner), empty: start && this.#starts.seek };\n }\n\n /**\n * This method gives the statements of one step of a loop: each new value first, and then each name gets its value.\n * `owners` has each name that appends to its own list (COMPILE.MODULE.APPEND.OWN). Each such name has the form of\n * `ownForm`, and no `until` reads it. The tests of a fold read only the names outside the fold, so they cannot read it.\n * A name in `adopt` has a first list that its appends can take (COMPILE.MODULE.FUSE.ADOPT).\n *\n * A step of another name can read it only before the step of the name, and only by `readsOnly`\n * (COMPILE.MODULE.APPEND.READ). The steps print in their order, so such a read ends before the first push.\n *\n * A step that is not such a form can be a wide form of `ownForm` with an append (COMPILE.MODULE.APPEND.OTHER). Each\n * step of another name that reads it must read it by `readsOnly`. A step of the name that such a read follows prints\n * after the other steps (COMPILE.MODULE.APPEND.LATE). The order must keep each read of each owner before its step.\n * These wide forms apply only with fuse.\n */\n #loopStep(step: Names, inner: Ctx, vars: ReadonlyMap<string, Name>, adopt: ReadonlySet<string>, until?: Expr): LoopStep {\n const owners: Owner[] = [];\n const nodes: Expr[] = [];\n const steps = Object.entries(step);\n const keys = steps.map(([k]) => k);\n const found = new Map<string, { readonly own: readonly Expr[]; readonly lets: readonly Expr[] }>();\n const wide: { readonly name: string; readonly own: readonly Expr[]; readonly lets: readonly Expr[]; readonly late: boolean }[] = [];\n for (const [i, [name, x]] of steps.entries()) {\n const own: Expr[] = [];\n const lets: Expr[] = [];\n const read = (y: Expr): boolean => namesOf(y).has(name);\n if (until !== undefined && read(until)) continue;\n const others = steps.filter(([k, y], j) => k !== name && read(y) && !(j < i && readsOnly(y, name)));\n if (ownForm(x, name, own, lets) && others.length === 0) {\n found.set(name, { own, lets });\n continue;\n }\n // The wide forms need fuse, so fuse false prints the module of the version before fusion (COMPILE.MODULE.FUSE.OFF).\n if (!this.#fuse || !steps.every(([k, y]) => k === name || !read(y) || readsOnly(y, name))) continue;\n const more: Expr[] = [];\n const moreLets: Expr[] = [];\n if (!ownForm(x, name, more, moreLets, true) || more.length === 0) continue;\n wide.push({ name, own: more, lets: moreLets, late: steps.some(([k, y], j) => j > i && k !== name && read(y)) });\n }\n // The steps of the late names print last, in their order. Each read of an owner must come before its step.\n const orderOf = (late: readonly string[]): readonly string[] => [...keys.filter((k) => !late.includes(k)), ...late];\n const keepsReads = (names: readonly string[], order: readonly string[]): boolean =>\n names.every((n) => steps.every(([k, y]) => k === n || !namesOf(y).has(n) || order.indexOf(k) < order.indexOf(n)));\n let late: readonly string[] = [];\n for (const w of wide) {\n const next = w.late ? [...late, w.name] : late;\n if (!keepsReads([...found.keys(), w.name], orderOf(next))) continue;\n found.set(w.name, w);\n late = next;\n }\n for (const [name, x] of steps) {\n const f = found.get(name);\n if (f === undefined) continue;\n // The variable starts with the first list, and each value of the step is that list or the value of an append that\n // pushes into it. Thus each append of the name gets the array of the variable (COMPILE.MODULE.FUSE.ADOPT). The body\n // of a let of COMPILE.MODULE.APPEND.LET can give another list.\n const owner: Owner = { name, read: vars.get(name) as Name, w: undefined, adopt: adopt.has(name), sure: adopt.has(name) && f.lets.length === 0 && !shadows(x, name) };\n for (const node of f.own) this.#own.set(node, owner);\n owners.push(owner);\n nodes.push(...f.own);\n // A branch of another list can be a filter of the list of the name (COMPILE.MODULE.APPEND.KEEP).\n for (const node of keepsOf(f.lets, name)) {\n this.#keeps.set(node, owner);\n nodes.push(node);\n }\n }\n try {\n return { ...this.#steps(step, inner, vars, orderOf(late)), owners };\n } finally {\n for (const node of nodes) {\n this.#own.delete(node);\n this.#keeps.delete(node);\n }\n }\n }\n\n /**\n * This method prints the result of a loop. With fuse, an append of the result to the list of an owner appends into\n * the array of the loop (COMPILE.MODULE.FUSE.ADOPT). The form of the result is the form of `lastForm`, so no part\n * reads the old list after the append. Only an owner whose step made its variable can do so, because the variable\n * holds only arrays that no other part holds. Each part of the result outside the form does not read the name. Thus\n * an inner loop there has no node and no relay of the form.\n */\n #loopResult(result: Expr, ctx: Ctx, owners: readonly Owner[]): Code {\n const nodes: Expr[] = [];\n const lets: Expr[] = [];\n for (const owner of this.#fuse ? owners : []) {\n const own: Expr[] = [];\n const relays = new Map<Expr, Relay>();\n if (owner.w === undefined || !lastForm(result, owner.name, own, relays)) continue;\n for (const node of own) this.#own.set(node, owner);\n for (const [l, r] of relays) this.#relays.set(l, { ...r, owner });\n nodes.push(...own);\n lets.push(...relays.keys());\n }\n try {\n return this.expr(result, ctx);\n } finally {\n for (const node of nodes) this.#own.delete(node);\n for (const l of lets) {\n for (const node of (this.#relays.get(l) as Relay).nodes) this.#own.delete(node);\n this.#relays.delete(l);\n }\n }\n }\n\n /**\n * This method gives the statements before a loop: the variable of each owner that its appends use. The variable of an\n * owner with `adopt` starts with the array of the first list (COMPILE.MODULE.FUSE.ADOPT), and each other one with null.\n */\n #ownVars(owners: readonly Owner[]): readonly string[] {\n return owners.flatMap((o) => (o.w === undefined ? [] : [`let ${o.w} = ${o.adopt ? o.read.code : \"null\"};`]));\n }\n\n /**\n * This method gives the statements of one step of a loop, without the variables of COMPILE.MODULE.APPEND.OWN. It also\n * gives the statements of each name alone, for the rest of a fold after its exit (`#foldExit`). The steps print in the\n * order of `order` (COMPILE.MODULE.APPEND.LATE).\n */\n #steps(step: Names, inner: Ctx, vars: ReadonlyMap<string, Name>, order: readonly string[]): { readonly s: string[]; readonly deps: ReadonlySet<number>; readonly parts: readonly StepPart[] } {\n const s: string[] = [];\n const sets: string[] = [];\n const parts: StepPart[] = [];\n const deps = new Set<number>();\n for (const name of order) {\n const x = step[name] as Expr;\n this.#wantList.add(x);\n const c = this.#hoist(this.expr(x, inner), hasLoop(x));\n const v = vars.get(name) as Name;\n if (c.v.kind !== v.kind || (c.v.list === undefined) !== (v.list === undefined)) throw new NotStandalone(`a step of a loop changes the kind of the name \"${name}\"`);\n if (v.list?.empty === true) this.#noteStart(x, c.v.list as ListInfo);\n if (v.list !== undefined && !fits(v.list, c.v.list as ListInfo)) throw new NotStandalone(`a step of a loop gives the name \"${name}\" a list that does not fit its first list`);\n const t = this.fresh(\"t\");\n const value = [...c.s, `const ${t} = ${c.v.code};`];\n s.push(...value);\n sets.push(`${v.code} = ${t};`);\n parts.push({ name, s: value, set: `${v.code} = ${t};`, safe: c.v.safe });\n for (const d of c.v.deps) deps.add(d);\n }\n return { s: [...s, ...sets], deps, parts };\n }\n\n /** This method keeps the items of the list that the step `x` gives to a name that starts empty (COMPILE.MODULE.LOOP.EMPTY). */\n #noteStart(x: Expr, list: ListInfo): void {\n if (list.item !== undefined || list.inner !== undefined) this.#starts.found.set(x, { item: list.item, inner: list.inner });\n }\n\n /**\n * An iteration (ITERATE.LIMIT, ITERATE.UNTIL): a `for` loop with a variable for each name. An error of a value, of the\n * test or of the result throws, so it is the value of the iteration.\n */\n #iterate(e: ExprOf<\"iterate\">, ctx: Ctx): Code {\n // Stryker disable next-line UpdateOperator: a level of a loop is a name, so a count down gives other names, and the same code\n const loop = this.#loops++;\n const names = this.#loopNames(e.init, e.step, ctx, loop);\n const inner: Ctx = { ...ctx, env: names.env };\n // The data limit reads the names outside the loop, after the first values (ITERATE.LIMIT.DATA).\n const limit = this.#limit(e, ctx);\n // A loop at a place that takes a list gives its result there (LOOP.LIST).\n if (this.#wantList.has(e)) this.#wantList.add(e.result);\n const until = e.until === undefined ? undefined : this.expr(e.until, inner);\n const step = this.#loopStep(e.step, inner, names.vars, names.adopt, e.until);\n const result = this.#loopResult(e.result, inner, step.owners);\n const k = this.fresh(\"k\");\n const body = [\n ...(until === undefined ? [] : [...until.s, `if (${this.#boolean(until.v)}) break;`]),\n `if (${k} === ${limit.code}) ${until === undefined ? \"break;\" : `${this.use(\"F\")}();`}`,\n ...step.s,\n ];\n const inside = [...(until?.v.deps ?? []), ...step.deps, ...result.v.deps].filter((d) => d !== loop);\n const deps = new Set([...names.deps, ...limit.deps, ...inside]);\n return { s: [...names.s, ...limit.s, ...this.#ownVars(step.owners), `for (let ${k} = 0; ; ${k}++) {`, ...ind(body), \"}\", ...result.s], v: { code: result.v.code, kind: result.v.kind, safe: false, deps, list: result.v.list } };\n }\n\n /**\n * The number of steps of an iteration. A data limit is the strict count of the targets of its axis. An error of the\n * axis, of a test or of an item throws. A count above the cap throws too (ITERATE.LIMIT.ERROR). A count that reads no\n * key is a constant of the run, so each key reads one value and not the targets (COMPILE.MODULE.LIMIT.ONCE).\n */\n #limit(e: ExprOf<\"iterate\">, ctx: Ctx): { readonly s: readonly string[]; readonly code: string; readonly deps: ReadonlySet<number> } {\n const [targets] = splitLimit(e) ?? [];\n if (targets === undefined) {\n const limit = e.limit as number;\n return { s: [], code: String(limit), deps: new Set() };\n }\n const count = this.#hoist(this.expr(app(\"count\", targets, lit({ strict: true })), ctx), true);\n const n = this.fresh(\"n\");\n return { s: [...count.s, `const ${n} = ${count.v.code};`, `if (${n} > ${String(MAX_ITERATIONS)}) ${this.use(\"F\")}();`], code: n, deps: count.v.deps };\n }\n\n /**\n * A fold (FOLD.ORDER, FOLD.ERROR): the loop over the targets of an axis, with a variable for each name. The tests read\n * only the names outside the fold. An error throws, so it is the value of the fold.\n */\n #fold(e: ExprOf<\"fold\">, ctx: Ctx): Code {\n // Stryker disable next-line UpdateOperator: a level of a loop is a name, so a count down gives other names, and the same code\n const loop = this.#loops++;\n // The names of the items hide the names outside the fold in the steps (AXIS.LIST.SCOPE).\n const names = this.#loopNames(e.init, e.step, ctx, loop, e.as);\n if (this.#wantList.has(e)) this.#wantList.add(e.result);\n const t = this.#targetLoop(e.axis, e.at ?? [], ctx, e.as);\n const tests = t.tests.map((x) => this.#hoist(this.expr(x, t.inner), hasLoop(x)));\n // The interpreter evaluates the tests at each target before the first step, so a module of a sheet does not have them.\n if (tests.some((x) => x.v.deps.has(CELLS))) throw new NotStandalone(\"a test of the axis of a fold reads a cell\");\n // Only the steps see the names of the items (AXIS.LIST.SCOPE). A name of `as` is not a name of `init`, so the read of\n // each name of the fold stays its read, and an append into its own list keeps its owner (COMPILE.MODULE.APPEND.OWN).\n const stepCtx: Ctx = { ...t.inner, env: withNames(names.env, t.items) };\n const first = this.#loopStep(e.step, stepCtx, names.vars, names.adopt);\n this.#readsNoTarget(t.texts, t.inner.level, [...tests.map((x) => x.v.deps), first.deps]);\n const result = this.#loopResult(e.result, { ...ctx, env: names.env }, first.owners);\n const scan = this.#scan(e, { loop, names, t, test: tests[0], step: first, result });\n if (scan !== undefined) return scan;\n // A fold over all the records can read the packs of its columns (COMPILE.MODULE.PAIRS).\n const packed = this.#packedSteps(e, t, stepCtx, names, first);\n const step = packed?.step ?? first;\n const item = [\n ...t.key,\n ...(t.skip === undefined ? [] : [`if (${t.j} === ${t.skip}) continue;`]),\n ...t.check,\n ...tests.flatMap((c) => [...c.s, `if (!${this.#boolean(c.v)}) continue;`]),\n ];\n const body = [...item, ...step.s, ...this.#foldExit(e, t, item, tests, step, names.vars, result)];\n const inside = [...tests.flatMap((c) => [...c.v.deps]), ...step.deps].filter((d) => d !== loop && d !== t.inner.level && d !== t.item);\n const deps = new Set([...names.deps, ...t.start, ...inside, ...[...result.v.deps].filter((d) => d !== loop)]);\n return { s: [...names.s, ...this.#ownVars(step.owners), ...t.s, ...(packed?.lets ?? []), t.head, ...ind(body), \"}\", ...result.s], v: { code: result.v.code, kind: result.v.kind, safe: false, deps, list: result.v.list } };\n }\n\n /**\n * This method gives the second print of the steps of a fold over all the records (COMPILE.MODULE.PAIRS), or\n * undefined. The axis has no test, no address and no reverse order, and no name holds a list. The second print reads\n * the pack of a column at the focus of the fold and of each loop in its steps. A column of the function that the\n * printer prints has a pack too, which each call makes again.\n *\n * Each call at such a focus is the body of its function at the place of the call (`#inline`). A pack holds the value\n * or the sentinel of the column at each record. Thus each read gives the value of a read of the column. Where the\n * second print fails, the fold keeps its first print.\n */\n #packedSteps(e: ExprOf<\"fold\">, t: { readonly j: string; readonly fixed: boolean; readonly tests: readonly Expr[] }, inner: Ctx, names: { readonly vars: ReadonlyMap<string, Name>; readonly adopt: ReadonlySet<string> }, first: LoopStep): { readonly step: LoopStep; readonly lets: readonly string[] } | undefined {\n if (this.#pack !== undefined || testsOf(e.axis).base.t !== \"all\" || !t.fixed || t.tests.length > 0 || first.owners.length > 0) return undefined;\n if ([...names.vars.values()].some((x) => x.list !== undefined)) return undefined;\n // The first print must read a column that can have a pack: a column of the run, or a column of this function.\n const scope = this.#scopes.at(-1);\n const read = first.s.join(\"\\n\");\n const columns = [...this.#runColumns.keys(), ...[...this.#callColumns].flatMap(([name, c]) => (c.scope === scope ? [name] : []))];\n if (!columns.some((name) => read.includes(`${name}(`))) return undefined;\n const pack: Pack = { foci: new Set([t.j]), calls: true, cols: new Map(), locals: new Set(), inlines: 0 };\n const scopes = this.#scopes.length;\n const outer = this.#inside;\n this.#pack = pack;\n let step: LoopStep;\n try {\n step = this.#loopStep(e.step, inner, names.vars, names.adopt);\n } catch (err) {\n if (!(err instanceof NoPack || err instanceof NotStandalone)) throw err;\n this.#scopes.length = scopes;\n this.#inside = outer;\n return undefined;\n } finally {\n this.#pack = undefined;\n }\n const text = step.s.join(\"\\n\");\n return { step, lets: this.#packLets([...pack.cols].filter(([, local]) => text.includes(`${local}[`))) };\n }\n\n /**\n * This method gives the exit of a fold (COMPILE.MODULE.EXIT): the statements after each step, or none. A name whose\n * step is `and(name, ...)` stops at false, and a name whose step is `or(name, ...)` stops at true. Then each later\n * step of the name gives the same value and evaluates no other argument. When each such name stops, the loop leaves.\n * The rest of the targets runs only the steps of the other names, with the checks and the tests of each target. Thus\n * an error of a later target is still the error of the fold. When these steps cannot throw and the result does not\n * read their names, the loop leaves at once.\n */\n #foldExit(e: ExprOf<\"fold\">, t: { readonly parts: ForParts; readonly checkSafe: boolean }, item: readonly string[], tests: readonly Code[], step: LoopStep, vars: ReadonlyMap<string, Name>, result: Code): string[] {\n if (step.owners.length > 0) return [];\n const stops: string[] = [];\n const rest: StepPart[] = [];\n for (const p of step.parts) {\n const stop = stopOf(e.step[p.name] as Expr, p.name);\n if (stop === undefined) rest.push(p);\n else stops.push(`${stop ? \"\" : \"!\"}${(vars.get(p.name) as Name).code}`);\n }\n if (stops.length === 0) return [];\n const test = stops.join(\" && \");\n const reads = [result.v.code, ...result.s].join(\"\\n\");\n // A part with statements of its own can have a loop or a try block, so only a part with one statement is quiet.\n const quiet =\n t.checkSafe &&\n tests.every((c) => c.s.length === 0 && this.#safeBoolean(c.v)) &&\n rest.every((p) => p.safe && p.s.length === 1 && !new RegExp(String.raw`\\b${(vars.get(p.name) as Name).code}\\b`).test(reads));\n if (quiet) return [`if (${test}) break;`];\n // The rest goes on from the next target, in the order of the loop, with the parts of the head of the loop.\n const { cond, next } = t.parts;\n const residual = [...item, ...rest.flatMap((p) => p.s), ...rest.map((p) => p.set)];\n return [`if (${test}) {`, ...ind([`for (${next}; ${cond}; ${next}) {`, ...ind(residual), \"}\", \"break;\"]), \"}\"];\n }\n\n /**\n * This method gives the code of a fold over the targets before the origin as a scan (COMPILE.MODULE.SCAN), or\n * undefined. The axis is `where(all, test)`, and the test compares a value `T` of the target with a key of the origin\n * by `<` or `<=`. The first values, the steps and the result read no key of the run. A run evaluates `T` once at\n * each record, and each step once at each record. When the values `T` do not decrease, the targets of each origin are\n * a prefix. A binary search finds it, and each prefix keeps its state. The steps run in the order of the fold, so the\n * result has the bits of the loop.\n */\n #scan(e: ExprOf<\"fold\">, p: ScanParts): Code | undefined {\n const { loop, names, t, test, step, result } = p;\n const level = t.inner.level;\n const [x] = t.tests;\n const { base } = testsOf(e.axis);\n if (base.t !== \"all\" || (e.at ?? []).length > 0 || e.as !== undefined || t.tests.length !== 1 || x?.tag !== \"app\" || x.args.length !== 2 || test === undefined) return undefined;\n // Stryker disable next-line all: for the axis all with no address, #targetLoop gives no statements, key, check or skip, so this test is always false\n if (t.s.length > 0 || t.key.length > 0 || t.check.length > 0 || t.skip !== undefined) return undefined;\n // The test reads the target and a key of the origin. The rest reads only the target, the names of the fold and the\n // constants of the run, so it can evaluate once for each run.\n if (!test.v.deps.has(level) || within(test.v.deps, [level]) || names.deps.size > 0 || step.owners.length > 0 || !within(step.deps, [loop, level]) || !within(result.v.deps, [loop])) return undefined;\n if ([...names.vars.values()].some((v) => v.list !== undefined) || result.v.list !== undefined) return undefined;\n const sides = x.args.map((a) => this.#hoist(this.expr(a, t.inner), hasLoop(a)));\n const at = sides.findIndex((c) => c.v.deps.size > 0 && !c.v.deps.has(level));\n const key = sides[at];\n const value = sides[1 - at];\n // The search needs an order of the values: `<=` of two numbers or of two texts.\n if (key === undefined || value === undefined || !within(value.v.deps, [level]) || (value.v.kind !== \"number\" && value.v.kind !== \"string\")) return undefined;\n // The test is an op whose inline form cannot fail, as for the prefixes of a node that keeps its items (`#cached`).\n const site = this.#facts.staticSite(x.op, sides.map((c) => c.v.kind));\n if (site?.t !== \"fn\" || site.bad || site.returns !== \"boolean\" || this.check(\"boolean\") !== undefined) return undefined;\n const form = inlineForm(functionText(((this.#domains[site.domain] as AnyDomain).ops[x.op] as { fn: (...a: never[]) => unknown }).fn));\n if (form?.params.length !== 2) return undefined;\n // `#0` is the value of the target and `#1` is the key, in the order of the parameters of the op.\n const pattern = patternOf(form, (i) => (at === 0 ? 1 - i : i));\n if (![\"#0<#1\", \"#0<=#1\", \"#1>#0\", \"#1>=#0\"].includes(pattern)) return undefined;\n const keyTest = form.parts.map((part) => (typeof part === \"number\" ? `(${at === 0 ? [\"q\", \"t\"][part] : [\"t\", \"q\"][part]})` : part)).join(\"\");\n const vars = [...names.vars.values()].map((v) => v.code);\n const s = this.fresh(\"s\");\n const pack = vars.length === 1 ? (vars[0] as string) : `[${vars.join(\", \")}]`;\n const unpack = vars.length === 1 ? [`let ${vars[0] as string} = ${s};`] : vars.map((v, i) => `let ${v} = ${s}[${String(i)}];`);\n const arrow = (params: string, lines: readonly string[], code: string): readonly string[] => (lines.length === 0 ? [`(${params}) => ${code}`] : [`(${params}) => {`, ...ind(lines), ` return ${code};`, \"}\"]);\n const fns = [arrow(\"\", names.s, pack), arrow(t.j, value.s, value.v.code), [`(t, q) => ${keyTest}`], arrow(`${s}, ${t.j}`, [...unpack, ...step.s], pack), arrow(s, [...unpack, ...result.s], result.v.code)];\n const name = this.fresh(\"P\");\n this.#intoRun([`const ${name} = ${this.use(\"PF\")}(n,`, ...ind(fns.flatMap((f, i) => [...f.slice(0, -1), `${f.at(-1) as string}${i < fns.length - 1 ? \",\" : \"\"}`])), \");\"]);\n const q = this.fresh(\"q\");\n return { s: this.#store(q, key), v: { code: `${name}(${q})`, kind: result.v.kind, safe: false, deps: key.v.deps } };\n }\n\n /**\n * A node of the memo: one function of its keys for each structure, with an entry for each value of the keys. A key\n * that is a constant of the run is the variable of that constant, not a key of the function. A node with no other key\n * is a constant of the run itself.\n */\n #memoized(e: Expr, keys: readonly Expr[], ctx: Ctx): Code {\n // A key can be a list, for example the list of a let that nth reads in the node (COMPILE.MODULE.NTH.INDEX).\n for (const k of keys) this.#wantList.add(k);\n const values = keys.map((k) => this.#hoist(this.expr(k, ctx)));\n const varying = keys.filter((_k, i) => (values[i] as Code).v.deps.size > 0);\n const params = varying.map(() => this.fresh(\"q\"));\n const names = new Map(\n keys.map((k, i): [Expr, Name] => {\n const x = (values[i] as Code).v;\n const p = varying.indexOf(k);\n return [k, p < 0 ? this.#nameOf(x) : { code: params[p] as string, kind: x.kind, lazy: true, deps: new Set([1]), list: plainList(x.list) }];\n }),\n );\n const outer = this.#inside;\n this.#inside = e;\n const bodyCtx: Ctx = { origin: undefined, focus: undefined, level: 1, originLevel: 1, env: new Map(), fns: new Map(), keys: names, columns: new Map() };\n if (varying.length === 0) {\n const body = this.#hoist(this.expr(e, bodyCtx));\n this.#inside = outer;\n return body;\n }\n // The kinds of the keys decide the ops in the node, so they are a part of the structure. Each key of the function\n // can hold the error sentinel, so the nodes with a safe key and the nodes without one share it.\n const tokens = new Map(keys.map((k, i): [Expr, object] => [k, varying.includes(k) ? { \"#\": varying.indexOf(k), kind: (values[i] as Code).v.kind, list: plainList((values[i] as Code).v.list) } : { \"@\": (names.get(k) as Name).code }]));\n const structure = canonical(e, (x) => tokens.get(x as Expr));\n let fn = this.#structures.get(structure);\n if (fn === undefined) {\n fn = this.fresh(\"m\");\n this.memos = true;\n const cached = varying.length === 1 ? this.#cached(e, varying[0] as Expr, bodyCtx, fn) : undefined;\n if (cached !== undefined) {\n this.#kinds.set(fn, cached.kind);\n this.#intoRun(cached.lines);\n } else {\n // The loop of the node gives statements.\n const body = this.expr(e, bodyCtx);\n this.#kinds.set(fn, body.v.kind);\n this.#lists.set(fn, heldList(body.v.list));\n this.#intoRun([`const ${fn} = ${this.use(params.length === 1 ? \"M1\" : \"M\")}((${params.join(\", \")}) => {`, ...ind(body.s), ` return ${body.v.code};`, \"});\"]);\n }\n this.#structures.set(structure, fn);\n }\n this.#inside = outer;\n // Each key of the function gets its value, or the error sentinel.\n const s: string[] = [];\n const args = varying.map((k) => {\n const c = values[keys.indexOf(k)] as Code;\n if (c.v.safe && c.s.length === 0) return c.v.code;\n if (c.s.length === 0 && c.v.held !== undefined) return c.v.held;\n const t = this.fresh(\"k\");\n s.push(...this.#store(t, c));\n return t;\n });\n return { s, v: { code: `${fn}(${args.join(\", \")})`, kind: this.#kinds.get(fn), safe: false, deps: depsOf(...values), list: this.#lists.get(fn) } };\n }\n\n /**\n * This method gives the code of a node of the memo whose key is only in one test of a list op: `test(T, key)`. Such a\n * node keeps its items in the helper `S`. One pass gives the tests before the test of the key and the value `T` of each\n * item. The rest of an item evaluates once, at the first key whose test is true.\n *\n * With the test `===`, each value `T` has a group of items. With `<` or `<=` and values `T` that do not decrease, the\n * items whose test is true are a prefix. Each prefix keeps its running value. The values add in the order of the items, so the result has the bits of the interpreter. An error before the test\n * of the key is an error of the item at each key. An error after it is an error at the keys whose test is true.\n */\n #cached(e: Expr, key: Expr, bodyCtx: Ctx, fn: string): { readonly lines: readonly string[]; readonly kind: Kind | undefined } | undefined {\n // Only an app has an op, and a node of the memo has a loop, so a list op has its target.\n const { op, args } = e as ExprOf<\"app\">;\n if (!LIST_OPS.has(op)) return undefined;\n const [target, ...rest] = args as [Expr, ...Expr[]];\n if (target.tag !== \"each\" || (target.at ?? []).length > 0) return undefined;\n const strict = this.#strict(op, rest);\n const kind = (bodyCtx.keys.get(key) as Name).kind;\n const { base, tests: raw } = testsOf(target.axis);\n const tests = raw.flatMap(partsOf);\n const at = tests.findIndex((t) => contains(t, key));\n const test = tests[at];\n if (base.t !== \"all\" || test?.tag !== \"app\" || test.args.length !== 2 || contains(target.body, key) || tests.some((t, i) => i !== at && contains(t, key))) return undefined;\n const [l, r] = test.args as [Expr, Expr];\n const keyFirst = l === key;\n const other = keyFirst ? r : l;\n if ((!keyFirst && r !== key) || contains(other, key)) return undefined;\n const j = this.fresh(\"j\");\n const loop: Ctx = { ...bodyCtx, focus: j, level: 2 };\n const t = this.#hoist(this.expr(other, loop));\n // The test of the key is an op whose inline form cannot fail: then the loop over the items needs no try.\n const site = this.#facts.staticSite(test.op, keyFirst ? [kind, t.v.kind] : [t.v.kind, kind]);\n if (site?.t !== \"fn\" || site.bad || site.returns !== \"boolean\" || this.check(\"boolean\") !== undefined) return undefined;\n // A static site of a domain has the function of the op of that domain.\n const src = functionText(((this.#domains[site.domain] as AnyDomain).ops[test.op] as { fn: (...a: never[]) => unknown }).fn);\n const form = inlineForm(src);\n if (form?.params.length !== 2 || !givesValue(src)) return undefined;\n const before = tests.slice(0, at).map((x) => this.#hoist(this.expr(x, loop)));\n const after = tests.slice(at + 1).map((x) => this.#hoist(this.expr(x, loop)));\n const body = this.#hoist(this.expr(target.body, loop));\n const B = (v: Value): string => this.#boolean(v);\n // The kind of the test of the key: `===` gives the groups of equal values, and `<` or `<=` from T to the key gives\n // the prefixes of the items when T does not decrease. NaN satisfies neither test, so its item is in no group.\n const pattern = patternOf(form, (p) => (keyFirst ? 1 - p : p));\n const mode = pattern === \"#0===#1\" || pattern === \"#1===#0\" ? 1 : [\"#0<#1\", \"#0<=#1\", \"#1>#0\", \"#1>=#0\"].includes(pattern) ? 2 : 0;\n const testArgs = keyFirst ? [\"q\", \"t\"] : [\"t\", \"q\"];\n const keyTest = form.parts.map((p) => (typeof p === \"number\" ? `(${testArgs[p] as string})` : p)).join(\"\");\n if (mode === 1) this.features.add(\"group\");\n if (mode === 2) this.features.add(\"prefix\");\n if (strict) this.features.add(\"strict\");\n const F = this.use(\"F\");\n // A function of the index of an item, from its statements and its value.\n const arrow = (lines: readonly string[], code: string): readonly string[] => (lines.length === 0 ? [`(${j}) => ${code}`] : [`(${j}) => {`, ...ind(lines), ` return ${code};`, \"}\"]);\n const pre = before.length === 0 ? undefined : before.every((x) => x.s.length === 0) ? arrow([], before.map((x) => B(x.v)).join(\" && \")) : arrow(before.flatMap((x, i) => [...x.s, ...(i < before.length - 1 ? [`if (!${B(x.v)}) return false;`] : [])]), B((before.at(-1) as Code).v));\n // The value of an item: the tests after the test of the key, and the body. N is an item that a later test excludes,\n // and E is an error.\n const value =\n after.length === 0 && body.v.safe && body.s.length === 0\n ? arrow([], body.v.code)\n : [`(${j}) => {`, \" try {\", ...ind(ind([...after.flatMap((x) => [...x.s, `if (!${B(x.v)}) return N;`]), ...body.s])), ` return ${body.v.code};`, \" } catch {\", \" return E;\", \" }\", \"}\"];\n const [stepName, stepCode] = STEPS[op] as readonly [string, string];\n this.top.set(stepName, `const ${stepName} = ${stepCode};`);\n // A sum has the check of a number, and only a sum or a mean needs that check.\n const results: Readonly<Record<string, () => readonly [string, string]>> = {\n count: () => [\"r_count\", \"(a, c) => c\"],\n sum: () => [this.check(\"number\") ?? \"r_id\", \"(a) => a\"],\n mean: () => [\"r_mean\", `(a, c) => (c === 0 ? ${F}() : ${this.#checked(\"number\", \"a / c\")})`],\n any: () => [\"r_id\", \"(a) => a\"],\n all: () => [\"r_id\", \"(a) => a\"],\n none: () => [\"r_not\", \"(a) => !a\"],\n };\n const [resultName, resultCode] = results[op]?.() ?? [\"r_one\", `(a, c) => (c === 0 ? ${F}() : a)`];\n if (!this.top.has(resultName)) this.top.set(resultName, `const ${resultName} = ${resultCode};`);\n const a0 = op === \"sum\" || op === \"mean\" ? \"0\" : op === \"all\" ? \"true\" : BOOLEAN_LIST_OPS.has(op) ? \"false\" : \"undefined\";\n // The values of an op of numbers or of booleans have that kind, or the result is an error. Count takes each kind.\n const needs = op === \"count\" ? undefined : listKind(op, undefined);\n const ok = needs === undefined || body.v.kind === needs ? [] : [`(x) => typeof x === \"${needs}\"`];\n if (ok.length > 0) this.features.add(\"ok\");\n if (pre !== undefined) this.features.add(\"pre\");\n const fns = [arrow(t.s, t.v.code), value, [`(t, q) => ${keyTest}`], ...(pre === undefined && ok.length === 0 ? [] : [pre ?? [\"undefined\"]]), ...(ok.length === 0 ? [] : [ok])];\n const lines = fns.flatMap((x, i) => [...x.slice(0, -1), `${x.at(-1) ?? \"\"}${i < fns.length - 1 ? \",\" : \"\"}`]);\n return { lines: [`const ${fn} = ${this.use(\"S\")}(n, ${mode}, ${String(strict)}, ${a0}, ${stepName}, ${resultName},`, ...ind(lines), \");\"], kind: listKind(op, body.v.kind) };\n }\n\n /** This method gives the code of the program at the key of the run. A constant of the run evaluates once. */\n /** This method gives the code of a program at the key `o` of the run. A sheet has one program for each formula. */\n root(expr: Expr): Code {\n // The value of a program and of a cell can be a list (COMPILE.MODULE.LIST.RESULT).\n this.#wantList.add(expr);\n return this.#hoist(this.expr(expr, { origin: \"o\", focus: \"o\", level: 1, originLevel: 1, env: new Map(), fns: new Map(), keys: new Map(), columns: new Map() }));\n }\n\n /** This method removes the declarations that no code reads, after the last program. */\n finish(): void {\n // A function of an op with an inline form at each of its sites needs no declaration.\n for (const [name, form] of this.#forms) if (form !== undefined && !this.#called.has(name)) this.top.delete(name);\n }\n\n /** This method gives the key of an expression at the place of `ctx`. Two expressions with one key have one value. */\n #constKey(e: Expr, ctx: Ctx): string {\n const key = keyText(e, ctx, this.#keyTable);\n keyProbe?.(e, ctx, key, this.#keyTable);\n return key;\n }\n}\n\n/** The function that sees each key of a constant or a column. */\nexport type KeyProbe = (e: Expr, scope: KeyScope, key: string, table: KeyTable) => void;\n\n/** The function that a test of the keys gives, or undefined when no such test runs. */\nlet keyProbe: KeyProbe | undefined;\n\n/** This function gives the result of `emit`, and `probe` sees each key of its printers, after each outer probe. The tests of the keys use it. The probe does not change the printed code. */\nexport function withKeyProbe<T>(probe: KeyProbe, emit: () => T): T {\n const outer = keyProbe;\n keyProbe = (e, scope, key, table): void => {\n outer?.(e, scope, key, table);\n probe(e, scope, key, table);\n };\n try {\n return emit();\n } finally {\n keyProbe = outer;\n }\n}\n\n/** The printers that `listFactsOf` collects, or undefined when no test of the analysis runs. */\nlet recorder: Printer[] | undefined;\n\n/**\n * This function gives the facts of fusion of each list node of the modules that `emit` prints (COMPILE.MODULE.FUSE.FACTS),\n * and the result of `emit`. The tests of the analysis use it. The facts do not change the printed code.\n */\nexport function listFactsOf(emit: () => Emitted): { readonly emitted: Emitted; readonly facts: ReadonlyMap<Expr, ListFacts> } {\n const printers: Printer[] = [];\n recorder = printers;\n try {\n const emitted = emit();\n return { emitted, facts: new Map(printers.flatMap((p) => [...p.listFacts()])) };\n } finally {\n recorder = undefined;\n }\n}\n\n/** This function gives the name of the function of a module, and its space, or the reason that the options are not valid. */\nfunction runOf(options: ModuleOptions): Run | { readonly reason: string } {\n const name = options.name ?? \"run\";\n if (!/^[A-Za-z_$][\\w$]*$/.test(name)) return { reason: `the name \"${name}\" is not a JavaScript name` };\n const space = options.space ?? \"array\";\n if (space !== \"array\" && space !== \"tree\" && space !== \"graph\") return { reason: `the space \"${String(space)}\" is not \"array\", \"tree\" or \"graph\"` };\n // The option fuse changes no code in this version, but a value that is not a boolean is an error of the caller.\n const fuse: unknown = options.fuse ?? true;\n if (typeof fuse !== \"boolean\") return { reason: `the option \"fuse\" is ${String(fuse)}, not true or false` };\n const lists: unknown = options.lists ?? \"envelope\";\n if (lists !== \"envelope\" && lists !== \"plain\") return { reason: `the option \"lists\" is ${String(lists)}, not \"envelope\" or \"plain\"` };\n const keys: unknown = options.keys ?? false;\n if (typeof keys !== \"boolean\") return { reason: `the option \"keys\" is ${String(keys)}, not true or false` };\n return { name, tree: space === \"tree\", graph: space === \"graph\", plain: lists === \"plain\" };\n}\n\n/** The function of a module: its name, its space, and true for the plain form of the lists (COMPILE.MODULE.LIST.PLAIN). */\ninterface Run {\n readonly name: string;\n readonly tree: boolean;\n readonly graph: boolean;\n readonly plain: boolean;\n}\n\n/** This function gives the reason of an error of the printer. Another exception is a defect, so it goes to the caller. */\nfunction reasonOf(thrown: unknown): Emitted {\n if (!(thrown instanceof NotStandalone)) throw thrown;\n return { ok: false, reason: thrown.message };\n}\n\n/**\n * This function gives the code of the check of a field of a record `r` at the position `i`. The check of a list keeps\n * the array of the list when the program reads the field (COMPILE.MODULE.LIST.INPUT). With `plain`, the field holds a\n * plain list (COMPILE.MODULE.LIST.PLAIN). With `flat`, the helper has no argument for the depth. The code is true for a\n * field against the schema.\n */\nfunction fieldCheck(p: Printer, field: string, kind: Kind | ListKind, plain: boolean, flat: boolean): string {\n const input = `r[${JSON.stringify(field)}]`;\n if (typeof kind !== \"object\") return p.against(kind, input);\n const read = listRead(p, input, kind, plain, flat);\n const keep = p.inputs.get(field);\n return `${keep === undefined ? read : `(${keep}[i] = ${read})`} === undefined`;\n}\n\n/** This function gives the code that reads a list of the input with the helper of its form. With `flat`, the helper has no argument for the depth. */\nfunction listRead(p: Printer, input: string, kind: ListKind, plain: boolean, flat: boolean): string {\n const depth = flat ? \"\" : `${String(depthOf(listOfKind(kind)))}, `;\n return `${p.use(plain ? \"LA\" : \"LI\")}(${input}, ${depth}${p.test(leafOf(kind))})`;\n}\n\n/**\n * This function gives the code of the check of a variable of the run. The check of a list keeps the array of the list\n * in the variable of the code when the program reads the variable (COMPILE.MODULE.LIST.VAR). The code is true for a\n * variable against the schema.\n */\nfunction varCheck(p: Printer, name: string, kind: Kind | ListKind, plain: boolean, flat: boolean): string {\n const input = `vars[${JSON.stringify(name)}]`;\n if (typeof kind !== \"object\") return p.against(kind, input);\n const read = listRead(p, input, kind, plain, flat);\n const keep = p.vars.get(name);\n return `${keep === undefined ? read : `(${keep} = ${read})`} === undefined`;\n}\n\n/**\n * This function gives the text of a module: the declarations, the helpers, and the function of the run. The run checks\n * its input, computes the parts of the tree and the constants of the run, and then gives the statements `body`.\n */\nfunction printModule(p: Printer, options: ModuleOptions, run: Run, body: readonly string[]): Emitted {\n p.use(\"C\");\n const helpers = new Set<Helper>();\n // A helper comes after the helpers that it needs. A set keeps the first place of each helper.\n const add = (h: Helper): void => {\n for (const x of NEEDS[h]) add(x);\n helpers.add(h);\n };\n const fields = Object.entries(options.schema.fields ?? {});\n const vars = Object.entries(options.schema.vars ?? {});\n // With no other depth, the list helpers have no argument for the depth (COMPILE.MODULE.SIZE.FLAT).\n const flat = options.fuse !== false && !p.opList && [...fields, ...vars].every(([, k]) => typeof k !== \"object\" || depthOf(listOfKind(k)) === 0);\n let fieldChecks: string;\n let varChecks: string;\n try {\n fieldChecks = fields.map(([f, k]) => ` || ${fieldCheck(p, f, k, run.plain, flat)}`).join(\"\");\n varChecks = vars.map(([v, k]) => ` || ${varCheck(p, v, k, run.plain, flat)}`).join(\"\");\n } catch (thrown) {\n return reasonOf(thrown);\n }\n const { name, tree, graph } = run;\n const isListVar = (v: string): boolean => typeof options.schema.vars?.[v] === \"object\";\n // A tree checks its parents, and it computes the parts that the program reads. The siblings need the children. The\n // order reads only the parents (COMPILE.MODULE.TREE.ALLOC).\n if (tree) p.use(\"PT\");\n if (p.treeParts.has(\"siblings\")) p.treeParts.add(\"children\");\n const parts = ([\"children\", \"siblings\", \"order\"] as const).filter((x) => p.treeParts.has(x));\n for (const x of parts) p.use(TREE_PARTS[x][0]);\n // A graph checks its edges, and it computes the predecessors if the program reads them.\n if (graph) p.use(\"GR\");\n if (p.into) p.use(\"GI\");\n if (p.runKeys) p.use(\"KC\");\n [...p.helpers].toSorted().forEach(add);\n const bad = nameReason(name);\n if (bad !== undefined) return { ok: false, reason: bad };\n const textOf = (h: Helper): string => (h === \"S\" ? helperS(p.features) : flat && (h === \"LI\" || h === \"LA\") ? FLAT_LIST_HELPERS[h]() : HELPERS[h]());\n const params = `(records, vars${tree ? \", parents\" : graph ? \", edges\" : \"\"}${p.runKeys ? \", keys\" : \"\"}) {`;\n const start = [\n ' if (!Array.isArray(records)) C(\"the records are not an array\");',\n \" const R = records;\",\n \" const n = R.length;\",\n ...[...p.inputs.values()].map((x) => ` const ${x} = [];`),\n \" for (let i = 0; i < n; i++) {\",\n \" const r = R[i];\",\n ` if (typeof r !== \"object\" || r === null${fieldChecks}) C(\\`the record \\${i} does not keep the schema\\`);`,\n \" }\",\n ...[...p.vars].filter(([v]) => isListVar(v)).map(([, code]) => ` let ${code};`),\n ` if (typeof vars !== \"object\" || vars === null${varChecks}) C(\"the variables do not keep the schema\");`,\n ...(tree ? [\" const P = PT(parents, n);\", ...parts.map((x) => ` ${TREE_PARTS[x][1]}`)] : []),\n ...(graph ? [\" const GO = GR(edges, n);\", ...(p.into ? [\" const GN = GI(GO, n);\"] : [])] : []),\n ...(p.runKeys ? [\" const KM = KC(keys, n);\"] : []),\n ...[...p.vars].filter(([v]) => !isListVar(v)).map(([v, code]) => ` const ${code} = vars[${JSON.stringify(v)}];`),\n ];\n const all: Tidied = { decls: new Map<string, string>([...[...helpers].map((h) => [h as string, textOf(h)] as const), ...p.top]), lines: [...ind(p.run), ...ind(body)] };\n // The text with fuse false stays the form of the version before this pass (COMPILE.MODULE.FUSE.OFF). A dropped print still goes, because it can read a name with no declaration (V-086).\n const small = options.fuse === false ? { ...all, lines: deadConstants(all.lines) } : tidy({ ...all, kept: start.join(\"\\n\"), globals: MODULE_GLOBALS }, options.faults);\n const { decls, lines: statements } = options.faults === \"throw\" ? keepFaults(small, p.copies) : small;\n const textWith = (head: string, tail: readonly string[]): string => [\n \"// Generated by @mark1russell7/vex-compiler from a Vex program. Do not edit.\",\n ERROR_NOTE,\n \"export class VexContractError extends Error {}\",\n \"/** The value of a key where the program gives an error of Vex. */\",\n \"export const VEX_ERROR = Object.freeze({ vexError: true });\",\n \"const E = {};\",\n ...(p.memos ? [\"const Z = {};\"] : []),\n // The values of an item of a node that keeps its items: excluded by a later test, and of the wrong kind.\n ...(decls.has(\"S\") ? [\"const N = {}, W = {};\"] : []),\n ...decls.values(),\n `${head}${params}`,\n ...start,\n ...statements,\n \"}\",\n ...tail,\n \"\",\n ].join(\"\\n\");\n // The check reads each line of the module, with the copies of the ops. The function of the run has no name in that text.\n const code = textWith(\"function\", []);\n // The parse of the names takes time, so it starts only for a name that is a word of the code. The fixed note holds the word `run`.\n const inner = wordsOf(code.replace(ERROR_NOTE, \"\")).includes(name) ? innerName(name, namesOfCode(code)) : name;\n return { ok: true, source: inner === name ? textWith(`export function ${name}`, []) : textWith(`function ${inner}`, [`export { ${inner} as ${name} };`]) };\n}\n\n/**\n * This function gives the module of a print (COMPILE.MODULE.LOOP.EMPTY). The first print keeps the text of each program\n * that it can print. After a reason, more prints look for the kinds that the steps give to the names that start empty.\n * Each print can find more kinds, because a step can read another such name. The last print uses the kinds, so its\n * checks of the steps prove them. A program without such a kind gets the reason of the first print.\n */\nfunction settledPrint(print: (starts: EmptyStarts) => Emitted): Emitted {\n const found: EmptyStarts[\"found\"] = new Map();\n const copies: EmptyStarts[\"copies\"] = new Map();\n const first = print({ found, copies, seek: false });\n if (first.ok) return first;\n for (let size = -1; size !== found.size; ) {\n size = found.size;\n print({ found, copies, seek: true });\n }\n return print({ found, copies, seek: false });\n}\n\n/** This function gives the facts of a node from the facts of two of its places. */\nconst bothPlaces = (a: ListFacts, b: ListFacts): ListFacts => ({ clean: a.clean && b.clean, fresh: a.fresh && b.fresh, inner: b.inner.map((x, i) => x && a.inner[i] === true), reads: Math.max(a.reads, b.reads) });\n\n/** This function gives the expressions of a program with one object at each place, the same copies for each print of the program. */\nfunction copiesOf(program: object, exprs: readonly Expr[], starts: EmptyStarts, shares: boolean): readonly Expr[] {\n const copies = starts.copies.get(program) ?? unsharedAll(exprs, shares);\n starts.copies.set(program, copies);\n return copies;\n}\n\n/**\n * This function prints a module. With the option `keys`, it prints again with the keys of the run when the first print\n * reads a key (COMPILE.MODULE.KEYS). Thus a program that reads no key keeps its text.\n */\nfunction keyedPrint(options: ModuleOptions, print: (keys: KeyPrint) => Emitted): Emitted {\n const keys = { keyed: false, read: false };\n const first = print(keys);\n return keys.read && options.keys === true ? print({ keyed: true, read: true }) : first;\n}\n\n/**\n * This function prints a program as a standalone ES module. The module exports `VexContractError`, `VEX_ERROR` and a\n * function that takes the records and the variables and gives the value at each key. A module of a tree space takes\n * the parents too. The function is pure, so a build can use it. The program can be an expression or a document\n * (DOC.ENTRY).\n *\n * This function is a tool of a build. A print of one module of ireko takes 16 to 172 ms on a CI runner, at 0.833 to\n * 1.149 times the fixed base of COMPILE.MODULE.COST. `docs/COMPILER.md` gives the ms and the ratio of each module. A\n * limit of that gate holds the cost of today. The target of 1.10 for each module is not proven. A caller on a request\n * path keeps the printed module, and it does not print for each request.\n */\nexport function emitModule(source: Expr | Envelope, options: ModuleOptions): Emitted {\n return keyedPrint(options, (keys) => settledPrint((starts) => printProgram(source, options, keys, starts)));\n}\n\n/** This function prints a program for one state of the keys, with the facts `starts`, for `emitModule`. */\nfunction printProgram(source: Expr | Envelope, options: ModuleOptions, keys: KeyPrint, starts: EmptyStarts): Emitted {\n const run = runOf(options);\n if (\"reason\" in run) return { ok: false, reason: run.reason };\n // DOC.ENTRY: a document gives its expression first, or the reason that it is not valid.\n const read = isDocument(source) ? fromDocument(source, options.domains) : { ok: true as const, value: source };\n if (!read.ok) return { ok: false, reason: read.error.message };\n const expr = read.value;\n // COMPILE.PLACES: the walks below take the time of the places, so the count comes first.\n const places = placesRead([expr]);\n if (places.error !== undefined) return { ok: false, reason: places.error };\n // EVAL.SHAPE: a module of an expression that is not valid has no use, so the printer gives the reason.\n const shape = shapeError(expr);\n if (shape !== undefined) return { ok: false, reason: shape };\n // COMPILE.MODULE.NESTING, LOOP.SIZE, STEP.MAX: a module refuses the programs that the interpreter refuses.\n const size = nestingError(expr) ?? sizeError(expr, options) ?? stepError(expr, options) ?? monotoneError(expr, options);\n if (size !== undefined) return { ok: false, reason: size };\n const plain = copiesOf(expr, [expr], starts, places.shares)[0] as Expr;\n const p = new Printer(plain, options, keys, starts);\n let value: Code;\n try {\n value = p.root(plain);\n p.finish();\n } catch (thrown) {\n return reasonOf(thrown);\n }\n // A list gives a vex.list (COMPILE.MODULE.LIST.RESULT), or a plain array (COMPILE.MODULE.LIST.PLAIN).\n const result = value.v.list === undefined ? value.v.code : p.runList(value.v, run.plain);\n const body = [\"const out = new Array(n);\", \"for (let o = 0; o < n; o++) {\", \" try {\", ...ind(ind(value.s)), ` out[o] = ${result};`, \" } catch {\", \" out[o] = VEX_ERROR;\", \" }\", \"}\", \"return out;\"];\n return printModule(p, options, run, body);\n}\n\n/** The budget of the stack of the search of a run of a sheet, as `STACK_BUDGET` of `SheetRun`. */\nconst SHEET_BUDGET = 3000;\n\n/** A formula of a sheet: its column, the position of its cell (undefined for the formula of the column) and its expression. */\ninterface Formula {\n readonly column: string;\n readonly key: number | undefined;\n readonly expr: Expr;\n}\n\n/** This function gives the words for a formula in a reason: the formula of a column, or of one cell. */\nconst formulaText = (f: Formula): string => (f.key === undefined ? `the formula of the column \"${f.column}\"` : `the formula of the cell \"${f.column}\" at \"${String(f.key)}\"`);\n\n/** This function gives the words for a kind in a reason. A list gives the kind of its items. */\nconst kindText = (k: Kind | undefined, l?: ListInfo): string => (l === undefined ? (k ?? \"that the printer does not know\") : `list of ${l.inner === undefined ? kindText(l.item) : kindText(undefined, l.inner)}`);\n\n/** This function gives the number of the levels of lists in the items of a list: 0 for a list of values. */\nconst depthOf = (l: ListInfo): number => (l.inner === undefined ? 0 : 1 + depthOf(l.inner));\n\n/** This function gives the facts of the lists of a column from the kind of the option `kinds` (COMPILE.MODULE.SHEET.LIST). */\nconst listOfKind = (k: ListKind, all = false): ListInfo => {\n const texts = all || k.texts === true;\n return typeof k.list === \"object\" ? { item: undefined, inner: listOfKind(k.list, all), texts } : { item: k.list, texts };\n};\n\n/** This function gives the kind of the items at the bottom of a list kind. */\nconst leafOf = (k: ListKind): Kind => (typeof k.list === \"object\" ? leafOf(k.list) : k.list);\n\n/**\n * This function gives the facts of the lists of a column from the list of its first formula. The other cells of the\n * column can have other formulas. Thus a list without items does not tell that each list of the column is empty.\n */\nconst columnList = (l: ListInfo): ListInfo => ({ item: l.item, inner: l.inner === undefined ? undefined : columnList(l.inner), texts: l.texts === true });\n\n/**\n * This function prints the formula columns of a sheet as a standalone ES module (COMPILE.MODULE.SHEET). The function of\n * the module takes the records and the variables, and the parents for a tree. It gives an object with an array for\n * each column: the result of the column at each key, or `VEX_ERROR`. The results are the results of `SheetRun`.\n *\n * The run fills the columns in the order of `SheetRun.fill`. A read of a finished cell is the read of an array. A read\n * of a cell that is not finished starts the search of `SheetRun`, with the same budget of the stack. Each cell on a\n * cycle of reads gives `VEX_ERROR`.\n */\nexport function emitSheetModule(columns: ReadonlyMap<string, Expr>, options: SheetModuleOptions): Emitted {\n return keyedPrint(options, (keys) => settledPrint((starts) => printSheet(columns, options, keys, starts)));\n}\n\n/** This function prints the columns of a sheet for one state of the keys, with the facts `starts`, for `emitSheetModule`. */\nfunction printSheet(columns: ReadonlyMap<string, Expr>, options: SheetModuleOptions, keyPrint: KeyPrint, starts: EmptyStarts): Emitted {\n const run = runOf(options);\n if (\"reason\" in run) return { ok: false, reason: run.reason };\n const budget = options.budget ?? SHEET_BUDGET;\n if (!Number.isSafeInteger(budget) || budget < 0) return { ok: false, reason: `the budget ${String(budget)} is not a whole number of 0 or more` };\n const cells: CellFormulas = options.cells ?? new Map();\n // A formula of a cell has a position as its key at the time of the build, and the keys of a run come later.\n if (options.keys === true && cells.size > 0) return { ok: false, reason: 'the option \"keys\" with formulas of cells' };\n // COMPILE.PLACES: the walks below take the time of the places, so the count comes first.\n const places = placesRead([...columns.values(), ...[...cells.values()].flatMap((own) => [...own.values()])]);\n if (places.error !== undefined) return { ok: false, reason: places.error };\n const names = [...new Set([...columns.keys(), ...cells.keys()])];\n const order = columnOrder(columns, cells);\n // The formulas in the order of the columns. A key of a cell that is not the text of a position is not a key of the\n // space, so no read finds its formula.\n const formulas: Formula[] = order.flatMap((column): Formula[] => {\n const own = [...(cells.get(column) ?? [])].filter(([k]) => /^(0|[1-9]\\d*)$/.test(k) && Number.isSafeInteger(Number(k)));\n const formula = columns.get(column);\n return [...(formula === undefined ? [] : [{ column, key: undefined, expr: formula }]), ...own.map(([k, expr]) => ({ column, key: Number(k), expr }))];\n });\n for (const f of formulas) {\n // EVAL.SHAPE: the printer gives the reason for an expression that is not valid.\n const shape = shapeError(f.expr);\n const reason = shape ?? nestingError(f.expr) ?? sizeError(f.expr, options) ?? stepError(f.expr, options) ?? monotoneError(f.expr, options);\n if (reason !== undefined) return { ok: false, reason: `${formulaText(f)}: ${reason}` };\n }\n const kinds = new Map<string, Kind | undefined>();\n const lists = new Map<string, ListInfo>();\n for (const [c, k] of Object.entries(options.kinds ?? {})) {\n kinds.set(c, typeof k === \"object\" ? undefined : k);\n if (typeof k === \"object\") lists.set(c, listOfKind(k));\n }\n const index = new Map(names.map((c, i) => [c, i]));\n // The memo of the printer covers each formula, so the formulas share their nodes of the memo.\n // A sheet whose reads all read finished cells needs no search: each cell is the value of its formula\n // (COMPILE.MODULE.SHEET.DIRECT). A sheet with formulas of cells always has the search.\n const direct = formulas.every((f) => f.key === undefined) && order.every((c) => readsFinished(columns, order, c, run.tree));\n const plain = copiesOf(columns, formulas.map((f) => f.expr), starts, places.shares);\n const p = new Printer(rec(Object.fromEntries(plain.map((expr, i) => [`f${String(i)}`, expr]))), options, keyPrint, starts, { columns: index, kinds, lists, direct });\n const fns: string[] = [];\n const decls: string[] = [];\n // The statements that put the value of each formula into the array of its column at the key `o`, for a direct fill.\n const blocks = new Map<string, readonly string[]>();\n try {\n for (const [i, f] of formulas.entries()) {\n const code = p.root(plain[i] as Expr);\n const { kind, list } = code.v;\n // The first formula of a column without a kind of the options gives the kind of the column. Each other formula\n // must give a value of that kind, or a list that fits the lists of the column (COMPILE.MODULE.SHEET.LIST).\n if (!kinds.has(f.column)) {\n kinds.set(f.column, kind);\n if (list !== undefined) lists.set(f.column, columnList(list));\n } else {\n const known = lists.get(f.column);\n if (kinds.get(f.column) !== kind || (known === undefined) !== (list === undefined) || (known !== undefined && !fits(known, list as ListInfo))) {\n throw new NotStandalone(`${formulaText(f)} gives a value of the kind ${kindText(kind, list)}, not of the kind ${kindText(kinds.get(f.column), known)} of its column`);\n }\n }\n // COMPILE.MODULE.ONCE: a direct fill has the code of each formula in its loop over the keys, with no function.\n if (direct) {\n const at = `D[${String(index.get(f.column))}][o]`;\n blocks.set(f.column, code.v.safe && code.s.length === 0 ? [`${at} = ${code.v.code};`] : [\"try {\", ...ind(code.s), ` ${at} = ${code.v.code};`, \"} catch {\", ` ${at} = E;`, \"}\"]);\n continue;\n }\n const fn = p.fresh(\"cf\");\n fns.push(fn);\n decls.push(...(code.v.safe && code.s.length === 0 ? [`const ${fn} = (o) => ${code.v.code};`] : [`const ${fn} = (o) => {`, \" try {\", ...ind(ind(code.s)), ` return ${code.v.code};`, \" } catch {\", \" return E;\", \" }\", \"};\"]));\n }\n p.finish();\n } catch (thrown) {\n return reasonOf(thrown);\n }\n p.use(direct ? \"DO\" : \"SH\");\n // A tree gives the keys in the order of a fill with the helper KO, once for each order.\n const orders = new Map<string, string>();\n const headOf = (c: string): string => {\n const { reverse, post, back } = keyOrderOf(readsOf(columns, cells, c).directions);\n if (!run.tree) return reverse ? \"for (let o = n - 1; o >= 0; o--)\" : \"for (let o = 0; o < n; o++)\";\n const args = `${p.use(\"KO\")}(H, RT, ${String(post)}, ${String(back)})`;\n let keys = orders.get(args);\n if (keys === undefined) {\n keys = p.fresh(\"K\");\n orders.set(args, keys);\n }\n return `for (const o of ${keys})`;\n };\n let fill: string[];\n if (direct) {\n // COMPILE.MODULE.ONCE: the columns that follow each other in the order share one loop over the keys when they have\n // the same order of the keys, and each read of a column of the loop reads a finished cell.\n const loops: { head: string; columns: string[] }[] = [];\n for (const c of order) {\n const head = headOf(c);\n const last = loops.at(-1);\n if (last?.head === head && readsFinished(columns, order, c, run.tree, new Set(last.columns))) last.columns.push(c);\n else loops.push({ head, columns: [c] });\n }\n fill = [];\n for (const { head, columns: cs } of loops) fill.push(`${head} {`, ...cs.flatMap((c) => ind(blocks.get(c) as readonly string[])), \"}\");\n } else {\n // The program of each column, and of each cell with its own formula, with its cost in estimated frames, as in SheetRun.\n const entry = (i: number): string => `[${fns[i] as string}, ${String(3 * nestingOf((formulas[i] as Formula).expr) + 16)}]`;\n const own = names.map((c) => {\n const at = formulas.flatMap((f, i) => (f.column === c && f.key !== undefined ? [`${String(f.key)}: ${entry(i)}`] : []));\n return at.length === 0 ? \"undefined\" : `{ ${at.join(\", \")} }`;\n });\n const cols = names.map((c) => {\n const i = formulas.findIndex((f) => f.column === c && f.key === undefined);\n return i < 0 ? \"undefined\" : entry(i);\n });\n decls.push(`const SS = SH(n, [${cols.join(\", \")}], [${own.join(\", \")}], ${String(budget)});`, `const ${READ_CELL} = SS.r;`);\n fill = order.map((c) => `${headOf(c)} SS.f(${String(index.get(c))}, o);`);\n }\n if (run.tree) p.treeParts.add(\"children\");\n // A column of lists gives a vex.list in each cell with a list (COMPILE.MODULE.LIST.RESULT), or a plain array\n // (COMPILE.MODULE.LIST.PLAIN).\n const resultOf = (c: string, read: string): string => {\n const l = lists.get(c);\n return l === undefined ? read : `${p.use(run.plain ? \"LCP\" : \"LC\")}(${read}, ${String(depthOf(l))})`;\n };\n const body = [\n ...(direct ? [`const D = [${names.map(() => \"new Array(n)\").join(\", \")}];`] : decls),\n ...[...orders].map(([args, keys]) => `const ${keys} = ${args};`),\n ...fill,\n `return { ${names.map((c, i) => `${JSON.stringify(c)}: ${resultOf(c, direct ? `DO(D[${String(i)}])` : `SS.o(${String(i)})`)}`).join(\", \")} };`,\n ];\n return printModule(p, options, run, body);\n}\n"],"mappings":";;;;;;;;;;;;AAqBA,MAAM,WAAW;;AAGjB,SAAS,W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,SAAS;EACT,SAAS;EAET,UAAU;EAIV,UAAU;GACR;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF,CAAC,CAAC,KAAK,IAAI;EACX,SAAS;EACT,SAAS;EACT,SAAS;EAET,SAAS;EACT,SAAS;EAKT,SAAS;EACT,UAAU;GACR;GACA;GACA;GACA;GACA;GACA;EACF,CAAC,CAAC,KAAK,IAAI;EAEX,UAAU;GACR;GACA;GACA;GACA;GACA;GACA;EACF,CAAC,CAAC,KAAK,IAAI;EACX,UAAU;EAIV,UAAU;GACR;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF,CAAC,CAAC,KAAK,IAAI;EACX,UAAU;GACR;GACA;GACA;GACA;GACA;EACF,CAAC,CAAC,KAAK,IAAI;EAEX,UAAU;EACV,UAAU;EAKV,UAAU;GACR;GACA;GACA;GACA;GACA;GACA;GACA;EACF,CAAC,CAAC,KAAK,IAAI;EACX,UAAU;GACR;GACA;GACA;GACA;GACA;GACA;EACF,CAAC,CAAC,KAAK,IAAI;EAGX,UAAU;EACV,UAAU;CACZ;AACF;;AAGA,SAAS,eAAe;CACtB,OAAO;EAIL,UAAU;GACR;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF,CAAC,CAAC,KAAK,IAAI;EAIX,UAAU;GACR;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF,CAAC,CAAC,KAAK,IAAI;EAIX,UAAU;EACV,UAAU;EAOV,UAAU;EAIV,UAAU;EACV,UAAU;EACV,UAAU;GACR;GACA;GACA;GACA;GACA;EACF,CAAC,CAAC,KAAK,IAAI;EACX,UAAU;GACR;GACA;GACA;GACA;GACA;EACF,CAAC,CAAC,KAAK,IAAI;EAKX,UAAU;GACR;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF,CAAC,CAAC,KAAK,IAAI;EAEX,UAAU;GACR;GACA;GACA;GACA;GACA;GACA;EACF,CAAC,CAAC,KAAK,IAAI;EAGX,UAAU;GACR;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF,CAAC,CAAC,KAAK,IAAI;EAEX,UAAU;CACZ;AACF;;AAGA,SAAS,eAAe;CACtB,OAAO;EAGL,UAAU;GACR;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF,CAAC,CAAC,KAAK,IAAI;EAEX,UAAU;GACR;GACA;GACA;GACA;GACA;GACA;EACF,CAAC,CAAC,KAAK,IAAI;EAEX,UAAU;GACR;GACA;GACA;GACA;GACA;GACA;EACF,CAAC,CAAC,KAAK,IAAI;EAGX,UAAU;GACR;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF,CAAC,CAAC,KAAK,IAAI;EACX,UAAU;EACV,UAAU;EACV,UAAU;EAEV,UAAU;EAGV,UAAU;GACR;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF,CAAC,CAAC,KAAK,IAAI;EAEX,UAAU;EAEV,UAAU;EAKV,UAAU;EAGV,UAAU;EAGV,UAAU;EAGV,UAAU;EAKV,UAAU;GACR;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF,CAAC,CAAC,KAAK,IAAI;EAIX,WAAW;GACT;GACA;GACA;GACA;GACA;EACF,CAAC,CAAC,KAAK,IAAI;CACb;AACF;;AAGA,SAAS,eAAe;CACtB,OAAO;EACL,WAAW;GACT;GACA;GACA;GACA;GACA;GACA;EACF,CAAC,CAAC,KAAK,IAAI;EAMX,WAAW;GACT;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF,CAAC,CAAC,KAAK,IAAI;EAIX,WAAW;GACT;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF,CAAC,CAAC,KAAK,IAAI;EACX,WAAW;EACX,WAAW;EAEX,WAAW;EACX,WAAW;EAGX,UAAU;EACV,WAAW;EACX,WAAW;GACT;GACA;GACA;GACA;GACA;EACF,CAAC,CAAC,KAAK,IAAI;EACX,WAAW;EACX,WAAW;GACT;GACA;GACA;GACA;GACA;EACF,CAAC,CAAC,KAAK,IAAI;EACX,WAAW;EACX,WAAW;GACT;GACA;GACA;GACA;GACA;GACA;EACF,CAAC,CAAC,KAAK,IAAI;EACX,WAAW;EACX,WAAW;EACX,WAAW;EACX,WAAW;EAEX,WAAW;GACT;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF,CAAC,CAAC,KAAK,IAAI;EAEX,UAAU;EAEV,WAAW;CACb;AACF;;AAGA,SAAS,eAAe;CACtB,OAAO;EACL,UAAU;GACR;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA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