@mark1russell7/strategy-space 0.0.0-stage → 0.0.2

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"terms.js","names":[],"sources":["../src/terms.ts"],"sourcesContent":["// The combinators of a strategy space (`docs/OPERATORS.md`): terms over configs, and the count of the terms to a depth.\nimport { canonicalJson } from \"@mark1russell7/rigor-generators\";\nimport type { ClaimBreak } from \"./claim.ts\";\nimport { checkConfig, spaceSize, type ShapeFilter, type StrategyConfig, type StrategySpace } from \"./strategy-space.ts\";\n\n/** The declaration of a combinator: a term with a range of arguments. */\nexport interface Combinator {\n readonly name: string;\n /** The smallest count of the arguments, a whole number of 1 or more. */\n readonly min: number;\n /** The largest count of the arguments, a whole number of `min` or more. */\n readonly max: number;\n /** With `true`, the order of the arguments changes the term. */\n readonly ordered: boolean;\n /** With `true`, the arguments of a term are all different. */\n readonly distinct: boolean;\n /**\n * The spec of a term of this combinator. With no value, a term has no spec.\n * `object`: the term has a spec object, for example the rule that picks the best result of a portfolio.\n * `limits`: the spec is `{ measure, limits }`. The limits are increasing numbers, one fewer than the arguments.\n */\n readonly spec?: \"object\" | \"limits\";\n /** The text that tells what the term does with its arguments. */\n readonly summary: string;\n}\n\n/**\n * The combinators of the first format. A term of `product` takes a pack config and a route config, and a joint space joins them.\n * A tie of a `portfolio` goes to the first argument in the order of `canonicalTerm`. So the order of the arguments does not change the result.\n */\nexport const COMBINATORS: readonly Combinator[] = /* @__PURE__ */ Object.freeze([\n {\n name: \"portfolio\",\n min: 2,\n max: 16,\n ordered: false,\n distinct: true,\n spec: \"object\",\n summary: \"It gives the input to each argument, and keeps the best result by the pick rule of its spec. A tie goes to the first argument in the canonical order.\",\n },\n { name: \"sequence\", min: 2, max: 2, ordered: true, distinct: false, summary: \"It gives the result of the first argument to the second argument.\" },\n { name: \"fallback\", min: 2, max: 2, ordered: true, distinct: true, summary: \"It gives the result of the first argument. When the first argument refuses the input, it gives the result of the second argument.\" },\n {\n name: \"dispatch\",\n min: 2,\n max: 16,\n ordered: true,\n distinct: false,\n spec: \"limits\",\n summary: \"It reads one measure of the input. At or below the first limit, it gives the result of the first argument, and so on up the limits.\",\n },\n]);\n\n/**\n * The starts of the keys that a spec can not have at any depth, with case ignored, for example `budgetMs` or `timeoutMs`.\n * A time budget makes the result change with the speed of the computer. A key that ends with `work`, for example `budgetWork`, is a count of steps, so a spec can have it.\n */\nexport const BUDGET_KEYS: readonly string[] = /* @__PURE__ */ Object.freeze([\"budget\", \"deadline\", \"timeout\"]);\n\n/**\n * This function gives the index of the argument of a `dispatch` term for a value of its measure. A band includes its upper limit.\n * So the value `limits[i]` goes to the argument `i`, and a value above the last limit goes to the last argument.\n */\nexport function dispatchIndex(limits: readonly number[], value: number): number {\n if (Number.isNaN(value)) throw new RangeError(\"The value of the measure is NaN.\");\n const i = limits.findIndex((limit) => value <= limit);\n return i === -1 ? limits.length : i;\n}\n\n/** A term: a config of the space, or a combinator with its arguments. */\nexport type StrategyTerm =\n | { readonly config: StrategyConfig }\n | { readonly combinator: string; readonly args: readonly StrategyTerm[]; readonly spec?: Readonly<Record<string, unknown>> };\n\n/** The options of `countSpace`. */\nexport interface CountOptions extends ShapeFilter {\n /** The largest depth of a term. A config has the depth 0. A term has the depth 1 more than its deepest argument. */\n readonly depth: number;\n /** The count of the levels of each numeric param of the space. */\n readonly levels: number;\n /** The combinators. The default is `COMBINATORS`. */\n readonly combinators?: readonly Combinator[];\n /**\n * The count of the specs of a term of each combinator, by its name. A list gives a count for each count of arguments, from `min` to `max`.\n * The default is 1. A `dispatch` term with `m` arguments has the count of its measures times the count of the lists of `m - 1` limits.\n */\n readonly specs?: Readonly<Record<string, bigint | readonly bigint[]>>;\n}\n\n/** The count of the terms of a space. */\nexport interface TermCount {\n /** The count of the configs without a meta option, the terms of the depth 0. */\n readonly base: bigint;\n /** The item `k` is the count of the terms of a depth of `k` or less. */\n readonly upTo: readonly bigint[];\n /** The count of the terms of a depth of `depth` or less. */\n readonly total: bigint;\n}\n\n/** This function throws a `RangeError` for a value that is not a whole number of `min` or more. */\nfunction assertWhole(value: number, name: string, min: number): void {\n if (!Number.isInteger(value) || value < min) throw new RangeError(`The ${name} ${value} is not a whole number of ${min} or more.`);\n}\n\n/** This function gives the breaks of a list of combinators. The claims are `combinator`, `duplicate` and `arity`. */\nexport function checkCombinators(combinators: readonly Combinator[]): ClaimBreak[] {\n const out: ClaimBreak[] = [];\n const names = new Set<string>();\n for (const c of combinators) {\n if (typeof c.name !== \"string\" || c.name === \"\") out.push({ claim: \"combinator\", detail: \"a combinator has no name\", inputs: [] });\n else if (names.has(c.name)) out.push({ claim: \"duplicate\", detail: `the list has the combinator ${c.name} two times`, inputs: [c.name] });\n names.add(c.name);\n if (!Number.isInteger(c.min) || c.min < 1 || !Number.isInteger(c.max) || c.max < c.min)\n out.push({ claim: \"arity\", detail: `the combinator ${c.name} has the arity ${c.min} to ${c.max}, not whole numbers with 1 <= min <= max`, inputs: [c.name] });\n }\n return out;\n}\n\n/** This function gives the count of the specs of one combinator for each count of arguments, from `min` to `max`. */\nfunction specCounts(c: Combinator, specs: CountOptions[\"specs\"]): bigint[] {\n const given = specs?.[c.name];\n const width = c.max - c.min + 1;\n const counts = given === undefined ? Array<bigint>(width).fill(1n) : typeof given === \"bigint\" ? Array<bigint>(width).fill(given) : [...given];\n if (counts.length !== width || counts.some((x) => typeof x !== \"bigint\" || x < 0n))\n throw new RangeError(`The specs of ${c.name} are not ${width} whole numbers of 0 or more.`);\n return counts;\n}\n\n/** This function gives the count of the terms of one combinator over a pool of `n` terms: the argument lists times the specs. */\nfunction argumentLists(c: Combinator, n: bigint, specs: readonly bigint[]): bigint {\n let sum = 0n;\n for (let m = c.min; m <= c.max; m++) {\n const k = BigInt(m);\n let lists: bigint;\n if (c.ordered && c.distinct) lists = fallingFactorial(n, k);\n else if (c.ordered) lists = n ** k;\n else if (c.distinct) lists = fallingFactorial(n, k) / factorial(k);\n else lists = fallingFactorial(n + k - 1n, k) / factorial(k);\n sum += lists * specs[m - c.min]!;\n }\n return sum;\n}\n\nfunction fallingFactorial(n: bigint, k: bigint): bigint {\n if (k > n) return 0n;\n let out = 1n;\n for (let i = 0n; i < k; i++) out *= n - i;\n return out;\n}\n\nfunction factorial(k: bigint): bigint {\n let out = 1n;\n for (let i = 2n; i <= k; i++) out *= i;\n return out;\n}\n\n/**\n * This function gives the count of the terms of a space to a depth. The base is the count of the configs without a meta option.\n * The terms of a depth of `k - 1` or less give the argument lists of each combinator. Each list counts once for each spec.\n * The count of a depth of `k` or less is the base plus these terms. Two terms with a different tree count as two terms, also when they give the same layout.\n */\nexport function countSpace(space: StrategySpace, options: CountOptions): TermCount {\n assertWhole(options.depth, \"depth\", 0);\n const combinators = options.combinators ?? COMBINATORS;\n const breaks = checkCombinators(combinators);\n if (breaks.length > 0) throw new RangeError(`The combinators are not good: ${breaks.map((b) => b.detail).join(\"; \")}.`);\n // The meta count is not part of a term count, so maxMeta 0 stops it early.\n const filter = { ...(options.shapes === undefined ? {} : { shapes: options.shapes }), ...(options.kinds === undefined ? {} : { kinds: options.kinds }) };\n const base = spaceSize(space, { levels: options.levels, maxMeta: 0n, ...filter }).base;\n const specs = combinators.map((c) => specCounts(c, options.specs));\n const upTo: bigint[] = [base];\n for (let k = 1; k <= options.depth; k++) {\n const pool = upTo[k - 1]!;\n upTo.push(combinators.reduce((sum, c, i) => sum + argumentLists(c, pool, specs[i]!), base));\n }\n return { base, upTo, total: upTo[options.depth]! };\n}\n\n/** This function gives the depth of a term. A config has the depth 0. */\nexport function termDepth(term: StrategyTerm): number {\n return \"config\" in term ? 0 : 1 + Math.max(0, ...term.args.map(termDepth));\n}\n\n/** This function gives the path of the first key that starts with a key of `BUDGET_KEYS`, or `undefined` when the value has none. */\nfunction budgetKey(value: unknown, path: string): string | undefined {\n if (value === null || typeof value !== \"object\") return undefined;\n for (const [key, inner] of Object.entries(value)) {\n const at = path === \"\" ? key : `${path}.${key}`;\n const lower = key.toLowerCase();\n if (BUDGET_KEYS.some((start) => lower.startsWith(start)) && !lower.endsWith(\"work\")) return at;\n const found = budgetKey(inner, at);\n if (found !== undefined) return found;\n }\n return undefined;\n}\n\n/** This function gives the breaks of the spec of a term of the combinator `c`. */\nfunction specBreaks(c: Combinator, t: { readonly args: readonly StrategyTerm[]; readonly spec?: unknown }, at: string): string[] {\n const spec = t.spec;\n const isObject = spec !== null && typeof spec === \"object\" && !Array.isArray(spec);\n if (c.spec === undefined) return spec === undefined ? [] : [`the term ${c.name} at ${at} has a spec, but ${c.name} takes no spec`];\n if (!isObject) return [`the term ${c.name} at ${at} has no spec object`];\n if (c.spec === \"object\") return [];\n const { measure, limits } = spec as { measure?: unknown; limits?: unknown };\n const out: string[] = [];\n if (typeof measure !== \"string\" || measure === \"\") out.push(`the term ${c.name} at ${at} has no measure`);\n const good =\n Array.isArray(limits) &&\n limits.length === t.args.length - 1 &&\n limits.every((x, i) => typeof x === \"number\" && Number.isFinite(x) && (i === 0 || x > (limits[i - 1] as number)));\n if (!good) out.push(`the term ${c.name} at ${at} needs ${t.args.length - 1} increasing finite limits`);\n return out;\n}\n\n/**\n * This function gives the breaks of a term. The claims are the claims of `checkConfig` for each config, and `combinator`, `arity`, `distinct`, `spec` and `budget`.\n * The `inputs` of a break have the path of the term, for example `0.1` for the second argument of the first argument. The root has the path `\"\"`.\n */\nexport function checkTerm(space: StrategySpace, term: StrategyTerm, combinators: readonly Combinator[] = COMBINATORS): ClaimBreak[] {\n const out: ClaimBreak[] = [];\n const walk = (t: StrategyTerm, path: string): void => {\n const at = path === \"\" ? \"the root\" : path;\n if (\"config\" in t) {\n for (const b of checkConfig(space, t.config)) out.push({ claim: b.claim, detail: `the config at ${at}: ${b.detail}`, inputs: [path] });\n return;\n }\n const c = combinators.find((x) => x.name === t.combinator);\n if (c === undefined) out.push({ claim: \"combinator\", detail: `the term at ${at} has the unknown combinator ${JSON.stringify(t.combinator)}`, inputs: [path] });\n else if (t.args.length < c.min || t.args.length > c.max)\n out.push({ claim: \"arity\", detail: `the term ${c.name} at ${at} has ${t.args.length} arguments, not ${c.min} to ${c.max}`, inputs: [path] });\n if (c !== undefined) for (const detail of specBreaks(c, t, at)) out.push({ claim: \"spec\", detail, inputs: [path] });\n const budget = budgetKey(t.spec, \"\");\n if (budget !== undefined) out.push({ claim: \"budget\", detail: `the spec at ${at} has the time budget ${budget}, so the term is not deterministic`, inputs: [path] });\n if (c?.distinct === true) {\n const keys = t.args.map((a) => canonicalJson(a, { form: \"json\" }));\n if (new Set(keys).size !== keys.length) out.push({ claim: \"distinct\", detail: `the term ${c.name} at ${at} has the same argument two times`, inputs: [path] });\n }\n t.args.forEach((a, i) => walk(a, path === \"\" ? String(i) : `${path}.${i}`));\n };\n walk(term, \"\");\n return out;\n}\n\n/**\n * This function gives the canonical form of a term. It sorts the arguments of each term of an unordered combinator by their canonical JSON.\n * Two terms that differ only in the order of such arguments give the same form. A tie of a `portfolio` goes to the first argument of this form.\n */\nexport function canonicalTerm(term: StrategyTerm, combinators: readonly Combinator[] = COMBINATORS): StrategyTerm {\n if (\"config\" in term) return term;\n const args = term.args.map((a) => canonicalTerm(a, combinators));\n const c = combinators.find((x) => x.name === term.combinator);\n if (c !== undefined && !c.ordered) {\n const keyed = args.map((a) => [canonicalJson(a, { form: \"json\" }), a] as const);\n keyed.sort(([x], [y]) => (x < y ? -1 : x > y ? 1 : 0));\n return { ...term, args: keyed.map(([, a]) => a) };\n }\n return { ...term, args };\n}\n"],"mappings":";;;;;;;AA8BA,MAAa,cAAqD,uBAAO,OAAO;CAC9E;EACE,MAAM;EACN,KAAK;EACL,KAAK;EACL,SAAS;EACT,UAAU;EACV,MAAM;EACN,SAAS;CACX;CACA;EAAE,MAAM;EAAY,KAAK;EAAG,KAAK;EAAG,SAAS;EAAM,UAAU;EAAO,SAAS;CAAoE;CACjJ;EAAE,MAAM;EAAY,KAAK;EAAG,KAAK;EAAG,SAAS;EAAM,UAAU;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G,KAAK,GAAG,GAAG,CAAC;CAC5E;CACA,KAAK,MAAM,EAAE;CACb,OAAO;AACT;;;;;AAMA,SAAgB,cAAc,MAAoB,cAAqC,aAA2B;CAChH,IAAI,YAAY,MAAM,OAAO;CAC7B,MAAM,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,GAAG,WAAW,CAAC;CAC/D,MAAM,IAAI,YAAY,MAAM,MAAM,EAAE,SAAS,KAAK,UAAU;CAC5D,IAAI,MAAM,KAAA,KAAa,CAAC,EAAE,SAAS;EACjC,MAAM,QAAQ,KAAK,KAAK,MAAM,CAAC,cAAc,GAAG,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,CAAU;EAC9E,MAAM,MAAM,CAAC,IAAI,CAAC,OAAQ,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,CAAE;EACrD,OAAO;GAAE,GAAG;GAAM,MAAM,MAAM,KAAK,GAAG,OAAO,CAAC;EAAE;CAClD;CACA,OAAO;EAAE,GAAG;EAAM;CAAK;AACzB"}
package/package.json CHANGED
@@ -1,6 +1,63 @@
1
1
  {
2
+ "$schema": "https://json.schemastore.org/package",
2
3
  "name": "@mark1russell7/strategy-space",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
4
+ "version": "0.0.2",
5
+ "description": "Layout strategies as data: the stages, options and parameters of a space, its checks, the id of a config, the count of the space, grids and seeded samples.",
6
+ "keywords": [
7
+ "strategy-space",
8
+ "layout",
9
+ "configuration-space",
10
+ "enumeration",
11
+ "sampling",
12
+ "search-space",
13
+ "deterministic"
14
+ ],
15
+ "homepage": "https://github.com/mark1russell7/strategy-space/tree/main/packages/strategy-space#readme",
16
+ "bugs": {
17
+ "url": "https://github.com/mark1russell7/strategy-space/issues"
18
+ },
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git+https://github.com/mark1russell7/strategy-space.git",
22
+ "directory": "packages/strategy-space"
23
+ },
24
+ "license": "MIT",
25
+ "author": "Mark Russell (https://github.com/mark1russell7)",
26
+ "type": "module",
27
+ "sideEffects": false,
28
+ "main": "./build/index.js",
29
+ "files": [
30
+ "build"
31
+ ],
32
+ "publishConfig": {
33
+ "access": "public"
34
+ },
35
+ "engines": {
36
+ "node": ">=22"
37
+ },
38
+ "dependencies": {
39
+ "@mark1russell7/rigor-generators": "^0.1.7"
40
+ },
41
+ "devDependencies": {
42
+ "@mark1russell7/cue": "^2.0.0",
43
+ "@types/node": "^26.6.5",
44
+ "esbuild": "^0.28.2",
45
+ "tsdown": "^0.23.1",
46
+ "typescript": "^7.0.2",
47
+ "vitest": "^5.0.3"
48
+ },
49
+ "scripts": {
50
+ "build": "tsdown",
51
+ "test": "vitest run",
52
+ "test:watch": "vitest",
53
+ "typecheck": "tsc -p tsconfig.json && tsc -p tsconfig.test.json"
54
+ },
55
+ "types": "./build/index.d.ts",
56
+ "exports": {
57
+ ".": {
58
+ "types": "./build/index.d.ts",
59
+ "import": "./build/index.js"
60
+ },
61
+ "./package.json": "./package.json"
62
+ }
6
63
  }